:root {
  --paper: #f5f3ee;
  --ink: #191a17;
  --ink-2: #44463f;
  --quiet: #6f7068;
  --rule: #dfdbd1;
  --rule-strong: #cbc6b9;
  --forest: #1f4d3a;
  --forest-tint: #e2eae3;
  --fail: #a23b2a;
  --fail-tint: #f3e3dd;
  --font: "Schibsted Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --grid: 1120px;
  --gutter: 32px;
  --rail: 200px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #131411;
    --ink: #ecebe5;
    --ink-2: #c3c3b9;
    --quiet: #94958b;
    --rule: #2a2b26;
    --rule-strong: #3b3c35;
    --forest: #93c0a4;
    --forest-tint: #1b261f;
    --fail: #e08a78;
    --fail-tint: #2c1d19;
  }
}

:root[data-theme="dark"] {
  --paper: #131411;
  --ink: #ecebe5;
  --ink-2: #c3c3b9;
  --quiet: #94958b;
  --rule: #2a2b26;
  --rule-strong: #3b3c35;
  --forest: #93c0a4;
  --forest-tint: #1b261f;
  --fail: #e08a78;
  --fail-tint: #2c1d19;
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

::view-transition-old(root), ::view-transition-new(root) { animation-duration: .45s; animation-timing-function: ease; }
html.theme-anim, html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after {
  transition: background-color .5s ease, color .5s ease, border-color .5s ease, fill .5s ease, stroke .5s ease !important;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 18px/1.6 var(--font);
  font-feature-settings: "tnum" 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--forest); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--forest) 35%, transparent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--forest); outline-offset: 3px; border-radius: 2px; }

p { margin: 0 0 1em; }
h1, h2, h3 { font-weight: 600; margin: 0; }

.quiet { color: var(--quiet); }
.small { font-size: 15px; line-height: 1.5; }

/* frame */
.frame { max-width: var(--grid); margin: 0 auto; padding: 0 var(--gutter); }

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  -webkit-backdrop-filter: saturate(140%) blur(12px); backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.topbar.scrolled { border-bottom-color: var(--rule); }
[id] { scroll-margin-top: 88px; }
.nav { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 18px; padding-bottom: 18px; font-size: 16px; }
.nav .name { color: var(--ink); text-decoration: none; font-weight: 600; letter-spacing: -0.01em; display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.nav .mark { width: 26px; height: 26px; flex: none; }
.nav ul { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; }
.nav ul a { color: var(--ink-2); text-decoration: none; }
.nav ul a:hover { color: var(--ink); }
.nav .right { display: flex; align-items: center; gap: 20px; }
.theme { width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--ink-2); cursor: pointer; padding: 0; }
.theme:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.theme svg { width: 18px; height: 18px; }
.theme .sun { display: none; }
:root[data-theme="dark"] .theme .sun { display: block; }
:root[data-theme="dark"] .theme .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme .sun { display: block; }
  :root:not([data-theme="light"]) .theme .moon { display: none; }
}

/* hero */
.hero { position: relative; min-height: calc(100vh - 64px); min-height: calc(100svh - 64px); display: flex; flex-direction: column; justify-content: center; padding: 24px 0 96px; }
.cue { position: absolute; left: 50%; bottom: 28px; width: 40px; height: 40px; margin-left: -20px; display: grid; place-items: center; color: var(--quiet); border-radius: 50%; text-decoration: none; transition: opacity .3s ease, color .2s ease; }
.cue:hover { color: var(--forest); }
.cue svg { width: 22px; height: 22px; }
.cue.gone { opacity: 0; pointer-events: none; }
@media (prefers-reduced-motion: no-preference) {
  .cue svg { animation: nudge 2.4s ease-in-out infinite; }
  @keyframes nudge { 0%, 70%, 100% { transform: translateY(0); } 85% { transform: translateY(4px); } }
}
.intro { padding: 88px 0 0; }
.intro .lede { margin-bottom: 24px; }
.intro .links { margin-bottom: 56px; }
.js-reveal .reveal { opacity: 0; transform: translateY(14px); transition: opacity 1s cubic-bezier(.2,.6,.2,1), transform 1s cubic-bezier(.2,.6,.2,1); }
.js-reveal .reveal.in { opacity: 1; transform: none; }
.hero .role-line { font-size: 17px; color: var(--ink-2); margin: 0 0 16px; }
.hero h1 {
  font-size: clamp(42px, 7.4vw, 92px);
  line-height: 0.98;
  letter-spacing: -0.045em;
  font-weight: 600;
  max-width: 15ch;
  margin: 0 0 40px;
}
.lede { font-size: 20px; line-height: 1.55; color: var(--ink-2); max-width: 36em; margin: 0 0 28px; }
.links { display: flex; flex-wrap: wrap; gap: 10px 28px; list-style: none; margin: 0; padding: 0; font-size: 17px; font-weight: 500; }

/* figures with provenance */
.figures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 2px solid var(--ink); }
.fig { padding: 26px 28px 30px 0; border-right: 1px solid var(--rule); }
.fig + .fig { padding-left: 28px; }
.fig:last-child { border-right: 0; }
.fig .num { font-size: clamp(42px, 4.6vw, 60px); white-space: nowrap; line-height: 1; letter-spacing: -0.04em; font-weight: 600; font-feature-settings: "tnum" 1; display: flex; align-items: flex-start; gap: 6px; }
.fig .what { margin: 14px 0 0; color: var(--ink-2); font-size: 16px; line-height: 1.45; max-width: 22em; }
.cite {
  font: 600 12px/1 var(--font);
  color: var(--forest);
  background: var(--forest-tint);
  border: 0;
  border-radius: 999px;
  min-width: 22px; height: 22px; padding: 0 7px;
  cursor: pointer;
  margin-top: 6px;
  letter-spacing: 0;
}
.cite:hover, .cite[aria-expanded="true"] { background: var(--forest); color: var(--paper); }
.source { margin: 14px 0 0; padding: 12px 0 0 14px; border-left: 2px solid var(--forest); font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.source[hidden] { display: none; }
.source b { font-weight: 600; color: var(--ink); display: block; margin-bottom: 2px; }
@media (prefers-reduced-motion: no-preference) {
  .source:not([hidden]) { animation: trace .28s ease-out; }
  @keyframes trace { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
}
.figures-note { margin: 14px 0 0; font-size: 14px; color: var(--quiet); }

/* rail layout */
.band { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); gap: 0 48px; padding: 96px 0 0; }
.band > .rail h2 { font-size: 17px; font-weight: 600; letter-spacing: 0; position: sticky; top: 88px; padding-top: 6px; border-top: 2px solid var(--ink); }
.band > .body { min-width: 0; }

/* exhibits */
.exhibits { list-style: none; margin: 0; padding: 0; }
.exhibit { border-top: 2px solid var(--ink); }
.exhibit:last-child { border-bottom: 1px solid var(--rule); }
.exhibit + .exhibit { border-top-width: 1px; border-top-color: var(--rule); }
.exhibit a { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; padding: 32px 0 36px; color: inherit; text-decoration: none; }
.exhibit h3 { font-size: 30px; line-height: 1.12; letter-spacing: -0.025em; margin: 0 0 12px; }
.exhibit a:hover h3 { color: var(--forest); }
.exhibit p { color: var(--ink-2); margin: 0 0 14px; max-width: 34em; }
.exhibit .where { font-size: 15px; color: var(--quiet); margin: 0; }
.exhibit .read { font-size: 15px; font-weight: 500; color: var(--forest); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--forest) 35%, transparent); text-underline-offset: 3px; }
.thumb { align-self: center; background: color-mix(in srgb, var(--ink) 3%, transparent); border-radius: 4px; padding: 18px; }
.thumb svg { width: 100%; height: auto; display: block; }

/* now */
.now h3 { font-size: 30px; line-height: 1.15; letter-spacing: -0.025em; margin: 0 0 6px; }
.now .when { color: var(--quiet); font-size: 16px; margin: 0 0 24px; }
.now .intro { font-size: 20px; line-height: 1.55; max-width: 34em; margin: 0 0 32px; }
.did { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; }
.did li { padding: 16px 0; border-top: 1px solid var(--rule); color: var(--ink-2); font-size: 16px; line-height: 1.5; }
.did li strong { display: block; color: var(--ink); font-weight: 600; margin-bottom: 2px; }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 24px; padding: 22px 0; border-top: 1px solid var(--rule); }
.timeline li:first-child { border-top: 2px solid var(--ink); }
.timeline .yrs { font-feature-settings: "tnum" 1; color: var(--quiet); font-size: 16px; padding-top: 3px; }
.timeline h3 { font-size: 21px; letter-spacing: -0.015em; margin: 0 0 2px; }
.timeline .title { color: var(--ink-2); margin: 0 0 8px; font-size: 16px; }
.timeline .desc { color: var(--ink-2); margin: 0; font-size: 16px; max-width: 38em; }

/* contact */
.contact { padding: 120px 0 0; }
.contact h2 { font-size: clamp(34px, 5vw, 60px); line-height: 1.02; letter-spacing: -0.04em; max-width: 14ch; margin: 0 0 28px; }
.contact .email { font-size: clamp(20px, 2.4vw, 28px); font-weight: 500; letter-spacing: -0.01em; }

footer { margin-top: 120px; border-top: 1px solid var(--rule); }
footer .frame { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 22px; padding-bottom: 48px; font-size: 15px; color: var(--quiet); }

/* ---------- case studies ---------- */
.wrap { max-width: 760px; margin: 0 auto; padding: 0 var(--gutter); }
.back { display: inline-block; margin: 32px 0 0; font-size: 16px; text-decoration: none; }
.cs-head { padding: 56px 0 40px; }
.cs-head .kicker { color: var(--ink-2); font-size: 17px; margin: 0; }
.cs-head h1 { font-size: clamp(40px, 6.4vw, 72px); line-height: 1; letter-spacing: -0.045em; margin: 18px 0 24px; }
.cs-head .deck { font-size: 22px; line-height: 1.45; color: var(--ink-2); margin: 0; letter-spacing: -0.005em; }
.meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; border-top: 2px solid var(--ink); padding: 18px 0 0; margin: 0; }
.meta dt { font-weight: 600; font-size: 15px; margin: 0 0 4px; }
.meta dd { margin: 0; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.cs section { padding-top: 56px; }
.cs h2 { font-size: 28px; letter-spacing: -0.02em; margin: 0 0 16px; }
.cs ol, .cs ul { padding-left: 22px; margin: 0 0 1em; }
.cs li { margin: 0 0 14px; }
.cs li::marker { color: var(--quiet); font-feature-settings: "tnum" 1; }
.cs strong { font-weight: 600; }
.takeaway { margin: 0; font-size: 26px; line-height: 1.35; letter-spacing: -0.02em; font-weight: 500; max-width: 26em; }

figure { margin: 48px 0 8px; padding: 28px; background: color-mix(in srgb, var(--ink) 3%, transparent); border-radius: 4px; }
figure svg { width: 100%; max-width: 560px; height: auto; display: block; margin: 0 auto; }
figcaption { margin-top: 18px; font-size: 15px; color: var(--quiet); text-align: center; }
.d-box { fill: var(--paper); stroke: var(--rule-strong); stroke-width: 1; }
.d-box-accent { fill: var(--forest-tint); stroke: var(--forest); stroke-width: 1; }
.d-box-fail { fill: var(--fail-tint); stroke: var(--fail); stroke-width: 1; }
.d-line { stroke: var(--quiet); stroke-width: 1; fill: none; }
.d-line-accent { stroke: var(--forest); stroke-width: 1.5; fill: none; }
.d-line-fail { stroke: var(--fail); stroke-width: 1.5; fill: none; stroke-dasharray: 5 4; }
.d-t { fill: var(--ink); font: 500 15px var(--font); }
.d-ts { fill: var(--quiet); font: 400 12px var(--font); }
.d-tf { fill: var(--fail); font: 500 14px var(--font); }
.d-ta { fill: var(--forest); font: 500 14px var(--font); }
.d-head-m { fill: var(--quiet); }
.d-head-a { fill: var(--forest); }
.d-head-f { fill: var(--fail); }

.next { margin-top: 88px; border-top: 2px solid var(--ink); padding-top: 18px; }
.next a { display: block; color: var(--ink); text-decoration: none; }
.next .label { color: var(--quiet); font-size: 15px; display: block; margin-bottom: 6px; }
.next h3 { font-size: 30px; letter-spacing: -0.025em; }
.next a:hover h3 { color: var(--forest); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .band { grid-template-columns: 1fr; gap: 0; padding-top: 72px; }
  .band > .rail h2 { position: static; border-top: 0; padding: 0; margin: 0 0 16px; color: var(--quiet); font-weight: 500; }
  .exhibit a { grid-template-columns: 1fr; gap: 20px; }
  .thumb { max-width: 360px; }
}
@media (max-width: 820px) {
  .figures { grid-template-columns: 1fr; }
  .fig, .fig + .fig { padding: 22px 0 24px; border-right: 0; border-bottom: 1px solid var(--rule); }
  .fig:last-child { border-bottom: 0; }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; }
  body { font-size: 17px; }
  .nav ul { gap: 14px; font-size: 15px; }
  .nav .right { gap: 8px; }
  .theme { width: 30px; height: 30px; }
  .nav .name { gap: 8px; font-size: 15px; }
  .nav .mark { width: 22px; height: 22px; }
  .hero { padding: 16px 0 88px; }
  .intro { padding-top: 56px; }
  .lede { font-size: 18px; }
  .did { grid-template-columns: 1fr; }
  .timeline li { grid-template-columns: 1fr; gap: 4px; }
  .exhibit h3, .now h3 { font-size: 26px; }
  .meta { grid-template-columns: 1fr; gap: 14px; }
  .cs-head .deck { font-size: 19px; }
  .takeaway { font-size: 21px; }
  figure { padding: 16px; margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter)); border-radius: 0; }
}
@media (max-width: 420px) {
  .nav .name span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .nav .mark { width: 26px; height: 26px; }
  .nav ul { gap: 16px; font-size: 15px; }
  .nav .right { gap: 8px; }
  .theme { margin-right: -6px; }
}

/* projects */
.feature { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center; border-top: 2px solid var(--ink); padding: 36px 0 40px; }
.feature .where { font-size: 15px; color: var(--quiet); margin: 0 0 10px; }
.feature h3 { font-size: clamp(40px, 5vw, 56px); line-height: 1; letter-spacing: -0.04em; margin: 0 0 18px; }
.feature h3 a { color: var(--ink); text-decoration: none; }
.feature h3 a:hover { color: var(--forest); }
.feature-deck { font-size: 19px; line-height: 1.55; color: var(--ink-2); margin: 0 0 16px; max-width: 30em; }
.feature .stack { font-size: 15px; color: var(--quiet); margin: 0 0 22px; }
.feature-thumb { display: block; padding: 24px; }
.feature + .feature { border-top-width: 1px; border-top-color: var(--rule); }
.feature:last-child { border-bottom: 1px solid var(--rule); }
@media (max-width: 900px) {
  .feature { grid-template-columns: 1fr; gap: 28px; }
  .feature-thumb { max-width: 420px; }
}

/* role progression */
.timeline .ladder { list-style: none; margin: 6px 0 14px; padding: 0 0 0 18px; position: relative; max-width: 36rem; }
.timeline .ladder::before { content: ""; position: absolute; left: 3.5px; top: 14px; bottom: 14px; border-left: 1px solid var(--rule-strong); }
.timeline .ladder li { position: relative; display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 4px 0; border: 0; font-size: 16px; line-height: 1.45; color: var(--ink-2); }
.timeline .ladder li::before { content: ""; position: absolute; left: -18px; top: 11px; width: 8px; height: 8px; box-sizing: border-box; border-radius: 50%; background: var(--paper); border: 1.5px solid var(--quiet); }
.timeline .ladder li:first-child::before { background: var(--forest); border-color: var(--forest); }
.timeline .ladder li:first-child .r { color: var(--ink); font-weight: 500; }
.timeline .ladder .d { color: var(--quiet); font-feature-settings: "tnum" 1; white-space: nowrap; font-size: 15px; }
