/* ============================================================
   ANTI-SLOP DESIGN SYSTEM — Theme #17 warm editorial (locked)
   Palette: forest #2f4a3c · copper #a67c4e · cream #f4efe6 ·
   cream-deep #ebe4d8 · ink-muted #5c6b63 · rule #d4cbb8.
   Forbidden: #0c0e13, #d9f65b, indigo/violet heroes.
   Type roles: Fraunces display · Source Sans 3 calm body ·
   IBM Plex Mono meta. Radius 2–4px. Spacing base 8.
   Motion: one ease, transform/opacity only, scrub via CSS vars
   (--page-progress / --hero-progress / --flagship-progress) with
   native view() timelines when supported. No WebGL, no particles.
   ============================================================ */

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

html {
  scroll-behavior: smooth;
  color-scheme: light;
}

:root {
  /* --- Surfaces (warm cream ramp) --- */
  --cream: #f4efe6; /* page */
  --cream-deep: #ebe4d8; /* raised band */
  --surface: #faf8f3; /* card */
  --surface-deep: #e5dcca; /* chrome / hover */

  /* --- Text --- */
  --ink: #1d211d;
  --ink-soft: #3d453e;
  --ink-muted: #5c6b63;

  /* --- Lines --- */
  --rule: #d4cbb8;
  --rule-strong: #c2b69d;

  /* --- Forest (invert bands, primary actions) --- */
  --forest: #2f4a3c;
  --forest-dark: #243a30;
  --forest-deep: #1a2e24;
  --invert-line: rgba(244, 239, 230, 0.22);

  /* --- Copper (the one accent) --- */
  --copper: #a67c4e;
  --copper-deep: #8a6238; /* on cream */
  --copper-bright: #c9a06e; /* on forest */
  --copper-dim: rgba(166, 124, 78, 0.5);
  --copper-soft: rgba(166, 124, 78, 0.1);

  /* --- Status --- */
  --fail: #8c3d2a;

  --radius: 0.1875rem; /* 3px — editorial, not pill */
  --radius-lg: 0.25rem; /* 4px */

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Source Sans 3", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  /* 8px spacing scale */
  --s-1: 0.5rem;
  --s-2: 1rem;
  --s-3: 1.5rem;
  --s-4: 2rem;
  --s-6: 3rem;
  --s-8: 4rem;
  --s-12: 6rem;
  --section-y: clamp(4rem, 2.5rem + 6vw, 9rem);

  --space: clamp(1.25rem, 4vw, 2.5rem);
  --max: 1200px;
  --max-wide: 1240px;

  /* One motion language */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-micro: 0.3s;
  --dur-hover: 0.35s;
  --dur-reveal: 0.75s;
  --dur-slow: 0.95s;
  --hover-scale: 1.04;
  --measure: 62ch;
  --page-progress: 0;
  --flagship-progress: 0;
  --hero-progress: 0;
}

::selection {
  background: var(--copper);
  color: var(--cream);
}

body {
  background: var(--cream);
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  min-height: 100dvh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
}

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

.skip-link {
  position: absolute;
  left: var(--space);
  top: -4rem;
  z-index: 200;
  background: var(--copper);
  color: var(--cream);
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 0.75rem;
}

/* ============ Navigation ============ */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  isolation: isolate;
  height: 4rem;
  backdrop-filter: blur(14px);
  background: rgba(244, 239, 230, 0.86);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.site-nav.is-scrolled {
  border-bottom-color: var(--rule);
}

/* Reading progress hairline — signal scrub. --page-progress fallback,
   native scroll() timeline when supported. */
@media (prefers-reduced-motion: no-preference) {
  .site-nav::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    bottom: -1.5px;
    height: 3px;
    background: var(--copper);
    transform: scaleX(var(--page-progress, 0));
    transform-origin: 0 50%;
    pointer-events: none;
  }

  @supports (animation-timeline: scroll()) {
    .site-nav::after {
      animation: nav-progress linear both;
      animation-timeline: scroll();
    }
  }
}

@keyframes nav-progress {
  to {
    transform: scaleX(1);
  }
}

@keyframes menu-in {
  from {
    opacity: 0;
    translate: 0 -8px;
  }

  to {
    opacity: 1;
    translate: 0 0;
  }
}

.nav-inner {
  max-width: var(--max-wide);
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--space);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-brand:hover {
  color: var(--forest);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  list-style: none;
}

.nav-links a {
  position: relative;
  text-decoration: none;
  color: var(--ink-muted);
  font-size: 0.92rem;
  font-weight: 500;
  transition: color var(--dur-micro) var(--ease);
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.3rem;
  height: 1px;
  background: var(--copper);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform var(--dur-micro) var(--ease);
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--forest);
}

.nav-links a:hover::after,
.nav-links a[aria-current="page"]::after {
  transform: scaleX(1);
}

.nav-cta {
  color: var(--forest) !important;
  font-weight: 600 !important;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--rule-strong);
  background: transparent;
  color: var(--ink);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius);
  cursor: pointer;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--space);
}

/* ============ Hero — asymmetric product opener ============ */
.hero {
  border-bottom: 1px solid var(--rule);
  background:
    radial-gradient(120% 90% at 85% -10%, rgba(166, 124, 78, 0.07), transparent 55%),
    var(--cream);
  /* Scrub transforms must never widen the page */
  overflow-x: clip;
}

.hero-inner {
  padding: clamp(1.25rem, 4vh, var(--s-4)) 0 clamp(var(--s-6), 9vh, 5.5rem);
}

.hero-grid {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: clamp(var(--s-4), 5vw, var(--s-8));
  align-items: start;
}

.hero-text {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.kicker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--forest);
  margin-bottom: var(--s-3);
}

/* Type-led break: the claim runs full-width above the 7/5 grid,
   not boxed into a bilateral column. */
.hero-claim {
  margin-bottom: clamp(var(--s-3), 4vw, var(--s-6));
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 1.2rem + 5vw, 5rem);
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 1.02;
  max-width: 18ch;
  color: var(--ink);
  text-wrap: balance;
}

.hero .lede {
  color: var(--ink-soft);
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  max-width: var(--measure);
  margin-bottom: var(--s-4);
  line-height: 1.7;
  text-wrap: pretty;
}

/* Instrument readout — proof once, near the claim */
.hero-proof {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--copper);
  border-radius: var(--radius);
  padding: var(--s-2) var(--s-3);
  margin-bottom: var(--s-4);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.proof-metric {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.proof-value {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.032em;
  color: var(--forest);
}

.proof-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.proof-status {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.proof-status strong {
  color: var(--fail);
  font-weight: 600;
}

/* Exhibit still drops below the claim baseline — asymmetric beat */
.hero-grid .hero-media {
  margin-top: clamp(var(--s-2), 3vw, var(--s-6));
}

.hero-media img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 0 rgba(26, 23, 20, 0.04), 0 24px 48px -36px rgba(26, 23, 20, 0.3);
}

/* Hero scrub beat — resolves onto the proof + CTA (narrative payoff).
   Driven directly by --hero-progress (0–1, written every frame in JS),
   so it scrubs identically in every browser and is capture-able:
   the claim recedes, the exhibit drifts, the cue rule drains — while
   the proof panel settles forward and the CTA row stays anchored, so
   a scrub capture ends framed on 43%→1% / safety_acceptance / Enter.
   Transform/opacity only. */
@media (prefers-reduced-motion: no-preference) {
  .hero-claim {
    translate: 0 calc(var(--hero-progress, 0) * -52px);
    opacity: calc(1 - var(--hero-progress, 0) * 0.75);
  }

  .hero-grid .hero-media img {
    translate: 0 calc(var(--hero-progress, 0) * -92px);
    scale: calc(1 - var(--hero-progress, 0) * 0.04);
    opacity: calc(1 - var(--hero-progress, 0) * 0.45);
  }

  /* The payoff comes forward instead of fading out. Desktop only:
     at stacked widths the panel is full-bleed and growth would poke
     past the viewport (the mobile payoff is the sticky Email CTA). */
  @media (min-width: 901px) {
    .hero-proof {
      scale: calc(1 + var(--hero-progress, 0) * 0.02);
      transform-origin: 0 50%;
    }
  }
}

/* Wordless cue: a copper rule that drains as the hero is read */
.scroll-cue {
  margin-top: var(--s-4);
}

.cue-rule {
  display: inline-block;
  width: 3.5rem;
  height: 2px;
  background: var(--copper);
  transform-origin: 0 50%;
}

@media (prefers-reduced-motion: no-preference) {
  .cue-rule {
    transform: scaleX(calc(1 - var(--hero-progress, 0)));
  }
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: var(--s-3);
}

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-block-size: 3rem;
  padding: 0.625rem var(--s-3);
  font-weight: 600;
  font-size: 0.96rem;
  text-decoration: none;
  border-radius: var(--radius);
  border: 1.5px solid transparent;
  transition:
    background-color var(--dur-micro) var(--ease),
    border-color var(--dur-micro) var(--ease),
    color var(--dur-micro) var(--ease),
    box-shadow var(--dur-micro) var(--ease),
    transform var(--dur-micro) var(--ease);
  cursor: pointer;
  white-space: nowrap;
}

.btn[target="_blank"]::after {
  content: "↗" / "";
  font-family: var(--font-mono);
  font-size: 0.82em;
  font-weight: 500;
  opacity: 0.75;
}

@media (prefers-reduced-motion: no-preference) {
  .btn:hover {
    transform: translateY(-2px);
  }

  .btn:active {
    transform: translateY(0);
  }
}

.btn-primary {
  background: var(--forest);
  color: var(--cream);
}

.btn-primary:hover {
  background: var(--forest-dark);
  box-shadow: 0 12px 24px -12px rgba(47, 74, 60, 0.5);
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--rule-strong);
  color: var(--ink);
}

.btn-secondary:hover {
  border-color: var(--forest);
  color: var(--forest);
}

.btn-ghost {
  background: transparent;
  border-color: var(--rule);
  color: var(--ink-soft);
}

.btn-ghost:hover {
  border-color: var(--rule-strong);
  color: var(--ink);
}

.trust-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: var(--s-3);
}

.chip {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-muted);
  background: var(--cream-deep);
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--rule);
}

.chip-link {
  color: var(--ink-soft);
  text-decoration: none;
  transition:
    border-color var(--dur-micro) var(--ease),
    color var(--dur-micro) var(--ease);
}

.chip-link:hover {
  border-color: var(--forest);
  color: var(--forest);
}

/* ============ Sections + chapter openers ============ */
.section {
  padding-block: var(--section-y);
}

/* Chapter opener: oversized outlined index announces the chapter
   before content — Fable product-site rhythm. */
.section-opener {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(var(--s-3), 4vw, var(--s-6));
  align-items: start;
  border-top: 1px solid var(--rule);
  padding-top: var(--s-3);
  margin-bottom: var(--s-6);
}

.opener-index {
  font-family: var(--font-display);
  font-size: clamp(3.2rem, 2rem + 6vw, 6.5rem);
  font-weight: 600;
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: transparent;
  -webkit-text-stroke: 1px var(--ink-muted);
  user-select: none;
}

/* Index fills with signal as the chapter arrives — scrubbed, decorative */
@media (prefers-reduced-motion: no-preference) {
  @supports ((animation-timeline: view()) and (animation-range: entry)) {
    .opener-index {
      animation: index-arrive linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 28%;
    }
  }
}

@keyframes index-arrive {
  from {
    opacity: 0.25;
    translate: 0 32px;
    -webkit-text-stroke-color: var(--index-stroke-from, var(--ink-muted));
  }

  to {
    opacity: 1;
    translate: 0 0;
    -webkit-text-stroke-color: var(--index-stroke-to, var(--copper-dim));
  }
}

.section-kicker {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--copper-deep);
  margin-bottom: var(--s-2);
}

.section-title-display {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 1.2rem + 3.1vw, 3.2rem);
  font-weight: 600;
  letter-spacing: -0.042em;
  margin-bottom: var(--s-2);
  line-height: 1.08;
  color: var(--ink);
  max-width: 26ch;
  text-wrap: balance;
}

.section-lede-display {
  color: var(--ink-soft);
  max-width: var(--measure);
  font-size: 1.15rem;
  line-height: 1.7;
  text-wrap: pretty;
}

/* Archival stills — screenshots are flattened to a warm monochrome so
   nothing in-frame reads as a live control (no blue CTAs). Exhibits,
   not embeds. */
.hero-media img,
.chapter-media img,
.work-visual img {
  filter: grayscale(1) sepia(0.32) contrast(0.92) brightness(1.05);
}

/* ============ Flagship — pinned chapter storytelling ============ */
.flagship-section {
  background: var(--cream-deep);
  border-bottom: 1px solid var(--rule);
  padding: 0;
}

.flagship-container {
  display: grid;
  grid-template-columns: 14rem 1fr;
  gap: 0;
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: var(--section-y) var(--space);
}

/* LATCH — do not change this structure.
   Desktop: unwrap so nav + content stay the 14rem | 1fr grid items.
   Stacked: this box is the tall parent sticky travels through. */
.flagship-track {
  display: contents;
}

/* The sticky box is .chapters-nav — always a direct child of the tall
   track, never a short wrapper. No transforms/animations on it. */
.chapters-nav {
  position: sticky;
  top: 5rem;
  align-self: start;
  z-index: 20;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  counter-reset: chapter;
}

/* Dossier progress tick: --flagship-progress 0–1 (JS). Desktop = left
   rail growth; stacked layouts restyle to a bottom hairline. */
@media (prefers-reduced-motion: no-preference) {
  .chapters-nav::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 2px;
    height: 100%;
    background: var(--copper);
    transform: scaleY(var(--flagship-progress, 0));
    transform-origin: 0 0;
    pointer-events: none;
  }
}

.chapter-link {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-muted);
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border-left: 2px solid transparent;
  border-radius: 0 var(--radius) var(--radius) 0;
  counter-increment: chapter;
  transition:
    color var(--dur-micro) var(--ease),
    background-color var(--dur-micro) var(--ease),
    border-color var(--dur-micro) var(--ease);
}

.chapter-link::before {
  content: counter(chapter, decimal-leading-zero) / "";
  font-size: 0.68rem;
  color: var(--copper-deep);
  margin-right: 0.75ch;
  letter-spacing: 0.04em;
}

.chapter-link:hover,
.chapter-link.is-active {
  color: var(--forest);
  background: rgba(47, 74, 60, 0.07);
}

.chapter-link.is-active {
  border-left-color: var(--copper);
}

/* Read chapters stay lit on the rail — dim signal, not a second widget */
.chapter-link.is-past {
  color: var(--copper-deep);
  border-left-color: rgba(166, 124, 78, 0.4);
}

.chapter-link.is-past::before {
  color: var(--copper);
}

.flagship-content-scroll {
  max-width: 58rem;
  min-width: 0;
}

.flagship-intro {
  margin-bottom: var(--s-6);
}

.flagship-intro .section-opener {
  margin-bottom: 0;
  border-top: 0;
  padding-top: 0;
}

.flagship-intro .section-kicker {
  margin-bottom: 0.65rem;
}

.flagship-intro .chapter-role {
  margin-bottom: 0.75rem;
}

.flagship-chapter {
  margin-bottom: var(--s-8);
  scroll-margin-top: 5rem;
}

.chapter-media {
  position: relative;
  margin-bottom: var(--s-4);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 24px 48px -36px rgba(26, 23, 20, 0.25);
}

.chapter-media img {
  width: 100%;
  height: clamp(24rem, 54vh, 40rem);
  object-fit: cover;
  display: block;
}

/* Media settles into the frame as it enters — scrubbed cinema */
@media (prefers-reduced-motion: no-preference) {
  @supports ((animation-timeline: view()) and (animation-range: entry)) {
    .chapter-media img {
      animation: media-settle linear both;
      animation-timeline: view();
      animation-range: entry 5% cover 45%;
    }
  }
}

@keyframes media-settle {
  from {
    opacity: 0.4;
    transform: scale(1.06);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Progress-driven exits — claim block, chapters, titles recede as
   they leave. Transform+opacity only. Never applied to
   .flagship-track / .chapters-nav (sticky latch). */
@media (prefers-reduced-motion: no-preference) {
  @supports ((animation-timeline: view()) and (animation-range: entry)) {
    .work-section .section-title-display,
    .wins-section .section-title-display,
    .section-title-invert,
    .work-section .section-lede-display,
    .wins-section .section-lede-display,
    .section-lede-invert {
      animation: section-exit linear both;
      animation-timeline: view();
      animation-range: exit 0% exit 85%;
    }

    .flagship-intro {
      animation: intro-exit linear both;
      animation-timeline: view();
      animation-range: exit 0% exit 70%;
    }

    /* The last chapter (Open) never ghosts: there is nothing after it
       to hand off to, and its copy must stay AA-legible. */
    .flagship-chapter:not(:last-of-type) {
      animation: chapter-exit linear both;
      animation-timeline: view();
      animation-range: exit 0% exit 62%;
    }
  }
}

@keyframes section-exit {
  to {
    opacity: 0.28;
    translate: 0 -18px;
  }
}

@keyframes intro-exit {
  to {
    opacity: 0.34;
    translate: 0 -22px;
  }
}

@keyframes chapter-exit {
  to {
    opacity: 0.3;
    translate: 0 -26px;
  }
}

.media-overlay {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.badge-mono {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  background: rgba(26, 23, 20, 0.75);
  backdrop-filter: blur(8px);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--rule);
  font-weight: 500;
}

.badge-mono.badge-fail {
  color: var(--cream);
  background: rgba(140, 61, 42, 0.88);
  border-color: rgba(140, 61, 42, 0.4);
}

.chapter-body {
  max-width: var(--measure);
}

/* Rung 2 — role (claim / evidence / method / numbers / honesty). */
.chapter-role {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--copper-deep);
  margin-bottom: 0.5rem;
}

.chapter-title {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 1.15rem + 1.1vw, 1.75rem);
  font-weight: 600;
  letter-spacing: -0.032em;
  color: var(--ink);
  margin-bottom: var(--s-2);
  text-wrap: balance;
}

.chapter-body p {
  color: var(--ink-soft);
  line-height: 1.7;
  margin-bottom: var(--s-2);
  text-wrap: pretty;
}

/* Open is the hand-off — full ink, no ghost grey */
#flagship-open .chapter-body p {
  color: var(--ink);
  font-weight: 500;
}

.chapter-body p:last-child {
  margin-bottom: 0;
}

.numbers-ledger {
  display: grid;
  gap: 0;
  margin-top: var(--s-3);
}

/* Evidence ledger — the numbers are the loudest thing in the chapter.
   Fraunces display values at ink/forest on cream (WCAG AA+). */
.ledger-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--s-4);
  align-items: baseline;
  padding: var(--s-3) 0;
  border-bottom: 1px solid var(--rule-strong);
  transition: border-color var(--dur-hover) var(--ease);
}

.ledger-row:hover {
  border-bottom-color: var(--copper);
}

.ledger-row:first-child {
  border-top: 1px solid var(--rule-strong);
}

.ledger-label {
  color: var(--ink);
  font-weight: 500;
  font-size: 1rem;
}

.ledger-value {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 1rem + 1.6vw, 2rem);
  letter-spacing: -0.032em;
  color: var(--forest);
  font-weight: 600;
  white-space: nowrap;
}

/* The headline reduction reads first */
.ledger-row:first-child .ledger-value {
  font-size: clamp(1.8rem, 1.2rem + 2.6vw, 2.9rem);
}

/* Honesty — one stamped dossier record, not four twin cards. */
.honesty-ledger {
  margin-top: var(--s-3);
  border: 1px solid var(--rule-strong);
  border-left: 3px solid var(--fail);
  border-radius: var(--radius);
  background: var(--surface);
}

.honesty-row {
  display: grid;
  grid-template-columns: minmax(9rem, 14rem) 1fr;
  gap: var(--s-3);
  align-items: baseline;
  padding: var(--s-2) var(--s-3);
  border-bottom: 1px solid var(--rule);
}

.honesty-row:last-child {
  border-bottom: 0;
}

.honesty-row dt {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.honesty-row dd {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}

.honesty-row .hv-flag {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--forest);
}

.honesty-row.is-loud {
  background: rgba(140, 61, 42, 0.06);
}

.honesty-row.is-loud dt {
  color: var(--fail);
}

.honesty-row .hv-false {
  font-family: var(--font-mono);
  font-size: clamp(1.1rem, 1rem + 0.8vw, 1.4rem);
  color: var(--fail);
}

.chapter-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: var(--s-3);
}

/* ============ Chapter cut — full-bleed Fraunces type risk ============
   One oversized italic line bridges the dossier into the work grid.
   Wider than the viewport on purpose; the band clips it. Drifts
   sideways with --page-progress (scrubbed, transform only). */
.chapter-cut {
  overflow: hidden;
  background: var(--cream);
  border-bottom: 1px solid var(--rule);
  padding: clamp(var(--s-4), 6vw, var(--s-8)) 0;
}

.cut-line {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(4rem, 11vw, 10rem);
  line-height: 1;
  letter-spacing: -0.045em;
  color: var(--forest);
  white-space: nowrap;
  margin-left: calc(-1 * var(--space));
  user-select: none;
}

@media (prefers-reduced-motion: no-preference) {
  .cut-line {
    translate: calc(var(--page-progress, 0) * -18vw) 0;
  }
}

/* ============ Work — unequal bento ============ */
.work-section {
  background: var(--cream);
  border-bottom: 1px solid var(--rule);
}

.work-bento {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--s-3);
  counter-reset: work;
}

.work-card {
  counter-increment: work;
  display: grid;
  grid-template-rows: auto 1fr;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition:
    transform var(--dur-hover) var(--ease),
    box-shadow var(--dur-hover) var(--ease),
    border-color var(--dur-hover) var(--ease);
}

.work-card:hover,
.work-card:focus-visible {
  border-color: rgba(47, 74, 60, 0.35);
}

@media (prefers-reduced-motion: no-preference) {
  .work-card:hover,
  .work-card:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 20px 40px -30px rgba(26, 23, 20, 0.35);
  }

  .work-card:hover .work-visual img,
  .work-card:focus-visible .work-visual img {
    transform: scale(var(--hover-scale));
  }
}

.work-card-large {
  grid-column: span 8;
}

.work-card-medium {
  grid-column: span 6;
}

.work-card-small {
  grid-column: span 4;
}

.work-visual {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--rule);
}

.work-visual img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--surface-deep);
  transition: transform var(--dur-hover) var(--ease);
}

.work-card-large .work-visual img {
  aspect-ratio: 16 / 9;
}

.work-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(166, 124, 78, 0.2), rgba(166, 124, 78, 0) 55%);
  opacity: 0;
  transition: opacity var(--dur-hover) var(--ease);
  pointer-events: none;
}

.work-card:hover .work-visual::after,
.work-card:focus-visible .work-visual::after {
  opacity: 1;
}

.work-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
}

.work-visual .work-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 1;
  color: var(--ink);
  background: rgba(26, 23, 20, 0.75);
  backdrop-filter: blur(8px);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--rule);
}

.work-text .work-badge {
  display: inline-block;
  margin-bottom: 0.75rem;
  background: var(--surface-deep);
  color: var(--ink-muted);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  width: fit-content;
}

.work-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  padding: var(--s-3);
}

.work-text h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.032em;
  margin-bottom: 0;
  color: var(--ink);
  transition: color var(--dur-micro) var(--ease);
}

.work-card-small .work-text h3 {
  font-size: 1.25rem;
}

.work-card:hover .work-text h3 {
  color: var(--forest);
}

.work-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--copper-deep);
  margin-bottom: 0.25rem;
}

/* Numbered-index discipline shared with the chapter rail */
.work-meta::before {
  content: "W·" counter(work, decimal-leading-zero) "  " / "";
  color: var(--copper);
}

.work-text p {
  color: var(--ink-soft);
  font-size: 0.98rem;
  line-height: 1.65;
  max-width: var(--measure);
  margin-bottom: 0.25rem;
  text-wrap: pretty;
}

.work-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.stack-chip {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  color: var(--ink-muted);
  background: var(--cream-deep);
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--rule);
}

/* ============ Wins — dated ledger ============ */
.wins-section {
  background: var(--cream-deep);
  border-bottom: 1px solid var(--rule);
}

.wins-ledger {
  display: grid;
  gap: 0;
}

.wins-row {
  display: grid;
  grid-template-columns: 1fr auto 5rem;
  gap: var(--s-4);
  padding: var(--s-3) 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
  transition: border-color var(--dur-hover) var(--ease);
}

.wins-row:hover {
  border-bottom-color: var(--copper-dim);
}

.wins-row:first-child {
  border-top: 1px solid var(--rule);
}

.wins-label {
  color: var(--ink-soft);
  font-size: 1rem;
}

.wins-value {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--forest);
  font-weight: 600;
  text-align: right;
}

.wins-year {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink-muted);
  text-align: right;
}

/* ============ Experience — the paper band ============ */
.experience-section {
  padding: 0;
  border-bottom: 1px solid var(--rule);
}

.experience-invert {
  background:
    radial-gradient(circle at 80% 20%, rgba(166, 124, 78, 0.12), transparent 60%),
    linear-gradient(135deg, var(--forest) 0%, var(--forest-dark) 100%);
  padding: var(--section-y) 0;
  position: relative;
}

.experience-invert :focus-visible {
  outline-color: var(--cream);
}

.section-kicker-invert {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: var(--s-2);
}

.experience-invert .section-kicker-invert {
  color: var(--copper-bright);
}

.section-title-invert {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 1.2rem + 3.1vw, 3.2rem);
  font-weight: 600;
  letter-spacing: -0.042em;
  margin-bottom: var(--s-2);
  line-height: 1.08;
  max-width: 26ch;
  text-wrap: balance;
}

.experience-invert .section-title-invert {
  color: var(--cream);
}

.section-lede-invert {
  max-width: var(--measure);
  font-size: 1.15rem;
  line-height: 1.7;
  text-wrap: pretty;
}

.experience-invert .section-lede-invert {
  color: rgba(244, 239, 230, 0.85);
}

.experience-invert .opener-index {
  -webkit-text-stroke-color: rgba(244, 239, 230, 0.6);
  --index-stroke-from: rgba(244, 239, 230, 0.6);
  --index-stroke-to: var(--copper-bright);
}

.experience-invert .section-opener {
  border-top-color: var(--invert-line);
}

.experience-logbook {
  display: grid;
  gap: 0;
  position: relative;
}

.logbook-entry {
  display: grid;
  grid-template-columns: 6rem 1fr;
  gap: var(--s-4);
  padding: var(--s-3) 0;
  border-top: 1px solid var(--invert-line);
  transition: border-color var(--dur-hover) var(--ease);
}

.logbook-entry:hover {
  border-top-color: var(--copper-bright);
}

.logbook-entry:last-child {
  border-bottom: 1px solid var(--invert-line);
}

.logbook-year {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--copper-bright);
  font-weight: 500;
  letter-spacing: 0.02em;
  padding-top: 0.2rem;
}

.logbook-details h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.024em;
  line-height: 1.3;
  color: var(--cream);
  margin-bottom: 0.4rem;
}

.logbook-org {
  color: rgba(244, 239, 230, 0.6);
  font-size: 0.94rem;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.logbook-desc {
  color: rgba(244, 239, 230, 0.85);
  font-size: 1rem;
  line-height: 1.6;
  max-width: 62ch;
  text-wrap: pretty;
}

/* ============ Contact — deep well ============ */
.contact {
  padding: 0;
}

.contact-invert {
  background:
    radial-gradient(circle at 80% 20%, rgba(166, 124, 78, 0.15), transparent 60%),
    linear-gradient(135deg, var(--forest-dark) 0%, var(--forest-deep) 100%);
  position: relative;
}

.contact-invert :focus-visible {
  outline-color: var(--copper-bright);
}

.contact-invert .section-kicker-invert {
  color: var(--copper-bright);
}

.contact-invert .section-title-invert {
  color: var(--cream);
}

.contact-invert .section-lede-invert {
  color: rgba(244, 239, 230, 0.85);
}

.contact-invert .opener-index {
  -webkit-text-stroke-color: rgba(244, 239, 230, 0.55);
  --index-stroke-from: rgba(244, 239, 230, 0.55);
  --index-stroke-to: var(--copper-bright);
}

.contact-invert .section-opener {
  border-top-color: var(--invert-line);
}

.contact .section {
  position: relative;
  z-index: 1;
}

.contact a {
  color: var(--cream);
}

.contact-email {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.6vw, 2.3rem);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid rgba(244, 239, 230, 0.4);
  margin-bottom: var(--s-3);
  transition:
    border-color var(--dur-micro) var(--ease),
    color var(--dur-micro) var(--ease);
  overflow-wrap: anywhere;
}

.contact-email:hover {
  color: var(--copper-bright);
  border-bottom-color: var(--copper-bright);
}

.social-row {
  display: flex;
  gap: var(--s-3);
  flex-wrap: wrap;
  margin-bottom: var(--s-6);
}

.social-row a {
  font-weight: 600;
  text-decoration: none;
  color: rgba(244, 239, 230, 0.9);
  transition: color var(--dur-micro) var(--ease);
  min-block-size: 24px;
}

.social-row a:hover {
  color: var(--copper-bright);
}

.contact-footer {
  padding-top: var(--s-4);
  border-top: 1px solid var(--invert-line);
  color: rgba(244, 239, 230, 0.6);
  font-size: 0.92rem;
}

/* ============ Footer ============ */
.site-footer {
  padding: var(--s-4) var(--space) var(--s-6);
  border-top: 1px solid var(--rule);
  background: var(--cream);
}

.footer-inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s-2);
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  gap: var(--s-3);
}

.footer-links a {
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 500;
  transition: color var(--dur-micro) var(--ease);
}

.footer-links a:hover {
  color: var(--forest);
}

/* ============ Shared reveal language ============ */
[data-reveal] {
  --reveal-delay: 0ms;
}

@media (prefers-reduced-motion: no-preference) {
  html.js [data-reveal]:not(.is-inview) {
    opacity: 0;
    translate: 0 1.125rem;
  }

  html.js [data-reveal].is-inview {
    animation: reveal-in var(--dur-reveal) var(--ease) both;
    animation-delay: var(--reveal-delay);
  }
}

@keyframes reveal-in {
  from {
    opacity: 0;
    translate: 0 1.125rem;
  }

  to {
    opacity: 1;
    translate: 0 0;
  }
}

/* Sibling stagger, capped at 300ms */
.work-bento > [data-reveal]:nth-child(2),
.wins-ledger > [data-reveal]:nth-child(2),
.experience-logbook > [data-reveal]:nth-child(2) {
  --reveal-delay: 60ms;
}

.work-bento > [data-reveal]:nth-child(3),
.wins-ledger > [data-reveal]:nth-child(3),
.experience-logbook > [data-reveal]:nth-child(3) {
  --reveal-delay: 120ms;
}

.work-bento > [data-reveal]:nth-child(4),
.wins-ledger > [data-reveal]:nth-child(4),
.experience-logbook > [data-reveal]:nth-child(4) {
  --reveal-delay: 180ms;
}

.work-bento > [data-reveal]:nth-child(5),
.wins-ledger > [data-reveal]:nth-child(5) {
  --reveal-delay: 240ms;
}

.work-bento > [data-reveal]:nth-child(n + 6),
.wins-ledger > [data-reveal]:nth-child(n + 6) {
  --reveal-delay: 300ms;
}

/* ============ Mobile Email CTA ============ */
.mobile-cta {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem var(--space) calc(0.625rem + env(safe-area-inset-bottom, 0px));
  background: rgba(244, 239, 230, 0.94);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--rule);
  translate: 0 110%;
  visibility: hidden;
}

@media (prefers-reduced-motion: no-preference) {
  .mobile-cta {
    transition:
      translate var(--dur-hover) var(--ease),
      visibility 0s var(--dur-hover);
  }
}

.mobile-cta.is-shown {
  translate: 0 0;
  visibility: visible;
  transition-delay: 0s;
}

@media (max-width: 700px) {
  html:has(.mobile-cta.is-shown) .site-footer {
    padding-bottom: calc(var(--s-8) + env(safe-area-inset-bottom, 0px));
  }
}

.mobile-cta-line {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  line-height: 1.35;
}

.mobile-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-block-size: 3rem;
  padding: 0.5rem var(--s-3);
  background: var(--copper-deep);
  color: var(--cream);
  font-weight: 600;
  font-size: 0.96rem;
  text-decoration: none;
  border-radius: var(--radius);
  transition: background-color var(--dur-micro) var(--ease);
  white-space: nowrap;
}

.mobile-cta-btn:hover {
  background: var(--copper);
}

.mobile-cta-dismiss {
  flex: none;
  inline-size: 2.75rem;
  block-size: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  color: var(--ink-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition:
    color var(--dur-micro) var(--ease),
    border-color var(--dur-micro) var(--ease);
}

.mobile-cta-dismiss:hover {
  color: var(--ink);
  border-color: var(--copper);
}

@media (min-width: 701px) {
  .mobile-cta {
    display: none;
  }
}

/* ============ Subpages — resume, case studies, 404 ============ */
.case-hero {
  padding: clamp(var(--s-4), 6vh, var(--s-6)) var(--space) var(--s-6);
}

.case-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 1.3rem + 3.2vw, 3.3rem);
  font-weight: 600;
  letter-spacing: -0.042em;
  line-height: 1.1;
  color: var(--ink);
  margin-bottom: var(--s-2);
  text-wrap: balance;
}

.case-hero .lede {
  color: var(--ink-soft);
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  line-height: 1.7;
  margin-bottom: var(--s-3);
}

.scope-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: var(--s-3);
}

.scope {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  background: var(--cream-deep);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
}

.scope.is-fail {
  color: var(--fail);
  border-color: rgba(140, 61, 42, 0.4);
}

main > .hero-media {
  max-width: var(--max-wide);
  margin: 0 auto var(--s-6);
  padding: 0 var(--space);
}

main > .hero-media figure {
  margin: 0;
}

main > .hero-media img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--rule-strong);
}

main > .hero-media figcaption {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem var(--s-2);
  padding-top: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--ink-muted);
}

.prose {
  max-width: 68ch;
}

.prose h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.032em;
  color: var(--ink);
  margin: var(--s-6) 0 var(--s-2);
  text-wrap: balance;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose p,
.prose li {
  color: var(--ink-soft);
  line-height: 1.7;
  text-wrap: pretty;
}

.prose strong {
  color: var(--ink);
}

.prose p {
  margin-bottom: var(--s-2);
}

.prose ul,
.prose ol {
  padding-left: 1.25rem;
  margin-bottom: var(--s-2);
}

.prose li {
  margin-bottom: 0.5rem;
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 0.25rem;
  padding: 0.1em 0.35em;
}

.prose a {
  color: var(--forest);
  text-underline-offset: 0.2em;
}

.figure {
  margin: var(--s-4) 0;
}

.figure img {
  width: 100%;
  height: auto;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: var(--surface);
}

.figure figcaption {
  padding-top: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--ink-muted);
}

.table-scroll {
  overflow-x: auto;
  margin: var(--s-3) 0 var(--s-4);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--cream-deep);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 0.75rem var(--s-2);
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
  color: var(--ink-soft);
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.data-table th {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 500;
}

.data-table .num {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  white-space: nowrap;
}

.tag-pass,
.tag-fail {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.tag-pass {
  color: var(--forest);
}

.tag-fail {
  color: var(--fail);
}

.ladder {
  list-style: none;
  padding: 0;
  margin: var(--s-3) 0 var(--s-4);
  border-top: 1px solid var(--rule);
}

.ladder li {
  display: grid;
  grid-template-columns: 3.5rem 1fr auto;
  gap: var(--s-2) var(--s-3);
  padding: var(--s-2) 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}

.ladder-phase {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--copper-deep);
}

.ladder li strong {
  display: block;
  color: var(--ink);
  margin-bottom: 0.25rem;
}

.ladder li p {
  margin: 0;
  font-size: 0.95rem;
}

.ladder-status {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  white-space: nowrap;
}

.callout {
  border: 1px solid var(--rule);
  border-left: 3px solid var(--copper);
  border-radius: var(--radius);
  background: var(--cream-deep);
  padding: var(--s-3);
  margin: var(--s-4) 0;
  color: var(--ink-soft);
  line-height: 1.7;
}

.callout strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 1.2rem + 2.4vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -0.042em;
  line-height: 1.12;
  color: var(--ink);
  margin-bottom: var(--s-2);
  text-wrap: balance;
}

.section-lede {
  color: var(--ink-soft);
  max-width: var(--measure);
  margin-bottom: var(--s-3);
  font-size: 1.1rem;
  line-height: 1.7;
}

.resume-meta {
  color: var(--ink-muted);
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: var(--s-3);
}

.resume-meta a {
  color: var(--forest);
  text-underline-offset: 0.2em;
}

.experience-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--rule);
}

.exp-row {
  display: grid;
  grid-template-columns: 5rem 1fr;
  gap: var(--s-3);
  padding: var(--s-3) 0;
  border-bottom: 1px solid var(--rule);
}

.exp-year {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--copper-deep);
  font-weight: 500;
  padding-top: 0.2rem;
}

.exp-role {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.016em;
  color: var(--ink);
  margin-bottom: 0.25rem;
}

.exp-org {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  margin-bottom: 0.4rem;
}

.exp-desc {
  color: var(--ink-soft);
  font-size: 0.98rem;
  line-height: 1.65;
  max-width: 62ch;
  text-wrap: pretty;
}

.page-404 {
  padding-block: var(--section-y);
}

.status-line {
  font-family: var(--font-mono);
}

/* ============ Responsive ============ */
@media (max-width: 1024px) {
  /* LATCH — the track (not a short aside) is the tall containing
     block. Sticky travels the full dossier height. Do not change. */
  html {
    scroll-padding-top: 8rem;
  }

  .flagship-container {
    display: block;
  }

  .flagship-track {
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
  }

  .chapters-nav {
    top: 4rem;
    align-self: stretch;
    flex-direction: row;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    gap: 0.25rem;
    background: rgba(244, 239, 230, 0.94);
    backdrop-filter: blur(12px);
    margin-inline: calc(-1 * var(--space));
    padding: 0.5rem var(--space);
    border-bottom: 1px solid var(--rule);
  }

  /* Horizontal rail: progress reads as a signal underline */
  @media (prefers-reduced-motion: no-preference) {
    .chapters-nav::after {
      top: auto;
      bottom: -1px;
      width: 100%;
      height: 2px;
      transform: scaleX(var(--flagship-progress, 0));
      transform-origin: 0 50%;
    }
  }

  /* 44px min tap; numbers stay in ::before */
  .chapter-link {
    white-space: nowrap;
    min-block-size: 44px;
    display: inline-flex;
    align-items: center;
    border-left: 0;
    border-bottom: 2px solid transparent;
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 0.5rem 0.7rem;
  }

  .chapter-link.is-active {
    border-bottom-color: var(--copper);
    color: var(--forest);
    background: rgba(47, 74, 60, 0.08);
  }

  .chapter-link.is-past {
    border-left-color: transparent;
    border-bottom-color: rgba(166, 124, 78, 0.4);
    color: var(--copper-deep);
  }

  .flagship-chapter {
    scroll-margin-top: 8rem;
  }

  .section-opener {
    grid-template-columns: auto 1fr;
  }
}

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: var(--s-4);
  }

  .hero-grid .hero-media {
    margin-top: 0;
  }

  .work-bento {
    grid-template-columns: 1fr;
  }

  .work-card-large,
  .work-card-medium,
  .work-card-small {
    grid-column: span 1;
  }

  /* Single column: every case card reads 4:3, featured included */
  .work-card-large .work-visual img {
    aspect-ratio: 4 / 3;
  }

  .logbook-entry {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .wins-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .wins-value,
  .wins-year {
    text-align: left;
  }

  .ladder li {
    grid-template-columns: 3.5rem 1fr;
  }

  .ladder-status {
    grid-column: 2;
    white-space: normal;
  }
}

@media (max-width: 640px) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(244, 239, 230, 0.97);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--rule);
    padding: 0.5rem var(--space) var(--s-2);
    counter-reset: navi;
  }

  .nav-links.is-open {
    display: flex;
  }

  @media (prefers-reduced-motion: no-preference) {
    .nav-links.is-open {
      animation: menu-in var(--dur-micro) var(--ease) both;
    }
  }

  .nav-links li {
    border-top: 1px solid var(--rule);
    counter-increment: navi;
  }

  /* ≥44px targets, indexed like the chapter rail */
  .nav-links a {
    display: flex;
    align-items: center;
    gap: 0.75ch;
    padding: 0.85rem 0;
    min-block-size: 44px;
  }

  .nav-links a::before {
    content: counter(navi, decimal-leading-zero) / "";
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--copper-dim);
    letter-spacing: 0.04em;
  }

  .nav-links a::after {
    display: none;
  }

  .cta-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .cta-row .btn-primary,
  .cta-row a.btn-primary {
    grid-column: 1 / -1;
  }

  .btn {
    justify-content: center;
    width: 100%;
    min-height: 48px;
  }

  .chapter-ctas {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .chapter-ctas .btn-primary,
  .chapter-ctas a.btn-primary {
    grid-column: 1 / -1;
  }

  .hero-proof {
    padding: var(--s-2);
    margin-bottom: var(--s-3);
  }

  .hero .lede {
    margin-bottom: var(--s-3);
  }

  .chapter-media img {
    height: clamp(16rem, 40vh, 26rem);
  }

  .section-opener {
    grid-template-columns: 1fr;
    gap: var(--s-2);
  }

  .opener-index {
    font-size: clamp(2.6rem, 12vw, 3.4rem);
    line-height: 1;
  }

  .exp-row {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
}

/* Reduced motion: all decorative motion is authored inside
   no-preference blocks, so it never runs here. Sticky latch and
   progress semantics keep working without animation. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

@media print {
  :root {
    --cream: #ffffff;
    --cream-deep: #ffffff;
    --surface: #f5f5f5;
    --surface-deep: #eeeeee;
    --rule: rgba(0, 0, 0, 0.25);
    --rule-strong: rgba(0, 0, 0, 0.4);
  }

  .site-nav,
  .skip-link,
  .nav-toggle,
  .site-footer,
  .cta-row,
  .mobile-cta {
    display: none !important;
  }

  body {
    background: white;
    color: #222;
    font-size: 11pt;
  }

  .section {
    padding: 1rem 0;
  }
}
