/* Exodus, the site at /: the app's own world (DESIGN.md), one dark theme by
   scene (a desk in a dim room). Tokens first, then the parts. */
@font-face { font-family: 'SF Pro Display'; font-weight: 100 900; font-display: swap; src: url(/fonts/SFProDisplay-Variable.woff2) format('woff2'); }
@font-face { font-family: 'Chakra Petch'; font-weight: 700; font-display: swap; src: url(/fonts/ChakraPetch-Bold-wordmark.woff2) format('woff2'); }

:root {
  color-scheme: dark;
  --bg: oklch(0.17 0.006 310);
  --control: oklch(0.295 0.01 310);
  --control-lo: oklch(0.258 0.009 310);
  --line: oklch(0.305 0.01 310);
  --divider: oklch(0.255 0.009 310);
  --control-line: oklch(0.385 0.012 310);
  --text: oklch(0.965 0.004 310);
  --text-2: oklch(0.8 0.01 310);
  --text-3: oklch(0.665 0.012 310);
  --ink: oklch(0.21 0.03 318);
  --accent: oklch(0.82 0.1 322);
  --accent-hi: oklch(0.88 0.08 320);
  --accent-lo: oklch(0.78 0.11 324);
  --accent-border: oklch(0.68 0.11 324);
  --accent-lip: oklch(0.48 0.1 326);
  --accent-text: oklch(0.86 0.085 322);
  --sans: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --wordmark: 'Chakra Petch', var(--sans);
  --gutter: max(24px, env(safe-area-inset-left, 0px));
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
html { font-synthesis: none; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 15px/1.45 var(--sans); letter-spacing: 0.004em;
  overflow-x: hidden;
  caret-color: var(--accent);
}
::selection { background: oklch(0.78 0.11 324 / 0.35); color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 9px; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { color: var(--accent-hi); }
img { max-width: 100%; display: block; }
h1, h2 { margin: 0; text-wrap: balance; }
p { margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--text-3); }
.num { font-variant-numeric: tabular-nums; }

/* The glow under the top band, following the cursor. */
#glow { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.band, main, .foot { position: relative; z-index: 1; }

/* Keycaps: the one control vocabulary. */
.key {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 16px; border-radius: 9px;
  border: 1px solid var(--control-line);
  background: linear-gradient(var(--control), var(--control-lo));
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.08), 0 1px 0 oklch(0.12 0.006 310), 0 6px 14px -8px oklch(0.05 0.01 310);
  color: var(--text); font: 560 13px/1 var(--sans); letter-spacing: 0.004em;
  cursor: pointer; user-select: none; text-decoration: none;
  transition: transform 160ms var(--ease), box-shadow 160ms var(--ease), filter 160ms var(--ease);
}
.key:hover { filter: brightness(1.08); color: var(--text); }
.key:active { transform: translateY(1px); box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.06), 0 0 0 oklch(0.12 0.006 310); }
.key.orchid {
  border-color: var(--accent-border);
  background: linear-gradient(var(--accent-hi), var(--accent-lo));
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.5), 0 1px 0 var(--accent-lip);
  color: var(--ink);
}
.key.orchid:hover { color: var(--ink); filter: brightness(1.04); }

/* Top band. */
.band {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; padding-inline: var(--gutter) max(24px, env(safe-area-inset-right, 0px));
  background: linear-gradient(oklch(0.17 0.006 310 / 0.92), oklch(0.17 0.006 310 / 0.7));
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--divider);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { color: var(--text); }
.wordmark { font: 700 18px/1 var(--wordmark); letter-spacing: 0.04em; }
.wordmark.small { font-size: 14px; }
.links { display: flex; align-items: center; gap: 22px; font: 530 13px/1 var(--sans); }
.links a:not(.key) { color: var(--text-2); }
.links a:not(.key):hover { color: var(--text); }

/* Hero. */
main { max-width: 1280px; margin: 0 auto; padding-inline: var(--gutter) max(24px, env(safe-area-inset-right, 0px)); }
.hero { padding-block: clamp(64px, 10vw, 128px) clamp(28px, 3.5vw, 44px); }
.hero h1 {
  font-size: clamp(40px, 6.2vw, 88px); line-height: 0.98; font-weight: 640; letter-spacing: -0.035em;
  max-width: 13ch;
}
/* The entrance runs once script adds .enter; at rest everything is visible. */
.enter .hero h1 { animation: rise 900ms var(--ease) 80ms backwards; }
.enter .shell { animation: settle 1100ms var(--ease) 360ms backwards; }
.lede p { font-size: 18px; color: var(--text-2); letter-spacing: -0.012em; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* The stage holds the frame in perspective; JS levels it as you scroll. */
.stage { padding-bottom: clamp(56px, 7vw, 96px); display: flex; flex-direction: column; gap: 10px; }
.frame { perspective: 1600px; perspective-origin: 50% 0; }
.shell {
  --tilt: 8deg; --s: 1;
  display: block; width: 100%; height: clamp(520px, 78vh, 760px); border: 1px solid var(--line); border-radius: 16px;
  background: var(--bg); color-scheme: dark;
  box-shadow: 0 1px 0 oklch(1 0 0 / 0.05) inset, 0 40px 80px -30px oklch(0.05 0.01 310), 0 0 0 1px oklch(0.1 0.006 310);
  transform: scale(var(--s)) rotateX(var(--tilt)) translateZ(0);
  transform-origin: 0 0;
  will-change: transform;
}
.enter .shell { animation: settle 1100ms var(--ease) 360ms backwards; }
@keyframes settle { from { opacity: 0; transform: scale(var(--s)) rotateX(16deg) translateY(40px); } to { opacity: 1; transform: scale(var(--s)) rotateX(var(--tilt)); } }

/* Foot. */
.foot {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px 24px;
  max-width: 1280px; margin: 0 auto; padding: clamp(28px, 3.5vw, 40px) var(--gutter) max(clamp(28px, 3.5vw, 40px), env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--divider); color: var(--text-3); font-size: 13px;
}
.foot .muted { text-align: center; }
@media (max-width: 560px) {
  .foot { grid-template-columns: auto 1fr; }
  .foot .links { justify-self: end; }
  .foot .muted { grid-column: 1 / -1; text-align: left; order: 1; }
}

@media (max-width: 900px) {
  /* The desk at its own width, scaled to stay legible (app.js sets --s, never
     under 0.6) and panned inside its frame when it is wider than the screen. */
  .frame { overflow-x: auto; overflow-y: hidden; height: calc(900px * var(--s, 0.6) + 16px); scrollbar-width: thin; scrollbar-color: var(--control-line) transparent; touch-action: pan-x pan-y; }
  .shell { --tilt: 5deg; width: 820px; height: 900px; }
  .hero h1 { max-width: 12ch; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .enter .hero h1, .enter .shell { animation: none; }
  .shell { --tilt: 0deg; transform: none; }
  .pulse::after, }
