:root {
  color-scheme: dark;
  --bg: #050708;
  --panel: #0b0f11;
  --panel-2: #0e1416;
  --line: #263338;
  --text: #d9e2df;
  --muted: #7f9295;
  --cyan: #55e4ea;
  --amber: #efb84b;
  --red: #ed4e4e;
  --violet: #b69cff;
  --reader-scale: 1;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --condensed: "Arial Narrow", "Roboto Condensed", "DIN Condensed", Impact, sans-serif;
  --sans: Inter, Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); }
a { color: inherit; }
button { font: inherit; }
img { display: block; max-width: 100%; }
::selection { background: var(--cyan); color: var(--bg); }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  transform: translateY(-160%);
  padding: 10px 14px;
  background: var(--cyan);
  color: var(--bg);
}
.skip-link:focus { transform: none; }

.system-bar {
  position: sticky;
  z-index: 50;
  top: 0;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgb(5 7 8 / 92%);
  backdrop-filter: blur(16px);
  font: 700 10px/1 var(--mono);
  letter-spacing: .15em;
}
.wordmark { display: inline-flex; align-items: center; gap: 12px; color: var(--cyan); text-decoration: none; letter-spacing: .16em; }
.wordmark-mark { width: 16px; height: 16px; border: 1px solid currentColor; border-radius: 50%; box-shadow: inset 0 0 0 4px var(--bg); background: currentColor; }
.system-coordinates { display: flex; align-items: center; gap: 30px; color: var(--muted); }
.online { color: var(--text); }
.online i { display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); animation: pulse 2.6s ease-in-out infinite; }

.shell { display: grid; grid-template-columns: 238px minmax(0, 1fr); }
.rail {
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 38px 28px 28px;
  border-right: 1px solid var(--line);
  background: #070a0b;
}
.eyebrow { margin: 0 0 18px; color: var(--muted); font: 700 9px/1.4 var(--mono); letter-spacing: .18em; }
.eyebrow.amber { color: var(--amber); }
.rail nav { display: grid; gap: 8px; }
.rail nav a {
  position: relative;
  padding: 10px 12px;
  color: var(--muted);
  font: 700 11px/1.2 var(--mono);
  text-decoration: none;
  transition: .2s ease;
}
.rail nav a::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 2px; background: transparent; }
.rail nav a:hover, .rail nav a.active { color: var(--cyan); background: linear-gradient(90deg, rgb(85 228 234 / 10%), transparent); }
.rail nav a.active::before { background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }
.rail-telemetry { color: #5d6d70; font: 400 8px/1.8 var(--mono); letter-spacing: .08em; }
.rail-telemetry span { color: var(--amber); }
.rail-count { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: end; }
.rail-count strong { color: #223034; font: 400 48px/1 var(--condensed); }
.rail-count span { color: var(--red); font: 700 8px/1.4 var(--mono); letter-spacing: .12em; }

main { min-width: 0; overflow: hidden; }
.hero { min-height: calc(100vh - 56px); display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(420px, .92fr); border-bottom: 1px solid var(--line); }
.hero-copy { display: flex; flex-direction: column; justify-content: center; padding: 80px clamp(36px, 6vw, 96px); }
.hero h1 { margin: 0; font: 800 clamp(62px, 7.4vw, 132px)/.82 var(--condensed); letter-spacing: -.055em; color: #edf5f2; }
.hero h1 span { color: transparent; -webkit-text-stroke: 1px #7d8e90; }
.hero-lead { max-width: 700px; margin: 38px 0 0; padding-left: 26px; border-left: 1px solid var(--cyan); color: #afbfbd; font-size: clamp(16px, 1.3vw, 21px); line-height: 1.65; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.button { min-height: 44px; display: inline-flex; align-items: center; padding: 0 18px; border: 1px solid var(--line); color: var(--text); font: 700 10px/1 var(--mono); letter-spacing: .12em; text-decoration: none; transition: .2s ease; }
.button:hover { border-color: var(--cyan); color: var(--cyan); transform: translateY(-2px); }
.button.primary { border-color: var(--cyan); background: var(--cyan); color: var(--bg); }
.button.primary:hover { box-shadow: 0 0 32px rgb(85 228 234 / 18%); color: var(--bg); }
.hero-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 64px 0 0; }
.hero-facts div { padding-top: 14px; border-top: 1px solid var(--line); }
.hero-facts dt { color: var(--muted); font: 700 8px/1 var(--mono); letter-spacing: .16em; }
.hero-facts dd { margin: 9px 0 0; color: #bdc9c6; font-size: 12px; }

.hero-visual { position: relative; min-height: 640px; overflow: hidden; background: radial-gradient(circle at 72% 45%, #102226 0, #091012 42%, #050708 72%); border-left: 1px solid var(--line); }
.hero-visual::before { content: ""; position: absolute; inset: 0; opacity: .35; background-image: linear-gradient(rgb(85 228 234 / 7%) 1px, transparent 1px), linear-gradient(90deg, rgb(85 228 234 / 7%) 1px, transparent 1px); background-size: 64px 64px; mask-image: radial-gradient(circle at 70% 45%, black, transparent 67%); }
.hero-image { position: absolute; inset: 8% 7% 7% 16%; margin: 0; overflow: hidden; border: 1px solid #344a4f; background: var(--panel); }
.hero-image::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgb(5 7 8 / 72%)); pointer-events: none; }
.hero-image img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.68) contrast(1.08) brightness(.82); transition: transform 8s ease; }
.hero-image:hover img { transform: scale(1.035); }
.hero-image figcaption { position: absolute; z-index: 2; inset: auto 26px 24px; display: flex; justify-content: space-between; gap: 20px; align-items: end; font: 700 9px/1.3 var(--mono); letter-spacing: .12em; }
.hero-image figcaption span { color: var(--cyan); }
.hero-image figcaption strong { max-width: 180px; text-align: right; }
.orbit { position: absolute; z-index: 3; border: 1px solid rgb(85 228 234 / 22%); border-radius: 50%; pointer-events: none; }
.orbit::after { content: ""; position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 18px var(--amber); }
.orbit-a { width: 74%; aspect-ratio: 1; top: 8%; left: 19%; animation: orbit 22s linear infinite; }
.orbit-a::after { top: 8%; left: 20%; }
.orbit-b { width: 48%; aspect-ratio: 1; top: 24%; left: 34%; border-color: rgb(239 184 75 / 17%); animation: orbit 31s linear infinite reverse; }
.orbit-b::after { right: 3%; bottom: 30%; width: 4px; height: 4px; background: var(--cyan); }
.target-label { position: absolute; z-index: 4; right: 8%; top: 10%; text-align: right; color: var(--text); font: 700 12px/1.3 var(--mono); }
.target-label small { color: var(--muted); font-size: 7px; letter-spacing: .14em; }

.section { padding: 100px clamp(28px, 5vw, 80px); border-bottom: 1px solid var(--line); }
.section-header { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 480px); gap: 40px; align-items: end; margin-bottom: 46px; }
.section-header h2 { margin: 0; color: #e5efec; font: 800 clamp(42px, 5vw, 78px)/.9 var(--condensed); letter-spacing: -.035em; }
.section-header > p { margin: 0; color: var(--muted); line-height: 1.7; }
.section-header.compact { grid-template-columns: 1fr; }
.dossier-grid { display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.dossier-card { min-height: 430px; display: flex; flex-direction: column; padding: 28px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--panel); transition: transform .22s ease, background .22s ease; }
.dossier-card:hover { z-index: 2; transform: translateY(-4px); background: linear-gradient(145deg, #0f1a1c, var(--panel)); }
.dossier-card::before { content: ""; width: 42px; height: 2px; margin-bottom: 28px; background: var(--cyan); box-shadow: 0 0 14px rgb(85 228 234 / 38%); }
.dossier-card.amber-card::before { background: var(--amber); box-shadow: 0 0 14px rgb(239 184 75 / 32%); }
.dossier-card.red::before { background: var(--red); box-shadow: 0 0 14px rgb(237 78 78 / 32%); }
.dossier-card.violet::before { background: var(--violet); box-shadow: 0 0 14px rgb(182 156 255 / 32%); }
.card-meta { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font: 700 8px/1.3 var(--mono); letter-spacing: .12em; }
.dossier-card h3 { margin: 44px 0 18px; color: #e4eeeb; font: 800 clamp(30px, 3vw, 50px)/.9 var(--condensed); letter-spacing: -.03em; }
.dossier-card h3 span { font-size: .48em; letter-spacing: 0; color: #a9b8b6; }
.dossier-card > p { margin: 0; color: #91a3a4; line-height: 1.65; }
.card-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: auto; padding: 30px 0 22px; }
.card-tags span { padding: 6px 8px; border: 1px solid var(--line); color: var(--muted); font: 700 7px/1 var(--mono); letter-spacing: .1em; }
.dossier-card > a { display: flex; justify-content: space-between; align-items: center; padding-top: 18px; border-top: 1px solid var(--line); color: var(--text); font: 700 9px/1 var(--mono); letter-spacing: .12em; text-decoration: none; }
.dossier-card > a b { color: var(--cyan); font-size: 18px; transition: transform .2s ease; }
.dossier-card > a:hover b { transform: translate(3px, -3px); }
.registry-error { display: block; padding: 24px; border: 1px solid var(--red); color: var(--red); font: 700 10px/1.5 var(--mono); }

.principles { background: #070a0b; }
.principle-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.principle-grid article { min-height: 290px; padding: 28px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.principle-grid span { color: var(--amber); font: 700 10px/1 var(--mono); }
.principle-grid h3 { margin: 62px 0 16px; font: 800 34px/1 var(--condensed); }
.principle-grid p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; }

.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-flow: dense; gap: 12px; }
.gallery-grid figure { min-width: 0; margin: 0; background: var(--panel); border: 1px solid var(--line); }
.gallery-grid figure.wide { grid-column: span 2; }
.gallery-grid figure.tall { grid-row: span 2; }
.image-button { width: 100%; aspect-ratio: 4 / 5; display: block; padding: 0; overflow: hidden; border: 0; background: var(--panel-2); cursor: zoom-in; }
.wide .image-button { aspect-ratio: 8 / 5; }
.tall .image-button { height: calc(100% - 75px); aspect-ratio: auto; }
.image-button img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.62) contrast(1.04) brightness(.78); transition: filter .3s ease, transform .7s ease; }
.image-button:hover img { filter: saturate(.9) contrast(1.05) brightness(.94); transform: scale(1.025); }
.gallery-grid figcaption { min-height: 75px; display: grid; gap: 7px; padding: 15px; font-family: var(--mono); }
.gallery-grid figcaption b { color: var(--cyan); font-size: 8px; letter-spacing: .12em; }
.gallery-grid figcaption span { color: var(--muted); font-size: 10px; line-height: 1.4; }

footer { min-height: 180px; display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 48px clamp(28px, 5vw, 80px); }
footer p { margin: 14px 0 0; color: var(--muted); }
footer > a { color: var(--cyan); font: 700 9px/1 var(--mono); letter-spacing: .12em; text-decoration: none; }

.lightbox { width: min(92vw, 1180px); height: min(92vh, 920px); padding: 50px 24px 20px; border: 1px solid var(--line); background: #050708; color: var(--text); }
.lightbox::backdrop { background: rgb(0 0 0 / 86%); backdrop-filter: blur(8px); }
.lightbox img { width: 100%; height: calc(100% - 48px); object-fit: contain; }
.lightbox p { margin: 14px 0 0; color: var(--muted); font: 700 9px/1.4 var(--mono); letter-spacing: .1em; text-align: center; }
.lightbox-close { position: absolute; top: 14px; right: 18px; border: 0; background: transparent; color: var(--cyan); font: 700 10px/1 var(--mono); cursor: pointer; }

.reader-page { background: #07090a; }
.reader-bar { position: fixed; width: 100%; }
.reader-tools { display: flex; gap: 7px; }
.reader-tools button { padding: 7px 10px; border: 1px solid var(--line); background: transparent; color: var(--text); font: 700 9px/1 var(--mono); letter-spacing: .08em; cursor: pointer; }
.reader-tools button:hover { border-color: var(--cyan); color: var(--cyan); }
.reader-shell { display: grid; grid-template-columns: 290px minmax(0, 1fr); padding-top: 56px; overflow: visible; }
.reader-index { position: fixed; top: 56px; bottom: 0; width: 290px; padding: 40px 30px; border-right: 1px solid var(--line); background: #080b0c; }
.reader-index > a { display: block; margin-bottom: 55px; color: var(--cyan); font: 700 9px/1 var(--mono); letter-spacing: .1em; text-decoration: none; }
.reader-index nav { display: grid; margin-bottom: 50px; }
.reader-index nav a { padding: 13px 0; border-bottom: 1px solid var(--line); color: var(--muted); font: 700 10px/1.3 var(--mono); text-decoration: none; }
.reader-index nav a.active { color: var(--cyan); }
.read-progress { height: 2px; background: var(--line); }
.read-progress i { display: block; width: 0; height: 100%; background: var(--cyan); }
#reader-status { color: var(--muted); font: 700 7px/1 var(--mono); letter-spacing: .12em; }
.document { grid-column: 2; width: min(100%, 1040px); padding: 70px clamp(30px, 7vw, 100px) 120px; }
.document-header { padding-bottom: 50px; border-bottom: 1px solid var(--line); }
.doc-classification, .doc-actions { display: flex; justify-content: space-between; gap: 20px; color: var(--muted); font: 700 8px/1.4 var(--mono); letter-spacing: .12em; }
.doc-classification span:first-child { color: var(--amber); }
.document-header h1 { margin: 50px 0 24px; font: 800 clamp(46px, 7vw, 90px)/.88 var(--condensed); letter-spacing: -.045em; }
.document-header > p { max-width: 760px; margin: 0 0 38px; color: #a8b7b5; font-size: 18px; line-height: 1.65; }
.doc-actions a { color: var(--cyan); text-decoration: none; }
.document-body { padding-top: 64px; font: 400 calc(18px * var(--reader-scale))/1.78 Georgia, "Times New Roman", serif; color: #cbd4d1; }
.document-body p { margin: 0 0 1.35em; }
.document-body h2 { margin: 2.2em 0 .75em; color: #eff5f3; font: 800 calc(38px * var(--reader-scale))/1 var(--condensed); letter-spacing: -.02em; }
.document-body h3 { margin: 2em 0 .75em; color: var(--cyan); font: 700 calc(15px * var(--reader-scale))/1.4 var(--mono); letter-spacing: .05em; }
.document-body h4 { margin: 1.8em 0 .7em; color: #dce7e4; font: 700 calc(18px * var(--reader-scale))/1.35 var(--sans); }
.document-body blockquote { margin: 1.8em 0; padding: .2em 0 .2em 1.5em; border-left: 2px solid var(--cyan); color: #a8bab8; }
.document-body ul, .document-body ol { margin: 0 0 1.5em; padding-left: 1.8em; }
.document-body li { margin-bottom: .55em; padding-left: .35em; }
.document-body li::marker { color: var(--amber); }
.document-body a { color: var(--cyan); text-underline-offset: .18em; }
.document-body hr { margin: 3em 0; border: 0; border-top: 1px solid var(--line); }
.document-body table { width: 100%; margin: 2em 0; border-collapse: collapse; font: 400 calc(15px * var(--reader-scale))/1.55 var(--sans); }
.document-body th, .document-body td { padding: 12px 14px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.document-body th { background: #101719; color: var(--cyan); font-family: var(--mono); }
.document-body code { color: #c9f3f1; font-family: var(--mono); font-size: .9em; }
.document-body pre { padding: 20px; overflow: auto; border: 1px solid var(--line); background: #050708; color: #c9f3f1; font: 400 calc(14px * var(--reader-scale))/1.65 var(--mono); }
.document-list-item { padding-left: 28px; position: relative; }
.document-list-item::before { content: "—"; position: absolute; left: 0; color: var(--amber); }
.load-error { padding: 24px; border: 1px solid var(--red); color: var(--red); font-family: var(--mono); }
.document-end { display: flex; justify-content: space-between; margin-top: 80px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted); font: 700 8px/1 var(--mono); letter-spacing: .12em; }
.document-end a { color: var(--cyan); text-decoration: none; }
.annotation-note { width: min(92vw, 560px); padding: 34px; border: 1px solid var(--line); background: var(--panel); color: var(--text); }
.annotation-note::backdrop { background: rgb(0 0 0 / 72%); }
.annotation-note > button:first-child { float: right; border: 0; background: transparent; color: var(--cyan); font-size: 20px; cursor: pointer; }
.annotation-note h2 { margin: 0 0 20px; font: 800 38px/1 var(--condensed); }
.annotation-note p { color: var(--muted); line-height: 1.7; }
#load-hypothesis { padding: 12px 16px; border: 1px solid var(--cyan); background: var(--cyan); color: var(--bg); font: 700 9px/1 var(--mono); letter-spacing: .1em; cursor: pointer; }

@keyframes orbit { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }

@media (max-width: 1100px) {
  .shell { grid-template-columns: 1fr; }
  .rail { display: none; }
  .hero { grid-template-columns: 1fr 44%; }
  .hero-copy { padding-inline: 38px; }
  .dossier-grid { grid-template-columns: repeat(2, 1fr); }
  .principle-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 760px) {
  .system-bar { padding: 0 16px; }
  .system-coordinates span:not(.online) { display: none; }
  .hero { grid-template-columns: 1fr; }
  .hero-copy { min-height: calc(100svh - 56px); padding: 70px 22px 44px; }
  .hero h1 { font-size: clamp(55px, 17vw, 90px); }
  .hero-lead { padding-left: 18px; }
  .hero-facts { grid-template-columns: 1fr; margin-top: 42px; }
  .hero-visual { min-height: 620px; border-top: 1px solid var(--line); border-left: 0; }
  .hero-image { inset: 7% 5% 7% 10%; }
  .section { padding: 74px 18px; }
  .section-header { grid-template-columns: 1fr; }
  .section-header h2 { font-size: 48px; }
  .dossier-grid, .principle-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid figure.wide { grid-column: span 2; }
  .gallery-grid figure.tall { grid-row: auto; }
  .tall .image-button { height: auto; aspect-ratio: 4 / 5; }
  footer { align-items: flex-start; flex-direction: column; }
  .reader-tools button:nth-child(-n+2) { display: none; }
  .reader-shell { display: block; }
  .reader-index { position: static; width: auto; height: auto; padding: 90px 20px 20px; border-right: 0; border-bottom: 1px solid var(--line); }
  .reader-index > a { margin-bottom: 34px; }
  .reader-index nav { grid-template-columns: 1fr; margin-bottom: 24px; }
  .document { width: 100%; padding: 54px 20px 90px; }
  .doc-classification, .doc-actions { flex-direction: column; }
  .document-header h1 { font-size: 50px; }
  .document-body { font-size: calc(17px * var(--reader-scale)); }
}

@media (max-width: 460px) {
  .wordmark span:last-child { display: none; }
  .gallery-grid { grid-template-columns: 1fr; }
  .gallery-grid figure.wide { grid-column: auto; }
  .wide .image-button { aspect-ratio: 4 / 5; }
}

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

@media print {
  @page { margin: 20mm 18mm; }
  :root { color-scheme: light; }
  body { background: white !important; color: black !important; }
  .system-bar, .reader-index, .annotation-note { display: none !important; }
  .reader-shell { display: block; padding: 0; }
  .document { width: 100%; max-width: none; padding: 0; }
  .document-header { border-color: #bbb; }
  .document-header h1, .document-body, .document-body h2, .document-body h3 { color: black; }
  .document-body { font-size: 11pt; line-height: 1.55; }
  .document-body h2, .document-body h3 { break-after: avoid; }
  .document-body p { orphans: 3; widows: 3; }
  .doc-actions a, .document-end a { color: black; }
}
