:root {
  color-scheme: dark;
  --ink: #f4f0e6;
  --muted: #a6a59f;
  --dim: #72746f;
  --line: rgba(236, 236, 222, 0.18);
  --line-bright: rgba(236, 236, 222, 0.38);
  --glass: rgba(8, 11, 14, 0.74);
  --glass-solid: #0a0d10;
  --amber: #e3a95c;
  --blue: #9fbfd4;
}

* { box-sizing: border-box; }

html, body { margin: 0; width: 100%; min-height: 100%; background: #05070a; color: var(--ink); }
body { font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; overflow: hidden; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }

#atlas { position: relative; width: 100vw; height: 100svh; min-height: 700px; overflow: hidden; background: #05070a; }
#map-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.grain {
  pointer-events: none; position: absolute; inset: 0; opacity: .09; mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.45'/%3E%3C/svg%3E");
}

.masthead { position: absolute; z-index: 5; inset: 0 0 auto 0; display: flex; justify-content: space-between; align-items: flex-start; padding: 28px 34px; pointer-events: none; }
.wordmark { color: var(--ink); text-decoration: none; pointer-events: auto; }
.eyebrow, .chapter { display: block; color: var(--muted); font-size: 10px; line-height: 1.2; letter-spacing: .19em; text-transform: uppercase; }
.title { display: block; margin-top: 9px; font-family: Iowan Old Style, Baskerville, Georgia, serif; font-size: 27px; line-height: .88; letter-spacing: -.035em; }
.orientation { display: grid; grid-template-columns: auto auto; gap: 4px 22px; align-items: center; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; letter-spacing: .1em; text-transform: uppercase; pointer-events: auto; }
.text-button { grid-column: 1 / -1; border: 0; padding: 5px 0; color: var(--ink); background: transparent; text-align: right; cursor: pointer; text-decoration: underline; text-decoration-color: var(--line-bright); text-underline-offset: 4px; }

.opening { position: absolute; z-index: 9; top: 160px; left: 34px; width: min(520px, calc(100vw - 430px)); display: flex; flex-direction: column; align-items: flex-start; padding: 24px 26px; text-align: left; border-left: 1px solid rgba(227,169,92,.6); background: linear-gradient(90deg, rgba(3,5,7,.94), rgba(3,5,7,.72) 82%, transparent); transition: opacity .55s ease, transform .55s ease, visibility .55s; }
.opening::before { content: ""; width: 44px; height: 1px; margin-bottom: 18px; background: linear-gradient(90deg, var(--amber), transparent); }
.opening h1 { margin: 12px 0 14px; max-width: 500px; font-family: Iowan Old Style, Baskerville, Georgia, serif; font-size: clamp(38px, 4.2vw, 62px); line-height: .92; font-weight: 400; letter-spacing: -.05em; }
.hero-tag { margin: 0 !important; max-width: 480px; text-transform: uppercase; color: var(--muted); font-size: 9px; letter-spacing: .16em; }
.hero-title { 
  margin-top: 16px;
  text-transform: none;
  background: linear-gradient(120deg, var(--ink), #ffe2a3 46%, var(--amber) 54%, var(--ink) 60%, #c4e5ff);
  background-size: 220% 220%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: title-aurora 14s linear infinite;
}
@keyframes title-aurora {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.opening p:not(.chapter):not(.hero-tag) { margin-top: 4px; }
.opening p:not(.chapter) { max-width: 440px; margin: 0; color: #bab9b3; font-size: 12px; line-height: 1.55; }
.neighborhood-strip { width: 100%; margin-top: 16px; padding: 12px 0 8px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: left; overflow: hidden; }
.local-cluster { display: grid; grid-auto-flow: column; grid-template-rows: repeat(2, auto); grid-auto-columns: minmax(180px, 1fr); gap: 6px; margin-top: 9px; padding-bottom: 5px; overflow-x: auto; scrollbar-width: thin; }
.cluster-chip { display: inline-flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--line); padding: 8px 10px; background: transparent; color: var(--ink); cursor: pointer; transition: border-color .2s, background .2s, transform .2s; }
.cluster-chip span { display: block; overflow: hidden; font-family: Iowan Old Style, Baskerville, Georgia, serif; font-size: 13px; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
.cluster-chip small { color: var(--muted); font-family: ui-monospace, monospace; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.cluster-chip:hover, .cluster-chip.is-selected { border-color: var(--amber); background: rgba(227, 169, 92, .12); transform: translateX(2px); }
.opening.is-gone { opacity: 0; visibility: hidden; pointer-events: none; transform: translateX(-18px); }
.lesson-path { position: absolute; z-index: 6; top: 108px; right: 34px; width: 270px; padding: 13px 15px; border: 1px solid var(--line); background: rgba(6, 9, 12, .76); backdrop-filter: blur(13px); }
.lesson-path strong { display: block; margin-top: 6px; font-family: Iowan Old Style, Baskerville, Georgia, serif; font-size: 18px; font-weight: 400; }
.lesson-path p { margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.lesson-path-continue, .lesson-path-restart { display: flex; justify-content: space-between; gap: 12px; margin-top: 11px; padding-top: 9px; border: 0; border-top: 1px solid var(--line); color: var(--ink); background: transparent; font: 500 9px/1.3 ui-monospace, monospace; letter-spacing: .04em; text-decoration: none; cursor: pointer; }
.lesson-path-continue[hidden], .lesson-path-restart[hidden] { display: none; }
.lesson-path-continue:hover, .lesson-path-continue:focus-visible, .lesson-path-restart:hover, .lesson-path-restart:focus-visible { color: var(--amber); outline: none; }
.lesson-path[data-complete="true"] { border-color: rgba(227, 169, 92, .7); }
.primary-button { margin-top: 16px; padding: 11px 16px 11px 18px; border: 1px solid var(--line-bright); border-radius: 999px; background: rgba(248, 246, 236, .04); color: var(--ink); cursor: pointer; letter-spacing: .02em; transition: background .2s, color .2s; }
.primary-button span { margin-left: 20px; color: var(--amber); }
.primary-button:hover { background: var(--ink); color: #07090b; }

.star-labels { position: absolute; z-index: 3; inset: 0; pointer-events: none; }
.star-label { position: absolute; transform: translate(-50%, 16px); border: 0; background: transparent; color: var(--ink); text-align: center; cursor: pointer; pointer-events: auto; text-shadow: 0 1px 12px #000; }
.star-label::before { content: ""; display: block; width: 1px; height: 20px; margin: 0 auto 6px; background: linear-gradient(var(--line-bright), transparent); }
.star-label strong { display: block; font-family: Iowan Old Style, Baskerville, Georgia, serif; font-size: 14px; font-weight: 400; }
.star-label.is-secondary { opacity: .46; }
.star-label.is-secondary strong { font-size: 11px; }
.star-label.is-secondary span { font-size: 7px; }
.star-label.is-secondary:hover, .star-label.is-secondary:focus-visible, .star-label.is-secondary.is-selected { opacity: 1; outline: none; }
.persistent-lab-entry { position: absolute; z-index: 11; right: 34px; bottom: 112px; display: grid; grid-template-columns: auto auto 18px; gap: 17px; align-items: center; min-width: 290px; padding: 12px 14px 12px 16px; border: 1px solid rgba(227,169,92,.72); background: rgba(8,10,12,.9); color: var(--ink); text-decoration: none; backdrop-filter: blur(16px); box-shadow: 0 18px 50px rgba(0,0,0,.28); transition: transform .2s, background .2s, border-color .2s; }
.persistent-lab-entry span { display: grid; gap: 3px; }
.persistent-lab-entry small, .persistent-lab-entry em { color: var(--muted); font: 600 7px/1.2 ui-monospace, monospace; letter-spacing: .11em; text-transform: uppercase; }
.persistent-lab-entry strong { font-family: Iowan Old Style, Baskerville, Georgia, serif; font-size: 18px; font-weight: 400; }
.persistent-lab-entry em { max-width: 110px; color: var(--amber); font-style: normal; text-align: right; }
.persistent-lab-entry b { color: var(--amber); font-weight: 400; }
.persistent-lab-entry:hover, .persistent-lab-entry:focus-visible { transform: translateY(-3px); border-color: var(--amber); background: rgba(24,20,14,.94); outline: none; }
.star-label span { display: block; margin-top: 2px; color: var(--muted); font-family: ui-monospace, monospace; font-size: 8px; letter-spacing: .12em; text-transform: uppercase; }
.star-label.is-selected strong { color: #fff0cc; }

.scale-story { position: absolute; z-index: 4; left: 34px; top: 150px; display: flex; align-items: center; gap: 11px; }
.scale-step { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 8px; border: 1px solid transparent; color: var(--dim); opacity: .52; transition: opacity .35s, border-color .35s, color .35s; }
.scale-step.is-active { border-color: var(--line); color: var(--ink); opacity: 1; background: rgba(4, 7, 9, .4); }
.scale-step span:last-child { display: flex; flex-direction: column; gap: 2px; font-size: 8px; letter-spacing: .08em; text-transform: uppercase; }
.scale-step strong { font-size: 9px; font-weight: 600; letter-spacing: .04em; }
.scale-index { display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid currentColor; border-radius: 50%; font-family: ui-monospace, monospace; font-size: 8px; }
.scale-arrow { color: var(--dim); }

.object-panel { position: absolute; z-index: 7; top: 0; right: 0; width: min(420px, 100vw); height: 100%; padding: 20px; background: linear-gradient(90deg, rgba(6, 8, 11, .2), rgba(6, 8, 11, .97) 14%); border-left: 1px solid var(--line); overflow-y: auto; transform: translateX(102%); transition: transform .55s cubic-bezier(.2,.75,.2,1); scrollbar-width: thin; }
.object-panel.is-open { transform: translateX(0); }
.panel-lab-continue { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 12px 0 6px; padding: 11px 12px; border: 1px solid rgba(227, 169, 92, .65); background: rgba(227, 169, 92, .08); color: var(--ink); font: 600 9px/1.35 ui-monospace, monospace; letter-spacing: .04em; text-decoration: none; }
.panel-lab-continue:hover, .panel-lab-continue:focus-visible { color: var(--amber); outline: 1px solid var(--amber); outline-offset: 2px; }
.panel-lab-continue[hidden] { display: none; }
.panel-topline { display: flex; align-items: center; justify-content: space-between; margin-left: 22px; color: var(--muted); font-size: 9px; letter-spacing: .14em; text-transform: uppercase; }
.panel-topline button, dialog > button { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 50%; background: transparent; cursor: pointer; font-size: 18px; }
.portrait-wrap { position: relative; height: min(34vh, 320px); min-height: 230px; margin: 6px 0 18px 22px; overflow: hidden; border-bottom: 1px solid var(--line); }
#portrait-canvas { width: 100%; height: 100%; display: block; }
.portrait-caption { position: absolute; left: 0; bottom: 12px; color: var(--muted); font-family: ui-monospace, monospace; font-size: 8px; letter-spacing: .12em; text-transform: uppercase; }
.object-copy { margin-left: 22px; }
.object-copy h2 { margin: 8px 0 10px; font-family: Iowan Old Style, Baskerville, Georgia, serif; font-size: 46px; line-height: .92; font-weight: 400; letter-spacing: -.04em; }
.object-summary { margin: 0 0 17px; color: #c2c1bb; font-size: 12px; line-height: 1.65; }
.fact-ribbon { display: grid; grid-template-columns: 1fr 1fr 1.3fr; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.fact-ribbon div { min-width: 0; padding: 11px 8px 12px 0; }
.fact-ribbon span, .fact-ribbon strong { display: block; }
.fact-ribbon span { color: var(--dim); font-size: 8px; letter-spacing: .1em; text-transform: uppercase; }
.fact-ribbon strong { margin-top: 5px; font-family: ui-monospace, monospace; font-size: 10px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.caveat { padding-left: 12px; border-left: 1px solid var(--amber); color: #9e9d97; font-size: 10px; line-height: 1.55; }
.glossary { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.glossary summary { padding: 13px 0; cursor: pointer; color: var(--muted); font-size: 9px; letter-spacing: .09em; text-transform: uppercase; }
.glossary dl { margin: 0; }
.glossary dt { margin-top: 10px; color: var(--ink); font-family: Iowan Old Style, Baskerville, Georgia, serif; font-size: 15px; }
.glossary dd { margin: 3px 0 12px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.sources { display: flex; flex-wrap: wrap; gap: 7px; padding-top: 14px; }
.sources a { padding: 6px 8px; border: 1px solid var(--line); color: var(--blue); font-size: 8px; line-height: 1.2; letter-spacing: .05em; text-decoration: none; text-transform: uppercase; }
.sources a:hover { border-color: var(--blue); }

.route-deck { position: absolute; z-index: 5; left: 34px; right: 454px; bottom: 26px; display: grid; grid-template-columns: 1.05fr .95fr .95fr auto; align-items: stretch; border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(18px); }
.route-intro { display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 13px 17px; border-right: 1px solid var(--line); }
#route-status { color: var(--ink); font-family: Iowan Old Style, Baskerville, Georgia, serif; font-size: 14px; }
.route-choice { display: flex; align-items: center; gap: 11px; padding: 12px 14px; border: 0; border-right: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; transition: background .2s; }
.route-choice:hover, .route-choice.is-selected { background: rgba(237, 219, 185, .07); }
.route-number { color: var(--dim); font-family: ui-monospace, monospace; font-size: 9px; }
.route-choice strong, .route-choice small { display: block; }
.route-choice strong { font-family: Iowan Old Style, Baskerville, Georgia, serif; font-size: 13px; font-weight: 400; }
.route-choice small { margin-top: 3px; color: var(--muted); font-family: ui-monospace, monospace; font-size: 8px; letter-spacing: .05em; }
.launch-button { min-width: 150px; border: 0; background: var(--ink); color: #07090b; cursor: pointer; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.launch-button span { display: inline-block; margin-left: 17px; color: #9a632c; transition: transform .2s; }
.launch-button:hover span { transform: translateX(4px); }

.time-lab { position: absolute; z-index: 5; top: 222px; left: 34px; width: 260px; padding: 15px; border: 1px solid var(--line); background: rgba(6, 9, 12, .65); backdrop-filter: blur(13px); }
.time-heading { display: flex; justify-content: space-between; align-items: center; }
.time-heading strong { font-family: Iowan Old Style, Baskerville, Georgia, serif; font-size: 22px; font-weight: 400; }
#velocity { width: 100%; height: 2px; margin: 17px 0; accent-color: var(--amber); cursor: ew-resize; }
.time-readouts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.time-readouts div { padding-top: 8px; border-top: 1px solid var(--line); }
.time-readouts span, .time-readouts strong { display: block; }
.time-readouts span { color: var(--dim); font-size: 8px; letter-spacing: .11em; text-transform: uppercase; }
.time-readouts strong { margin-top: 4px; font-family: ui-monospace, monospace; font-size: 11px; font-weight: 500; }
#relativity-note { margin: 11px 0 0; color: #858781; font-size: 8px; line-height: 1.5; }

.guide { position: absolute; z-index: 5; top: 444px; left: 34px; width: 330px; padding: 15px; border: 1px solid var(--line); background: rgba(6, 9, 12, .7); backdrop-filter: blur(13px); }
.guide-heading { display: flex; justify-content: space-between; align-items: flex-start; }
.guide-heading strong { display: block; margin-top: 5px; font-family: Iowan Old Style, Baskerville, Georgia, serif; font-size: 17px; font-weight: 400; }
.grounding-badge { color: var(--blue); font-size: 7px; letter-spacing: .08em; text-transform: uppercase; }
#guide-form { display: grid; grid-template-columns: 1fr 46px; margin-top: 11px; border: 1px solid var(--line); }
#guide-question { min-height: 54px; padding: 10px; resize: none; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 10px; line-height: 1.4; }
#guide-question::placeholder { color: #72746f; }
#guide-form button { border: 0; border-left: 1px solid var(--line); background: transparent; cursor: pointer; color: var(--amber); font-size: 10px; }
.guide-answer { max-height: 112px; margin-top: 10px; overflow-y: auto; color: #a9aaa4; font-size: 9px; line-height: 1.55; white-space: pre-wrap; }
.guide-answer.is-error { color: #e8b18b; }

.time-lab, .guide, .simulation-console, .route-deck { transition: opacity .32s ease, transform .32s ease, visibility .32s; }
#atlas.is-origin-step .time-lab,
#atlas.is-origin-step .guide,
#atlas.is-origin-step .simulation-console,
#atlas.is-origin-step .route-deck {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(12px);
}

.simulation-console { position: absolute; z-index: 5; top: 220px; left: 380px; width: 430px; padding: 16px; border: 1px solid var(--line); background: linear-gradient(145deg, rgba(9, 13, 16, .89), rgba(5, 8, 11, .7)); backdrop-filter: blur(16px); }
.sim-header, .sim-route, .warp-controls { display: flex; align-items: center; justify-content: space-between; }
.sim-header strong { display: block; margin-top: 5px; font-family: Iowan Old Style, Baskerville, Georgia, serif; font-size: 18px; font-weight: 400; }
.phase-badge { padding: 6px 9px; border: 1px solid rgba(227, 169, 92, .45); color: #efc58d; font-family: ui-monospace, monospace; font-size: 8px; letter-spacing: .11em; text-transform: uppercase; }
.sim-route { margin-top: 14px; color: var(--muted); font-family: ui-monospace, monospace; font-size: 8px; letter-spacing: .08em; text-transform: uppercase; }
.sim-route span:first-child { color: var(--ink); }
.sim-progress { position: relative; height: 2px; margin: 13px 0 16px; background: rgba(236, 236, 222, .15); }
.sim-progress > span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--blue), var(--amber)); transition: width .12s linear; }
.sim-progress > i { position: absolute; top: 50%; left: 0; width: 8px; height: 8px; border: 1px solid #f2d19d; border-radius: 50%; background: #17140f; transform: translate(-50%, -50%); transition: left .12s linear; }
.sim-telemetry { display: grid; grid-template-columns: 1fr 1fr; gap: 11px 17px; }
.sim-telemetry div { padding-top: 7px; border-top: 1px solid var(--line); }
.sim-telemetry span, .sim-telemetry strong { display: block; }
.sim-telemetry span { color: var(--dim); font-size: 7px; letter-spacing: .11em; text-transform: uppercase; }
.sim-telemetry strong { margin-top: 5px; font-family: ui-monospace, monospace; font-size: 11px; font-weight: 500; }
.sim-actions { display: grid; grid-template-columns: 1.2fr 1fr 1.25fr; margin-top: 15px; border: 1px solid var(--line); }
.sim-actions button { min-height: 34px; padding: 7px; border: 0; border-right: 1px solid var(--line); background: transparent; cursor: pointer; color: var(--muted); font-size: 8px; letter-spacing: .08em; text-transform: uppercase; }
.sim-actions button:last-child { border-right: 0; }
.sim-actions button:first-child { background: rgba(227, 169, 92, .1); color: var(--ink); }
.sim-actions button:hover, .warp-controls button:hover { color: var(--ink); background: rgba(236, 236, 222, .07); }
.sim-actions button:disabled { cursor: not-allowed; opacity: .38; }
.warp-controls { justify-content: flex-start; gap: 5px; margin-top: 10px; }
.warp-controls > span { margin-right: auto; color: var(--dim); font-size: 7px; letter-spacing: .11em; text-transform: uppercase; }
.warp-controls button { min-width: 30px; padding: 5px 6px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; font-family: ui-monospace, monospace; font-size: 7px; }
.warp-controls .warp-choice.is-active { border-color: var(--amber); color: var(--ink); }
#audio-toggle { min-width: 86px; margin-left: 5px; color: var(--blue); }
#sim-caveat { margin: 11px 0 0; padding-left: 10px; border-left: 1px solid var(--amber); color: #858781; font-size: 8px; line-height: 1.5; }

dialog { width: min(540px, calc(100vw - 36px)); padding: 28px; border: 1px solid var(--line-bright); background: #0b0e11; color: var(--ink); box-shadow: 0 35px 100px #000; }
dialog::backdrop { background: rgba(0, 0, 0, .75); backdrop-filter: blur(5px); }
dialog > button { float: right; }
dialog h2 { margin: 18px 0 13px; font-family: Iowan Old Style, Baskerville, Georgia, serif; font-size: 34px; line-height: 1; font-weight: 400; letter-spacing: -.03em; }
dialog p { color: var(--muted); font-size: 12px; line-height: 1.65; }

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

@media (max-width: 1120px) {
  .opening { width: min(470px, calc(100vw - 360px)); }
  .route-deck { right: 34px; }
  .object-panel { width: min(400px, 100vw); }
  .simulation-console { left: 330px; width: 370px; }
  .lesson-path { right: 34px; top: 150px; }
}

@media (max-width: 820px) {
  body { overflow: auto; }
  #atlas { min-height: 1260px; height: 100svh; }
  .masthead { padding: 20px; }
  .orientation { grid-template-columns: auto; text-align: right; }
  .orientation span:nth-child(2) { display: none; }
  .scale-story { left: 20px; top: 128px; transform: scale(.88); transform-origin: left center; }
  .time-lab { top: 205px; left: 20px; width: 230px; }
  .guide { top: 420px; left: 20px; width: 290px; }
  .lesson-path { top: 128px; right: 20px; width: min(270px, calc(100vw - 40px)); }
  .simulation-console { top: 650px; left: 20px; width: calc(100vw - 40px); max-width: 430px; }
  .route-deck { left: 20px; right: 20px; bottom: 20px; grid-template-columns: 1fr 1fr; }
  .route-intro { grid-column: 1 / -1; border-right: 0; border-bottom: 1px solid var(--line); }
  .launch-button { grid-column: 1 / -1; min-height: 48px; }
  .object-panel { z-index: 12; padding-left: 8px; }
}

.simulation-console {
  transition: max-height 220ms ease, padding 220ms ease, background-color 220ms ease;
}

.simulation-console .sim-header {
  align-items: center;
  gap: 12px;
}

.panel-collapse {
  min-height: 42px;
  margin-left: auto;
  padding: 0 16px;
  border: 1px solid var(--gold, #d8a750);
  background: rgba(216, 167, 80, .12);
  color: var(--paper, #f3eee4);
  font: 700 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
}

.panel-collapse:hover,
.panel-collapse:focus-visible {
  background: var(--paper, #f3eee4);
  color: #080a0c;
  outline: none;
}

.simulation-console.is-collapsed {
  min-height: 0;
  max-height: 82px;
  padding-bottom: 16px;
  background: rgba(3, 5, 7, .94);
}

.simulation-console.is-collapsed > :not(.sim-header) {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
@media (max-width: 820px) {
  .opening { top: 150px; left: 20px; width: calc(100vw - 40px); max-height: 440px; padding: 18px; background: rgba(3,5,7,.9); }
  .opening h1 { font-size: clamp(34px, 10vw, 50px); }
  .persistent-lab-entry { position: fixed; z-index: 14; right: 20px; bottom: 20px; min-width: 250px; }
  .opening:not(.is-gone) ~ .persistent-lab-entry { bottom: 20px; }
}
.atlas-intro-mode .simulation-console,
.atlas-intro-mode .lesson-path,
.atlas-intro-mode .route-deck,
.atlas-intro-mode .time-lab,
.atlas-intro-mode .guide {
  opacity: 0;
  transform: translateY(18px) scale(.98);
  pointer-events: none;
}

.atlas-intro-mode .opening {
  top: 50%;
  left: 50%;
  width: min(760px, calc(100vw - 48px));
  max-height: min(760px, calc(100vh - 90px));
  padding: 44px 48px 38px;
  overflow: auto;
  transform: translate(-50%, -50%);
  text-align: center;
  border: 1px solid rgba(216, 167, 80, .32);
  background: radial-gradient(circle at 50% 16%, rgba(216, 167, 80, .12), transparent 36%), rgba(3, 5, 7, .9);
  box-shadow: 0 30px 100px rgba(0, 0, 0, .55);
  backdrop-filter: blur(18px);
}

.atlas-intro-mode .opening::before {
  content: '';
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(255, 255, 255, .045);
  pointer-events: none;
}

.atlas-intro-mode .opening > *:not(.intro-orbit) {
  position: relative;
  z-index: 2;
}

.atlas-intro-mode .opening .chapter,
.atlas-intro-mode .opening .hero-tag {
  text-align: center;
}

.atlas-intro-mode .opening .hero-tag {
  margin-top: 10px;
  color: #d8a750;
}

.atlas-intro-mode .opening h1 {
  max-width: 680px;
  margin: 16px auto 18px;
  font-size: clamp(54px, 6.4vw, 92px);
  line-height: .91;
  letter-spacing: -.055em;
}

.atlas-intro-mode .opening h1 em {
  color: #efc47f;
  font-weight: inherit;
}

.atlas-intro-mode .opening > p:not(.chapter):not(.hero-tag) {
  max-width: 560px;
  margin: 0 auto 26px;
  color: #c7cdd2;
  font-size: 15px;
  line-height: 1.55;
}

.intro-orbit {
  position: absolute;
  z-index: 1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.intro-orbit i {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 600px;
  height: 210px;
  border: 1px solid rgba(216, 167, 80, .14);
  border-radius: 50%;
  transform: translate(-50%, -50%) rotate(var(--orbit-angle, 0deg));
}

.intro-orbit i:nth-child(2) { --orbit-angle: 58deg; width: 520px; height: 176px; }
.intro-orbit i:nth-child(3) { --orbit-angle: -58deg; width: 450px; height: 150px; }

.intro-orbit b {
  position: absolute;
  top: 19%;
  left: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #efc47f;
  box-shadow: 0 0 24px #d8a750;
  animation: intro-star-drift 7s ease-in-out infinite alternate;
}

.intro-orbit b:nth-of-type(2) { top: 66%; left: 20%; animation-delay: -2s; }
.intro-orbit b:nth-of-type(3) { top: 74%; left: 82%; animation-delay: -4s; }

@keyframes intro-star-drift {
  from { transform: translate3d(-14px, -8px, 0) scale(.7); opacity: .45; }
  to { transform: translate3d(18px, 10px, 0) scale(1.35); opacity: 1; }
}

.reveal-cluster,
.atlas-intro-mode #enter-atlas {
  min-height: 52px;
  padding: 0 22px;
  border: 1px solid #d8a750;
  background: #f3eee4;
  color: #080a0c;
  font: 800 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .09em;
  text-transform: uppercase;
  cursor: pointer;
}

.reveal-cluster span,
.atlas-intro-mode #enter-atlas span {
  margin-left: 14px;
  color: #ad7429;
}

.atlas-intro-mode #enter-atlas {
  margin-top: 18px;
}

.atlas-intro-mode .neighborhood-strip {
  margin-top: 24px;
  padding: 18px;
  text-align: left;
  border: 1px solid rgba(207, 216, 224, .18);
  background: rgba(0, 0, 0, .28);
  animation: cluster-rise 380ms ease-out both;
}

.atlas-intro-mode .local-cluster {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(46px, auto));
  gap: 7px;
  min-height: 99px;
}

.atlas-intro-mode .cluster-chip {
  min-width: 0;
  padding: 11px 10px;
  text-align: left;
}

.cluster-preview {
  margin-top: 10px;
  padding: 14px 18px;
  text-align: left;
  border-left: 2px solid #d8a750;
  background: rgba(216, 167, 80, .07);
  animation: cluster-rise 380ms ease-out both;
}

.cluster-preview span,
.cluster-preview strong,
.cluster-preview p {
  display: block;
}

.cluster-preview span {
  color: #aeb8bf;
  font: 700 9px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.cluster-preview strong {
  margin-top: 4px;
  color: #f3eee4;
  font: 500 22px/1.2 Georgia, serif;
}

.cluster-preview p {
  margin: 5px 0 0;
  color: #c7cdd2;
  font-size: 12px;
  line-height: 1.5;
}

@keyframes cluster-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 820px) {
  .atlas-intro-mode .opening {
    top: 50%;
    left: 50%;
    width: calc(100vw - 24px);
    max-height: calc(100vh - 70px);
    padding: 34px 22px 28px;
    transform: translate(-50%, -50%);
  }
  .atlas-intro-mode .opening h1 { font-size: clamp(46px, 14vw, 66px); }
  .atlas-intro-mode .local-cluster { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .intro-orbit b,
  .atlas-intro-mode .neighborhood-strip,
  .cluster-preview { animation: none; }
}

/* Minimal atlas gateway: preserve the full stellar map and one clear action. */
body.atlas-minimal-mode .opening,
body.atlas-minimal-mode .scale-story,
body.atlas-minimal-mode .lesson-path,
body.atlas-minimal-mode .route-deck,
body.atlas-minimal-mode .time-lab,
body.atlas-minimal-mode .guide,
body.atlas-minimal-mode .simulation-console {
  display: none !important;
}

body.atlas-minimal-mode #map-canvas,
body.atlas-minimal-mode .star-labels {
  opacity: 1 !important;
  visibility: visible !important;
}

body.atlas-minimal-mode .star-labels {
  pointer-events: auto !important;
}

body.atlas-minimal-mode .persistent-lab-entry {
  position: absolute;
  z-index: 12;
  top: 50%;
  left: 50%;
  right: auto;
  bottom: auto;
  width: min(330px, calc(100vw - 40px));
  min-height: 92px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 22px 28px;
  border: 1px solid rgba(239, 196, 127, .82);
  background:
    radial-gradient(circle at 50% 0%, rgba(227, 169, 92, .2), transparent 62%),
    rgba(6, 9, 12, .82);
  box-shadow: 0 0 0 1px rgba(227, 169, 92, .1), 0 24px 70px rgba(0, 0, 0, .55);
  backdrop-filter: blur(18px);
  transform: translate(-50%, -50%);
  transition: transform .24s ease, border-color .24s ease, background .24s ease;
  animation: lab-beacon 3.8s ease-in-out infinite;
}

body.atlas-minimal-mode .persistent-lab-entry span {
  display: block;
}

body.atlas-minimal-mode .persistent-lab-entry small,
body.atlas-minimal-mode .persistent-lab-entry em {
  display: none;
}

body.atlas-minimal-mode .persistent-lab-entry strong {
  font-family: Iowan Old Style, Baskerville, Georgia, serif;
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 400;
  letter-spacing: -.02em;
}

body.atlas-minimal-mode .persistent-lab-entry b {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(239, 196, 127, .45);
  border-radius: 50%;
  color: var(--amber);
  font-size: 18px;
}

body.atlas-minimal-mode .persistent-lab-entry:hover,
body.atlas-minimal-mode .persistent-lab-entry:focus-visible {
  border-color: #f4cf92;
  background:
    radial-gradient(circle at 50% 0%, rgba(227, 169, 92, .3), transparent 68%),
    rgba(10, 12, 14, .9);
  outline: none;
  transform: translate(-50%, -50%) scale(1.035);
}

@keyframes lab-beacon {
  0%, 100% { box-shadow: 0 0 0 1px rgba(227, 169, 92, .1), 0 24px 70px rgba(0, 0, 0, .55); }
  50% { box-shadow: 0 0 0 8px rgba(227, 169, 92, 0), 0 24px 85px rgba(227, 169, 92, .15); }
}

@media (max-width: 640px) {
  body.atlas-minimal-mode .persistent-lab-entry {
    min-height: 78px;
    padding: 18px 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.atlas-minimal-mode .persistent-lab-entry { animation: none; }
}
