:root {
  --bg: #05060d;
  --panel: #0c0f1d;
  --line: #1d2340;
  --text: #e7ebf7;
  --muted: #8d95b3;
  --accent: #7cd4ff;
  --warm: #ffc466;
  --hot: #ff5fc8;
  --radius: 10px;
  /* A faint grain for the cards' shades alone, where a long dark ramp
     over a picture would band in eight bits a channel; nowhere else. */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 1.4 -0.45'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.045'/%3E%3C/svg%3E");
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
h1, h2, h3, .brand { font-family: "Trebuchet MS", system-ui, sans-serif; letter-spacing: 0.02em; }
/* Lines of a heading even, never one word left alone on the last. */
h1, h2, h3 { text-wrap: balance; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.2rem); margin: 0 0 0.6em; }
.muted { color: var(--muted); }

.top {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(16px, 4vw, 40px);
  padding-bottom: 34px;
  background: linear-gradient(to bottom, rgba(2, 3, 7, 0.98) 0%, rgba(2, 3, 7, 0.9) 45%, rgba(2, 3, 7, 0.55) 75%, rgba(2, 3, 7, 0));
  /* The shadow's tail reaches over the page; clicks fall through it. */
  pointer-events: none;
}
.top > * { pointer-events: auto; }
.brand { display: block; line-height: 0; }
/* The wordmark (docs/brand), the intro's strokes. */
.brand img { display: block; height: clamp(20px, 3.2vw, 28px); width: auto; }
.top nav { display: flex; gap: clamp(10px, 2.5vw, 28px); align-items: center; }
.top nav a { color: var(--text); text-decoration: none; font-size: 0.95rem; }
.top nav a.cta { border: 1px solid var(--accent); padding: 6px 14px; border-radius: 999px; color: var(--accent); }
@media (max-width: 640px) { .top nav a:not(.cta) { display: none; } }

/* Every section but the footer wears a replay of its own (app.js
   backdrops): the video is fixed to the viewport and the section's clip-path
   shows only its own stretch of it, so scrolling slides each section over a
   still sky. */
.hero, .band { position: relative; clip-path: inset(0); isolation: isolate; }
video.bg {
  position: fixed; inset: 0; width: 100vw; height: 100vh; object-fit: cover; z-index: -2;
  background: radial-gradient(ellipse at 60% 40%, #1b2350 0%, #090b18 55%, var(--bg) 100%);
}
.bg-shade { position: absolute; inset: 0; z-index: -1; background: rgba(5, 6, 13, 0.74); }
.hero { min-height: 100svh; display: flex; align-items: flex-end; }
.hero .bg-shade { background: linear-gradient(to top, var(--bg) 4%, rgba(5, 6, 13, 0.86) 14%, rgba(5, 6, 13, 0.62) 26%, rgba(5, 6, 13, 0.42) 38%, rgba(5, 6, 13, 0.3) 50%, rgba(5, 6, 13, 0.27) 62%, rgba(5, 6, 13, 0.36) 80%, rgba(5, 6, 13, 0.5)); }
.hero-text { position: relative; padding: 0 clamp(16px, 6vw, 80px) clamp(48px, 10vh, 110px); max-width: 860px; }
.hero h1 { font-size: clamp(2.3rem, 7vw, 4.6rem); line-height: 1.04; margin: 0 0 0.35em; text-shadow: 0 2px 30px rgba(0, 0, 0, 0.6); }
.release { display: inline-block; margin: 0 0 14px; padding: 5px 14px; border-radius: 999px; background: var(--warm); color: #1a1205; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.85rem; }
.lede { font-size: clamp(1.05rem, 2.2vw, 1.3rem); max-width: 40em; }
.live { display: inline-flex; align-items: center; gap: 8px; background: rgba(12, 15, 29, 0.7); border: 1px solid var(--line); padding: 6px 14px; border-radius: 999px; font-size: 0.95rem; }
.live-note { margin: 8px 0 0; font-size: 0.8rem; color: var(--muted); }
.live .dot { width: 9px; height: 9px; border-radius: 50%; background: #5f6; box-shadow: 0 0 10px #5f6; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.button { display: inline-block; padding: 12px 24px; border-radius: 999px; border: 1px solid var(--line); background: rgba(12, 15, 29, 0.7); color: var(--text); text-decoration: none; font-weight: 600; }
.button.primary { background: var(--accent); border-color: var(--accent); color: #031019; }
.button:hover { filter: brightness(1.12); }

/* Every section is at least a screen tall, its content centred in it, so
   each one's sky has the screen to itself as it scrolls by. */
.band { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding: clamp(72px, 11vw, 140px) clamp(16px, 6vw, 80px); }
.band > p { max-width: 46em; }
/* Text over a busy film (the shipyard's) sits on a pane of its own. */
.narrow { max-width: 40em; padding: clamp(20px, 3vw, 34px); border-radius: 16px; background: rgba(5, 6, 13, 0.72); border: 1px solid rgba(124, 212, 255, 0.16); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.narrow h2 { margin-top: 0; }
.narrow p:last-child { margin-bottom: 0; }
/* The section's shade, darker at the top and the bottom so one section's
   sky fades into the dark before the next one's begins. One gradient, not
   a fade stacked on a shade: each layer rounds to eight bits on its own, and
   a dark ramp has few enough steps already. The ends ease in and out
   (smoothstep, eight stops) so no edge of the ramp shows as a line. */
.band .bg-shade {
  --fade: clamp(90px, 22vh, 240px);
  /* How dark the middle is; a section over a film it wants seen sets less. */
  --shade: 0.74;
  background: linear-gradient(to bottom,
    rgba(5, 6, 13, calc(1 - (1 - var(--shade)) * 0.000)) calc(var(--fade) * 0),
    rgba(5, 6, 13, calc(1 - (1 - var(--shade)) * 0.043)) calc(var(--fade) * 0.125),
    rgba(5, 6, 13, calc(1 - (1 - var(--shade)) * 0.156)) calc(var(--fade) * 0.25),
    rgba(5, 6, 13, calc(1 - (1 - var(--shade)) * 0.316)) calc(var(--fade) * 0.375),
    rgba(5, 6, 13, calc(1 - (1 - var(--shade)) * 0.500)) calc(var(--fade) * 0.5),
    rgba(5, 6, 13, calc(1 - (1 - var(--shade)) * 0.684)) calc(var(--fade) * 0.625),
    rgba(5, 6, 13, calc(1 - (1 - var(--shade)) * 0.844)) calc(var(--fade) * 0.75),
    rgba(5, 6, 13, calc(1 - (1 - var(--shade)) * 0.957)) calc(var(--fade) * 0.875),
    rgba(5, 6, 13, calc(1 - (1 - var(--shade)) * 1.000)) calc(var(--fade) * 1),
    rgba(5, 6, 13, calc(1 - (1 - var(--shade)) * 1.000)) calc(100% - var(--fade) * 1),
    rgba(5, 6, 13, calc(1 - (1 - var(--shade)) * 0.957)) calc(100% - var(--fade) * 0.875),
    rgba(5, 6, 13, calc(1 - (1 - var(--shade)) * 0.844)) calc(100% - var(--fade) * 0.75),
    rgba(5, 6, 13, calc(1 - (1 - var(--shade)) * 0.684)) calc(100% - var(--fade) * 0.625),
    rgba(5, 6, 13, calc(1 - (1 - var(--shade)) * 0.500)) calc(100% - var(--fade) * 0.5),
    rgba(5, 6, 13, calc(1 - (1 - var(--shade)) * 0.316)) calc(100% - var(--fade) * 0.375),
    rgba(5, 6, 13, calc(1 - (1 - var(--shade)) * 0.156)) calc(100% - var(--fade) * 0.25),
    rgba(5, 6, 13, calc(1 - (1 - var(--shade)) * 0.043)) calc(100% - var(--fade) * 0.125),
    rgba(5, 6, 13, calc(1 - (1 - var(--shade)) * 0.000)) calc(100% - var(--fade) * 0));
}
.band.center { align-items: center; text-align: center; }

/* The modes: a bento of glass cards, the crown room the big one. */
.modes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-flow: row dense; gap: 14px; }
.modes article {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 6px;
  padding: 20px 22px; border-radius: 14px;
  background: linear-gradient(160deg, rgba(22, 28, 54, 0.72), rgba(8, 10, 22, 0.62));
  isolation: isolate;
  border: 1px solid rgba(124, 212, 255, 0.14);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 12px 32px rgba(0, 0, 0, 0.35);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.modes article::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--warm), transparent); opacity: 0.55;
}
.modes article:hover { transform: translateY(-3px); border-color: rgba(124, 212, 255, 0.4); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 18px 40px rgba(0, 0, 0, 0.45), 0 0 24px rgba(124, 212, 255, 0.12); }
.modes .wide { grid-column: span 2; }
/* A card with its mode's still (app.js modeShots, tools/modeshots.sh): the
   picture under a shade that is darkest where the words are, eased over
   many stops (a two-stop ramp shows its steps) and faintly grained; the
   picture eases in a little on hover. */
.modes article.shot::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--grain), linear-gradient(to top, rgba(6, 8, 18, 0.94) 0%, rgba(6, 8, 18, 0.9) 12%, rgba(6, 8, 18, 0.8) 24%, rgba(6, 8, 18, 0.66) 36%, rgba(6, 8, 18, 0.53) 48%, rgba(6, 8, 18, 0.43) 60%, rgba(6, 8, 18, 0.36) 74%, rgba(6, 8, 18, 0.32) 88%, rgba(6, 8, 18, 0.3)), var(--shot) center / cover no-repeat;
  transition: transform 0.6s ease;
}
.modes article.shot { justify-content: flex-end; min-height: 190px; }
.modes article.shot:hover::after { transform: scale(1.04); }
.tags { display: flex; gap: 6px; align-self: flex-start; }
.modes .feature {
  grid-column: span 2; grid-row: span 2; justify-content: flex-end; padding: 28px 30px;
  background: radial-gradient(ellipse at 80% 10%, rgba(255, 196, 102, 0.22), rgba(255, 196, 102, 0.15) 15%, rgba(255, 196, 102, 0.08) 32%, rgba(255, 196, 102, 0.03) 48%, transparent 62%), linear-gradient(160deg, rgba(36, 28, 58, 0.78), rgba(8, 10, 22, 0.66));
  border-color: rgba(255, 196, 102, 0.3);
}
.modes .feature h3 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
.modes .feature p { font-size: 1.05rem; max-width: 30em; }
.modes h3 { margin: 0; color: var(--warm); font-size: 1.15rem; }
.modes p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.tag { align-self: flex-start; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); background: rgba(124, 212, 255, 0.1); border: 1px solid rgba(124, 212, 255, 0.25); padding: 2px 9px; border-radius: 999px; }
.tag.team { color: var(--hot); background: rgba(255, 95, 200, 0.1); border-color: rgba(255, 95, 200, 0.3); }
@media (max-width: 900px) { .modes { grid-template-columns: repeat(2, minmax(0, 1fr)); } .modes .wide { grid-column: span 1; } }
@media (max-width: 560px) { .modes { grid-template-columns: 1fr; } .modes .feature, .modes .wide { grid-column: auto; grid-row: auto; } }

/* The ladder: the words on the left, the twenty ranks' emblems loose over
   the whole section around them (app.js ranks), each bobbing on a clock of
   its own. The emblems are rendered over black (tools/emblems.sh) and
   screened onto the section's sky, so a video may move itself but nothing
   between it and the section may be a stacking context of its own. */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 72px); align-items: center; }
.split h2 { max-width: 14em; }
.split p { max-width: 34em; }
.watch { display: flex; align-items: center; gap: 12px; width: fit-content; max-width: 100%; margin-top: 10px; padding: 10px 18px; border-radius: 14px; background: rgba(12, 15, 29, 0.7); border: 1px solid rgba(255, 95, 200, 0.35); }
.watch::before { content: ""; width: 9px; height: 9px; flex: none; border-radius: 50%; background: var(--hot); box-shadow: 0 0 10px var(--hot); animation: pulse 1.6s ease-in-out infinite; }
.watch .now { display: block; color: #fff; }
.watch .how { display: block; color: var(--warm); font-weight: 700; }
#ladder .split { position: relative; z-index: 1; grid-template-columns: minmax(0, 34em); }
.ranks-sky { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.ranks-sky video {
  position: absolute; display: block; aspect-ratio: 1; mix-blend-mode: screen;
  -webkit-mask-image: radial-gradient(closest-side, #000 82%, transparent); mask-image: radial-gradient(closest-side, #000 82%, transparent);
  opacity: 0; transition: opacity 1.2s ease; transition-delay: var(--delay, 0s);
  animation: float var(--period, 9s) ease-in-out infinite; animation-delay: var(--phase, 0s);
}
.ranks-sky.on video { opacity: 1; }
@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(var(--dx), calc(var(--dy) * -1)); }
  50% { transform: translate(0, var(--dy)); }
  75% { transform: translate(calc(var(--dx) * -1), 0); }
}
@keyframes pulse { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .ranks-sky video, .watch::before { animation: none; } .ranks-sky video { transition: none; } }
@media (max-width: 800px) { .split { grid-template-columns: 1fr; } }

#ships .bg-shade { --shade: 0.4; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 14px; margin-top: 18px; max-width: 46em; }
.gallery figure { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; text-align: center; }
.gallery canvas { width: 100%; aspect-ratio: 1; image-rendering: pixelated; }
.gallery figcaption { font-size: 0.85rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.downloads { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 220px)); justify-content: center; gap: 14px; width: 100%; margin-bottom: 18px; }
.center .platform { align-items: center; }
.platform { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.15rem; }
.platform span { font-weight: 400; color: var(--muted); font-size: 0.9rem; }
.platform.mine { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.platform[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }

body.phone .desktop-only { display: none; }

footer { padding: 36px clamp(16px, 6vw, 80px); text-align: center; }
footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; margin-bottom: 8px; }

/* Text pages: terms, privacy, support, pairing */
.page { max-width: 760px; margin: 0 auto; padding: 96px 16px 64px; }
.page h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); margin-top: 0; }
.page h2 { font-size: 1.3rem; margin-top: 1.8em; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin: 20px 0; }
.price { font-size: 2rem; font-weight: 800; color: var(--warm); }
.choice { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.choice label { border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; cursor: pointer; }
.choice input { margin-right: 6px; }
.waiver { display: flex; gap: 12px; align-items: flex-start; margin: 18px 0; }
.waiver input { margin-top: 5px; width: 18px; height: 18px; flex: none; }
button.button { font: inherit; cursor: pointer; }
button.button:disabled { opacity: 0.45; cursor: not-allowed; }
.code { font: 700 clamp(1.8rem, 8vw, 2.8rem) ui-monospace, monospace; letter-spacing: 0.15em; color: var(--warm); word-break: break-all; }
.notice { border-left: 3px solid var(--warm); padding: 8px 14px; background: rgba(255, 196, 102, 0.06); }
