/* Command deck: tactical instruments around a museum-grade reading surface. */
:root {
  --bg: #07080b;
  --panel: rgba(12, 13, 17, 0.94);
  --panel-solid: #0c0d11;
  --ink: #ece8dc;
  --muted: #b5b0a4;
  --rule: rgba(212, 175, 55, 0.3);
  --rule-soft: rgba(236, 232, 220, 0.1);
  --gold: #d4af37;
  --gold-text: #e8c44a;
  --scout: #86efac;
  --accent: var(--gold-text);
  --display: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --body: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --r: 6px;
  --gut: max(16px, env(safe-area-inset-left, 0px));
  --gut-r: max(16px, env(safe-area-inset-right, 0px));
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--body); -webkit-font-smoothing: antialiased; }
body { overflow: hidden; }
.mono { font-family: var(--mono); }
h1, h2, h3 { font-family: var(--display); margin: 0; line-height: 1.1; text-wrap: balance; }
a { color: var(--gold-text); }
button { font: inherit; color: inherit; touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--gold-text); outline-offset: 2px; }
.eyebrow { margin: 0; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

.btn-solid, .btn-ghost, .btn-link { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 3px; font: 600 12px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn-solid { background: var(--gold); color: #0b0b0b; border: 1px solid var(--gold); }
.btn-solid:hover { background: var(--gold-text); }
.btn-ghost { background: rgba(10, 11, 14, 0.7); color: var(--ink); border: 1px solid var(--rule); }
.btn-ghost:hover { border-color: var(--gold); }
.btn-link { color: var(--muted); padding: 0 6px; }
.btn-link:hover { color: var(--ink); }
.btn-solid:disabled { opacity: 0.4; cursor: default; }

.app { position: fixed; inset: 0; }
#world { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; outline: none; }

/* Labels pinned over buildings */
.labels { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.label { position: absolute; left: 0; top: 0; display: grid; grid-template-columns: auto auto; column-gap: 6px; align-items: baseline; padding: 4px 9px 5px; border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 3px; background: rgba(7, 8, 11, 0.86); pointer-events: auto; cursor: pointer; transition: border-color 0.2s, background 0.2s, opacity 0.3s; will-change: transform; }
.label::after { content: ""; position: absolute; left: 50%; bottom: -9px; width: 1px; height: 8px; background: var(--accent); opacity: 0.6; }
.label .idx { font-size: 11px; color: var(--accent); }
.label strong { font: 600 13px var(--display); }
.label .era { grid-column: 1 / -1; font-size: 11px; color: var(--muted); }
.label.on, .label:hover { border-color: var(--accent); background: rgba(7, 8, 11, 0.9); }
.label.minor { opacity: 0.55; border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
.label.minor strong { font-size: 12px; }
.label.minor:hover, .label.minor.on, .zoomed .label.minor { opacity: 1; }
[data-mode="exhibit"] .label, [data-mode="exhibit"] .label.minor { opacity: 0; pointer-events: none; }

/* Top deck */
.deck-top { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: calc(14px + env(safe-area-inset-top, 0px)) var(--gut-r) 14px var(--gut); pointer-events: none; background: linear-gradient(rgba(7, 8, 11, 0.85), transparent); }
.deck-top > * { pointer-events: auto; }
.brand h1 { font-size: 30px; letter-spacing: -0.015em; margin-top: 6px; }
.intro { margin: 6px 0 0; font-size: 15px; color: var(--ink); opacity: 0.86; transition: opacity 0.3s; }
.brand h1 { transition: opacity 0.3s; }
/* While reading an exhibit the header shrinks to its crumb and name, clear of the focused sign. */
[data-mode="exhibit"] .intro { opacity: 0; }
.btn-cta { justify-self: start; display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; min-height: 40px; padding: 0 18px; border: 1px solid var(--gold); border-radius: 999px; background: rgba(212, 175, 55, 0.14); color: var(--gold-text); font: 600 13px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer; transition: background 0.2s, color 0.2s; }
.btn-cta:hover { background: var(--gold); color: #0b0b0b; }
.btn-cta span { transition: transform 0.2s; }
.btn-cta:hover span { transform: translateX(3px); }
[data-mode="exhibit"] .btn-cta { opacity: 0; pointer-events: none; }
.btn-ghost.quiet { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost.quiet:hover { color: var(--ink); border-color: transparent; }
.brand h1 a { color: var(--ink); text-decoration: none; }
.brand .eyebrow span { color: var(--gold-text); }
.top-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; align-items: center; }

/* Sector rail */
.sectors { position: absolute; left: var(--gut); bottom: calc(24px + env(safe-area-inset-bottom, 0px)); width: 264px; display: grid; justify-items: start; gap: 8px; }
.sectors-panel { width: 100%; padding: 12px 8px 8px; background: var(--panel-solid); border: 1px solid var(--rule-soft); border-top: 1px solid var(--rule); border-radius: var(--r); }
.sectors-panel .eyebrow { padding: 0 4px; }
.sectors-btn span { transition: transform 0.2s; }
.sectors-btn[aria-expanded="true"] span { transform: rotate(180deg); }
.sectors .eyebrow span:first-child { color: var(--gold-text); }
.sectors ol { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 2px; }
.sectors ol button { width: 100%; display: grid; grid-template-columns: 30px 1fr; align-items: center; gap: 8px; padding: 9px 10px; border: 0; border-left: 2px solid transparent; background: linear-gradient(90deg, rgba(7, 8, 11, 0.78), rgba(7, 8, 11, 0.35)); text-align: left; cursor: pointer; border-radius: 0 3px 3px 0; transition: border-color 0.2s, background 0.2s; }
.sectors ol button:hover, .sectors ol button.active { border-left-color: var(--accent); background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 16%, rgba(7, 8, 11, 0.9)), rgba(7, 8, 11, 0.4)); }
.sectors .idx { font-size: 12px; color: var(--accent); }
.sectors .nm { display: grid; }
.sectors strong { font: 600 14px/1.2 var(--display); }
.sectors .nm span { font-size: 12px; color: var(--muted); letter-spacing: 0.04em; }
.sectors ol button.seen .idx::after { content: " ✓"; color: var(--muted); }

/* Readout: the selected node */
.readout { position: absolute; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); min-width: 320px; max-width: calc(100vw - 640px); padding: 14px 20px 16px; background: var(--panel); border: 1px solid var(--rule-soft); border-top: 2px solid var(--accent); border-radius: var(--r); text-align: center; }
.readout::before, .readout::after { content: ""; position: absolute; top: 8px; width: 10px; height: 10px; border-top: 1px solid var(--accent); }
.readout::before { left: 8px; border-left: 1px solid var(--accent); }
.readout::after { right: 8px; border-right: 1px solid var(--accent); }
.readout .eyebrow { color: var(--accent); }
.readout h2 { font-size: 22px; margin: 6px 0 4px; }
.readout-tag { margin: 0 0 12px; font-size: 12px; color: var(--muted); }
[data-mode="exhibit"] .readout { display: none; }

/* Instruments: minimap + counters */
.instruments { position: absolute; right: var(--gut-r); bottom: calc(24px + env(safe-area-inset-bottom, 0px)); width: 128px; display: grid; gap: 6px; }
#minimap { opacity: 0.7; transition: opacity 0.2s; }
#minimap:hover { opacity: 1; }
.app:not(.has-finds) .finds { visibility: hidden; }
#minimap { width: 128px; height: 128px; border-radius: 50%; background: radial-gradient(circle, rgba(16, 17, 22, 0.9), rgba(7, 8, 11, 0.95)); border: 1px solid var(--rule); cursor: crosshair; box-shadow: inset 0 0 0 6px rgba(7, 8, 11, 0.6); }
.instrument-row { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); letter-spacing: 0.06em; }
.instrument-row b { color: var(--gold-text); }
.zoom-btns { display: flex; gap: 4px; }
.zoom-btns button { width: 30px; height: 30px; border: 1px solid var(--rule); background: rgba(7, 8, 11, 0.8); border-radius: 3px; cursor: pointer; font-size: 16px; }
.hint { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(28px + env(safe-area-inset-bottom, 0px)); margin: 0; padding: 6px 14px; font-size: 13px; color: var(--ink); background: rgba(7, 8, 11, 0.72); border-radius: 999px; white-space: nowrap; pointer-events: none; }
.touched .hint, .app:has(.readout:not([hidden])) .hint { opacity: 0; }

[data-mode="exhibit"] .sectors, [data-mode="exhibit"] .hint, [data-mode="exhibit"] .instruments { opacity: 0; pointer-events: none; }
.sectors, .hint, .instruments { transition: opacity 0.3s; }

/* Artifact toast */
.toast { position: absolute; left: var(--gut); bottom: calc(64px + env(safe-area-inset-bottom, 0px)); transform: translateY(8px); width: min(420px, calc(100vw - 32px)); padding: 14px 18px; background: var(--panel); border: 1px solid rgba(56, 189, 248, 0.4); border-left: 3px solid var(--gold-text); border-radius: var(--r); opacity: 0; transition: opacity 0.3s, transform 0.3s; cursor: pointer; z-index: 6; }
.toast.open { opacity: 1; transform: none; }
.toast .eyebrow { color: var(--gold-text); }
.toast h3 { font-size: 18px; margin: 4px 0; }
.toast p:last-child { margin: 0; color: var(--ink); font-size: 14px; }

/* Exhibit */
.exhibit { position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); right: var(--gut-r); bottom: calc(12px + env(safe-area-inset-bottom, 0px)); width: min(600px, 47vw); display: flex; flex-direction: column; background: var(--panel-solid); border: 1px solid var(--rule-soft); border-top: 3px solid var(--accent); border-radius: var(--r); z-index: 5; opacity: 0; transform: translateX(16px); transition: opacity 0.35s, transform 0.35s; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); }
.exhibit.open { opacity: 1; transform: none; }
.exhibit-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 10px 10px 24px; border-bottom: 1px solid var(--rule-soft); }
.exhibit-bar .eyebrow { color: var(--accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { width: 40px; height: 40px; flex: none; border: 1px solid var(--rule-soft); background: transparent; border-radius: 3px; font-size: 22px; cursor: pointer; }
.icon-btn:hover { border-color: var(--accent); }
.exhibit-scroll { overflow-y: auto; overscroll-behavior: contain; padding: 28px 28px 32px; flex: 1; }
.ex-head { margin-bottom: 24px; }
.emblem { float: right; width: clamp(96px, 22%, 148px); aspect-ratio: 1; object-fit: contain; margin: 0 0 12px 20px; padding: 10px; box-sizing: border-box; border: 2px solid var(--gold); border-radius: var(--r); background: radial-gradient(circle, #1f2a24, #0c0d11); box-shadow: 0 0 24px rgba(232, 196, 74, 0.18); }
.list-ex:has(> .emblem) { grid-template-columns: minmax(0, 1fr) clamp(96px, 20vw, 148px); column-gap: 20px; }
.list-ex:has(> .emblem) > * { grid-column: 1 / -1; }
.list-ex:has(> .emblem) > :is(.kicker, h2, .lede) { grid-column: 1; }
.list-ex:has(> .emblem) > .emblem { grid-row: 1 / span 3; grid-column: 2; align-self: start; width: 100%; margin: 0; float: none; }
.kicker { margin: 0 0 10px; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.ex-head h2, .list-ex h2 { font-size: clamp(28px, 3.4vw, 40px); letter-spacing: -0.015em; }
.lede { font-size: 17px; line-height: 1.6; color: var(--ink); margin: 14px 0 0; max-width: 62ch; }
.ex-body { display: grid; gap: 28px; }
.sec { font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); padding-bottom: 8px; margin-bottom: 12px; border-bottom: 1px solid var(--rule-soft); }
.story p { margin: 0 0 10px; max-width: 62ch; }

.gallery { display: grid; gap: 10px; }
.gallery.n2 { grid-template-columns: 1fr 1fr; }
.gallery.n3 { grid-template-columns: 1.3fr 1fr 1fr; }
.gallery figure { margin: 0; min-width: 0; }
.zoomable { display: block; width: 100%; padding: 0; border: 0; background: #000; cursor: zoom-in; border-radius: var(--r); overflow: hidden; aspect-ratio: 4 / 5; }
.gallery.n1 .zoomable { aspect-ratio: 16 / 10; }
.zoomable.hero { outline: 2px solid var(--gold); outline-offset: -2px; box-shadow: 0 0 24px rgba(232, 196, 74, 0.18); }
.zoomable img { width: 100%; height: 100%; display: block; transition: transform 0.4s; }
.zoomable:hover img { transform: scale(1.03); }
figcaption { margin-top: 6px; font-size: 12px; color: var(--muted); }

.quote { margin: 0; padding: 6px 0 6px 18px; border-left: 2px solid var(--accent); }
.quote p { margin: 0 0 6px; font: italic 18px/1.5 var(--body); }
.quote cite { font-size: 12px; color: var(--muted); font-style: normal; letter-spacing: 0.08em; text-transform: uppercase; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 88px 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--rule-soft); font-size: 14px; }
.timeline li span:first-child { font-size: 12px; color: var(--muted); padding-top: 2px; font-variant-numeric: tabular-nums; }
.timeline li.key { color: var(--gold-text); }
.timeline li.key span:last-child { font-weight: 500; }

.facts { margin: 0; display: grid; gap: 0; }
.facts div { display: grid; grid-template-columns: 140px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--rule-soft); }
.facts dt { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); padding-top: 2px; }
.facts dd { margin: 0; font-size: 14px; }

.links { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.links a { font: 600 12px var(--mono); text-decoration: none; color: var(--ink); border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent); border-radius: 3px; padding: 8px 12px; }
.links a:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }

.media { display: grid; gap: 10px; }
.media-card { display: grid; grid-template-columns: 132px 1fr; gap: 14px; align-items: center; text-decoration: none; color: var(--ink); padding: 8px; border: 1px solid var(--rule-soft); border-radius: var(--r); }
.media-card:hover { border-color: var(--accent); }
.thumb { position: relative; aspect-ratio: 16 / 9; border-radius: 4px; overflow: hidden; background: repeating-linear-gradient(0deg, rgba(255,255,255,.04) 0 2px, transparent 2px 4px), linear-gradient(135deg, #1b1630, #0b0b10); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.play { position: absolute; inset: 0; margin: auto; width: 34px; height: 34px; border-radius: 50%; background: rgba(0, 0, 0, 0.7); border: 1px solid var(--accent); }
.play::after { content: ""; position: absolute; left: 13px; top: 10px; border-left: 11px solid var(--ink); border-top: 7px solid transparent; border-bottom: 7px solid transparent; }
.media-text { display: grid; gap: 2px; }
.media-text strong { font: 600 15px var(--display); }
.media-text span { font-size: 13px; color: var(--muted); }

.monitors { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.monitor { position: relative; display: grid; gap: 4px; align-content: start; min-height: 112px; padding: 12px; text-decoration: none; color: var(--ink); border-radius: 4px; border: 1px solid #1f2a24; background: repeating-linear-gradient(0deg, rgba(255,255,255,.035) 0 1px, transparent 1px 3px), radial-gradient(120% 120% at 20% 0%, color-mix(in srgb, var(--accent) 22%, #0a0f0c), #050806); box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.8); overflow: hidden; }
.monitor .ch { font-size: 11px; color: var(--accent); letter-spacing: 0.1em; }
.monitor strong { font: 600 14px/1.3 var(--display); }
.monitor span:last-child { font-size: 12px; color: var(--muted); }
.monitor:hover { border-color: var(--accent); }
.monitor::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 30%; background: linear-gradient(transparent, rgba(255,255,255,.06), transparent); transform: translateY(-100%); animation: scan 4s linear infinite; animation-delay: calc(var(--i) * -0.8s); }
@keyframes scan { to { transform: translateY(370%); } }

.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; gap: 8px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 30px 1fr; column-gap: 10px; font-size: 14px; }
.steps li::before { content: counter(s, decimal-leading-zero); grid-row: span 2; font: 600 12px var(--mono); color: var(--accent); padding-top: 2px; }
.steps strong { font-family: var(--display); }
.steps span { color: var(--muted); }

/* 2 Hand Hold'em demo */
.hh { padding: 18px; border-radius: var(--r); background: radial-gradient(140% 100% at 50% 0%, #11473e, #071d1a 70%); border: 1px solid rgba(45, 212, 191, 0.3); }
.hh-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.hh-row { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 10px; margin-bottom: 8px; }
.hh-label { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(236, 232, 220, 0.7); }
.hh-cards { display: flex; gap: 6px; flex-wrap: wrap; min-height: 58px; }
.card { width: 42px; height: 58px; display: grid; place-items: center; align-content: center; border-radius: 4px; background: #f8f5ec; color: #121212; border: 1px solid rgba(0, 0, 0, 0.3); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4); line-height: 1; padding: 0; }
.card b { font: 700 16px var(--display); }
.card i { font-style: normal; font-size: 18px; }
.card.red { color: #c81e1e; }
.card.back { background: repeating-linear-gradient(45deg, #0f4f47 0 4px, #0b3a35 4px 8px); border: 2px solid #f8f5ec; }
button.card { cursor: pointer; transition: transform 0.15s; }
button.card:hover:not(:disabled) { transform: translateY(-3px); }
button.card.picked { transform: translateY(-6px); outline: 2px solid var(--gold-text); }
.hh-hands { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0 8px; }
.hh-hand { padding: 10px; border: 1px dashed rgba(236, 232, 220, 0.25); border-radius: 4px; }
.hh-hand > span { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold-text); }
.hh-hand .hh-cards { margin-top: 6px; }
.hh-hand p { margin: 6px 0 0; font-size: 12px; min-height: 1.5em; }
.hh-hand.win { border: 1px solid var(--gold-text); background: rgba(232, 196, 74, 0.08); }
.hh-hand.lose { opacity: 0.7; }
.hh-msg { margin: 6px 0 12px; font-size: 14px; min-height: 1.5em; }
.hh .btn-ghost { min-height: 32px; }

/* Book */
.book-stage { display: grid; justify-items: center; gap: 10px; perspective: 1400px; padding: 10px 0; }
.book { position: relative; width: min(240px, 60vw); aspect-ratio: 2 / 3; padding: 0; border: 0; background: #f5f0e1; border-radius: 2px 6px 6px 2px; cursor: pointer; transform-style: preserve-3d; transform: rotateY(-18deg) rotateX(6deg); transition: transform 0.8s; box-shadow: 20px 24px 40px rgba(0, 0, 0, 0.5); }
.book.open { transform: rotateY(0) rotateX(0) translateX(40px); }
.book-inside { position: absolute; inset: 0; display: grid; align-content: center; gap: 10px; padding: 22px; color: #1a1712; text-align: left; }
.book-inside .mono { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: #8a6d1f; }
.book-inside strong { font: 600 17px/1.3 var(--display); }
.book-inside span:last-child { font-size: 13px; color: #4a4336; }
.book-cover { position: absolute; inset: 0; transform-origin: left center; transition: transform 0.9s cubic-bezier(.6,.05,.3,1); backface-visibility: hidden; transform-style: preserve-3d; }
.book-cover img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 2px 6px 6px 2px; }
.book.open .book-cover { transform: rotateY(-165deg); }
.hint-inline { margin: 0; font-size: 12px; color: var(--muted); letter-spacing: 0.08em; }

/* Contact */
.contact { padding: 18px; border: 1px solid var(--rule); border-radius: var(--r); background: linear-gradient(135deg, rgba(232, 196, 74, 0.08), transparent 60%); }
.contact .eyebrow { color: var(--gold-text); }
.email { display: block; font: 600 clamp(20px, 2.6vw, 28px)/1.2 var(--display); margin: 8px 0 14px; overflow-wrap: anywhere; user-select: all; }
.contact-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.copy-status { font-size: 12px; color: var(--muted); }
.downloads { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.downloads a { display: block; padding: 9px 12px; border: 1px solid var(--rule-soft); border-radius: 3px; text-decoration: none; color: var(--ink); font-size: 13px; }
.downloads a::before { content: "↓ "; color: var(--gold-text); }
.downloads a:hover { border-color: var(--gold); }

.ex-foot { margin-top: 32px; padding-top: 18px; border-top: 1px solid var(--rule-soft); }
.foot-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.foot-actions.spread { justify-content: space-between; }
.tour-foot .eyebrow { color: var(--gold-text); margin-bottom: 10px; }

/* List view */
.list-view { position: absolute; inset: 0; z-index: 8; background: var(--bg); overflow-y: auto; }
.list-head { position: sticky; top: 0; z-index: 1; background: var(--bg); border-bottom: 1px solid var(--rule-soft); }
.list-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: calc(12px + env(safe-area-inset-top, 0px)) var(--gut-r) 12px var(--gut); border-bottom: 1px solid var(--rule-soft); }
.list-nav { display: flex; gap: 6px; overflow-x: auto; padding: 10px var(--gut-r) 10px var(--gut); font-size: 12px; scrollbar-width: none; }
.list-nav a { flex: none; color: var(--ink); text-decoration: none; padding: 6px 10px; border: 1px solid var(--rule-soft); border-left: 2px solid var(--accent); border-radius: 3px; transition: background 0.2s, border-color 0.2s; }
.list-nav a.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); }
@media (hover: hover) { .list-nav a:hover { border-color: var(--accent); } }
.list-body { max-width: 760px; margin: 0 auto; padding: 32px var(--gut-r) 80px var(--gut); display: grid; gap: 72px; }
.list-ex { display: grid; gap: 24px; scroll-margin-top: 132px; }
.list-ex .kicker { margin: 0; }
.list-ex .lede { margin: 0; }
.no-webgl #list-close { display: none; }

.lightbox { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; align-content: center; gap: 10px; padding: 24px; background: rgba(0, 0, 0, 0.9); cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 82vh; object-fit: contain; border-radius: 4px; }
.lightbox-close { position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); right: 12px; }
.list-actions { display: flex; align-items: center; gap: 14px; }
.lightbox p { margin: 0; color: var(--muted); font-size: 13px; }

/* Loading reveal: the trophy photo and his name while the world assembles behind it. */
.loading { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; padding: 24px; background: radial-gradient(ellipse at 35% 45%, #1a1712, var(--bg) 70%); transition: opacity 0.7s; }
.loading.done { opacity: 0; pointer-events: none; }
.reveal { display: flex; align-items: center; gap: clamp(20px, 4vw, 48px); max-width: 860px; animation: reveal-in 0.9s ease-out both; }
.reveal-photo { width: clamp(180px, 26vw, 300px); height: auto; aspect-ratio: 2 / 3; object-fit: cover; object-position: 50% 15%; border: 2px solid var(--gold); border-radius: var(--r); box-shadow: 0 0 60px rgba(232, 196, 74, 0.22), 0 30px 80px rgba(0, 0, 0, 0.6); }
.reveal-text { display: grid; gap: 10px; }
.reveal-text .eyebrow { color: var(--gold-text); }
.reveal-name { margin: 0; font: 700 clamp(32px, 5vw, 56px)/1.05 var(--display); letter-spacing: -0.02em; }
.reveal-line { margin: 0; font-size: clamp(16px, 1.8vw, 20px); color: var(--ink); opacity: 0.86; }
.reveal-status { margin: 14px 0 0; display: flex; align-items: center; gap: 12px; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.reveal-status .bar { position: relative; width: 120px; height: 2px; background: var(--rule-soft); overflow: hidden; }
.reveal-status .bar::after { content: ""; position: absolute; inset: 0; width: 40%; background: var(--gold-text); animation: reveal-bar 1.1s ease-in-out infinite; }
@keyframes reveal-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes reveal-bar { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
@media (max-width: 640px) {
  .reveal { flex-direction: column; text-align: center; }
  .reveal-photo { width: min(56vw, 240px); }
  .reveal-status { justify-content: center; }
}

/* Header portrait: the trophy photo stays beside his name. */
.brand { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: start; }
.brand > :not(.portrait) { grid-column: 2; }
.portrait { grid-row: 1 / span 4; display: block; width: 76px; aspect-ratio: 4 / 5; border: 2px solid var(--gold); border-radius: var(--r); overflow: hidden; box-shadow: 0 0 24px rgba(232, 196, 74, 0.2); transition: transform 0.2s, opacity 0.3s; }
.portrait:hover { transform: translateY(-2px); }
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; display: block; }
[data-mode="exhibit"] .portrait { opacity: 0; pointer-events: none; }

/* Mid widths: tuck the readout so it never collides with the rail or the minimap. */
@media (max-width: 1180px) {
  .readout { max-width: calc(100vw - 32px); bottom: calc(184px + env(safe-area-inset-bottom, 0px)); left: auto; right: var(--gut-r); transform: none; min-width: 0; width: 300px; }
  .hint { display: none; }
}

/* Phones */
@media (max-width: 760px) {
  .deck-top { flex-wrap: wrap; gap: 8px; padding-bottom: 6px; }
  .brand h1 { font-size: 22px; }
  .top-actions { gap: 6px; }
  .top-actions .btn-link, .wide-only, .zoom-btns, .list-actions .btn-link { display: none; }
  .no-webgl .list-actions .btn-link { display: inline-flex; }
  .label { padding: 3px 6px 4px; }
  .label strong { font-size: 12px; }
  .label .era { display: none; }
  .btn-solid, .btn-ghost { min-height: 34px; padding: 0 10px; font-size: 12px; }
  .sectors { left: var(--gut); right: var(--gut-r); width: auto; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  .sectors-panel { max-height: 60vh; overflow-y: auto; }
  .intro { font-size: 13px; margin-top: 2px; }
  /* Name, one line, then the tour button sharing a row with List and Media. */
  .deck-top { display: grid; align-items: center; column-gap: 8px; row-gap: 0; }
  .brand { display: contents; }
  .brand > * { grid-column: 1 / -1; pointer-events: auto; }
  .brand .eyebrow { display: none; }
  .deck-top { grid-template-columns: auto 1fr auto; }
  .deck-top .brand .portrait { grid-column: 1; grid-row: 1 / span 2; width: 46px; align-self: center; margin-right: 2px; }
  .deck-top .brand h1 { grid-column: 2 / -1; grid-row: 1; }
  .deck-top .brand .intro { grid-column: 2 / -1; grid-row: 2; }
  .deck-top .brand .btn-cta { grid-column: 1 / span 2; grid-row: 3; justify-self: start; margin-top: 10px; min-height: 36px; padding: 0 14px; font-size: 12px; }
  .top-actions { grid-column: 3; grid-row: 3; margin-top: 10px; flex-wrap: nowrap; }
  /* Phones keep only the world, the signs and the drawer: no minimap, counter or hint. */
  .instruments { display: none; }
  .readout { left: var(--gut); right: var(--gut-r); width: auto; bottom: calc(60px + env(safe-area-inset-bottom, 0px)); padding: 12px 14px; display: grid; grid-template-columns: 1fr auto; text-align: left; column-gap: 12px; align-items: center; }
  .readout .eyebrow, .readout h2, .readout-tag { grid-column: 1; }
  .readout h2 { font-size: 18px; margin: 2px 0; }
  .readout-tag { margin: 0; font-size: 12px; }
  #readout-go { grid-column: 2; grid-row: 1 / span 3; }
  .readout::before, .readout::after { display: none; }
  .exhibit { top: 38vh; left: 0; right: 0; bottom: 0; width: auto; border-radius: 14px 14px 0 0; transform: translateY(24px); border-left: 0; border-right: 0; border-bottom: 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .exhibit-bar { padding-left: var(--gut); }
  .exhibit-scroll { padding: 20px var(--gut-r) 28px var(--gut); }
  .lede { font-size: 16px; }
  .gallery.n3 { grid-template-columns: 1fr 1fr; }
  .gallery.n3 figure:first-child { grid-column: 1 / -1; }
  .gallery.n3 figure:first-child .zoomable { aspect-ratio: 1; } /* the lead photos are portraits: keep the trophy and his face in frame */
  .facts div { grid-template-columns: 1fr; gap: 2px; }
  .media-card { grid-template-columns: 104px 1fr; }
  .downloads { grid-template-columns: 1fr; }
  .timeline li { grid-template-columns: 74px 1fr; }
  .toast { left: var(--gut); right: var(--gut-r); width: auto; bottom: auto; top: calc(150px + env(safe-area-inset-top, 0px)); }
  /* While an exhibit is open the sheet is the focus: drop the header buttons and float the toast just above the sheet. */
  .top-actions { transition: opacity 0.3s; }
  [data-mode="exhibit"] .top-actions, [data-mode="exhibit"] .brand h1 { opacity: 0; pointer-events: none; }
  [data-mode="exhibit"] .toast { display: none; } /* the small view above the sheet is for the building */
  [data-mode="exhibit"] .instruments { opacity: 0; pointer-events: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
#ex-title:focus { outline: none; }

/* Phones: the logo sits above the heading so the text runs full width. */
@media (max-width: 760px) {
  .emblem { float: none; display: block; width: 92px; margin: 0 0 14px; padding: 8px; }
  .list-ex:has(> .emblem) { grid-template-columns: minmax(0, 1fr); }
  .list-ex:has(> .emblem) > :is(.kicker, h2, .lede) { grid-column: 1; }
  .list-ex:has(> .emblem) > .emblem { grid-row: auto; grid-column: 1; width: 92px; margin: 0 0 14px; }
}
