/* Case study pages. Same tokens as the home page. Shared by every case study. */
:root {
  --paper: #F7F5EF;
  --ink: #17160F;
  --ink-soft: #5B564A;
  --pencil: #6B6152;
  --line: #E3DECC;
  --line-strong: #C9C2A9;
  --rust: #A63F1D;
  --rust-strong: #7C2E14;
  --rust-light: #C97C3F;
  --rust-wash: #F1E4D8;

  --font-display: 'Bricolage Grotesque', 'Arial Black', sans-serif;
  --font-body: 'Outfit', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', 'SF Mono', Consolas, monospace;

  --gutter: clamp(20px, 4vw, 56px);
  --topbar-h: 60px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1B1A14;
    --ink: #F3F0E6;
    --ink-soft: #B9B3A0;
    --pencil: #C9C2A9;
    --line: #35331F;
    --line-strong: #4A4730;
    --rust: #E2793F;
    --rust-strong: #F2A876;
    --rust-light: #F2B37D;
    --rust-wash: #2B2316;
  }
}
:root[data-theme="dark"] {
  --paper: #1B1A14;
  --ink: #F3F0E6;
  --ink-soft: #B9B3A0;
  --pencil: #C9C2A9;
  --line: #35331F;
  --line-strong: #4A4730;
  --rust: #E2793F;
  --rust-strong: #F2A876;
  --rust-light: #F2B37D;
  --rust-wash: #2B2316;
}

* { box-sizing: border-box; }
html { background: var(--paper); scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- Top bar: same as the home page ---------- */
/* ---------- Top bar: full width, logo + menu + CV/theme ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar-h);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
    gap: 24px;
  padding-inline: clamp(20px, 3vw, 32px);
}

.top-nav {
  display: flex;
  align-items: center;
  gap: clamp(28px, 3vw, 48px);
}
.topbar .wordmark { justify-self: start; }
.topbar .top-tools { justify-self: end; }



/* ---------- Wordmark: outline mark, fills + name slides in on hover ---------- */
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.mark { display: inline-flex; align-items: center; flex-shrink: 0; }
.mark svg { display: block; height: 28px; width: auto; overflow: visible; }
.logo-path {
  fill: none;
  stroke: var(--ink);
  stroke-width: 85;
  transition: fill 0.4s ease, stroke 0.4s ease, stroke-width 0.4s ease;
}
.wordmark:hover .logo-path,
.wordmark:focus-visible .logo-path {
  fill: url(#railLogoGradient);
  stroke: var(--rust-strong);
  stroke-width: 0;
}
.wordmark-text {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  max-width: 0;
  opacity: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.92rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  transform: translateX(-6px);
  transition: max-width 0.4s ease, opacity 0.3s ease, transform 0.35s ease, margin-left 0.4s ease;
}
.wordmark:hover .wordmark-text,
.wordmark:focus-visible .wordmark-text {
  max-width: 160px;
  opacity: 1;
  transform: translateX(0);
  margin-left: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .logo-path { transition: fill 0.3s ease; }
  .wordmark-text { transition: opacity 0.3s ease; }

  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.top-nav .rail-link {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 6px 0;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: border-color 0.25s ease, color 0.25s ease;
}

.rail-link .num {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--line-strong);
  transition: color 0.25s ease;
}

.rail-link .label {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  transition: color 0.25s ease;
}

.rail-link.is-active {
  border-bottom-color: var(--rust);
}
.rail-link.is-active .num { color: var(--rust); }
.rail-link.is-active .label { color: var(--ink); font-weight: 500; }

.top-tools {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--ink-soft);
  font-family: var(--font-mono);
}
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
.theme-track {
  position: relative;
  width: 34px;
  height: 18px;
  border-radius: 9px;
  background: var(--line-strong);
  transition: background 0.2s ease;
}
.theme-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--paper);
  transition: transform 0.2s ease;
}
:root[data-theme="dark"] .theme-track { background: var(--rust); }
:root[data-theme="dark"] .theme-thumb { transform: translateX(16px); }

@media (max-width: 880px) {
  :root { --topbar-h: 56px; }
  .topbar { display: flex; justify-content: space-between; padding-inline: 16px; gap: 12px; }
  .mark svg { height: 22px; }
  .wordmark:hover .wordmark-text, .wordmark:focus-visible .wordmark-text { max-width: 0; opacity: 0; margin-left: 0; }
  .top-nav { gap: 4px; overflow-x: auto; min-width: 0; flex: 1 1 auto; -webkit-overflow-scrolling: touch; }
  .top-nav .rail-link { flex-shrink: 0; padding: 6px 8px; }
  .rail-link .label { white-space: nowrap; }
  .top-tools { gap: 10px; }
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Back link sits under the top bar */
.back-row { display: inline-flex; align-items: center; gap: 8px; margin-top: clamp(22px, 3.5vw, 34px); text-decoration: none;
  font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-soft); transition: color 0.2s ease; }
.back-row:hover { color: var(--rust); }
.back-row svg { width: 14px; height: 14px; }

/* ---------- Layout ---------- */
main { max-width: 1180px; margin-inline: auto; padding: 0 var(--gutter) clamp(80px, 12vh, 140px); }
.wide { max-width: 1040px; margin-inline: auto; }
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Hero ---------- */
.hero { padding-top: clamp(36px, 7vh, 72px); }
.eyebrow {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--rust);
  display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow .lock { width: 12px; height: 12px; }
h1.title {
  margin: 12px 0 0;
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(2.3rem, 1.7rem + 2.6vw, 3.6rem); line-height: 1.02; letter-spacing: -0.01em;
}
.hero-meta { margin-top: 12px; font-family: var(--font-mono); font-size: 0.82rem; color: var(--ink-soft); }
.dek { margin-top: 22px; font-size: 1.12rem; color: var(--ink); max-width: 60ch; }


.hero-figure { margin: clamp(28px, 4vw, 40px) 0 0; }
.hero-figure .frame { border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; background: #fff; }
.hero-figure img { width: 100%; height: auto; }

.meta-strip {
  margin-top: clamp(26px, 4vw, 36px);
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 7px 0;
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-soft);
}
.meta-dot { margin: 0 14px; color: var(--line-strong); }
.meta-item b { color: var(--ink); font-weight: 500; margin-right: 5px; }

/* ---------- Gate: blurred preview with a call to action, in the Medium style ---------- */
.gate { margin-top: clamp(40px, 6vw, 72px); position: relative; }
.gate-ghost { height: clamp(300px, 34vw, 400px); overflow: hidden; pointer-events: none; user-select: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 92%); mask-image: linear-gradient(to bottom, #000 0%, transparent 92%); }
.gate-ghost-inner { filter: blur(5px); opacity: 0.8; }
.gh-label { display: block; width: 28px; height: 8px; border-radius: 4px; background: var(--rust); opacity: 0.6; }
.gh-title { display: block; margin-top: 14px; width: min(46%, 420px); height: 26px; border-radius: 6px; background: var(--ink); opacity: 0.8; }
.gh-line { display: block; margin-top: 12px; height: 10px; border-radius: 5px; background: var(--ink-soft); opacity: 0.4; }
.gh-grid { margin-top: 26px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.gh-card { border: 1px solid var(--line-strong); border-radius: 8px; padding: 18px; }
.gh-card i { display: block; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--rust); margin-bottom: 14px; }
.gh-card b { display: block; height: 14px; width: 70%; border-radius: 4px; background: var(--ink); opacity: 0.75; margin-bottom: 12px; }
.gh-card span { display: block; height: 8px; border-radius: 4px; background: var(--ink-soft); opacity: 0.4; margin-top: 8px; }
.gh-card span:nth-of-type(2) { width: 82%; }
.gh-card span:nth-of-type(3) { width: 55%; }
@media (max-width: 900px) { .gh-grid { grid-template-columns: repeat(2, 1fr); } }

.gate-card {
  position: relative; z-index: 1; margin: clamp(-170px, -14vw, -120px) auto 0; max-width: 580px;
  background: color-mix(in srgb, var(--paper) 88%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid var(--line-strong); border-radius: 12px; padding: clamp(24px, 4vw, 36px); text-align: center;
  box-shadow: 0 24px 60px rgba(23,22,15,0.12);
}
.gate.is-checking form, .gate.is-checking .gate-ask { opacity: 0.35; pointer-events: none; }
.gate-head { display: flex; align-items: center; justify-content: center; gap: 10px; }
.gate-head svg { width: 18px; height: 18px; color: var(--rust); flex-shrink: 0; }
.gate h2 { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: clamp(1.3rem, 1.1rem + 0.7vw, 1.6rem); letter-spacing: -0.01em; }
.gate p { margin: 10px auto 0; color: var(--ink-soft); max-width: 46ch; font-size: 0.96rem; }
.gate form { margin: 22px auto 0; display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; transition: opacity 0.2s ease; }
.gate input[type="password"] {
  flex: 1 1 200px; min-width: 0; font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line-strong); border-radius: 6px; padding: 12px 14px;
}
.gate input[type="password"]:focus { outline: 2px solid var(--rust); outline-offset: 1px; border-color: var(--rust); }
.gate button[type="submit"] {
  font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase;
  background: var(--ink); color: var(--paper); border: 1px solid var(--ink); border-radius: 6px;
  padding: 12px 24px; cursor: pointer; transition: background 0.2s ease, border-color 0.2s ease;
}
.gate button[type="submit"]:hover { background: var(--rust); border-color: var(--rust); color: #fff; }
.gate button[disabled] { opacity: 0.6; cursor: progress; }
.gate-msg { margin: 10px 0 0; min-height: 1.4em; font-size: 0.9rem; color: var(--rust-strong); }
.gate-ask { margin-top: 4px !important; font-size: 0.9rem !important; transition: opacity 0.2s ease; }
.gate-ask a { color: var(--rust); text-decoration: none; border-bottom: 1px solid var(--rust-light); }
.gate-ask a:hover { color: var(--rust-strong); }
.preview-banner {
  margin: 0 0 14px; padding: 8px 12px; border: 1px dashed var(--rust-light); border-radius: 4px;
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--rust-strong); background: var(--paper);
}

/* ---------- Protected body ---------- */
#gated { scroll-margin-top: calc(var(--topbar-h) + 8px); }
section.block { margin-top: clamp(52px, 8vw, 88px); scroll-margin-top: calc(var(--topbar-h) + 12px); }
section.block h2 { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.45rem, 1.2rem + 0.9vw, 1.9rem); letter-spacing: -0.01em; margin: 0 0 18px; }
.block p { margin: 0 0 16px; color: var(--ink); }
.block p:last-child { margin-bottom: 0; }
.block p.muted, .muted { color: var(--ink-soft); }
.section-num { font-family: var(--font-mono); font-size: 0.72rem; color: var(--rust); display: block; margin-bottom: 8px; }

.question {
  margin: 26px 0 0; padding: 18px 22px;
  border-left: 3px solid var(--rust); background: var(--rust-wash); border-radius: 0 6px 6px 0;
  font-family: var(--font-display); font-weight: 600; font-size: clamp(1.05rem, 0.98rem + 0.4vw, 1.25rem); line-height: 1.4;
}
.question small { display: block; margin-bottom: 6px; font-family: var(--font-mono); font-weight: 500; font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--rust-strong); }

/* Figures */
.figure { margin: 26px 0 0; }
.figure .frame { border: 1px solid var(--line-strong); border-radius: 6px; overflow: hidden; background: #fff; }
.figure img { width: 100%; height: auto; }
.figure img.zoomable { cursor: zoom-in; }
.figure figcaption { margin-top: 10px; font-size: 0.84rem; color: var(--ink-soft); max-width: 70ch; }
.figure-2up { margin: 26px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.figure-2up .figure { margin: 0; }
.figure-side { margin: 26px 0 0; display: grid; grid-template-columns: minmax(0, 300px) 1fr; gap: clamp(20px, 4vw, 40px); align-items: start; }
.figure-side .figure { margin: 0; }
.figure-side .side-copy p { color: var(--ink-soft); font-size: 0.96rem; }
@media (max-width: 680px) {
  .figure-2up { grid-template-columns: 1fr; }
  .figure-side { grid-template-columns: 1fr; }
  .figure-side .figure { max-width: 320px; }
}

/* Approach steps: a real timeline with a line */
.steps { list-style: none; margin: 28px 0 0; padding: 0; counter-reset: step; }
.step { position: relative; display: grid; grid-template-columns: minmax(0, 250px) minmax(0, 1fr); gap: 8px clamp(24px, 4vw, 56px);
  padding: 0 0 clamp(34px, 5vw, 52px) 56px; border-left: 1px solid var(--line-strong); margin-left: 14px; }
.step:last-child { padding-bottom: 0; border-left-color: transparent; }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: -15px; top: -2px; width: 29px; height: 29px; border-radius: 50%;
  background: var(--paper); border: 1px solid var(--rust); color: var(--rust);
  font-family: var(--font-mono); font-size: 0.74rem; display: flex; align-items: center; justify-content: center;
}
.step-head h3 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; line-height: 1.25; }
.step-body { min-width: 0; }
.step-body p { margin: 0 0 12px; font-size: 0.97rem; color: var(--ink-soft); line-height: 1.55; }
.step-body p:first-child { color: var(--ink); }
.step-body p:last-child { margin-bottom: 0; }
.step-body .chips { margin-top: 14px; }
.step-body .figure-2up { margin-top: 18px; }
.step-body .table-wrap { margin-top: 18px; }
.step-body .step-note { margin-top: 14px; font-size: 0.9rem; color: var(--ink-soft); }
@media (max-width: 860px) { .step { grid-template-columns: 1fr; padding-left: 40px; margin-left: 10px; } }

/* States strip */
.states { margin: 22px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.states li { list-style: none; border: 1px solid var(--line-strong); border-radius: 4px; padding: 9px 10px; background: var(--paper); }
@media (max-width: 520px) { .states { grid-template-columns: repeat(2, 1fr); } }
.states b { display: block; font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--rust); font-weight: 500; }
.states span { font-size: 0.82rem; color: var(--ink-soft); line-height: 1.35; display: block; margin-top: 2px; }

/* Changes table */
.table-wrap { margin-top: 22px; border: 1px solid var(--line); border-radius: 6px; overflow-x: auto; }
table.changes { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
@media (max-width: 600px) { .changes th, .changes td { padding-inline: 12px; font-size: 0.84rem; } }
.changes caption { text-align: left; padding: 14px 16px 6px; font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }
.changes th { text-align: left; padding: 8px 16px; font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); font-weight: 500; border-bottom: 1px solid var(--line-strong); }
.changes td { padding: 11px 16px; vertical-align: top; border-top: 1px solid var(--line); color: var(--ink); }
.changes tr:first-child td { border-top: none; }
.changes td:first-child { color: var(--ink-soft); width: 44%; }

/* Decisions */
.decisions { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.decision { border: 1px solid var(--line); border-radius: 8px; padding: clamp(18px, 2.4vw, 24px); display: flex; flex-direction: column; }
.decision .figure { margin-top: auto; padding-top: 18px; }
.decision-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.decision-num { font-family: var(--font-mono); font-size: 0.78rem; color: var(--rust); }
.decision h3 { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: clamp(1.1rem, 1rem + 0.35vw, 1.3rem); line-height: 1.2; letter-spacing: -0.01em; }
.decision p { margin: 0 0 12px; }
.decision p:last-child { margin-bottom: 0; }
.decision .lead { font-size: 1.02rem; }
.decision .tag {
  display: block; margin: 16px 0 4px; font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--rust);
}
.decision .tag + p { color: var(--ink-soft); }
.compare { margin: 16px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.compare div { border: 1px solid var(--line-strong); border-radius: 4px; padding: 12px 14px; font-size: 0.88rem; color: var(--ink-soft); }
.compare b { display: block; margin-bottom: 4px; color: var(--ink); font-family: var(--font-mono); font-weight: 500; font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; }
@media (max-width: 560px) { .compare { grid-template-columns: 1fr; } }

.name-path { margin: 16px 0 6px; padding: 0; list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 6px; }
.name-path li { font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-soft); border: 1px solid var(--line-strong); border-radius: 20px; padding: 5px 12px; }
.name-path li + li::before { content: none; }
.name-path .arrow { border: none; padding: 0; color: var(--line-strong); }
.name-path .final { background: var(--rust); border-color: var(--rust); color: #fff; }

.held-back { margin-top: clamp(26px, 4vw, 36px); border: 1px dashed var(--line-strong); border-radius: 8px; padding: clamp(18px, 3vw, 26px); }
.held-back h3 { margin: 0 0 8px; font-family: var(--font-mono); font-weight: 500; font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }
.held-back p { margin: 0; color: var(--ink-soft); font-size: 0.96rem; }

/* Timeline extras */
.step .phase { display: block; margin: 3px 0 4px; font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--rust); }
.chips { margin: 14px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { font-family: var(--font-mono); font-size: 0.74rem; color: var(--ink-soft); border: 1px solid var(--line-strong); border-radius: 20px; padding: 4px 11px; }

/* Decision visuals */
.swap { margin: 16px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.swap div { border: 1px solid var(--line-strong); border-radius: 6px; padding: 14px 16px; font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; line-height: 1.3; }
.swap b { display: block; margin-bottom: 6px; font-family: var(--font-mono); font-weight: 500; font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; }
.swap .no { color: var(--ink-soft); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.swap .no b { text-decoration: none; display: block; }
.swap .yes { background: var(--rust-wash); border-color: var(--rust-light); color: var(--ink); }
.swap .yes b { color: var(--rust-strong); }
.decision .after { margin-top: 14px; color: var(--ink-soft); font-size: 0.95rem; }
@media (max-width: 560px) { .swap { grid-template-columns: 1fr; } }
.trio { margin: 16px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.trio li { border: 1px solid var(--line-strong); border-radius: 6px; padding: 14px; font-family: var(--font-display); font-weight: 600; line-height: 1.25; }
.trio b { display: block; margin-bottom: 8px; font-family: var(--font-mono); font-weight: 500; font-size: 0.74rem; color: var(--rust); }
.trio small { display: block; margin-top: 8px; font-family: var(--font-body); font-weight: 400; font-size: 0.82rem; color: var(--ink-soft); }
@media (max-width: 560px) { .trio { grid-template-columns: 1fr; } }
.points { margin: 16px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.points li { border-left: 2px solid var(--rust); padding: 2px 0 2px 14px; font-size: 0.94rem; color: var(--ink-soft); }
.points b { display: block; color: var(--ink); font-weight: 600; }

/* Beta results */
.beta-grid { margin-top: 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.beta-col { border: 1px solid var(--line); border-radius: 8px; padding: clamp(16px, 2.5vw, 22px); }
.beta-col h3 { margin: 0; font-family: var(--font-mono); font-weight: 500; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--rust); }
.beta-col .learned { margin-top: 14px; font-size: 0.95rem; }
@media (max-width: 680px) { .beta-grid { grid-template-columns: 1fr; } }

/* Outcome */
.stat-grid { margin-top: 24px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.stat-tile { background: var(--paper); padding: clamp(18px, 2.5vw, 26px); }
.stat-num { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); line-height: 1.1; color: var(--rust); }
.stat-label { margin-top: 8px; font-size: 0.88rem; color: var(--ink-soft); }
@media (max-width: 680px) { .stat-grid { grid-template-columns: 1fr; } }
.learned { margin: 26px 0 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.learned li { display: flex; gap: 12px; align-items: flex-start; }
.learned svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 5px; color: var(--rust); }
.learned .good svg { color: var(--ink-soft); }
.block .note { margin-top: 20px; font-size: 0.92rem; color: var(--ink-soft); }

/* Reflection */
.reflection { margin-top: clamp(52px, 8vw, 88px); padding-top: clamp(32px, 5vw, 44px); border-top: 1px solid var(--line); scroll-margin-top: calc(var(--topbar-h) + 12px); }
.reflection blockquote { margin: 0 0 22px; font-family: var(--font-display); font-weight: 600; font-size: clamp(1.2rem, 1.02rem + 0.7vw, 1.5rem); line-height: 1.38; color: var(--ink); max-width: 56ch; }
.reflection p { color: var(--ink-soft); max-width: 62ch; margin: 0 0 16px; }

.case-footer {
  margin-top: clamp(60px, 9vw, 100px); padding-top: 28px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
}
.case-footer a { text-decoration: none; font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--rust); }
.case-footer a:hover { color: var(--rust-strong); }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 30px;
  background: rgba(10, 9, 5, 0.92); opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
}
.lightbox.is-open { opacity: 1; pointer-events: auto; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 4px; box-shadow: 0 20px 60px rgba(0,0,0,0.5); background: #fff; }
.lightbox-close {
  position: absolute; top: 20px; right: 24px; background: none; border: 1px solid rgba(247,245,239,0.3); color: #F7F5EF;
  width: 40px; height: 40px; border-radius: 50%; font-size: 1.4rem; line-height: 1; cursor: pointer;
}

/* ---------- Case header: hero, role, challenge ---------- */
.hero-grid { padding-top: clamp(20px, 3vw, 32px); display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.25fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.hero-grid .hero { padding-top: 0; }
.hero-grid .dek { max-width: 50ch; }
.hero-shots { position: relative; aspect-ratio: 1.22; }
.hero-shots img { position: absolute; height: auto; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; box-shadow: 0 22px 54px rgba(23,22,15,0.14); }
.hero-shots .shot-back { top: 0; left: 0; width: 88%; }
.hero-shots .shot-front { right: 0; bottom: 0; width: 60%; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } .hero-shots { max-width: 620px; } }

.role-band { margin-top: clamp(44px, 7vw, 80px); padding-top: clamp(22px, 3vw, 30px); border-top: 1px solid var(--line); }
.band-label { display: block; margin-bottom: 10px; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--rust); }
.role-lead { margin: 0; max-width: 62ch; font-family: var(--font-display); font-weight: 600; font-size: clamp(1.2rem, 1.02rem + 0.8vw, 1.6rem); line-height: 1.35; letter-spacing: -0.005em; }
.role-cols { margin: clamp(20px, 3vw, 30px) 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(16px, 2.5vw, 32px); }
.role-cols li { border-top: 2px solid var(--rust); padding-top: 12px; font-size: 0.94rem; color: var(--ink-soft); line-height: 1.45; }
.role-cols b { display: block; margin-bottom: 4px; font-family: var(--font-mono); font-weight: 500; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); }
@media (max-width: 800px) { .role-cols { grid-template-columns: repeat(2, 1fr); } }

.challenge { margin-top: clamp(44px, 7vw, 80px); padding-top: clamp(22px, 3vw, 30px); border-top: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 72px); align-items: start; }
.challenge .copy p { margin: 0 0 14px; max-width: 64ch; }
.challenge .copy p:last-child { margin-bottom: 0; }
.challenge .question { margin: 0; align-self: center; font-size: clamp(1rem, 0.95rem + 0.3vw, 1.15rem); line-height: 1.4; padding: 18px 20px; }
@media (max-width: 800px) { .challenge { grid-template-columns: 1fr; } }

.block > p, .reflection p { max-width: 72ch; }
.decision .trio, .decision .swap { grid-template-columns: 1fr; }
.decision .trio li { display: flex; gap: 10px; align-items: baseline; padding: 10px 12px; }
.decision .trio b { margin: 0; }
.decision .trio small { display: none; }
.reflection-h { margin: 0 0 14px; font-family: var(--font-display); font-weight: 800; font-size: clamp(1.45rem, 1.2rem + 0.9vw, 1.9rem); letter-spacing: -0.01em; }

/* At a glance */
.glance { margin: clamp(44px, 7vw, 80px) 0 0; padding: clamp(20px, 3vw, 28px) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr); gap: clamp(16px, 2.5vw, 32px); }
.glance dt { margin: 0 0 6px; font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--rust); }
.glance dd { margin: 0; font-size: 0.9rem; line-height: 1.45; color: var(--ink); }
@media (max-width: 1000px) { .glance { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .glance { grid-template-columns: 1fr 1fr; } }
.role-lead { font-size: clamp(1.1rem, 1rem + 0.55vw, 1.4rem); max-width: 72ch; }

/* Decision trio with the reason for each question */
.decision .trio small { display: block; margin-top: 2px; font-family: var(--font-body); font-weight: 400; font-size: 0.82rem; color: var(--ink-soft); }
.decision .trio li { display: flex; gap: 12px; align-items: flex-start; }
.decision .trio li span { display: block; }
.decision .trio b { margin-top: 3px; }
.reflection-h { margin: 0 0 14px; font-family: var(--font-display); font-weight: 800; font-size: clamp(1.45rem, 1.2rem + 0.9vw, 1.9rem); letter-spacing: -0.01em; }
.step > .figure-2up { grid-column: 1 / -1; margin-top: 10px; }
.gate .gate-sub { margin-top: 8px; }
.gate form { margin-top: 20px; }

/* Result numbers */
.stats { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 28px 0 8px; padding: 0; }
.stats li { border-top: 2px solid var(--rust); padding-top: 14px; }
.stats .num { display: block; font-family: var(--font-display, 'Bricolage Grotesque', sans-serif); font-weight: 700; font-size: clamp(2.2rem, 4.5vw, 3.4rem); line-height: 1; letter-spacing: -0.02em; }
.stats .cap { display: block; margin-top: 10px; font-size: 0.92rem; color: var(--ink-soft); }
@media (max-width: 700px) { .stats { grid-template-columns: 1fr; } }

/* Major learning highlight */
.highlight { margin-top: 48px; padding: 32px 36px; border: 1px solid var(--line-strong); border-left: 4px solid var(--rust); border-radius: 10px; background: color-mix(in srgb, var(--rust) 6%, var(--paper, transparent)); }
.highlight .tag-label { display: block; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--rust); margin-bottom: 12px; }
.highlight h3 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 14px; }
.highlight p { max-width: 68ch; margin: 0 0 12px; }
.highlight p:last-child { margin-bottom: 0; }
@media (max-width: 600px) { .highlight { padding: 22px 20px; } }

/* Agentia hero: three products into one */
.hero-unify { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) 48px minmax(0, 1fr); align-items: center; }
.hero-unify ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.hero-unify li, .unify-out { border: 1px solid var(--line-strong); border-radius: 10px; padding: 16px 18px; background: var(--paper); }
.hero-unify b { display: block; font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; letter-spacing: -0.005em; color: var(--ink); }
.hero-unify span { display: block; margin-top: 4px; font-size: 0.86rem; line-height: 1.4; color: var(--ink-soft); }
.unify-in li { opacity: 0.85; }
.unify-link { width: 100%; height: 200px; color: var(--rust); }
.unify-out { border: 2px solid var(--rust); box-shadow: 0 18px 44px rgba(23,22,15,0.12); padding: 26px 22px; }
.unify-out b { font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.7rem); color: var(--rust); }
@media (max-width: 900px) { .hero-unify { max-width: 620px; } }
@media (max-width: 480px) { .hero-unify { grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr); } .hero-unify li, .unify-out { padding: 12px; } .unify-out { padding: 18px 12px; } }

/* Footer: contact, same as Home/Work/About */
.site-foot { background: #17160F; color: #F3F0E6; padding: 44px var(--gutter); }
.site-foot .foot-inner { max-width: 1180px; margin-inline: auto; }
.site-foot .foot-label { display: block; font-family: var(--font-mono, "IBM Plex Mono", monospace); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: #C97C3F; margin-bottom: 16px; }
.site-foot .foot-row { display: flex; flex-wrap: wrap; gap: 12px 32px; font-family: var(--font-mono, "IBM Plex Mono", monospace); font-size: 0.8rem; letter-spacing: 0.02em; }
.site-foot .item { display: inline-flex; align-items: center; gap: 8px; color: #D9D4C3; }
.site-foot svg { width: 14px; height: 14px; flex-shrink: 0; color: #C97C3F; }
.site-foot a { color: #F3F0E6; text-decoration: none; border-bottom: 1px solid rgba(243,240,230,0.35); }
.site-foot a:hover { color: #C97C3F; border-color: #C97C3F; }

/* Typography polish: no widows, one reading measure across the page */
:root { --measure: 46rem; }
h1, h2, h3, blockquote, figcaption, .dek, .hero-meta, .role-lead, .lead, .question, .muted, .decision-head h3, .step-head h3 { text-wrap: balance; }
p, li, dd { text-wrap: pretty; }
.block > p, .block > p.note, .block > p.muted, .reflection p, .reflection blockquote { max-width: calc(66.667% - 8px); }
.highlight p, .challenge .copy p { max-width: var(--measure); }
@media (max-width: 760px) { .block > p, .block > p.note, .block > p.muted, .reflection p, .reflection blockquote { max-width: none; } }
.step-body p, .step-body .step-note { max-width: none; }
.block .note { font-size: 0.92rem; }
