/* WTK KSP Multiplayer — Mission Control Design System
   Requires: tokens.css
   ─────────────────────────────────────────────────────────────── */


/* ═══════════════════════════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════════════════════════ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 1rem);
}

body {
  font-family: var(--font-body);
  background: var(--void);
  color: var(--text);
  line-height: 1.65;
  font-size: var(--sz-16);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* CRT scanline overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0, 0, 0, 0.035) 3px,
    rgba(0, 0, 0, 0.035) 4px
  );
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover { text-decoration: underline; }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

strong { font-weight: 600; color: var(--text); }

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--panel-raised);
  border: 1px solid var(--panel-edge-hi);
  padding: 0.1em 0.4em;
  color: var(--caution);
  border-radius: 2px;
}

ul, ol { list-style: none; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}


/* ═══════════════════════════════════════════════════════════════
   LAYOUT
═══════════════════════════════════════════════════════════════ */

.container {
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--sp-6);
}

.section {
  margin-bottom: var(--sp-8);
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-6);
}

.main-content {
  padding-bottom: var(--sp-16);
}

@media (max-width: 640px) {
  .container { padding-inline: var(--sp-4); }
}
@media (max-width: 768px) {
  .two-col { grid-template-columns: 1fr; gap: var(--sp-4); }
}


/* ═══════════════════════════════════════════════════════════════
   NAVIGATION
═══════════════════════════════════════════════════════════════ */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 14, 20, 0.94);
  border-bottom: 1px solid var(--panel-edge);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.nav-inner {
  display: flex;
  align-items: center;
  height: var(--nav-h);
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--sp-6);
  gap: var(--sp-4);
}

/* Logo */
.nav-logo {
  display: flex;
  align-items: baseline;
  gap: 0;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--sz-14);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}
.nav-logo:hover { text-decoration: none; }

.logo-mark  { color: var(--go); }
.logo-sep   { color: var(--text-dim); margin-inline: 0.1em; }
.logo-sub   { color: var(--text-muted); }
.logo-cursor {
  color: var(--go);
  animation: blink 1.1s step-end infinite;
  margin-left: 2px;
}

/* Desktop nav links */
.nav-links {
  display: flex;
  gap: 0;
  margin-left: auto;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: var(--sz-12);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: var(--sp-2) var(--sp-3);
  transition: color var(--dur-base), background var(--dur-base);
}
.nav-links a:hover {
  color: var(--text);
  background: var(--panel);
  text-decoration: none;
}
.nav-links a.active { color: var(--accent); }

/* Hamburger button */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: 1px solid var(--panel-edge);
  cursor: pointer;
  padding: 8px 10px;
  margin-left: auto;
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-muted);
  transition: transform var(--dur-base), opacity var(--dur-base);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile slide-down menu */
.nav-mobile {
  display: none;
  background: var(--panel);
  border-bottom: 1px solid var(--panel-edge);
  padding: var(--sp-2) var(--sp-4) var(--sp-3);
}
.nav-mobile ul { display: flex; flex-direction: column; }
.nav-mobile a {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--sz-13);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: var(--sp-3) var(--sp-2);
  border-bottom: 1px solid var(--panel-edge);
}
.nav-mobile a:hover { color: var(--text); text-decoration: none; }
.nav-mobile ul li:last-child a { border-bottom: none; }
/* Dropdown (Mission section) */
.nav-dropdown {
  position: relative;
}
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-top: none;
  z-index: 101;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  display: block;
}
.nav-dropdown-menu a {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--sz-11);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--panel-edge);
  white-space: nowrap;
}
.nav-dropdown-menu a:hover {
  color: var(--text);
  background: var(--panel-raised);
  text-decoration: none;
}
.nav-dropdown-menu a:last-child {
  border-bottom: none;
}

.nav-mobile.open { display: block; }

@media (max-width: 720px) {
  .nav-dropdown:hover .nav-dropdown-menu,
  .nav-dropdown:focus-within .nav-dropdown-menu {
    position: static;
    border: 1px solid var(--panel-edge);
    margin-top: var(--sp-2);
  }
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
}
@media (max-width: 640px) {
  .nav-inner { padding-inline: var(--sp-4); }
}


/* ═══════════════════════════════════════════════════════════════
   HERO — MISSION STATUS
═══════════════════════════════════════════════════════════════ */

.hero {
  position: relative;
  display: flex;
  align-items: center;
  padding-block: var(--sp-12) var(--sp-10);
  overflow: hidden;
}

/* Background grid (NASA console graph-paper feel) */
.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right,  rgba(35, 44, 58, 0.35) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(35, 44, 58, 0.35) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 90% 90% at 50% 50%, black 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 90% 90% at 50% 50%, black 30%, transparent 100%);
}

/* Faint green horizon glow */
.hero::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 70%;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--go-glow), transparent);
  filter: blur(4px);
}

.hero-inner {
  position: relative;
  z-index: 1;
}

.hero-label {
  font-family: var(--font-mono);
  font-size: var(--sz-11);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--text-dim);
  margin-bottom: var(--sp-5);
  animation: fade-up var(--dur-slow) var(--ease-out) both;
}

.hero-status {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  margin-bottom: var(--sp-5);
  animation: fade-up var(--dur-slow) 80ms var(--ease-out) both;
}

/* Live telemetry folded into the hero verdict area */
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-7) var(--sp-8);
  margin-bottom: var(--sp-5);
  animation: fade-up var(--dur-slow) 120ms var(--ease-out) both;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.hero-stat-label {
  font-family: var(--font-mono);
  font-size: var(--sz-10);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-dim);
}

.hero-stat-value {
  font-family: var(--font-mono);
  font-size: var(--sz-22);
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  transition: color var(--dur-slow);
}

.hero-stat-value.go { color: var(--go); }

/* CTA row: live telemetry left of the JOIN button */
.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-5) var(--sp-8);
  animation: fade-up var(--dur-slow) 200ms var(--ease-out) both;
}

.hero-stats--inline {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-8);
  margin: 0;
  animation: none;
}

.hero-stats--inline .hero-stat {
  position: relative;
  padding-right: var(--sp-8);
}

.hero-stats--inline .hero-stat:not(:last-child)::after {
  content: '|';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: var(--sz-14);
  color: var(--panel-edge-hi);
}

@media (max-width: 680px) {
  .hero-cta-row { flex-direction: column; align-items: flex-start; gap: var(--sp-6); }
  .hero-stats--inline { width: 100%; justify-content: space-between; gap: var(--sp-5); }
  .hero-stats--inline .hero-stat { padding-right: var(--sp-5); }
}

/* Pulsing status dot */
.status-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-dim);
  flex-shrink: 0;
  transition: background var(--dur-slow), box-shadow var(--dur-slow);
}
.status-dot.go {
  background: var(--go);
  animation: pulse-go 2.2s ease-out infinite;
}
.status-dot.caution {
  background: var(--caution);
  box-shadow: 0 0 10px var(--caution-glow);
}
.status-dot.nogo {
  background: var(--nogo);
  box-shadow: 0 0 10px var(--nogo-glow);
}

/* Hero verdict (large status text) */
.hero-verdict {
  font-family: var(--font-mono);
  font-size: var(--sz-hero);
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  color: var(--text);
  transition: color var(--dur-slow);
}
.hero-verdict.go      { color: var(--go); }
.hero-verdict.caution { color: var(--caution); }
.hero-verdict.nogo    { color: var(--nogo); }

/* Blinking cursor — shown while checking, hidden once resolved */
.cursor-blink {
  display: inline-block;
  color: var(--text-dim);
  font-weight: 400;
  animation: blink 1.1s step-end infinite;
  margin-left: 2px;
}
.hero-verdict.go .cursor-blink,
.hero-verdict.nogo .cursor-blink { display: none; }

.hero-note {
  font-family: var(--font-mono);
  font-size: var(--sz-12);
  color: var(--nogo);
  letter-spacing: 0.08em;
  margin-bottom: var(--sp-3);
  min-height: 1.2em;
}
.hero-note:empty { margin-bottom: 0; }
.hero-note.go      { color: var(--go); }
.hero-note.caution { color: var(--caution); }

.hero-sub {
  font-family: var(--font-mono);
  font-size: var(--sz-12);
  color: var(--text-dim);
  letter-spacing: 0.1em;
  margin-bottom: var(--sp-8);
  animation: fade-up var(--dur-slow) 160ms var(--ease-out) both;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: var(--sz-12);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--void);
  background: var(--go);
  padding: var(--sp-3) var(--sp-6);
  text-decoration: none;
  cursor: pointer;
  transition: background var(--dur-base), box-shadow var(--dur-base), transform var(--dur-fast);
  /* Chamfered top-right corner */
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
  animation: fade-up var(--dur-slow) 240ms var(--ease-out) both;
}
.btn-primary:hover {
  background: #5dff8d;
  box-shadow: 0 0 24px var(--go-glow);
  transform: translateY(-1px);
  text-decoration: none;
  color: var(--void);
}
.btn-primary:active { transform: translateY(0); }


/* ═══════════════════════════════════════════════════════════════
   TELEMETRY STRIP
═══════════════════════════════════════════════════════════════ */

.telemetry {
  background: var(--panel);
  border-top: 1px solid var(--panel-edge);
  border-bottom: 1px solid var(--panel-edge);
  padding-block: var(--sp-4);
  margin-bottom: var(--sp-12);
}

.telem-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto auto;
}

/* Compact telemetry strip (home page): tighter cells + a wider grid that
   also carries the live mission overview (vessels / kerbals / flags). */
.telemetry-compact { padding-block: var(--sp-2); margin-bottom: var(--sp-8); }
.telemetry-compact .telem-cell { padding: var(--sp-2) var(--sp-3); }
.telemetry-compact .telem-value { font-size: var(--sz-14); }
/* Two-row telemetry: row 1 = server connection details (5 cells),
   row 2 = live mission/game data (4 cells). 3-up on narrow screens. */
.telem-row { grid-template-columns: repeat(3, 1fr); grid-template-rows: auto; }
.telem-row-server { margin-bottom: var(--sp-3); }
@media (min-width: 880px) {
  /* Both rows share the SAME 5-column tracks so the vertical dividers line up
     top-to-bottom. The game row has 4 cells, leaving the 5th track empty. */
  .telem-row-server,
  .telem-row-game { grid-template-columns: repeat(5, 1fr); }
  /* One tidy row each: vertical dividers between cells, no bottom borders.
     The extra specificity (and :nth-child(3n)) overrides the generic 3-up
     divider rules below so no internal divider goes missing. */
  .telem-row .telem-cell,
  .telem-row .telem-cell:nth-child(3n) { border-bottom: none; border-right: 1px solid var(--panel-edge); }
  .telem-row .telem-cell:last-child { border-right: none; }
}
.telem-foot {
  font-family: var(--font-mono);
  font-size: var(--sz-11);
  color: var(--text-dim);
  text-align: right;
  margin-top: var(--sp-2);
}
.telem-foot a { color: var(--accent); }

/* Metadata-only strip (server version / address) below the hero */
.telemetry-meta { text-align: center; }
.telem-meta {
  font-family: var(--font-mono);
  font-size: var(--sz-12);
  color: var(--text-dim);
  letter-spacing: 0.1em;
  line-height: 1.6;
}

/* Top row: STATUS, ADDRESS, PORT (cells 1–3)
   Bottom row: PLAYERS, MODPACK, PATCH (cells 4–6) */
.telem-cell {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  padding: var(--sp-3) var(--sp-4);
  border-right: 1px solid var(--panel-edge);
  border-bottom: 1px solid var(--panel-edge);
}
.telem-cell:nth-child(3n) { border-right: none; }
.telem-cell:nth-last-child(-n+3) { border-bottom: none; }

.telem-label {
  font-family: var(--font-mono);
  font-size: var(--sz-10);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-dim);
  display: block;
}

.telem-value {
  font-family: var(--font-mono);
  font-size: var(--sz-16);
  color: var(--text);
  font-variant-numeric: tabular-nums;
  display: block;
  transition: color var(--dur-slow);
}
.telem-value.go      { color: var(--go); }
.telem-value.nogo    { color: var(--nogo); }
.telem-value.caution { color: var(--caution); }

.telem-addr {
  font-size: var(--sz-13);
  letter-spacing: -0.01em;
  word-break: break-all;
}

@media (max-width: 900px) {
  .telem-grid { grid-template-columns: 1fr 1fr; }
  .telem-cell:nth-child(even) { border-right: none; }
  .telem-cell:nth-child(3),
  .telem-cell:nth-child(4) { border-top: 1px solid var(--panel-edge); }
  .telem-cell:nth-child(3) { border-right: 1px solid var(--panel-edge); }
}
@media (max-width: 540px) {
  .telem-grid { grid-template-columns: 1fr; }
  .telem-cell { border-right: none !important; }
  .telem-cell:not(:first-child) { border-top: 1px solid var(--panel-edge); }
  .telem-cell:nth-last-child(-n+3) { border-bottom: 1px solid var(--panel-edge); }
}


/* ═══════════════════════════════════════════════════════════════
   PANEL COMPONENT
   Bordered module with corner ticks + floating label tab
═══════════════════════════════════════════════════════════════ */

.panel {
  position: relative;
  background-color: var(--panel);
  border: 1px solid var(--panel-edge);
  padding: var(--sp-6);

  /* Corner ticks — four solid-color gradient rectangles, one per corner */
  background-image:
    linear-gradient(var(--tick-color), var(--tick-color)),  /* TL-h */
    linear-gradient(var(--tick-color), var(--tick-color)),  /* TL-v */
    linear-gradient(var(--tick-color), var(--tick-color)),  /* TR-h */
    linear-gradient(var(--tick-color), var(--tick-color)),  /* TR-v */
    linear-gradient(var(--tick-color), var(--tick-color)),  /* BL-h */
    linear-gradient(var(--tick-color), var(--tick-color)),  /* BL-v */
    linear-gradient(var(--tick-color), var(--tick-color)),  /* BR-h */
    linear-gradient(var(--tick-color), var(--tick-color));  /* BR-v */
  background-size:
    var(--tick)   var(--tick-w),  /* TL-h */
    var(--tick-w) var(--tick),    /* TL-v */
    var(--tick)   var(--tick-w),  /* TR-h */
    var(--tick-w) var(--tick),    /* TR-v */
    var(--tick)   var(--tick-w),  /* BL-h */
    var(--tick-w) var(--tick),    /* BL-v */
    var(--tick)   var(--tick-w),  /* BR-h */
    var(--tick-w) var(--tick);    /* BR-v */
  background-position:
    left top,    left top,
    right top,   right top,
    left bottom, left bottom,
    right bottom, right bottom;
  background-repeat: no-repeat;
}

/* Floating label tab — sits over the top border */
.panel[data-label]::before {
  content: attr(data-label);
  position: absolute;
  top: 0;
  left: var(--sp-6);
  transform: translateY(-50%);
  background: var(--panel);
  padding: 0 var(--sp-3);
  font-family: var(--font-mono);
  font-size: var(--sz-10);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  white-space: nowrap;
  line-height: 1.4;
}

/* Footer row inside a panel */
.panel-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-top: var(--sp-5);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--panel-edge);
}
.panel-action .telem-label { color: var(--text-dim); }


/* ═══════════════════════════════════════════════════════════════
   STEPS — PRE-FLIGHT CHECKLIST
═══════════════════════════════════════════════════════════════ */

.steps {
  display: flex;
  flex-direction: column;
  margin-top: var(--sp-3);
}

.step-item {
  display: flex;
  gap: var(--sp-5);
  padding: var(--sp-5) 0;
  border-bottom: 1px solid var(--panel-edge);
}
.step-item:first-child { padding-top: var(--sp-3); }
.step-item:last-child  { border-bottom: none; padding-bottom: 0; }

.step-num {
  font-family: var(--font-mono);
  font-size: var(--sz-32);
  font-weight: 700;
  color: var(--panel-edge-hi);
  line-height: 1;
  flex-shrink: 0;
  width: 2.4rem;
  padding-top: 0.05em;
  font-variant-numeric: tabular-nums;
  transition: color var(--dur-base);
}
.step-item:hover .step-num { color: var(--accent); }

.step-body { flex: 1; min-width: 0; }

.step-title {
  font-family: var(--font-mono);
  font-size: var(--sz-13);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text);
  margin-bottom: var(--sp-2);
}

.step-body p {
  font-size: var(--sz-14);
  color: var(--text-muted);
  line-height: 1.7;
}


/* ═══════════════════════════════════════════════════════════════
   MISSION BRIEF
═══════════════════════════════════════════════════════════════ */

.panel p {
  font-size: var(--sz-14);
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: var(--sp-4);
}
.panel p:last-child { margin-bottom: 0; }


/* ═══════════════════════════════════════════════════════════════
   FLIGHT RULES
═══════════════════════════════════════════════════════════════ */

.rules-list {
  display: flex;
  flex-direction: column;
}

.rules-list li {
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--panel-edge);
  font-size: var(--sz-13);
  color: var(--text-muted);
  line-height: 1.55;
}
.rules-list li:first-child { padding-top: var(--sp-2); }
.rules-list li:last-child  { border-bottom: none; padding-bottom: 0; }

.rule-id {
  font-family: var(--font-mono);
  font-size: var(--sz-10);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.08em;
  flex-shrink: 0;
}


/* ═══════════════════════════════════════════════════════════════
   MOD MANIFEST PREVIEW
═══════════════════════════════════════════════════════════════ */

.mod-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
  min-height: 60px;
  align-content: flex-start;
}

.mod-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-mono);
  font-size: var(--sz-11);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px var(--sp-3);
  border: 1px solid var(--panel-edge);
  background: var(--panel-raised);
  color: var(--text-muted);
  white-space: nowrap;
}

.mod-tag--required {
  border-color: rgba(57, 255, 106, 0.28);
  background: var(--go-dim);
  color: rgba(57, 255, 106, 0.8);
}

.mod-tag-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.mod-tag--more {
  border-color: var(--panel-edge-hi);
  color: var(--text-dim);
}

/* Skeleton loading state */
.mod-tag--skeleton {
  width: 90px;
  height: 24px;
  background: var(--panel-raised);
  border: 1px solid var(--panel-edge);
  animation: skeleton-pulse 1.6s ease-in-out infinite;
}
.mod-tag--skeleton:nth-child(2) { width: 70px;  animation-delay: 0.1s; }
.mod-tag--skeleton:nth-child(3) { width: 110px; animation-delay: 0.2s; }
.mod-tag--skeleton:nth-child(4) { width: 80px;  animation-delay: 0.3s; }
.mod-tag--skeleton:nth-child(5) { width: 95px;  animation-delay: 0.15s; }
.mod-tag--skeleton:nth-child(6) { width: 65px;  animation-delay: 0.25s; }


/* ═══════════════════════════════════════════════════════════════
   LINK ARROW
═══════════════════════════════════════════════════════════════ */

.link-arrow {
  font-family: var(--font-mono);
  font-size: var(--sz-12);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  text-decoration: none;
  transition: letter-spacing var(--dur-base), color var(--dur-base);
}
.link-arrow:hover {
  letter-spacing: 0.16em;
  color: var(--text);
  text-decoration: none;
}


/* ═══════════════════════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════════════════════ */

.site-footer {
  background: var(--panel);
  border-top: 1px solid var(--panel-edge);
  padding-block: var(--sp-8);
}

.footer-inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-6);
}

.footer-brand {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--sz-13);
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}
.footer-nav a {
  font-family: var(--font-mono);
  font-size: var(--sz-11);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-dim);
  padding: var(--sp-1) var(--sp-3);
  transition: color var(--dur-base);
}
.footer-nav a:hover { color: var(--text-muted); text-decoration: none; }

.footer-meta {
  font-family: var(--font-mono);
  font-size: var(--sz-11);
  color: var(--text-dim);
  letter-spacing: 0.06em;
  margin-left: auto;
}

@media (max-width: 640px) {
  .footer-inner { flex-direction: column; align-items: flex-start; gap: var(--sp-4); }
  .footer-meta  { margin-left: 0; }
}


/* ═══════════════════════════════════════════════════════════════
   ANIMATIONS
═══════════════════════════════════════════════════════════════ */

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

@keyframes pulse-go {
  0%   { box-shadow: 0 0 0 0   var(--go-glow); }
  65%  { box-shadow: 0 0 0 10px rgba(57, 255, 106, 0); }
  100% { box-shadow: 0 0 0 0   rgba(57, 255, 106, 0); }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.35; }
  50%       { opacity: 0.7; }
}

/* Scroll-triggered reveal — class added by IntersectionObserver in main.js */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--dur-slow) var(--ease-out),
              transform var(--dur-slow) var(--ease-out);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}


/* ═══════════════════════════════════════════════════════════════
   PAGE HEADER (inner pages)
═══════════════════════════════════════════════════════════════ */

.page-header {
  padding-block: var(--sp-10) var(--sp-8);
  border-bottom: 1px solid var(--panel-edge);
  margin-bottom: var(--sp-8);
}

.page-header-label {
  font-family: var(--font-mono);
  font-size: var(--sz-11);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--text-dim);
  margin-bottom: var(--sp-3);
}

.page-title {
  font-family: var(--font-mono);
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.1;
}

.page-sub {
  font-size: var(--sz-14);
  color: var(--text-muted);
  margin-top: var(--sp-3);
  line-height: 1.7;
  max-width: 70ch;
}


/* ═══════════════════════════════════════════════════════════════
   CALLOUT BOXES
═══════════════════════════════════════════════════════════════ */

.callout {
  border-left: 3px solid var(--panel-edge-hi);
  padding: var(--sp-4) var(--sp-5);
  margin-bottom: var(--sp-4);
  font-size: var(--sz-14);
  line-height: 1.7;
  color: var(--text-muted);
  background: var(--panel-raised);
}
.callout-info    { border-color: var(--accent);   background: var(--accent-dim); }
.callout-warning { border-color: var(--caution);  background: var(--caution-dim); }
.callout-success { border-color: var(--go);       background: var(--go-dim); }
.callout strong  { color: var(--text); }
.callout code    { font-size: 0.85em; }


/* ═══════════════════════════════════════════════════════════════
   CONTENT TYPOGRAPHY (inside panels / main content)
═══════════════════════════════════════════════════════════════ */

.content h2 {
  font-family: var(--font-mono);
  font-size: var(--sz-14);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text);
  margin-bottom: var(--sp-4);
  margin-top: var(--sp-8);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--panel-edge);
}
.content h2:first-child { margin-top: 0; }

.content h3 {
  font-family: var(--font-mono);
  font-size: var(--sz-13);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text);
  margin-bottom: var(--sp-2);
  margin-top: var(--sp-6);
}

.content p {
  font-size: var(--sz-14);
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: var(--sp-4);
}
.content p:last-child { margin-bottom: 0; }

.content ul, .content ol {
  font-size: var(--sz-14);
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: var(--sp-4);
  padding-left: var(--sp-5);
}
.content ul { list-style: disc; }
.content ol { list-style: decimal; }
.content li { margin-bottom: var(--sp-2); }
.content li:last-child { margin-bottom: 0; }
.content li > ul, .content li > ol { margin-top: var(--sp-2); margin-bottom: 0; }


/* ═══════════════════════════════════════════════════════════════
   DOWNLOAD BUTTON
═══════════════════════════════════════════════════════════════ */

.dl-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-mono);
  font-size: var(--sz-12);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: var(--sp-2) var(--sp-5);
  background: var(--accent-dim);
  text-decoration: none;
  transition: background var(--dur-base), box-shadow var(--dur-base);
  margin-bottom: var(--sp-3);
}
.dl-btn:hover {
  background: rgba(90, 200, 250, 0.2);
  box-shadow: 0 0 14px rgba(90, 200, 250, 0.2);
  text-decoration: none;
  color: var(--accent);
}


/* ═══════════════════════════════════════════════════════════════
   PLATFORM NOTE (join guide)
═══════════════════════════════════════════════════════════════ */

.platform-note {
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  background: var(--panel-raised);
  border-left: 2px solid var(--panel-edge-hi);
  margin: var(--sp-3) 0;
  font-size: var(--sz-13);
  color: var(--text-muted);
}

.platform-label {
  font-family: var(--font-mono);
  font-size: var(--sz-10);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--caution);
  flex-shrink: 0;
  min-width: 4rem;
}


/* ═══════════════════════════════════════════════════════════════
   BADGE
═══════════════════════════════════════════════════════════════ */

.badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: var(--sz-10);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px var(--sp-2);
  border: 1px solid;
  vertical-align: middle;
}
.badge-required { color: var(--go);       border-color: rgba(57, 255, 106, 0.3);  background: var(--go-dim); }
.badge-optional { color: var(--caution);  border-color: rgba(255, 182, 39, 0.3); background: var(--caution-dim); }
.badge-manual   { color: var(--text-dim); border-color: var(--panel-edge);        background: transparent; }
.badge-caution  { color: var(--caution);  border-color: rgba(255, 182, 39, 0.3);  background: var(--caution-dim); }


/* ═══════════════════════════════════════════════════════════════
   FILTER BAR (mods page)
═══════════════════════════════════════════════════════════════ */

.filter-bar {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: var(--sp-6);
  padding: var(--sp-3) var(--sp-4);
  background: var(--panel);
  border: 1px solid var(--panel-edge);
}

.filter-bar-label {
  font-family: var(--font-mono);
  font-size: var(--sz-11);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  margin-right: var(--sp-2);
}

.filter-btn {
  font-family: var(--font-mono);
  font-size: var(--sz-11);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  padding: var(--sp-1) var(--sp-3);
  border: 1px solid var(--panel-edge);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--dur-base), color var(--dur-base), border-color var(--dur-base);
}
.filter-btn:hover { background: var(--panel-raised); color: var(--text); }
.filter-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

.filter-count {
  font-family: var(--font-mono);
  font-size: var(--sz-11);
  color: var(--text-dim);
  letter-spacing: 0.06em;
  margin-left: auto;
}


/* ═══════════════════════════════════════════════════════════════
   MOD TABLE (mods page)
═══════════════════════════════════════════════════════════════ */

.mod-category {
  border: 1px solid var(--panel-edge);
  background: var(--panel);
  margin-bottom: var(--sp-2);
}
.mod-category:first-child { margin-top: 0; }

.mod-category-heading {
  font-family: var(--font-mono);
  font-size: var(--sz-12);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text);
  padding: var(--sp-4) var(--sp-5);
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  list-style: none;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  transition: background var(--dur-base), color var(--dur-base);
}
.mod-category-heading::-webkit-details-marker { display: none; }
.mod-category-heading:hover { background: var(--panel-raised); }
.mod-category-heading .cat-toggle {
  font-size: var(--sz-10);
  color: var(--accent);
  width: 1em;
  display: inline-block;
  transition: transform var(--dur-base);
}
.mod-category[open] .mod-category-heading .cat-toggle { transform: rotate(90deg); }
.mod-category-heading .cat-count {
  margin-left: auto;
  font-size: var(--sz-11);
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}
.mod-category-heading .cat-required,
.mod-category-heading .cat-optional {
  font-size: var(--sz-10);
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 1px var(--sp-2);
  border: 1px solid;
}
.mod-category-heading .cat-required { color: var(--go);      border-color: rgba(57, 255, 106, 0.3); background: var(--go-dim); }
.mod-category-heading .cat-optional { color: var(--caution); border-color: rgba(255, 182, 39, 0.3); background: var(--caution-dim); }

.mod-category-body {
  padding: 0 var(--sp-2) var(--sp-3);
  border-top: 1px solid var(--panel-edge);
}

.mod-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--sz-13);
  margin-bottom: var(--sp-4);
}
.mod-table thead th {
  font-family: var(--font-mono);
  font-size: var(--sz-10);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  text-align: left;
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--panel-edge);
  font-weight: 700;
}
.mod-table tbody tr { border-bottom: 1px solid var(--panel-edge); }
.mod-table tbody tr:last-child { border-bottom: none; }
.mod-table tbody tr:hover { background: var(--panel-raised); }
.mod-table tbody td {
  padding: var(--sp-3) var(--sp-4);
  color: var(--text-muted);
  vertical-align: top;
}
.mod-table tbody td:first-child { color: var(--text); }
.mod-table tbody td a { color: var(--accent); }
.mod-table tbody td.mod-ver {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: var(--sz-12);
  white-space: nowrap;
}

.mod-name-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-bottom: var(--sp-1);
}
.mod-fname {
  font-family: var(--font-mono);
  font-size: var(--sz-13);
  font-weight: 700;
  color: var(--text);
}
.mod-desc {
  font-size: var(--sz-12);
  color: var(--text-dim);
  line-height: 1.5;
  max-width: 60ch;
}
.mod-repo {
  font-family: var(--font-mono);
  font-size: var(--sz-11);
  color: var(--accent);
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.mod-repo:hover { text-decoration: underline; }
.mod-repo-none { color: var(--text-dim); cursor: not-allowed; }


/* ═══════════════════════════════════════════════════════════════
   CHANGELOG ENTRIES
═══════════════════════════════════════════════════════════════ */

.changelog-entry {
  padding: var(--sp-6) 0;
  border-bottom: 1px solid var(--panel-edge);
}
.changelog-entry:last-child { border-bottom: none; padding-bottom: 0; }

.changelog-version {
  font-family: var(--font-mono);
  font-size: var(--sz-18);
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: baseline;
  gap: var(--sp-4);
  flex-wrap: wrap;
  margin-bottom: var(--sp-3);
}

.changelog-date {
  font-family: var(--font-mono);
  font-size: var(--sz-12);
  color: var(--text-dim);
  letter-spacing: 0.08em;
  font-weight: 400;
}

.changelog-entry > p {
  font-size: var(--sz-14);
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: var(--sp-4);
}

.changelog-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.changelog-list li {
  font-size: var(--sz-14);
  color: var(--text-muted);
  padding-left: var(--sp-5);
  position: relative;
  line-height: 1.65;
}
.changelog-list li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--text-dim);
  font-family: var(--font-mono);
}
.changelog-list li strong { color: var(--text); }


/* ═══════════════════════════════════════════════════════════════
   REDUCED MOTION
═══════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  /* Remove scanlines */
  body::after { display: none; }
  /* Remove hero glow */
  .hero::before { display: none; }
  /* Skip reveal animation */
  .reveal { opacity: 1; transform: none; }
}


/* ═══════════════════════════════════════════════════════════════
   MAINTENANCE MODE
   ────────────────────────────────────────────────────────────────
   Used by /maintenance.html and the redirect overlay.
   Tokens already in :root; no new variables.
═══════════════════════════════════════════════════════════════ */

/* Full-page maintenance screen */
.mtn-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-12) var(--sp-6);
  position: relative;
  overflow: hidden;
}

/* Background grid (echoes .hero-bg-grid) */
.mtn-page::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right,  rgba(35, 44, 58, 0.35) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(35, 44, 58, 0.35) 1px, transparent 1px);
  background-size: 56px 56px;
  pointer-events: none;
  z-index: 0;
}

.mtn-card {
  position: relative;
  z-index: 1;
  max-width: 720px;
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  padding: var(--sp-12) var(--sp-10);
  font-family: var(--font-body);
}

/* Corner ticks (echoes .hero-panel corner brackets) */
.mtn-card::before,
.mtn-card::after {
  content: "";
  position: absolute;
  width: var(--tick);
  height: var(--tick);
  border: var(--tick-w) solid var(--caution);
}
.mtn-card::before {
  top: 0; left: 0;
  border-right: none;
  border-bottom: none;
}
.mtn-card::after {
  bottom: 0; right: 0;
  border-left: none;
  border-top: none;
}

.mtn-label {
  font-family: var(--font-mono);
  font-size: var(--sz-12);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--caution);
  margin-bottom: var(--sp-4);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.mtn-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--caution);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--caution-glow);
  animation: blink 1.1s step-end infinite;
}

.mtn-title {
  font-family: var(--font-mono);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--sp-6);
  line-height: 1.15;
}

.mtn-message {
  font-size: var(--sz-18);
  color: var(--text);
  line-height: 1.5;
  margin-bottom: var(--sp-6);
  font-family: var(--font-body);
}

.mtn-message:empty { display: none; }

.mtn-eta {
  font-family: var(--font-mono);
  font-size: var(--sz-14);
  color: var(--caution);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--sp-8);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.mtn-eta-label { color: var(--text-muted); }

.mtn-eta-clock {
  font-weight: 700;
  color: var(--caution);
  font-variant-numeric: tabular-nums;
}

.mtn-meta {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: var(--sp-2) var(--sp-6);
  font-family: var(--font-mono);
  font-size: var(--sz-12);
  color: var(--text-muted);
  margin-bottom: var(--sp-8);
  padding: var(--sp-4);
  background: var(--void);
  border: 1px solid var(--panel-edge);
}

.mtn-meta dt { text-transform: uppercase; letter-spacing: 0.08em; }
.mtn-meta dd { color: var(--text); }

.mtn-actions {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.mtn-btn {
  font-family: var(--font-mono);
  font-size: var(--sz-12);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: var(--sp-3) var(--sp-5);
  background: var(--panel-raised);
  border: 1px solid var(--panel-edge);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--dur-base);
}

.mtn-btn:hover {
  border-color: var(--caution);
  color: var(--caution);
  text-decoration: none;
}

.mtn-btn-primary {
  background: var(--caution);
  color: var(--void);
  border-color: var(--caution);
  font-weight: 700;
}

.mtn-btn-primary:hover {
  background: var(--caution);
  color: var(--void);
  filter: brightness(1.1);
}

.mtn-foot {
  position: relative;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: var(--sz-11);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-top: var(--sp-8);
  text-align: center;
}

/* ── Slim banner for non-maintenance pages when redirect is suppressed ── */
.mtn-slim {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--caution-dim);
  border-bottom: 1px solid var(--caution);
  font-family: var(--font-mono);
  font-size: var(--sz-12);
  color: var(--caution);
  padding: var(--sp-2) var(--sp-6);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  max-width: 100%;
  overflow-x: auto;
}

.mtn-slim-dot {
  width: 6px;
  height: 6px;
  background: var(--caution);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--caution-glow);
  animation: blink 1.1s step-end infinite;
  flex-shrink: 0;
}

.mtn-slim-msg { flex: 1; min-width: 0; }

.mtn-slim-cta {
  color: var(--caution);
  text-decoration: underline;
  flex-shrink: 0;
}

.mtn-slim-cta:hover { color: var(--text); }

@media (max-width: 720px) {
  .mtn-card { padding: var(--sp-8) var(--sp-5); }
  .mtn-meta { grid-template-columns: 1fr; gap: var(--sp-1); }
  .mtn-meta dd { margin-bottom: var(--sp-2); }
}
