/* Cantorite: Night Freight. Colours, type and panels follow docs/railhead/art-guide.md and ui-design.md:
   basalt and blue-black night, cyan crystal for the player, warm amber lamps, brass-rimmed dark panels,
   gold only for the Harrow, red only for "will be hit". */

@font-face { font-family: 'Barlow'; font-weight: 500; font-style: normal; font-display: swap; src: url('fonts/barlow-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 700; font-style: normal; font-display: swap; src: url('fonts/barlow-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Semi Condensed'; font-weight: 600; font-style: normal; font-display: swap; src: url('fonts/barlow-semi-condensed-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Semi Condensed'; font-weight: 700; font-style: normal; font-display: swap; src: url('fonts/barlow-semi-condensed-latin-700-normal.woff2') format('woff2'); }

:root {
  color-scheme: dark;
  --night: #10141b;
  --haze: #1c2430;
  --basalt: #3a3d42;
  --basalt-deep: #24262a;
  --panel: rgba(14, 18, 24, 0.78);
  --panel-solid: #0e1218;
  --brass: #b08a4a;
  --brass-light: #d6b373;
  --cream: #e9dfc8;
  --text: #cfd3d8;
  --muted: #9aa3ae;
  --crystal: #5ff2e6;
  --crystal-body: #1e8c8a;
  --amber: #ffb45a;
  --gold: #ffc940;   /* the Harrow only */
  --red: #ff4b3e;    /* "will be hit" only */
  --navy: #1f3a68;
  --steel: #d8dee4;
  --directorate: #4fe3ff;
  --umbra: #b84fff;  /* the Umbra only */
  --display: 'Barlow Semi Condensed', 'Arial Narrow', 'Roboto Condensed', sans-serif;
  --body: 'Barlow', 'Segoe UI', system-ui, sans-serif;
  --r: 18px;
  --gutter: clamp(16px, 5vw, 56px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--text); font: 500 17px/1.6 var(--body);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(255, 180, 90, 0.10), transparent 60%),
    radial-gradient(900px 700px at 0% 30%, rgba(95, 242, 230, 0.05), transparent 60%),
    var(--night);
  }
html, body { overflow-x: clip; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--crystal); text-underline-offset: 3px; }
a:hover { color: #9ff8f0; }
:focus-visible { outline: 2px solid var(--crystal); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--panel-solid); color: var(--cream); padding: 10px 14px; border: 1.5px solid var(--brass); border-radius: 12px; }
.skip:focus { left: 16px; }

.wrap { width: min(1160px, 100%); margin: 0 auto; padding-inline: var(--gutter); }

h1, h2, h3 { font-family: var(--display); color: var(--cream); margin: 0; text-wrap: balance; }
h2 { font-weight: 700; font-size: clamp(32px, 5vw, 52px); line-height: 1.02; letter-spacing: 0.005em; }
h3 { font-weight: 600; font-size: 24px; line-height: 1.1; }
p { margin: 0; max-width: 64ch; }
.lede { font-size: 19px; color: var(--cream); }
.eyebrow { font: 600 15px/1 var(--display); font-variant-caps: all-small-caps; letter-spacing: 0.12em; color: var(--brass-light); display: inline-flex; align-items: center; gap: 10px; }
.eyebrow .n { color: var(--crystal); font-variant-numeric: tabular-nums; }
.stack { display: flex; flex-direction: column; gap: 20px; }

/* Panel: dark translucent, rounded 18 px, thin brass rim (ui-design section 9) */
.panel { background: var(--panel); border: 1.5px solid var(--brass); border-radius: var(--r); }

/* Top strip, after the fight HUD: pips for line integrity, a round counter */
.strip { position: sticky; top: 0; z-index: 20; background: rgba(16, 20, 27, 0.86); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid rgba(176, 138, 74, 0.45); }
.strip .wrap { display: flex; align-items: center; gap: 16px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--cream); text-decoration: none; font: 700 19px/1 var(--display); white-space: nowrap; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.brand span { color: var(--muted); font-weight: 600; }
.pips { display: flex; gap: 5px; margin-left: 4px; }
.pips i { width: 10px; height: 10px; transform: rotate(45deg); border: 1.5px solid var(--crystal-body); background: transparent; transition: background 200ms ease-out, border-color 200ms ease-out; }
.pips i.on { background: var(--crystal); border-color: var(--crystal); box-shadow: 0 0 8px rgba(95, 242, 230, 0.5); }
.strip nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.strip nav a { color: var(--text); text-decoration: none; font: 600 16px/1 var(--display); padding: 10px 10px; border-radius: 10px; }
.strip nav a:hover { color: var(--cream); background: rgba(255, 255, 255, 0.05); }
.lang { display: inline-flex; border: 1.5px solid var(--brass); border-radius: 999px; overflow: hidden; margin-left: 8px; }
.lang a, .lang span { font: 700 14px/1 var(--display); padding: 8px 11px; text-decoration: none; letter-spacing: 0.06em; }
.lang span { background: var(--brass); color: var(--panel-solid); }
.lang a { color: var(--cream); }

/* Hero */
.hero { padding-block: clamp(40px, 7vw, 88px) clamp(48px, 7vw, 96px); position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; inset: auto 0 0 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(176, 138, 74, 0.6), transparent); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.hero .over { display: block; font: 600 20px/1 var(--display); letter-spacing: 0.32em; color: var(--muted); text-transform: uppercase; margin-bottom: 14px; }
.hero h1 { font-weight: 700; font-size: clamp(54px, 9vw, 112px); line-height: 0.9; letter-spacing: -0.005em; }
.hero h1 small { display: block; font-size: 0.36em; line-height: 1.2; font-weight: 600; color: var(--amber); letter-spacing: 0.02em; margin-top: 10px; }
.tagline { font: 600 clamp(22px, 2.6vw, 28px)/1.25 var(--display); color: var(--cream); }
.facts { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; list-style: none; }
.facts li { font: 600 15px/1 var(--display); color: var(--cream); padding: 9px 13px; border-radius: 999px; background: var(--panel); border: 1.5px solid rgba(176, 138, 74, 0.7); }
.facts li b { color: var(--crystal); font-weight: 700; }
.status { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-size: 15px; }
.status::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 10px var(--amber); flex: none; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 22px; border-radius: 999px; font: 700 18px/1 var(--display); text-decoration: none; transition: transform 150ms ease-out, background 150ms ease-out; }
.btn:active { transform: scale(0.96); }
.btn.primary { background: linear-gradient(180deg, #2aa8a2, var(--crystal-body)); color: #04201f; border: 1.5px solid var(--crystal); box-shadow: 0 0 22px rgba(95, 242, 230, 0.22); }
.btn.primary:hover { color: #04201f; background: linear-gradient(180deg, #34c0b9, #229e9b); }
.btn.ghost { color: var(--cream); border: 1.5px solid var(--brass); background: var(--panel); }
.btn.ghost:hover { color: var(--cream); background: rgba(176, 138, 74, 0.18); }

.phone { position: relative; border-radius: 30px; padding: 10px; background: linear-gradient(160deg, #2b2f35, #15181d); border: 1.5px solid var(--brass); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 0 6px rgba(14, 18, 24, 0.6); max-width: 420px; justify-self: center; width: 100%; }
.phone img { border-radius: 22px; }
.phone::before { content: ''; position: absolute; inset: -40px -60px; z-index: -1; background: radial-gradient(closest-side, rgba(255, 180, 90, 0.18), transparent); }

/* Sections */
section { padding-block: clamp(56px, 8vw, 104px); }
section + section { border-top: 1px solid rgba(58, 61, 66, 0.8); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.split.flip > :first-child { order: 2; }

/* The round: three steps, each a panel */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 0; margin: 0; list-style: none; counter-reset: step; }
.steps li { padding: 22px 22px 24px; display: flex; flex-direction: column; gap: 10px; }
.steps .k { display: flex; align-items: center; gap: 12px; }
.steps .k svg { width: 40px; height: 40px; flex: none; }
.steps .k b { font: 700 15px/1 var(--display); color: var(--muted); font-variant-numeric: tabular-nums; }
.steps p { font-size: 16px; }

/* Board diagram */
.diagram { padding: 18px; }
.diagram svg { width: 100%; height: auto; display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 12px 4px 0; margin: 0; list-style: none; font-size: 14px; color: var(--muted); }
.legend li { display: inline-flex; align-items: center; gap: 8px; }
.legend i { width: 14px; height: 14px; border-radius: 3px; flex: none; }

/* Squad cards, after the bottom tray */
.squad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 0; margin: 0; list-style: none; }
.squad li { padding: 16px 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.squad h3 { font-size: 22px; }
.squad .meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; font: 600 14px/1 var(--display); color: var(--muted); }
.squad .meta div { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.squad .meta dd { margin: 0; color: var(--cream); display: inline-flex; align-items: center; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.squad .hp { display: inline-flex; gap: 3px; align-items: center; }
.squad .hp i { width: 9px; height: 9px; border-radius: 2px; background: var(--cream); }
.squad p { font-size: 15px; line-height: 1.5; }
.factions { display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 0; list-style: none; }
.factions li { display: inline-flex; align-items: center; gap: 10px; padding: 9px 14px; border-radius: 12px; background: var(--panel); border: 1.5px solid rgba(176, 138, 74, 0.6); font-size: 15px; }
.factions .sw { width: 14px; height: 14px; border-radius: 50%; flex: none; }

/* Figures */
figure { margin: 0; display: flex; flex-direction: column; gap: 10px; }
figure img { border-radius: 14px; border: 1.5px solid rgba(176, 138, 74, 0.55); background: var(--basalt-deep); }
figcaption { font-size: 14px; line-height: 1.5; color: var(--muted); }
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
.gallery .wide { grid-column: 1 / -1; }
.duo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }

/* The run: route choice */
.route { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.route div { padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.route b { font: 700 20px/1 var(--display); color: var(--cream); display: flex; align-items: center; gap: 8px; }
.route p { font-size: 15px; line-height: 1.5; }
.ticks { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.ticks li { position: relative; padding-left: 26px; }
.ticks li::before { content: ''; position: absolute; left: 3px; top: 0.5em; width: 9px; height: 9px; transform: rotate(45deg); background: var(--crystal); box-shadow: 0 0 6px rgba(95, 242, 230, 0.5); }

/* World: the Harrow's gold lives only here */
.world { background: radial-gradient(700px 400px at 80% 40%, rgba(255, 201, 64, 0.07), transparent 70%); }
.harrow-name { color: var(--gold); }

/* Fair play */
.promises { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 0; margin: 0; list-style: none; }
.promises li { padding: 16px 18px; display: flex; gap: 12px; align-items: flex-start; font-size: 16px; line-height: 1.45; }
.promises li strong { color: var(--cream); display: block; font: 700 19px/1.15 var(--display); margin-bottom: 4px; }
.promises svg { width: 26px; height: 26px; flex: none; margin-top: 1px; }
.free { padding: 20px 22px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.free h3 { font-size: 20px; margin-bottom: 6px; }
.free p { font-size: 15px; line-height: 1.5; }

/* Platforms */
.plats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.plats > div { padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.plats b { font: 700 20px/1.1 var(--display); color: var(--cream); }

/* Links */
.links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.links a { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; text-decoration: none; color: var(--text); transition: transform 150ms ease-out, border-color 150ms ease-out; }
.links a:hover { border-color: var(--crystal); transform: translateY(-2px); color: var(--text); }
.links b { font: 700 21px/1.1 var(--display); color: var(--cream); }
.links span { font-size: 15px; color: var(--muted); }
.links .arrow { color: var(--crystal); }

footer { border-top: 1px solid rgba(176, 138, 74, 0.45); padding-block: 32px 40px; font-size: 15px; color: var(--muted); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; }
footer .credit { font: 600 17px/1 var(--display); color: var(--cream); text-decoration: none; letter-spacing: 0.04em; }
footer .credit:hover { color: var(--amber); }
footer nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }

/* Responsive */
@media (max-width: 980px) {
  .hero .wrap, .split { grid-template-columns: minmax(0, 1fr); }
  .split.flip > :first-child { order: 0; }
  .phone { max-width: 380px; }
  .steps, .promises, .links, .free { grid-template-columns: minmax(0, 1fr); }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .strip nav a.sec { display: none; }
  .pips { display: none; }
}
@media (max-width: 560px) {
  body { font-size: 16.5px; }
  .squad { grid-template-columns: minmax(0, 1fr); }
  .gallery, .plats, .route { grid-template-columns: minmax(0, 1fr); }
  .diagram { padding: 12px; }
  .diagram .duo { gap: 10px; }
  .diagram figcaption { font-size: 13px; }
  .brand span { display: none; }
  .hero .over { font-size: 16px; letter-spacing: 0.24em; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Swatches (no inline styles: the CSP has no 'unsafe-inline') */
.c-red { background: var(--red); }
.c-cyan { background: var(--crystal); }
.c-gold { background: var(--gold); }
.c-amber { background: var(--amber); }
.c-steel { background: var(--steel); }
.c-umbra { background: var(--umbra); }
