/* =========================================================
   sanvi.cc · "Notebook" design system
   Light: lab-notebook paper. Dark: graphite.
   ========================================================= */
:root {
  --bg: #F5F3ED;
  --surface: #FFFDF8;
  --tint: #EFECE4;
  --text: #1A1917;
  --muted: #5F5A51;
  --line: #DAD5C8;
  --line-strong: #1A1917;
  --accent: #B53C0B;
  --accent-ink: #FFFFFF;
  --accent-soft: #F7E1D6;
  --grid: rgba(26, 25, 23, .05);
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --r: 6px;
  --shadow: 0 1px 0 rgba(26,25,23,.04), 0 12px 32px -18px rgba(60,40,10,.25);
  --ease: cubic-bezier(.2, .7, .2, 1);
  /* 8pt spacing scale */
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s5: 48px; --s6: 64px; --s7: 96px; --s8: 128px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161513; --surface: #1E1D1A; --tint: #1A1917; --text: #ECE9E2; --muted: #A9A397;
    --line: #34322D; --line-strong: #ECE9E2; --accent: #F07A45; --accent-ink: #1A0F08; --accent-soft: #3A2419;
    --grid: rgba(236, 233, 226, .045); --shadow: 0 12px 32px -18px rgba(0,0,0,.7);
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body { margin: 0; overflow-x: clip; background: var(--bg); color: var(--text); font: 400 17px/1.6 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; line-height: 1.08; letter-spacing: -.025em; font-weight: 700; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
.mono { font-family: var(--mono); font-size: 12.5px; letter-spacing: .02em; }
.muted { color: var(--muted); }
.lead { font-size: 20px; line-height: 1.5; max-width: 40ch; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 var(--s4); }
@media (max-width: 640px) { .wrap { padding: 0 var(--s2); } body { font-size: 16px; } }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: var(--r); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
::selection { background: var(--accent); color: var(--accent-ink); }

/* ---------- Buttons & links ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: var(--r); font: 600 15px/1 var(--sans); text-decoration: none; border: 1.5px solid transparent; transition: transform .2s var(--ease), background .2s, border-color .2s, color .2s; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--text)); }
.btn-ghost { border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--line-strong); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 14px; }
.arrow-link { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; text-decoration: none; border-bottom: 1.5px solid var(--accent); padding-bottom: 2px; width: fit-content; }
.arrow-link span { transition: transform .2s var(--ease); }
.arrow-link:hover span { transform: translateX(4px); }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar-in { display: flex; align-items: center; gap: var(--s3); height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; text-decoration: none; letter-spacing: -.01em; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 6px; background: var(--text); color: var(--bg); font: 700 12px var(--mono); box-shadow: inset 0 -3px 0 var(--accent); }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { position: relative; text-decoration: none; color: var(--muted); font-size: 15px; padding: 8px 12px; border-radius: var(--r); transition: color .15s; }
.nav a:hover { color: var(--text); }
.nav a[aria-current="true"] { color: var(--text); }
.nav a[aria-current="true"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px; background: var(--accent); border-radius: 2px; }
@media (max-width: 760px) {
  .topbar-in { flex-wrap: wrap; height: auto; padding: 10px 0 0; row-gap: 4px; }
  .nav { order: 3; width: calc(100% + 32px); margin: 0 -16px; padding: 0 8px; overflow-x: auto; scrollbar-width: none; }
  .topbar .btn { margin-left: auto; }
}

/* ---------- Hero ---------- */
.hero { position: relative; padding: var(--s7) 0 var(--s5); background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 24px 24px; background-position: -1px -1px; border-bottom: 1px solid var(--line); }
.hero::after { content: ""; position: absolute; inset: auto 0 0; height: 120px; background: linear-gradient(transparent, var(--bg)); pointer-events: none; }
.hero-in { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .85fr); gap: var(--s6); align-items: end; }
@media (max-width: 960px) { .hero-in { grid-template-columns: 1fr; gap: var(--s5); } .hero { padding-top: var(--s6); } }
.kicker { color: var(--accent); text-transform: uppercase; letter-spacing: .08em; margin-bottom: var(--s3); }
.hero h1 { font-size: clamp(44px, 7.4vw, 92px); letter-spacing: -.04em; line-height: .98; max-width: 13ch; }
.hero-sub { font: italic 400 clamp(22px, 2.6vw, 30px)/1.3 var(--serif); color: var(--muted); max-width: 30ch; margin: var(--s3) 0 var(--s4); }

/* Title block: engineering-drawing signature */
.titleblock { background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: 2px; box-shadow: 6px 6px 0 var(--accent-soft); }
.tb-head, .tb-foot { display: flex; justify-content: space-between; gap: 12px; padding: 10px 16px; text-transform: uppercase; letter-spacing: .08em; }
.tb-head { border-bottom: 1.5px solid var(--line-strong); }
.tb-head span:last-child { font-weight: 500; color: var(--text); }
.tb-foot { border-top: 1.5px solid var(--line-strong); color: var(--muted); }
.titleblock dl { margin: 0; }
.titleblock dl > div { display: grid; grid-template-columns: 112px 1fr; border-bottom: 1px solid var(--line); }
.titleblock dl > div:last-child { border-bottom: 0; }
.titleblock dt { padding: 12px 16px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; border-right: 1px solid var(--line); }
.titleblock dd { margin: 0; padding: 11px 16px; font-weight: 500; line-height: 1.4; }
@media (max-width: 420px) { .titleblock dl > div { grid-template-columns: 92px 1fr; } .titleblock dt, .titleblock dd { padding-inline: 12px; } }
@media (max-width: 330px) { .titleblock dl > div { grid-template-columns: 1fr; } .titleblock dt { border-right: 0; padding-bottom: 0; } }

/* Proof strip */
.proof { position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); margin-top: var(--s6); padding-top: var(--s3); border-top: 1px solid var(--line); }
.proof-label { color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.proof ul { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.proof li { font-weight: 600; font-size: 16px; letter-spacing: -.01em; }

/* ---------- Sections ---------- */
.section { padding: var(--s8) 0; }
.section-tint { background: var(--tint); border-block: 1px solid var(--line); }
@media (max-width: 640px) { .section { padding: var(--s6) 0; } }
.sec-head { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: var(--s2); margin-bottom: var(--s5); padding-bottom: var(--s2); border-bottom: 1.5px solid var(--line-strong); }
.sec-num { color: var(--accent); font-size: 14px; }
.sec-head h2 { font-size: clamp(30px, 4.2vw, 48px); }
.sec-aside { color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

/* ---------- Case studies (home) ---------- */
.cases { display: grid; gap: var(--s7); }
.case { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: var(--s6); align-items: center; }
.case:nth-child(even) .case-fig { order: 2; }
@media (max-width: 900px) { .case { grid-template-columns: 1fr; gap: var(--s3); } .case:nth-child(even) .case-fig { order: 0; } .cases { gap: var(--s6); } }
.case-fig { display: block; text-decoration: none; }
.plate { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); transition: transform .35s var(--ease), box-shadow .35s var(--ease); }
.plate picture, .plate img { width: 100%; }
.plate img { aspect-ratio: 4 / 3; object-fit: cover; background: #fff; }
.case:hover .plate { transform: translateY(-4px); }
.plate figcaption { display: flex; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); color: var(--muted); line-height: 1.45; }
.plate figcaption span { color: var(--accent); white-space: nowrap; }
.plate video { display: block; width: 100%; height: auto; max-height: 80vh; background: #000; }
.plate-empty .ph-media { aspect-ratio: 4 / 3; }
.ph-media { display: grid; place-items: center; padding: 24px; text-align: center; color: var(--muted); font: 12px var(--mono); background: repeating-linear-gradient(135deg, transparent 0 10px, var(--grid) 10px 20px); }
.case-text { display: flex; flex-direction: column; gap: var(--s2); }
.case-idx { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.case-idx span:last-child { color: var(--accent); text-align: right; }
.case h3 { font-size: clamp(28px, 3.2vw, 38px); }
.case h3 a { text-decoration: none; background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 2px no-repeat; transition: background-size .3s var(--ease); }
.case h3 a:hover { background-size: 100% 2px; }
.case-sum { color: var(--muted); max-width: 52ch; }
.metric { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: var(--s2); align-items: center; padding: var(--s2) 0; }
.metric-value { grid-row: span 2; font: 700 clamp(44px, 5vw, 64px)/1 var(--sans); letter-spacing: -.04em; color: var(--accent); font-variant-numeric: tabular-nums; }
.metric-label { font-weight: 500; line-height: 1.3; max-width: 24ch; }
.tag { justify-self: start; font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; padding: 3px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { font: 12px var(--mono); padding: 5px 10px; border-radius: 4px; background: var(--tint); border: 1px solid var(--line); }

/* ---------- Index: folder tabs + log rows ---------- */
.tabs { display: flex; gap: 2px; padding: 6px 0 0 var(--s2); margin-bottom: -1.5px; overflow-x: auto; scrollbar-width: none; position: relative; z-index: 1; }
.tabs [role="tab"] { flex: none; display: inline-flex; align-items: center; gap: 10px; font: 600 13px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: var(--bg); border: 1.5px solid var(--line); border-bottom-color: var(--line-strong); border-radius: 10px 10px 0 0; padding: 12px 22px 11px; cursor: pointer; transition: color .15s, transform .2s var(--ease), background .15s; }
.tabs [role="tab"]:hover { color: var(--text); transform: translateY(-3px); }
.tabs [role="tab"][aria-selected="true"] { background: var(--surface); color: var(--text); border-color: var(--line-strong); border-bottom-color: var(--surface); transform: none; }
.count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--tint); font-size: 11px; color: var(--text); }
[aria-selected="true"] .count { background: var(--accent); color: var(--accent-ink); }
.panel { background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: 0 var(--r) var(--r) var(--r); padding: var(--s1) var(--s3); box-shadow: var(--shadow); }
.js .panel[hidden] { display: none; }
.panel-title { display: none; }
html:not(.js) .panel { margin-bottom: var(--s3); border-radius: var(--r); }
html:not(.js) .panel-title { display: block; font-size: 20px; padding: 16px 0 8px; }
html:not(.js) .tabs { display: none; }
@media (max-width: 640px) {
  .panel { padding: 4px var(--s2); }
  .tabs { padding-left: 6px; }
  .tabs [role="tab"] { padding: 10px 9px 9px; gap: 6px; font-size: 11px; letter-spacing: .03em; border-radius: 8px 8px 0 0; }
  .count { display: none; }
}
.rows li + li { border-top: 1px solid var(--line); }
.row { width: 100%; display: grid; grid-template-columns: 120px minmax(0, 1fr) auto 28px; gap: var(--s3); align-items: baseline; padding: 18px 4px; text-align: left; font: inherit; color: inherit; background: none; border: 0; text-decoration: none; cursor: pointer; transition: background .15s, padding .2s var(--ease); border-radius: 4px; }
.row:hover { background: var(--tint); padding-left: 12px; }
.row-date { color: var(--muted); }
.row-main { display: flex; flex-wrap: wrap; column-gap: 12px; align-items: baseline; }
.row-title { font-weight: 600; font-size: 17px; }
.row-org { color: var(--muted); font-size: 15px; }
.row-status { color: var(--accent); text-transform: uppercase; letter-spacing: .06em; font-size: 11px; }
.row-go { color: var(--muted); font-family: var(--mono); text-align: right; transition: transform .2s var(--ease), color .15s; }
.row:hover .row-go { color: var(--accent); transform: translateX(3px); }
@media (max-width: 640px) { .row { grid-template-columns: 1fr auto; gap: 4px 12px; } .row-date { grid-column: 1; grid-row: 1; } .row-status { grid-column: 2; grid-row: 1; text-align: right; } .row-main { grid-column: 1 / -1; } .row-go { display: none; } }

/* ---------- Writing ---------- */
.posts { border-top: 1px solid var(--line); }
.posts li { border-bottom: 1px solid var(--line); }
.posts a { display: grid; grid-template-columns: 140px minmax(0, 1fr) auto; gap: var(--s3); align-items: baseline; padding: var(--s3) 4px; text-decoration: none; }
.post-title { font: 400 clamp(24px, 2.6vw, 32px)/1.15 var(--serif); letter-spacing: -.01em; transition: color .15s; }
.posts a:hover .post-title { color: var(--accent); }
.post-sub { display: block; color: var(--muted); font-size: 15px; margin-top: 6px; max-width: 60ch; }
.post-pub { color: var(--muted); white-space: nowrap; }
.post-date { color: var(--muted); }
@media (max-width: 720px) { .posts a { grid-template-columns: 1fr; gap: 6px; } .post-pub { order: -1; } }
.pubs { display: flex; flex-wrap: wrap; gap: 12px; margin-top: var(--s4); }

/* ---------- Off the clock ---------- */
.off { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); }
@media (max-width: 820px) { .off { grid-template-columns: 1fr; } }
.note { display: flex; flex-direction: column; gap: var(--s2); min-height: 200px; padding: var(--s3); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); background-image: linear-gradient(transparent 31px, var(--grid) 32px); background-size: 100% 32px; background-position: 0 12px; }
.note-label { color: var(--accent); text-transform: uppercase; letter-spacing: .08em; }
.note .arrow-link { margin-top: auto; }

/* ---------- Contact + sphere ---------- */
.contact-in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s6); align-items: center; }
@media (max-width: 900px) { .contact-in { grid-template-columns: 1fr; } }
.contact-copy { display: flex; flex-direction: column; gap: var(--s3); }
.contact-copy .sec-head { margin-bottom: 0; }
.sphere { width: 100%; max-width: 460px; margin: 0 auto; display: none; overflow: visible; touch-action: none; }
.js .sphere { display: block; }
.shelves { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.shelves a { display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; background: var(--surface); font-weight: 600; }
.shelves a.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.js .shelves { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; margin-top: var(--s2); }
.js .shelves a { padding: 4px 0; border: 0; border-radius: 0; background: none; color: var(--muted); font: 12.5px var(--mono); border-bottom: 1px solid transparent; }
.js .shelves a:hover, .js .shelves a:focus-visible { color: var(--text); border-bottom-color: var(--accent); }
.js .shelves a.primary { color: var(--accent); background: none; }
@media (max-width: 560px) {
  .js .sphere { display: none; }
  .js .shelves { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .js .shelves a { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--text); font: 600 15px var(--sans); }
  .js .shelves a.primary { background: var(--accent); color: var(--accent-ink); }
}
.sphere .ring { fill: none; stroke: var(--line); stroke-dasharray: 2 6; }
.sphere .spoke { stroke: var(--line); stroke-width: 1.5; }
.sphere .hub circle { fill: var(--text); }
.sphere .hub text { fill: var(--bg); font: 700 13px var(--mono); text-anchor: middle; dominant-baseline: central; }
.sphere .node { cursor: pointer; outline: none; }
.sphere .node circle { fill: var(--surface); stroke: var(--line-strong); stroke-width: 1.5; transition: fill .2s, stroke .2s; }
.sphere .node text { fill: var(--text); font: 500 11px var(--mono); text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.sphere .node.primary circle { fill: var(--accent); stroke: var(--accent); }
.sphere .node.primary text { fill: var(--accent-ink); font-weight: 700; }
.sphere .node.missing circle { stroke: var(--accent); stroke-dasharray: 3 4; }
.sphere .node:hover circle, .sphere .node:focus-visible circle { stroke: var(--accent); stroke-width: 3; }

/* ---------- Footer ---------- */
.footer { border-top: 1.5px solid var(--line-strong); }
.footer-in { display: grid; grid-template-columns: 1fr auto; gap: var(--s3); padding-block: var(--s5); }
.footer-name { font-weight: 700; }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: start; }
.footer-links a { text-decoration: none; border-bottom: 1px solid var(--line); }
.footer-links a:hover { border-color: var(--accent); }
.footer-rev { grid-column: 1 / -1; }
@media (max-width: 640px) { .footer-in { grid-template-columns: 1fr; } }

/* ---------- Placeholders (removed as content arrives) ---------- */
.ph { border: 1.5px dashed var(--accent); background: var(--accent-soft); color: var(--text); border-radius: 4px; padding: 8px 12px; font: 500 12.5px/1.45 var(--mono); }

/* ---------- Detail dialog ---------- */
.detail { width: min(760px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); padding: 0; border: 1.5px solid var(--line-strong); border-radius: var(--r); background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.detail[open] { animation: rise .3s var(--ease); }
.detail::backdrop { background: rgba(20, 18, 15, .5); backdrop-filter: blur(3px); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.detail-in { position: relative; padding: var(--s5) var(--s5) var(--s4); display: flex; flex-direction: column; gap: var(--s2); }
@media (max-width: 640px) { .detail-in { padding: var(--s4) var(--s2) var(--s3); } }
.close { position: absolute; top: 14px; right: 14px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg); color: var(--text); font-size: 22px; cursor: pointer; }
.detail h2 { font-size: clamp(26px, 4vw, 36px); padding-right: 48px; }
.result { border-left: 3px solid var(--accent); padding: 12px 16px; background: var(--tint); }
.result .mono { display: block; color: var(--accent); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px; }
.gallery { display: grid; gap: var(--s3); }

/* ---------- Case study page ---------- */
.cs { padding: var(--s4) 0 var(--s7); }
.back { display: inline-block; text-decoration: none; color: var(--muted); margin-bottom: var(--s5); }
.back:hover { color: var(--accent); }
.cs-head { display: grid; gap: var(--s2); max-width: 880px; margin-bottom: var(--s5); }
.cs-head h1 { font-size: clamp(40px, 6.4vw, 76px); letter-spacing: -.04em; }
.cs-meta { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4); margin: var(--s1) 0 0; padding: var(--s2) 0; border-block: 1px solid var(--line); }
.cs-meta div { display: flex; gap: 8px; }
.cs-meta dt { color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.cs-meta dd { margin: 0; }
.cs-hero-fig { margin-bottom: var(--s6); }
.cs-hero-fig img { aspect-ratio: auto; object-fit: contain; }
.cs-grid { border-top: 1.5px solid var(--line-strong); }
.cs-row { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--s4); padding: var(--s4) 0; border-bottom: 1px solid var(--line); }
.cs-label { font: 500 12.5px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--accent); padding-top: 6px; }
.cs-body { font-size: 19px; line-height: 1.6; max-width: 66ch; }
.cs-body .gallery img { aspect-ratio: auto; object-fit: contain; }
@media (max-width: 760px) { .cs-row { grid-template-columns: 1fr; gap: var(--s1); } .cs-body { font-size: 17px; } }
.cs-next { display: flex; flex-direction: column; gap: 8px; margin-top: var(--s6); padding: var(--s4); background: var(--tint); border: 1px solid var(--line); border-radius: var(--r); }
.cs-next a { display: flex; flex-direction: column; gap: 4px; text-decoration: none; }
.cs-next a .mono { color: var(--accent); }
.cs-next-title { font-size: clamp(24px, 3vw, 32px); font-weight: 700; letter-spacing: -.02em; }
.cs-next a:hover .cs-next-title { color: var(--accent); }
.cs-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3); margin-top: var(--s5); }
.notfound { padding: var(--s8) var(--s4); }
.notfound h1 { font-size: clamp(36px, 6vw, 64px); margin-bottom: var(--s3); }

/* ---------- Reveal on scroll (progressive) ---------- */
.js .reveal { opacity: 0; transform: translateY(16px); 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 { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}
@media print {
  .topbar, .sphere-box, .tabs, .pubs { display: none !important; }
  .js .panel[hidden] { display: block; }
  body { background: #fff; }
}
