/* Self-hosted fonts (no third-party requests) */
@font-face { font-family: "Orbitron"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/orbitron-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Orbitron"; font-style: normal; font-weight: 900; font-display: swap; src: url("/fonts/orbitron-latin-900-normal.woff2") format("woff2"); }
@font-face { font-family: "Rajdhani"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/rajdhani-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Rajdhani"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/rajdhani-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Rajdhani"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/rajdhani-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/jetbrains-mono-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/inter-latin-600-normal.woff2") format("woff2"); }

:root {
  --bg: #03080f;
  --bg-2: #061321;
  --panel: rgba(8, 26, 42, 0.55);
  --panel-edge: rgba(45, 226, 255, 0.22);
  --cyan: #2de2ff;
  --cyan-soft: rgba(45, 226, 255, 0.55);
  --cyan-faint: rgba(45, 226, 255, 0.08);
  --amber: #ffb547;
  --red: #ff4d5e;
  --text: #d4eef8;
  --muted: #7ea3b5;
  --display: "Orbitron", "Rajdhani", system-ui, sans-serif;
  --ui: "Rajdhani", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --read: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --maxw: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at 70% -10%, #0b2a40 0%, var(--bg) 55%) fixed, var(--bg);
  color: var(--text);
  font-family: var(--ui);
  font-size: 18px;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--cyan); text-decoration: none; }
a:hover { color: #fff; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
.mono { font-family: var(--mono); letter-spacing: 0.04em; }
.muted { color: var(--muted); }
::selection { background: var(--cyan); color: var(--bg); }

/* Background layers */
.bg-grid {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(var(--cyan-faint) 1px, transparent 1px),
    linear-gradient(90deg, var(--cyan-faint) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 75%);
}
.bg-scan {
  position: fixed; inset: 0; z-index: 50; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,0.018) 0 1px, transparent 1px 3px);
}

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 24px;
  padding: 14px var(--gutter);
  background: rgba(3, 8, 15, 0.72);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--panel-edge);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--cyan); }
.brand-mark { width: 34px; height: 34px; }
.brand-ring { transform-origin: 32px 32px; animation: spin 18s linear infinite; }
.brand-text { font-family: var(--display); font-weight: 700; letter-spacing: 0.18em; font-size: 15px; color: var(--text); }
.brand-text b { color: var(--cyan); font-weight: 900; margin-left: 4px; }
.nav { display: flex; gap: 6px; margin-left: auto; }
.nav a {
  font-family: var(--mono); font-size: 13px; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--muted); padding: 8px 12px; border: 1px solid transparent;
}
.nav a:hover { color: var(--text); border-color: var(--panel-edge); }
.nav a[aria-current="page"] { color: var(--cyan); border-color: var(--cyan-soft); background: var(--cyan-faint); }
.status { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: #3dff9a; box-shadow: 0 0 10px #3dff9a; animation: pulse 2s ease-in-out infinite; }
.sep { color: var(--cyan-soft); opacity: .6; }

main { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

/* Typography */
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: 0.02em; line-height: 1.12; margin: 0; }
h2 { font-size: clamp(24px, 3vw, 34px); }
h3 { font-size: 17px; letter-spacing: 0.06em; text-transform: uppercase; }
.kicker { color: var(--amber); font-size: 12.5px; letter-spacing: 0.16em; margin: 0 0 14px; text-transform: uppercase; }
.lede { color: var(--muted); font-size: 20px; max-width: 60ch; margin: 16px 0 0; }

/* Hero */
.hero {
  display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: 40px;
  min-height: calc(100vh - 66px); padding: 48px 0;
}
.hero-title { font-size: clamp(38px, 6vw, 76px); font-weight: 900; text-transform: uppercase; }
.hero-title .line { display: block; }
.hero-title .accent {
  background: linear-gradient(90deg, var(--cyan), #9ff4ff 50%, var(--amber));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 22px rgba(45, 226, 255, 0.35));
}
.hero-sub { font-size: 20px; color: var(--muted); max-width: 54ch; margin: 22px 0 0; }
.typer { color: var(--cyan); font-size: 14px; margin: 22px 0 0; min-height: 1.6em; }
.caret, .blink { animation: blink 1s steps(1) infinite; color: var(--amber); }
.cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 14px 22px; border: 1px solid var(--cyan-soft); color: var(--cyan);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  transition: background .2s, color .2s, box-shadow .2s;
}
.btn-primary { background: var(--cyan); color: var(--bg); font-weight: 600; border-color: var(--cyan); }
.btn-primary:hover { background: #fff; color: var(--bg); box-shadow: 0 0 30px rgba(45,226,255,.6); }
.btn-ghost { background: var(--cyan-faint); }
.btn-ghost:hover { background: rgba(45,226,255,.18); color: #fff; }

/* HUD reactor */
.hero-hud { position: relative; aspect-ratio: 1; width: 100%; max-width: 540px; justify-self: center; }
.reactor { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 0 14px rgba(45,226,255,.35)); }
.reactor .r { fill: none; stroke: var(--cyan); }
.r-ticks { stroke-width: 10; stroke-dasharray: 1.5 8.3; opacity: .55; }
.r-ticks-sm { stroke-width: 6; stroke-dasharray: 2 6; opacity: .8; }
.r-thin { stroke-width: 1; opacity: .4; }
.r-arc-a { stroke-width: 3; stroke-dasharray: 240 80 40 80 120 445; }
.r-arc-b { stroke-width: 8; stroke-dasharray: 60 30 10 30; opacity: .45; }
.r-dash { stroke-width: 2; stroke-dasharray: 4 10; }
.r-amber { stroke: var(--amber) !important; stroke-width: 4; stroke-dasharray: 90 50 20 50 150 293; filter: drop-shadow(0 0 6px rgba(255,181,71,.6)); }
.hex { fill: rgba(45,226,255,.06); stroke: var(--cyan); stroke-width: 2; animation: pulse 3s ease-in-out infinite; }
.core { animation: corePulse 2.6s ease-in-out infinite; transform-origin: 200px 200px; }
.core-label { font-family: var(--display); font-weight: 900; font-size: 34px; fill: var(--bg); }
.crosshair line { stroke: var(--amber); stroke-width: 2; }
.spin, .sweep { transform-origin: 200px 200px; transform-box: view-box; }
.s-slow { animation: spin 40s linear infinite; }
.s-rev { animation: spin 26s linear infinite reverse; }
.s-med { animation: spin 16s linear infinite; }
.s-rev-slow { animation: spin 32s linear infinite reverse; }
.s-fast { animation: spin 9s linear infinite; }
.sweep { animation: spin 6s linear infinite; }
.sweep path { fill: url(#coreGlow); opacity: .10; }

.readout {
  position: absolute; display: flex; flex-direction: column; gap: 2px;
  font-size: 12px; color: var(--text); padding: 8px 12px;
  background: rgba(3, 8, 15, .7); border: 1px solid var(--panel-edge); border-left: 2px solid var(--amber);
  backdrop-filter: blur(4px); white-space: nowrap;
}
.readout b { font-weight: 600; color: var(--muted); font-size: 10.5px; letter-spacing: .16em; }
.readout span { color: var(--cyan); font-size: 15px; }
.ro-1 { top: 6%; left: -4%; } .ro-2 { top: 14%; right: -6%; }
.ro-3 { bottom: 16%; left: -8%; } .ro-4 { bottom: 5%; right: -2%; }

/* Telemetry */
.telemetry {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--panel-edge); background: var(--panel);
}
.stat { padding: 26px 24px; border-right: 1px solid var(--panel-edge); position: relative; }
.stat:last-child { border-right: 0; }
.stat::before { content: ""; position: absolute; top: -1px; left: 24px; width: 36px; height: 2px; background: var(--amber); }
.stat-num { font-family: var(--display); font-size: clamp(30px, 4vw, 44px); font-weight: 900; color: var(--cyan); }
.stat-unit { font-family: var(--display); font-size: 22px; color: var(--amber); margin-left: 2px; }
.stat-label { display: block; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .14em; margin-top: 6px; }

/* Sections */
.section { padding: 80px 0 0; }
.section-head { margin-bottom: 28px; }
.page-head { padding-top: 72px; }
.page-head h1 { font-size: clamp(34px, 5vw, 58px); text-transform: uppercase; }
.more { margin: 26px 0 0; }

/* Panels */
.panel {
  position: relative; background: var(--panel); border: 1px solid var(--panel-edge);
  backdrop-filter: blur(6px);
}
.corner { position: absolute; width: 14px; height: 14px; border-color: var(--cyan); border-style: solid; border-width: 0; }
.corner.tl { top: -1px; left: -1px; border-top-width: 2px; border-left-width: 2px; }
.corner.tr { top: -1px; right: -1px; border-top-width: 2px; border-right-width: 2px; }
.corner.bl { bottom: -1px; left: -1px; border-bottom-width: 2px; border-left-width: 2px; }
.corner.br { bottom: -1px; right: -1px; border-bottom-width: 2px; border-right-width: 2px; }

.grid-6 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.sys { padding: 22px 22px 20px; transition: transform .25s, border-color .25s, box-shadow .25s; }
.sys:hover { transform: translateY(-3px); border-color: var(--cyan-soft); box-shadow: 0 0 30px rgba(45,226,255,.12), inset 0 0 30px rgba(45,226,255,.05); }
.sys-head { display: flex; justify-content: space-between; font-size: 11.5px; margin-bottom: 16px; }
.sys-code { color: var(--amber); letter-spacing: .18em; }
.sys-state { color: #3dff9a; }
.sys p { color: var(--muted); margin: 10px 0 18px; font-size: 17px; }
.meter { height: 4px; background: rgba(45,226,255,.12); overflow: hidden; }
.meter span { display: block; height: 100%; width: var(--v); background: linear-gradient(90deg, var(--cyan), var(--amber)); box-shadow: 0 0 10px var(--cyan); transform-origin: left; animation: fill 1.6s ease-out both; }

/* Transmissions list */
.tx-list { display: grid; gap: 12px; }
.tx {
  display: grid; grid-template-columns: 90px 1fr auto; gap: 20px; align-items: center;
  padding: 20px 22px; color: var(--text); transition: border-color .2s, background .2s, transform .2s;
}
.tx:hover { border-color: var(--cyan-soft); background: rgba(12, 40, 62, .6); color: var(--text); transform: translateX(4px); }
.tx-id { color: var(--amber); font-size: 13px; }
.tx-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tx-title { font-family: var(--display); font-size: 19px; font-weight: 700; letter-spacing: .03em; }
.tx:hover .tx-title { color: var(--cyan); }
.tx-desc { color: var(--muted); font-size: 17px; }
.tx-meta { font-size: 12px; color: var(--muted); text-align: right; line-height: 1.7; display: flex; flex-direction: column; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; padding: 3px 8px; border: 1px solid var(--panel-edge); color: var(--cyan); background: var(--cyan-faint); }

/* Terminal */
.terminal { overflow: hidden; }
.term-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--panel-edge); font-size: 12px; color: var(--muted); }
.term-bar span { width: 10px; height: 10px; border-radius: 50%; background: var(--red); }
.term-bar span:nth-child(2) { background: var(--amber); }
.term-bar span:nth-child(3) { background: #3dff9a; }
.term-bar b { margin-left: 8px; font-weight: 400; }
.term-body { margin: 0; padding: 22px; font-size: 14px; line-height: 1.8; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.term-body .p { color: var(--amber); }

/* Article */
.article { max-width: 760px; margin: 0 auto; padding: 64px 0 0; }
.article-head h1 { font-size: clamp(32px, 5vw, 52px); line-height: 1.1; }
.back { display: inline-block; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 28px; }
.article-head { padding-bottom: 32px; margin-bottom: 36px; border-bottom: 1px solid var(--panel-edge); position: relative; }
.article-head::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 80px; height: 2px; background: var(--amber); }
.prose { font-family: var(--read); font-size: 18px; line-height: 1.75; color: #c6dde8; }
.prose > * + * { margin-top: 1.1em; }
.prose p, .prose ul, .prose ol { margin-bottom: 0; }
.prose h2 { font-size: 24px; margin-top: 2em; color: var(--text); }
.prose h2::before { content: "// "; color: var(--amber); }
.prose h3 { margin-top: 1.6em; color: var(--cyan); }
.prose a { text-decoration: underline; text-decoration-color: var(--cyan-soft); text-underline-offset: 3px; }
.prose strong { color: #fff; }
.prose blockquote { margin-left: 0; margin-right: 0; padding: 14px 20px; border-left: 3px solid var(--amber); background: rgba(255,181,71,.06); color: var(--text); font-style: italic; }
.prose code { font-family: var(--mono); font-size: .88em; background: rgba(45,226,255,.1); padding: 2px 6px; color: var(--cyan); }
.prose pre { background: #020a12; border: 1px solid var(--panel-edge); border-left: 3px solid var(--cyan); padding: 18px 20px; overflow-x: auto; }
.prose pre code { background: none; padding: 0; color: #bfefff; font-size: 14px; }
.prose img { max-width: 100%; height: auto; border: 1px solid var(--panel-edge); }
.prose-panel { padding: clamp(22px, 4vw, 40px); }
.prose-panel .prose { max-width: 68ch; }
.article-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 56px; padding-top: 20px; border-top: 1px solid var(--panel-edge); font-size: 12px; letter-spacing: .14em; color: var(--muted); }

/* Footer */
.footer {
  max-width: var(--maxw); margin: 100px auto 0; padding: 26px var(--gutter) 40px;
  display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted);
  border-top: 1px solid var(--panel-edge); text-transform: uppercase; letter-spacing: .12em;
}

/* Boot overlay */
.boot { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: grid; place-items: center; padding: 24px; transition: opacity .5s ease; }
.boot.done { opacity: 0; pointer-events: none; }
.boot[hidden] { display: none; }
.boot-inner { width: min(560px, 100%); }
#boot-log { color: var(--cyan); font-size: 13px; line-height: 1.8; min-height: 11em; margin: 0 0 18px; white-space: pre-wrap; }
#boot-log .ok { color: #3dff9a; }
#boot-log .amb { color: var(--amber); }
.boot-bar { height: 3px; background: rgba(45,226,255,.15); }
.boot-bar span { display: block; height: 100%; width: 0; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); transition: width .2s linear; }
.boot-skip { margin-top: 18px; background: none; border: 1px solid var(--panel-edge); color: var(--muted); font-family: var(--mono); font-size: 12px; letter-spacing: .14em; padding: 8px 14px; cursor: pointer; }
.boot-skip:hover { color: var(--cyan); border-color: var(--cyan-soft); }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes pulse { 50% { opacity: .45; } }
@keyframes corePulse { 50% { transform: scale(.88); opacity: .8; } }
@keyframes fill { from { transform: scaleX(0); } }

/* Responsive */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 40px; }
  .hero-hud { max-width: 420px; order: -1; margin: 0 auto; }
  .grid-6 { grid-template-columns: repeat(2, 1fr); }
  .telemetry { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--panel-edge); }
  .status { display: none; }
}
@media (max-width: 600px) {
  body { font-size: 17px; }
  .topbar { gap: 12px; padding: 12px 16px; }
  .brand-text { display: none; }
  .nav a { padding: 6px 8px; font-size: 11.5px; letter-spacing: .08em; }
  .hero-hud { max-width: 300px; }
  .readout { font-size: 10px; padding: 5px 8px; }
  .readout span { font-size: 12px; }
  .ro-1 { left: -6%; } .ro-2 { right: -8%; } .ro-3 { left: -8%; } .ro-4 { right: -6%; }
  .grid-6 { grid-template-columns: 1fr; }
  .tx { grid-template-columns: 1fr; gap: 8px; }
  .tx-meta { text-align: left; flex-direction: row; gap: 14px; }
  .stat { padding: 20px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
.prose blockquote p { margin: 0; }
.prose .figure { margin: 2em 0; padding: 20px; background: var(--panel); border: 1px solid var(--panel-edge); }
.prose .figure .diagram { display: block; width: 100%; height: auto; }
.prose figcaption { margin-top: 12px; font-family: var(--mono); font-size: 12px; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.prose h3 { text-transform: none; letter-spacing: .02em; font-size: 18px; }
.origin { margin-top: 40px; font-size: 12px; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; }
@media (max-width: 600px) { .prose .figure { padding: 10px; margin-left: -6px; margin-right: -6px; } }
@media (max-width: 720px) {
  .prose .figure { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .prose .figure .diagram { min-width: 680px; }
  .prose .figure figcaption::after { content: "  ◂ scroll ▸"; color: var(--cyan); }
}
.roles { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 26px 0 0; }
.roles li { font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--amber); padding: 5px 10px; border: 1px solid rgba(255,181,71,.35); background: rgba(255,181,71,.06); }
.role-line { color: var(--amber); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; margin: 14px 0 0; }
.author { margin-top: 56px; padding: 24px 26px; }
.author .kicker { margin-bottom: 8px; }
.author-name { font-family: var(--display); font-size: 20px; font-weight: 700; margin: 0; }
.author .role-line { margin-top: 6px; font-size: 12px; }
.author-bio { color: var(--muted); font-size: 17px; margin: 12px 0 0; }
.prose > :first-child { margin-top: 0; }
.timeline { list-style: none; padding: 0; border-left: 2px solid var(--panel-edge); }
.timeline li { position: relative; padding: 0 0 18px 22px; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 8px; width: 10px; height: 10px; background: var(--bg); border: 2px solid var(--cyan); }
.timeline li:first-child::before { background: var(--amber); border-color: var(--amber); box-shadow: 0 0 10px var(--amber); }
.timeline span { display: block; font-size: 12px; color: var(--amber); letter-spacing: .12em; }
.timeline b { color: #fff; margin-right: 8px; }
