/* ============================================================================
   Oakline Partners — Shared theme (tokens + fonts + shared primitives).
   Imported by all pages. Edit this file to retheme all pages at once.
   ============================================================================ */

:root {
  /* ── Accent — warm signature amber, dark-tuned (live pages' canonical) ─ */
  --accent:        #E8722C;        /* amber fill (CTA, tints) */
  --accent-text:   #F2935A;        /* brighter amber for text/links on near-black (>=4.5:1 on #0A0A0B) */
  --accent-soft:   rgba(232, 114, 44, 0.14);
  --accent-line:   rgba(232, 114, 44, 0.32);

  /* ── Backgrounds — canonical dark system ──────────────────── */
  --bg: #0A0A0B;
  --bg-deep: #000000;
  --surface: #141417;
  --surface-soft: rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.07);

  /* ── Inverted section ──────────────────────────────────────── */
  --invert-bg: #F6F6F7;
  --invert-ink: #0A0A0B;
  --invert-soft: #57575C;

  /* ── Text — full ramp on dark ──────────────────────────────── */
  --text: #FFFFFF;
  --text-2: #B6B6BC;
  --text-3: #8A8A90;

  /* ── Lines ─────────────────────────────────────────────────── */
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.18);

  /* ── Status ────────────────────────────────────────────────── */
  --status: #6FCF97;

  /* ── Type ──────────────────────────────────────────────────── */
  --font-display: "DM Sans", system-ui, -apple-system, sans-serif;
  --font-sans: "DM Sans", system-ui, -apple-system, sans-serif;

  /* ── Layout / radius ───────────────────────────────────────── */
  --r-card: 16px;
  --r-pill: 30px;
  --maxw: 1180px;
  --pad-x: clamp(20px, 5vw, 80px);

  /* ── Shadows ───────────────────────────────────────────────── */
  --shadow-card: 0 1px 0 rgba(255,255,255,0.03), 0 18px 40px -28px rgba(0,0,0,0.9);
  --shadow-float: 0 30px 80px -40px rgba(0,0,0,0.95);

  /* ── Easing ────────────────────────────────────────────────── */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════════════════════════════════ */

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: clip; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: "DM Sans", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  /* iOS: kill the grey tap-flash on links/buttons — we have custom :active
     states, so the default highlight only reads as un-native. */
  -webkit-tap-highlight-color: transparent;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

::selection { background: rgba(232,114,44,0.28); color: #fff; }

/* ═══════════════════════════════════════════════════════════════════════════
   LAYOUT UTILITIES
   ═══════════════════════════════════════════════════════════════════════════ */

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
}
.wrap-wide { max-width: 1320px; }

/* ═══════════════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.975rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1;
  padding: 15px 26px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.25s var(--ease), background-color 0.25s var(--ease),
              border-color 0.25s var(--ease), color 0.25s var(--ease), opacity 0.25s var(--ease);
  white-space: nowrap;
}
.btn:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; }
.btn-primary { background: var(--accent); color: #0A0A0B; }
.btn-primary:hover { transform: translateY(-1px); background: #F2843E; }
.btn-primary:active { transform: translateY(0); background: #D9651F; }

.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover { transform: translateY(-1px); background: rgba(255,255,255,0.06); border-color: var(--accent-line); }
.btn-ghost:active { transform: translateY(0); background: rgba(255,255,255,0.03); }

.btn .arr { transition: transform 0.25s var(--ease); }
.btn:hover .arr { transform: translateX(3px); }

/* On the inverted section */
.invert .btn-primary { background: var(--accent); color: #0A0A0B; }
.invert .btn-primary:hover { background: #F2843E; }
.invert .btn-primary:active { background: #D9651F; }
.invert .btn-ghost { color: var(--invert-ink); border-color: rgba(10,10,11,0.22); }
.invert .btn-ghost:hover { background: rgba(10,10,11,0.05); border-color: rgba(10,10,11,0.38); }
.invert .btn:focus-visible { outline-color: #B85316; }

/* ═══════════════════════════════════════════════════════════════════════════
   TEXT LINKS
   ═══════════════════════════════════════════════════════════════════════════ */

.tlink {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--accent-text);
  border-bottom: 1px solid var(--accent-line);
  padding-bottom: 2px;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), gap 0.2s var(--ease);
}
.tlink:hover { gap: 11px; color: #F7A878; border-color: var(--accent-text); }
.tlink:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 4px; border-radius: 2px; }
.tlink .arr { transition: transform 0.2s var(--ease); }
.tlink:hover .arr { transform: translateX(2px); }
.invert .tlink { color: #B85316; border-color: rgba(184,83,22,0.34); }
.invert .tlink:hover { color: #9C4310; border-color: #B85316; }
.invert .tlink:focus-visible { outline-color: #B85316; }

/* ═══════════════════════════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════════════════════════ */

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease), backdrop-filter 0.3s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(10,10,11,0.78);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.brand { display: inline-flex; align-items: center; }
.brand img { height: 26px; width: auto; }
.brand:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 4px; border-radius: 4px; }

.nav { display: flex; align-items: center; gap: 34px; }
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a {
  font-size: 0.925rem;
  font-weight: 500;
  color: var(--text-2);
  letter-spacing: -0.005em;
  transition: color 0.2s var(--ease);
  position: relative;
  padding: 4px 0;
}
.nav-links a:hover { color: #fff; }
.nav-links a:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; border-radius: 3px; color: #fff; }
.nav-links a[aria-current="page"] { color: #fff; }
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -1px;
  width: 100%; height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
}
.nav-links a:hover::after { transform: scaleX(1); }
.nav-links a[aria-current="page"]::after { transform: scaleX(1); }
.header-cta { display: inline-flex; }
.menu-btn { display: none; }

/* ═══════════════════════════════════════════════════════════════════════════
   SECTIONS
   ═══════════════════════════════════════════════════════════════════════════ */

section { position: relative; }
.sec-pad { padding-top: clamp(60px, 8.5vw, 104px); padding-bottom: clamp(60px, 8.5vw, 104px); }

/* ═══════════════════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════════════════ */

.site-footer {
  background: var(--bg-deep);
  border-top: 1px solid var(--line);
  padding: clamp(56px, 7vw, 80px) 0 36px;
}
.footer-top {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: clamp(36px, 5vw, 64px);
}
.footer-brand img { height: 26px; width: auto; margin-bottom: 22px; }
.footer-brand p { font-size: 0.98rem; color: var(--text-2); max-width: 380px; line-height: 1.6; }
.footer-brand .loc { margin-top: 18px; color: var(--text-3); font-size: 0.9rem; }
.footer-col h4 {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 18px;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.footer-col a {
  font-size: 0.96rem;
  color: var(--text-2);
  transition: color 0.2s var(--ease);
  display: inline-block;
}
.footer-col a:hover { color: var(--accent-text); }
.footer-col a:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; border-radius: 3px; color: #fff; }
.footer-bottom {
  margin-top: clamp(48px, 6vw, 64px);
  padding-top: 28px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-bottom p { font-size: 0.86rem; color: var(--text-3); }
.footer-bottom .fb-links { display: flex; gap: 22px; }
.footer-bottom .fb-links a { font-size: 0.86rem; color: var(--text-3); transition: color 0.2s var(--ease); }
.footer-bottom .fb-links a:hover { color: var(--accent-text); }
.footer-bottom .fb-links a:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; border-radius: 3px; }

/* ═══════════════════════════════════════════════════════════════════════════
   REVEAL ANIMATIONS
   ═══════════════════════════════════════════════════════════════════════════ */

.reveal { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  }
  .js .reveal.in { opacity: 1; transform: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 980px) {
  /* Responsive grid collapsing handled in page-specific CSS */
}

@media (max-width: 760px) {
  .nav-links, .header-cta { display: none; }
  .menu-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    background: var(--accent);
    color: #0A0A0B;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 11px 18px;
    border-radius: var(--r-pill);
    border: none;
    cursor: pointer;
    transition: transform 0.2s var(--ease), background-color 0.2s var(--ease);
  }
  .menu-btn:hover { transform: translateY(-1px); background: #F2843E; }
  .menu-btn:active { transform: translateY(0); }
  .menu-btn:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   LEDGER SYSTEM (v2)
   ─────────────────────────────────────────────────────────────────────────────
   ADDITIVE ONLY. Shared chrome for the "Ledger" design direction.
   Nothing above this block is modified. Future Ledger pages add
   `class="ledger-page"` to <body>; that opt-in scopes every rule that would
   otherwise collide with the existing shared components. Pages WITHOUT that
   class (e.g. commercial-contractors) keep the original rules above verbatim.
   Genuinely new class names (rail, dot, mono, sec-head) are global and cannot
   collide. Source of truth: explore/directions/02-ledger.html inline <style>.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── New tokens (additive) ──────────────────────────────────────────────── */
:root {
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --rail-w: 64px;
  --r-sharp: 6px;
}

/* ── Mono micro-label primitive (new global names) ──────────────────────── */
.mono {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  font-feature-settings: "tnum" 1;
}
.mono-num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ── Status dot (new global names) ──────────────────────────────────────── */
.dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--status);
  box-shadow: 0 0 0 3px rgba(111,207,151,0.16);
  flex: none;
}
.dot.amber { background: var(--accent); box-shadow: 0 0 0 3px rgba(232,114,44,0.18); }
.dot.live { position: relative; }
@media (prefers-reduced-motion: no-preference) {
  .dot.live::after {
    content: ""; position: absolute; inset: -3px; border-radius: 50%;
    border: 1px solid var(--status); opacity: 0;
    animation: pulse 2.6s var(--ease) infinite;
  }
  .dot.amber.live::after { border-color: var(--accent); }
}
@keyframes pulse {
  0% { transform: scale(0.8); opacity: 0.7; }
  70%, 100% { transform: scale(2.2); opacity: 0; }
}

/* ── META-RAIL system (new global names) ────────────────────────────────── */
.meta-rail {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--rail-w);
  z-index: 90;
  border-right: 1px solid var(--line);
  background: rgba(10,10,11,0.6);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
}
.rail-mark {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: #fff;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  cursor: pointer;
}
.rail-mark:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; border-radius: 3px; }
.rail-index {
  display: flex;
  flex-direction: column;
  gap: 13px;
  align-items: center;
}
.rail-tick {
  display: grid;
  place-items: center;
  width: 30px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  color: var(--text-3);
  transition: color 0.25s var(--ease);
  position: relative;
  padding: 2px 0;
}
.rail-tick::before {
  content: ""; position: absolute; left: -1px; top: 50%;
  width: 5px; height: 16px;
  background: var(--accent);
  transform: translateY(-50%) scaleY(0);
  transition: transform 0.25s var(--ease);
}
.rail-tick:hover { color: var(--text-2); }
.rail-tick.active { color: var(--accent-text); }
.rail-tick.active::before { transform: translateY(-50%) scaleY(0.875); } /* 14px visual */
.rail-live {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
}
.rail-live .mono { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 0.6rem; color: var(--status); letter-spacing: 0.16em; }

/* ── Section-head lattice — scoped (name could recur elsewhere) ─────────── */
.ledger-page .sec-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding-bottom: 16px;
  margin-bottom: clamp(36px, 5vw, 56px);
  border-bottom: 1px solid var(--line-2);
}
.ledger-page .sec-head .sh-num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--accent-text);
  flex: none;
}
.ledger-page .sec-head .sh-label { color: var(--text-3); }
.ledger-page .sec-head .sh-spacer { flex: 1; height: 1px; }

/* ── Hero engineered grid overlay — scoped ──────────────────────────────── */
.ledger-page .hero { position: relative; overflow: hidden; }
.ledger-page .hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(90deg, var(--line) 1px, transparent 1px),
    linear-gradient(var(--line) 1px, transparent 1px);
  background-size: clamp(60px, 8vw, 96px) clamp(60px, 8vw, 96px);
  -webkit-mask-image: radial-gradient(120% 90% at 30% 30%, #000 0%, transparent 75%);
  mask-image: radial-gradient(120% 90% at 30% 30%, #000 0%, transparent 75%);
  opacity: 0.7;
  z-index: 0;
  pointer-events: none;
}

/* ── Content offset for the rail — scoped ───────────────────────────────── */
.ledger-page .page { margin-left: var(--rail-w); }

/* ── Header shifted right of rail — scoped (theme default is left:0) ─────── */
.ledger-page .site-header { left: var(--rail-w); }
.ledger-page .site-header.scrolled {
  background: rgba(10,10,11,0.82);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}

/* ── Nav links: mono uppercase with num prefix — scoped ─────────────────── */
.ledger-page .nav-links a {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
  transition: color 0.2s var(--ease);
  position: relative;
  padding: 5px 0;
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
}
.ledger-page .nav-links a .nl-num { color: var(--text-3); font-size: 0.66rem; transition: color 0.2s var(--ease); }
.ledger-page .nav-links a:hover { color: #fff; }
.ledger-page .nav-links a:hover .nl-num { color: var(--accent-text); }
.ledger-page .nav-links a:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; border-radius: 3px; color: #fff; }
.ledger-page .nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
}
.ledger-page .nav-links a:hover::after { transform: scaleX(1); }

/* ── Buttons: sharp radius only (colors/hover inherit theme) — scoped ───── */
.ledger-page .btn { border-radius: var(--r-sharp); }
.ledger-page .menu-btn { border-radius: var(--r-sharp); }

/* ── Text link: mono uppercase with growing rule — scoped (full override) ─ */
.ledger-page .tlink {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-text);
  border-bottom: 0;
  padding-bottom: 0;
  transition: gap 0.2s var(--ease), color 0.2s var(--ease);
}
.ledger-page .tlink::before {
  content: ""; width: 24px; height: 1px;
  margin-right: -8px; /* box is full-size; scaleX shows 16px at rest, no layout shift on hover */
  background: var(--accent-line);
  transform: scaleX(0.667);
  transform-origin: left center;
  transition: transform 0.2s var(--ease), background-color 0.2s var(--ease);
}
.ledger-page .tlink:hover { gap: 13px; color: #F7A878; border-color: transparent; }
.ledger-page .tlink:hover::before { transform: scaleX(1); background: var(--accent); }
.ledger-page .tlink:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 4px; border-radius: 2px; }
.ledger-page .tlink .arr { transition: transform 0.2s var(--ease); }
.ledger-page .tlink:hover .arr { transform: translateX(2px); }
.ledger-page .invert .tlink { color: #B85316; border-color: transparent; }
.ledger-page .invert .tlink::before { background: rgba(184,83,22,0.4); }
.ledger-page .invert .tlink:hover { color: #9C4310; border-color: transparent; }
.ledger-page .invert .tlink:hover::before { background: #B85316; }

/* ── Footer mono bits — scoped (image wordmark handled by existing rules) ─ */
.ledger-page .footer-bottom p { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.04em; color: var(--text-3); }
.ledger-page .footer-bottom .fbl a { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-3); transition: color 0.2s var(--ease); }
.ledger-page .footer-bottom .fbl a:hover { color: var(--accent-text); }
.ledger-page .footer-bottom .fbl a:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; border-radius: 3px; }

/* ── Responsive: rail is a desktop flourish — remove it entirely on mobile ──
   Reclaims the fixed-width strip (was eating ~12% of a 375px iPhone screen)
   and drops one of the fixed + backdrop-filter layers stacking over the
   hero canvas, which is measurably expensive to composite on iOS Safari.
   --rail-w:0 cascades to .page's margin-left and .site-header's left (both
   read the variable), so nothing else needs to change. ─────────────────── */
@media (max-width: 760px) {
  .ledger-page { --rail-w: 0px; }
  .ledger-page .meta-rail { display: none; }
  /* shared footer collapse for Ledger pages */
  .ledger-page .footer-top { grid-template-columns: 1fr; }
  .ledger-page .footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* ── Mobile perf: drop backdrop-filter, keep the same visual read ──────────
   backdrop-filter is one of the more expensive GPU composites on iOS Safari,
   worse still when the element sits over a continuously-animating canvas
   (the hero). A slightly more opaque flat background reads almost
   identically without the blur pass. Scoped to the fixed header only — the
   rail is gone on mobile and the founder-tag chip is handled alongside it
   in index.html (not a fixed/scroll-heavy element, lower priority, same
   pattern if it turns out to matter). ────────────────────────────────────── */
@media (max-width: 760px) {
  .site-header.scrolled,
  .ledger-page .site-header.scrolled {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: rgba(10,10,11,0.94);
  }
  html[data-theme="light"] .site-header.scrolled,
  html[data-theme="light"] .ledger-page .site-header.scrolled {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: rgba(255,255,255,0.96);
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   LIGHT THEME — "Contrast" palette  (data-theme="light" on <html>)
   ─────────────────────────────────────────────────────────────────────────────
   ADDITIVE ONLY. When html[data-theme="light"] is absent (or "dark"), everything
   above renders unchanged — this block never applies. When present, it overrides
   the dark tokens to the approved Contrast light look (explore/light/contrast.html)
   and adapts the handful of components that hardcode dark values in the page
   <style> blocks (white headings, amber glows, the inverted PROOF band).
   Only overrides what differs. Amber FILLS keep dark text on them.
   ═══════════════════════════════════════════════════════════════════════════ */

html[data-theme="light"] {
  /* ── Accent — amber FILL stays #E8722C (dark text on it); TEXT amber goes
        darker for AA on white ── */
  --accent:        #E8722C;
  --accent-text:   #BE531A;        /* AA amber for text/links on white */
  --accent-soft:   rgba(232, 114, 44, 0.10);
  --accent-line:   rgba(232, 114, 44, 0.40);

  /* ── Backgrounds — white base, recessed light surfaces ── */
  --bg: #FFFFFF;
  --bg-deep: #F6F6F8;
  --surface: #F6F6F8;
  --surface-soft: rgba(10, 10, 11, 0.025);
  --surface-hover: rgba(10, 10, 11, 0.05);

  /* ── Inverted band → now DARK (the one contrasting band on a light site) ── */
  --invert-bg: #0A0A0B;
  --invert-ink: #FFFFFF;
  --invert-soft: #A9A9B0;

  /* ── Text — near-black ramp on white ── */
  --text: #0A0A0B;
  --text-2: #4A4A52;
  --text-3: #7C7C86;

  /* ── Lines — visible hairlines on white ── */
  --line: rgba(10, 10, 11, 0.12);
  --line-2: rgba(10, 10, 11, 0.16);
  --line-strong: rgba(10, 10, 11, 0.20);

  /* ── Status — green that reads on white ── */
  --status: #2E9E5B;

  /* ── Shadows — crisp light offsets, no dark glow ── */
  --shadow-card: 0 2px 0 rgba(10,10,11,0.04), 0 18px 40px -26px rgba(10,10,11,0.22);
  --shadow-float: 0 2px 0 rgba(10,10,11,0.05), 0 30px 60px -34px rgba(10,10,11,0.30);
}

/* ── Body-level selection tint on light ── */
html[data-theme="light"] body { background: var(--bg); color: var(--text); }
html[data-theme="light"] ::selection { background: rgba(232,114,44,0.24); color: #0A0A0B; }

/* ── Ghost buttons: light surface + darker amber focus ── */
html[data-theme="light"] .btn:focus-visible { outline-color: var(--accent-text); }
html[data-theme="light"] .btn-ghost { color: var(--text); border-color: var(--line-strong); }
html[data-theme="light"] .btn-ghost:hover { background: rgba(10,10,11,0.04); border-color: rgba(10,10,11,0.40); }
html[data-theme="light"] .btn-ghost:active { background: rgba(10,10,11,0.02); }

/* ── Header: white glass on scroll ── */
html[data-theme="light"] .site-header.scrolled {
  background: rgba(255,255,255,0.86);
  border-bottom-color: var(--line-strong);
}
html[data-theme="light"] .ledger-page .site-header.scrolled {
  background: rgba(255,255,255,0.86);
  border-bottom-color: var(--line-strong);
}

/* ── Nav hover ink → near-black (dark theme forced #fff) ── */
html[data-theme="light"] .ledger-page .nav-links a:hover,
html[data-theme="light"] .ledger-page .nav-links a:focus-visible { color: var(--text); }

/* ── Meta-rail: light glass, hairline visible ── */
html[data-theme="light"] .meta-rail {
  border-right-color: var(--line-strong);
  background: rgba(255,255,255,0.75);
}
html[data-theme="light"] .rail-mark { color: var(--text); }
html[data-theme="light"] .rail-tick:hover { color: var(--text); }

/* ── Status dot rings tuned for green-on-white ── */
html[data-theme="light"] .dot { box-shadow: 0 0 0 3px rgba(46,158,91,0.16); }
html[data-theme="light"] .dot.amber { box-shadow: 0 0 0 3px rgba(232,114,44,0.20); }

/* ── tlink hover on light ── */
html[data-theme="light"] .ledger-page .tlink:hover { color: #A6470F; }

/* ═══ HERO / SECTION HEADINGS — page <style> hardcodes color:#fff ═══
   Flip every forced-white heading to near-black ink on light. ── */
html[data-theme="light"] .ledger-page .hero h1,
html[data-theme="light"] .ledger-page .htl-cell .htl-v,
html[data-theme="light"] .ledger-page .wwd-intro h2,
html[data-theme="light"] .ledger-page .pillar-id h3,
html[data-theme="light"] .ledger-page .pillar-id .pid-body .em,
html[data-theme="light"] .ledger-page .process-head h2,
html[data-theme="light"] .ledger-page .ledger-step h3,
html[data-theme="light"] .ledger-page .audit-left h2,
html[data-theme="light"] .ledger-page .audit-list li b,
html[data-theme="light"] .ledger-page .founder-copy h2,
html[data-theme="light"] .ledger-page .final h2,
html[data-theme="light"] .ledger-page .fhero-copy h1,
html[data-theme="light"] .ledger-page .fhero-plate .fp-name,
html[data-theme="light"] .ledger-page .fbody-aside .fb-title,
html[data-theme="light"] .ledger-page .pr-row h3 { color: var(--text); }

/* ── Hero grid overlay was masked at 0.7 over dark; keep the mask but the
      hairline var already flips to dark-on-white via --line ── */
html[data-theme="light"] .ledger-page .hero::before,
html[data-theme="light"] .ledger-page .fhero::before { opacity: 1; }

/* ── Hero glow → faint amber wash on white, no dark radial ── */
html[data-theme="light"] .ledger-page .hero-glow {
  background: radial-gradient(110% 70% at 22% 118%, rgba(232,114,44,0.14) 0%, rgba(232,114,44,0.05) 34%, rgba(232,114,44,0) 62%);
}
html[data-theme="light"] .ledger-page .fhero-glow {
  background: radial-gradient(100% 70% at 78% 118%, rgba(232,114,44,0.13) 0%, rgba(232,114,44,0.05) 34%, rgba(232,114,44,0) 62%);
}

/* ── hm-tag: give it a white chip on light so it reads on the glow ── */
html[data-theme="light"] .ledger-page .hero-meta .hm-tag { background: #fff; }

/* ── Spec table: white card, crisp shadow (dark used a translucent gradient) ── */
html[data-theme="light"] .ledger-page .spec {
  background: #fff;
  box-shadow: var(--shadow-card);
}
html[data-theme="light"] .ledger-page .hero-throughline {
  background: #fff;
  box-shadow: var(--shadow-card);
}

/* ── Mechanism / node / principle marks: drop the dark amber glow ── */
html[data-theme="light"] .ledger-page .spec-cell .mech-li .mk { box-shadow: none; }
html[data-theme="light"] .ledger-page .ledger-step .ls-node { background: #fff; }
html[data-theme="light"] .ledger-page .ledger-step .ls-node span { box-shadow: none; }
html[data-theme="light"] .ledger-page .pr-idx::before { box-shadow: none; }

/* ── Process / ledger / audit-list step number color to full ink on light ── */
html[data-theme="light"] .ledger-page .ledger-step .ls-num { color: var(--text); }

/* ── Ledger + process tables: white card + shadow (were transparent on dark) ── */
html[data-theme="light"] .ledger-page .ledger {
  background: #fff;
  box-shadow: var(--shadow-card);
}

/* ── Audit soft glow → lighter amber on white ── */
html[data-theme="light"] .ledger-page .audit::before {
  background: radial-gradient(50% 50% at 50% 50%, rgba(232,114,44,0.08) 0%, rgba(232,114,44,0.02) 42%, rgba(232,114,44,0) 70%);
}

/* ═══ PROOF band → DARK on a light site (the one contrasting band) ═══
   invert tokens already flipped above; the page <style> hardcodes a couple
   of light-band values that must go dark. ── */
html[data-theme="light"] .ledger-page .proof .sec-head { border-bottom-color: rgba(255,255,255,0.18); }
html[data-theme="light"] .ledger-page .proof .sec-head .sh-num { color: #F2935A; }
html[data-theme="light"] .ledger-page .proof-quote blockquote .qmark { color: #F2935A; }
html[data-theme="light"] .ledger-page .proof-foot { border-top-color: rgba(255,255,255,0.18); }

/* ── Founder photo card surface → white on light ── */
html[data-theme="light"] .ledger-page .founder-photo { background: #fff; }

/* ── FINAL CTA glows → faint amber on white ── */
html[data-theme="light"] .ledger-page .final::before {
  background: radial-gradient(56% 70% at 50% 100%, rgba(232,114,44,0.12) 0%, rgba(232,114,44,0.03) 42%, rgba(232,114,44,0) 72%);
}

/* ── Footer border strengthened on white ── */
html[data-theme="light"] .site-footer { border-top-color: var(--line-strong); }

/* ═══ THEME TOGGLE BUTTON — inherits currentColor so it works in both bands ═══ */
/* (defined globally below, unscoped) */

/* ── WORDMARK SWAP: dark shows white mark, light shows dark mark ── */
.wm-light { display: none; }
html[data-theme="light"] .wm-dark { display: none; }
html[data-theme="light"] .wm-light { display: block; }

/* ═══════════════════════════════════════════════════════════════════════════
   THEME TOGGLE — sliding sun/moon pill (vanilla). Both icons always show;
   the thumb slides over the active side. Dark = moon (right), light = sun
   (left). Markup: button.theme-toggle > span.tt-thumb + .ico-sun + .ico-moon
   ═══════════════════════════════════════════════════════════════════════════ */
.theme-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 62px;
  height: 32px;
  padding: 0 8px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-2);
  background: var(--surface-soft);
  color: var(--text-3);
  cursor: pointer;
  flex: none;
  transition: border-color 0.25s var(--ease), background-color 0.25s var(--ease);
}
.theme-toggle svg { width: 15px; height: 15px; display: block; position: relative; z-index: 1; transition: color 0.25s var(--ease), opacity 0.25s var(--ease); }
.theme-toggle .tt-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: #26262B;
  border: 1px solid var(--line-2);
  box-shadow: 0 2px 6px -2px rgba(0,0,0,0.6);
  transform: translateX(29px); /* dark default: thumb over the moon */
  transition: transform 0.3s var(--ease), background-color 0.25s var(--ease), border-color 0.25s var(--ease);
  z-index: 0;
  pointer-events: none;
}
.theme-toggle .ico-moon { color: var(--accent-text); }          /* active side, dark */
.theme-toggle .ico-sun { color: var(--text-3); opacity: 0.75; } /* resting side, dark */
html[data-theme="light"] .theme-toggle { background: rgba(10,10,11,0.04); }
html[data-theme="light"] .theme-toggle .tt-thumb {
  transform: translateX(0);
  background: #fff;
  border-color: var(--line-strong);
  box-shadow: 0 2px 6px -3px rgba(10,10,11,0.35);
}
html[data-theme="light"] .theme-toggle .ico-sun { color: var(--accent-text); opacity: 1; }
html[data-theme="light"] .theme-toggle .ico-moon { color: var(--text-3); opacity: 0.75; }
.theme-toggle:hover { border-color: var(--accent-line); }
.theme-toggle:hover .tt-thumb { border-color: var(--accent-line); }
.theme-toggle:active .tt-thumb { transform: translateX(29px) scale(0.94); }
html[data-theme="light"] .theme-toggle:active .tt-thumb { transform: translateX(0) scale(0.94); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; }

/* Keep the toggle reachable on mobile even when nav-links + header-cta collapse.
   The theme default (760px) and both Ledger pages hide .nav-links/.header-cta;
   the toggle must survive. It sits in .nav next to the menu button. */
@media (max-width: 760px) {
  .theme-toggle { width: 62px; height: 32px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   KINETIC MOTION LAYER — shared CSS start-states for /motion.js
   ─────────────────────────────────────────────────────────────────────────────
   ADDITIVE ONLY. Two gate classes on <html>:
   - .kinetic-pre — set by a tiny inline <head> script (no network dependency)
     when reduced-motion is off; arms ONLY the hero for the load-in so there is
     no flash. motion.js removes it after the entrance (or immediately if the
     GSAP CDN failed), so content can never stay hidden.
   - .kinetic — set by motion.js once GSAP+ScrollTrigger are confirmed; arms
     the scroll-driven start-states (rail progress, ledger rule, node lights).
   No JS / reduced motion → neither class → page renders at rest.
   ═══════════════════════════════════════════════════════════════════════════ */

/* Lenis owns scrolling when motion is on. CSS smooth-scroll must be OFF or
   the browser re-animates every scroll write Lenis makes, which reads as
   rubbery, laggy wheel scrolling. Anchor jumps go through lenis.scrollTo. */
html.kinetic { scroll-behavior: auto; }

/* Hero load-in arm (kinetic-pre): children start invisible, GSAP fades them in */
html.kinetic-pre .ledger-page .hero-inner > *,
html.kinetic-pre .ledger-page .fhero-inner > * { opacity: 0; }

/* Scroll-progress fill riding the meta-rail's right edge */
.rail-progress {
  position: absolute;
  top: 0;
  right: -1px;
  width: 2px;
  height: 100%;
  transform: scaleY(0);
  transform-origin: top center;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-text) 100%);
  pointer-events: none;
  z-index: 2;
  will-change: transform;
}
html:not(.kinetic) .rail-progress { display: none; }

/* Ledger connecting rule: drawn on enter. motion.js tweens --rule-scale on
   .ledger; the ::before reads it. Starts collapsed only when .kinetic armed. */
html.kinetic .ledger-page .ledger { --rule-scale: 0; }
html.kinetic .ledger-page .ledger::before {
  transform: scaleX(var(--rule-scale, 0));
  transform-origin: left center;
  will-change: transform;
}
@media (max-width: 760px) {
  /* rule is vertical on mobile — draw top→bottom instead */
  html.kinetic .ledger-page .ledger::before {
    transform: scaleY(var(--rule-scale, 0));
    transform-origin: top center;
  }
}

/* Ledger step nodes: dim until lit in sequence */
html.kinetic .ledger-page .ledger-step .ls-node {
  border-color: var(--line-2);
  transition: border-color 0.3s var(--ease);
}
html.kinetic .ledger-page .ledger-step .ls-node span {
  opacity: 0;
  transform: scale(0.3);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
  will-change: transform, opacity;
}
html.kinetic .ledger-page .ledger-step.lit .ls-node { border-color: var(--accent-line); }
html.kinetic .ledger-page .ledger-step.lit .ls-node span { opacity: 1; transform: scale(1); }

/* Count-up figures hold layout with tabular nums while the value climbs */
[data-count] { font-variant-numeric: tabular-nums; }

/* Meta-rail active tick: crisper mechanical snap under motion */
html.kinetic .rail-tick::before { transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1); }
html.kinetic .rail-tick.active::before { transform: translateY(-50%) scaleY(1); }

/* Proof-quote word spans (motion.js wraps words for the scrubbed read-in) */
.pq-w { display: inline-block; }

/* Reduced motion: strip every kinetic state. Belt-and-suspenders alongside
   the JS guard (motion.js never adds .kinetic under reduce). */
@media (prefers-reduced-motion: reduce) {
  html.kinetic-pre .ledger-page .hero-inner > *,
  html.kinetic-pre .ledger-page .fhero-inner > * { opacity: 1 !important; }
  html.kinetic .ledger-page .ledger::before { transform: none !important; }
  html.kinetic .ledger-page .ledger-step .ls-node span { opacity: 1 !important; transform: none !important; }
  .rail-progress { display: none !important; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   SKIP LINK — keyboard users jump past the rail + nav (WCAG 2.4.1).
   Hidden off-screen via transform (no layout animation), revealed on focus.
   ═══════════════════════════════════════════════════════════════════════════ */
.skip-link {
  position: fixed;
  top: 12px; left: 12px;
  z-index: 200;
  background: var(--accent);
  color: #0A0A0B;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 11px 18px;
  border-radius: var(--r-sharp, 6px);
  transform: translateY(-200%);
  transition: transform 0.2s var(--ease);
}
.skip-link:focus-visible {
  transform: none;
  outline: 2px solid var(--accent-text);
  outline-offset: 3px;
}

/* ── Touch targets: comfortable tap areas where links run small on phones ── */
@media (max-width: 760px) {
  .footer-col a { padding: 8px 0; }
  .footer-bottom .fbl a, .footer-bottom .fb-links a { padding: 10px 0; display: inline-block; }
  .ledger-page .tlink { padding-top: 8px; padding-bottom: 8px; }
}
