/* ayaangoswami.dev
   A pale page with dark windows cut into it. The windows hold the live things: a box of parts
   you can shove around in the hero, the figures, and views into Hallownest. Halfway down, one
   window opens all the way and the rest of the page is underground. */

/* ---------- Tokens ---------- */

:root, .menu, .light {
  --bg: #eff0f7;
  --bg-2: #e2e4ee;
  --surface: #ffffff;
  --surface-2: #ffffff;
  --fg: #0b0d16;
  --fg-2: #40455a;
  --fg-3: #6c7187;
  --line: rgba(11, 13, 22, 0.1);
  --line-2: rgba(11, 13, 22, 0.2);
  --accent: #2b46ff;
  --on-accent: #ffffff;
  --geo: #a6781a;
  --crystal: #bd3a96;
  --city: #2a63cc;
  --green: #2a8748;
  --infection: #e0661f;
  color-scheme: light;
}
.dark, .win, .site-foot, html.on-dark .site-head > .brand, html.on-dark .head-tag {
  --bg: #090b13;
  --bg-2: #171b29;
  --surface: #10131e;
  --surface-2: #151a29;
  --fg: #eef1f8;
  --fg-2: #b4bccc;
  --fg-3: #858fa4;
  --line: rgba(220, 232, 248, 0.12);
  --line-2: rgba(220, 232, 248, 0.24);
  --accent: #9ec5ff;
  --on-accent: #0b1220;
  --geo: #e8d49c;
  --crystal: #f29bd9;
  --city: #8ab8f0;
  --green: #93d28c;
  --infection: #ff9d4d;
  color-scheme: dark;
}
:root {
  --sans: 'Geist', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'EB Garamond', Georgia, serif;
  --hk: 'Cinzel', 'Trajan Pro', serif;
  --mono: ui-monospace, 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  --wrap: 1480px;
  --gutter: clamp(16px, 2.8vw, 40px);
  --radius: clamp(14px, 1.5vw, 22px);
  --head-h: 84px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
  --vivid: #2b46ff;
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg-2);
  font: 400 1.0625rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
@supports (overflow: clip) { body { overflow-x: clip; } }
img, svg, canvas, picture { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
p { margin: 0 0 1em; }
h1, h2, h3 { color: var(--fg); font-weight: 400; margin: 0; }
button { font: inherit; color: inherit; }
::selection { background: var(--vivid); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sep { opacity: 0.45; margin: 0 0.45em; }
.alias { position: absolute; top: 0; left: 0; }

.skip { position: fixed; left: 12px; top: -60px; z-index: 100; background: var(--fg); color: var(--bg); padding: 0.7em 1.1em; border-radius: 999px; text-decoration: none; font-weight: 500; }
.skip:focus { top: 12px; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.wrap.narrow { max-width: 860px; }

.label, .kicker {
  font: 500 0.74rem/1.4 var(--sans);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.label a, .kicker a { color: var(--fg-2); text-decoration: none; }
.label a:hover, .kicker a:hover { color: var(--fg); }

.lede { font-size: clamp(1.15rem, 1.45vw, 1.38rem); line-height: 1.45; letter-spacing: -0.012em; color: var(--fg); max-width: 46ch; }
.lede a { color: inherit; }

h1 em, h2 em, h3 em, .statement-sm em, .quote em {
  font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.02em;
}

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--fg)); flex: none; }
.dot-games { --c: var(--geo); }
.dot-robotics { --c: var(--crystal); }
.dot-ml { --c: var(--city); }
.dot-health { --c: var(--green); }

/* ---------- Pills, rolls, links, the round button ---------- */

.roll { position: relative; display: inline-block; overflow: hidden; height: 1.2em; line-height: 1.2; vertical-align: middle; }
.roll > span { display: block; transition: transform 0.55s var(--ease); }
.roll > span + span { position: absolute; left: 0; top: 100%; }
a:hover .roll > span, button:hover .roll > span, a:focus-visible .roll > span { transform: translateY(-100%); }

.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.7rem;
  height: 46px; padding: 0 1.35rem; border: 0; border-radius: 999px; cursor: pointer;
  font: 500 0.78rem/1 var(--sans); letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; text-decoration: none;
  transform: translate(var(--mx, 0), var(--my, 0));
  transition: background 0.3s, color 0.3s, box-shadow 0.3s, transform 0.5s var(--ease);
}
.pill svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; flex: none; }
.pill svg.fill { fill: currentColor; stroke: none; }
.pill-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; transition: transform 0.45s var(--ease); flex: none; }
.pill:hover .pill-dot { transform: scale(1.9); }
.pill-dark { background: var(--fg); color: var(--bg); }
.pill-light { background: var(--surface); color: var(--fg); }
.pill-soft { background: var(--bg-2); color: var(--fg); }
.pill-ghost { background: transparent; color: var(--fg); box-shadow: inset 0 0 0 1px var(--line-2); }
.pill-ghost:hover { box-shadow: inset 0 0 0 1px var(--fg); }
.pill-accent { background: var(--vivid); color: #fff; }
.pill[disabled] { opacity: 0.6; cursor: progress; }
.pill-row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: clamp(2rem, 4vw, 3.2rem) 0 0; }

.arrow-link {
  position: relative; z-index: 2;
  display: inline-flex; align-items: center; gap: 0.45em;
  color: var(--fg); text-decoration: none;
  font: 500 0.76rem/1.4 var(--sans); letter-spacing: 0.04em; text-transform: uppercase;
  padding-bottom: 4px; background: linear-gradient(currentColor, currentColor) left bottom / 100% 1px no-repeat;
  transition: background-size 0.5s var(--ease);
}
.arrow-link:hover { background-size: 0% 1px; background-position: right bottom; }
.arrow-link svg { width: 1.1em; height: 1.1em; fill: none; stroke: currentColor; stroke-width: 1.6; transition: transform 0.4s var(--ease); }
.arrow-link:hover svg { transform: translateX(3px); }
.link-row { display: flex; flex-wrap: wrap; gap: 0.9rem 1.8rem; margin-top: 1.8rem; }

/* The round button that says "this whole box opens". */
.card-btn {
  display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--line-2); color: var(--fg);
  transition: background 0.35s, color 0.35s, box-shadow 0.35s, transform 0.5s var(--ease);
}
.card-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; transition: transform 0.5s var(--ease); }
.card-btn-lg { width: 64px; height: 64px; }
.card-btn-lg svg { width: 22px; height: 22px; }

/* ---------- Header ---------- */

.site-head {
  position: fixed; inset: 0 0 auto; z-index: 50; height: var(--head-h);
  display: flex; align-items: center; gap: 1.5rem; padding: 0 var(--gutter);
  pointer-events: none; transition: transform 0.6s var(--ease);
}
.site-head > * { pointer-events: auto; }
.site-head.is-hidden { transform: translateY(-110%); }
/* The name sits in its own pill once the page has scrolled, so it stays readable over anything. */
.brand {
  display: inline-flex; align-items: center; gap: 0.65rem; flex: none; height: 46px; padding: 0 1.1rem 0 0.45rem; margin-left: -0.45rem;
  border-radius: 999px; color: var(--fg); text-decoration: none; background: transparent;
  font: 600 0.98rem/1 var(--sans); letter-spacing: 0.01em; text-transform: uppercase;
  transition: color 0.4s, background 0.4s, box-shadow 0.4s;
}
.site-head.is-scrolled .brand { background: var(--surface); box-shadow: 0 8px 30px rgba(11, 13, 22, 0.08); }
html.on-dark .site-head.is-scrolled .brand { box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3); }
.logo-mark { width: 32px; height: 32px; flex: none; }
.lm-badge { fill: currentColor; transition: fill 0.4s; }
.lm-a { fill: none; stroke: var(--bg); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.lm-spark { fill: var(--vivid); transform-origin: 16px 18.2px; transition: transform 0.6s var(--ease); }
html.on-dark .site-head > .brand .lm-spark { fill: #2b46ff; }
.brand:hover .lm-spark { transform: rotate(90deg) scale(1.15); }
.head-tag {
  margin: 0 0 0 clamp(2rem, 10vw, 13rem); max-width: 30ch;
  font-size: 1.02rem; line-height: 1.28; letter-spacing: -0.01em; color: var(--fg);
  transition: opacity 0.5s, transform 0.6s var(--ease);
}
.site-head.is-scrolled .head-tag { opacity: 0; transform: translateY(-8px); pointer-events: none; }
.head-actions { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; }
.depth-pill {
  display: inline-flex; align-items: center; gap: 0.5rem; height: 46px; padding: 0 0.9rem 0 0.2rem;
  font: 500 0.76rem/1 var(--mono); color: var(--fg); font-variant-numeric: tabular-nums; white-space: nowrap; transition: color 0.4s;
}
.depth-pill i { position: relative; width: 2px; height: 22px; border-radius: 2px; background: var(--line-2); overflow: hidden; }
.depth-pill i::after { content: ''; position: absolute; inset: 0; background: currentColor; transform-origin: top; transform: scaleY(var(--depth, 0)); }
html.on-dark .depth-pill { color: #eef1f8; }
html.on-dark .depth-pill i { background: rgba(220, 232, 248, 0.24); }
.berry-pill {
  display: inline-flex; align-items: center; gap: 0.45rem; height: 46px; padding: 0 1rem 0 0.8rem; border-radius: 999px;
  background: var(--bg-2); color: var(--fg); font: 500 0.78rem/1 var(--sans); letter-spacing: 0.04em; font-variant-numeric: tabular-nums;
}
html.on-dark .berry-pill { background: #171b29; color: #eef1f8; }
.berry-pill-icon svg { width: 16px; height: 17px; }
.berry-pill.is-bump { animation: bump 0.6s var(--ease); }
@keyframes bump { 40% { transform: scale(1.15); } }
html.on-dark .head-talk { background: #eef1f8; color: #090b13; }
.menu-btn { background: var(--bg-2); color: var(--fg); }
html.on-dark .menu-btn { background: #171b29; color: #eef1f8; }
.menu-btn:hover .roll > span { transform: none; }
.menu-btn[aria-expanded='true'] .roll > span { transform: translateY(-100%); }
.menu-dots { display: inline-flex; gap: 3px; transition: transform 0.5s var(--ease); }
.menu-dots b { width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.menu-btn[aria-expanded='true'] .menu-dots { transform: rotate(90deg); }

.menu {
  position: absolute; top: calc(var(--head-h) - 10px); right: var(--gutter);
  width: min(380px, calc(100vw - 2 * var(--gutter))); display: grid; gap: 8px;
}
.menu[hidden] { display: none; }
.menu-card { margin: 0; padding: 10px; border-radius: 20px; background: var(--surface); color: var(--fg); box-shadow: 0 18px 50px rgba(11, 13, 22, 0.12); list-style: none; }
.menu-card ul { list-style: none; margin: 0; padding: 0; }
.menu-card a {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.8rem 0.9rem; border-radius: 12px; text-decoration: none;
  font: 500 1.06rem/1.1 var(--sans); letter-spacing: 0.01em; text-transform: uppercase;
  transition: background 0.25s;
}
.menu-card a svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; opacity: 0; transform: translateX(-6px); transition: opacity 0.25s, transform 0.35s var(--ease); }
.menu-card a:hover, .menu-card a:focus-visible { background: var(--bg-2); }
.menu-card a:hover svg, .menu-card a:focus-visible svg { opacity: 1; transform: none; }
.menu-card a[aria-current='page'] span::after { content: ''; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: currentColor; margin-left: 0.6rem; vertical-align: middle; }
.menu-now { padding: 1.1rem 1.2rem; }
.menu-now .label { margin-bottom: 0.4rem; }
.menu-now p:last-child { margin: 0; font-size: 1.15rem; line-height: 1.3; letter-spacing: -0.01em; color: var(--fg); }
.menu-dark { background: #0b0d16; color: #eef1f8; }
.menu-dark a:hover, .menu-dark a:focus-visible { background: #1a1e2c; }
.menu-dark a svg { opacity: 0.6; transform: none; }
@media (prefers-reduced-motion: no-preference) {
  html:not([data-motion='reduce']) .menu:not([hidden]) .menu-card { animation: menuIn 0.6s var(--ease) both; }
  html:not([data-motion='reduce']) .menu:not([hidden]) .menu-card:nth-child(2) { animation-delay: 0.05s; }
  html:not([data-motion='reduce']) .menu:not([hidden]) .menu-card:nth-child(3) { animation-delay: 0.1s; }
}
@keyframes menuIn { from { opacity: 0; transform: translateY(-12px) scale(0.97); } }

@media (max-width: 1100px) { .head-tag { display: none; } }
@media (max-width: 900px) { .depth-pill { display: none; } }
@media (max-width: 640px) {
  :root { --head-h: 68px; }
  .brand span { display: none; }
  .brand { padding: 0 0.45rem; }
  .head-talk { display: none; }
  .pill { height: 42px; padding: 0 1.1rem; }
  .berry-pill { height: 42px; }
}

/* ---------- Depth rail (home, wide screens) ---------- */

.rail { display: none; }
@media (min-width: 1640px) {
  .js .rail { display: block; position: fixed; left: 20px; top: 50%; transform: translateY(-50%); height: 52vh; width: 14px; z-index: 40; color: var(--fg); transition: color 0.4s; }
  html.on-dark .rail { color: #eef1f8; }
}
.rail-track { position: absolute; left: 6px; top: 0; bottom: 0; width: 1px; background: color-mix(in srgb, currentColor 25%, transparent); }
.rail-fill { position: absolute; left: 0; top: 0; width: 1px; height: 100%; background: currentColor; transform-origin: top; transform: scaleY(var(--p, 0)); }
.rail-marker { position: absolute; left: 0; top: calc(var(--p, 0) * 100%); }
.rail-orb { position: absolute; left: -3px; top: -3px; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.rail-depth { position: absolute; left: 16px; top: -7px; white-space: nowrap; font: 500 0.66rem/1 var(--mono); letter-spacing: 0.02em; }
.rail ol { list-style: none; margin: 0; padding: 0; }
.rail li { position: absolute; left: 0; top: calc(var(--pos, 0) * 100%); transform: translateY(-50%); }
.rail a { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; padding: 4px 0; color: inherit; }
.rail-dot { width: 7px; height: 7px; margin-left: 3px; border-radius: 50%; box-shadow: inset 0 0 0 1px currentColor; transition: background 0.2s; }
.rail-label { font: 500 0.66rem/1 var(--sans); letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; opacity: 0; transform: translateX(-4px); transition: opacity 0.2s, transform 0.3s var(--ease); margin-left: 58px; }
.rail:hover .rail-label, .rail a:focus-visible .rail-label { opacity: 1; transform: none; }
.rail a:hover .rail-dot, .rail a[aria-current='true'] .rail-dot { background: currentColor; }

/* ---------- Windows: the dark rounded cards ---------- */

.win { position: relative; border-radius: var(--radius); overflow: hidden; background: #0c0f1a; color: var(--fg-2); isolation: isolate; }
.dark .win { background: #10131f; box-shadow: inset 0 0 0 1px var(--line); }
.win img { display: block; }

/* ---------- Hero: the box of parts ---------- */

.hero { padding-top: var(--head-h); }
.hero-win {
  height: calc(100svh - var(--head-h) - 58px); min-height: 560px; max-height: 1040px;
  background: radial-gradient(75% 85% at 66% 42%, #1c2550 0%, #0d1124 55%, #070912 100%);
}
.pile-canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: pan-y; cursor: grab; opacity: 0; transition: opacity 1.2s ease; }
.pile-canvas:active { cursor: grabbing; }
.pile-on .pile-canvas { opacity: 1; }
.pile-fallback {
  position: absolute; inset: 0; pointer-events: none; transition: opacity 1.2s ease;
  background:
    radial-gradient(12% 20% at 66% 38%, rgba(236, 240, 248, 0.85), rgba(236, 240, 248, 0) 70%),
    radial-gradient(11% 18% at 76% 56%, rgba(43, 70, 255, 0.85), rgba(43, 70, 255, 0) 70%),
    radial-gradient(9% 15% at 58% 60%, rgba(8, 9, 14, 0.95), rgba(8, 9, 14, 0) 70%);
}
.pile-on .pile-fallback { opacity: 0; }
.hero-content {
  position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column;
  padding: clamp(20px, 2.8vw, 40px); pointer-events: none;
}
.hero-content a { pointer-events: auto; }
.hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem 2rem; }
.hero-kicker { color: var(--fg-2); margin: 0; max-width: 46%; }
.pile-key { display: grid; justify-items: end; gap: 0.7rem; }
.pile-key ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.5rem 1.1rem; }
.pile-key li { display: inline-flex; align-items: center; gap: 0.45rem; font: 500 0.72rem/1 var(--sans); letter-spacing: 0.04em; text-transform: uppercase; color: var(--fg-2); }
.pile-key svg { width: 17px; height: 17px; fill: var(--fg); }
.pile-key .g-teeth { fill: none; stroke: var(--fg); stroke-width: 2.4; stroke-dasharray: 2.5 2.1; }
.pile-key .g-hole { fill: #0c0f1a; }
.pile-key .g-half { fill: var(--vivid); }
.hero-hint { margin: 0; display: flex; align-items: center; gap: 0.55rem; color: var(--fg-3); }
.hint-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--vivid); }
.hero-name {
  margin: auto 0 0; color: var(--fg); pointer-events: none;
  font: 500 clamp(3.4rem, 11vw, 12rem)/0.86 var(--sans); letter-spacing: -0.055em;
  text-shadow: 0 4px 40px rgba(7, 9, 18, 0.35);
}
.hero-name .line { display: block; overflow: hidden; padding-bottom: 0.07em; margin-bottom: -0.07em; }
.hero-name .line > span { display: inline-block; }
.hero-bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem 3rem; margin-top: clamp(1.2rem, 2.4vw, 2rem); flex-wrap: wrap; }
.hero-lede { margin: 0; max-width: 36ch; font-size: clamp(1.05rem, 1.3vw, 1.25rem); line-height: 1.4; color: var(--fg-2); }

.title-menu ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.1rem; justify-items: end; }
.title-menu a {
  display: inline-flex; align-items: center; gap: 0.6rem; padding: 0.3rem 0; text-decoration: none;
  font: 500 0.8rem/1 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-2);
  transition: color 0.25s;
}
.title-menu .fleur { width: 26px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; opacity: 0; transition: opacity 0.3s, transform 0.4s var(--ease); }
.title-menu .fleur-l { transform: translateX(8px); }
.title-menu .fleur-r { transform: translateX(-8px); }
.title-menu a:hover, .title-menu a:focus-visible { color: var(--fg); outline: none; }
.title-menu a:hover .fleur, .title-menu a:focus-visible .fleur { opacity: 1; transform: none; }

.cross-row { display: flex; align-items: center; justify-content: space-between; height: 58px; }
.cross { position: relative; width: 13px; height: 13px; }
.cross::before, .cross::after { content: ''; position: absolute; left: 50%; top: 50%; background: var(--fg); }
.cross::before { width: 13px; height: 1.4px; transform: translate(-50%, -50%); }
.cross::after { width: 1.4px; height: 13px; transform: translate(-50%, -50%); }
.cross-row .label { color: var(--fg); }

@media (prefers-reduced-motion: no-preference) {
  html:not([data-motion='reduce']) .hero-name .line > span { animation: lineUp 1.3s var(--ease) both 0.15s; }
  html:not([data-motion='reduce']) .hero-name .line + .line > span { animation-delay: 0.25s; }
  html:not([data-motion='reduce']) .hero-top,
  html:not([data-motion='reduce']) .hero-bottom { animation: fadeUp 1.2s var(--ease) both 0.55s; }
  html:not([data-motion='reduce']) .hero-win { animation: winIn 1.4s var(--ease) both; }
  html:not([data-motion='reduce']) .hint-dot { animation: pulse 2.4s ease-in-out infinite; }
}
@keyframes lineUp { from { transform: translateY(105%); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } }
@keyframes winIn { from { clip-path: inset(6% 4% 6% 4% round var(--radius)); opacity: 0.4; } to { clip-path: inset(0 round var(--radius)); opacity: 1; } }
@keyframes pulse { 50% { transform: scale(1.8); opacity: 0.45; } }

@media (max-width: 860px) {
  .hero-top { flex-direction: column; }
  .hero-kicker { max-width: none; }
  .pile-key { justify-items: start; }
  .pile-key ul { justify-content: flex-start; }
}
@media (max-width: 760px) {
  .hero-win { min-height: 560px; }
  .hero-hint { display: none; }
  .title-menu ul { justify-items: start; }
  .title-menu .fleur-l { display: none; }
}

/* ---------- Intro ---------- */

.intro { position: relative; padding-top: clamp(110px, 12vw, 200px); }
.statement { font: 400 clamp(2.8rem, 7.4vw, 7.6rem)/0.95 var(--sans); letter-spacing: -0.05em; color: var(--fg); }
.intro-statement { max-width: 13ch; }
.intro-statement .indent { display: block; padding-left: clamp(0px, 16vw, 15rem); }
.intro-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(2rem, 7vw, 8rem); align-items: start; margin-top: clamp(3.5rem, 7vw, 7rem); }
.intro-media { aspect-ratio: 4 / 3; margin: 0; }
.intro-media figcaption, .portal figcaption, .about-art figcaption {
  position: absolute; z-index: 2; left: 14px; bottom: 14px; margin: 0; padding: 0.45rem 0.75rem; border-radius: 999px;
  background: rgba(9, 11, 19, 0.6); color: #eef1f8; font-size: 0.66rem;
}
@supports (backdrop-filter: blur(4px)) { .intro-media figcaption, .portal figcaption, .about-art figcaption { backdrop-filter: blur(10px); background: rgba(9, 11, 19, 0.4); } }
.duotone { position: absolute; inset: -10% 0; }
.duotone picture, .duotone img { width: 100%; height: 100%; }
.duotone img { object-fit: cover; object-position: 48% 30%; filter: grayscale(1) contrast(1.25) brightness(0.9); }
.duotone::after { content: ''; position: absolute; inset: 0; background: var(--vivid); mix-blend-mode: screen; }
.intro-text { padding-top: 0.4rem; }
.intro-text .lede { font-size: clamp(1.35rem, 2.1vw, 1.9rem); line-height: 1.25; letter-spacing: -0.025em; max-width: 26ch; margin-bottom: 1.6rem; }
.intro-text > p:not(.lede):not(.pill-row) { max-width: 50ch; }
.creds { list-style: none; padding: 0; margin: 2rem 0 0; border-top: 1px solid var(--line); }
.creds li { display: flex; align-items: center; gap: 0.8rem; padding: 0.85rem 0; border-bottom: 1px solid var(--line); color: var(--fg); font-size: 1rem; }
.creds a { color: inherit; text-underline-offset: 3px; text-decoration-color: var(--line-2); }
@media (max-width: 860px) { .intro-grid { grid-template-columns: 1fr; } .intro-statement .indent { padding-left: 12vw; } }

/* ---------- Chapters ---------- */

.chap { position: relative; padding-top: clamp(120px, 14vw, 230px); }
.chapter { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(1.6rem, 5vw, 5rem); align-items: end; margin-bottom: clamp(3.5rem, 7vw, 7rem); }
.chapter:not(:has(.portal)) { grid-template-columns: 1fr; }
.chapter-num { margin: 0 0 1.2rem; }
.chapter-num span {
  display: inline-grid; place-items: center; min-width: 46px; height: 46px; padding: 0 0.7rem; border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--line-2); font: 500 0.85rem/1 var(--hk); letter-spacing: 0.06em; color: var(--fg);
}
.h-chapter { font: 400 clamp(3.2rem, 8.6vw, 9rem)/0.9 var(--sans); letter-spacing: -0.055em; margin-bottom: 1.4rem; }
.chapter-note { max-width: 40ch; margin: 0; color: var(--fg-2); }
.portal { margin: 0; aspect-ratio: 16 / 10; }
.portal-img { position: absolute; inset: -12% 0; }
.portal-img picture, .portal-img img, .about-img picture, .about-img img, .robot-img picture, .robot-img img, .descent-img picture, .descent-img img { width: 100%; height: 100%; }
.portal-img img, .about-img img, .robot-img img, .descent-img img { object-fit: cover; }
@media (max-width: 860px) { .chapter { grid-template-columns: 1fr; } }

.statement-sm { font: 400 clamp(1.9rem, 3.7vw, 3.5rem)/1.04 var(--sans); letter-spacing: -0.04em; color: var(--fg); max-width: 20ch; margin: 0; }
.chap-intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem clamp(2rem, 6vw, 7rem); align-items: end; margin-bottom: clamp(3.5rem, 6vw, 6rem); }
.chap-intro .lede { margin: 0; }
@media (max-width: 860px) { .chap-intro { grid-template-columns: 1fr; } }

/* ---------- Projects: a box that opens, beside a window you can play with ---------- */

.project { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(14px, 1.6vw, 22px); align-items: stretch; }
.project + .project { margin-top: clamp(14px, 1.6vw, 22px); }
.project-flip .pcard { order: 2; }
.project-fig { min-width: 0; }
.project-fig > .fig { height: 100%; }
@media (max-width: 960px) { .project { grid-template-columns: 1fr; } .project-flip .pcard { order: 0; } }

.pcard {
  position: relative; display: flex; flex-direction: column; padding: clamp(22px, 2.8vw, 40px); border-radius: var(--radius);
  background: var(--surface); box-shadow: 0 1px 0 rgba(11, 13, 22, 0.04); cursor: pointer;
  transition: box-shadow 0.45s var(--ease), transform 0.45s var(--ease);
}
.pcard:hover, .pcard:focus-within { box-shadow: inset 0 0 0 1px rgba(var(--rgb), 0.45), 0 30px 70px -36px rgba(var(--rgb), 0.5); }
.pcard-tags { display: flex; align-items: center; flex-wrap: wrap; margin: 0 0 1.4rem; color: var(--fg-2); }
.pcard-tags .dot { margin-right: 0.7rem; }
.case-n { font-family: var(--mono); color: var(--fg); margin-right: 0.9rem; }
.h-case { font: 400 clamp(1.75rem, 2.9vw, 2.75rem)/1.08 var(--sans); letter-spacing: -0.035em; margin-bottom: 1.4rem; max-width: 18ch; }
.pcard > p:not(.pcard-tags) { max-width: 54ch; }
.pcard strong { color: var(--fg); font-weight: 500; }
.pcard-foot { margin-top: auto; padding-top: 1.6rem; display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem 1.6rem; flex-wrap: wrap; }
.pcard-links { display: flex; flex-wrap: wrap; gap: 0.8rem 1.5rem; margin: 0; }
.pcard-open {
  display: inline-flex; align-items: center; gap: 0.9rem; margin-left: auto; text-decoration: none; color: var(--fg);
  font: 500 0.78rem/1 var(--sans); letter-spacing: 0.04em; text-transform: uppercase;
}
/* The whole box is the link. Other links inside it sit above the overlay so they still work. */
.pcard-open::after { content: ''; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.pcard-open:focus-visible { outline: none; }
.pcard-open:focus-visible::after { outline: 2px solid var(--accent); outline-offset: 3px; }
.pcard a:not(.pcard-open), .pcard button { position: relative; z-index: 2; }
.pcard:hover .card-btn, .pcard:focus-within .card-btn, .card:hover .card-btn, .card:focus-visible .card-btn,
.tl-link:hover .card-btn, .next-card:hover .card-btn, .next-card:focus-visible .card-btn {
  background: var(--c, var(--fg)); color: #fff; box-shadow: none;
}
.dark .tl-link:hover .card-btn { color: #0b1020; }
.pcard:hover .card-btn svg, .card:hover .card-btn svg, .tl-link:hover .card-btn svg, .next-card:hover .card-btn svg { transform: translateX(2px); }

.formula {
  display: flex; flex-wrap: wrap; gap: 0.4rem 1.8rem; margin: 0.4rem 0 1rem; padding: 1rem 1.3rem; border-radius: 14px;
  font: italic 400 clamp(1.3rem, 2vw, 1.55rem)/1.4 var(--serif); color: var(--fg); background: var(--bg);
}

/* Smaller project boxes */
.cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(12px, 1.4vw, 18px); }
.cards > li { display: flex; }
.card {
  position: relative; display: flex; flex-direction: column; gap: 0.9rem; width: 100%; padding: clamp(20px, 2vw, 28px); border-radius: var(--radius);
  background: var(--surface); text-decoration: none; color: inherit; overflow: hidden;
  transition: box-shadow 0.45s var(--ease);
}
.card:hover, .card:focus-visible { box-shadow: inset 0 0 0 1px rgba(var(--rgb), 0.45), 0 30px 60px -34px rgba(var(--rgb), 0.5); outline: none; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.card-top .label { display: inline-flex; align-items: center; gap: 0.6rem; }
.card-title { margin-top: 1.8rem; color: var(--fg); font: 400 clamp(1.35rem, 1.9vw, 1.75rem)/1.12 var(--sans); letter-spacing: -0.03em; }
.card-text { color: var(--fg-2); font-size: 0.97rem; line-height: 1.5; }
.card-media { display: block; position: relative; aspect-ratio: 16 / 9; margin: calc(-1 * clamp(20px, 2vw, 28px)) calc(-1 * clamp(20px, 2vw, 28px)) 0.4rem; overflow: hidden; background: #0c0f1a; }
.card-media picture, .card-media img { width: 100%; height: 100%; }
.card-media img { object-fit: cover; transition: transform 0.9s var(--ease); }
.card:hover .card-media img { transform: scale(1.05); }
@media (max-width: 960px) { .cards { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .cards { grid-template-columns: 1fr; } }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1rem, 3vw, 2.5rem); margin: clamp(5rem, 9vw, 9rem) 0 0; }
.stats div { border-top: 1px solid var(--line-2); padding-top: 1.1rem; }
.stats dt { margin: 0; }
.stats dd { margin: 1.4rem 0 0; font: 400 clamp(3.2rem, 8.4vw, 8rem)/0.88 var(--sans); letter-spacing: -0.06em; color: var(--fg); font-variant-numeric: tabular-nums; }
.stats small { display: block; margin-top: 0.9rem; font-size: 1rem; letter-spacing: -0.005em; color: var(--fg-2); }
@media (max-width: 600px) { .stats { grid-template-columns: 1fr; } }

.robot-row { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(2rem, 5vw, 5rem); align-items: end; margin-top: clamp(5rem, 9vw, 9rem); }
.berry-photo { aspect-ratio: 5 / 4; }
.robot-img { position: absolute; inset: -8% 0; }
.robot-img img { object-position: 50% 45%; }
.robot-caption .label { margin-bottom: 1rem; }
@media (max-width: 860px) { .robot-row { grid-template-columns: 1fr; } }

.more { margin-top: clamp(5rem, 9vw, 9rem); }
.more-title { margin-bottom: 1.2rem; }
.quote { font: 400 clamp(1.8rem, 3.4vw, 3.2rem)/1.08 var(--sans); letter-spacing: -0.04em; color: var(--fg); max-width: 24ch; margin: 0 0 clamp(2.5rem, 5vw, 4rem); }

/* ---------- Rows: writing, with a sliding arrow ---------- */

.rows { list-style: none; padding: 0; margin: 0; }
.row a {
  position: relative; display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 4fr) minmax(0, 5fr) minmax(0, 1.4fr);
  gap: 0.4rem 2rem; align-items: baseline; padding: 1.6rem 0; text-decoration: none; color: inherit;
  border-top: 1px solid var(--line); transition: border-color 0.35s;
}
.row:last-child a { border-bottom: 1px solid var(--line); }
.row a:hover, .row:hover + .row a, .row a:focus-visible { border-top-color: var(--fg); }
.row:last-child a:hover, .row:last-child a:focus-visible { border-bottom-color: var(--fg); }
.row a:focus-visible { outline: none; }
.row-kicker { grid-column: 1; }
.row-title { grid-column: 2; position: relative; display: block; color: var(--fg); font: 400 clamp(1.25rem, 1.8vw, 1.6rem)/1.15 var(--sans); letter-spacing: -0.03em; }
.row-title > span:last-child { display: inline-block; transition: transform 0.55s var(--ease); }
.row-arrow { position: absolute; left: 0; top: 0.12em; opacity: 0; transform: translateX(-12px); transition: opacity 0.3s, transform 0.55s var(--ease); }
.row-arrow svg { width: 0.95em; height: 0.95em; fill: none; stroke: currentColor; stroke-width: 1.6; }
.row a:hover .row-arrow, .row a:focus-visible .row-arrow { opacity: 1; transform: none; }
.row a:hover .row-title > span:last-child, .row a:focus-visible .row-title > span:last-child { transform: translateX(1.35em); }
.row-text { grid-column: 3; color: var(--fg-2); font-size: 1rem; line-height: 1.5; }
.row-meta { grid-column: 4; text-align: right; white-space: nowrap; }
.rows-big .row a { padding: 2rem 0; }
.rows-big .row-title { font-size: clamp(1.45rem, 2.4vw, 2.3rem); }
@media (max-width: 860px) {
  .row a { grid-template-columns: 1fr; }
  .row-kicker, .row-title, .row-text, .row-meta { grid-column: 1; text-align: left; }
}

/* ---------- The map: it tilts flat as it scrolls in ---------- */

.map-stage { position: relative; margin: 0; perspective: 1800px; }
.map-stage .map-canvas {
  transform-origin: 50% 100%;
  transform: rotateX(calc((1 - min(1, var(--p, 1) * 2.6)) * 26deg)) scale(calc(0.9 + min(1, var(--p, 1) * 2.6) * 0.1));
}
.map-stage::before { content: ''; position: absolute; left: 6%; right: 6%; top: 20%; bottom: 14%; border-radius: 50%; background: rgba(11, 13, 22, 0.22); filter: blur(40px); pointer-events: none; }
.map { position: relative; margin: 0; }
.map-canvas { position: relative; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; }
.map-svg { width: 100%; height: auto; min-width: 860px; }
.map-paper { position: relative; min-width: 860px; }
.parchment { fill: #e2d6b8; }
.grain { mix-blend-mode: multiply; opacity: 0.6; }
.region-shape { fill: none; stroke: #4a3b28; stroke-opacity: 0.55; stroke-width: 1.4; stroke-dasharray: 8 5; }
.region[data-region='games'] .region-shape { fill: rgba(196, 150, 60, 0.13); }
.region[data-region='robotics'] .region-shape { fill: rgba(190, 80, 150, 0.11); }
.region[data-region='ml'] .region-shape { fill: rgba(60, 110, 180, 0.12); }
.region[data-region='health'] .region-shape { fill: rgba(70, 140, 70, 0.13); }
.region-label { font: 600 15px var(--sans); letter-spacing: 0.14em; fill: #3a2d1d; opacity: 0.85; }
.tunnel { fill: none; stroke: #4a3b28; stroke-opacity: 0.75; stroke-width: 2.2; stroke-linecap: round; transition: stroke 0.25s, stroke-width 0.25s, opacity 0.25s; }
.room { cursor: pointer; transition: opacity 0.25s; }
.room-shape { fill: #f0e7d0; stroke: #3a2d1d; stroke-width: 1.8; transition: fill 0.2s, stroke 0.2s; }
.room text { font: italic 500 17px var(--serif); fill: #2b2116; pointer-events: none; }
.seal circle { fill: #a8321f; }
.seal .seal-ring { fill: none; stroke: #e7a08a; stroke-width: 1; }
.room:hover .room-shape, .room:focus-visible .room-shape, .room.is-active .room-shape { fill: #fff8e6; stroke: #a8321f; stroke-width: 2.4; }
.room:focus { outline: none; }
.map.has-focus .room:not(.is-near) { opacity: 0.35; }
.map.has-focus .tunnel { opacity: 0.25; }
.map.has-focus .tunnel.is-near { opacity: 1; stroke: #a8321f; stroke-width: 3; }
.pin-pole { fill: none; stroke: #3a2d1d; stroke-width: 1.5; }
.map-pin-flag { fill: #a8321f; }
.map-pin text, .map-legend text { font: italic 400 15px var(--serif); fill: #3a2d1d; }
.compass circle { fill: none; stroke: #3a2d1d; stroke-opacity: 0.7; }
.compass .compass-inner { stroke-dasharray: 2 3; }
.compass path { fill: #f0e7d0; stroke: #3a2d1d; stroke-width: 1; }
.compass .compass-n { fill: #3a2d1d; }
.compass .compass-ew { fill: #d8caa8; }
.compass text { font: 600 12px var(--sans); fill: #3a2d1d; }
.tunnel-key { stroke: #4a3b28; stroke-width: 2.2; stroke-linecap: round; }

.map-info { margin-top: 1.8rem; min-height: 8.5rem; display: grid; gap: 0.4rem; color: var(--fg-2); font-size: 1.05rem; }
.map-hint { color: var(--fg-3); max-width: 70ch; }
.map-hint .kicker { display: block; margin-bottom: 0.4rem; }
.map-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.3rem 2rem; align-items: start; }
.map-card h3 { font: 400 clamp(1.6rem, 2.4vw, 2.2rem)/1.1 var(--sans); letter-spacing: -0.035em; color: var(--fg); }
.map-card .kicker { grid-column: 1 / -1; }
.map-card p { margin: 0.4rem 0 0; max-width: 64ch; }
.map-card ul { list-style: none; padding: 0; margin: 0.7rem 0 0; display: grid; gap: 0.25rem; font-size: 1rem; }
.map-card li::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--fg); margin-right: 0.7em; vertical-align: middle; }
.map-card li b { color: var(--fg); font-weight: 500; }
.map-card .arrow-link { grid-row: 2; grid-column: 2; white-space: nowrap; }
.map-list { display: none; list-style: none; padding: 0; margin: 2rem 0 0; }
@media (max-width: 760px) {
  .map-card { grid-template-columns: 1fr; }
  .map-card .arrow-link { grid-row: auto; grid-column: auto; justify-self: start; margin-top: 0.6rem; }
  .map-canvas::after {
    content: 'Drag to explore the map'; position: sticky; left: 0; bottom: 0; display: block; width: max-content;
    font: 500 0.66rem/1 var(--sans); letter-spacing: 0.04em; text-transform: uppercase; color: #fff;
    padding: 0.7em 0.9em; margin: 0 0 8px 8px; border-radius: 999px; background: rgba(9, 11, 19, 0.8);
  }
  .map-list { display: grid; gap: 1.4rem; grid-template-columns: 1fr 1fr; }
  .map-list ul { list-style: none; padding: 0; margin: 0.5rem 0 0; }
  .map-list a { display: block; padding: 0.25rem 0; color: var(--fg); text-decoration: none; }
}
html:not(.js) .map-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.4rem; }
html:not(.js) .map-list ul { list-style: none; padding: 0; margin: 0.5rem 0 0; }

/* ---------- Figures (they live in windows, so they use the dark tokens) ---------- */

.fig { margin: 0; }
.fig.win { padding: clamp(18px, 2.4vw, 32px); }
.fig figcaption { font-size: 0.92rem; line-height: 1.5; color: var(--fg-3); margin-top: 1rem; max-width: 64ch; }
.fig-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.8rem 1.2rem; margin-bottom: 1.2rem; }
.fig-head .kicker, .fig > .kicker { margin: 0; color: var(--fg-2); }

.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line-2); }
.seg button {
  font: 500 0.68rem/1 var(--sans); letter-spacing: 0.04em; text-transform: uppercase;
  background: transparent; border: 0; border-radius: 999px; color: var(--fg-3); padding: 0.75em 1em; cursor: pointer;
  transition: background 0.25s, color 0.25s;
}
.seg button:hover { color: var(--fg); }
.seg button[aria-pressed='true'] { background: var(--fg); color: var(--bg); }

.needs-js { display: none; color: var(--fg-3); font-size: 1rem; }
html:not(.js) .needs-js, .module-failed .needs-js { display: block; }
html:not(.js) .sim-stage, html:not(.js) .sim-graph, html:not(.js) .sim-readout,
.module-failed .sim-stage, .module-failed .sim-graph, .module-failed .sim-readout { display: none; }

.photo { margin: 0; }
.photo picture, .photo img { width: 100%; }
.photo img { border-radius: 14px; }
.photo figcaption { font-size: 0.92rem; color: var(--fg-3); margin-top: 0.8rem; }
.photo-link { display: block; position: relative; text-decoration: none; }
.photo-zoom { position: absolute; right: 12px; bottom: 12px; background: rgba(9, 11, 19, 0.85); color: #fff; font: 500 0.68rem/1 var(--sans); letter-spacing: 0.04em; text-transform: uppercase; padding: 0.75em 1em; border-radius: 999px; opacity: 0; transition: opacity 0.2s; }
.photo-link:hover .photo-zoom, .photo-link:focus-visible .photo-zoom { opacity: 1; }
@media (hover: none) { .photo-zoom { opacity: 1; } }

.table-scroll { overflow-x: auto; margin: 1.5rem 0 2rem; }
table { width: 100%; border-collapse: collapse; font-size: 0.98rem; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 0.65rem 0.9rem 0.65rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font: 500 0.68rem/1.3 var(--sans); letter-spacing: 0.04em; text-transform: uppercase; color: var(--fg-3); border-bottom-color: var(--line-2); }
tbody th { font-weight: 500; color: var(--fg); }
tr.is-hl th, tr.is-hl td { color: var(--accent); }
.data-table { margin-top: 1rem; }
.data-table summary { cursor: pointer; font: 500 0.7rem/1 var(--sans); letter-spacing: 0.04em; text-transform: uppercase; color: var(--fg-2); padding: 0.4rem 0; }
.data-table summary:hover { color: var(--fg); }
html:not(.js) .triage .chart, html:not(.js) .triage .seg { display: none; }

.chart { position: relative; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart .axis line, .chart .axis path { stroke: var(--line-2); }
.chart .grid line { stroke: var(--line); stroke-dasharray: 2 4; }
.chart text { font: 400 12px var(--sans); fill: var(--fg-3); font-variant-numeric: tabular-nums; }
.chart .axis-title { font: 500 9.5px var(--sans); letter-spacing: 0.06em; fill: var(--fg-2); }
.chart .band { fill: var(--green); opacity: 0.08; }
.chart .band-line { stroke: var(--green); stroke-dasharray: 5 4; opacity: 0.8; }
.chart .band-label { fill: var(--green); font-style: italic; }
.chart .pt { cursor: pointer; transition: transform 0.8s var(--ease); }
.chart .pt circle { fill: #0c0f1a; stroke: var(--fg-2); stroke-width: 1.5; transition: r 0.2s, fill 0.2s; }
.chart .pt text { fill: var(--fg-2); font-size: 12.5px; }
.chart .pt.is-ref circle { stroke: var(--city); }
.chart .pt.is-dep circle { fill: var(--accent); stroke: #fff; }
.chart .pt.is-dep text { fill: var(--accent); }
.chart .pt .pt-sub { font-size: 11.5px; font-style: italic; }
.chart .pt:hover circle, .chart .pt:focus-visible circle, .chart .pt.is-on circle { r: 8; }
.chart .pt:focus { outline: none; }
.chart .pt:focus-visible circle { stroke: var(--accent); stroke-width: 2.5; }
.chart-legend { list-style: none; padding: 0; margin: 0.8rem 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0.2rem 1rem; font-size: 0.92rem; color: var(--fg-2); }
.chart-legend[hidden] { display: none; }
.chart-legend b { color: var(--fg); font-weight: 500; margin-right: 0.5em; }
.chart-legend .is-dep, .chart-legend .is-dep b { color: var(--accent); }
.chart-legend .is-dep { grid-column: 1 / -1; }
.chart-legend span { font-style: italic; margin-left: 0.6em; }
.chart-tip {
  position: absolute; pointer-events: none; z-index: 3; min-width: 210px; border-radius: 12px;
  background: #05070d; box-shadow: inset 0 0 0 1px var(--line-2); padding: 0.75rem 0.9rem; font-size: 0.9rem; line-height: 1.45;
  opacity: 0; transform: translate(-50%, calc(-100% - 14px)); transition: opacity 0.15s;
}
.chart-tip.is-on { opacity: 1; }
.chart-tip strong { display: block; color: var(--fg); font-weight: 500; margin-bottom: 0.25rem; }
.chart-tip span { display: flex; justify-content: space-between; gap: 1rem; color: var(--fg-2); }
.chart-tip b { font-weight: 500; color: var(--fg); }

.sim-stage { perspective: 1100px; margin: -9% auto -3%; max-width: 520px; }
.sim-tilt { transform: rotateX(30deg); transform-origin: 50% 60%; }
.sim-field { width: 100%; aspect-ratio: 1; }
.sim-readout { display: flex; flex-wrap: wrap; align-items: end; gap: 1rem 2rem; margin: 1.2rem 0 0.8rem; }
.sim-readout strong { display: block; font: 400 1.9rem/1.1 var(--sans); letter-spacing: -0.03em; color: var(--fg); font-variant-numeric: tabular-nums; margin-top: 0.3rem; }
.sim-readout [data-time='chain'] { color: #f2c46f; }
.sim-readout .btn { margin-left: auto; }
.btn {
  display: inline-flex; align-items: center; height: 40px; padding: 0 1.1rem; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--bg-2); color: var(--fg); font: 500 0.72rem/1 var(--sans); letter-spacing: 0.04em; text-transform: uppercase;
  transition: background 0.25s, color 0.25s;
}
.btn:hover { background: var(--fg); color: var(--bg); }
.sim-graph { width: 100%; height: 130px; border-top: 1px solid var(--line); }
@media (max-width: 560px) { .sim-tilt { transform: rotateX(18deg); } .sim-readout .btn { margin-left: 0; } }

.watch-fig > .kicker { margin-bottom: 0.5rem; }
.watch-stage { perspective: 900px; height: 430px; display: grid; place-items: center; touch-action: pan-y; }
.watch { position: relative; width: 200px; height: 170px; transform-style: preserve-3d; transform: rotateX(var(--rx, 12deg)) rotateY(var(--ry, -24deg)); cursor: grab; }
.watch.is-dragging { cursor: grabbing; }
.watch .case { position: absolute; inset: 0; transform-style: preserve-3d; }
.case-slice { position: absolute; inset: 0; border-radius: 28px; background: #19202d; border: 1px solid rgba(220, 232, 248, 0.07); transform: translateZ(calc(var(--z) * -2.6px)); }
.case-face { position: absolute; inset: 0; border-radius: 28px; transform: translateZ(1px); background: linear-gradient(150deg, #34405a, #141b28 60%); border: 1px solid rgba(220, 232, 248, 0.3); box-shadow: inset 0 0 0 7px #0c111a; }
.case-btn { position: absolute; right: -5px; width: 7px; height: 26px; background: #2b3549; border-radius: 3px; transform: translateZ(-10px); }
.case-btn.b1 { top: 36px; } .case-btn.b2 { top: 98px; }
.strap { position: absolute; left: 38px; width: 124px; height: 120px; background: linear-gradient(90deg, #111725, #1b2334 50%, #111725); border: 1px solid rgba(220, 232, 248, 0.07); }
.strap-top { bottom: calc(100% - 14px); border-radius: 22px 22px 6px 6px; transform-origin: bottom; transform: translateZ(-12px) rotateX(-24deg); }
.strap-bot { top: calc(100% - 14px); border-radius: 6px 6px 22px 22px; transform-origin: top; transform: translateZ(-12px) rotateX(24deg);
  background-image: radial-gradient(circle, #06090f 3px, transparent 3.5px), linear-gradient(90deg, #111725, #1b2334 50%, #111725);
  background-size: 100% 20px, 100% 100%; background-position: 0 52px, 0 0; background-repeat: repeat-y, no-repeat; }
.screen { position: absolute; inset: 21px; border-radius: 9px; background: #030405; overflow: hidden; box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.9), 0 0 0 1px #000; font-family: var(--mono); color: #ebe7dd; }
.scr { position: absolute; inset: 9px 11px; opacity: 0; visibility: hidden; transition: opacity 0.35s, visibility 0.35s; display: flex; flex-direction: column; justify-content: center; }
.scr.is-on { opacity: 1; visibility: visible; }
.scr p { margin: 0; }
.scr-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 10px; color: #cfcabd; }
.scr-top .bt { color: #5ba6ff; margin-left: auto; }
.batt { width: 20px; height: 9px; border: 1px solid #cfcabd; padding: 1px; background: #e2533c content-box; }
.scr-big { font-size: 18px; line-height: 1.25; }
.scr-big b { font-weight: 500; color: #fff; }
.scr-mid { font-size: 11px; line-height: 1.6; }
.scr-back { font-size: 11px; color: #cfcabd; margin-top: 4px !important; }
.scr-back.right { text-align: right; }
.scr-alert { color: #ff4c3b; font-size: 13px; text-align: center; line-height: 1.35; letter-spacing: 0.04em; }
.scr-menu { list-style: none; margin: 10px 0 0; padding: 0; font-size: 11px; line-height: 1.7; color: #a99ae6; }
.scr-menu .sel { color: #fff; }
.watch-tabs { margin: 0.4rem 0 1.4rem; }
.trace { border-top: 1px solid var(--line); padding-top: 0.8rem; }
.trace-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.trace-state { font: italic 400 1.05rem/1 var(--serif); color: var(--green); }
.trace-state.is-tremor { color: var(--infection); }
.trace-canvas { width: 100%; height: 84px; margin-top: 0.5rem; }
@media (max-width: 560px) { .watch-stage { height: 360px; } .watch { scale: 0.86; } }

.iage-fig > .kicker { margin-bottom: 1.6rem; }
.bars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(0.8rem, 2.5vw, 1.8rem); align-items: start; }
.bar-track { position: relative; height: 260px; display: flex; flex-direction: column; justify-content: flex-end; }
.bar-val { order: -1; font: 400 clamp(2rem, 3.4vw, 3rem)/1 var(--sans); letter-spacing: -0.05em; color: var(--fg); margin-bottom: 0.6rem; }
.bar-fill {
  display: block; height: calc(var(--v) * 1% * 0.8); border-radius: 10px 10px 0 0; transform-origin: bottom;
  background: repeating-linear-gradient(135deg, rgba(232, 212, 156, 0.75) 0 2px, transparent 2px 7px);
  box-shadow: inset 0 0 0 1px var(--geo);
}
.bar-key { display: block; border-top: 1px solid var(--line-2); padding-top: 0.7rem; font: 500 0.74rem/1.3 var(--sans); letter-spacing: 0.04em; text-transform: uppercase; color: var(--fg); }
.bar-note { display: block; font-size: 0.88rem; line-height: 1.4; color: var(--fg-3); margin-top: 0.3rem; }
html.js-reveal .iage-fig .bar-fill { transform: scaleY(0); transition: transform 1.3s var(--ease); }
html.js-reveal .is-in .iage-fig .bar-fill { transform: none; }
html.js-reveal .is-in .iage-fig .bar:nth-child(2) .bar-fill { transition-delay: 0.12s; }
html.js-reveal .is-in .iage-fig .bar:nth-child(3) .bar-fill { transition-delay: 0.24s; }
@media (max-width: 560px) { .bar-track { height: 200px; } }

/* ---------- The descent: one window opens all the way ----------
   Only transforms and opacity change while scrolling, so it stays smooth. */

.descent { position: relative; height: 280vh; --e: min(1, calc(var(--p, 0) * 1.9)); }
.descent-pin { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; display: grid; place-items: center; }
/* Behind the window: goes dark as the window reaches full size, so no page shows in its rounded corners. */
.descent-pin::before { content: ''; position: absolute; inset: 0; background: #090b13; opacity: clamp(0, calc((var(--e) - 0.86) * 8), 1); will-change: opacity; }
.descent-win { position: absolute; inset: 0; border-radius: 30px; overflow: hidden; background: #090b13; transform: scale(calc(0.38 + var(--e) * 0.62)); will-change: transform; }
.descent-img { position: absolute; inset: 0; transform: scale(calc(1.35 - var(--e) * 0.35)); will-change: transform; }
.descent-img img { object-position: 50% 40%; }
.descent-shade { position: absolute; inset: 0; background: #090b13; opacity: clamp(0, calc((var(--p, 0) - 0.55) * 2.6), 1); will-change: opacity; }
.descent-words {
  position: relative; z-index: 2; margin: 0; display: flex; gap: 0.25em; white-space: nowrap;
  font: 400 clamp(3.4rem, 12vw, 13rem)/0.9 var(--sans); letter-spacing: -0.06em; color: #fff;
  text-shadow: 0 4px 40px rgba(5, 7, 13, 0.45); opacity: clamp(0, calc((var(--e) - 0.55) * 3), 1); will-change: opacity;
}
.descent-words span { display: inline-block; transform: translateX(calc(var(--p, 0) * var(--dir) * 22vw)); will-change: transform; }
.descent-words span:first-child { --dir: -1; }
.descent-words span:last-child { --dir: 1; font-family: var(--serif); font-style: italic; letter-spacing: -0.03em; }
.descent-depth { position: absolute; z-index: 2; left: 50%; bottom: clamp(24px, 5vh, 56px); transform: translateX(-50%); margin: 0; color: #fff; opacity: clamp(0, calc((var(--e) - 0.7) * 4), 1); font-variant-numeric: tabular-nums; white-space: nowrap; }
html:not(.js) .descent, [data-motion='reduce'] .descent { height: 70vh; --p: 0.5; }
html:not(.js) .descent-pin, [data-motion='reduce'] .descent-pin { height: 70vh; }

/* ---------- Underground ---------- */

.dark { position: relative; background: var(--bg); color: var(--fg-2); box-shadow: 0 -2px 0 #090b13; }
.dark .chap:first-child { padding-top: clamp(80px, 9vw, 140px); }
.dark .pill-light { background: var(--fg); color: var(--bg); }

/* The expedition scrolls sideways while the page scrolls down. */
.hscroll { position: relative; margin-top: clamp(1rem, 3vw, 2rem); }
.hscroll-pin { padding: 0 var(--gutter); }
.tl-track { list-style: none; margin: 0 auto; padding: 0; display: grid; gap: 14px; max-width: calc(var(--wrap) - 2 * var(--gutter)); }
.tl-card {
  position: relative; display: flex; flex-direction: column; gap: 1.4rem; justify-content: space-between;
  padding: clamp(20px, 2vw, 30px); border-radius: var(--radius); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow 0.4s;
}
.tl-n { margin: 0; color: var(--fg-3); font-family: var(--mono); letter-spacing: 0; text-transform: none; }
.tl-when { margin: 0; font: 400 clamp(2.4rem, 4.4vw, 4.4rem)/0.95 var(--sans); letter-spacing: -0.05em; color: var(--fg); }
.tl-body h3 { display: flex; align-items: center; gap: 0.6rem; font: 400 1.35rem/1.2 var(--sans); letter-spacing: -0.025em; margin-bottom: 0.6rem; }
.tl-body h3 a { text-decoration: none; }
.tl-body p { margin: 0; color: var(--fg-2); font-size: 0.98rem; line-height: 1.55; }
.tl-link { cursor: pointer; padding-bottom: calc(clamp(20px, 2vw, 30px) + 52px); }
.tl-link h3 a::after { content: ''; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.tl-link h3 a:focus-visible { outline: none; }
.tl-link h3 a:focus-visible::after { outline: 2px solid var(--accent); outline-offset: 3px; }
.tl-link:hover { box-shadow: inset 0 0 0 1px rgba(var(--rgb), 0.55); }
.tl-link .card-btn { position: absolute; right: clamp(20px, 2vw, 30px); bottom: clamp(20px, 2vw, 30px); }
.tl-card .berry { position: relative; z-index: 2; }
.tl-progress { display: none; }
.hs-on .hscroll-pin { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; display: flex; flex-direction: column; justify-content: center; padding: 0; }
.hs-on .tl-track { display: flex; gap: 16px; max-width: none; margin: 0; padding: 0 var(--gutter); width: max-content; will-change: transform; }
.hs-on .tl-card { width: clamp(300px, 27vw, 420px); min-height: clamp(380px, 54vh, 540px); flex: none; }
.hs-on .tl-progress { display: block; position: relative; height: 2px; margin: 2.2rem var(--gutter) 0; background: var(--line); border-radius: 2px; overflow: hidden; }
.tl-progress-fill { position: absolute; inset: 0; background: var(--fg); transform-origin: left; transform: scaleX(var(--p, 0)); }
@media (min-width: 761px) { .tl-track:not(.hs-on *) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- The bench ---------- */

.about-grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.about-text .statement-sm { margin-bottom: 2rem; }
.about-text p:not(.statement-sm) { max-width: 58ch; }
.about-text a, .prose a, .kit-used a { color: var(--fg); text-decoration-color: var(--line-2); text-underline-offset: 3px; text-decoration-thickness: 1px; transition: text-decoration-color 0.2s; }
.about-text a:hover, .prose a:hover, .kit-used a:hover { text-decoration-color: currentColor; }
.about-art { margin: 0; aspect-ratio: 1200 / 724; }
.about-img { position: absolute; inset: -8% 0; }
@media (max-width: 960px) { .about-grid { grid-template-columns: 1fr; } }

.shelf { margin-top: clamp(5rem, 10vw, 9rem); }
.shelf-title, .charms-title { margin-bottom: 1.4rem; }
.shelf-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: minmax(0, 1.72fr) minmax(0, 1fr) minmax(0, 1fr); gap: clamp(1rem, 2.5vw, 2rem); max-width: 1100px; align-items: start; }
.shelf-list a { display: grid; gap: 0.25rem; text-decoration: none; color: inherit; }
.cover, .duo { display: block; position: relative; border-radius: 14px; overflow: hidden; transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform 0.6s var(--ease); }
.cover::after, .duo::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at var(--gx, 50%) var(--gy, 0%), rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 55%); opacity: 0; transition: opacity 0.4s; }
.cover:hover::after, .duo:hover::after { opacity: 1; }
.cover img { width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: cover; }
.shelf-rank { margin-top: 0.9rem; font: 500 0.8rem/1 var(--hk); letter-spacing: 0.1em; color: var(--accent); }
.shelf-name { font: 400 1.15rem/1.25 var(--sans); letter-spacing: -0.02em; color: var(--fg); }
.shelf-note { font-size: 0.95rem; color: var(--fg-3); }
.shelf-duo { display: grid; gap: 0.25rem; }
.duo { aspect-ratio: 1.149; }
.shelf-list .duo-half { position: absolute; inset: 0; display: block; }
.shelf-list .duo-half img { position: absolute; top: 0; width: 58%; height: 100%; object-fit: cover; transition: transform 0.7s var(--ease); }
.duo-hk { clip-path: polygon(0 0, 58% 0, 42% 100%, 0 100%); }
.duo-hk img { left: 0; }
.duo-ss { clip-path: polygon(58% 0, 100% 0, 100% 100%, 42% 100%); }
.duo-ss img { right: 0; }
.shelf-list .duo-half:hover img, .shelf-list .duo-half:focus-visible img { transform: scale(1.04); }
.duo .duo-half:focus-visible { outline: none; }
.duo:has(.duo-half:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.duo-seam { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.duo-seam line { stroke: #f4f8ff; stroke-width: 2; vector-effect: non-scaling-stroke; }
@media (max-width: 600px) { .shelf-list { grid-template-columns: 1fr 1fr; } .shelf-duo { grid-column: 1 / -1; } }

.charms { margin-top: clamp(4rem, 8vw, 7rem); }
.charm-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.charm { display: grid; justify-items: start; gap: 0.2rem; padding: 1.6rem 1.2rem 1.6rem 0; }
.charm + .charm { padding-left: 1.2rem; border-left: 1px solid var(--line); }
.charm-badge {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 1.2rem;
  background: radial-gradient(circle at 50% 38%, #24324d, #0d1322 70%);
  box-shadow: inset 0 0 0 2px #3a4a68, inset 0 0 0 5px #0d1322, inset 0 0 0 6px rgba(188, 217, 255, 0.35);
}
.charm-photo img { width: 54px; height: 54px; border-radius: 50%; object-fit: cover; }
.charm-badge.charm-berry svg { width: 28px; height: 28px; }
.charm-text { font: 500 1.05rem/1 var(--hk); color: var(--fg); letter-spacing: 0.06em; }
.charm-value { font: 400 clamp(1.6rem, 2.4vw, 2.2rem)/1 var(--sans); letter-spacing: -0.04em; color: var(--fg); font-variant-numeric: tabular-nums; }
.charm-label { font-size: 0.92rem; color: var(--fg-3); }
@media (max-width: 900px) {
  .charm-list { grid-template-columns: 1fr 1fr; }
  .charm, .charm + .charm { padding: 1.4rem 1rem 1.4rem 0; border-left: 0; }
  .charm:nth-child(even) { padding-left: 1rem; border-left: 1px solid var(--line); }
  .charm:nth-child(n + 3) { border-top: 1px solid var(--line); }
}

.kit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 1.6rem 3rem; margin-top: clamp(4rem, 7vw, 6rem); }
.kit .label { margin-bottom: 0.8rem; }
.kit-classes { margin: 0; font-size: 1.3rem; line-height: 1.35; letter-spacing: -0.02em; color: var(--fg); max-width: 22ch; }
.kit-used dl { margin: 0; border-top: 1px solid var(--line); }
.kit-used dl div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.1rem 2rem; padding: 0.75rem 0; border-bottom: 1px solid var(--line); }
.kit-used dt { color: var(--fg); }
.kit-used dd { margin: 0; color: var(--fg-2); }
@media (max-width: 760px) { .kit { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .kit-used dl div { grid-template-columns: 1fr; } }

/* ---------- The bell ---------- */

.bell-chap { padding-bottom: clamp(110px, 13vw, 200px); }
.bell-kicker { margin: 0; font-family: var(--hk); letter-spacing: 0.1em; }
.h-bell { font: 400 clamp(4rem, 14.5vw, 16rem)/0.86 var(--sans); letter-spacing: -0.065em; margin: 1.4rem 0 clamp(3rem, 7vw, 6rem); }
.contact-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.bell-row { display: flex; align-items: flex-end; gap: 0.8rem; margin-bottom: 1.6rem; }
.bell-wrap { width: 100px; padding: 0; border: 0; background: none; cursor: pointer; }
.bell-wrap:focus-visible { outline-offset: 6px; }
.bell-bracket { fill: none; stroke: #3a4a68; stroke-width: 4; stroke-linecap: round; }
.bell-boss { fill: #3a4a68; stroke: var(--accent); stroke-opacity: 0.5; }
.bell-body { fill: #2c3a57; stroke: var(--accent); stroke-opacity: 0.7; stroke-width: 1.4; }
.bell-band { fill: none; stroke: var(--accent); stroke-opacity: 0.35; stroke-width: 1.2; }
.bell-rim { fill: #3a4a6c; stroke: var(--accent); stroke-opacity: 0.7; stroke-width: 1.2; }
.bell-shine { fill: none; stroke: #eef1f8; stroke-width: 2.6; stroke-linecap: round; opacity: 0.45; }
.bell-clapper { fill: #3a4a68; stroke: var(--accent); stroke-opacity: 0.5; }
.bell-swing { transform-origin: 70px 30px; }
.bell.is-ringing .bell-swing { animation: ring 1.1s var(--ease); }
@keyframes ring { 0% { transform: rotate(0); } 15% { transform: rotate(14deg); } 35% { transform: rotate(-11deg); } 55% { transform: rotate(7deg); } 75% { transform: rotate(-4deg); } 100% { transform: rotate(0); } }
.contact-links { list-style: none; padding: 0; margin: 2rem 0 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.contact-links .pill { text-transform: none; letter-spacing: 0; font-size: 0.95rem; }
.note { display: grid; gap: 1.6rem; padding: clamp(22px, 3vw, 40px); border-radius: var(--radius); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.field label { display: block; font: 500 0.7rem/1 var(--sans); letter-spacing: 0.04em; text-transform: uppercase; color: var(--fg-3); margin-bottom: 0.5rem; }
.field input, .field textarea {
  width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--line-2); border-radius: 0;
  color: var(--fg); font: 400 1.15rem/1.5 var(--sans); padding: 0.5rem 0; resize: vertical; transition: border-color 0.25s;
}
.field input:focus, .field textarea:focus { outline: none; border-bottom-color: var(--fg); }
.field input:focus-visible, .field textarea:focus-visible { box-shadow: 0 1px 0 var(--fg); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; }
.note-actions { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.note-status { margin: 0; font-size: 1rem; color: var(--fg-2); }
.note-status.is-ok { color: var(--green); }
.note-status.is-err { color: var(--infection); }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }

/* ---------- Strawberries (Celeste) ---------- */

.berry {
  position: relative; z-index: 3; display: inline-grid; place-items: center; vertical-align: middle;
  width: 34px; height: 34px; padding: 4px; border: 0; background: none; cursor: pointer;
  filter: drop-shadow(0 0 8px rgba(232, 57, 77, 0.45));
}
.berry[hidden] { display: none; }
.berry svg { width: 100%; height: 100%; }
.berry-gold { filter: drop-shadow(0 0 10px rgba(244, 201, 74, 0.6)); }
html:not(.js) .berry { display: none; }
.berry.is-ghost { opacity: 0.25; filter: grayscale(0.6); cursor: default; }
.berry-map { position: absolute; left: 90.5%; top: 25%; width: 30px; height: 30px; }
.berry-photo { position: relative; }
.berry-on-photo { position: absolute; left: 12%; top: 12%; }
.berry-table { margin-top: 0.6rem; }
.berry-bar { order: -2; width: 30px; height: 30px; margin: 0 0 0.3rem -3px; }
.berry-watch { position: absolute; right: -3px; bottom: -4px; width: 22px; height: 22px; padding: 2px; }
.berry-inline { width: 26px; height: 26px; padding: 2px; margin-left: 0.2rem; }
.berry-bell { margin-bottom: 0.4rem; }
@media (prefers-reduced-motion: no-preference) {
  html:not([data-motion='reduce']) .berry:not(.is-ghost) { animation: bob 2.6s ease-in-out infinite; }
  html:not([data-motion='reduce']) .berry.is-collecting { animation: collect 0.8s var(--ease) forwards; }
  html:not([data-motion='reduce']) .berry-bell:not(.is-ghost) { animation: drop 0.7s var(--ease), bob 2.6s 0.7s ease-in-out infinite; }
}
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes collect { 0% { transform: scale(1); opacity: 1; } 40% { transform: translateY(-26px) scale(1.4); opacity: 1; } 100% { transform: translateY(-40px) scale(0.4); opacity: 0; } }
@keyframes drop { from { transform: translateY(-60px); opacity: 0; } to { transform: none; opacity: 1; } }
.berry-toast {
  position: fixed; left: 50%; bottom: 22px; z-index: 60; transform: translateX(-50%);
  display: flex; align-items: center; gap: 0.7rem; height: 48px; padding: 0 1.2rem 0 0.9rem; border-radius: 999px;
  background: #0b0d16; color: #eef1f8; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
  font: 500 0.78rem/1 var(--sans); letter-spacing: 0.04em; text-transform: uppercase;
}
.berry-toast[hidden] { display: none; }
.berry-toast:not([hidden]) { animation: toastIn 0.6s var(--ease); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 16px); } }
.berry-toast-icon svg { width: 20px; height: 22px; }

/* ---------- Footer ---------- */

.site-foot { position: relative; background: #05070d; color: var(--fg-2); padding: clamp(70px, 8vw, 110px) 0 28px; overflow: hidden; box-shadow: 0 -2px 0 #05070d; }
.foot-top { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.6fr); gap: 2rem; }
.foot-top .label { margin-bottom: 0.8rem; }
.foot-top p { margin: 0; color: var(--fg); line-height: 1.5; }
.foot-top a { color: var(--fg); text-decoration: none; background: linear-gradient(currentColor, currentColor) left bottom / 0% 1px no-repeat; transition: background-size 0.4s var(--ease); }
.foot-top a:hover { background-size: 100% 1px; }
.foot-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.2rem; }
.foot-top .foot-note { color: var(--fg-3); font-size: 0.92rem; }
.foot-mark { margin: clamp(4rem, 8vw, 7rem) 0 1.4rem; font: 500 clamp(3rem, 12.6vw, 15.5rem)/0.8 var(--sans); letter-spacing: -0.065em; color: var(--fg); white-space: nowrap; }
.foot-bottom { display: flex; justify-content: space-between; gap: 1rem; padding-top: 1.2rem; border-top: 1px solid var(--line); font-size: 0.88rem; }
.foot-bottom p { margin: 0; }
.foot-top-link { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--fg); text-decoration: none; }
.foot-top-link svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; transform: rotate(-90deg); transition: transform 0.4s var(--ease); }
.foot-top-link:hover svg { transform: rotate(-90deg) translateX(3px); }
@media (max-width: 860px) { .foot-top { grid-template-columns: 1fr 1fr; } .foot-top .foot-note { grid-column: 1 / -1; } }

/* ---------- Project pages: you land inside the project's box ---------- */

.proj-hero { padding-top: var(--head-h); }
.proj-win {
  display: flex; align-items: flex-end; min-height: calc(100svh - var(--head-h) - 40px); max-height: 980px;
  padding: clamp(24px, 3.4vw, 56px);
}
.proj-art { position: absolute; inset: 0; z-index: -1; }
.proj-art picture, .proj-art img { width: 100%; height: 100%; }
.proj-art img { object-fit: cover; object-position: 50% 40%; }
.proj-art::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(9, 11, 19, 0.25) 0%, rgba(9, 11, 19, 0.5) 45%, rgba(9, 11, 19, 0.9) 100%),
    linear-gradient(90deg, rgba(9, 11, 19, 0.65) 0%, rgba(9, 11, 19, 0) 70%);
}
.proj-hero-inner { width: 100%; }
.back-link { display: inline-flex; align-items: center; gap: 0.55rem; margin-bottom: clamp(2rem, 5vw, 4rem); color: var(--fg-2); text-decoration: none; transition: color 0.25s; }
.back-link svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; transform: rotate(180deg); transition: transform 0.4s var(--ease); }
.back-link:hover { color: var(--fg); }
.back-link:hover svg { transform: rotate(180deg) translateX(3px); }
.proj-kicker { display: flex; align-items: center; gap: 0.6rem; margin: 0 0 1.4rem; color: var(--fg-2); }
.proj-title { max-width: 14ch; }
.proj-lede { margin-top: 1.6rem; max-width: 40ch; }
.proj-art-credit { position: absolute; right: clamp(16px, 2vw, 28px); top: clamp(16px, 2vw, 28px); margin: 0; font-size: 0.64rem; color: var(--fg-2); }
.proj-meta-wrap { margin: clamp(2.5rem, 5vw, 4rem) auto clamp(3rem, 6vw, 5rem); }
.proj-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.proj-meta div { padding: 1.1rem 1.4rem 1.1rem 0; }
.proj-meta div + div { padding-left: 1.4rem; border-left: 1px solid var(--line); }
.proj-meta dd { margin: 0.4rem 0 0; color: var(--fg); font-size: 0.98rem; line-height: 1.45; }
@media (max-width: 700px) { .proj-meta div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); } }
@media (prefers-reduced-motion: no-preference) {
  html:not([data-motion='reduce']) .proj-win { animation: winIn 1.3s var(--ease) both; }
  html:not([data-motion='reduce']) .proj-art img { animation: settle 1.8s var(--ease) both; }
  html:not([data-motion='reduce']) .proj-hero-inner > *:not(.proj-title) { animation: fadeUp 1s var(--ease) both 0.3s; }
}
@keyframes settle { from { transform: scale(1.12); } }

/* Other sub pages */
.page-head { padding: calc(var(--head-h) + clamp(60px, 9vw, 140px)) 0 clamp(50px, 6vw, 90px); }
.page-kicker { margin-bottom: 1.6rem; }
.page-title { font: 400 clamp(2.8rem, 7.4vw, 7.6rem)/0.92 var(--sans); letter-spacing: -0.055em; max-width: 15ch; }
.page-lede { margin-top: 2rem; max-width: 46ch; }
.page-body { padding-bottom: clamp(100px, 12vw, 180px); }

.prose { max-width: 70ch; font-size: 1.14rem; line-height: 1.72; color: var(--fg-2); }
.prose > * + h2 { margin-top: 2.6em; }
.prose h2 { font: 400 clamp(1.6rem, 2.6vw, 2.3rem)/1.12 var(--sans); letter-spacing: -0.035em; margin-bottom: 0.7em; scroll-margin-top: calc(var(--head-h) + 20px); }
.prose h3 { font: 500 1.2rem/1.3 var(--sans); letter-spacing: -0.015em; margin: 1.8em 0 0.5em; }
.prose strong { color: var(--fg); font-weight: 500; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.3em; }
.prose li { margin-bottom: 0.45em; }
.prose ul li::marker { color: var(--fg); }
.prose ol li::marker { color: var(--fg); font-variant-numeric: tabular-nums; }
.prose code { font-family: var(--mono); font-size: 0.82em; background: var(--bg-2); padding: 0.12em 0.4em; border-radius: 5px; color: var(--fg); }
.prose pre { background: #0b0d16; color: #dfe5f0; padding: 1.2rem 1.3rem; overflow-x: auto; margin: 1.8rem 0 2.2rem; line-height: 1.55; border-radius: 14px; }
.prose pre code { background: none; padding: 0; font-size: 0.82rem; color: inherit; }
.prose .fig { margin: 2.6rem 0; }
.prose .cite { border-left: 2px solid var(--fg); padding-left: 1rem; font-size: 1.05rem; }
.prose .post-aside { color: var(--fg-3); font-size: 1rem; border-top: 1px solid var(--line); padding-top: 1.2rem; margin-top: 2.6rem; }
.prose table { font-size: 1rem; }
.photo.inset { max-width: 480px; }
@media (min-width: 1100px) { .prose .poster { width: calc(100% + 140px); max-width: none; } }
.post > p:first-child::first-letter { float: left; font: 400 3.8em/0.82 var(--sans); letter-spacing: -0.04em; padding: 0.05em 0.1em 0 0; color: var(--fg); }
.post-tags { margin-top: 3rem; }

/* The way out: next as a big box you dive into, previous as a quiet link */
.onward { margin-top: clamp(5rem, 9vw, 8rem); display: grid; gap: 1.2rem; }
.next-card {
  --rgb: 43, 70, 255;
  position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem;
  min-height: clamp(220px, 26vw, 340px); padding: clamp(22px, 3vw, 40px); border-radius: var(--radius); overflow: hidden; isolation: isolate;
  text-decoration: none; color: var(--fg); background: var(--surface); transition: box-shadow 0.45s var(--ease);
}
.next-card:hover, .next-card:focus-visible { box-shadow: inset 0 0 0 1px rgba(var(--rgb), 0.45), 0 30px 80px -40px rgba(var(--rgb), 0.5); outline: none; }
.next-card:has(.next-art) { background: #0c0f1a; color: #eef1f8; }
.next-card:has(.next-art) .label { color: #b4bccc; }
.next-card:has(.next-art) .card-btn { color: #eef1f8; box-shadow: inset 0 0 0 1px rgba(220, 232, 248, 0.3); }
.next-art { position: absolute; inset: 0; z-index: -1; opacity: 0.55; transition: transform 0.9s var(--ease), opacity 0.4s; }
.next-art picture, .next-art img { width: 100%; height: 100%; }
.next-art img { object-fit: cover; }
.next-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(12, 15, 26, 0.95) 0%, rgba(12, 15, 26, 0.5) 60%, rgba(12, 15, 26, 0.2) 100%); }
.next-card:hover .next-art { transform: scale(1.04); opacity: 0.75; }
.next-title { display: block; margin-top: 0.8rem; font: 400 clamp(2rem, 5vw, 4.4rem)/1 var(--sans); letter-spacing: -0.045em; color: inherit; max-width: 18ch; }
.prev-link { display: inline-flex; align-items: center; gap: 0.55rem; color: var(--fg-3); text-decoration: none; justify-self: start; }
.prev-link svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; transform: rotate(180deg); }
.prev-link:hover { color: var(--fg); }

.index { margin-top: clamp(5rem, 8vw, 7rem); display: grid; gap: clamp(3.5rem, 6vw, 5rem); }
.index-head { display: flex; align-items: center; gap: 0.7rem; margin: 0 0 1.2rem; }
.cards-index { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.year-group + .year-group { margin-top: 4rem; }
.year-head { margin: 0 0 1rem; }

.lost { min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding: calc(var(--head-h) + 40px) 0 80px; }
.lost-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.lost-grid .page-title { margin: 1rem 0 1.6rem; }
.lost-win { padding: clamp(24px, 4vw, 48px); aspect-ratio: 4 / 3; display: grid; place-items: center; }
.lost-scene { width: 100%; max-width: 380px; }
.lost-scene .ground { fill: #05070d; }
.lost-scene .ground-rim { fill: none; stroke: var(--accent); stroke-opacity: 0.3; stroke-width: 1.4; }
.lost-scene .sil { fill: #05070d; }
@media (max-width: 760px) { .lost-grid { grid-template-columns: 1fr; } }

.bot-tread { fill: #10182a; stroke: #eaf0f7; stroke-width: 1.4; stroke-opacity: 0.55; }
.bot-wheel { fill: #0a0f1a; stroke: #eaf0f7; stroke-width: 1.3; stroke-opacity: 0.5; }
.bot-cloak { fill: #1a2438; }
.bot-cloak-fold { fill: none; stroke: #0b1120; stroke-width: 2.4; stroke-linecap: round; opacity: 0.8; }
.bot-cloak-rim { fill: none; stroke: #bcd9ff; stroke-width: 1.8; stroke-opacity: 0.7; stroke-linecap: round; }
.bot-cloak-rim.dim { stroke-opacity: 0.25; }
.bot-face { fill: #eaf0f7; }
.bot-face-shade { fill: #c3cfdf; }
.bot-bolt { fill: #9fb0c6; }
.bot-eye { fill: #05070c; }
.bot-glint { fill: #bcd9ff; }
.bot-eye-closed { fill: none; stroke: #05070c; stroke-width: 2.6; stroke-linecap: round; }
.bot-antenna { fill: none; stroke: #eaf0f7; stroke-width: 2.4; stroke-linecap: round; }
.bot-orb { fill: #fff; }
.bot-orb-glow { fill: #bcd9ff; opacity: 0.25; }
.bot-arm { fill: none; stroke: #9fb0c6; stroke-width: 3.4; stroke-linecap: round; }
.bot-pole { fill: none; stroke: #9fb0c6; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.bot-map { fill: #e3d5b4; stroke: #8a7350; stroke-width: 1.2; }
.bot-map-ink { fill: none; stroke: #a99273; stroke-width: 0.8; }
.bot-map-route { fill: none; stroke: #b5452b; stroke-width: 1.5; stroke-dasharray: 3 2; }
.bot-map-pin { fill: #b5452b; }

/* ---------- The dive ----------
   A dark layer grows out of the box you clicked to fill the screen; the next page fades in from it. */

.dive {
  position: fixed; inset: 0; z-index: 95; pointer-events: none; background: #0c0f1a;
  clip-path: var(--from); transition: clip-path 0.6s var(--ease-io);
}
.dive::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at var(--x) var(--y), rgba(var(--rgb), 0.35), rgba(var(--rgb), 0) 55%); }
.dive.is-open { clip-path: var(--to); }
/* Painted before any script runs, so the new page never flashes. site.js swaps in a real layer
   right away; the delayed fade is only a fallback in case it can't. */
html.arrive body::after {
  content: ''; position: fixed; inset: 0; z-index: 95; pointer-events: none;
  background: radial-gradient(circle at var(--arrive-x, 50%) var(--arrive-y, 50%), rgba(var(--arrive-rgb, 158, 197, 255), 0.35), rgba(var(--arrive-rgb, 158, 197, 255), 0) 55%) #0c0f1a;
  animation: arriveOut 0.6s 1.6s var(--ease) forwards;
}
.dive.is-out { opacity: 0; transition: clip-path 0.6s var(--ease-io), opacity 0.55s var(--ease); }
.dove .proj-win { animation: none !important; }
@keyframes arriveOut { to { opacity: 0; visibility: hidden; } }

/* ---------- Reveals (only when JS is running and motion is allowed) ---------- */

html.js-reveal [data-split] .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.1em; margin-bottom: -0.1em; }
html.js-reveal [data-split] .w > span { display: inline-block; transform: translate3d(0, 108%, 0); transition: transform 1.1s var(--ease) calc(var(--i, 0) * 38ms); }
html.js-reveal [data-split].is-in .w > span { transform: none; }
html.js-reveal [data-split='chars'] .w > span { transition-duration: 1.2s; transition-delay: calc(var(--i, 0) * 32ms); }
html.js-reveal [data-reveal]:not([data-reveal='clip']) { opacity: 0; transform: translate3d(0, 26px, 0); transition: opacity 1s var(--ease) var(--d, 0s), transform 1.1s var(--ease) var(--d, 0s); }
html.js-reveal [data-reveal].is-in:not([data-reveal='clip']) { opacity: 1; transform: none; }
html.js-reveal [data-reveal='clip'] { clip-path: inset(14% 6% 0 6% round var(--radius)); transition: clip-path 1.4s var(--ease); }
html.js-reveal [data-reveal='clip'] img { transform: scale(1.18); transition: transform 1.8s var(--ease); }
html.js-reveal [data-reveal='clip'].is-in { clip-path: inset(0 0 0 0 round var(--radius)); }
html.js-reveal [data-reveal='clip'].is-in img { transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

@media print {
  .site-head, .rail, .hero-win canvas, .site-foot, .note, .berry, .descent { display: none !important; }
  body, .dark { background: #fff !important; color: #111 !important; }
}
