/* Earth's Last Bastion — site theme.
   Tokens come from the "Bastion Theme" design: a near-black world where only
   edges, readouts and threats emit light, and colour means allegiance. */
/* Self-hosted fonts (SIL OFL; latin subset from Google Fonts). Same origin and
   preloaded from the layout, so text is not held back by a third-party CSS hop. */
@font-face { font-family: 'Chakra Petch'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/chakra-petch-400.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Chakra Petch'; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/chakra-petch-600.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Chakra Petch'; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/chakra-petch-700.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/ibm-plex-mono-400.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
:root {
  /* neutrals */
  --void: #05080c;
  --hull: #0b1218;
  --panel: #11191f;
  --gridline: #1a2a38;
  --strut: #273444;
  --regolith: #4a6a85;
  --label: #7b8fa6;
  --text: #9fb3c6;
  --body: #d0dde8;
  --bright: #e8f7ff;
  /* signals — never mix their meanings */
  --cyan: #22e6ff; /* yours: structures, focus, primary action */
  --cyan-hi: #8ff4ff;
  --magenta: #ff2bd6; /* hostile */
  --red: #ff3b4e; /* critical, destructive */
  --amber: #ffb020; /* ore, costs */
  --green: #39ff88; /* shipped, success */
  --display: 'Chakra Petch', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
  --chamfer: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--void);
  background-image: linear-gradient(rgba(15, 30, 42, 0.7) 1px, transparent 1px), linear-gradient(90deg, rgba(15, 30, 42, 0.7) 1px, transparent 1px);
  background-size: 48px 48px;
  color: var(--body);
  font: 400 17px/1.55 var(--display);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--cyan); text-decoration: none; }
a:hover { color: var(--cyan-hi); }

/* ---- nav */
header.nav { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; padding: 18px 28px; border-bottom: 1px solid var(--gridline); background: rgba(5, 8, 12, 0.85); }
.brand { font-weight: 700; font-size: 16px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--body); }
.brand span { color: var(--cyan); }
header.nav nav { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; font-size: 14px; letter-spacing: 0.12em; text-transform: uppercase; }
header.nav nav a { color: var(--text); }
header.nav nav a:hover { color: var(--bright); }
header.nav nav a.boxed { color: var(--cyan); border: 1px solid var(--cyan); padding: 8px 16px; }
header.nav nav a.boxed:hover { background: #0a2a33; }
header.nav form { margin: 0; }

main { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 28px 72px; display: flex; flex-direction: column; gap: 72px; }
main.narrow { max-width: 520px; padding-top: 56px; gap: 28px; }
footer { padding: 22px 28px; border-top: 1px solid var(--gridline); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font: 12px var(--mono); letter-spacing: 0.16em; color: var(--label); text-transform: uppercase; }
footer a { color: var(--label); }
footer a:hover { color: var(--cyan); }

/* ---- type */
.eyebrow { font: 12px var(--mono); letter-spacing: 0.2em; color: var(--cyan); text-transform: uppercase; }
.eyebrow.dim { color: var(--label); }
h1, h2, h3 { margin: 0; text-transform: uppercase; color: var(--bright); }
h1 { font-size: clamp(40px, 5.5vw, 68px); font-weight: 700; line-height: 0.95; letter-spacing: 0.02em; }
h1 span { color: var(--cyan); text-shadow: 0 0 22px rgba(34, 230, 255, 0.6); }
h2 { font-size: 32px; font-weight: 600; letter-spacing: 0.03em; }
h3 { font-size: 18px; font-weight: 600; text-transform: none; }
p { margin: 0; color: var(--text); }
.lede { font-size: 18px; line-height: 1.5; max-width: 460px; }
.mono { font-family: var(--mono); }

/* ---- buttons */
.cta, button.cta { display: inline-block; padding: 16px 28px; background: var(--cyan); color: var(--void); border: 0; font: 700 16px var(--display); letter-spacing: 0.12em; text-transform: uppercase; cursor: pointer; clip-path: var(--chamfer); }
.cta:hover, button.cta:hover { background: var(--cyan-hi); color: var(--void); }
.glow { filter: drop-shadow(0 0 12px rgba(34, 230, 255, 0.55)); display: inline-block; } /* clip-path eats box-shadow, so the glow lives on a wrapper */
.ghost { display: inline-block; padding: 15px 26px; background: transparent; color: var(--cyan); border: 1px solid var(--cyan); font: 600 16px var(--display); letter-spacing: 0.12em; text-transform: uppercase; }
.ghost:hover { background: #0a2a33; }
button.link { padding: 0; font: inherit; letter-spacing: inherit; text-transform: inherit; color: var(--text); background: none; border: 0; cursor: pointer; }
button.link:hover { color: var(--bright); }

/* ---- hero */
.hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 40px; padding: 64px 0 0; align-items: center; }
.hero > div:first-child { display: flex; flex-direction: column; gap: 24px; }
.actions { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.actions small { font: 13px var(--mono); color: var(--label); }
.keyart { aspect-ratio: 4 / 3; border: 1px solid var(--strut); background: radial-gradient(circle at 50% 62%, rgba(34, 230, 255, 0.1), transparent 60%), var(--hull); position: relative; overflow: hidden; }
.keyart svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.keyart .cap { position: absolute; left: 14px; bottom: 12px; font: 11px var(--mono); letter-spacing: 0.2em; color: var(--label); }
.keyart .alert { position: absolute; right: 14px; top: 12px; font: 11px var(--mono); letter-spacing: 0.2em; color: #ff8ae9; }
.keyart video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
/* HUD captions over live footage: a dark chip keeps them legible whatever passes underneath */
.keyart .cap, .keyart .alert { padding: 3px 7px; background: rgba(5, 8, 12, 0.78); }
.keyart .motion { position: absolute; right: 12px; bottom: 10px; padding: 4px 9px; font: 11px var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--text); background: rgba(5, 8, 12, 0.78); border: 1px solid var(--strut); cursor: pointer; }
.keyart .motion:hover, .keyart .motion:focus-visible { color: var(--bright); border-color: var(--cyan); }

/* ---- sections */
.section { display: flex; flex-direction: column; gap: 28px; }
.section > .head { display: flex; flex-direction: column; gap: 12px; }
.beats { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.beat { display: flex; flex-direction: column; gap: 10px; padding: 22px; border: 1px solid var(--gridline); border-top: 2px solid var(--sig, var(--cyan)); background: var(--hull); }
.beat .num { font: 12px var(--mono); letter-spacing: 0.2em; color: var(--sig, var(--cyan)); }
.beat h3 { font-size: 24px; text-transform: uppercase; letter-spacing: 0.04em; }
.beat p { font-size: 15px; line-height: 1.5; }
.arsenal { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.unit { display: flex; flex-direction: column; gap: 12px; padding: 18px; border: 1px solid var(--gridline); background: var(--hull); color: var(--cyan); }
.unit svg { width: 100%; height: 120px; filter: drop-shadow(0 0 5px currentColor); }
.unit p { font-size: 14px; line-height: 1.4; }
.unit .stat { font: 12px var(--mono); color: var(--label); }
.eyebrow.hostile { color: #ff8ae9; }
.lede.wide { max-width: 760px; }
.story { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 40px; align-items: start; }
.prose { display: flex; flex-direction: column; gap: 16px; max-width: 620px; }
.prose p { font-size: 17px; line-height: 1.6; }
.prose strong { color: var(--bright); font-weight: 600; }
.log { border: 1px solid var(--gridline); background: var(--hull); font: 13px var(--mono); letter-spacing: 0.14em; text-transform: uppercase; }
.log-head { padding: 12px 16px; border-bottom: 1px solid var(--gridline); color: var(--label); font-size: 11px; letter-spacing: 0.2em; }
.log .row { display: flex; justify-content: space-between; gap: 16px; padding: 10px 16px; color: var(--label); border-bottom: 1px solid var(--hull); }
.log .row + .row { border-top: 1px dashed var(--gridline); }
.log .row span:last-child { color: var(--red); } /* full strength: dimmed red fails 4.5:1 on the hull */
.log .row.live { color: var(--bright); }
.log .row.live span:last-child { color: var(--green); opacity: 1; text-shadow: 0 0 10px rgba(57, 255, 136, 0.6); }
.arsenal.host .unit { color: var(--magenta); }
.final { align-items: center; text-align: center; padding: 56px 24px; border: 1px solid var(--strut); background: var(--hull); }
.final .lede { max-width: 520px; }

/* ---- account pages */
.card { display: flex; flex-direction: column; gap: 14px; padding: 24px; border: 1px solid var(--strut); background: var(--hull); }
.card h2 { font-size: 22px; }
.card h2 small { font: 11px var(--mono); letter-spacing: 0.16em; color: var(--label); }
.card h2 small.live { color: var(--green); }
form { margin: 0; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
label { display: block; width: 100%; font: 11px var(--mono); letter-spacing: 0.2em; text-transform: uppercase; color: var(--label); }
input { display: block; width: 100%; margin-top: 6px; padding: 11px 12px; font: 16px var(--mono); color: var(--bright); background: var(--void); border: 1px solid var(--strut); border-radius: 0; }
input:focus { outline: 1px solid var(--cyan); border-color: var(--cyan); }
.error { padding: 10px 12px; color: #ff9aa5; border: 1px solid var(--red); background: #2a0a10; font-size: 15px; }
.note { padding: 10px 12px; color: var(--amber); border: 1px solid var(--amber); font-size: 15px; }
dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 22px; margin: 0; font-family: var(--mono); font-size: 15px; }
dt { color: var(--label); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; align-self: center; }
dd { margin: 0; color: var(--bright); }

@media (max-width: 640px) {
  header.nav { padding: 14px 18px; }
  header.nav nav { gap: 16px; font-size: 12px; }
  .brand { font-size: 14px; }
  main { padding: 0 18px 56px; gap: 56px; }
  .hero { padding-top: 40px; }
}

/* ---- 3D unit models: the line-art icon until the canvas takes over */
.unit .model { position: relative; width: 100%; height: 150px; }
.unit .model svg, .unit .model canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.unit .model svg { filter: drop-shadow(0 0 5px currentColor); transition: opacity 0.3s; }
.unit .model canvas { opacity: 0; object-fit: contain; transition: opacity 0.3s; }
.unit .model.live canvas { opacity: 1; }
.unit .model.live svg { opacity: 0; }

/* ---- progression */
.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; counter-reset: tier; }
.tier { display: flex; flex-direction: column; gap: 12px; padding: 22px; border: 1px solid var(--gridline); border-left: 2px solid var(--cyan); background: var(--hull); }
.tier .num { font: 12px var(--mono); letter-spacing: 0.2em; color: var(--cyan); }
.tier h3 { font-size: 22px; text-transform: uppercase; letter-spacing: 0.04em; }
.tier p { font-size: 15px; line-height: 1.5; }
.tier ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--text); }
.tier li { padding-left: 16px; position: relative; line-height: 1.4; }
.tier li::before { content: ''; position: absolute; left: 0; top: 0.55em; width: 7px; height: 1px; background: var(--cyan); }
.tier strong { color: var(--bright); font-weight: 600; }
