/* ============================================================
   THE DATUM STANDARD · Advisor Hub
   Palette, type roles, and apparatus rules per the brand system.
   ============================================================ */

:root {
  /* Palette */
  --datum-black: #17191a;
  --carbon: #34383a;
  --warm-stone: #d8d2c7;
  --paper: #f5f2eb;
  --mineral: #547067;
  --cool-gray: #858b8b; /* supporting text on Datum Black only */
  --cool-gray-light: #555b5b; /* supporting text on Paper and Warm Stone */

  --rule: rgba(23, 25, 26, 0.16);
  --rule-strong: rgba(23, 25, 26, 0.32);
  --rule-invert: rgba(245, 242, 235, 0.2);

  /* Type roles */
  --font-ui: 'Instrument Sans', 'Helvetica Neue', sans-serif;
  --font-doctrine: 'Source Serif 4', Georgia, serif;
  --font-apparatus: 'JetBrains Mono', ui-monospace, monospace;

  /* Scale */
  --text-hero: clamp(2.5rem, 5vw, 4.25rem);
  --text-2xl: clamp(2rem, 4vw, 3.25rem);
  --text-xl: clamp(1.5rem, 2.4vw, 2.125rem);
  --text-lg: 1.25rem;
  --text-base: 1.0625rem;
  --text-sm: 0.9375rem;
  --text-xs: 0.8125rem;
  --text-micro: 0.6875rem;

  /* Rhythm */
  --gutter: clamp(1.5rem, 5vw, 5rem);
  --measure: 62ch;
  --max: 1360px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--datum-black);
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg {
  max-width: 100%;
}

/* Trademark marks never inherit heading size. */
sup {
  font-size: 0.42em;
  vertical-align: super;
  line-height: 0;
  font-weight: 400;
  color: var(--cool-gray-light);
  margin-left: 0.5px;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--mineral);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--datum-black);
  color: var(--paper);
  padding: 0.75rem 1.25rem;
  z-index: 100;
  font-size: var(--text-sm);
}
.skip:focus {
  left: 0;
}

/* ---------- Apparatus primitives ---------- */

.apparatus {
  font-family: var(--font-apparatus);
  font-size: var(--text-micro);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cool-gray-light);
  font-weight: 500;
}

.apparatus .idx {
  color: var(--mineral);
}

/* A hairline reference line with a datum point at its origin. */
.refline {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin: 0 0 1.5rem;
}
.refline::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mineral);
  flex: none;
}
.refline::after {
  content: '';
  height: 1px;
  flex: 1;
  background: var(--rule);
}

.doctrine {
  font-family: var(--font-doctrine);
  font-size: clamp(1.375rem, 2.2vw, 1.875rem);
  line-height: 1.42;
  font-weight: 400;
  letter-spacing: -0.008em;
}

/* ---------- Shell ---------- */

.wrap {
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

section {
  border-top: 1px solid var(--rule);
}

.pad-lg {
  padding-block: clamp(4.5rem, 9vw, 8.5rem);
}
.pad-md {
  padding-block: clamp(3.5rem, 6vw, 6rem);
}
.pad-sm {
  padding-block: clamp(2.5rem, 4vw, 4rem);
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 74px;
}

.lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  padding-block: 0.5rem;
}
.lockup img {
  height: 40px;
  width: auto;
  flex: none;
  display: block;
}
.footer-lockup {
  height: 72px;
  width: auto;
  display: block;
}
.lockup-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.lockup-text b {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.lockup-text span {
  font-family: var(--font-apparatus);
  font-size: 0.5625rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cool-gray-light);
  margin-top: 5px;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2vw, 2rem);
}
.nav a {
  font-size: var(--text-sm);
  text-decoration: none;
  color: var(--carbon);
  padding: 0.5rem 0;
  position: relative;
  transition: color 0.2s var(--ease);
}
.nav a:hover {
  color: var(--datum-black);
}
.nav a[aria-current='page'] {
  color: var(--datum-black);
}
.nav a[aria-current='page']::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--mineral);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--rule-strong);
  color: var(--datum-black);
  font-family: var(--font-apparatus);
  font-size: var(--text-micro);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.6rem 0.9rem;
  cursor: pointer;
  /* Reserve the wider label's width so toggling Menu to Close does not shift the
     lockup. Measured: Menu 64.95px, Close 73.48px. */
  min-width: 4.6rem;
  text-align: center;
  min-height: 44px;
}

@media (max-width: 860px) {
  .nav-toggle {
    display: block;
  }
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    padding: 0.5rem var(--gutter) 1.25rem;
  }
  .nav.open {
    display: flex;
  }
  .nav a {
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--rule);
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  .nav a[aria-current='page']::after {
    display: none;
  }
  .nav a[aria-current='page'] {
    color: var(--mineral);
  }
  .site-header .wrap {
    position: relative;
  }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 46px;
  padding: 0.7rem 1.4rem;
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  border: 1px solid var(--datum-black);
  background: var(--datum-black);
  color: var(--paper);
  transition:
    background 0.2s var(--ease),
    color 0.2s var(--ease),
    border-color 0.2s var(--ease);
}
.btn:hover {
  background: var(--carbon);
  border-color: var(--carbon);
}
.btn--ghost {
  background: transparent;
  color: var(--datum-black);
  border-color: var(--rule-strong);
}
.btn--ghost:hover {
  background: transparent;
  border-color: var(--datum-black);
  color: var(--datum-black);
}
.btn--invert {
  background: var(--paper);
  color: var(--datum-black);
  border-color: var(--paper);
}
.btn--invert:hover {
  background: var(--warm-stone);
  border-color: var(--warm-stone);
  color: var(--datum-black);
}
.btn .arw {
  color: var(--mineral);
  font-family: var(--font-apparatus);
}
.btn--invert .arw {
  color: var(--mineral);
}

/* ---------- Hero ---------- */

.hero {
  border-top: none;
  padding-block: clamp(4rem, 9vw, 8rem) clamp(3rem, 6vw, 5.5rem);
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: end;
}

h1 {
  font-size: var(--text-hero);
  line-height: 0.96;
  letter-spacing: -0.032em;
  font-weight: 500;
  margin: 0.4rem 0 0;
  text-wrap: balance;
}

.hero h1 em {
  font-style: normal;
  display: block;
  color: var(--carbon);
}

.hero-sub {
  margin: 1.75rem 0 0;
  max-width: 46ch;
  color: var(--carbon);
  font-size: var(--text-lg);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2.25rem;
}

.hero-mark {
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  padding-bottom: 0.5rem;
}
.hero-mark img {
  width: auto;
  height: min(46vw, 300px);
}

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .hero-mark {
    order: -1;
    justify-content: flex-start;
  }
  .hero-mark img {
    height: 190px;
  }
}

/* ---------- Measured strip (four-stage bar) ---------- */

.strip {
  background: var(--datum-black);
  color: var(--paper);
  border-top: none;
}
.strip .apparatus {
  color: rgba(245, 242, 235, 0.55);
}
.strip-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.strip-cell {
  padding: clamp(1.75rem, 3vw, 2.75rem) clamp(1rem, 2vw, 2rem) clamp(1.75rem, 3vw, 2.5rem) 0;
  border-left: 1px solid var(--rule-invert);
  padding-left: clamp(1rem, 2vw, 2rem);
  position: relative;
}
.strip-cell:first-child {
  border-left: none;
  padding-left: 0;
}
.strip-cell h3 {
  font-size: var(--text-lg);
  font-weight: 500;
  letter-spacing: -0.012em;
  margin: 0.85rem 0 0.5rem;
}
.strip-cell p {
  margin: 0;
  font-size: var(--text-sm);
  color: rgba(245, 242, 235, 0.72);
  line-height: 1.55;
}

@media (max-width: 900px) {
  .strip-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .strip-cell:nth-child(3) {
    border-left: none;
    padding-left: 0;
  }
  .strip-cell:nth-child(3),
  .strip-cell:nth-child(4) {
    border-top: 1px solid var(--rule-invert);
  }
}
@media (max-width: 560px) {
  .strip-grid {
    grid-template-columns: 1fr;
  }
  .strip-cell {
    border-left: none;
    padding-left: 0;
    border-top: 1px solid var(--rule-invert);
  }
  .strip-cell:first-child {
    border-top: none;
  }
}

/* ---------- Section heads ---------- */

.sec-head {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.3fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: start;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}
.sec-head h2 {
  font-size: var(--text-2xl);
  line-height: 1.05;
  letter-spacing: -0.026em;
  font-weight: 500;
  margin: 0;
  text-wrap: balance;
}
.sec-head p {
  margin: 0;
  color: var(--carbon);
  max-width: 54ch;
}
@media (max-width: 820px) {
  .sec-head {
    grid-template-columns: 1fr;
  }
}

/* ---------- Arc tables ---------- */

.arc {
  display: grid;
  grid-template-columns: minmax(0, 240px) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  padding-block: clamp(2rem, 4vw, 3rem);
  border-top: 1px solid var(--rule);
}
.arc:first-of-type {
  border-top: 1px solid var(--rule-strong);
}
.arc-label h3 {
  font-size: var(--text-xl);
  font-weight: 500;
  letter-spacing: -0.018em;
  margin: 0.5rem 0 0.5rem;
  line-height: 1.15;
}
.arc-label p {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--cool-gray-light);
}

.stage-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}
.stage {
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr);
  gap: 0 1rem;
  padding: 1.15rem 0;
  border-top: 1px solid var(--rule);
  align-items: baseline;
}
.stage:first-child {
  border-top: none;
  padding-top: 0;
}
.stage-num {
  font-family: var(--font-apparatus);
  font-size: var(--text-xs);
  color: var(--mineral);
  letter-spacing: 0.08em;
  font-weight: 500;
}
.stage h4 {
  margin: 0 0 0.3rem;
  font-size: var(--text-lg);
  font-weight: 500;
  letter-spacing: -0.012em;
}
.stage p {
  margin: 0;
  color: var(--carbon);
  font-size: var(--text-sm);
  max-width: 64ch;
}
.stage sup {
  font-size: 0.58em;
  vertical-align: super;
  color: var(--cool-gray-light);
  margin-left: 1px;
}

@media (max-width: 820px) {
  .arc {
    grid-template-columns: 1fr;
  }
  .stage {
    grid-template-columns: 2.75rem minmax(0, 1fr);
  }
}

/* ---------- Certification panel ---------- */

.panel {
  background: var(--warm-stone);
  border-top: none;
}
.panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}
.panel h2 {
  font-size: var(--text-2xl);
  line-height: 1.06;
  letter-spacing: -0.026em;
  font-weight: 500;
  margin: 0.5rem 0 1.25rem;
  text-wrap: balance;
}
.panel p {
  color: var(--carbon);
  max-width: 52ch;
}
.panel .apparatus {
  color: var(--cool-gray-light);
}

.gauge {
  border: 1px solid rgba(23, 25, 26, 0.22);
  background: var(--paper);
  padding: clamp(1.5rem, 3vw, 2.25rem);
}
.gauge-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--rule);
  font-size: var(--text-sm);
}
.gauge-row:first-of-type {
  border-top: none;
  padding-top: 0;
}
.gauge-row span:last-child {
  font-family: var(--font-apparatus);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  color: var(--cool-gray-light);
  white-space: nowrap;
}
.gauge-row.is-set span:last-child {
  color: var(--mineral);
}

@media (max-width: 860px) {
  .panel-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Tool cards ---------- */

.tools {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}
.tool {
  grid-column: span 4;
  background: var(--paper);
  padding: clamp(1.5rem, 2.5vw, 2.25rem);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  text-decoration: none;
  transition: background 0.2s var(--ease);
}
a.tool:hover {
  background: var(--warm-stone);
}
.tool--wide {
  grid-column: span 6;
}
.tool h3 {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 500;
  letter-spacing: -0.012em;
}
.tool p {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--carbon);
}
.tool-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: auto;
  padding-top: 0.85rem;
  border-top: 1px solid var(--rule);
}
.status {
  font-family: var(--font-apparatus);
  font-size: var(--text-micro);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cool-gray-light);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cool-gray);
  flex: none;
}
.status--live::before {
  background: var(--mineral);
}
.status--live {
  color: var(--mineral);
}

@media (max-width: 980px) {
  .tool,
  .tool--wide {
    grid-column: span 6;
  }
}
@media (max-width: 640px) {
  .tool,
  .tool--wide {
    grid-column: span 12;
  }
}

/* ---------- Doctrine band ---------- */

.band {
  background: var(--datum-black);
  color: var(--paper);
  border-top: none;
}
/* Supporting text inside a dark band reverts to the dark-ground gray. The
   light-ground value measures 2.55:1 on Datum Black and fails AA. */
.band sup,
.band .apparatus,
.band .form-note,
.band .deflist dt {
  color: var(--cool-gray);
}
.band blockquote {
  margin: 0;
  max-width: 26ch;
}
.band-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}
.band .doctrine {
  font-size: clamp(1.75rem, 3.4vw, 2.75rem);
  line-height: 1.26;
}
.band p {
  color: rgba(245, 242, 235, 0.74);
  max-width: 48ch;
}
.band .apparatus {
  color: rgba(245, 242, 235, 0.5);
}
.band .refline::after {
  background: var(--rule-invert);
}
@media (max-width: 820px) {
  .band-grid {
    grid-template-columns: 1fr;
  }
  .band blockquote {
    max-width: none;
  }
}

/* ---------- Access / contact ---------- */

.access-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}
@media (max-width: 820px) {
  .access-grid {
    grid-template-columns: 1fr;
  }
}

form .field {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 1.1rem;
}
form label {
  font-family: var(--font-apparatus);
  font-size: var(--text-micro);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cool-gray-light);
}
form input,
form select,
form textarea {
  font-family: var(--font-ui);
  font-size: var(--text-base);
  color: var(--datum-black);
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  padding: 0.7rem 0.85rem;
  width: 100%;
  min-height: 46px;
  border-radius: 0;
}
form textarea {
  resize: vertical;
  min-height: 110px;
  line-height: 1.55;
}
form input:focus,
form select:focus,
form textarea:focus {
  outline: 2px solid var(--mineral);
  outline-offset: 1px;
  border-color: var(--mineral);
}
.form-note {
  font-size: var(--text-xs);
  color: var(--cool-gray-light);
  margin: 0.9rem 0 0;
}

.deflist {
  margin: 0;
}
.deflist div {
  display: grid;
  grid-template-columns: minmax(0, 150px) minmax(0, 1fr);
  gap: 1rem;
  padding: 0.9rem 0;
  border-top: 1px solid var(--rule);
}
.deflist div:first-child {
  border-top: none;
  padding-top: 0;
}
.deflist dt {
  font-family: var(--font-apparatus);
  font-size: var(--text-micro);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cool-gray-light);
  padding-top: 0.2rem;
}
.deflist dd {
  margin: 0;
  font-size: var(--text-sm);
}
.deflist a {
  color: var(--datum-black);
  text-decoration-color: var(--rule-strong);
  text-underline-offset: 3px;
}
.deflist a:hover {
  text-decoration-color: var(--mineral);
}
@media (max-width: 560px) {
  .deflist div {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
}

/* ---------- Prose ---------- */

.prose {
  max-width: var(--measure);
}
.prose p {
  color: var(--carbon);
}
.prose h3 {
  font-size: var(--text-xl);
  font-weight: 500;
  letter-spacing: -0.018em;
  margin: 2.5rem 0 0.75rem;
}
.prose ul {
  padding-left: 1.1rem;
  color: var(--carbon);
}
.prose li {
  margin-bottom: 0.5rem;
}
.prose li::marker {
  color: var(--mineral);
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--datum-black);
  color: rgba(245, 242, 235, 0.7);
  border-top: none;
  padding-block: clamp(3rem, 5vw, 4.5rem) 2rem;
  font-size: var(--text-sm);
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
  gap: clamp(1.75rem, 4vw, 4rem);
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--rule-invert);
}
.site-footer .lockup-text b {
  color: var(--paper);
}
.site-footer h4 {
  font-family: var(--font-apparatus);
  font-size: var(--text-micro);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(245, 242, 235, 0.5);
  margin: 0 0 1rem;
  font-weight: 500;
}
.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}
.site-footer a {
  color: rgba(245, 242, 235, 0.78);
  text-decoration: none;
}
.site-footer a:hover {
  color: var(--paper);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.footer-desc {
  margin: 1.1rem 0 0;
  max-width: 40ch;
  color: rgba(245, 242, 235, 0.62);
  font-size: var(--text-sm);
}
.footer-legal {
  display: grid;
  gap: 0.4rem;
  padding-top: 1.5rem;
}
.footer-legal p {
  margin: 0;
}
.footer-copyright {
  font-family: var(--font-apparatus);
  font-size: var(--text-micro);
  letter-spacing: 0.1em;
  color: rgba(245, 242, 235, 0.7);
}
.footer-trademarks {
  max-width: 92ch;
  font-size: var(--text-xs);
  line-height: 1.5;
  color: var(--cool-gray);
}
@media (max-width: 820px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .footer-brand {
    grid-column: span 2;
  }
}

/* ---------- Page header (interior) ---------- */

.page-head {
  border-top: none;
  padding-block: clamp(3rem, 6vw, 5.5rem) clamp(2rem, 4vw, 3.5rem);
}
.page-head h1 {
  font-size: var(--text-2xl);
  line-height: 1.03;
  max-width: 20ch;
}
.page-head .lede {
  margin: 1.5rem 0 0;
  max-width: 58ch;
  color: var(--carbon);
  font-size: var(--text-lg);
  line-height: 1.55;
}
