/* Tokens from the game's UI kit (planet-mining docs/design/ui-kit/kit.html, ADR 0051). */
@font-face { font-family: 'Sora'; src: url('/fonts/Sora-Variable.ttf') format('truetype'); font-weight: 100 800; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('/fonts/JetBrainsMono-Variable.ttf') format('truetype'); font-weight: 100 800; font-display: swap; }

:root {
  --font-ui: 'Sora', system-ui, sans-serif; --font-num: 'JetBrains Mono', ui-monospace, monospace;
  --glass: rgba(14, 20, 32, .58); --glass-solid: rgba(12, 17, 27, .86); --glass-hi: rgba(255, 255, 255, .10);
  --edge: rgba(190, 215, 255, .16); --text: #eef3fb; --dim: #93a1b8; --faint: #5b6880;
  /* the site's accent is equipment yellow, not the UI kit's violet (owner's choice 2026-11-22, planet-mining#939) */
  --accent: #f5b814; --accent-ink: #1a1200;
  --heat: #ff6b3d; --warn: #ffc94d; --ok: #4fe3a0; --value: #5ee6ff;
  --equipment: #f5b814;
  --space: #07050c;
  --blur: 14px;
  --radius: 14px;
  --pad: clamp(18px, 4vw, 44px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--space); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; color: var(--text); background: var(--space);
  font-family: var(--font-ui); font-size: 17px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: inherit; }
h1, h2 { margin: 0 0 .4em; font-weight: 750; letter-spacing: -.01em; line-height: 1.08; }
h2 { font-size: clamp(28px, 3.6vw, 46px); }
p { margin: 0 0 .8em; color: var(--dim); }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }

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

/* ---------- the world behind ---------- */
#world { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100lvh; display: block; z-index: 0; touch-action: pan-y; }
#veil { position: fixed; inset: 0; z-index: 1; pointer-events: none; background: #000; opacity: 0; }
#labels { position: fixed; inset: 0; z-index: 2; pointer-events: none; }
.pin-label {
  position: absolute; left: 0; top: 0; transform: translate(-50%, -140%);
  font: 700 12px/1 var(--font-num); padding: 4px 7px; border-radius: 999px;
  background: var(--glass-solid); border: 1.5px solid var(--c); color: var(--text);
  white-space: nowrap; opacity: 0; transition: opacity .3s;
}
.pin-label::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); margin-right: 6px; vertical-align: 0; }
.ore-label {
  position: absolute; left: 0; top: 0; transform: translate(-50%, -150%);
  font: 700 11px/1 var(--font-ui); letter-spacing: .08em; padding: 4px 8px; border-radius: 6px;
  background: var(--glass-solid); border: 1px solid var(--edge); color: var(--text); opacity: 0; transition: opacity .35s;
}
.ore-label.valuable { border-color: var(--value); color: var(--value); }
.ore-label::after { content: ''; position: absolute; left: 50%; top: 100%; width: 1px; height: 10px; background: currentColor; opacity: .6; }

/* ---------- top bar ---------- */
.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px var(--pad); pointer-events: none;
}
.top > * { pointer-events: auto; }
.wordmark { font-weight: 800; letter-spacing: .14em; font-size: 15px; text-decoration: none; text-shadow: 0 1px 10px rgba(0,0,0,.6); }
.top-actions { display: flex; gap: 10px; align-items: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 650 14px var(--font-ui); text-decoration: none; cursor: pointer;
  padding: 10px 16px; border-radius: 10px; border: 1px solid transparent;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-1px) scale(1.02); }
.btn:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { background: var(--glass); border-color: var(--edge); color: var(--text); backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur)); }
.btn-ghost:hover { border-color: var(--accent); }
.btn-big { font-size: 16px; padding: 14px 22px; border-radius: 12px; }
.btn[hidden] { display: none; }

.glass {
  background: var(--glass); border: 1px solid var(--edge); border-radius: var(--radius);
  backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur));
  box-shadow: 0 18px 50px rgba(0,0,0,.35), inset 0 1px 0 var(--glass-hi);
}

/* ---------- HUD ---------- */
.hud {
  position: fixed; right: var(--pad); top: 50%; transform: translateY(-50%); z-index: 10;
  display: flex; flex-direction: column; gap: 10px; width: 128px; pointer-events: none;
  opacity: 0; transition: opacity .5s;
}
.hud.on { opacity: 1; }
.hud-plate { padding: 12px 14px; }
.hud-label { font: 700 10px var(--font-ui); letter-spacing: .14em; color: var(--dim); display: flex; gap: 6px; align-items: center; }
.hud-depth { font: 700 30px/1.1 var(--font-num); margin-top: 2px; }
.hud-depth .unit { font-size: 14px; color: var(--dim); margin-left: 3px; }
.hud-layer { font: 700 10px var(--font-ui); letter-spacing: .14em; color: var(--dim); margin: 2px 0 10px; }
.hud-gauge { position: relative; height: 160px; width: 6px; border-radius: 3px; overflow: hidden;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,.18) 0 1px, transparent 1px 16px), rgba(255,255,255,.06); }
.hud-gauge-fill { position: absolute; left: 0; right: 0; top: 0; height: 0; background: var(--text); border-radius: 3px; }
/* below layer 1 the gauge turns to noise: the site does not tell what is there */
.hud-gauge::after { content: ''; position: absolute; left: 0; right: 0; top: 46%; bottom: 0;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,.22) 0 2px, transparent 2px 5px, rgba(255,255,255,.08) 5px 6px, transparent 6px 11px);
  animation: static 0.35s steps(3) infinite; opacity: .55; }
@keyframes static { 0% { background-position: 0 0; } 50% { background-position: 0 7px; } 100% { background-position: 0 3px; } }
.hud.lost .hud-depth .num { animation: flicker .18s steps(2) infinite; color: var(--heat); }
.hud.lost .hud-layer { color: var(--heat); }
@keyframes flicker { 50% { opacity: .35; } }
.heat-icon { width: 9px; height: 11px; background: var(--heat); clip-path: polygon(50% 0, 100% 60%, 80% 100%, 20% 100%, 0 60%); }
.hud-bar { height: 6px; border-radius: 3px; background: rgba(255,255,255,.08); margin-top: 8px; overflow: hidden; }
.hud-bar-fill { height: 100%; width: 0; background: var(--heat); border-radius: 3px; }
.hud.lost .hud-bar-fill { animation: flicker .22s steps(2) infinite; }

/* ---------- story sections ---------- */
main { position: relative; z-index: 5; pointer-events: none; }
.story { position: relative; min-height: 150vh; padding: 30vh var(--pad) 0; display: flex; align-items: flex-start; }
.story-right { justify-content: flex-end; }
.story-right .panel { margin-right: 160px; }
.panel { pointer-events: auto; max-width: 440px; padding: 26px 28px; position: sticky; top: 26vh; }
.panel h2 + p, .panel p:last-child { margin-bottom: 0; }
.eyebrow { font: 700 12px var(--font-ui); letter-spacing: .16em; color: var(--accent); margin-bottom: 10px; }
.eyebrow-heat { color: var(--heat); }

.story-hero { min-height: 140vh; padding-top: 0; align-items: center; }
.panel-hero { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; justify-content: center; max-width: 640px; background: none; padding: 0; }
.panel-hero .title { font-size: clamp(44px, min(7.4vw, 10vh), 96px); letter-spacing: .02em; font-weight: 800; text-shadow: 0 4px 40px rgba(0,0,0,.55); }
.lead { font-size: clamp(17px, min(1.6vw, 2.6vh), 21px); color: var(--text); max-width: 40ch; text-shadow: 0 2px 18px rgba(0,0,0,.7); }
.row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.scroll-cue { position: absolute; left: 50%; top: calc(100vh - 64px); transform: translateX(-50%); font: 700 11px var(--font-ui); letter-spacing: .2em; color: var(--dim); }
.scroll-cue::after { content: ''; display: block; width: 1px; height: 26px; margin: 8px auto 0; background: linear-gradient(var(--dim), transparent); animation: cue 1.8s ease-in-out infinite; }
@keyframes cue { 0%, 100% { transform: translateY(0); opacity: .4; } 50% { transform: translateY(6px); opacity: 1; } }




/* crew roles in the player colours */
.crew { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 6px; }
.crew li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text); }
.crew-tag { flex: none; width: 34px; height: 22px; border-radius: 999px; border: 2px solid var(--c); display: grid; place-items: center; font: 700 11px var(--font-num); background: var(--glass-solid); }

/* FAQ */
.story-faq { min-height: 110vh; justify-content: center; padding-top: 14vh; }
.story-faq .panel { position: relative; top: 0; }
.panel-faq { text-align: left; max-width: 720px; padding: 26px 28px; }
.faq details { border-top: 1px solid rgba(255,255,255,.08); padding: 14px 0; }
.faq details:last-child { border-bottom: 1px solid rgba(255,255,255,.08); }
.faq summary { cursor: pointer; font-weight: 650; color: var(--text); list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--accent); font: 700 18px/1 var(--font-num); }
.faq details[open] summary::after { content: '–'; }
.faq details p { margin: 10px 0 0; }

.story-video { min-height: 130vh; justify-content: center; }
.panel-wide { max-width: 1040px; width: 100%; text-align: center; top: 12vh; }
.video { position: relative; aspect-ratio: 16 / 9; overflow: hidden; margin-top: 18px; padding: 0; }
.video-poster, .video video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.video-poster { opacity: .55; filter: saturate(.9); }
.video-soon { position: absolute; inset: auto 0 0 0; margin: 0; padding: 16px; font: 700 12px var(--font-ui); letter-spacing: .18em; color: var(--text); background: linear-gradient(transparent, rgba(0,0,0,.65)); }

.story-deep { min-height: 190vh; justify-content: center; }
.panel-center { text-align: center; max-width: 620px; margin: 0 auto; }
.panel-center h2 { text-shadow: 0 4px 30px rgba(0,0,0,.8); }
.panel-center p { color: #c3ccdb; }

.story-signup { min-height: 120vh; justify-content: center; padding-top: 18vh; }
.story-signup .panel { position: relative; top: 0; }
.ask { font: 800 clamp(34px, 5.6vw, 72px)/1.05 var(--font-ui); color: var(--text); margin-bottom: 34px; text-shadow: 0 0 40px rgba(255, 107, 61, .35); }
.signup { text-align: left; padding: 26px 28px; display: grid; gap: 4px; }
.signup form { display: grid; gap: 14px; margin-top: 10px; }
.signup .btn-ghost { margin-top: 10px; }
.field { display: grid; gap: 6px; font: 600 13px var(--font-ui); color: var(--dim); }
.field input { font: 500 16px var(--font-ui); color: var(--text); background: rgba(0,0,0,.35); border: 1px solid var(--edge); border-radius: 10px; padding: 12px 14px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--dim); cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--accent); width: 16px; height: 16px; }
.hp { position: absolute; left: -5000px; width: 1px; height: 1px; opacity: 0; }
.form-msg { min-height: 1.4em; margin: 0; font-size: 14px; }
.form-msg.ok { color: var(--ok); }
.form-msg.bad { color: var(--warn); }

.foot { position: relative; z-index: 5; padding: 60px var(--pad) 40px; text-align: center; background: linear-gradient(transparent, #000 40%); font-size: 13px; }
.foot nav { display: flex; gap: 18px; justify-content: center; margin: 10px 0; }
.foot a { color: var(--dim); }
.studio { color: var(--faint); }
.still-note { display: none; }

/* ?bare (captures): only the world */
body.bare main, body.bare .top, body.bare .hud, body.bare .foot, body.bare #labels { display: none; }

/* ---------- still version: no WebGL or reduced motion ---------- */
body.still #world, body.still .hud, body.still #labels { display: none; }
body.still .still-note { display: block; }
body.still .story[data-still] { background: var(--still) center / cover no-repeat; }
body.still .story[data-still]::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(7,5,12,.75), rgba(7,5,12,.25)); }
body.still .panel { position: relative; top: 0; }
body.still .story { min-height: 100vh; padding-top: 18vh; }

@media (max-width: 760px) {
  body { font-size: 16px; }
  .top { padding: 10px 14px; }
  .top-actions .btn-primary { display: none; }
  .hud { right: 10px; width: 92px; top: auto; bottom: 14px; transform: none; }
  .hud-gauge { display: none; }
  .hud-depth { font-size: 22px; }
  .story { padding: 60vh 14px 0; }
  .story-right { justify-content: flex-start; }
  .story-right .panel { margin-right: 0; }
  .panel { top: auto; position: relative; padding: 20px; max-width: calc(100% - 100px); }
  .panel-center, .panel-wide { max-width: 100%; }
  .story-hero { padding-top: 0; }
  .panel-hero { max-width: none; height: 100vh; justify-content: flex-end; margin: 0 -14px; padding: 0 14px 12vh; background: linear-gradient(transparent 35%, rgba(7,5,12,.88) 62%); }
  .scroll-cue { display: none; }
}

/* ---------- privacy / credits pages ---------- */
.doc-main { max-width: 720px; margin: 0 auto; padding: 60px 24px 80px; }
.doc-main h1 { font-size: 36px; margin-top: 1.4em; }
.doc-main h2 { font-size: 20px; margin-top: 1.4em; }
.doc-main li { color: var(--dim); margin-bottom: .6em; }
.doc-main a { color: var(--accent); }

/* tall panels sit higher so they fit a 1366x768 screen */
#crew .panel { top: 12vh; }
#crew h2 { font-size: clamp(26px, 3vw, 38px); }
#crew .panel { max-width: 520px; }
.crew { grid-template-columns: 1fr 1fr; column-gap: 14px; }
.crew li { font-size: 13px; align-items: flex-start; }
@media (max-width: 760px) { .crew { grid-template-columns: 1fr; } #crew .panel { top: auto; } }

.story-tall { min-height: 170vh; }

/* crew: the counter and the roles light up as each member joins the shot */
.crew-count { margin: 14px 0 4px; color: var(--dim); font: 700 12px var(--font-ui); letter-spacing: .12em; text-transform: uppercase; }
.crew-count .num { font-size: 28px; color: var(--text); letter-spacing: 0; }
.crew li { opacity: .35; transition: opacity .35s; }
.crew li.on { opacity: 1; }
body.still .crew li { opacity: 1; }
