/* ═══════════════════════════════════════════════════════════
   THE UNOFFICIAL NARAMO WIKI — main.css
   Nuclear green (primary) · Cold-war steel · Classified amber
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;600;700;900&family=Rajdhani:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600&family=Share+Tech+Mono&display=swap');

/* ── TOKENS ─────────────────────────────────────────────── */
:root {
  /* Backgrounds */
  --void:        #050806;
  --concrete:    #0b100a;
  --panel:       #101510;
  --panel-raised:#162019;
  --panel-hover: #1c2a1c;

  /* Borders */
  --border-dim:  rgba(0,255,65,.08);
  --border-mid:  rgba(0,255,65,.18);
  --border-act:  #00ff41;

  /* Nuclear green */
  --green:       #00ff41;
  --green-600:   #00cc34;
  --green-400:   #009c28;
  --green-muted: rgba(0,255,65,.08);
  --green-glow:  rgba(0,255,65,.18);
  --green-glow2: rgba(0,255,65,.35);

  /* Steel */
  --steel-100:   #c4d4de;
  --steel-300:   #8aa4b8;
  --steel-500:   #546e7e;
  --steel-700:   #2c4050;
  --steel-900:   #0e1a22;

  /* Amber */
  --amber:       #f5a623;
  --amber-600:   #c47f00;
  --amber-glow:  rgba(245,166,35,.14);

  /* Red */
  --red:         #ff3c3c;
  --red-glow:    rgba(255,60,60,.18);

  /* Text */
  --tx-primary:  #cce8cc;
  --tx-secondary:#6a8a6a;
  --tx-muted:    #38543a;
  --tx-header:   #e4f4e4;
  --tx-amber:    #ffc857;
  --tx-steel:    #8aa4b8;

  /* Layout */
  --nav-h:       64px;
  --sidebar-w:   280px;
  --max-w:       1200px;
  --pad:         clamp(1rem, 3vw, 2rem);

  /* Fonts */
  --f-display:   'Orbitron', monospace;
  --f-heading:   'Rajdhani', sans-serif;
  --f-body:      'Inter', system-ui, sans-serif;
  --f-mono:      'Share Tech Mono', monospace;

  /* Effects */
  --glow-green:  0 0 12px rgba(0,255,65,.4), 0 0 40px rgba(0,255,65,.15);
  --glow-amber:  0 0 12px rgba(245,166,35,.4), 0 0 40px rgba(245,166,35,.1);
  --shadow-card: 0 4px 24px rgba(0,0,0,.5);
  --shadow-panel:0 8px 48px rgba(0,0,0,.7);

  /* Transitions */
  --ease:        cubic-bezier(.4,0,.2,1);
  --t:           .2s cubic-bezier(.4,0,.2,1);
  --t-slow:      .4s cubic-bezier(.4,0,.2,1);
}

/* ── RESET ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--f-body);
  background: var(--void);
  color: var(--tx-primary);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--green); text-decoration: none; transition: color var(--t); }
a:hover { color: #fff; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
ul, ol { list-style: none; }

/* ── SCROLLBAR ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--concrete); }
::-webkit-scrollbar-thumb { background: var(--green-400); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--green); }
::selection { background: rgba(0,255,65,.25); color: #fff; }

/* ── LAYOUT ──────────────────────────────────────────────── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--pad); }
.wiki-main { padding-top: var(--nav-h); min-height: calc(100vh - var(--nav-h)); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 1.25rem; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill,minmax(240px,1fr)); gap: 1.25rem; }
.grid-content { display: grid; grid-template-columns: 1fr 300px; gap: 2rem; align-items: start; }

/* ── HEADER / NAVBAR ─────────────────────────────────────── */
.wiki-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 900;
  height: var(--nav-h);
  background: rgba(5,8,6,.92);
  border-bottom: 1px solid var(--border-mid);
  backdrop-filter: blur(12px);
  display: flex; align-items: center;
  transition: box-shadow var(--t);
}
.wiki-header.scrolled { box-shadow: 0 4px 30px rgba(0,0,0,.6), 0 0 0 1px var(--border-dim); }
.header-inner {
  display: flex; align-items: center; gap: 1.5rem;
  max-width: var(--max-w); margin: 0 auto; padding: 0 var(--pad); width: 100%;
}

/* Logo */
.wiki-logo {
  font-family: var(--f-display); font-weight: 700; font-size: .85rem;
  color: var(--green); letter-spacing: .08em;
  display: flex; align-items: center; gap: .5rem;
  white-space: nowrap; flex-shrink: 0;
  text-shadow: var(--glow-green);
  transition: text-shadow var(--t);
}
.wiki-logo:hover { color: #fff; text-shadow: 0 0 20px rgba(0,255,65,.6), 0 0 60px rgba(0,255,65,.2); }
.logo-symbol { font-size: 1.4rem; animation: nuke-pulse 3s ease-in-out infinite; }
.logo-text span { color: var(--tx-amber); }

/* Nav links */
.wiki-nav { display: flex; align-items: stretch; gap: .1rem; flex: 1; justify-content: center; }
.nav-item { position: relative; display: flex; align-items: stretch; }
.nav-link {
  font-family: var(--f-heading); font-weight: 600; font-size: .78rem;
  letter-spacing: .12em; text-transform: uppercase; color: var(--tx-secondary);
  padding: 0 .8rem; display: flex; align-items: center; gap: .3rem;
  transition: color var(--t); position: relative; white-space: nowrap;
}
.nav-link::after {
  content: ''; position: absolute; bottom: 0; left: 50%; right: 50%; height: 2px;
  background: var(--green); transition: left var(--t), right var(--t);
  box-shadow: 0 0 8px var(--green);
}
.nav-item:hover .nav-link, .nav-item.active .nav-link { color: var(--green); }
.nav-item:hover .nav-link::after, .nav-item.active .nav-link::after { left: 0; right: 0; }
.nav-chevron { font-size: .65rem; transition: transform var(--t); }
.nav-item:hover .nav-chevron { transform: rotate(90deg); }

/* Header right */
.header-right { display: flex; align-items: center; gap: .75rem; flex-shrink: 0; }
.search-wrap { position: relative; }
.search-input {
  background: var(--panel); border: 1px solid var(--border-dim); border-radius: 4px;
  color: var(--tx-primary); font-family: var(--f-mono); font-size: .8rem;
  padding: .45rem .9rem .45rem 2.2rem; width: 180px;
  transition: border-color var(--t), box-shadow var(--t), width var(--t);
  outline: none;
}
.search-input:focus { border-color: var(--green); box-shadow: 0 0 0 2px var(--green-glow); width: 220px; }
.search-input::placeholder { color: var(--tx-muted); }
.search-icon {
  position: absolute; left: .7rem; top: 50%; transform: translateY(-50%);
  color: var(--tx-muted); font-size: .85rem; pointer-events: none;
}
.sidebar-toggle {
  width: 38px; height: 38px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 5px;
  border-radius: 4px; border: 1px solid var(--border-dim);
  transition: border-color var(--t), background var(--t);
}
.sidebar-toggle:hover { border-color: var(--green); background: var(--green-muted); }
.sidebar-toggle span {
  display: block; width: 18px; height: 1.5px; background: var(--tx-secondary);
  transition: background var(--t), transform var(--t);
}
.sidebar-toggle:hover span { background: var(--green); }

/* ── MEGA MENU ────────────────────────────────────────────── */
.mega-panel {
  position: fixed; top: var(--nav-h); left: 0; right: 0; z-index: 800;
  background: rgba(10,14,10,.97);
  border-bottom: 2px solid var(--border-mid);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-panel);
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateY(-10px);
  transition: opacity var(--t), visibility var(--t), transform var(--t);
}
.nav-item:hover .mega-panel,
.nav-item:focus-within .mega-panel { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0); }
.mega-inner {
  max-width: var(--max-w); margin: 0 auto; padding: 1.75rem var(--pad);
  display: flex; gap: 2.5rem;
}
.mega-col { min-width: 160px; }
.mega-col-head {
  font-family: var(--f-display); font-size: .65rem; font-weight: 700;
  letter-spacing: .2em; text-transform: uppercase; color: var(--green);
  margin-bottom: 1rem; padding-bottom: .5rem;
  border-bottom: 1px solid var(--border-mid);
}
.mega-col a {
  display: flex; align-items: center; gap: .5rem;
  font-family: var(--f-heading); font-weight: 500; font-size: .9rem;
  color: var(--tx-secondary); padding: .35rem 0;
  transition: color var(--t), gap var(--t);
}
.mega-col a::before { content: '›'; color: var(--tx-muted); transition: color var(--t); }
.mega-col a:hover { color: var(--green); gap: .75rem; }
.mega-col a:hover::before { color: var(--green); }
.mega-divider { width: 1px; background: var(--border-dim); flex-shrink: 0; }

/* ── SIDEBAR ─────────────────────────────────────────────── */
.sidebar-overlay {
  position: fixed; inset: 0; z-index: 850;
  background: rgba(0,0,0,.7); backdrop-filter: blur(4px);
  opacity: 0; visibility: hidden; transition: opacity var(--t-slow), visibility var(--t-slow);
}
.sidebar-overlay.open { opacity: 1; visibility: visible; }
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 860;
  width: var(--sidebar-w); background: var(--concrete);
  border-right: 1px solid var(--border-mid);
  transform: translateX(-100%);
  transition: transform var(--t-slow) var(--ease);
  display: flex; flex-direction: column; overflow: hidden;
}
.sidebar.open { transform: translateX(0); box-shadow: 4px 0 40px rgba(0,255,65,.08); }
.sidebar-head {
  padding: 1rem 1.25rem; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border-mid); flex-shrink: 0;
  background: var(--panel);
}
.sidebar-title { font-family: var(--f-display); font-size: .7rem; letter-spacing: .2em; color: var(--green); }
.sidebar-close {
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  color: var(--tx-secondary); border-radius: 3px; font-size: 1.1rem;
  transition: color var(--t), background var(--t);
}
.sidebar-close:hover { color: var(--red); background: var(--red-glow); }
.sidebar-body { overflow-y: auto; flex: 1; padding: .75rem 0; }
.sidebar-section { border-bottom: 1px solid var(--border-dim); }
.sidebar-cat {
  display: flex; align-items: center; gap: .65rem; width: 100%;
  padding: .65rem 1.25rem; color: var(--tx-secondary);
  font-family: var(--f-heading); font-weight: 600; font-size: .88rem; letter-spacing: .05em;
  transition: color var(--t), background var(--t);
}
.sidebar-cat:hover { color: var(--green); background: var(--green-muted); }
.sidebar-cat.expanded { color: var(--green); }
.cat-icon { font-size: 1rem; width: 20px; text-align: center; }
.cat-label { flex: 1; }
.cat-arrow { font-size: .7rem; transition: transform var(--t); }
.sidebar-cat.expanded .cat-arrow { transform: rotate(90deg); }
.sidebar-items { overflow: hidden; max-height: 0; transition: max-height .3s var(--ease); }
.sidebar-items.open { max-height: 500px; }
.sidebar-items a {
  display: block; padding: .45rem 1.25rem .45rem 3rem;
  font-size: .83rem; color: var(--tx-muted);
  transition: color var(--t), background var(--t), border-left var(--t);
  border-left: 2px solid transparent;
}
.sidebar-items a:hover { color: var(--green); background: var(--green-muted); border-left-color: var(--green); }

/* ── HERO (homepage) ─────────────────────────────────────── */
.hero {
  min-height: 100vh; display: flex; align-items: center;
  position: relative; overflow: hidden;
  background: var(--void);
  background-image:
    linear-gradient(rgba(0,255,65,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,255,65,.025) 1px, transparent 1px);
  background-size: 44px 44px;
}
.hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg,transparent,transparent 2px,rgba(0,0,0,.12) 2px,rgba(0,0,0,.12) 4px);
  animation: scanlines 10s linear infinite;
}
.hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 70% 50%, rgba(0,255,65,.04) 0%, transparent 65%);
}
.hero-inner {
  position: relative; z-index: 2;
  max-width: var(--max-w); margin: 0 auto; padding: var(--pad);
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 3rem; width: 100%;
}
.hero-eyebrow {
  font-family: var(--f-display); font-size: .65rem; letter-spacing: .3em;
  color: var(--amber); text-transform: uppercase;
  display: flex; align-items: center; gap: .75rem; margin-bottom: 1.25rem;
}
.hero-eyebrow::before { content: ''; width: 32px; height: 1px; background: var(--amber); }
.hero-title {
  font-family: var(--f-display); font-weight: 900;
  font-size: clamp(1.8rem, 4.5vw, 3.4rem); line-height: 1.1;
  color: var(--tx-header); letter-spacing: .04em; margin-bottom: 1rem;
  text-shadow: 0 0 40px rgba(0,255,65,.15);
}
.hero-title .highlight { color: var(--green); text-shadow: var(--glow-green); display: block; }
.hero-subtitle {
  font-family: var(--f-mono); font-size: clamp(.8rem, 1.5vw, .95rem);
  color: var(--tx-secondary); margin-bottom: 2rem; line-height: 1.8;
  max-width: 520px;
}
.hero-subtitle .cursor { animation: blink .8s step-end infinite; color: var(--green); }
.hero-tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2rem; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero-symbol {
  font-size: clamp(6rem, 12vw, 10rem); color: var(--green);
  animation: nuke-pulse 3s ease-in-out infinite, spin-slow 30s linear infinite;
  filter: drop-shadow(0 0 30px rgba(0,255,65,.4));
  flex-shrink: 0; user-select: none;
  opacity: .7;
}

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--f-heading); font-weight: 600; font-size: .9rem;
  letter-spacing: .1em; text-transform: uppercase;
  padding: .7rem 1.6rem; border-radius: 3px; border: 1px solid transparent;
  transition: all var(--t); white-space: nowrap;
}
.btn-primary {
  background: var(--green); color: #050806; border-color: var(--green);
  box-shadow: 0 0 20px rgba(0,255,65,.25);
}
.btn-primary:hover {
  background: #fff; color: #050806; border-color: #fff;
  box-shadow: 0 0 30px rgba(255,255,255,.2);
}
.btn-outline { background: transparent; color: var(--green); border-color: var(--border-mid); }
.btn-outline:hover { border-color: var(--green); background: var(--green-muted); color: var(--green); box-shadow: var(--glow-green); }
.btn-steel { background: transparent; color: var(--tx-steel); border-color: var(--steel-700); }
.btn-steel:hover { border-color: var(--steel-300); color: var(--steel-100); background: var(--steel-900); }
.btn-amber { background: var(--amber); color: #050806; border-color: var(--amber); }
.btn-amber:hover { background: var(--tx-amber); color: #050806; box-shadow: var(--glow-amber); }
.btn-sm { padding: .45rem 1rem; font-size: .78rem; }

/* ── SECTION CARDS (homepage grid) ──────────────────────── */
.section-grid { padding: 4rem 0; }
.section-label {
  font-family: var(--f-display); font-size: .65rem; letter-spacing: .25em;
  color: var(--tx-muted); text-transform: uppercase; margin-bottom: .5rem;
}
.section-title {
  font-family: var(--f-heading); font-weight: 700; font-size: 1.6rem;
  color: var(--tx-header); margin-bottom: 2rem;
}
.section-title span { color: var(--green); }
.wiki-card {
  background: var(--panel); border: 1px solid var(--border-dim);
  border-radius: 6px; padding: 1.5rem; position: relative; overflow: hidden;
  transition: border-color var(--t), transform var(--t), box-shadow var(--t);
  display: flex; flex-direction: column; gap: .75rem;
}
.wiki-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--card-accent, var(--green));
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--t);
}
.wiki-card:hover { border-color: var(--border-mid); transform: translateY(-3px); box-shadow: var(--shadow-card), 0 0 20px var(--green-glow); }
.wiki-card:hover::before { transform: scaleX(1); }
.card-icon { font-size: 2rem; line-height: 1; }
.card-name {
  font-family: var(--f-heading); font-weight: 700; font-size: 1.1rem;
  color: var(--tx-header); letter-spacing: .04em;
}
.card-desc { font-size: .83rem; color: var(--tx-secondary); flex: 1; }
.card-link {
  font-family: var(--f-heading); font-size: .78rem; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--green);
  display: flex; align-items: center; gap: .4rem; transition: gap var(--t);
}
.wiki-card:hover .card-link { gap: .75rem; }

/* Accent variants */
.accent-green { --card-accent: var(--green); }
.accent-amber { --card-accent: var(--amber); }
.accent-steel { --card-accent: var(--steel-300); }
.accent-red   { --card-accent: var(--red); }

/* ── PAGE HEADER (inner pages) ───────────────────────────── */
.page-header {
  background: var(--concrete); border-bottom: 1px solid var(--border-dim);
  padding: 2.5rem 0 2rem; position: relative; overflow: hidden;
}
.page-header::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--green), transparent);
}
.page-eyebrow {
  font-family: var(--f-display); font-size: .6rem; letter-spacing: .25em;
  color: var(--tx-muted); text-transform: uppercase; margin-bottom: .75rem;
}
.page-title {
  font-family: var(--f-display); font-weight: 700;
  font-size: clamp(1.4rem, 3vw, 2rem); color: var(--tx-header);
  letter-spacing: .04em; margin-bottom: .5rem;
}
.page-title .pg-accent { color: var(--green); }
.page-desc { font-size: .9rem; color: var(--tx-secondary); max-width: 600px; }
.page-meta { display: flex; gap: 1.5rem; margin-top: 1rem; flex-wrap: wrap; }
.meta-item {
  display: flex; align-items: center; gap: .4rem;
  font-family: var(--f-mono); font-size: .75rem; color: var(--tx-muted);
}
.meta-item strong { color: var(--tx-secondary); }

/* ── BREADCRUMB ──────────────────────────────────────────── */
.breadcrumb {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  font-family: var(--f-mono); font-size: .75rem; padding: .75rem 0;
  border-bottom: 1px solid var(--border-dim); margin-bottom: 1.5rem;
}
.breadcrumb a { color: var(--tx-muted); }
.breadcrumb a:hover { color: var(--green); }
.breadcrumb-sep { color: var(--tx-muted); }
.breadcrumb-current { color: var(--tx-secondary); }

/* ── WIKI CONTENT (auto-styles all semantic HTML) ────────── */
.wiki-content { max-width: 860px; }
.wiki-content > * + * { margin-top: 1rem; }

.wiki-content h1 {
  font-family: var(--f-display); font-weight: 700;
  font-size: clamp(1.4rem, 2.5vw, 1.8rem); color: var(--tx-header);
  letter-spacing: .04em; padding-bottom: .75rem;
  border-bottom: 1px solid var(--border-mid); margin-top: 2rem; margin-bottom: 1.5rem;
  display: flex; align-items: center; gap: .75rem;
}
.wiki-content h1::before { content: ''; width: 4px; height: 1.2em; background: var(--green); border-radius: 2px; display: block; box-shadow: 0 0 8px var(--green); flex-shrink: 0; }

.wiki-content h2 {
  font-family: var(--f-heading); font-weight: 700; font-size: 1.25rem;
  color: var(--tx-header); margin-top: 2rem; margin-bottom: .75rem;
  display: flex; align-items: center; gap: .6rem; letter-spacing: .03em;
}
.wiki-content h2::before { content: ''; width: 3px; height: .9em; background: var(--amber); border-radius: 2px; display: block; }

.wiki-content h3 {
  font-family: var(--f-heading); font-weight: 600; font-size: 1.05rem;
  color: var(--green); margin-top: 1.5rem; margin-bottom: .5rem; letter-spacing: .04em;
}
.wiki-content h4 {
  font-family: var(--f-heading); font-weight: 600; font-size: .95rem;
  color: var(--tx-steel); text-transform: uppercase; letter-spacing: .1em;
  margin-top: 1.25rem;
}

.wiki-content p { color: var(--tx-primary); line-height: 1.8; }
.wiki-content a { color: var(--green); text-decoration: underline; text-decoration-color: rgba(0,255,65,.3); }
.wiki-content a:hover { text-decoration-color: var(--green); }
.wiki-content strong { color: var(--tx-header); font-weight: 600; }
.wiki-content em { color: var(--tx-amber); font-style: normal; }

.wiki-content ul, .wiki-content ol { padding-left: 1.25rem; }
.wiki-content ul li { list-style: none; position: relative; padding-left: 1rem; color: var(--tx-primary); margin-bottom: .3rem; }
.wiki-content ul li::before { content: '›'; position: absolute; left: 0; color: var(--green); font-weight: bold; }
.wiki-content ol { counter-reset: li; }
.wiki-content ol li { list-style: none; position: relative; padding-left: 1.5rem; counter-increment: li; margin-bottom: .3rem; }
.wiki-content ol li::before { content: counter(li); position: absolute; left: 0; width: 1.1rem; height: 1.1rem; background: var(--panel-raised); border: 1px solid var(--border-mid); border-radius: 2px; display: flex; align-items: center; justify-content: center; font-size: .7rem; font-family: var(--f-mono); color: var(--green); top: .25rem; }

.wiki-content blockquote {
  border-left: 3px solid var(--amber); background: rgba(245,166,35,.05);
  padding: .85rem 1.25rem; margin: 1.5rem 0; border-radius: 0 4px 4px 0;
  font-style: italic; color: var(--tx-secondary);
}
.wiki-content code {
  font-family: var(--f-mono); font-size: .85em; background: var(--panel-raised);
  color: var(--green); padding: .1em .4em; border-radius: 3px;
  border: 1px solid var(--border-dim);
}
.wiki-content pre {
  background: var(--panel-raised); border: 1px solid var(--border-dim); border-radius: 6px;
  padding: 1.25rem; overflow-x: auto; margin: 1.5rem 0;
}
.wiki-content pre code { background: none; border: none; padding: 0; font-size: .85rem; }
.wiki-content hr { border: none; border-top: 1px solid var(--border-dim); margin: 2rem 0; }

/* Auto-styled table inside wiki-content */
.wiki-content table {
  width: 100%; border-collapse: collapse; margin: 1.5rem 0;
  font-size: .88rem; border: 1px solid var(--border-dim); border-radius: 6px; overflow: hidden;
}
.wiki-content table thead th {
  background: var(--panel-raised); color: var(--green); font-family: var(--f-heading);
  font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-size: .78rem;
  padding: .7rem 1rem; text-align: left; border-bottom: 1px solid var(--border-mid);
}
.wiki-content table tbody tr { border-bottom: 1px solid var(--border-dim); transition: background var(--t); }
.wiki-content table tbody tr:hover { background: var(--panel-hover); }
.wiki-content table tbody tr:nth-child(even) { background: rgba(255,255,255,.02); }
.wiki-content table td { padding: .6rem 1rem; color: var(--tx-primary); }
.wiki-content table td:first-child { color: var(--tx-header); font-weight: 500; }

/* ── STANDALONE TABLES ───────────────────────────────────── */
.wiki-table {
  width: 100%; border-collapse: collapse; font-size: .88rem;
  border: 1px solid var(--border-dim); border-radius: 6px; overflow: hidden;
}
.wiki-table thead th {
  background: var(--panel-raised); color: var(--green); font-family: var(--f-heading);
  font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-size: .78rem;
  padding: .7rem 1rem; text-align: left; border-bottom: 1px solid var(--border-mid);
}
.wiki-table tbody tr { border-bottom: 1px solid var(--border-dim); transition: background var(--t); }
.wiki-table tbody tr:hover { background: var(--panel-hover); }
.wiki-table tbody tr:nth-child(even) { background: rgba(255,255,255,.02); }
.wiki-table td { padding: .6rem 1rem; color: var(--tx-primary); }
.wiki-table td:first-child { color: var(--tx-header); font-weight: 500; }
.table-wrap { overflow-x: auto; border-radius: 6px; }

/* ── INFOBOX ─────────────────────────────────────────────── */
.infobox {
  background: var(--panel); border: 1px solid var(--border-mid);
  border-radius: 6px; overflow: hidden;
  width: 100%; position: sticky; top: calc(var(--nav-h) + 1rem);
}
.infobox-head {
  background: var(--panel-raised); padding: .85rem 1rem;
  border-bottom: 1px solid var(--border-mid);
}
.infobox-name {
  font-family: var(--f-heading); font-weight: 700; font-size: 1rem;
  color: var(--tx-header); letter-spacing: .04em;
}
.infobox-type { font-family: var(--f-mono); font-size: .7rem; color: var(--green); margin-top: .2rem; }
.infobox-img {
  width: 100%; aspect-ratio: 16/9; background: var(--panel-raised);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .5rem; position: relative; overflow: hidden;
  border-bottom: 1px solid var(--border-dim);
}
.infobox-img::before {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg,transparent,transparent 3px,rgba(0,255,65,.03) 3px,rgba(0,255,65,.03) 4px);
  animation: scanlines 6s linear infinite;
}
.infobox-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.img-placeholder-icon { font-size: 2.5rem; opacity: .3; position: relative; z-index: 1; }
.img-placeholder-text {
  font-family: var(--f-mono); font-size: .7rem; color: var(--tx-muted);
  position: relative; z-index: 1; letter-spacing: .1em;
}
.infobox-body {}
.infobox-row {
  display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem;
  padding: .55rem 1rem; border-bottom: 1px solid var(--border-dim); font-size: .83rem;
}
.infobox-row:last-child { border-bottom: none; }
.infobox-label { color: var(--tx-muted); font-family: var(--f-mono); font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; flex-shrink: 0; }
.infobox-value { color: var(--tx-primary); text-align: right; font-weight: 500; }
.infobox-tags { padding: .75rem 1rem; display: flex; flex-wrap: wrap; gap: .35rem; border-top: 1px solid var(--border-dim); }

/* ── CALLOUT BOXES ───────────────────────────────────────── */
.callout {
  border-left: 3px solid; border-radius: 0 6px 6px 0;
  padding: 1rem 1.25rem; margin: 1.25rem 0;
  display: flex; gap: .75rem;
}
.callout-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: .1rem; }
.callout-body { flex: 1; }
.callout-title { font-family: var(--f-heading); font-weight: 700; font-size: .88rem; letter-spacing: .06em; text-transform: uppercase; margin-bottom: .25rem; }
.callout-text { font-size: .85rem; color: var(--tx-secondary); line-height: 1.6; }
.callout-text a { color: inherit; text-decoration: underline; }

.callout.tip       { border-color: var(--green); background: rgba(0,255,65,.05); }
.callout.tip .callout-title { color: var(--green); }
.callout.warning   { border-color: var(--amber); background: rgba(245,166,35,.06); }
.callout.warning .callout-title { color: var(--amber); }
.callout.danger    { border-color: var(--red); background: rgba(255,60,60,.06); }
.callout.danger .callout-title { color: var(--red); }
.callout.info      { border-color: var(--steel-300); background: rgba(138,164,184,.06); }
.callout.info .callout-title { color: var(--steel-300); }
.callout.classified {
  border-color: var(--amber); background: rgba(245,166,35,.06);
  border-style: dashed; position: relative;
}
.callout.classified::after {
  content: 'CLASSIFIED'; position: absolute; top: .5rem; right: .75rem;
  font-family: var(--f-display); font-size: .55rem; letter-spacing: .2em;
  color: var(--amber); border: 1px solid var(--amber); padding: .15rem .4rem;
  border-radius: 2px; animation: stamp-glow 2s ease-in-out infinite;
}

/* ── IMAGE PLACEHOLDER (slot) ───────────────────────────── */
.img-slot {
  width: 100%; background: var(--panel-raised);
  border: 1px dashed var(--border-mid); border-radius: 6px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .5rem; position: relative; overflow: hidden; min-height: 200px;
}
.img-slot::before {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg,transparent,transparent 3px,rgba(0,255,65,.025) 3px,rgba(0,255,65,.025) 4px);
  animation: scanlines 8s linear infinite;
}
.img-slot-icon { font-size: 2.5rem; opacity: .25; position: relative; z-index: 1; }
.img-slot-label { font-family: var(--f-mono); font-size: .72rem; color: var(--tx-muted); position: relative; z-index: 1; letter-spacing: .1em; }
.img-slot-hint { font-size: .7rem; color: var(--tx-muted); opacity: .6; position: relative; z-index: 1; }
.img-slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 2; }

/* ── TAGS / BADGES ───────────────────────────────────────── */
.tag {
  display: inline-flex; align-items: center; gap: .3rem;
  font-family: var(--f-mono); font-size: .68rem; letter-spacing: .06em;
  padding: .2rem .55rem; border-radius: 3px; border: 1px solid; white-space: nowrap;
}
.tag-green  { color: var(--green); border-color: rgba(0,255,65,.3); background: rgba(0,255,65,.07); }
.tag-amber  { color: var(--tx-amber); border-color: rgba(245,166,35,.3); background: rgba(245,166,35,.07); }
.tag-steel  { color: var(--tx-steel); border-color: rgba(138,164,184,.25); background: rgba(138,164,184,.06); }
.tag-red    { color: var(--red); border-color: rgba(255,60,60,.3); background: rgba(255,60,60,.07); }
.tag-lg { font-size: .78rem; padding: .3rem .75rem; }

/* ── TABS ────────────────────────────────────────────────── */
.tabs { margin: 1.5rem 0; }
.tab-nav { display: flex; border-bottom: 1px solid var(--border-dim); gap: .25rem; overflow-x: auto; }
.tab-btn {
  font-family: var(--f-heading); font-weight: 600; font-size: .85rem;
  letter-spacing: .06em; color: var(--tx-muted); padding: .65rem 1.25rem;
  border-bottom: 2px solid transparent; white-space: nowrap;
  transition: color var(--t), border-color var(--t); margin-bottom: -1px;
}
.tab-btn:hover { color: var(--tx-secondary); }
.tab-btn.active { color: var(--green); border-bottom-color: var(--green); }
.tab-panel { display: none; padding-top: 1.5rem; }
.tab-panel.active { display: block; }

/* ── STAT BAR ────────────────────────────────────────────── */
.stat-bar { margin-bottom: .75rem; }
.stat-bar-label { display: flex; justify-content: space-between; font-family: var(--f-mono); font-size: .75rem; color: var(--tx-secondary); margin-bottom: .3rem; }
.stat-bar-track { height: 6px; background: var(--panel-raised); border-radius: 3px; overflow: hidden; }
.stat-bar-fill { height: 100%; border-radius: 3px; background: var(--bar-color, var(--green)); transition: width 1s var(--ease); box-shadow: 0 0 6px var(--bar-color, var(--green)); }

/* ── CONTENT LAYOUT ──────────────────────────────────────── */
.content-wrap { padding: 2rem 0 4rem; }
.wiki-body { display: grid; grid-template-columns: 1fr 300px; gap: 2.5rem; align-items: start; }
.wiki-body.no-sidebar { grid-template-columns: 1fr; }
.wiki-body .wiki-content { min-width: 0; }

/* ── PANEL ───────────────────────────────────────────────── */
.panel {
  background: var(--panel); border: 1px solid var(--border-dim);
  border-radius: 6px; overflow: hidden;
}
.panel-head {
  background: var(--panel-raised); padding: .75rem 1rem;
  border-bottom: 1px solid var(--border-dim);
  font-family: var(--f-heading); font-weight: 700; font-size: .85rem;
  color: var(--tx-header); letter-spacing: .06em; text-transform: uppercase;
  display: flex; align-items: center; gap: .5rem;
}
.panel-head-icon { color: var(--green); }
.panel-body { padding: 1rem; }
.panel-row { display: flex; align-items: center; justify-content: space-between; padding: .5rem 0; border-bottom: 1px solid var(--border-dim); font-size: .85rem; }
.panel-row:last-child { border-bottom: none; }
.panel-row-label { color: var(--tx-muted); font-family: var(--f-mono); font-size: .75rem; }
.panel-row-value { color: var(--tx-primary); font-weight: 500; }

/* ── FOOTER ──────────────────────────────────────────────── */
.wiki-footer {
  background: var(--concrete); border-top: 1px solid var(--border-dim);
  padding: 3rem 0 2rem; margin-top: 4rem;
}
.footer-inner { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 2rem; }
.footer-brand .wiki-logo { font-size: .75rem; margin-bottom: .75rem; }
.footer-tagline { font-size: .8rem; color: var(--tx-muted); line-height: 1.6; max-width: 240px; }
.footer-col-head {
  font-family: var(--f-display); font-size: .6rem; letter-spacing: .2em;
  color: var(--green); text-transform: uppercase; margin-bottom: .75rem;
}
.footer-col a { display: block; font-size: .83rem; color: var(--tx-muted); padding: .25rem 0; transition: color var(--t); }
.footer-col a:hover { color: var(--green); }
.footer-bottom {
  border-top: 1px solid var(--border-dim); margin-top: 2rem; padding-top: 1.5rem;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: gap 1rem;
  font-family: var(--f-mono); font-size: .72rem; color: var(--tx-muted);
}
.footer-disclaimer { max-width: 600px; line-height: 1.6; }
.footer-unofficial {
  font-family: var(--f-display); font-size: .6rem; letter-spacing: .2em;
  color: var(--amber); border: 1px solid rgba(245,166,35,.3); padding: .3rem .7rem;
  border-radius: 3px; white-space: nowrap; animation: stamp-glow 3s ease-in-out infinite;
}

/* ── RECENT UPDATES STRIP ────────────────────────────────── */
.updates-strip { background: var(--panel); border-top: 1px solid var(--border-dim); border-bottom: 1px solid var(--border-dim); padding: 2rem 0; }
.updates-grid { display: flex; gap: 1.5rem; overflow-x: auto; padding-bottom: .5rem; }
.update-card {
  flex-shrink: 0; width: 220px; background: var(--panel-raised);
  border: 1px solid var(--border-dim); border-radius: 6px; padding: 1rem;
  transition: border-color var(--t);
}
.update-card:hover { border-color: var(--border-mid); }
.update-card-type { font-family: var(--f-mono); font-size: .68rem; color: var(--tx-muted); margin-bottom: .4rem; }
.update-card-name { font-family: var(--f-heading); font-weight: 600; font-size: .9rem; color: var(--tx-header); }

/* ── HUB PAGE CARDS ──────────────────────────────────────── */
.hub-card {
  background: var(--panel); border: 1px solid var(--border-dim); border-radius: 6px;
  overflow: hidden; transition: border-color var(--t), transform var(--t), box-shadow var(--t);
  text-decoration: none;
}
.hub-card:hover { border-color: var(--green); transform: translateY(-2px); box-shadow: var(--shadow-card), 0 0 20px var(--green-glow); color: inherit; }
.hub-card-img {
  aspect-ratio: 16/9; background: var(--panel-raised);
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem; color: var(--tx-muted); opacity: .4; position: relative; overflow: hidden;
}
.hub-card-img::before {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg,transparent,transparent 3px,rgba(0,0,0,.15) 3px,rgba(0,0,0,.15) 4px);
  pointer-events: none;
}
.hub-card-body { padding: 1rem; }
.hub-card-name { font-family: var(--f-heading); font-weight: 700; font-size: 1rem; color: var(--tx-header); margin-bottom: .35rem; }
.hub-card-desc { font-size: .8rem; color: var(--tx-secondary); margin-bottom: .75rem; }
.hub-card-tags { display: flex; gap: .35rem; flex-wrap: wrap; }

/* ── UTILITY ─────────────────────────────────────────────── */
.text-green   { color: var(--green); }
.text-amber   { color: var(--amber); }
.text-steel   { color: var(--tx-steel); }
.text-muted   { color: var(--tx-muted); }
.text-red     { color: var(--red); }
.text-mono    { font-family: var(--f-mono); }
.text-heading { font-family: var(--f-heading); }
.text-display { font-family: var(--f-display); }
.text-center  { text-align: center; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.flex  { display: flex; }
.flex-gap { display: flex; gap: 1rem; flex-wrap: wrap; }
.glow-green { text-shadow: var(--glow-green); }

/* ── SECTION SEPARATOR ───────────────────────────────────── */
.sep { border: none; border-top: 1px solid var(--border-dim); margin: 2.5rem 0; }
.sep-green { border-color: transparent; background: linear-gradient(90deg, transparent, var(--green), transparent); height: 1px; border: none; margin: 2.5rem 0; }

/* ── REVEAL ANIMATION HOOK ────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.reveal.visible { opacity: 1; transform: none; }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 1024px) {
  .wiki-nav { display: none; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .grid-4 { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 768px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-symbol { display: none; }
  .wiki-body { grid-template-columns: 1fr; }
  .infobox { position: static; }
  .footer-inner { grid-template-columns: 1fr; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .grid-auto { grid-template-columns: 1fr; }
  .search-input { width: 140px; }
  .wiki-logo .logo-text { display: none; }
}
@media (max-width: 480px) {
  :root { --nav-h: 56px; }
  .hero-actions { flex-direction: column; }
  .btn { justify-content: center; }
}

/* ── REDUCED MOTION ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
