/* ==========================================================================
   LIBRA CAPITAL GROUP — design system
   Concept: "The Instrument" — Libra is the only constellation that is an
   instrument, not a creature. Night field (descended from the old brand
   #1f4e78), silver steel, seal-red wax — the mark of verification.
   Type: Besley (Clarendon, the ledger letterform) + Public Sans (the US
   government's own service typeface) + system mono (data).
   ========================================================================== */

/* ---------- Fonts ---------- */
@font-face {
  font-family: 'Besley';
  src: url('../fonts/besley-var.woff2') format('woff2');
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Besley';
  src: url('../fonts/besley-var-italic.woff2') format('woff2');
  font-weight: 300 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Public Sans';
  src: url('../fonts/public-sans-var.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  /* surfaces */
  --ink: #0c0f16;
  --ink-2: #121722;
  --ink-3: #1a2230;
  --paper: #f1ecdf;
  --paper-2: #e9e2d0;
  /* text */
  --text-on-ink: #e9edf4;
  --muted-on-ink: #9aa3b5;
  --faint-on-ink: #677083;
  --text-on-paper: #171b26;
  --muted-on-paper: #5b6172;
  /* accent — brass. Weights and measures, not startup. */
  --seal: #cd5468;
  --seal-bright: #e78e9e;
  --seal-deep: #8f2440;
  --seal-dim: rgba(205, 84, 104, 0.4);
  /* rules */
  --line-ink: rgba(199, 209, 228, 0.14);
  --line-ink-strong: rgba(199, 209, 228, 0.3);
  --line-paper: rgba(23, 27, 38, 0.18);
  --line-paper-strong: rgba(23, 27, 38, 0.4);
  /* type */
  --serif: 'Besley', 'Clarendon', Georgia, serif;
  --sans: 'Public Sans', -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', 'Cascadia Mono', 'Segoe UI Mono', Consolas, 'Liberation Mono', monospace;
  /* rhythm */
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --max: 82rem;
  --radius: 2px;
  --ease-out: cubic-bezier(0.19, 1, 0.22, 1);
  --dur: 0.9s;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  background: var(--ink);
  color: var(--text-on-ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font: inherit; background: none; border: 0; cursor: pointer; color: inherit; }
::selection { background: var(--seal); color: var(--ink); }

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

/* Film grain — one subtle layer over everything */
body::after {
  content: '';
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 9s steps(6) infinite;
}
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-2%, 3%); }
  40% { transform: translate(3%, -2%); }
  60% { transform: translate(-3%, -3%); }
  80% { transform: translate(2%, 2%); }
}

/* ---------- Layout primitives ---------- */
.wrap {
  width: min(100% - 2 * var(--gutter), var(--max));
  margin-inline: auto;
}
.section { padding-block: clamp(5rem, 11vw, 9.5rem); position: relative; }
.section--flush-top { padding-top: 0; }

.surface-paper {
  background: var(--paper);
  color: var(--text-on-paper);
}
.surface-paper ::selection { background: var(--ink); color: var(--paper); }
.surface-ink-2 { background: var(--ink-2); }

/* ---------- Type ---------- */
.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--seal);
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1.6rem;
}
.eyebrow::before {
  content: '';
  width: 2.2rem;
  height: 1px;
  background: var(--seal);
  flex: none;
}
.eyebrow .idx { color: var(--faint-on-ink); }
.surface-paper .eyebrow .idx { color: var(--muted-on-paper); }

h1, h2, h3, .display {
  font-family: var(--serif);
  font-weight: 460;
  line-height: 1.04;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.display-xl { font-size: clamp(2.9rem, 7.2vw, 6.2rem); }
.display-lg { font-size: clamp(2.3rem, 5vw, 4.2rem); }
.display-md { font-size: clamp(1.7rem, 3.2vw, 2.6rem); line-height: 1.12; }
.display-sm { font-size: clamp(1.25rem, 2vw, 1.6rem); line-height: 1.2; }

.lede {
  font-size: clamp(1.1rem, 1.6vw, 1.3rem);
  line-height: 1.6;
  color: var(--muted-on-ink);
  max-width: 46ch;
}
.surface-paper .lede { color: var(--muted-on-paper); }

em, .accent-i {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 430;
  color: var(--seal-bright);
}
.surface-paper em, .surface-paper .accent-i { color: var(--seal-deep); }

.mono { font-family: var(--mono); }
.small { font-size: 0.875rem; }

p + p { margin-top: 1em; }

/* ---------- The Beam — signature divider ---------- */
/* A balance beam: line + central fulcrum + calibration ticks.
   Enters tilted, settles level. Equilibrium as structure. */
.beam {
  position: relative;
  height: 1px;
  background: var(--line-ink-strong);
  margin-block: clamp(3rem, 6vw, 5rem);
  transform-origin: 50% 50%;
  transform: rotate(-2deg);
  transition: transform 1.4s var(--ease-out);
}
.beam::before {
  /* fulcrum */
  content: '';
  position: absolute;
  left: 50%;
  top: -4px;
  width: 9px;
  height: 9px;
  background: var(--seal);
  transform: translateX(-50%) rotate(45deg);
}
.beam::after {
  /* calibration ticks */
  content: '';
  position: absolute;
  inset: -3px 0 auto;
  height: 7px;
  background-image: repeating-linear-gradient(
    90deg,
    var(--line-ink-strong) 0 1px,
    transparent 1px 10%
  );
  opacity: 0.6;
}
.surface-paper .beam { background: var(--line-paper-strong); }
.surface-paper .beam::after {
  background-image: repeating-linear-gradient(
    90deg,
    var(--line-paper-strong) 0 1px,
    transparent 1px 10%
  );
}
.beam.is-level { transform: rotate(0deg); }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  transition: background-color 0.4s ease, border-color 0.4s ease;
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  background: rgba(12, 15, 22, 0.82);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--line-ink);
}
.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding-block: 1.1rem;
}
.lockup {
  font-family: var(--sans);
  font-weight: 640;
  font-size: 0.95rem;
  letter-spacing: 0.24em;
  white-space: nowrap;
  color: var(--text-on-ink);
}
.lockup span { color: var(--seal); font-weight: 460; }
.lockup .lockup__divider {
  display: inline-block;
  width: 1px;
  height: 0.9em;
  background: var(--line-ink-strong);
  margin: 0 0.7em -0.12em;
}

.site-nav { display: flex; align-items: center; gap: clamp(1.2rem, 2.4vw, 2.4rem); }
.site-nav a {
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--muted-on-ink);
  transition: color 0.25s ease;
  position: relative;
  padding-block: 0.3rem;
}
.site-nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--seal);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease-out);
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text-on-ink); }
.site-nav a:hover::after, .site-nav a[aria-current="page"]::after {
  transform: scaleX(1);
  transform-origin: left;
}
.site-nav .nav-cta {
  border: 1px solid var(--seal-dim);
  padding: 0.55rem 1.15rem;
  color: var(--seal-bright);
  transition: border-color 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}
.site-nav .nav-cta::after { display: none; }
.site-nav .nav-cta:hover {
  border-color: var(--seal);
  background: var(--seal);
  color: var(--ink);
}

.nav-toggle { display: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: min(100svh, 60rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  isolation: isolate;
}
.hero--sub { min-height: min(72svh, 44rem); padding-top: 7rem; }
#instrument, .hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}
.hero__vignette {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(120% 90% at 50% 10%, transparent 55%, var(--ink) 100%),
    linear-gradient(to bottom, rgba(12,15,22,0.5), transparent 30%, transparent 72%, var(--ink) 100%);
}
.hero__content { padding-block: 8rem 4rem; }
.hero h1 { max-width: 14ch; }
.hero .lede { margin-top: 2rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 3rem; }
.hero__caption {
  position: absolute;
  right: var(--gutter);
  bottom: 2.2rem;
  max-width: 21rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  line-height: 1.7;
  letter-spacing: 0.06em;
  color: var(--faint-on-ink);
  text-align: right;
}
.hero__caption strong { color: var(--muted-on-ink); font-weight: 500; }
.hero__scrollcue {
  position: absolute;
  left: var(--gutter);
  bottom: 2.2rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--faint-on-ink);
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.hero__scrollcue::after {
  content: '';
  width: 1px;
  height: 2.6rem;
  background: linear-gradient(var(--seal), transparent);
  animation: cue 2.4s ease-in-out infinite;
}
@keyframes cue {
  0%, 100% { transform: scaleY(0.3); transform-origin: top; opacity: 0.4; }
  50% { transform: scaleY(1); opacity: 1; }
}

/* staged hero entrance — JS-triggered transitions; visible without JS */
html.js [data-stage] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 1.2s var(--ease-out), transform 1.2s var(--ease-out);
}
html.js [data-stage="1"] { transition-delay: 0.12s; }
html.js [data-stage="2"] { transition-delay: 0.3s; }
html.js [data-stage="3"] { transition-delay: 0.5s; }
html.js [data-stage="4"] { transition-delay: 0.72s; }
html.js [data-stage].is-in { opacity: 1; transform: none; }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--seal);
  --btn-fg: var(--ink);
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  padding: 0.95rem 1.7rem;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid var(--btn-bg);
  transition: transform 0.3s var(--ease-out), background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  will-change: transform;
}
.btn:hover { background: var(--seal-bright); border-color: var(--seal-bright); }
.btn .arrow { transition: transform 0.3s var(--ease-out); }
.btn:hover .arrow { transform: translateX(4px); }
.btn--ghost {
  background: transparent;
  color: var(--text-on-ink);
  border-color: var(--line-ink-strong);
}
.btn--ghost:hover {
  background: transparent;
  border-color: var(--seal);
  color: var(--seal-bright);
}
.surface-paper .btn--ghost { color: var(--text-on-paper); border-color: var(--line-paper-strong); }
.surface-paper .btn--ghost:hover { color: var(--seal-deep); border-color: var(--seal-deep); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--seal-bright);
}
.link-arrow .arrow { transition: transform 0.3s var(--ease-out); }
.link-arrow:hover .arrow { transform: translateX(5px); }
.surface-paper .link-arrow { color: var(--seal-deep); }

/* ---------- Section headers ---------- */
.section-head { max-width: 62rem; margin-bottom: clamp(2.6rem, 6vw, 4.5rem); }
.section-head .lede { margin-top: 1.4rem; }
.section-head--split {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  max-width: none;
}

/* ---------- Practices band (home) ---------- */
.practices { counter-reset: practice; }
.practice-row {
  display: grid;
  grid-template-columns: 4.5rem 1fr auto;
  align-items: baseline;
  gap: 1.5rem;
  padding-block: 1.35rem;
  border-bottom: 1px solid var(--line-ink);
  position: relative;
  transition: padding-left 0.4s var(--ease-out);
}
.practice-row:first-child { border-top: 1px solid var(--line-ink); }
.practice-row::before {
  counter-increment: practice;
  content: counter(practice, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--faint-on-ink);
  letter-spacing: 0.1em;
}
.practice-row__name {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3.4vw, 2.9rem);
  font-weight: 440;
  line-height: 1.1;
  letter-spacing: -0.01em;
  transition: color 0.3s ease, font-variation-settings 0.3s ease;
}
.practice-row__meta {
  font-size: 0.9rem;
  color: var(--muted-on-ink);
  text-align: right;
  max-width: 24rem;
}
.practice-row:hover { padding-left: 0.8rem; }
.practice-row:hover .practice-row__name { color: var(--seal-bright); }
.practice-row:hover::after {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 2px;
  background: var(--seal);
}

/* ---------- Cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
  gap: 1px;
  background: var(--line-paper);
  border: 1px solid var(--line-paper);
}
@media (min-width: 901px) {
  .card-grid--3 { grid-template-columns: repeat(3, 1fr); }
}
.surface-ink .card-grid, .section:not(.surface-paper) .card-grid {
  background: var(--line-ink);
  border-color: var(--line-ink);
}
.card {
  background: var(--paper);
  padding: 2rem 1.8rem 1.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  min-height: 15rem;
  position: relative;
  transition: background-color 0.35s ease;
}
.section:not(.surface-paper) .card { background: var(--ink-2); }
.card__idx {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--muted-on-paper);
}
.section:not(.surface-paper) .card__idx { color: var(--faint-on-ink); }
.card h3 { font-size: 1.45rem; font-weight: 480; }
.card p { font-size: 0.95rem; color: var(--muted-on-paper); flex: 1; }
.section:not(.surface-paper) .card p { color: var(--muted-on-ink); }
.card .link-arrow { font-size: 0.9rem; }
.card:hover { background: var(--paper-2); }
.section:not(.surface-paper) .card:hover { background: var(--ink-3); }

/* leaf chip list inside cards */
.leaves {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.3rem;
}
.leaves li {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--line-paper);
  color: var(--muted-on-paper);
}
.section:not(.surface-paper) .leaves li {
  border-color: var(--line-ink);
  color: var(--muted-on-ink);
}

/* ---------- Tier scale (home + DT hub) ---------- */
.tier-scale { position: relative; padding-top: 3.5rem; }
.tier-scale__beam {
  position: absolute;
  top: 1.4rem;
  left: 6%;
  right: 6%;
  height: 1px;
  background: var(--line-ink-strong);
}
.tier-scale__beam::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -5px;
  width: 11px;
  height: 11px;
  background: var(--seal);
  transform: translateX(-50%) rotate(45deg);
}
.tier-scale__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1rem, 2.5vw, 2rem);
}
.tier-card {
  border: 1px solid var(--line-ink);
  background: var(--ink-2);
  padding: 2.2rem 1.9rem;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: border-color 0.35s ease, transform 0.5s var(--ease-out), background-color 0.35s ease;
}
.tier-card::before {
  /* hanger wire to the beam */
  content: '';
  position: absolute;
  top: -2.1rem;
  left: 50%;
  width: 1px;
  height: 2.1rem;
  background: var(--line-ink-strong);
}
.tier-card__tier {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--seal);
}
.tier-card h3 { font-size: clamp(1.35rem, 1.9vw, 1.75rem); font-weight: 470; }
.tier-card p { font-size: 0.95rem; color: var(--muted-on-ink); flex: 1; }
.tier-card:hover {
  border-color: var(--seal-dim);
  background: var(--ink-3);
  transform: translateY(-6px);
}

/* ---------- Ledger / proof tables ---------- */
.ledger {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.ledger caption {
  text-align: left;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--seal);
  padding-bottom: 1rem;
}
.ledger th {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-align: left;
  color: var(--muted-on-paper);
  padding: 0.8rem 1rem 0.8rem 0;
  border-bottom: 1px solid var(--line-paper-strong);
}
.ledger td {
  padding: 0.95rem 1rem 0.95rem 0;
  border-bottom: 1px solid var(--line-paper);
  vertical-align: top;
}
.ledger .mono { font-size: 0.85rem; }
.section:not(.surface-paper) .ledger th { color: var(--muted-on-ink); border-color: var(--line-ink-strong); }
.section:not(.surface-paper) .ledger td { border-color: var(--line-ink); }

.table-scroll { overflow-x: auto; }
.table-scroll .ledger { min-width: 34rem; }

/* ---------- Stat strip — honest structural figures, static (no count-up) ---------- */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  border-block: 1px solid var(--line-ink);
}
.stat {
  padding: 2rem 1.5rem;
  border-right: 1px solid var(--line-ink);
}
.stat:last-child { border-right: 0; }
.stat__value {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  font-weight: 430;
  line-height: 1;
  color: var(--seal-bright);
}
.stat__label {
  margin-top: 0.7rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-on-ink);
}
.surface-paper .stat { border-color: var(--line-paper); }
.surface-paper .stat-strip { border-color: var(--line-paper); }
.surface-paper .stat__value { color: var(--seal-deep); }
.surface-paper .stat__label { color: var(--muted-on-paper); }

/* ---------- Prose blocks ---------- */
.prose { max-width: 68ch; }
.prose h2, .prose h3 { margin-block: 2.2em 0.7em; }
.prose > h2:first-child, .prose > h3:first-child { margin-top: 0; }
.prose ul { list-style: none; margin-block: 1em; }
.prose ul li {
  padding-left: 1.6rem;
  position: relative;
  margin-bottom: 0.55em;
}
.prose ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 0.7rem;
  height: 1px;
  background: var(--seal);
}

/* two-column split */
.split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: start;
}
.split__sticky { position: sticky; top: 7rem; }

/* ---------- Reveal on scroll ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
  transition-delay: var(--reveal-delay, 0s);
}
[data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- CTA band ---------- */
.cta-band {
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-band h2 { max-width: 20ch; margin-inline: auto; }
.cta-band .lede { margin: 1.6rem auto 0; }
.cta-band__actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2.8rem;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line-ink);
  background: var(--ink);
  padding-block: 4.5rem 2.5rem;
  font-size: 0.92rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(16rem, 1.4fr) repeat(3, minmax(9rem, 1fr));
  gap: 3rem;
  margin-bottom: 3.5rem;
}
.footer-entity p { color: var(--muted-on-ink); margin-top: 1.1rem; max-width: 30ch; }
.footer-entity .mono {
  display: block;
  margin-top: 1.4rem;
  font-size: 0.78rem;
  line-height: 2;
  color: var(--faint-on-ink);
}
.footer-entity .mono a { color: var(--muted-on-ink); }
.footer-entity .mono a:hover { color: var(--seal-bright); }
.footer-col h4 {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--seal);
  margin-bottom: 1.2rem;
}
.footer-col li { margin-bottom: 0.6rem; }
.footer-col a { color: var(--muted-on-ink); transition: color 0.25s ease; font-size: 0.9rem; }
.footer-col a:hover { color: var(--text-on-ink); }
.footer-legal {
  border-top: 1px solid var(--line-ink);
  padding-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--faint-on-ink);
}
.footer-legal a { color: var(--muted-on-ink); }
.footer-legal a:hover { color: var(--seal-bright); }

/* ---------- Page hero (interior pages) ---------- */
.page-hero {
  position: relative;
  padding-top: clamp(9rem, 16vh, 12rem);
  padding-bottom: clamp(3.5rem, 7vw, 6rem);
  overflow: hidden;
}
.page-hero h1 { max-width: 16ch; }
.page-hero .lede { margin-top: 1.8rem; max-width: 56ch; }
.crumb {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint-on-ink);
  margin-bottom: 2rem;
  display: flex;
  gap: 0.8rem;
  align-items: center;
}
.crumb a { color: var(--muted-on-ink); }
.crumb a:hover { color: var(--seal-bright); }
.crumb .sep { color: var(--faint-on-ink); }

/* ---------- Category blocks (solutions hub) ---------- */
.cat-block {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 5vw, 5rem);
  padding-block: clamp(3rem, 6vw, 5rem);
  border-top: 1px solid var(--line-paper);
}
.cat-block__head { position: sticky; top: 7rem; align-self: start; }
.cat-block__idx {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  color: var(--seal-deep);
  display: block;
  margin-bottom: 1rem;
}
.cat-block h2 { font-size: clamp(1.9rem, 3.4vw, 2.9rem); font-weight: 470; }
.cat-block__desc { margin-top: 1.2rem; color: var(--muted-on-paper); max-width: 40ch; }
.leaf-list li { border-bottom: 1px solid var(--line-paper); }
.leaf-list li:first-child { border-top: 1px solid var(--line-paper); }
.leaf {
  display: grid;
  grid-template-columns: 3.2rem 1fr;
  gap: 1rem;
  padding-block: 1.3rem;
}
.leaf__code {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--muted-on-paper);
  padding-top: 0.35rem;
}
.leaf h3 { font-size: 1.15rem; font-weight: 560; font-family: var(--sans); letter-spacing: 0; }
.leaf p { font-size: 0.92rem; color: var(--muted-on-paper); margin-top: 0.35rem; }

/* ---------- Feature list (tier pages) ---------- */
.feature-list { border-top: 1px solid var(--line-ink); }
.surface-paper .feature-list { border-color: var(--line-paper); }
.feature {
  display: grid;
  grid-template-columns: minmax(10rem, 16rem) 1fr;
  gap: 2rem;
  padding-block: 1.8rem;
  border-bottom: 1px solid var(--line-ink);
}
.surface-paper .feature { border-color: var(--line-paper); }
.feature h3 { font-size: 1.2rem; font-weight: 560; font-family: var(--sans); letter-spacing: 0; }
.feature p { font-size: 0.95rem; color: var(--muted-on-ink); }
.surface-paper .feature p { color: var(--muted-on-paper); }

/* ---------- Note / rule box ---------- */
.note {
  border-left: 2px solid var(--seal);
  padding: 1.2rem 1.6rem;
  background: color-mix(in srgb, var(--seal) 6%, transparent);
  font-size: 0.98rem;
  max-width: 62ch;
}
.note .mono { color: var(--seal); font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; display: block; margin-bottom: 0.5rem; }

/* ---------- Contact / forms ---------- */
.field { margin-bottom: 1.6rem; }
.field label {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-on-ink);
  margin-bottom: 0.6rem;
}
.field input, .field textarea, .field select {
  width: 100%;
  font: inherit;
  color: var(--text-on-ink);
  background: var(--ink-2);
  border: 1px solid var(--line-ink);
  padding: 0.9rem 1rem;
  transition: border-color 0.3s ease;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--seal);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .split, .cat-block { grid-template-columns: 1fr; }
  .split__sticky, .cat-block__head { position: static; }
  .tier-scale__grid { grid-template-columns: 1fr; }
  .tier-scale__beam { display: none; }
  .tier-card::before { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .practice-row { grid-template-columns: 3rem 1fr; }
  .practice-row__meta { grid-column: 2; text-align: left; max-width: none; }
  .section-head--split { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 760px) {
  .nav-toggle {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    gap: 0;
    z-index: 120;
  }
  .nav-toggle .bar {
    display: block;
    width: 22px;
    height: 1.5px;
    background: var(--text-on-ink);
    margin-block: 3px;
    transition: transform 0.35s var(--ease-out), opacity 0.25s ease;
  }
  .nav-open .nav-toggle .bar:nth-child(1) { transform: translateY(4.5px) rotate(45deg); }
  .nav-open .nav-toggle .bar:nth-child(2) { opacity: 0; }
  .nav-open .nav-toggle .bar:nth-child(3) { transform: translateY(-4.5px) rotate(-45deg); }

  .site-nav {
    position: fixed;
    inset: 0;
    background: var(--ink);
    flex-direction: column;
    justify-content: center;
    gap: 2rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
  }
  .nav-open .site-nav { opacity: 1; pointer-events: auto; }
  .site-nav a { font-size: 1.35rem; font-family: var(--serif); font-weight: 460; }
  .hero__caption { display: none; }
  .feature { grid-template-columns: 1fr; gap: 0.5rem; }
  .footer-grid { grid-template-columns: 1fr; gap: 2.2rem; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  html.js [data-stage] { opacity: 1; transform: none; }
  .beam { transform: none; }
  body::after { animation: none; }
}

/* ==========================================================================
   MOTION SYSTEM v2
   ========================================================================== */

/* ---------- Cross-document view transitions ---------- */
@view-transition { navigation: auto; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-14px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(18px); } }
::view-transition-old(root) { animation: vt-out 0.28s ease both; }
::view-transition-new(root) { animation: vt-in 0.42s cubic-bezier(0.19, 1, 0.22, 1) both; }

/* ---------- Word-mask headline reveal ---------- */
.has-words .w {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}
.has-words .wi {
  display: inline-block;
  transform: translateY(112%);
  transition: transform 1.1s var(--ease-out);
  transition-delay: calc(var(--wd, 0ms) + 180ms);
}
html.js .has-words[data-stage] { opacity: 1; transform: none; }
.has-words.is-in .wi, [data-reveal].is-in .has-words .wi { transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .has-words .wi { transform: none; transition: none; }
}

/* ---------- Reticle cursor ---------- */
.reticle {
  position: fixed;
  left: -18px;
  top: -18px;
  width: 36px;
  height: 36px;
  pointer-events: none;
  z-index: 9998;
  transition: opacity 0.3s ease;
}
.reticle i {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(199, 209, 228, 0.5);
  border-radius: 50%;
  transition: transform 0.35s var(--ease-out), border-color 0.3s ease;
}
.reticle i::before, .reticle i::after {
  content: '';
  position: absolute;
  background: rgba(199, 209, 228, 0.55);
  transition: background-color 0.3s ease;
}
.reticle i::before { left: 50%; top: -5px; width: 1px; height: 5px; }
.reticle i::after { top: 50%; left: -5px; height: 1px; width: 5px; }
.reticle--active i {
  transform: scale(1.7);
  border-color: rgba(224, 104, 126, 0.8);
}
.reticle--active i::before, .reticle--active i::after { background: rgba(224, 104, 126, 0.8); }
.reticle--gone { opacity: 0; }

/* ---------- Ruler scrollbar ---------- */
.ruler {
  position: fixed;
  top: 12vh;
  bottom: 12vh;
  right: 14px;
  width: 20px;
  z-index: 90;
  pointer-events: none;
}
.ruler__tick {
  position: absolute;
  right: 0;
  width: 6px;
  height: 1px;
  background: rgba(128, 138, 158, 0.5);
}
.ruler__tick.is-major { width: 12px; }
.ruler__thumb {
  position: absolute;
  right: 0;
  translate: 0 -50%;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ruler__thumb b {
  order: 2;
  width: 16px;
  height: 2px;
  background: var(--seal);
  display: block;
}
.ruler__thumb em {
  order: 1;
  font-family: var(--mono);
  font-style: normal;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  color: rgba(128, 138, 158, 0.9);
}


/* ---------- Card tilt + specular glare ---------- */
.tiltable {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.25s ease, background-color 0.35s ease, border-color 0.35s ease;
  will-change: transform;
  position: relative;
  overflow: hidden;
}
.tiltable::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(38rem circle at var(--gx, 50%) var(--gy, 50%),
    rgba(229, 236, 246, 0.09), transparent 45%);
  transition: opacity 0.35s ease;
}
.tiltable:hover::after { opacity: 1; }
.surface-paper .tiltable::after {
  background: radial-gradient(38rem circle at var(--gx, 50%) var(--gy, 50%),
    rgba(23, 27, 38, 0.06), transparent 45%);
}

/* Weighing beam responds */
.tier-scale__beam { transition: transform 0.7s var(--ease-out); transform-origin: 50% 50%; }
.tier-card { transition: border-color 0.35s ease, transform 0.5s var(--ease-out), background-color 0.35s ease, translate 0.7s var(--ease-out); }

/* ---------- The Dial ---------- */
.sr-keep {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.dial-wrap { position: relative; }
.dial-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  overflow: hidden;
  cursor: pointer;
}
.dial-info { display: flex; flex-direction: column; gap: 1.1rem; max-width: 34rem; }
.dial-info__idx {
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  color: var(--seal);
}
.dial-info__name {
  font-family: var(--serif);
  font-size: clamp(2.6rem, 4.6vw, 4.6rem);
  font-weight: 480;
  line-height: 1.02;
  letter-spacing: -0.01em;
}
.dial-info__meta { color: var(--muted-on-ink); font-size: 1.05rem; max-width: 40ch; }
.dial-swap .dial-info__name { animation: dialname 0.55s var(--ease-out); }
.dial-swap .dial-info__meta { animation: dialname 0.55s var(--ease-out) 0.06s backwards; }
@keyframes dialname {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
.dial-box {
  --dial-r: 25rem;
  --dial-r2: 26.5rem;
  position: relative;
  height: 100%;
}
.dial-ring {
  position: absolute;
  top: 50%;
  left: 78%;
  width: 0;
  height: 0;
  will-change: transform;
}
.dial-ring::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--dial-r2) - 2.5rem);
  top: calc(-1 * var(--dial-r2) - 2.5rem);
  width: calc(2 * var(--dial-r2) + 5rem);
  height: calc(2 * var(--dial-r2) + 5rem);
  border: 1px solid var(--line-ink);
  border-radius: 50%;
}
.dial-ring__label {
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 450;
  white-space: nowrap;
  color: var(--faint-on-ink);
  padding-right: 1.2rem;
  transition: color 0.4s ease;
  will-change: transform, opacity;
}
.dial-ring__label.is-active { color: var(--text-on-ink); }
.dial-ring__tick {
  position: absolute;
  width: 10px;
  height: 1px;
  background: var(--line-ink);
  transform-origin: 0 0;
}
.dial-ring__tick.is-major { width: 18px; background: var(--line-ink-strong); }
.dial-marker {
  position: absolute;
  width: 11px;
  height: 11px;
  background: var(--seal);
  rotate: 45deg;
  translate: -50% -50%;
  box-shadow: 0 0 18px rgba(205, 84, 104, 0.55);
}
@media (max-width: 979px) {
  .dial-wrap { display: none; }
  .sr-keep {
    position: static !important;
    width: auto; height: auto;
    clip-path: none;
    white-space: normal;
  }
}
@media (prefers-reduced-motion: reduce) {
  .reticle, .ruler, .dial-wrap { display: none; }
  .sr-keep {
    position: static !important;
    width: auto; height: auto;
    clip-path: none;
    white-space: normal;
  }
  .tiltable { transform: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}
#xp { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
html.webgl #instrument { display: none; }
.xp-label { position: fixed; left: 0; top: 0; z-index: 1;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em;
  color: rgba(236,241,249,0.42); pointer-events: none; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .xp-label { display: none; } }

/* ==========================================================================
   v4 — mobile fixes + 3D affordances
   ========================================================================== */

/* Mobile nav: lock the page while the menu is open (scroll made it unusable) */
body.nav-open { overflow: hidden; height: 100dvh; }
html:has(body.nav-open) { overflow: hidden; }
body.nav-open .site-header { background: var(--ink); }
@media (max-width: 760px) {
  .site-nav {
    height: 100dvh;
    overscroll-behavior: contain;
  }
}

/* Ledger tables on small screens: self-scrolling with edge-shadow affordance.
   No wrapper needed — the table itself becomes the scroll container. */
@media (max-width: 760px) {
  .ledger {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    font-size: 0.88rem;
    /* scroll shadows: fixed-position gradient cues at both edges */
    background:
      linear-gradient(90deg, var(--paper) 30%, rgba(241, 236, 223, 0)) left / 36px 100% no-repeat local,
      linear-gradient(270deg, var(--paper) 30%, rgba(241, 236, 223, 0)) right / 36px 100% no-repeat local,
      radial-gradient(farthest-side at 0 50%, rgba(23, 27, 38, 0.28), transparent) left / 14px 100% no-repeat scroll,
      radial-gradient(farthest-side at 100% 50%, rgba(23, 27, 38, 0.28), transparent) right / 14px 100% no-repeat scroll;
  }
  .section:not(.surface-paper) .ledger {
    background:
      linear-gradient(90deg, var(--ink) 30%, rgba(12, 15, 22, 0)) left / 36px 100% no-repeat local,
      linear-gradient(270deg, var(--ink) 30%, rgba(12, 15, 22, 0)) right / 36px 100% no-repeat local,
      radial-gradient(farthest-side at 0 50%, rgba(199, 209, 228, 0.22), transparent) left / 14px 100% no-repeat scroll,
      radial-gradient(farthest-side at 100% 50%, rgba(199, 209, 228, 0.22), transparent) right / 14px 100% no-repeat scroll;
  }
  .ledger td, .ledger th { white-space: normal; min-width: 9.5rem; }
  .ledger td:first-child, .ledger th:first-child { min-width: 7rem; }
  .table-scroll { overflow: visible; }
  .table-scroll .ledger { min-width: 0; }
}

/* Grab affordance on the hero instrument */
@media (pointer: fine) {
  html.webgl .hero { cursor: grab; }
  html.webgl .hero a, html.webgl .hero button { cursor: pointer; }
}

/* ---------- v5: text protection over the 3D scene ---------- */
/* Feathered ink scrims behind text blocks that float over the canvas.
   Text readability outranks every effect. */
html.webgl .section:not(.surface-paper) .section-head,
html.webgl .dial-info,
html.webgl .cta-band .wrap,
html.webgl .page-hero .wrap,
html.webgl .hero__content,
html.webgl .section:not(.surface-paper) .split > div,
html.webgl .section:not(.surface-paper) .stat-strip {
  position: relative;
  isolation: isolate;
}
html.webgl .section:not(.surface-paper) .section-head::before,
html.webgl .dial-info::before,
html.webgl .cta-band .wrap::before,
html.webgl .page-hero .wrap::before,
html.webgl .hero__content::before,
html.webgl .section:not(.surface-paper) .split > div::before,
html.webgl .section:not(.surface-paper) .stat-strip::before {
  content: '';
  position: absolute;
  inset: -2.5rem -3.5rem;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(115% 105% at 35% 50%,
    rgba(12, 15, 22, 0.8),
    rgba(12, 15, 22, 0.42) 55%,
    transparent 80%);
}

/* scrims: tighter on small screens so they never push page width */
@media (max-width: 760px) {
  html.webgl .section:not(.surface-paper) .section-head::before,
  html.webgl .dial-info::before,
  html.webgl .cta-band .wrap::before,
  html.webgl .page-hero .wrap::before,
  html.webgl .hero__content::before,
  html.webgl .section:not(.surface-paper) .split > div::before,
  html.webgl .section:not(.surface-paper) .stat-strip::before {
    inset: -1.25rem -1rem;
  }
}

/* grid blowout guard: let split/cat-block items shrink below content width,
   so inner tables scroll instead of widening the page */
@media (max-width: 900px) {
  .split > div, .split > .split__sticky, .cat-block > * { min-width: 0; }
}
