:root {
  color-scheme: dark;
  --night: #0b1226;
  --ground: #0f1a34;
  --panel: #131f3d;
  --line: #263659;
  --line-strong: #3a4d78;
  --paper: #e9eefb;
  --dim: #a3b2d3;
  --amber: #ffb547;
  --amber-hover: #ffc970;
  --on-amber: #1d1300;
  --sans: "Golos Text", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --hand: "Caveat", "Segoe Print", cursive;
  --gutter: 96px;
  /* Names used by the private panel stylesheet. */
  --bg: var(--night);
  --surface: var(--panel);
  --raised: #1b2950;
  --control-line: var(--line-strong);
  --fg: var(--paper);
  --accent: var(--amber);
  --accent-hover: var(--amber-hover);
}
@font-face { font-family: "Golos Text"; src: url("/assets/golos-cyrillic.woff2") format("woff2"); font-weight: 400 900; font-display: swap; unicode-range: U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: "Golos Text"; src: url("/assets/golos-latin.woff2") format("woff2"); font-weight: 400 900; font-display: swap; unicode-range: U+0000-03FF,U+2000-206F,U+20A0-20CF,U+2190-21FF,U+2212; }
@font-face { font-family: "JetBrains Mono"; src: url("/assets/jetbrains-mono-cyrillic.woff2") format("woff2"); font-weight: 100 800; font-display: swap; unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: "JetBrains Mono"; src: url("/assets/jetbrains-mono-latin.woff2") format("woff2"); font-weight: 100 800; font-display: swap; unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Caveat"; src: url("/assets/caveat-cyrillic.woff2") format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: "Caveat"; src: url("/assets/caveat-latin.woff2") format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

/* Project colors and map positions (no inline styles: the site CSP blocks them). */
.c-nightscout { --c: #ffb547; --x: .60; --y: .30; --mx: .30; --my: .20; }
.c-debugych { --c: #ff8a7a; --x: .86; --y: .36; --mx: .76; --my: .32; }
.c-meeting { --c: #b9a3ff; --x: .74; --y: .72; --mx: .26; --my: .60; }
.c-quizroom { --c: #6fd6c8; --x: .90; --y: .84; --mx: .74; --my: .74; }
.c-mail { --c: #ffd9a0; --x: .48; --y: .84; --mx: .50; --my: .92; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--night); color: var(--paper); font: 16px/1.6 var(--sans); }
a { color: inherit; }
h1, h2, h3, p, figure, ul { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
[id] { scroll-margin-top: 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.defs { position: absolute; }
.skip-link { position: fixed; z-index: 20; top: 8px; left: 8px; padding: 8px 12px; background: var(--amber); color: var(--on-amber); transform: translateY(-160%); }
.skip-link:focus { transform: none; }
.shell { width: min(1120px, calc(100% - 2 * var(--gutter))); margin-inline: auto; }

/* Controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--night); color: var(--paper); font: 600 15px/1.2 var(--sans); text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--paper); background: var(--panel); }
.btn-small { min-height: 38px; padding: 7px 14px; font-size: 14px; }
.btn-amber { border-color: var(--amber); background: var(--amber); color: var(--on-amber); }
.btn-amber:hover { border-color: var(--amber-hover); background: var(--amber-hover); }
.text-link { color: var(--paper); font-weight: 550; text-decoration: underline; text-decoration-color: var(--amber); text-decoration-thickness: 1px; text-underline-offset: .24em; }
.text-link:hover { color: var(--amber); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; list-style: none; }
.tags li { padding: 2px 8px; border: 1px solid var(--line); border-radius: 3px; color: var(--dim); font: 12px/1.6 var(--mono); }

/* Header */
.top { position: relative; z-index: 3; border-bottom: 1px solid var(--line); background: var(--night); }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 750; letter-spacing: .09em; text-decoration: none; }
.mark { width: 15px; height: 15px; border: 1px solid var(--amber); border-radius: 50%; background: radial-gradient(circle, var(--amber) 2px, transparent 3px); }
.top nav { display: flex; flex-wrap: wrap; gap: clamp(14px, 2.6vw, 32px); color: var(--dim); font-size: 14px; }
.top nav a { text-decoration: none; }
.top nav a:hover { color: var(--paper); text-decoration: underline; text-underline-offset: 4px; }

/* Odometer */
.odo { position: fixed; z-index: 4; inset: 0 auto 0 0; width: 64px; border-right: 1px solid var(--line); background: var(--night); pointer-events: none; }
.odo-ticks { position: absolute; inset: 0; background:
  repeating-linear-gradient(to bottom, var(--line-strong) 0 1px, transparent 1px 60px) right / 24px 100% no-repeat,
  repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px 12px) right / 10px 100% no-repeat;
  background-position-y: var(--odo-shift, 0px); }
.odo-read { position: absolute; top: 50%; left: 6px; display: grid; transform: translateY(-50%); padding: 4px 0; background: var(--night); color: var(--amber); font: 500 11px/1.25 var(--mono); }
.odo-read::after { content: ""; position: absolute; top: 50%; left: calc(100% + 2px); width: 14px; border-top: 1px solid var(--amber); }
.odo-unit { color: var(--dim); }

/* Hero and scene */
.hero { position: relative; }
.hero-text { position: absolute; z-index: 2; inset: clamp(32px, 6vh, 64px) 0 auto; pointer-events: none; }
.hero-text > * { pointer-events: auto; max-width: 30rem; }
.hero h1 { font-size: clamp(54px, 7vw, 100px); font-weight: 720; line-height: .95; letter-spacing: -.045em; max-width: 7ch; }
.lead { margin-top: 22px; color: var(--paper); font-size: clamp(19px, 2vw, 26px); line-height: 1.3; letter-spacing: -.02em; }
.note { margin-top: 10px; color: var(--dim); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin-top: 26px; }
.scene { position: relative; height: clamp(600px, 88svh, 820px); overflow: hidden; background:
  radial-gradient(circle at 62% 52%, rgba(255, 181, 71, .10), transparent 32%),
  linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 120px 120px,
  linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 120px 120px,
  var(--ground); }
.scene-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: none; touch-action: pan-y; cursor: crosshair; }
.scene.is-live { background: var(--ground); }
.scene.is-live .scene-canvas { display: block; }
.scene.is-active { box-shadow: inset 0 0 0 2px rgba(255, 181, 71, .55); }
.pins { position: absolute; inset: 0; margin: 0; padding: 0; list-style: none; pointer-events: none; }
.pin { position: absolute; left: calc(var(--x) * 100%); top: calc(var(--y) * 100%); display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; color: var(--c); text-decoration: none; transform: translate(-50%, -50%); pointer-events: auto; }
.pin-ring { width: 34px; height: 34px; border: 1.5px solid var(--c); border-radius: 50%; background: radial-gradient(circle, var(--c) 3px, transparent 4px); box-shadow: 0 0 0 7px color-mix(in srgb, var(--c) 16%, transparent), 0 0 34px color-mix(in srgb, var(--c) 40%, transparent); }
.pin-label { position: absolute; top: calc(100% - 2px); padding: 1px 6px; border-radius: 3px; background: var(--night); font: 500 12px/1.4 var(--mono); white-space: nowrap; }
.pin:hover .pin-label { text-decoration: underline; }
.scene.is-live .pin-ring, .scene.is-live .pin-label { opacity: 0; }
.scene.is-live .pin:focus-visible { outline-offset: -6px; }
.scene-card { position: absolute; z-index: 2; width: min(280px, calc(100% - 32px)); padding: 14px 16px; border: 1px solid var(--c, var(--amber)); border-radius: 8px; background: rgba(11, 18, 38, .94); box-shadow: 0 0 40px color-mix(in srgb, var(--c, var(--amber)) 18%, transparent); }
.card-title { display: flex; align-items: center; gap: 8px; font-size: 17px; }
.card-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--amber)); }
.card-desc { margin: 6px 0 10px; color: var(--dim); font-size: 14px; line-height: 1.45; }
.card-link { font-size: 14px; }
/* Over a live map the card lets taps through to the map; only its link takes them. */
.scene.is-live .scene-card { pointer-events: none; }
.scene.is-live .scene-card a { pointer-events: auto; }
.scene-hint { position: absolute; z-index: 2; left: max(var(--gutter), calc((100% - 1120px) / 2)); bottom: 22px; display: none; align-items: center; gap: 14px; max-width: calc(100% - 36px); padding: 8px 14px 8px 8px; border: 1px solid var(--line); border-radius: 8px; background: rgba(11, 18, 38, .9); color: var(--dim); font: 12px/1.45 var(--mono); }
.scene.is-live .scene-hint { display: flex; }
/* 3D map game: "Найдено N из 5" next to the hint, and a soft arrow towards an unfound project. */
.scene-count { margin: 0; padding-left: 14px; border-left: 1px solid var(--line); color: var(--amber); white-space: nowrap; }
.scene-count a { color: inherit; }
.scene-arrow { position: absolute; z-index: 2; left: 0; top: 0; width: 0; height: 0; border-style: solid; border-width: 9px 0 9px 16px; border-color: transparent transparent transparent rgba(233, 238, 251, .8); transform-origin: 8px 9px; pointer-events: none; opacity: 0; transition: opacity .6s; filter: drop-shadow(0 0 6px rgba(255, 181, 71, .55)); }
.scene-arrow.is-on { opacity: 1; animation: arrow-nudge 1.4s ease-in-out infinite; }
@keyframes arrow-nudge { 50% { opacity: .45; } }

/* Dividers and sections */
.hatch { height: 26px; border-block: 1px solid var(--line); background: repeating-linear-gradient(135deg, var(--line) 0 1px, transparent 1px 9px); }
.section { padding-block: clamp(56px, 8vw, 104px); }
.section h2 { font-size: clamp(34px, 4.6vw, 60px); font-weight: 700; line-height: 1.02; letter-spacing: -.04em; }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 24px; margin-bottom: 18px; }
.project { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 64px); align-items: center; padding-block: 36px; border-top: 1px solid var(--line); }
/* Wide screens: the lead case gets a bigger screenshot, the rest alternate sides. */
@media (min-width: 861px) {
  .project.is-lead { grid-template-columns: minmax(0, .78fr) minmax(0, 1.22fr); }
  .project.is-flip .project-art { order: -1; }
}
.project h3 { font-size: clamp(26px, 3vw, 38px); font-weight: 680; line-height: 1.1; letter-spacing: -.04em; }
.project-kind { margin-top: 4px; color: var(--c); font: 500 12px/1.6 var(--mono); }
.project-text > p:not(.project-kind) { max-width: 52ch; margin-top: 14px; color: var(--dim); }
.project-text .tags { margin: 14px 0 16px; }
.project-art { padding: 10px; border: 1px dashed var(--line-strong); border-radius: 10px; background:
  linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 24px 24px,
  linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 24px 24px; background-color: rgba(15, 26, 52, .6); }
.project-art svg { display: block; width: 100%; height: auto; }
/* Real screenshots in a small app-window frame on the blueprint grid; the bar takes the project colour. */
.shot { padding: 14px; }
.shot-frame { overflow: hidden; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--night);
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .7); }
.shot-frame::before { content: ""; display: block; height: 22px; border-bottom: 1px solid var(--line);
  background: radial-gradient(circle, var(--c, var(--amber)) 3.5px, transparent 4px) 8px 50% / 14px 14px no-repeat,
    radial-gradient(circle, var(--line-strong) 3.5px, transparent 4px) 24px 50% / 14px 14px no-repeat,
    radial-gradient(circle, var(--line-strong) 3.5px, transparent 4px) 40px 50% / 14px 14px no-repeat, var(--panel); }
.shot-frame img, .shot-frame video { display: block; width: 100%; height: auto; }
.shot-frame video { aspect-ratio: 16 / 9; }
.project-links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
/* About */
.about { display: grid; grid-template-columns: minmax(0, .72fr) minmax(0, 1.35fr); gap: 25px; align-items: start; }
.about-text p { max-width: 62ch; color: var(--dim); }
.about-text p + p { margin-top: 12px; }
.about-text strong { color: var(--paper); font-weight: 600; }
.about-list { display: grid; gap: 0; margin: 22px 0 0; padding: 0; list-style: none; }
.about-list li { display: grid; grid-template-columns: minmax(0, 11em) minmax(0, 1fr); gap: 4px 18px; padding-block: 12px; border-top: 1px dashed var(--line); }
.about-list b { color: var(--c); font: 500 13px/1.6 var(--mono); }
.about-list span { color: var(--dim); }
@media (max-width: 860px) { .about { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .about-list li { grid-template-columns: minmax(0, 1fr); } }
.shot figcaption { margin-top: 10px; color: var(--dim); font: 12px/1.4 var(--mono); }
a.shot-frame { display: block; cursor: zoom-in; transition: border-color .2s, transform .2s; }
a.shot-frame:hover { border-color: var(--c, var(--amber)); transform: translateY(-2px); }

/* Full-size screenshot viewer (site.js). */
.has-viewer { overflow: hidden; }
.viewer { width: 100vw; max-width: none; height: 100vh; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0;
  background: #05080f; color: var(--paper); overflow: hidden; }
.viewer::backdrop { background: transparent; }
.viewer[open] { display: flex; flex-direction: column; }
.viewer-stage { flex: 1; min-height: 0; display: flex; overflow: auto; padding: 56px 16px 8px; cursor: zoom-out; overscroll-behavior: contain; }
.viewer-stage img { margin: auto; max-width: 100%; max-height: 100%; border: 1px solid var(--line-strong); border-radius: 6px; cursor: zoom-in;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .8); }
.viewer.is-zoomed .viewer-stage img { max-width: none; max-height: none; cursor: zoom-out; }
.viewer-caption { padding: 8px 16px 16px; text-align: center; color: var(--dim); font: 12px/1.4 var(--mono); }
.viewer-hint { display: none; margin-top: -10px; padding: 0 16px 16px; text-align: center; color: var(--amber); font: 12px/1.4 var(--mono); }
.viewer.is-shrunk:not(.is-zoomed) .viewer-hint { display: block; }
.viewer-close { position: absolute; top: 10px; right: 12px; width: 40px; height: 40px; border: 1px solid var(--line-strong); border-radius: 50%;
  background: var(--panel); color: var(--paper); font: 24px/1 var(--sans); cursor: pointer; }
.viewer-close:hover { border-color: var(--amber); }
@media (prefers-reduced-motion: reduce) { a.shot-frame { transition: none; } a.shot-frame:hover { transform: none; } }
.ill { fill: none; stroke: var(--paper); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ill .ill-fill { fill: var(--night); }
.ill .accent-fill { fill: var(--c, var(--amber)); stroke: none; }
.ill .accent-stroke { stroke: var(--c, var(--amber)); }
.ill .stars circle { fill: var(--paper); stroke: none; }
.ill .ill-text { fill: var(--dim); stroke: none; font: 12px var(--mono); }
.spin { transform-box: fill-box; transform-origin: center; }
.project:hover .spin { animation: spin 2.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.more { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 18px; }
.more summary { width: fit-content; cursor: pointer; font-weight: 550; }
.more ul { margin-top: 10px; padding: 0; list-style: none; }
.more li { display: flex; flex-wrap: wrap; gap: 4px 14px; padding-block: 5px; color: var(--dim); font-size: 15px; }
.principles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(18px, 3vw, 40px); margin-top: 30px; }
.principles article { padding-top: 18px; border-top: 2px solid var(--line-strong); }
.principles h3 { font-size: clamp(20px, 2vw, 25px); line-height: 1.2; letter-spacing: -.02em; }
.principles p { margin: 10px 0 14px; color: var(--dim); }
.stack { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 26px; }
.stack > div { padding-top: 12px; border-top: 1px solid var(--line); }
.stack h3 { margin-bottom: 12px; font-size: 17px; font-weight: 600; }

/* Private panel and login */
.eyebrow { display: flex; align-items: center; gap: 7px; color: var(--amber); font: 500 12px/1.5 var(--mono); }
.signal { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 10px var(--amber); }
input, select { min-width: 0; min-height: 42px; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--night); color: var(--paper); font: inherit; }
input:focus-visible, select:focus-visible { outline-offset: 1px; }
.login-card { max-width: 510px; margin: clamp(48px, 12vw, 130px) auto; padding: clamp(22px, 5vw, 48px); border: 1px dashed var(--line-strong); border-radius: 10px; background:
  linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 24px 24px,
  linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 24px 24px, var(--panel); }
.login-card h1 { margin: 8px 0 15px; font-size: clamp(36px, 7vw, 60px); line-height: 1.05; letter-spacing: -.05em; }
.login-card p { color: var(--dim); }
.login-card p + a { margin-top: 20px; }
.login-card form, .login-card label { display: grid; gap: 8px; }
.login-card form { margin-top: 20px; gap: 14px; }
.login-card .login-error { margin-top: 12px; color: #ffb5a7; }
.top form { margin: 0; }

/* Case page */
.case-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: end; padding-block: clamp(40px, 6vw, 84px); }
.case-intro h1 { margin-top: 22px; font-size: clamp(52px, 7vw, 96px); font-weight: 720; line-height: .95; letter-spacing: -.045em; }
.case-intro .lead { margin-top: 18px; }
.case-summary { max-width: 46ch; margin-top: 12px; color: var(--dim); }
.case-intro .tags { margin-block: 16px 24px; }
.case-frame .frame-box { position: relative; padding: 12px; border: 1px dashed var(--line-strong); border-radius: 10px; background:
  linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 24px 24px,
  linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 24px 24px; }
.case-frame .frame-box::before, .case-frame .frame-box::after { content: ""; position: absolute; width: 18px; height: 18px; border: 2px solid var(--amber); }
.case-frame .frame-box::before { top: -2px; left: -2px; border-right: 0; border-bottom: 0; }
.case-frame .frame-box::after { right: -2px; bottom: -2px; border-left: 0; border-top: 0; }
.case-frame img { display: block; width: 100%; height: auto; aspect-ratio: 1.45; object-fit: cover; border-radius: 4px; }
.case-frame figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; margin-top: 10px; color: var(--dim); font: 12px/1.5 var(--mono); }
.case-frame figcaption span:first-child { color: var(--paper); }
.split { display: grid; grid-template-columns: minmax(0, .72fr) minmax(0, 1.35fr); gap: 25px; align-items: start; }
.case-text { display: grid; gap: 14px; max-width: 62ch; }
.case-text p, .case-list { color: var(--dim); font-size: clamp(16px, 1.8vw, 19px); }
.case-list { display: grid; gap: 10px; max-width: 62ch; margin: 0; padding-left: 1.1em; }
.case-list li::marker { color: var(--amber); }
.section-lead { max-width: 62ch; margin-top: 14px; color: var(--dim); font-size: clamp(16px, 1.8vw, 19px); }
.route { position: relative; margin: 34px 0 0; padding: 0 0 0 64px; list-style: none; counter-reset: stop; }
.route::before { content: ""; position: absolute; top: 18px; bottom: 18px; left: 19px; border-left: 2px dashed var(--line-strong); }
.route li { position: relative; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 20px 32px; align-items: start; padding-block: 0 34px; counter-increment: stop; }
.route li:last-child { padding-bottom: 0; }
.route li::before { content: counter(stop); position: absolute; top: 0; left: -64px; display: grid; place-items: center; width: 40px; height: 40px; border: 2px solid var(--amber); border-radius: 50%; background: var(--night); color: var(--amber); font: 500 16px var(--mono); }
.route h3 { font-size: clamp(20px, 2.6vw, 30px); line-height: 1.15; letter-spacing: -.03em; }
.route-copy p { max-width: 56ch; margin-top: 8px; color: var(--dim); }
.route-shot { grid-column: 1 / -1; max-width: 820px; }
.route-shot figcaption { margin-top: 8px; color: var(--dim); font: 12px/1.4 var(--mono); }
.route-shot.is-narrow { max-width: 600px; }
.route-copy code { color: var(--paper); font: .92em var(--mono); font-variant-ligatures: none; }
.case-frame .frame-box.is-shot img { aspect-ratio: auto; object-fit: contain; }
.case-frame video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 4px; background: var(--night); }
.case-links { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 14px 0 0; padding: 0; list-style: none; }
.readout { min-width: 0; margin: 0; padding: 8px 16px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); font-size: 14px; }
.readout div { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; padding-block: 7px; }
.readout div + div { border-top: 1px dashed var(--line); }
.readout dt { color: var(--dim); font: 12px/1.5 var(--mono); }
.readout dd { margin: 0; font-weight: 600; }
.gauges { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 28px 0 0; }
.gauges div { padding: 16px 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.gauges dt { color: var(--dim); font-size: 14px; }
.gauges dd { margin: 6px 0 0; color: var(--amber); font: 500 clamp(26px, 3vw, 36px)/1.1 var(--mono); letter-spacing: -.02em; }
.case-note { margin-top: 14px; color: var(--dim); font-size: 14px; }
.scribble-code { margin-top: 18px; }

/* Contact */
.contact-inner { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: clamp(24px, 5vw, 64px); align-items: center; }
.contact-lead { max-width: 46ch; margin-top: 18px; color: var(--dim); font-size: clamp(17px, 1.8vw, 20px); }
mark { padding: 0 .2em; border-radius: 3px; background: var(--amber); color: var(--on-amber); box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.mail-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 18px; color: var(--dim); }
.mail-line a { color: var(--paper); font-weight: 600; text-decoration: none; }
.mail-line a:hover { text-decoration: underline; }
.copy { min-height: 32px; padding: 4px 10px; border: 1px solid var(--line-strong); border-radius: 5px; background: none; color: var(--dim); font: 13px var(--sans); cursor: pointer; }
.copy:hover { color: var(--paper); border-color: var(--paper); }
.copy-status { color: var(--amber); font: 12px var(--mono); }
.contact-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; padding: 0; list-style: none; }
.scribble { display: flex; align-items: flex-end; gap: 4px; margin: 6px 0 0 18px; color: var(--amber); font: 600 25px/1 var(--hand); transform: rotate(-3deg); transform-origin: left; }
.scribble svg { width: 46px; height: 32px; fill: none; stroke: var(--amber); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.contact-art svg, .end-art svg { display: block; width: 100%; height: auto; }

/* End */
.end { border-top: 1px solid var(--line); background: repeating-linear-gradient(135deg, rgba(38, 54, 89, .35) 0 1px, transparent 1px 9px); }
.end-inner { display: grid; grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr); gap: clamp(24px, 5vw, 64px); align-items: center; padding-block: clamp(48px, 7vw, 88px); }
.end-title { font-size: clamp(24px, 2.6vw, 32px); font-weight: 650; letter-spacing: -.02em; }
.end-text > p:not(.end-title) { margin-top: 8px; color: var(--dim); }
.end-links { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 18px; padding: 0; list-style: none; }
.end-bottom { display: flex; justify-content: space-between; gap: 12px; padding-block: 22px 28px; border-top: 1px solid var(--line); color: var(--dim); font-size: 14px; }
/* 404 page */
.lost { display: grid; align-items: center; min-height: calc(100vh - 72px); min-height: calc(100dvh - 72px); }
.lost-code { color: var(--amber); font: 600 clamp(56px, 9vw, 112px)/1 var(--mono); letter-spacing: -.04em; }
.lost .end-title { margin-top: 12px; }

@media (max-width: 1100px) {
  :root { --gutter: 40px; }
  .odo { display: none; }
}
@media (max-width: 860px) {
  .project, .contact-inner, .end-inner { grid-template-columns: minmax(0, 1fr); }
  .project-art { max-width: 460px; }
  .contact-art { max-width: 300px; }
  .end-art { max-width: 260px; }
  .principles, .stack { grid-template-columns: minmax(0, 1fr); }
  .case-hero, .split, .route li { grid-template-columns: minmax(0, 1fr); }
  .gauges { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 735px) {
  :root { --gutter: 18px; }
  .top-inner { flex-wrap: wrap; min-height: 0; gap: 8px 12px; padding-block: 11px; }
  .top nav { order: 3; width: 100%; justify-content: space-between; gap: 4px 10px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 13px; }
  .hero-text { position: static; padding-block: 34px 26px; }
  .hero h1 { font-size: clamp(48px, 15vw, 76px); }
  .scene { height: max(420px, 70svh); }
  .pin { left: calc(var(--mx) * 100%); top: calc(var(--my) * 100%); }
  .scene-hint { left: 12px; bottom: 12px; }
  /* The 3D map docks the project card along the bottom; the hint makes room for it. */
  .scene.is-live .scene-card { width: calc(100% - 24px); }
  .scene.has-card .scene-hint { display: none; }
  /* Narrow hint bar: the counter (and the finale line) gets a line of its own. */
  .scene-hint { flex-wrap: wrap; row-gap: 6px; }
  .scene-count { flex-basis: 100%; padding-left: 0; border-left: 0; }
  .section h2 { font-size: clamp(32px, 10vw, 44px); }
  .route { padding-left: 50px; }
  .route::before { left: 15px; }
  .route li::before { left: -50px; width: 32px; height: 32px; font-size: 14px; }
}
@media (max-width: 440px) {
  .gauges { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 370px) {
  /* Keep the four menu links on one line on the narrowest phones. */
  .top nav { gap: 4px 6px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .project:hover .spin { animation: none; }
}

/* 3D map (scene3d.js) */
.scene-webgl { position: absolute; inset: 0; display: none; width: 100%; height: 100%; touch-action: pan-y; cursor: crosshair; }
.scene.is-3d .scene-webgl { display: block; }
.scene-dark { position: absolute; inset: 0; display: none; width: 100%; height: 100%; pointer-events: none; }
.scene.is-3d .scene-dark { display: block; }
.scene.is-3d .scene-canvas { display: none; }
.scene.is-3d { background: #070c1c; }
