/* Dunvarra: the game's "Clean Orbital" look on the web.
   Colors from crates/game/src/palette.rs and the HUD (dark glass, teal accent, orange for the one main action). */

@font-face { font-family: "Sora"; src: url("/assets/fonts/Sora-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Sora"; src: url("/assets/fonts/Sora-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("/assets/fonts/Manrope-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("/assets/fonts/Manrope-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Space Mono"; src: url("/assets/fonts/SpaceMono-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Space Mono"; src: url("/assets/fonts/SpaceMono-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  color-scheme: light dark;
  --space-0: #0b1729;
  --space-1: #1d3a5c;
  --glass: rgba(12, 22, 34, 0.86);
  --glass-ink: #e6eef6;
  --glass-muted: #8ea3b6;
  --teal: #2c8e9c;
  --teal-bright: #4cc2cf;
  --orange: #ff7a42;
  --hazard: #ffb21e;

  --bg: #eef1f4;
  --surface: #ffffff;
  --surface-2: #e1e7ec;
  --line: #d2dae1;
  --ink: #13202e;
  --muted: #4d5f70;
  --accent: #1f7480;
  --accent-tint: rgba(44, 142, 156, 0.12);
  --shadow: 0 1px 2px rgba(19, 32, 46, 0.06), 0 8px 24px rgba(19, 32, 46, 0.06);

  --radius: 14px;
  --radius-s: 9px;
  --wrap: 1120px;
  --font-display: "Sora", "Manrope", system-ui, sans-serif;
  --font-ui: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Space Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1729;
    --surface: #12233a;
    --surface-2: #172c46;
    --line: rgba(255, 255, 255, 0.09);
    --ink: #e6eef6;
    --muted: #8ea3b6;
    --accent: #4cc2cf;
    --accent-tint: rgba(76, 194, 207, 0.14);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.25);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.6 var(--font-ui);
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--teal-bright); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 0.6em; }
h1 { font-size: clamp(1.9rem, 4.6vw, 3.1rem); }
h2 { font-size: clamp(1.4rem, 2.8vw, 1.9rem); }
h3 { font-size: 1.08rem; font-weight: 600; letter-spacing: 0; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding-inline: clamp(16px, 4vw, 32px); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }

.label {
  font-family: var(--font-mono); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent);
}

/* Top bar: the HUD's dark glass */
.bar {
  position: sticky; top: 0; z-index: 5;
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  color: var(--glass-ink);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.bar .wrap { display: flex; align-items: center; gap: 12px 20px; min-height: 60px; flex-wrap: wrap; padding-block: 8px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; margin-right: auto; }
.brand img { width: 30px; height: 30px; }
.brand span { font-family: var(--font-display); font-weight: 700; letter-spacing: 0.16em; font-size: 0.98rem; }
.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a {
  color: var(--glass-muted); text-decoration: none; font-weight: 600; font-size: 0.92rem;
  padding: 6px 10px; border-radius: 8px;
}
.nav a:hover { color: var(--glass-ink); background: rgba(255, 255, 255, 0.06); }
.nav a[aria-current="page"] { color: var(--glass-ink); background: rgba(255, 255, 255, 0.08); }
.nav .lang {
  font-family: var(--font-mono); font-size: 0.8rem; font-weight: 700; color: var(--teal-bright);
  border: 1px solid rgba(76, 194, 207, 0.4); margin-left: 4px;
}
.nav .lang:hover { background: rgba(76, 194, 207, 0.14); color: var(--teal-bright); }

/* Hero: always the game's space backdrop */
.hero {
  background: radial-gradient(120% 90% at 80% 0%, var(--space-1) 0%, var(--space-0) 62%);
  color: var(--glass-ink);
  padding-block: clamp(36px, 7vw, 80px) clamp(40px, 7vw, 88px);
  overflow: hidden;
}
.hero .wrap { display: grid; gap: clamp(28px, 4vw, 48px); }
.hero .label { color: var(--teal-bright); }
.hero h1 { margin-top: 10px; max-width: 18ch; }
.hero .lede { font-size: clamp(1.04rem, 1.8vw, 1.18rem); color: #c9d6e2; max-width: 60ch; }
.hero .lede em { color: var(--glass-ink); font-style: normal; font-family: var(--font-mono); font-size: 0.92em; }
.shot {
  margin: 0; border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 0 0 1px rgba(111, 244, 255, 0.18), 0 24px 70px rgba(0, 0, 0, 0.45);
}
.shot img { width: 100%; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 22px; }
.cta {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--orange); color: #1f0d04; font-weight: 700; text-decoration: none;
  padding: 11px 18px; border-radius: 10px;
}
.cta small { font-family: var(--font-mono); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.75; }
.cta[aria-disabled="true"] { cursor: default; }
.chip {
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--glass-muted);
}
.chip b { color: var(--teal-bright); font-weight: 700; }

/* Sections */
section.block { padding-block: clamp(44px, 7vw, 84px); }
section.alt { background: var(--surface-2); }
@media (prefers-color-scheme: dark) { section.alt { background: #0e1d31; } }
.intro { max-width: 62ch; color: var(--muted); margin-bottom: 30px; }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 20px 18px; box-shadow: var(--shadow);
}
.card p { color: var(--muted); margin: 0; }
.card .tick { display: block; width: 26px; height: 4px; border-radius: 2px; background: var(--teal); margin-bottom: 14px; }

.gallery { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); margin-top: 8px; }
.gallery figure { margin: 0; }
.gallery a { display: block; border-radius: var(--radius-s); overflow: hidden; border: 1px solid var(--line); }
.gallery img { aspect-ratio: 16 / 10; object-fit: cover; width: 100%; transition: transform 0.25s ease; }
.gallery a:hover img { transform: scale(1.02); }
.gallery figcaption { font-size: 0.9rem; color: var(--muted); padding-top: 8px; }

.peoples { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.peoples li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 14px 16px; border-top: 4px solid var(--c, var(--teal)); }
.peoples b { display: block; font-family: var(--font-display); font-weight: 600; }
.peoples i { display: block; font-style: normal; font-family: var(--font-mono); font-size: 0.76rem; color: var(--accent); margin-bottom: 6px; }
.peoples span { color: var(--muted); font-size: 0.93rem; }
.note { color: var(--muted); font-size: 0.95rem; margin-top: 18px; }

.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li { display: grid; grid-template-columns: minmax(110px, 170px) 1fr; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 1px solid var(--line); }
.timeline time { font-family: var(--font-mono); font-size: 0.88rem; color: var(--accent); padding-top: 2px; }
.timeline b { font-family: var(--font-display); font-weight: 600; }
.timeline p { margin: 2px 0 0; color: var(--muted); }
@media (max-width: 520px) { .timeline li { grid-template-columns: 1fr; gap: 2px; } }

.split { display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); align-items: start; }
.platforms { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; padding: 0; list-style: none; }
.platforms li { font-family: var(--font-mono); font-size: 0.82rem; padding: 5px 10px; border-radius: 999px; background: var(--accent-tint); color: var(--accent); }

.quote { border-left: 3px solid var(--teal); padding: 4px 0 4px 16px; margin: 26px 0 0; color: var(--muted); }
.quote b { font-family: var(--font-mono); font-size: 0.78rem; color: var(--accent); letter-spacing: 0.06em; }

/* Text pages: legal, support */
.page { padding-block: clamp(36px, 6vw, 64px) clamp(48px, 8vw, 96px); }
.page .wrap { max-width: 820px; }
.page h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); }
.page h2 { font-size: 1.25rem; margin-top: 2em; }
.page h3 { margin-top: 1.4em; }
.page ul { padding-left: 1.2em; }
.page li { margin-bottom: 0.35em; }
.meta { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); }
.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin: 18px 0; }
.box p:last-child { margin-bottom: 0; }
address { font-style: normal; }
dl.facts { display: grid; grid-template-columns: minmax(120px, 220px) 1fr; gap: 0; margin: 0; }
dl.facts dt, dl.facts dd { margin: 0; padding: 10px 0; border-top: 1px solid var(--line); }
dl.facts dt { font-family: var(--font-mono); font-size: 0.82rem; color: var(--accent); padding-right: 14px; padding-top: 12px; }
@media (max-width: 520px) { dl.facts { grid-template-columns: 1fr; } dl.facts dd { border-top: 0; padding-top: 0; } }
details { border-top: 1px solid var(--line); padding: 12px 0; }
details:last-of-type { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; font-weight: 600; }
details p { margin: 8px 0 0; color: var(--muted); }

/* Footer: dark glass again */
.foot { background: var(--space-0); color: var(--glass-muted); font-size: 0.9rem; padding-block: 28px; }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; justify-content: space-between; }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot a { color: var(--glass-ink); text-decoration: none; }
.foot a:hover { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Construction: the start page while the game is not announced yet (components/site/Construction.tsx).
   A 12 s loop: the trolley runs out, lowers the block into the gap, the block sets, the hook goes back. */
.hero.building .wrap { align-items: center; }
@media (min-width: 860px) { .hero.building .wrap { grid-template-columns: 1fr minmax(280px, 440px); } }
.construction { margin: 0; width: 100%; max-width: 440px; justify-self: center; }
.construction svg { width: 100%; height: auto; display: block; overflow: visible; }
.construction .plot { fill: rgba(76, 194, 207, 0.08); stroke: rgba(76, 194, 207, 0.35); stroke-width: 1; }
.construction .plot-line { fill: none; stroke: rgba(76, 194, 207, 0.22); stroke-dasharray: 4 5; }
.construction .cube-t { fill: #3a6f8f; }
.construction .cube-l { fill: #1d3a5c; }
.construction .cube-r { fill: #27506f; }
.construction .cube polygon { stroke: rgba(111, 244, 255, 0.25); stroke-width: 0.8; stroke-linejoin: round; }
.construction .cube-hazard .cube-t { fill: var(--hazard); }
.construction .cube-hazard .cube-l { fill: #c97a0a; }
.construction .cube-hazard .cube-r { fill: #e39410; }
.construction .cube-ghost polygon { fill: rgba(255, 178, 30, 0.06); stroke: var(--hazard); stroke-dasharray: 3 3; }
.construction .mast, .construction .jib, .construction .counter, .construction .cab, .construction .trolley-box { fill: var(--orange); }
.construction .counter { fill: #8ea3b6; }
.construction .cab { fill: #ffd2bd; }
.construction .lattice { stroke: #0b1729; stroke-width: 1.2; opacity: 0.55; }
.construction .tie { fill: none; stroke: #c9d6e2; stroke-width: 1.2; opacity: 0.6; }
.construction .rope { stroke: #c9d6e2; stroke-width: 1.4; }
.construction .beacon { fill: #ff4d3d; }
.construction .barrier rect { fill: #8ea3b6; }
.construction .barrier .stripes { fill: var(--hazard); }
.construction .barrier .stripe { fill: #0b1729; }

.construction .trolley { transform: translateX(268px); animation: sf-trolley 12s ease-in-out infinite; }
.construction .hoist { animation: sf-hoist 12s ease-in-out infinite; }
.construction .rope { transform-box: fill-box; transform-origin: 50% 0; animation: sf-rope 12s ease-in-out infinite; }
.construction .hoist > g { animation: sf-carried 12s linear infinite; }
.construction .placed { opacity: 0; animation: sf-set 12s linear infinite; }
.construction .beacon { animation: sf-blink 1.4s steps(2, jump-none) infinite; }

/* The block's top centre hangs at y 166 and lands at y 252 (86 lower); the rope is 74 long. */
@keyframes sf-trolley { 0%, 8% { transform: translateX(268px); } 28%, 70% { transform: translateX(200px); } 90%, 100% { transform: translateX(268px); } }
@keyframes sf-hoist { 0%, 30% { transform: translateY(0); } 48%, 56% { transform: translateY(86px); } 70%, 100% { transform: translateY(0); } }
@keyframes sf-rope { 0%, 30% { transform: translateY(0) scaleY(1); } 48%, 56% { transform: translateY(-86px) scaleY(2.162); } 70%, 100% { transform: translateY(0) scaleY(1); } }
@keyframes sf-carried { 0%, 52% { opacity: 1; } 53%, 92% { opacity: 0; } 96%, 100% { opacity: 1; } }
@keyframes sf-set { 0%, 52% { opacity: 0; } 53%, 93% { opacity: 1; } 97%, 100% { opacity: 0; } }
@keyframes sf-blink { 0% { opacity: 1; } 100% { opacity: 0.15; } }

@media (prefers-reduced-motion: reduce) {
  .construction .trolley, .construction .hoist, .construction .rope, .construction .hoist > g, .construction .placed, .construction .beacon { animation: none; }
  .construction .trolley { transform: translateX(200px); }
}

/* The footer sits at the bottom of the window on short pages; the construction hero fills the space. */
body { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
body > main { flex: 1 0 auto; display: flex; flex-direction: column; }
body > main > section:only-child { flex: 1 0 auto; }
.hero.building { display: flex; align-items: center; }
