/* Thrustline: the game's colours. Space black, the HUD's cyan accent,
   wall blue, and the team reds and blues. Dark always, like the game. */
:root {
  --bg: #04060c;
  --bg-raised: #0a1020;
  --line: #1a2a4a;
  --text: #dfe8f6;
  --muted: #8a9bb8;
  --accent: #59d9ff;
  --accent-ink: #021018;
  --wall: #2f6bff;
  --red: #ff4d5e;
  --green: #45e08a;
  --glow: 0 0 6px rgba(89, 217, 255, 0.55), 0 0 18px rgba(89, 217, 255, 0.25);
  --radius: 4px;
  --gutter: 16px;
  --max: 1160px;
  color-scheme: dark;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }
a:focus-visible,
.button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.skip {
  position: absolute; left: -999px; top: 8px; z-index: 10;
  background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: var(--radius);
}
.skip:focus { left: 8px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* Text drawn with the game's stroke font (see js/vector.js). */
.vector { display: inline-block; vertical-align: middle; overflow: visible; max-width: 100%; height: auto; }
/* Stroke widths are set per drawing in vector.js (data-stroke, in pixels). */
.vector path { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }
.glow .vector { filter: drop-shadow(0 0 3px rgba(89, 217, 255, 0.8)) drop-shadow(0 0 12px rgba(89, 217, 255, 0.35)); }

/* ---- Hero ---------------------------------------------------------- */
.hero {
  position: relative; min-height: clamp(560px, 100svh, 1000px); display: flex; flex-direction: column;
  overflow: hidden; background: #04060c url("/media/loop-poster.jpg") center / cover no-repeat;
  color: #dfe8f6; isolation: isolate;
}
.hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.hero-shade {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse at 50% 45%, rgba(4, 6, 12, 0.25) 0%, rgba(4, 6, 12, 0.7) 60%, rgba(4, 6, 12, 0.95) 100%),
    linear-gradient(to bottom, rgba(4, 6, 12, 0.55), rgba(4, 6, 12, 0.1) 30%, rgba(4, 6, 12, 0.1) 70%, var(--bg));
}

.nav {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  width: 100%; max-width: var(--max); margin: 0 auto; padding: 18px var(--gutter);
}
.nav-home { color: #dfe8f6; display: inline-flex; padding: 6px 0; }
.nav-links { display: flex; gap: 22px; flex-wrap: wrap; justify-content: flex-end; }
.nav-links a { color: #b9c7de; text-decoration: none; font-size: 15px; letter-spacing: 0.04em; }
.nav-links a:hover { color: #59d9ff; }

.hero-body {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 24px var(--gutter) 72px;
}
.logo { margin: 0; color: #59d9ff; line-height: 1; }
.logo .vector { width: min(760px, 88vw); height: auto; filter: drop-shadow(0 0 4px rgba(89, 217, 255, 0.9)) drop-shadow(0 0 22px rgba(89, 217, 255, 0.45)); }
.tagline { max-width: 34em; margin: 28px 0 0; font-size: clamp(17px, 2.2vw, 21px); color: #c9d6ea; text-shadow: 0 1px 12px rgba(0, 0, 0, 0.8); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 32px; }
.hero-meta { margin: 14px 0 0; color: #93a4c2; font-size: 14px; letter-spacing: 0.03em; }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 22px; border-radius: var(--radius);
  border: 1px solid rgba(89, 217, 255, 0.55); color: #dfe8f6; background: rgba(6, 14, 30, 0.55);
  text-decoration: none; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; font-size: 14px;
  transition: background 0.15s, box-shadow 0.15s, transform 0.15s;
  backdrop-filter: blur(4px);
}
.button:hover { background: rgba(89, 217, 255, 0.12); box-shadow: var(--glow); }
.button.primary { background: #59d9ff; color: #021018; border-color: #59d9ff; }
.button.primary:hover { background: #8fe7ff; }
.button small { font-weight: 500; text-transform: none; letter-spacing: 0; opacity: 0.8; }

.live-pill {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 26px; padding: 6px 14px;
  border: 1px solid rgba(69, 224, 138, 0.45); border-radius: 999px; color: #c8f5dc;
  background: rgba(4, 20, 12, 0.55); font-size: 14px; text-decoration: none; backdrop-filter: blur(4px);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: #45e08a; box-shadow: 0 0 8px #45e08a; animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }

/* Strokes draw in, the way the game's menus arrive. */
[data-draw] .vector path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.1s cubic-bezier(0.6, 0, 0.2, 1) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---- Sections ------------------------------------------------------ */
main > section { max-width: var(--max); margin: 0 auto; padding: 88px var(--gutter) 24px; }
/* Pages other than the front: the menu over a plain background. */
body.page main > section:first-child { padding-top: 40px; }
.section-title { margin: 0 0 14px; color: var(--accent); }
.section-title + .mode-grid { margin-top: 26px; }
.section-title .vector { filter: drop-shadow(0 0 3px rgba(89, 217, 255, 0.7)); }
.lede { max-width: 44em; margin: 0 0 36px; color: var(--muted); font-size: 18px; }

.feature-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.feature-grid li { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-raised); }
.feature-grid h3 { margin: 14px 0 6px; font-size: 17px; }
.feature-grid p { margin: 0; color: var(--muted); font-size: 15.5px; }
.icon { width: 40px; height: 40px; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }

.mode-grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.mode { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg-raised); transition: border-color 0.2s, transform 0.2s; }
.mode:hover { border-color: rgba(89, 217, 255, 0.6); transform: translateY(-2px); }
.mode img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; background: #04060c; }
.mode-text { padding: 18px 20px 22px; }
.mode h3 { margin: 0 0 10px; color: var(--text); }
.mode p { margin: 0; color: var(--muted); font-size: 15.5px; }
.mode p + p { margin-top: 10px; }
.mode .maps { font-size: 14px; }
/* The tribute mode spans the row: picture beside the text. */
.mode.wide { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.mode.wide img { height: 100%; }
.mode.wide .mode-text { align-self: center; padding: 24px 28px; }

.live-board { display: grid; gap: 18px; grid-template-columns: repeat(3, 1fr); margin: 10px 0 26px; }
.stat { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-raised); display: flex; flex-direction: column; gap: 4px; }
.stat-value { font-size: clamp(34px, 6vw, 52px); font-weight: 700; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: 14px; letter-spacing: 0.05em; text-transform: uppercase; }
.table-wrap { overflow-x: auto; }
.servers { width: 100%; border-collapse: collapse; font-size: 15.5px; }
.servers th, .servers td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); }
.servers th { color: var(--muted); font-weight: 600; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; }
.servers .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.servers .full { color: var(--red); }
.servers .bots { color: var(--muted); font-size: 13px; }
.live-note { color: var(--muted); font-size: 14px; }

.download-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 22px; }
.platform { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-raised); display: flex; flex-direction: column; gap: 10px; }
.platform.mine { border-color: var(--accent); box-shadow: var(--glow); }
.platform h3 { margin: 0; font-size: 18px; }
.platform p { margin: 0; color: var(--muted); font-size: 15px; flex: 1; }
.platform .button { align-self: flex-start; }
.platform .size { color: var(--muted); font-size: 13px; }
.fine { color: var(--muted); font-size: 14px; max-width: 52em; }
.all-files { margin: 0 0 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-raised); }
.all-files summary { cursor: pointer; padding: 14px 18px; font-weight: 600; }
.all-files summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.files { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.files th, .files td { text-align: left; padding: 10px 18px; border-top: 1px solid var(--line); vertical-align: top; }
.files th { color: var(--muted); font-weight: 600; font-size: 12.5px; letter-spacing: 0.06em; text-transform: uppercase; }
.files .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.files code { font: 12.5px/1.4 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; color: var(--muted); word-break: break-all; }
.files .file { color: var(--muted); word-break: break-all; }

.tribute { text-align: center; }
.tribute .section-title { display: flex; justify-content: center; }
.tribute p { max-width: 38em; margin: 0 auto 14px; color: var(--muted); }
.tribute-lead { font-size: 21px; color: var(--text) !important; }
.tribute-names { display: flex; flex-direction: column; align-items: center; gap: 14px; margin: 22px auto 24px !important; color: var(--accent); }

.footer { max-width: var(--max); margin: 80px auto 0; padding: 32px var(--gutter) 48px; border-top: 1px solid var(--line); color: var(--muted); display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between; font-size: 14px; }
.footer p { margin: 0; }

@media (max-width: 720px) {
  body { font-size: 16px; }
  .nav-links { gap: 14px; }
  .nav-links a { font-size: 14px; }
  .nav-home { display: none; }
  .tagline br { display: none; }
  .nav { justify-content: center; }
  main > section { padding-top: 64px; }
  .live-board { grid-template-columns: 1fr; }
  .mode-grid { grid-template-columns: 1fr; }
  .mode.wide { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-draw] .vector path { animation: none; stroke-dashoffset: 0; }
  .dot { animation: none; }
  .mode, .button { transition: none; }
  .hero-video { display: none; }
}

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.servers td.join { text-align: right; }
.servers td.join a { color: var(--accent); font-weight: 600; text-decoration: none; }
.servers td.join a:hover { text-decoration: underline; }

/* ---- Sign in (a dialog over the front page). */
.nav-sign-in { border: 1px solid rgba(89, 217, 255, 0.55); border-radius: var(--radius); padding: 4px 12px; }
.nav-sign-in.signed-in { border-color: rgba(69, 224, 138, 0.55); color: #c8f5dc; }
dialog.sign-in {
  width: min(480px, calc(100vw - 32px)); padding: 28px; border-radius: var(--radius);
  border: 1px solid rgba(89, 217, 255, 0.35); background: var(--bg-raised); color: var(--text);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), var(--glow);
}
dialog.sign-in::backdrop { background: rgba(2, 4, 10, 0.72); backdrop-filter: blur(3px); }
.sign-in h2 { margin: 0 0 12px; font-size: 22px; letter-spacing: 0.02em; }
.sign-in p { margin: 0 0 14px; color: #b6c4da; line-height: 1.5; }
.sign-in form:not(.sign-in-close) { display: grid; gap: 10px; margin-top: 6px; }
.sign-in label { font-size: 13px; color: #93a4c2; letter-spacing: 0.04em; }
.sign-in input {
  min-height: 46px; padding: 10px 14px; border-radius: var(--radius); font: inherit; font-size: 16px;
  border: 1px solid rgba(89, 217, 255, 0.35); background: #050a16; color: var(--text);
}
.sign-in input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.sign-in-close { position: absolute; top: 10px; right: 12px; }
.sign-in-close button { background: none; border: 0; color: #93a4c2; font-size: 26px; cursor: pointer; line-height: 1; }
.sign-in-code {
  display: grid; gap: 6px; margin: 4px 0 18px; padding: 16px; border-radius: var(--radius);
  border: 1px dashed rgba(89, 217, 255, 0.45); background: rgba(5, 10, 22, 0.8); text-align: center;
}
.sign-in-code span { color: #b6c4da; font-size: 14px; }
.sign-in-code output {
  font: 600 34px/1.2 ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: 0.12em;
  color: var(--accent); text-shadow: 0 0 14px rgba(89, 217, 255, 0.45); user-select: all;
}
.sign-in-code small { color: #93a4c2; }
.sign-in-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.sign-in .link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; }
.sign-in-error { color: #ff8a7a; }
.sign-in-note, .sign-in-local { font-size: 13px; color: #7f8fab !important; margin: 14px 0 0 !important; }
