:root[data-theme="film"] { --bg: #14100c; --ink: #f3ead9; --ink-2: #b8a892; --ink-3: #7a6a58; --line: rgba(243,234,217,.10); --line-2: rgba(243,234,217,.22); --panel: rgba(20,16,12,.88); --accent: #f0b35c; --sans: 'Instrument Serif', 'Instrument Sans', Georgia, serif; }
:root[data-theme="arcade"] { --bg: #050308; --ink: #f2ecff; --ink-2: #b9a8d6; --ink-3: #6e5c8a; --line: rgba(242,236,255,.10); --line-2: rgba(242,236,255,.22); --panel: rgba(5,3,8,.9); --accent: #ff4fd8; }
:root {
  --bg: #08090c;
  --ink: #e6e8ee;
  --ink-2: #9aa1b2;
  --ink-3: #5c6270;
  --line: rgba(230,232,238,.10);
  --line-2: rgba(230,232,238,.22);
  --panel: rgba(10,11,15,.86);
  --accent: #9ec5ff;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
  --sans: 'Instrument Sans', system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--sans); overflow: hidden; -webkit-font-smoothing: antialiased; }
canvas#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
button, input { font: inherit; }
.mono, .stats, .legend, .label, .meta, #intro-line, #intro-steps, .hint, .drop p, .toast { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }

.hud { position: fixed; top: 24px; left: 26px; z-index: 5; pointer-events: none; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.hud h1 { margin: 0; font-size: 15px; font-weight: 500; letter-spacing: .02em; }
.hud .sub { margin: 8px 0 0; color: var(--ink-2); font-size: 13px; max-width: 340px; line-height: 1.5; }
.stats { display: flex; gap: 28px; margin: 22px 0 0; color: var(--ink-3); }
.stats div { display: flex; flex-direction: column; gap: 6px; }
.stats dt { font-size: 10px; }
.stats dd { margin: 0; font-size: 20px; letter-spacing: 0; color: var(--ink); font-weight: 500; }

.seg { pointer-events: auto; display: inline-flex; margin-top: 18px; border: 1px solid var(--line-2); }
.seg button { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; background: transparent; border: 0; color: var(--ink-3); padding: 7px 12px; cursor: pointer; }
.seg button.on { background: rgba(230,232,238,.08); color: var(--ink); }
.seg button:hover { color: var(--ink); }
.loadbox { pointer-events: auto; margin-top: 16px; width: 380px; border: 1px solid var(--line); border-left: 1px solid var(--accent); padding: 12px 14px; background: rgba(8,9,12,.7); display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.loadbox p { width: 100%; margin: 0 0 4px; font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.ghost.small { padding: 6px 10px; font-size: 10px; }
.small.link { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); text-decoration: none; }
.small.link:hover { color: var(--accent); }
.sw-co { border-radius: 2px; border-color: var(--ink-2); }
.legend { position: fixed; top: 26px; right: 26px; z-index: 5; display: flex; flex-direction: column; gap: 8px; color: var(--ink-3); pointer-events: none; text-align: right; }
.legend span { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.sw { width: 9px; height: 9px; border-radius: 50%; display: inline-block; border: 1.5px solid var(--ink-3); }
.sw-rec { border-color: var(--ink); }
.sw-con { border-color: var(--ink-3); }
.sw-tie { border-color: var(--accent); box-shadow: 0 0 8px var(--accent); }

.panel { position: fixed; top: 96px; right: 26px; width: 360px; max-height: calc(100vh - 290px); overflow: auto; z-index: 6;
  background: var(--panel); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line); padding: 22px; animation: rise .4s cubic-bezier(.2,.8,.2,1); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.panel .close { position: absolute; top: 8px; right: 10px; background: none; border: 0; color: var(--ink-3); font-size: 20px; cursor: pointer; }
.panel .close:hover { color: var(--ink); }
.who { display: flex; gap: 14px; align-items: flex-start; }
.who img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 1.5px solid var(--accent); background: #111318; }
.who img.logo { border-radius: 10px; object-fit: contain; padding: 10px; background: #0f1116; }
.who h2 { margin: 0; font-size: 17px; font-weight: 500; }
.who p { margin: 4px 0 0; font-size: 13px; color: var(--ink-2); line-height: 1.4; }
.who .meta { margin-top: 8px; color: var(--ink-3); font-size: 10px; }
.ties { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 6px; }
.ties .label { width: 100%; color: var(--ink-3); margin: 0 0 4px; font-size: 10px; }
.ties button { border: 1px solid var(--line-2); background: transparent; color: var(--ink); padding: 5px 10px; font-size: 12px; cursor: pointer; }
.ties button:hover { border-color: var(--accent); color: var(--accent); }
blockquote { margin: 18px 0 0; padding: 0 0 0 14px; border-left: 1px solid var(--line-2); font-size: 13px; line-height: 1.6; color: var(--ink-2); white-space: pre-line; }
.panel-actions { display: flex; gap: 8px; margin-top: 18px; }
.ghost { border: 1px solid var(--line-2); background: transparent; color: var(--ink); padding: 8px 12px; font-size: 12px; cursor: pointer; text-decoration: none; font-family: var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.ghost:hover { border-color: var(--accent); color: var(--accent); }

.ask { position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%); width: min(600px, calc(100vw - 40px)); z-index: 6; display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.pills-wrap { display: flex; flex-direction: column; gap: 9px; background: rgba(9,10,13,.97); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--line-2); border-radius: 14px; padding: 12px 14px; box-shadow: 0 18px 50px rgba(0,0,0,.6); }
.pills-label { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.answer { pointer-events: auto; width: 100%; max-height: 42vh; overflow: auto; background: rgba(12,14,18,.97); border: 1px solid var(--line-2); border-left: 2px solid var(--accent); border-radius: 14px; padding: 16px 18px; font-size: 14.5px; line-height: 1.62; color: var(--ink); animation: rise .4s cubic-bezier(.2,.8,.2,1); position: relative; box-shadow: 0 18px 50px rgba(0,0,0,.55); }
.answer p { margin: 0; padding-right: 52px; }
.answer-q { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 9px !important; }
.answer-q:empty { display: none; }
.answer.thinking p { color: var(--ink-3); font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.answer.thinking p::after { content: ''; display: inline-block; width: 6px; height: 6px; margin-left: 8px; border-radius: 50%; background: var(--accent); animation: blink 1s infinite; vertical-align: middle; }
@keyframes blink { 50% { opacity: .15; } }
.mini { position: absolute; top: 10px; right: 10px; border: 1px solid var(--line); background: transparent; color: var(--ink-3); padding: 3px 7px; font-size: 10px; cursor: pointer; font-family: var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.mini:hover { color: var(--ink); border-color: var(--line-2); }
.pills { display: flex; flex-wrap: wrap; gap: 7px; }
.pills button { border: 1px solid var(--line-2); background: rgba(230,232,238,.08); color: var(--ink); padding: 8px 12px; border-radius: 9px; cursor: pointer; transition: .15s; font-size: 13px; line-height: 1.2; text-shadow: 0 1px 3px rgba(0,0,0,.7); }
.pills button:hover { color: var(--accent); border-color: var(--accent); background: rgba(230,232,238,.13); }
.pills button.on { color: var(--accent); border-color: var(--accent); background: rgba(158,197,255,.14); }
.bar { width: 100%; display: flex; align-items: center; gap: 12px; background: rgba(9,10,13,.97); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--line-2); border-radius: 12px; padding: 5px 5px 5px 14px; transition: border-color .2s, background .2s; box-shadow: 0 18px 50px rgba(0,0,0,.6); }
.bar:hover { border-color: var(--line-2); }
.bar:focus-within { border-color: var(--accent); }
.prompt-glyph { font-family: var(--mono); color: var(--accent); }
.bar input { flex: 1; background: none; border: 0; color: var(--ink); outline: none; font-size: 14px; text-shadow: 0 1px 3px rgba(0,0,0,.7); }
.bar input::placeholder { color: var(--ink-3); }
.bar button { border: 1px solid var(--line-2); background: transparent; color: var(--ink); padding: 8px 14px; cursor: pointer; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.bar button:hover { border-color: var(--accent); color: var(--accent); }
.bar button:disabled { opacity: .4; cursor: default; }
.hint { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); margin: 0; color: var(--ink-3); font-size: 10px; z-index: 6; opacity: .7; white-space: nowrap; }
.hint b { color: var(--ink-2); font-weight: 500; }

.intro { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; background: rgba(8,9,12,.86); transition: opacity .9s; }
.intro.out { opacity: 0; pointer-events: none; }
.intro-card { text-align: left; max-width: 520px; padding: 0 24px; }
.intro .kicker { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin: 0 0 18px; }
.intro .face { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 1.5px solid var(--accent); box-shadow: 0 0 24px rgba(158,197,255,.35); margin: 0 0 22px; display: block; }
.intro h2, .intro .lede { text-wrap: balance; }
.intro h2 { font-size: 34px; line-height: 1.12; font-weight: 500; margin: 0 0 18px; letter-spacing: -.01em; }
.intro .lede { font-size: 16px; line-height: 1.6; color: var(--ink); margin: 0 0 14px; }
.intro .how { font-size: 14px; line-height: 1.6; color: var(--ink-2); margin: 0 0 26px; }
.intro .enter { font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; background: var(--ink); color: #0b0d12; border: 0; padding: 12px 18px; cursor: pointer; }
.intro .enter:hover { background: var(--accent); }
.intro .fine { margin: 22px 0 0; font-size: 12px; color: var(--ink-3); }
.intro .fine a { color: var(--ink-2); text-decoration: none; border-bottom: 1px solid var(--line-2); }
.intro .loading { margin-top: 28px; text-align: center; }
.intro.out { opacity: 0; pointer-events: none; }
.ring { width: 44px; height: 44px; margin: 0 auto 26px; border-radius: 50%; border: 1px solid var(--line-2); border-top-color: var(--accent); animation: spin 1.2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#intro-line { margin: 0; color: var(--accent); }
#intro-steps { list-style: none; padding: 0; margin: 22px 0 0; color: var(--ink-3); font-size: 10px; }
#intro-steps li { margin: 8px 0; transition: .3s; }
#intro-steps li.on { color: var(--ink); }
#intro-steps li.done { color: var(--ink-3); }
#intro-steps li.done::before { content: '· '; color: var(--accent); }

.drop { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(158,197,255,.04); border: 1px solid var(--accent); }
.drop p { color: var(--accent); font-size: 13px; }
.toast { position: fixed; top: 24px; left: 50%; transform: translateX(-50%); z-index: 40; background: var(--panel); border: 1px solid var(--line-2); padding: 10px 14px; animation: rise .3s; color: var(--ink); }

@media (max-width: 720px) {
  .legend, .hud .sub, .pills-wrap, .hint { display: none; }
  /* docked under the HUD, not over the ask bar: the field stays visible and nothing stacks on nothing else */
  .panel { left: 12px; right: 12px; width: auto; top: 150px; bottom: auto; max-height: 42vh; }
  .kudos { left: 12px; right: 12px; width: auto; top: 150px; bottom: auto; max-height: 42vh; }
}

.panel .grip { height: 14px; margin: -10px -22px 8px; cursor: grab; background: linear-gradient(var(--line-2), var(--line-2)) center / 28px 2px no-repeat; }
.panel .grip:active { cursor: grabbing; }
.legend .switch { pointer-events: auto; margin-top: 8px; align-self: flex-end; font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; background: transparent; border: 1px solid var(--line-2); color: var(--ink-3); padding: 5px 9px; cursor: pointer; }
.legend .switch.on { color: var(--accent); border-color: var(--accent); }
.matches { width: 100%; background: var(--panel); backdrop-filter: blur(14px); border: 1px solid var(--line); display: flex; flex-direction: column; }
.matches button { display: flex; gap: 12px; align-items: baseline; text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--line); color: var(--ink); padding: 9px 14px; cursor: pointer; font-size: 13px; }
.matches button:last-child { border-bottom: 0; }
.matches button:hover { background: rgba(230,232,238,.05); }
.matches b { font-weight: 500; white-space: nowrap; }
.matches span { color: var(--ink-3); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ask .matches { display: flex; }

body.pre .hud, body.pre .legend, body.pre .ask, body.pre .hint { visibility: hidden; }

.seg.small { margin-top: 10px; align-self: flex-end; pointer-events: auto; }
.seg.small button { padding: 5px 9px; }
.kudos { position: fixed; bottom: 34px; left: 26px; width: 340px; max-height: 56vh; overflow: auto; z-index: 6; background: rgba(12,14,18,.97); backdrop-filter: blur(14px); border: 1px solid var(--line-2); border-left: 2px solid var(--accent); border-radius: 14px; padding: 16px 18px 18px; animation: rise .4s cubic-bezier(.2,.8,.2,1); box-shadow: 0 18px 50px rgba(0,0,0,.55); }
.kudos .close { position: absolute; top: 8px; right: 12px; background: none; border: 0; color: var(--ink-3); font-size: 20px; line-height: 1; cursor: pointer; }
.kudos .close:hover { color: var(--ink); }
.kudos .label { margin: 0 0 12px; color: var(--ink-3); }
.kudos article { display: flex; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); cursor: pointer; }
.kudos article:hover h3 { color: var(--accent); }
.kudos img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line-2); flex: none; }
.kudos h3 { margin: 0; font-size: 14px; font-weight: 500; }
.kudos .meta { margin: 3px 0 8px; font-size: 10px; }
.kudos blockquote { margin: 0; padding: 0; border: 0; font-size: 12.5px; line-height: 1.55; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

.enter:disabled { opacity: .55; cursor: default; }
.intro .enter.continue { display: inline-flex; align-items: center; gap: 11px; font-family: var(--sans); font-size: 15px; letter-spacing: 0; text-transform: none; font-weight: 500; background: #fff; color: #0b0d12; border-radius: 999px; padding: 7px 22px 7px 7px; }
.intro .enter.continue:hover { background: #e9edf4; }
.intro .btn-face { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: #d5d9e0; flex: none; }

/* entering the map: drop the pitch, keep only the loading steps */
.intro-card.entering .kicker,
.intro-card.entering h2,
.intro-card.entering .lede,
.intro-card.entering .how,
.intro-card.entering .enter,
.intro-card.entering .face,
.intro-card.entering .fine { display: none; }
.intro-card.entering { text-align: center; max-width: 340px; }
.intro-card.entering .loading { margin-top: 0; }
