:root {
  --bg: #05070d; --ink: #e9edf4; --muted: #8f9ab0; --line: rgba(233, 237, 244, 0.12);
  --red: #e32c2e; --navy: #1f386b; --blue: #8fb4ff;
  --sans: Inter, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --gutter: clamp(16px, 5vw, 72px);
}
* { box-sizing: border-box; }
html { scroll-behavior: auto; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 17px; line-height: 1.5; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; }
h1, h2, h3 { font-weight: 500; letter-spacing: -0.015em; margin: 0; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }

/* loading screen */
#loader { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; transition: opacity 0.8s ease; }
#loader.done { opacity: 0; pointer-events: none; }
/* the full logo is 1950 x 569 in the file; the mark layers cover x 60..700 of it, so they sit at 3.08% from the left and 32.8% wide */
#loader .logo { position: relative; width: min(390px, 78vw); aspect-ratio: 1950 / 569; }
#loader .logo .word { position: absolute; inset: 0; background: url(../brand/mark-word.png) no-repeat; background-size: 100% 100%; }
#loader .mark { position: absolute; left: 3.077%; top: 0; width: 32.82%; height: 100%; }
#loader .mark i { position: absolute; inset: 0; background-repeat: no-repeat; background-size: 100% 100%; }
#loader .arc { background-image: url(../brand/mark-arc.png); }
#loader .line { background-image: url(../brand/mark-line.png); }
#loader .orbit { background-image: url(../brand/mark-orbit.png); }
#loader .pct { font-size: 12px; letter-spacing: 0.3em; color: #8f9ab0; font-variant-numeric: tabular-nums; }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
#fade { position: fixed; inset: 0; background: var(--bg); opacity: 0; pointer-events: none; z-index: 2; }

/* nav */
#nav { position: fixed; top: 0; left: 0; right: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; padding: 18px var(--gutter); background: linear-gradient(rgba(5, 7, 13, 0.92), rgba(5, 7, 13, 0.6) 60%, rgba(5, 7, 13, 0)); }
#nav .logo img { height: 34px; width: auto; display: block; opacity: 0.95; }
#nav nav { display: flex; gap: 26px; align-items: center; font-size: 14px; }
#nav nav a { text-decoration: none; color: #d5dcea; transition: color 0.2s; }
#nav nav a:hover { color: var(--ink); }
#nav nav a.cta { color: var(--ink); border: 1px solid var(--line); padding: 7px 14px; border-radius: 999px; }
#nav nav a.cta:hover { border-color: var(--ink); }

/* hud */
#hud { position: fixed; inset: 0; z-index: 5; pointer-events: none; transition: opacity 0.4s; }
.hud-chapter { position: absolute; left: var(--gutter); bottom: clamp(56px, 12vh, 140px); max-width: 640px; opacity: 0; transition: opacity 0.25s, transform 0.25s; background: rgba(5, 7, 13, 0.72); backdrop-filter: blur(6px); border-left: 2px solid var(--line); border-radius: 4px; padding: 22px 26px 24px; }
.hud-chapter h1 { font-size: clamp(30px, 4.6vw, 58px); line-height: 1.08; max-width: 13ch; }
.hud-chapter h2 { font-size: clamp(24px, 3.1vw, 40px); line-height: 1.15; max-width: 18ch; }
.hud-chapter p { color: #e6ebf4; max-width: 46ch; margin: 16px 0 0; }
.hud-chapter .kicker { font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: #bcd3ff; margin: 0 0 14px; }
.hud-chapter .mono b { color: var(--ink); }
.hud-chapter .nodes { margin-top: 14px; color: #bcd3ff; }
#tpi, #alert { background: rgba(5, 7, 13, 0.9); backdrop-filter: blur(8px); }
.scrollhint { font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: #d5dcea; margin-top: 30px !important; animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }


.figs { display: flex; flex-wrap: wrap; gap: 26px 40px; margin: 26px 0 0; }
.figs dt { font-size: clamp(22px, 2.6vw, 34px); font-weight: 500; letter-spacing: -0.02em; }
.figs dd { margin: 0; color: #d5dcea; font-size: 13px; }

#telemetry { background: rgba(5, 7, 13, 0.72); padding: 12px 14px; border-radius: 4px; backdrop-filter: blur(6px); position: absolute; right: var(--gutter); top: 92px; font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: #c9d1e0; width: 200px; border-left: 2px solid var(--line); transition: opacity 0.3s; }
#telemetry .row { display: flex; justify-content: space-between; margin: 5px 0; }
#telemetry b { font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }
#telemetry .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #5ad17a; margin-right: 7px; vertical-align: 1px; animation: pulse 1.6s infinite; }

#alert { position: absolute; right: var(--gutter); bottom: clamp(56px, 12vh, 140px); border: 1px solid rgba(227, 44, 46, 0.7); border-left: 3px solid var(--red); color: var(--ink); padding: 12px 16px; border-radius: 4px; line-height: 1.6; font-size: 12.5px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35); opacity: 0; transform: translateY(8px); transition: opacity 0.3s, transform 0.3s; max-width: 46ch; }
#alert b { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
#alert i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--red); margin-right: 10px; animation: pulse 1s infinite; }
#alert.on { opacity: 1; transform: none; }

/* the magnifier: the flagged site as the operator sees it. Scroll-driven: the 5 m thermal frame finds the anomaly, then the
   view zooms into it and the 0.46 m multispectral frame identifies what it is. */
#inset { position: absolute; right: var(--gutter); bottom: clamp(40px, 8vh, 90px); width: 400px; background: rgba(5, 7, 13, 0.82); backdrop-filter: blur(6px); border: 1px solid rgba(227, 44, 46, 0.45); border-radius: 4px; overflow: hidden; opacity: 0; transform: translateY(8px); transition: opacity 0.35s, transform 0.35s; }
#inset.on { opacity: 1; transform: none; }
#inset .inset-head, #inset .inset-foot { display: flex; justify-content: space-between; padding: 7px 10px; font-size: 10.5px; color: #c9d1e0; }
#inset .inset-foot { color: var(--muted); border-top: 1px solid var(--line); }
#inset .inset-foot span:last-child { color: #7f899e; }
#inset .inset-view { position: relative; width: 400px; height: 250px; overflow: hidden; background: #000; }
#inset .inset-frame { position: absolute; inset: 0; will-change: transform, opacity; }
#inset .inset-frame.thermal { transform-origin: 51.9% 51.6%; }
#inset .inset-frame.optical { transform-origin: 59% 49%; opacity: 0; }
#inset img { display: block; width: 100%; height: 100%; object-fit: cover; }
#inset .thermal img { filter: contrast(1.04); }
#inset .optical img { filter: contrast(1.05); }
#inset em { font-style: normal; }
#inset .mode em { display: none; } #inset.ir .mode em.ir { display: inline; } #inset.rgb .mode em.rgb { display: inline; }
#inset .pipe { position: absolute; left: 37.5%; top: 0; bottom: 0; width: 0; border-left: 1.5px dashed rgba(199, 234, 89, 0.85); }
#inset .pipe span { position: absolute; left: 8px; top: 8%; }
#inset .pipe span, #inset .anom span, #inset .det span { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase; color: #dfe9c2; background: rgba(5, 7, 13, 0.72); padding: 2px 6px; border-left: 2px solid #c7ea59; white-space: nowrap; line-height: 1.25; }
#inset .pipe span b { display: block; font-weight: 600; color: #e9f5c9; }
#inset .anom { position: absolute; left: 51.9%; top: 51.6%; width: 9%; height: 6%; transform: translate(-50%, -50%); border: 1.2px solid #c7ea59; opacity: 0; }
#inset .anom span { position: absolute; left: 100%; top: 50%; margin-left: 10px; transform: translateY(-50%); }
#inset .anom span, #inset .det span { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase; color: #dfe9c2; background: rgba(5, 7, 13, 0.72); padding: 2px 6px; border-left: 2px solid #c7ea59; white-space: nowrap; line-height: 1.25; }
#inset .anom span b, #inset .det span b { display: block; font-weight: 600; color: #e9f5c9; }
#inset .det { position: absolute; border: 1.2px solid #c7ea59; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(0, 0, 0, 0.35); opacity: 0; }
#inset.boxes .det { animation: detin 0.5s ease-out forwards; }
#inset.boxes .det:nth-child(3) { animation-delay: 0.35s; }
@keyframes detin { from { opacity: 0; transform: scale(1.15); } to { opacity: 1; transform: none; } }
#inset .det span { position: absolute; left: -1.5px; bottom: 100%; margin-bottom: 3px; }
#inset .det span.below { bottom: auto; top: 100%; margin: 3px 0 0; }
#inset .sweep { position: absolute; left: 0; right: 0; top: 0; height: 2px; background: linear-gradient(90deg, rgba(199, 234, 89, 0), rgba(199, 234, 89, 0.9), rgba(199, 234, 89, 0)); box-shadow: 0 0 12px rgba(199, 234, 89, 0.6); opacity: 0; pointer-events: none; }
#inset.on .sweep { animation: sweep 1.6s ease-in-out 1 forwards; }
@keyframes sweep { 0% { top: 0; opacity: 1; } 90% { opacity: 1; } 100% { top: 100%; opacity: 0; } }
#inset .c { position: absolute; width: 14px; height: 14px; border: 1.5px solid #c7ea59; opacity: 0.9; }
#inset .tl { top: 6px; left: 6px; border-right: 0; border-bottom: 0; } #inset .tr { top: 6px; right: 6px; border-left: 0; border-bottom: 0; }
#inset .bl { bottom: 6px; left: 6px; border-right: 0; border-top: 0; } #inset .br { bottom: 6px; right: 6px; border-left: 0; border-top: 0; }
#tpi { position: absolute; transform: translate(-50%, -100%); color: #ff6b6b; background: rgba(5, 7, 13, 0.7); border: 1px solid rgba(227, 44, 46, 0.6); padding: 5px 9px; border-radius: 3px; white-space: nowrap; opacity: 0; transition: opacity 0.2s; font-size: 11px; }

/* scroll spacers */
#chapters { position: relative; z-index: 1; }
.ch { height: 160vh; }
.ch#top { height: 130vh; }
.ch#ch-5 { height: 190vh; }

/* static sections */
main { position: relative; z-index: 3; }
.static { position: relative; background: var(--bg); padding: clamp(72px, 10vw, 140px) var(--gutter); border-top: 1px solid var(--line); }
.static h2 { font-size: clamp(28px, 3.4vw, 44px); margin-bottom: 40px; max-width: 20ch; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 28px; }
.cards article { border-top: 1px solid var(--line); padding-top: 22px; }
.cards h3 { font-size: 19px; margin-bottom: 10px; }
.cards p { color: var(--muted); margin: 0; font-size: 16px; }
.figrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 28px; margin: 0; }
.figrow dt { font-size: clamp(30px, 3.4vw, 46px); font-weight: 500; letter-spacing: -0.02em; }
.figrow dd { margin: 6px 0 0; color: var(--muted); font-size: 14px; max-width: 24ch; }
.note { color: var(--muted); font-size: 14px; max-width: 70ch; margin-top: 40px; }
/* programme: what exists */
#programme .lead { color: #d5dcea; font-size: 17px; max-width: 78ch; margin: -14px 0 40px; }
#programme .photos { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin-bottom: 44px; }
#programme figure { margin: 0; }
#programme figure img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 3px; filter: saturate(0.85); }
#programme figcaption { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-top: 8px; }
.inventory { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 26px 40px; margin: 0; }
.inventory div { border-top: 1px solid var(--line); padding-top: 16px; }
.inventory dt { font-size: 17px; font-weight: 500; margin-bottom: 6px; }
.inventory dd { margin: 0; color: var(--muted); font-size: 15px; max-width: 48ch; }
.people { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 28px; max-width: 640px; }
.people div { display: grid; gap: 4px; border-top: 1px solid var(--line); padding-top: 18px; }
.people span { color: var(--muted); font-size: 15px; }
.people a { color: var(--blue); text-decoration: none; font-size: 15px; }
.people a:hover { text-decoration: underline; }
footer { padding: 40px var(--gutter) 60px; display: flex; flex-wrap: wrap; gap: 12px 40px; justify-content: space-between; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); background: var(--bg); position: relative; }
footer a { color: var(--muted); }

@media (max-width: 760px) {
  #nav nav a:not(.cta) { display: none; }
  #telemetry { display: none; }
  #alert { left: var(--gutter); right: var(--gutter); bottom: auto; top: 84px; max-width: none; font-size: 11.5px; }
  .hud-chapter { right: var(--gutter); bottom: 36px; padding: 18px 18px 20px; max-width: none; }
  .hud-chapter h1 { font-size: 30px; max-width: none; }
  .hud-chapter h2 { font-size: 23px; max-width: none; }
  .hud-chapter p { font-size: 15px; margin-top: 12px; }
  .figs { gap: 16px 28px; margin-top: 18px; } .figs dt { font-size: 22px; }
  /* the magnifier moves to the top on a phone, full width, the chapter card keeps the bottom */
  #inset { left: var(--gutter); right: var(--gutter); top: 84px; bottom: auto; width: auto; }
  #inset .inset-view { width: 100%; height: 44vw; }
  #inset .inset-head, #inset .inset-foot { font-size: 9.5px; padding: 6px 8px; }
  #inset .mode { min-width: 0; }
  #tpi { font-size: 10px; }
  .static { padding: 56px var(--gutter); }
  .static h2 { font-size: 28px; margin-bottom: 24px; }
  #programme .lead { font-size: 15px; margin: -6px 0 28px; }
  .people { gap: 18px; }
  footer { font-size: 12px; padding: 28px var(--gutter) 40px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .hud-chapter { bottom: 24px; max-width: 60vw; padding: 14px 18px; }
  .hud-chapter h1 { font-size: 24px; } .hud-chapter h2 { font-size: 20px; } .hud-chapter p { font-size: 14px; margin-top: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .scrollhint, #telemetry .dot, #alert i { animation: none; }
}
