/*
 * ghostline.mackorgames.com
 *
 * The identity is the game's, taken straight from app/ui/theme.js: a near-black
 * world where everything that matters emits light. Nothing here is an image —
 * the hero, the trail, the hazards and the icon are all CSS and inline SVG, for
 * the same reason the game has no sprites.
 *
 * Dark by default with a light theme via [data-theme="light"], following the
 * house one-pager pattern. Unlike the client sites, dark is not merely the
 * default here — it is what the product looks like, so the light theme is a
 * courtesy rather than a peer.
 */

:root {
  /* Straight from the game. Do not drift these independently. */
  --void: #07080C;
  --deep: #0B0E15;
  --surface: #12161F;
  --raised: #1A2029;

  --player: #7FE7DC;
  --hazard: #FF6B35;
  --terrain: #2B3644;
  --terrain-edge: #495B70;
  --goal: #C8F464;

  --text: #EAF2F5;
  --muted: #94A3AF;
  --dim: #5C6873;

  --line: rgba(180, 200, 220, 0.10);
  --line-strong: rgba(180, 200, 220, 0.22);

  --bg: var(--void);
  --panel: var(--deep);

  --wrap: 1080px;
  --radius: 14px;
  --radius-lg: 22px;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

[data-theme="light"] {
  --bg: #F4F6F8;
  --panel: #FFFFFF;
  --surface: #FFFFFF;
  --raised: #EDF1F4;
  --text: #10151B;
  --muted: #4A5866;
  --dim: #78889A;
  --line: rgba(16, 21, 27, 0.10);
  --line-strong: rgba(16, 21, 27, 0.20);
  --terrain: #C2CEDA;
  --terrain-edge: #8DA0B4;
  --player: #128577;
  --goal: #6E8F14;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: min(var(--wrap), calc(100% - 40px)); margin-inline: auto; }

a { color: var(--player); text-decoration: none; }
a:hover { text-decoration: underline; }

.skip {
  position: absolute; left: -9999px;
  background: var(--player); color: var(--void);
  padding: 10px 16px; border-radius: 0 0 8px 0; font-weight: 700;
}
.skip:focus { left: 0; top: 0; z-index: 100; }

:focus-visible { outline: 2px solid var(--player); outline-offset: 3px; border-radius: 4px; }

/* ── Header ───────────────────────────────────────────────────────────── */

.header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.nav { display: flex; align-items: center; gap: 20px; height: 62px; }

.brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--text); font-weight: 800; letter-spacing: 3px; font-size: 15px;
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand svg { display: block; }

.nav-links { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.nav-links a { color: var(--muted); font-size: 14px; font-weight: 600; }
.nav-links a:hover { color: var(--text); text-decoration: none; }

.theme-toggle {
  background: transparent; border: 1px solid var(--line-strong);
  color: var(--muted); border-radius: 999px; width: 34px; height: 34px;
  cursor: pointer; display: grid; place-items: center; font-size: 14px;
}
.theme-toggle:hover { color: var(--text); border-color: var(--player); }

.menu-btn { display: none; background: none; border: 0; color: var(--text); font-size: 22px; cursor: pointer; }

@media (max-width: 760px) {
  .menu-btn { display: block; margin-left: auto; }
  .nav-links {
    position: absolute; inset: 62px 0 auto 0;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: var(--panel); border-bottom: 1px solid var(--line);
    padding: 8px 20px 16px; margin-left: 0;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 10px 0; width: 100%; }
}

/* ── Hero ─────────────────────────────────────────────────────────────── */

.hero { padding: 88px 0 64px; position: relative; overflow: hidden; }

.eyebrow {
  font-size: 12px; letter-spacing: 3px; text-transform: uppercase;
  color: var(--player); font-weight: 800; margin: 0 0 18px;
}

h1 {
  font-size: clamp(42px, 8vw, 86px);
  line-height: 0.98; letter-spacing: -1px; margin: 0 0 22px; font-weight: 800;
}

.lede { font-size: clamp(17px, 2.2vw, 21px); color: var(--muted); max-width: 56ch; margin: 0 0 14px; }
.lede strong { color: var(--text); font-weight: 700; }

/*
 * The hero figure: a course cross-section with a trail running through it.
 * It is the game's own visual language — glowing line, dark terrain, orange
 * hazards — so the site and the first screenshot agree with each other.
 */
.stage {
  margin: 40px 0 0; border-radius: var(--radius-lg);
  border: 1px solid var(--line); background: var(--deep);
  overflow: hidden; position: relative;
}
[data-theme="light"] .stage { background: #0B0E15; }
.stage svg { display: block; width: 100%; height: auto; }

.trail-run {
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
  animation: draw 4.5s ease-in-out infinite;
}
@keyframes draw {
  0%   { stroke-dashoffset: 1400; }
  55%  { stroke-dashoffset: 0; }
  85%  { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}

/*
 * Reduced motion has to draw the finished line, not a faster version of the
 * animation. The global rule above collapses every animation to 0.001ms, which
 * for this one means it completes instantly and then — with no fill-mode —
 * snaps back to a dash offset of 1400, i.e. fully hidden. The route simply
 * disappears, which is the one part of the picture worth seeing.
 */
@media (prefers-reduced-motion: reduce) {
  .trail-run { animation: none; stroke-dashoffset: 0; opacity: 0.9; }
}

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; align-items: center; }

.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 14px 24px; border-radius: var(--radius);
  font-weight: 800; font-size: 14px; letter-spacing: 1.5px;
  background: var(--player); color: var(--void); border: 1px solid transparent;
}
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn.ghost:hover { border-color: var(--player); }
.btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }

.note { font-size: 13px; color: var(--dim); margin-top: 12px; }

/* ── Sections ─────────────────────────────────────────────────────────── */

section { padding: 72px 0; border-top: 1px solid var(--line); }
section:first-of-type { border-top: 0; }

h2 { font-size: clamp(26px, 4vw, 38px); letter-spacing: -0.5px; margin: 0 0 14px; font-weight: 800; }
h3 { font-size: 18px; margin: 0 0 8px; font-weight: 700; }
p { margin: 0 0 16px; }
.section-lede { color: var(--muted); max-width: 62ch; font-size: 17px; }

.grid { display: grid; gap: 16px; margin-top: 34px; }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px;
}
.card .glyph {
  width: 40px; height: 40px; border-radius: 11px;
  display: grid; place-items: center; margin-bottom: 16px;
  background: color-mix(in srgb, var(--player) 14%, transparent);
  color: var(--player);
}
.card p { color: var(--muted); margin: 0; font-size: 15px; }
.card.hazard .glyph { background: color-mix(in srgb, var(--hazard) 16%, transparent); color: var(--hazard); }

/* A pull-quote for the one claim worth making loudly. */
.claim {
  border-left: 3px solid var(--player);
  padding: 6px 0 6px 22px; margin: 30px 0;
  font-size: clamp(18px, 2.6vw, 24px); line-height: 1.45; color: var(--text);
}

.mono { font-family: var(--mono); }
.kbd {
  font-family: var(--mono); font-size: 13px;
  background: var(--raised); border: 1px solid var(--line-strong);
  border-radius: 6px; padding: 2px 7px; color: var(--text);
}

/* ── Prose pages (privacy / terms / support) ──────────────────────────── */

.doc { padding: 56px 0 80px; }
.doc h1 { font-size: clamp(30px, 5vw, 44px); margin-bottom: 10px; }
.doc .updated { color: var(--dim); font-size: 14px; margin-bottom: 40px; }
.doc h2 { font-size: 22px; margin: 40px 0 12px; }
.doc h3 { font-size: 17px; margin: 26px 0 8px; }
.doc p, .doc li { color: var(--muted); max-width: 72ch; }
.doc strong { color: var(--text); }
.doc ul, .doc ol { padding-left: 22px; }
.doc li { margin-bottom: 8px; }

.doc table { border-collapse: collapse; width: 100%; margin: 18px 0 26px; font-size: 15px; }
.doc th, .doc td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc th { color: var(--text); font-weight: 700; font-size: 13px; letter-spacing: 1px; text-transform: uppercase; }
.doc td { color: var(--muted); }
.table-scroll { overflow-x: auto; }

.callout {
  background: var(--panel); border: 1px solid var(--line);
  border-left: 3px solid var(--player);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 18px 22px; margin: 26px 0;
}
.callout p:last-child { margin-bottom: 0; }

details {
  border-bottom: 1px solid var(--line); padding: 16px 0;
}
details summary {
  cursor: pointer; font-weight: 700; color: var(--text);
  list-style: none; display: flex; justify-content: space-between; gap: 16px;
}
details summary::-webkit-details-marker { display: none; }
details summary::after { content: '+'; color: var(--player); font-size: 20px; line-height: 1; }
details[open] summary::after { content: '−'; }
details .body { padding-top: 12px; color: var(--muted); }
details .body p:last-child { margin-bottom: 0; }

/* ── Footer ───────────────────────────────────────────────────────────── */

.footer { border-top: 1px solid var(--line); padding: 44px 0 60px; color: var(--dim); font-size: 14px; }
.footer-row { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: flex-start; }
.footer a { color: var(--muted); }
.footer a:hover { color: var(--text); }
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; }

/* Fade-in on scroll, applied by js/main.js. */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
