/* Tokens follow portfolio/DESIGN.md: warm off-white page, one teal accent (the CV accent). */
:root {
  --page: oklch(0.975 0.006 85);
  --surface: oklch(0.992 0.004 85);
  --shift: oklch(0.962 0.008 85);
  --stage: oklch(0.945 0.01 80);
  --ink: oklch(0.25 0.012 230);
  --body: oklch(0.38 0.012 230);
  --muted: oklch(0.5 0.012 230);
  --hair: oklch(0.9 0.008 85);
  --hair-2: oklch(0.935 0.007 85);
  --accent: oklch(0.62 0.11 218);
  --accent-ink: oklch(0.46 0.1 218);
  --accent-wash: oklch(0.965 0.02 218);
  --max: 1120px;
  --gutter: clamp(20px, 5vw, 64px);
  --font: "Onest", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: oklch(0.2 0.01 230);
    --surface: oklch(0.24 0.012 230);
    --shift: oklch(0.27 0.012 230);
    --stage: oklch(0.22 0.012 230);
    --ink: oklch(0.95 0.006 85);
    --body: oklch(0.84 0.008 85);
    --muted: oklch(0.7 0.01 85);
    --hair: oklch(0.34 0.012 230);
    --hair-2: oklch(0.3 0.012 230);
    --accent: oklch(0.72 0.11 218);
    --accent-ink: oklch(0.8 0.09 218);
    --accent-wash: oklch(0.3 0.04 218);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--page);
  color: var(--body);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  font-feature-settings: "tnum" 1;
}
h1, h2, h3 { color: var(--ink); margin: 0; }
p { margin: 0; }
a { color: var(--accent-ink); text-underline-offset: 3px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.label {
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}

/* Label bar */
.labelbar { border-bottom: 1px solid var(--hair); background: var(--surface); }
.labelbar p { font-size: 13px; padding: 10px 0; color: var(--muted); }
.labelbar strong { color: var(--body); font-weight: 600; }

/* Hero */
.hero { padding: clamp(64px, 9vw, 128px) 0 clamp(48px, 7vw, 96px); }
.hero .label { color: var(--accent-ink); }
.hero h1 {
  margin-top: 20px; max-width: 22ch;
  font-size: clamp(34px, 5vw, 64px); font-weight: 300; line-height: 1.08; letter-spacing: -0.03em;
}
.hero .intro { margin-top: 28px; max-width: 60ch; font-size: 18px; font-weight: 300; }
.toc { margin: 40px 0 0; padding: 0; list-style: none; display: grid; gap: 0; border-top: 1px solid var(--hair); max-width: 760px; }
.toc li { border-bottom: 1px solid var(--hair); }
.toc a {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 16px; align-items: baseline;
  padding: 16px 0; color: var(--ink); text-decoration: none;
}
.toc a:hover .toc-name { color: var(--accent-ink); }
.toc .num { font-size: 13px; color: var(--muted); }
.toc-name { font-size: 18px; font-weight: 500; transition: color 160ms; }
.toc .where { font-size: 13px; color: var(--muted); }

/* Case chapters */
.case { padding: clamp(72px, 10vw, 140px) 0; border-top: 1px solid var(--hair); }
.case:nth-of-type(even) { background: var(--surface); }
.case-grid { display: grid; grid-template-columns: 190px 1fr; gap: clamp(24px, 4vw, 56px); }
.rail { position: sticky; top: 32px; align-self: start; }
.rail .num { display: block; font-size: 44px; font-weight: 200; line-height: 1; color: var(--accent); }
.rail .label { display: block; margin-top: 12px; }
.case h2 {
  font-size: clamp(24px, 2.8vw, 36px); font-weight: 300; line-height: 1.22; letter-spacing: -0.015em; max-width: 30ch;
}
.cols { margin-top: 44px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.col h3 { font-size: 13px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); padding-bottom: 10px; border-bottom: 1px solid var(--hair); }
.col p, .col li { font-size: 15.5px; }
.col p { margin-top: 14px; }
.col ul { margin: 14px 0 0; padding-left: 18px; }
.col li + li { margin-top: 8px; }
.col--changed p strong { color: var(--ink); font-weight: 600; }

/* Exhibit: one visual per case */
.exhibit { margin: 48px 0 0; padding: clamp(20px, 3vw, 36px); background: var(--stage); border-radius: 14px; }
.exhibit figcaption { font-size: 13px; color: var(--muted); margin-top: 16px; }

/* 01 decision path */
.path { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.path li {
  position: relative; background: var(--surface); border: 1px solid var(--hair); border-radius: 10px; padding: 14px 14px 16px;
  counter-increment: step;
}
.path li::before { content: counter(step, decimal-leading-zero); display: block; font-size: 12px; color: var(--muted); }
.path li:not(:last-child)::after {
  content: ""; position: absolute; top: 50%; right: -9px; width: 8px; height: 1px; background: var(--accent);
}
.path b { display: block; margin-top: 6px; font-size: 15px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.path span { display: block; margin-top: 6px; font-size: 13.5px; line-height: 1.45; }
.path li:last-child { border-color: var(--accent); background: var(--accent-wash); }
@media (max-width: 1180px) {
  .path { grid-template-columns: 1fr; gap: 10px; }
  .path li { display: grid; grid-template-columns: 28px 170px 1fr; gap: 12px; align-items: baseline; padding: 12px 16px; }
  .path li::before { grid-column: 1; }
  .path b, .path span { margin-top: 0; }
  .path li:not(:last-child)::after { top: auto; bottom: -9px; right: auto; left: 28px; width: 1px; height: 8px; }
}
@media (max-width: 560px) {
  .path li { grid-template-columns: 28px 1fr; }
  .path span { grid-column: 2; }
}

/* 02 big numeral */
.numeral { display: grid; grid-template-columns: auto 1fr; gap: clamp(16px, 3vw, 40px); align-items: center; }
.numeral .big { font-size: clamp(88px, 16vw, 200px); font-weight: 200; line-height: 0.9; letter-spacing: -0.04em; color: var(--accent); }
.numeral p { font-size: 18px; font-weight: 300; max-width: 36ch; color: var(--ink); }

/* 03 hours bars */
.bars { display: grid; gap: 18px; }
.bar { display: grid; grid-template-columns: 210px 1fr; gap: 16px; align-items: center; }
.bar .who { font-size: 14.5px; color: var(--ink); }
.bar .track { display: flex; align-items: center; position: relative; height: 34px; background: var(--surface); border: 1px solid var(--hair); border-radius: 8px; overflow: hidden; }
.bar .fill { height: 100%; background: var(--hair); display: flex; align-items: center; justify-content: flex-end; padding-right: 10px; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.bar .fill--accent { background: var(--accent); color: var(--surface); }

/* Footer */
.foot { padding: 56px 0 72px; border-top: 1px solid var(--hair); }
.foot p { font-size: 14px; color: var(--muted); }
.foot p + p { margin-top: 8px; }

@media (max-width: 880px) {
  .case-grid { grid-template-columns: 1fr; }
  .rail { position: static; display: flex; align-items: baseline; gap: 14px; }
  .rail .label { margin-top: 0; }
  .cols { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 560px) {
  .numeral { grid-template-columns: 1fr; }
  .bar { grid-template-columns: 1fr; gap: 6px; }
  .toc a { grid-template-columns: 32px 1fr; }
  .toc .where { grid-column: 2; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
.bar .after { padding-left: 10px; font-size: 13.5px; font-weight: 600; color: var(--ink); white-space: nowrap; }
