/* ---------- Tokens ---------- */
:root {
  --bg: #f9f9f9;
  --bg-2: #efeeea;
  --surface: #ffffff;
  --fg: #0a0a0a;
  --muted: #5a5752;
  --line: #dedcd6;
  --accent: #b3200e;       /* text-safe red, 5.8:1 on bg-2 */
  --accent-hot: #ff462e;   /* decorative only */
  --band: #0e0e0e;
  --band-fg: #f2f1ee;
  --band-muted: #a3a09a;
  --band-line: #2a2927;
  --coast-bg: #0b2624;
  --coast-fg: #e6f2f0;
  --coast-muted: #9cc1bc;
  --coast-accent: #5ed3c5;
  --coast-brand: #12807a;

  --font-sans: "Inter Tight", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1320px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0e0e; --bg-2: #161616; --surface: #141414;
    --fg: #f2f1ee; --muted: #a3a09a; --line: #2a2927;
    --accent: #ff6a52; --band: #050505; --band-line: #222;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e0e0e; --bg-2: #161616; --surface: #141414;
  --fg: #f2f1ee; --muted: #a3a09a; --line: #2a2927;
  --accent: #ff6a52; --band: #050505; --band-line: #222;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 1rem/1.6 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
code { font-family: var(--font-mono); font-size: .85em; }
:focus-visible { outline: 2px solid var(--accent-hot); outline-offset: 3px; }
::selection { background: var(--accent-hot); color: #0a0a0a; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--fg); color: var(--bg); padding: 10px 16px; text-decoration: none;
}
.skip:focus { top: 12px; color: var(--bg); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.serif { font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: 0; }
.mono { font-family: var(--font-mono); font-size: .75rem; letter-spacing: .04em; text-transform: uppercase; }
.reg { font-size: .38em; vertical-align: super; font-weight: 500; color: var(--accent-hot); margin-left: .04em; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.brand { font-weight: 700; font-size: 1.05rem; letter-spacing: -.02em; text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.brand .reg { font-size: .6em; }
.nav { margin-left: auto; }
.nav ul { display: flex; gap: 4px; }
.nav a {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 10px;
  text-decoration: none; font-size: .9rem; font-weight: 500;
}
.nav a .n { font-family: var(--font-mono); font-size: .68rem; color: var(--muted); }
.nav a[aria-current="page"] .label { color: var(--accent); }
.roll { display: inline-block; overflow: hidden; height: 1.6em; line-height: 1.6em; vertical-align: middle; }
.roll .label { display: block; transition: transform .35s var(--ease); }
.roll .label::after { content: attr(data-text); display: block; color: var(--accent); }
a:hover .roll .label, a:focus-visible .roll .label { transform: translateY(-1.6em); }
.theme-toggle {
  width: 44px; height: 44px; display: grid; place-items: center; flex: none;
  border: 1px solid var(--line); background: transparent; cursor: pointer; border-radius: 0;
}
.theme-toggle:hover { border-color: var(--fg); }
.theme-toggle svg { width: 18px; height: 18px; }
.icon-sun { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: block; }
  :root:not([data-theme="light"]) .icon-moon { display: none; }
}

@media (max-width: 900px) {
  .header-inner { flex-wrap: wrap; gap: 0 12px; }
  .theme-toggle { margin-left: auto; }
  .nav { order: 3; width: 100%; margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter); overflow-x: auto; scrollbar-width: none; border-top: 1px solid var(--line); }
  .nav::-webkit-scrollbar { display: none; }
  .nav ul { width: max-content; }
  .nav a { padding: 0 12px 0 0; }
}

/* ---------- Section scaffolding ---------- */
.section { padding: clamp(72px, 11vw, 144px) 0; }
.index-row {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  padding-bottom: 14px; margin-bottom: clamp(32px, 5vw, 56px);
  border-bottom: 1px solid var(--line); color: var(--muted);
}
.index-row b { color: var(--fg); font-weight: 500; }
.sec-title {
  font-size: clamp(2.4rem, 6.4vw, 5.6rem); line-height: .95; letter-spacing: -.045em; font-weight: 600;
  max-width: 14ch;
}
.sec-title .serif { letter-spacing: -.01em; }
.sec-lede { color: var(--muted); font-size: clamp(1.05rem, 1.6vw, 1.25rem); max-width: 56ch; margin-top: 20px; }

/* ---------- Buttons ---------- */
.btns { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 20px;
  border: 1px solid var(--fg); text-decoration: none; font-weight: 500; font-size: .95rem;
  transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.btn:hover { background: var(--fg); color: var(--bg); }
.btn-solid { background: var(--fg); color: var(--bg); }
.btn-solid:hover { background: var(--accent-hot); border-color: var(--accent-hot); color: #0a0a0a; }
.btn .arrow { transition: transform .25s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

/* ---------- Hero ---------- */
.hero { padding: clamp(28px, 5vw, 56px) 0 clamp(48px, 7vw, 96px); border-bottom: 1px solid var(--line); }
.hero-meta { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--muted); }
.hero-meta .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #1f9d55; margin-right: 8px; box-shadow: 0 0 0 0 rgba(31,157,85,.5); animation: pulse 2.4s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(31,157,85,0); } 100% { box-shadow: 0 0 0 0 rgba(31,157,85,0); } }
.wordmark {
  font-weight: 700; letter-spacing: -.065em; line-height: .8;
  font-size: clamp(3.5rem, 17.2vw, 16.5rem);
  margin: clamp(20px, 4vw, 40px) 0 clamp(24px, 4vw, 48px) -.04em;
  white-space: nowrap;
}
.wordmark .reg { font-size: .16em; vertical-align: top; position: relative; top: .3em; }
.hero-grid { display: grid; grid-template-columns: 1fr; gap: 28px; align-items: end; }
.hero-who { font-size: .95rem; color: var(--muted); max-width: 34ch; }
.hero-who strong { color: var(--fg); font-weight: 600; display: block; font-size: 1.05rem; }
.hero-lede { font-size: clamp(1.3rem, 2.6vw, 2.1rem); line-height: 1.2; letter-spacing: -.025em; font-weight: 500; max-width: 30ch; }
.hero-lede .serif { color: var(--accent); }
.hero .btns { margin-top: 28px; }
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1fr 2fr; gap: 48px; }
}

/* ---------- Stats ---------- */
.stats { border-bottom: 1px solid var(--line); }
.stats ul { display: grid; grid-template-columns: repeat(2, 1fr); }
.stats li { padding: clamp(24px, 4vw, 44px) clamp(12px, 2vw, 28px) clamp(24px, 4vw, 44px) 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stats li:nth-child(2n) { border-right: 0; padding-left: clamp(12px, 2vw, 28px); }
.stats li:nth-child(n+3) { border-bottom: 0; }
.stat-num { font-size: clamp(2.2rem, 5.4vw, 4.4rem); font-weight: 600; letter-spacing: -.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-num sup { font-size: .4em; color: var(--accent-hot); vertical-align: top; margin-left: 2px; }
.stat-label { color: var(--muted); font-size: .9rem; margin-top: 10px; max-width: 24ch; }
@media (min-width: 900px) {
  .stats ul { grid-template-columns: repeat(4, 1fr); }
  .stats li, .stats li:nth-child(2n) { border-bottom: 0; border-right: 1px solid var(--line); padding-left: clamp(12px, 2vw, 28px); }
  .stats li:first-child { padding-left: 0; }
  .stats li:last-child { border-right: 0; }
}

/* ---------- Coast story ---------- */
.coast { background: var(--coast-bg); color: var(--coast-fg); position: relative; overflow: clip; }
.coast .index-row { border-color: rgba(230,242,240,.16); color: var(--coast-muted); }
.coast .index-row b { color: var(--coast-fg); }
.coast a:hover { color: var(--coast-accent); }
.coast .sec-title .serif { color: var(--coast-accent); }
.coast .sec-lede { color: var(--coast-muted); }
.coast-rings {
  position: absolute; right: -18vw; top: -10vw; width: 70vw; max-width: 900px; aspect-ratio: 1; pointer-events: none; opacity: .14;
}
.coast-top { display: grid; gap: 28px; position: relative; }
.coast-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.badge {
  display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 12px;
  border: 1px solid rgba(230,242,240,.22); font-size: .82rem; color: var(--coast-fg);
}
.badge svg { width: 14px; height: 14px; }
.coast-story { display: grid; gap: 40px; margin-top: clamp(48px, 7vw, 96px); position: relative; }
.phone-col { display: flex; justify-content: center; }
.phone {
  width: min(300px, 78vw); aspect-ratio: 9 / 19; background: #050b0a; border-radius: 44px; padding: 12px;
  box-shadow: 0 0 0 1px rgba(230,242,240,.14), 0 40px 80px -30px rgba(0,0,0,.6);
  position: relative;
}
.phone::before { content: ""; position: absolute; top: 20px; left: 50%; translate: -50% 0; width: 84px; height: 22px; background: #050b0a; border-radius: 20px; z-index: 3; }
.screen { position: relative; width: 100%; height: 100%; border-radius: 34px; overflow: hidden; background: #eef3f2; color: #10201e; font-size: 12px; }
.scr { position: absolute; inset: 0; padding: 52px 14px 16px; display: flex; flex-direction: column; gap: 10px; opacity: 0; transform: translateY(10px); transition: opacity .45s var(--ease), transform .45s var(--ease); }
.scr.on { opacity: 1; transform: none; }
.scr-map { position: absolute; inset: 0; background:
  linear-gradient(90deg, transparent 49%, #d5dfdd 49% 51%, transparent 51%) 0 0 / 64px 64px,
  linear-gradient(0deg, transparent 49%, #d5dfdd 49% 51%, transparent 51%) 0 0 / 64px 64px,
  #e5ecea; }
.scr-map::after { content: ""; position: absolute; left: -10%; top: 52%; width: 130%; height: 10px; background: #cbd7d4; transform: rotate(-14deg); }
.scr > *:not(.scr-map) { position: relative; z-index: 1; }
.s-search { background: #fff; border-radius: 14px; padding: 10px 12px; color: #4a5b58; box-shadow: 0 2px 8px rgba(0,0,0,.06); display: flex; gap: 8px; align-items: center; }
.s-search svg { width: 14px; height: 14px; }
.pin { position: absolute; width: 30px; height: 30px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg); background: var(--coast-brand); display: grid; place-items: center; box-shadow: 0 0 0 6px rgba(18,128,122,.18); }
.pin span { transform: rotate(45deg); color: #fff; font-size: 10px; font-weight: 700; }
.pin.you { background: #10201e; box-shadow: 0 0 0 10px rgba(16,32,30,.12); }
.s-sheet { margin-top: auto; background: #fff; border-radius: 18px; padding: 14px; box-shadow: 0 -4px 20px rgba(0,0,0,.08); display: grid; gap: 8px; }
.s-h { font-weight: 700; font-size: 13px; }
.s-sub { color: #4a5b58; font-size: 11px; }
.s-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid #e4ebe9; }
.s-row:first-of-type { border-top: 0; }
.av { width: 30px; height: 30px; border-radius: 50%; background: #d8efec; color: #0d5e59; font-weight: 700; font-size: 10px; display: grid; place-items: center; flex: none; }
.chip { font-size: 10px; padding: 3px 8px; border-radius: 999px; background: #e3f3f1; color: #0d5e59; white-space: nowrap; }
.s-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.s-btn { border-radius: 12px; padding: 9px; text-align: center; font-weight: 600; font-size: 11px; background: #e9eeed; color: #10201e; }
.s-btn.go { background: var(--coast-brand); color: #fff; }
.s-toggle { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid #e4ebe9; }
.s-toggle:first-of-type { border-top: 0; }
.sw { width: 30px; height: 18px; border-radius: 9px; background: var(--coast-brand); position: relative; flex: none; }
.sw::after { content: ""; position: absolute; right: 2px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; }
.sw.off { background: #c9d3d1; }
.sw.off::after { right: auto; left: 2px; }
.bubble { max-width: 78%; padding: 8px 11px; border-radius: 14px; background: #fff; font-size: 11.5px; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.bubble.me { align-self: flex-end; background: var(--coast-brand); color: #fff; border-bottom-right-radius: 4px; }
.bubble:not(.me) { border-bottom-left-radius: 4px; }
.s-top { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid #dfe7e5; }
.s-ok { display: inline-flex; gap: 6px; align-items: center; color: #0d5e59; font-weight: 600; font-size: 11px; }
.s-tests { margin-top: 6px; font-family: var(--font-mono); font-size: 10.5px; background: #10201e; color: #b8f0e9; border-radius: 12px; padding: 12px; line-height: 1.7; }
.s-tests b { color: #5ed3c5; font-weight: 500; }

.chapters { display: grid; gap: 0; counter-reset: ch; }
.chapter { padding: 28px 0; border-top: 1px solid rgba(230,242,240,.16); transition: opacity .4s var(--ease); }
.chapter:last-child { border-bottom: 1px solid rgba(230,242,240,.16); }
.ch-n { font-family: var(--font-mono); font-size: .75rem; color: var(--coast-accent); letter-spacing: .06em; }
.chapter h3 { font-size: clamp(1.5rem, 3vw, 2.3rem); line-height: 1.05; letter-spacing: -.035em; font-weight: 600; margin: 10px 0 14px; }
.chapter p { color: var(--coast-muted); max-width: 52ch; }
.chapter p strong { color: var(--coast-fg); font-weight: 500; }
.chapter ul { margin-top: 14px; display: grid; gap: 8px; }
.chapter li { display: grid; grid-template-columns: 18px 1fr; gap: 10px; color: var(--coast-muted); }
.chapter li svg { width: 16px; height: 16px; margin-top: 4px; color: var(--coast-accent); }
.coast-foot { display: grid; gap: 24px; margin-top: clamp(48px, 6vw, 80px); padding-top: 28px; border-top: 1px solid rgba(230,242,240,.16); }
.stack-list { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--coast-muted); font-size: .92rem; }
.coast .btn { border-color: var(--coast-fg); color: var(--coast-fg); }
.coast .btn:hover { background: var(--coast-fg); color: var(--coast-bg); }
.coast .btn-solid { background: var(--coast-accent); border-color: var(--coast-accent); color: var(--coast-bg); }
.coast .btn-solid:hover { background: var(--coast-fg); border-color: var(--coast-fg); color: var(--coast-bg); }

@media (min-width: 960px) {
  .coast-top { grid-template-columns: 1.3fr 1fr; align-items: end; }
  .coast-story { grid-template-columns: 1fr 1.1fr; gap: 72px; }
  .phone-col { position: sticky; top: calc(50vh - 300px); align-self: start; height: 620px; align-items: center; }
  .chapter { padding: 12vh 0; opacity: .35; }
  .chapter.active { opacity: 1; }
  .coast-foot { grid-template-columns: 1fr auto; align-items: center; }
}
@media (min-width: 960px) and (max-height: 700px) {
  .phone-col { top: 80px; }
}

/* ---------- Work rows ---------- */
.rows { border-top: 1px solid var(--line); }
.row {
  position: relative; display: grid; grid-template-columns: 40px 1fr; gap: 6px 16px;
  padding: 26px 0; border-bottom: 1px solid var(--line);
  transition: background-color .25s var(--ease), padding .3s var(--ease);
}
.row-n { font-family: var(--font-mono); font-size: .75rem; color: var(--muted); padding-top: .55em; }
.row h3 { font-size: clamp(1.35rem, 2.6vw, 2rem); letter-spacing: -.035em; line-height: 1.1; font-weight: 600; }
.row h3 a { text-decoration: none; }
.row h3 a::after { content: ""; position: absolute; inset: 0; }
.row p { color: var(--muted); max-width: 60ch; margin-top: 8px; }
.row-meta { grid-column: 2; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; margin-top: 4px; }
.metric { font-weight: 600; letter-spacing: -.02em; }
.metric .serif { color: var(--accent); font-size: 1.15em; }
.tags { color: var(--muted); font-size: .85rem; }
.row-year { font-family: var(--font-mono); font-size: .75rem; color: var(--muted); }
.row-arrow { display: none; }
.row:hover { background: var(--bg-2); }
.row:has(a:focus-visible) { outline: 2px solid var(--accent-hot); outline-offset: -2px; }
.row h3 a:focus-visible { outline: none; }
@media (min-width: 900px) {
  .row { grid-template-columns: 64px minmax(0, 1.5fr) minmax(0, 1fr) 90px 40px; align-items: center; padding: 30px 0; }
  .row:hover { padding-left: 16px; padding-right: 16px; }
  .row-meta { grid-column: auto; flex-direction: column; gap: 6px; }
  .row-year { text-align: right; }
  .row-arrow { display: block; width: 28px; height: 28px; justify-self: end; transition: transform .3s var(--ease), color .2s; }
  .row:hover .row-arrow { transform: rotate(-45deg); color: var(--accent); }
}
.team { font-family: var(--font-mono); font-size: .65rem; letter-spacing: .06em; text-transform: uppercase; border: 1px solid var(--line); padding: 2px 6px; margin-left: 8px; vertical-align: middle; color: var(--muted); font-weight: 400; }

/* ---------- Open source ---------- */
.oss-grid { display: grid; gap: 40px; }
.oss-list li { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.oss-list li:first-child { border-top: 1px solid var(--line); }
.oss-org { font-weight: 600; letter-spacing: -.01em; }
.oss-org a { text-decoration: none; }
.oss-org a:hover { text-decoration: underline; }
.oss-fix { grid-column: 1; color: var(--muted); font-size: .95rem; }
.oss-status { grid-row: 1 / span 2; grid-column: 2; align-self: center; text-align: right; }
.status { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status.merged { color: #6d28d9; }
.status.open { color: #15803d; }
:root[data-theme="dark"] .status.merged { color: #b99cff; }
:root[data-theme="dark"] .status.open { color: #5fd38d; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .status.merged { color: #b99cff; }
  :root:not([data-theme="light"]) .status.open { color: #5fd38d; }
}
.oss-date { display: block; font-family: var(--font-mono); font-size: .7rem; color: var(--muted); margin-top: 4px; }
.oss-side .big { font-size: clamp(5rem, 14vw, 11rem); font-weight: 600; letter-spacing: -.06em; line-height: .85; }
.oss-side .big sup { font-size: .25em; color: var(--accent-hot); vertical-align: top; }
.oss-side p { color: var(--muted); max-width: 34ch; margin-top: 14px; }
@media (min-width: 900px) { .oss-grid { grid-template-columns: 1fr 2fr; gap: 64px; } .oss-side { position: sticky; top: 100px; align-self: start; } }

/* ---------- Research ---------- */
.papers { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.paper { background: var(--bg); padding: clamp(24px, 3vw, 36px); display: flex; flex-direction: column; gap: 14px; }
.paper-tag { color: var(--muted); }
.paper-tag.hot { color: var(--accent); }
.paper h3 { font-size: clamp(1.3rem, 2.2vw, 1.7rem); letter-spacing: -.03em; line-height: 1.12; font-weight: 600; }
.paper p { color: var(--muted); }
.paper-num { font-size: clamp(2.4rem, 4.5vw, 3.6rem); font-weight: 600; letter-spacing: -.05em; line-height: 1; margin-top: auto; padding-top: 10px; }
.paper-num small { font-size: .32em; letter-spacing: 0; font-weight: 500; color: var(--muted); display: block; margin-top: 6px; }
.paper a { font-weight: 500; }
@media (min-width: 900px) { .papers { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Principles ---------- */
.principles { display: grid; gap: 0; border-top: 1px solid var(--line); }
.principle { padding: 28px 0; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.principle .mono { color: var(--accent); }
.principle h3 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); letter-spacing: -.03em; line-height: 1.1; font-weight: 600; }
.principle p { color: var(--muted); max-width: 46ch; }
@media (min-width: 900px) {
  .principles { grid-template-columns: repeat(3, 1fr); border-top: 0; }
  .principle { border-bottom: 0; border-left: 1px solid var(--line); padding: 8px 28px 8px; }
  .principle:first-child { border-left: 0; padding-left: 0; }
}

/* ---------- Roadmap teaser ---------- */
.teaser { display: block; text-decoration: none; background: var(--band); color: var(--band-fg); padding: clamp(40px, 7vw, 88px) clamp(20px, 5vw, 64px); position: relative; overflow: hidden; }
.teaser:hover { color: var(--band-fg); }
.teaser .mono { color: var(--band-muted); }
.teaser-title { font-size: clamp(2.2rem, 7vw, 6rem); font-weight: 600; letter-spacing: -.05em; line-height: .95; margin-top: 16px; max-width: 14ch; }
.teaser-title .serif { color: var(--accent-hot); }
.teaser p { color: var(--band-muted); max-width: 52ch; margin-top: 18px; }
.teaser-go { display: inline-flex; align-items: center; gap: 12px; margin-top: 28px; font-weight: 500; border-bottom: 1px solid currentColor; padding-bottom: 4px; }
.teaser-go svg { width: 18px; height: 18px; transition: transform .3s var(--ease); }
.teaser:hover .teaser-go svg { transform: translateX(6px); }
.teaser-years { position: absolute; right: -2vw; bottom: -4vw; font-size: clamp(6rem, 22vw, 20rem); font-weight: 700; letter-spacing: -.07em; line-height: .8; color: transparent; -webkit-text-stroke: 1px #2c2b29; pointer-events: none; }

/* ---------- FAQ ---------- */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; display: grid; grid-template-columns: 44px 1fr 28px; gap: 12px; align-items: center;
  padding: 22px 0; font-size: clamp(1.1rem, 1.8vw, 1.4rem); font-weight: 500; letter-spacing: -.02em; min-height: 44px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .mono { color: var(--muted); }
.faq summary .plus { width: 22px; height: 22px; position: relative; justify-self: end; }
.faq summary .plus::before, .faq summary .plus::after { content: ""; position: absolute; left: 50%; top: 50%; width: 16px; height: 1.5px; background: currentColor; translate: -50% -50%; transition: transform .3s var(--ease); }
.faq summary .plus::after { transform: rotate(90deg); }
.faq details[open] .plus::after { transform: rotate(0deg); }
.faq summary:hover { color: var(--accent); }
.faq .answer { padding: 0 0 24px 56px; color: var(--muted); max-width: 70ch; }
@media (max-width: 600px) { .faq .answer { padding-left: 0; } }

/* ---------- Footer ---------- */
.site-footer { background: var(--band); color: var(--band-fg); padding: clamp(64px, 10vw, 128px) 0 28px; }
.site-footer a:hover { color: var(--accent-hot); }
.footer-cta .mono { color: var(--band-muted); }
.footer-big { font-size: clamp(3.2rem, 13vw, 12rem); font-weight: 700; letter-spacing: -.065em; line-height: .85; margin: 18px 0 28px; }
.footer-big .serif { font-weight: 400; color: var(--accent-hot); }
.footer-mail { font-size: clamp(1.15rem, 3vw, 2rem); letter-spacing: -.02em; font-weight: 500; text-decoration: none; border-bottom: 1px solid var(--band-line); padding-bottom: 6px; word-break: break-word; }
.footer-grid { display: grid; gap: 32px; margin-top: clamp(48px, 8vw, 96px); padding-top: 28px; border-top: 1px solid var(--band-line); }
.footer-grid h2 { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--band-muted); font-weight: 400; margin-bottom: 12px; }
.footer-grid li a { display: inline-flex; gap: 10px; align-items: center; min-height: 36px; text-decoration: none; }
.footer-grid li .mono { color: var(--band-muted); font-size: .68rem; }
.footer-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 48px; color: var(--band-muted); font-size: .85rem; }
.footer-base a { text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Roadmap page ---------- */
.rm-hero { padding: clamp(28px, 5vw, 56px) 0 clamp(40px, 6vw, 72px); }
.rm-word { font-size: clamp(3.2rem, 15.5vw, 15rem); font-weight: 700; letter-spacing: -.065em; line-height: .82; margin: clamp(20px, 4vw, 40px) 0 clamp(20px, 3vw, 32px) -.04em; white-space: nowrap; }
.rm-word .to { font-family: var(--font-serif); font-style: italic; font-weight: 400; color: var(--accent-hot); letter-spacing: -.02em; }
.rm-lede { font-size: clamp(1.15rem, 2.2vw, 1.6rem); letter-spacing: -.02em; line-height: 1.3; max-width: 46ch; }
.rm-lede + .mono { color: var(--muted); margin-top: 18px; display: block; }
.rm-summary { display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: clamp(32px, 5vw, 56px); }
.rm-summary div { padding: 20px 16px 20px 0; border-right: 1px solid var(--line); }
.rm-summary div:nth-child(2n) { border-right: 0; padding-left: 16px; }
.rm-summary div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
.rm-summary b { display: block; font-size: clamp(1.8rem, 4vw, 3rem); letter-spacing: -.05em; font-weight: 600; line-height: 1; }
.rm-summary span { color: var(--muted); font-size: .88rem; }
@media (min-width: 900px) {
  .rm-summary { grid-template-columns: repeat(4, 1fr); }
  .rm-summary div, .rm-summary div:nth-child(2n) { border-bottom: 0; border-right: 1px solid var(--line); padding-left: 20px; }
  .rm-summary div:nth-child(-n+2) { border-bottom: 0; }
  .rm-summary div:first-child { padding-left: 0; }
  .rm-summary div:last-child { border-right: 0; }
}

.filters { position: sticky; top: 64px; z-index: 20; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.filters .wrap { display: flex; gap: 8px; align-items: center; overflow-x: auto; padding-top: 10px; padding-bottom: 10px; scrollbar-width: none; }
.filters .wrap::-webkit-scrollbar { display: none; }
.filters .mono { color: var(--muted); margin-right: 6px; flex: none; }
.filter {
  flex: none; min-height: 40px; padding: 0 14px; border: 1px solid var(--line); background: transparent; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px; font-size: .88rem; border-radius: 0;
  transition: background-color .2s, color .2s, border-color .2s;
}
.filter .sw-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--fg)); }
.filter:hover { border-color: var(--fg); }
.filter[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.filter .count { font-family: var(--font-mono); font-size: .7rem; opacity: .7; }
@media (max-width: 900px) { .filters { top: 108px; } }

.track-product { --c: #0f8f86; }
.track-research { --c: #c2410c; }
.track-oss { --c: #7c3aed; }
.track-course { --c: #2563eb; }
.track-edu { --c: #a16207; }
:root[data-theme="dark"] .track-product { --c: #5ed3c5; }
:root[data-theme="dark"] .track-research { --c: #ff8a5c; }
:root[data-theme="dark"] .track-oss { --c: #b99cff; }
:root[data-theme="dark"] .track-course { --c: #7fb0ff; }
:root[data-theme="dark"] .track-edu { --c: #e3b341; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .track-product { --c: #5ed3c5; }
  :root:not([data-theme="light"]) .track-research { --c: #ff8a5c; }
  :root:not([data-theme="light"]) .track-oss { --c: #b99cff; }
  :root:not([data-theme="light"]) .track-course { --c: #7fb0ff; }
  :root:not([data-theme="light"]) .track-edu { --c: #e3b341; }
}

.timeline { padding: clamp(40px, 6vw, 80px) 0 0; }
.timeline .wrap { position: relative; }
.rail { position: absolute; top: 0; bottom: 0; left: calc(var(--gutter) + 7px); width: 1px; background: var(--line); }
.rail-fill { position: absolute; top: 0; left: 0; width: 100%; height: calc(var(--p, 0) * 100%); background: var(--accent-hot); }
.year { position: relative; display: grid; grid-template-columns: 1fr; padding-left: 36px; margin-bottom: clamp(48px, 7vw, 96px); }
.year-label { font-size: clamp(3.4rem, 9vw, 7.5rem); font-weight: 700; letter-spacing: -.06em; line-height: .85; margin-bottom: 20px; }
.year-label small { display: block; font-family: var(--font-mono); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 400; margin-top: 12px; }
.year-label::before { content: ""; position: absolute; left: 0; top: .4em; width: 15px; height: 15px; border-radius: 50%; background: var(--bg); border: 1px solid var(--fg); }
.entries { display: grid; gap: 0; }
.entry { position: relative; padding: 22px 0; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.entry::before { content: ""; position: absolute; left: -32px; top: 31px; width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--fg)); }
.entry-head { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.entry-date { font-family: var(--font-mono); font-size: .72rem; color: var(--muted); letter-spacing: .04em; }
.entry-track { font-family: var(--font-mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--c); display: inline-flex; align-items: center; gap: 6px; }
.entry h3 { font-size: clamp(1.2rem, 2.2vw, 1.6rem); letter-spacing: -.03em; line-height: 1.15; font-weight: 600; }
.entry h3 a { text-decoration: none; }
.entry h3 a:hover { text-decoration: underline; }
.entry p { color: var(--muted); max-width: 64ch; }
.entry .kpis { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.kpi { font-size: .8rem; padding: 4px 10px; border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.kpi b { font-weight: 600; }
.entry.big h3 { font-size: clamp(1.6rem, 3.4vw, 2.6rem); }
.entry.big { padding: 30px 0; }
.entry[hidden], .year[hidden] { display: none; }
@media (min-width: 900px) {
  .rail { left: calc(var(--gutter) + 228px); }
  .year { grid-template-columns: 200px 1fr; gap: 0 56px; padding-left: 0; }
  .year-label { position: sticky; top: 140px; align-self: start; margin: 0; text-align: right; font-size: clamp(3rem, 5vw, 4.4rem); }
  .year-label::before { left: 221px; top: .35em; }
  .entry::before { left: -32px; }
  .entry:first-child { border-top: 0; padding-top: 0; }
  .entry:first-child::before { top: 9px; }
}
@media (max-width: 899px) { .entry:first-child { border-top: 0; padding-top: 0; } .entry:first-child::before { top: 9px; } }

.now { border: 1px solid var(--fg); padding: clamp(20px, 3vw, 32px); display: grid; gap: 10px; }
.now .mono { color: var(--accent); }

.cols { display: grid; gap: 40px; }
.skill-grid { display: grid; gap: 0; border-top: 1px solid var(--line); }
.skill-grid div { display: grid; gap: 6px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.skill-grid dt { font-weight: 600; letter-spacing: -.01em; }
.skill-grid dd { color: var(--muted); font-size: .95rem; }
@media (min-width: 900px) { .skill-grid div { grid-template-columns: 260px 1fr; gap: 24px; } }
.course-list { display: flex; flex-wrap: wrap; gap: 8px; }
.course-list li { border: 1px solid var(--line); padding: 6px 12px; font-size: .88rem; }
.pub { border-left: 2px solid var(--accent-hot); padding-left: 18px; max-width: 80ch; }
.pub p + p { color: var(--muted); margin-top: 8px; font-size: .95rem; }
.mini-list li { padding: 14px 0; border-bottom: 1px solid var(--line); }
.mini-list li:first-child { border-top: 1px solid var(--line); }
.mini-list b { font-weight: 600; }
.mini-list span { color: var(--muted); }
.sub-h { font-size: clamp(1.6rem, 3vw, 2.4rem); letter-spacing: -.04em; font-weight: 600; margin-bottom: 20px; line-height: 1; }

/* ---------- Motion ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .scr { transform: none; }
}

@media print {
  .site-header, .filters, .theme-toggle, .teaser, .rail { display: none !important; }
  body { background: #fff; color: #000; }
  .site-footer, .coast { background: #fff; color: #000; }
}
