:root {
  color-scheme: dark;
  --paper: #eee7db; --muted: #b4afa5; --subtle: #8f8a81;
  --accent: #d9a47d; --ember: #c36547;
  --line: rgba(232,215,190,.17); --panel: rgba(22,20,19,.76);
  --sans: 'Segoe UI', system-ui, sans-serif;
  --display: Georgia, 'Times New Roman', serif;
  background: #0b0a09; color: var(--paper); font-family: var(--sans); font-synthesis: none;
}
* { box-sizing: border-box; }
html { min-width: 300px; scroll-behavior: smooth; }
body { margin: 0; min-height: 100svh; background: #0b0a09; isolation: isolate; }
body::before { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 1; background: linear-gradient(90deg, rgba(10,9,8,.97), rgba(10,9,8,.89) 28%, rgba(10,9,8,.42) 58%, rgba(10,9,8,.12)); }
body::after { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 1; opacity: .055; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' opacity='.7' filter='url(%23n)'/%3E%3C/svg%3E"); }
#atmosphere { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
main { position: relative; width: 100%; max-width: 1680px; margin: auto; padding: 48px 6.25vw 30px; min-height: 100svh; z-index: 2; }
button, input, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button, a, input, select { touch-action: manipulation; }
button { cursor: pointer; color: var(--paper); border: 1px solid var(--line); background: rgba(27,23,21,.8); padding: 14px 20px; min-height: 48px; font-size: .88rem; font-weight: 500; transition: background .18s, color .18s, border-color .18s, transform .18s; }
button:hover { border-color: var(--accent); background: rgba(58,43,33,.85); }
button:active { transform: translateY(1px); }
button:focus-visible, input:focus-visible, select:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
button:disabled { opacity: .45; cursor: default; }
button:disabled:hover { border-color: var(--line); background: rgba(27,23,21,.8); }
p { color: var(--muted); line-height: 1.75; max-width: 740px; }
h1, h2, h3, p { overflow-wrap: break-word; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; }
h2 { margin: 18px 0 22px; font-size: clamp(2rem,4vw,3.5rem); line-height: 1.12; letter-spacing: -.035em; }
.eyebrow, .folio, .kicker, .session-label, .art-index { font-family: var(--sans); font-size: .66rem; font-weight: 500; letter-spacing: .19em; text-transform: uppercase; color: var(--muted); line-height: 1.6; }
header { position: relative; margin-bottom: 42px; }
.brand { margin-bottom: 16px; }
.brand > .eyebrow { display: inline-flex; align-items: center; gap: 12px; }
.brand > .eyebrow::before { content: ''; width: 5px; height: 5px; background: var(--ember); border-radius: 50%; box-shadow: 0 0 16px rgba(195,101,71,.55); }
.folio { position: absolute; top: 1px; right: 0; color: #a09a8e; }
.brand h1, header h1 { margin: 20px 0 0; font-family: var(--display); font-size: clamp(5.4rem,10.5vw,10rem); line-height: 1.08; letter-spacing: .16em; color: var(--paper); text-shadow: 0 0 50px rgba(224,180,135,.08); }
.rule { width: 100%; height: 1px; margin-top: 27px; background: linear-gradient(90deg,rgba(217,164,125,.42),rgba(217,164,125,.07) 70%,transparent); position: relative; }
.rule::before { content: ''; position: absolute; top: -1px; left: 0; width: 56px; height: 2px; background: var(--accent); }

/* A quiet editorial surface around the audio-led experience. */
.home-layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,.95fr); gap: 7%; min-height: 450px; position: relative; }
.home-copy { padding-top: 28px; }
.home-copy .brand h1 { font-size:clamp(4rem,8.5vw,8rem); letter-spacing:.12em; white-space:nowrap; overflow-wrap:normal; }
.home-copy .kicker { color: var(--accent); margin: 0 0 19px; letter-spacing: .22em; font-size: .62rem; }
.tagline { font-family: var(--display); color: var(--paper); font-size: clamp(2.5rem,3.65vw,4.1rem); line-height: 1.08; letter-spacing: -.045em; margin: 0 0 20px; max-width: 570px; }
.intro { font-size: .82rem; max-width: 390px; line-height: 1.8; margin-bottom: 28px; color: #b1aba1; }
.menu { display: flex; flex-direction: column; align-items: stretch; gap: 5px; width: min(100%,640px); margin-top: 24px; }
.menu button { text-align: left; position: relative; border-color: transparent; background: transparent; min-height: 45px; padding: 12px 0; line-height: 1.5; color: var(--muted); }
.menu button:hover { color: var(--paper); background: rgba(222,181,147,.05); border-color: transparent; }
.menu button small { font-size: .72rem; margin-left: 12px; color: var(--subtle); }
.home-copy .menu { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 2px 24px; width: min(100%,478px); margin-top: 0; }
.home-copy .menu button { padding: 11px 0; min-height: 43px; font-size: .77rem; border-bottom: 1px solid var(--line); }
.home-copy .menu button:hover { border-bottom-color: var(--accent); }
.home-copy .menu .menu-primary, .menu .menu-primary { background: var(--paper); color: #211710; padding: 19px 23px; min-height: 58px; margin: 0 0 14px; border: 1px solid var(--paper); font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.home-copy .menu .menu-primary { grid-column: 1 / -1; }
.menu .menu-primary::after { content: '↗'; float: right; font-size: 1.25rem; font-weight: 400; line-height: 1; margin-left: 10px; }
.menu .menu-primary:hover { background: #d9a47d; border-color: #d9a47d; color: #160f0b; }
.home-art { position: relative; min-height: 390px; align-self: stretch; pointer-events: none; }
.home-art::before { content: ''; position: absolute; inset: 10% -6% 13% 5%; border: 1px solid rgba(211,158,123,.11); clip-path: polygon(0 0,24px 0,24px 1px,calc(100% - 24px) 1px,calc(100% - 24px) 0,100% 0,100% 24px,calc(100% - 1px) 24px,calc(100% - 1px) calc(100% - 24px),100% calc(100% - 24px),100% 100%,calc(100% - 24px) 100%,calc(100% - 24px) calc(100% - 1px),24px calc(100% - 1px),24px 100%,0 100%,0 calc(100% - 24px),1px calc(100% - 24px),1px 24px,0 24px); }
.art-index { position: absolute; top: 18%; left: 9%; font-size: .57rem; letter-spacing: .22em; opacity: .7; }
.art-caption { position: absolute; right: 0; bottom: 0; font-family: var(--display); font-style: italic; font-size: 1rem; color: #d4c3ac; opacity: .8; }
.sound-emblem { position: absolute; top: 15%; right: 0; display: flex; gap: 3px; height: 18px; align-items: center; }
.sound-emblem i { display: block; width: 1px; height: 5px; background: #d2b399; opacity: .8; }
.sound-emblem i:nth-child(2n) { height: 12px; }
.sound-emblem i:nth-child(3n) { height: 18px; }
.sound-emblem i:nth-child(4n) { height: 9px; }
.home-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 30px; margin-top: 35px; padding-top: 20px; border-top: 1px solid var(--line); }
footer { color: var(--subtle); font-size: .63rem; line-height: 1.9; letter-spacing: .08em; margin-top: 36px; }
.home-footer p { margin: 0; color: var(--subtle); font-size: .63rem; line-height: 1.8; letter-spacing: .05em; }
.home-footer .footer-note { color: var(--accent); }
.home-utilities { display:flex; flex-wrap:wrap; gap:3px 20px; margin-top:20px; max-width:490px; }
.home-utilities button { border:0; background:none; color:var(--muted); font-size:.72rem; padding:8px 0; min-height:38px; }
.home-utilities button:hover { color:var(--accent); }
.save-note { grid-column:1 / -1; margin:-7px 0 12px; font-size:.72rem; }
.setup-steps { list-style:none; padding:0; display:grid; grid-template-columns:repeat(3,1fr); gap:14px; max-width:960px; }
.setup-steps li { display:flex; gap:18px; border:1px solid var(--line); background:var(--panel); padding:24px; }
.setup-steps li>span { color:var(--accent); font-size:.7rem; padding-top:3px; }
.setup-steps strong { font-size:.85rem; font-weight:500; }
.setup-steps p { font-size:.76rem; margin:8px 0 0; line-height:1.6; }
.safety-note { font-size:.75rem; margin-top:25px; }
.settings-tabs { display:flex; gap:8px; margin-top:26px; }
.settings-tabs button { min-height:42px; font-size:.76rem; background:transparent; }
.settings-tabs [aria-current="page"] { border-color:var(--accent); color:var(--accent); background:rgba(217,164,125,.08); }

.screen-shell { max-width: 1160px; }
.screen-shell header { margin-bottom: 38px; }
.screen-shell header h1, body:not([data-screen="home"]) header h1 { font-size: clamp(3rem,6vw,5.3rem); letter-spacing: .18em; }
.screen-shell .rule { margin-top: 22px; }
.screen-heading { margin-bottom: 26px; max-width: 820px; }
.screen-heading h2 { margin-top: 12px; }
.screen-heading p { font-size: .9rem; margin: 0; }
.settings { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; max-width: 960px; margin: 26px 0 30px; }
.settings label { display: flex; flex-direction: column; justify-content: center; gap: 17px; font-size: .8rem; line-height: 1.55; min-height: 108px; padding: 20px 24px; border: 1px solid var(--line); background: var(--panel); color: var(--paper); }
.settings label:has(input[type="checkbox"]) { flex-direction: row-reverse; justify-content: flex-end; align-items: center; gap: 18px; min-height: 89px; }
.settings label:focus-within { border-color: var(--accent); background: rgba(38,29,23,.9); }
.settings label.setting-row { display:grid; grid-template-columns:1fr auto; align-content:center; gap:10px 18px; }
.setting-title { grid-column:1; }
.setting-value { grid-column:2; grid-row:1; font-variant-numeric:tabular-nums; font-size:.8rem; }
.setting-hint { grid-column:1 / -1; font-size:.7rem; font-weight:400; color:var(--muted); line-height:1.6; }
.setting-row input[type="range"],.setting-row select { grid-column:1 / -1; }
.settings label.setting-checkbox { grid-template-columns:24px 1fr; justify-content:normal; align-items:start; }
.setting-checkbox .setting-title { grid-column:2; grid-row:1; }
.setting-checkbox .setting-hint { grid-column:2; }
.setting-checkbox input { grid-column:1; grid-row:1; }
input, select { max-width: 100%; background: #171310; color: var(--paper); border: 1px solid #6d6258; padding: 10px 12px; accent-color: var(--accent); }
input[type="range"] { padding: 0; width: 100%; min-height: 28px; cursor: pointer; background: transparent; }
input[type="checkbox"] { width: 20px; height: 20px; flex: 0 0 20px; margin: 0; cursor: pointer; }
select { min-height: 44px; cursor: pointer; }
.bindings { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; width: min(100%,960px); margin: 25px 0 30px; }
.bindings button { text-align: left; min-height: 56px; font-size: .81rem; background: var(--panel); }
.bindings button:hover { background: rgba(58,43,33,.85); }
.status, .setting-value { color: var(--accent); font-family: var(--sans); }
.binding-status { color:var(--accent); font-size:.82rem; }
.bindings button.remapping { outline:2px solid var(--accent); background:rgba(217,164,125,.14); }
.result-stats { display:flex; gap:48px; flex-wrap:wrap; margin:35px 0; padding:26px 0; border-block:1px solid var(--line); max-width:880px; }
.result-stats dt { font-size:.68rem; color:var(--muted); margin-bottom:10px; }
.result-stats dd { margin:0; font-family:var(--display); font-size:1.6rem; }
body[data-screen="history"] .menu { width: min(100%,960px); }
body[data-screen="history"] .menu button { border-bottom-color: var(--line); padding: 16px 0; }
body[data-screen="practice"] #cue-description { border-left: 2px solid var(--accent); padding-left: 20px; }
body[data-screen="practice"] #cue-description:empty { display: none; }

.play { display: flex; min-height: calc(100svh - 80px); flex-direction: column; position: relative; }
.play:focus-visible { outline: none; }
.play-top { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding-bottom: 25px; border-bottom: 1px solid var(--line); }
.brand-small { color: var(--paper); font-family: var(--display); letter-spacing: .22em; font-size: 1.55rem; font-weight: 400; }
.session-label { color: var(--subtle); font-size: .62rem; }
.mission-panel { padding-top: 45px; width: min(100%,750px); }
.mission-panel .eyebrow { color: var(--accent); display: inline-flex; align-items: center; gap: 11px; }
.mission-panel .eyebrow::before { content: ''; height: 4px; width: 4px; background: var(--accent); border-radius: 50%; }
.mission-panel h2 { max-width: 650px; font-size: clamp(2.4rem,4.3vw,4.25rem); margin: 18px 0; color: var(--paper); }
.objective-copy, #room-status { font-size: .8rem; color: var(--muted); }
#room-status { display: inline-block; margin: 5px 0; padding: 9px 12px; font-size: .68rem; border: 1px solid var(--line); letter-spacing: .075em; }
.interaction-cue { width: fit-content; max-width: 650px; margin-top: 22px; padding: 12px 17px; color: var(--paper); font-size: .8rem; line-height: 1.6; border-left: 2px solid var(--accent); background: rgba(35,28,23,.82); }
.interaction-cue[hidden] { display: none; }
.interaction-cue kbd, .controls kbd { font: inherit; color: var(--paper); border: 1px solid #716358; background: #211c17; padding: 3px 6px; margin-right: 5px; }
.journey { display: flex; gap: 0; width: min(100%,850px); margin-top: auto; padding: 65px 0 0; list-style: none; }
.journey-step { width: 25%; position: relative; padding: 21px 18px 0 0; border-top: 1px solid var(--line); font-size: .67rem; letter-spacing: .05em; line-height: 1.6; color: var(--subtle); }
.journey-step::before { content: ''; position: absolute; width: 5px; height: 5px; border: 1px solid #877566; background: #0f0c0a; top: -3px; left: 0; border-radius: 50%; }
.journey-step[aria-current="step"] { color: var(--paper); border-top-color: var(--accent); }
.journey-step[aria-current="step"]::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 10px #a2633655; }
.journey-step .step-number { font-size: .59rem; display: block; color: var(--subtle); margin-bottom: 4px; }
.journey-step>span:first-child { display:block; font-size:.59rem; margin-bottom:4px; }
.journey-step.completed { color:var(--muted); border-top-color:rgba(217,164,125,.45); }
.journey-step.completed::before { background:var(--muted); }
.play-bottom { margin-top:auto; padding-top:30px; padding-bottom:82px; display:grid; grid-template-columns:1fr auto; align-items:center; gap:20px 28px; }
.play-bottom .interaction-cue { grid-column:1 / -1; margin-bottom:0; }
.quick-controls { display:flex; flex-wrap:wrap; gap:14px 22px; color:var(--muted); font-size:.68rem; line-height:1.7; }
.quick-controls span { white-space:nowrap; }
.quick-controls kbd { font:inherit; color:var(--paper); border-bottom:1px solid #7d6c5c; padding:3px 0; margin-right:7px; }
.play .controls { font-family: var(--sans); font-size: .7rem; line-height: 1.9; color: var(--muted); max-width: 660px; margin: 0; }
.play-actions { display: flex; flex-wrap: wrap; gap: 9px; flex-shrink: 0; }
.play-actions button { font-size: .72rem; min-height: 44px; background: rgba(17,14,12,.7); border-color: rgba(218,177,145,.3); }
.pause-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; }
.pause-summary { border-left: 1px solid var(--line); padding-left: 35px; }

.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; }
#caption { position: fixed; z-index: 10; bottom: max(22px,env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: min(88%,1150px); font-size: var(--caption-size,20px); line-height: 1.5; text-align: center; color: #fff6e8; background: rgba(7,6,5,.96); border: 1px solid rgba(217,164,125,.42); padding: 13px 23px; box-shadow: 0 8px 35px #0009; pointer-events: none; }
#caption:empty { padding: 0; border: 0; background: none; box-shadow: none; }
.audio-only #atmosphere, .audio-only .home-art { display: none; }
.audio-only::before, .audio-only::after { display: none; }
.audio-only .home-layout { grid-template-columns: 1fr; }
.audio-only .home-copy { max-width: 660px; }
.hide-ui .play-top, .hide-ui .mission-panel, .hide-ui .journey, .hide-ui .play .controls { opacity: 0; }
.hide-ui .play-actions button { opacity: 0; }
.hide-ui .play-actions button:focus-visible { opacity: 1; }
.hide-ui .quick-controls,.hide-ui .interaction-cue { opacity:0; }
.high-contrast { --paper: #fff; --muted: #e6e6e6; --subtle: #cdcdcd; --accent: #ffd3a3; --line: #9b8f80; --panel: #101010; }
.high-contrast::before { background: rgba(0,0,0,.92); }
.high-contrast::after { display: none; }
.high-contrast .menu button, .high-contrast .intro, .high-contrast .folio, .high-contrast .session-label { color: var(--paper); }
.high-contrast .menu .menu-primary { color: #000; }
.high-contrast .home-art { opacity: .2; }
.reduced-motion *, .reduced-motion *::before, .reduced-motion *::after { transition:none !important; animation:none !important; }
.qa-map { position: fixed; right: 1rem; top: 1rem; width: min(44vw,440px); height: auto; z-index: 20; border: 2px solid #fff; pointer-events: none; background: #000; }
.qa-map[hidden] { display: none; }

@media (min-width: 1800px) { main { padding-left: 100px; padding-right: 100px; } .home-layout { min-height: 560px; } .home-copy { padding-top: 50px; } .home-footer { margin-top: 45px; } }
@media (max-width: 1050px) {
  main { padding: 34px 5.5vw 26px; }
  .home-layout { gap: 3%; grid-template-columns: 1.15fr .85fr; }
  .tagline { font-size: clamp(2.35rem,4.3vw,3.4rem); }
  .home-copy .menu { gap: 2px 18px; }
  .home-art::before { inset: 10% -1% 13% 5%; }
  .play-bottom { grid-template-columns:1fr; gap:18px; justify-items:start; }
  .journey { padding-top: 65px; }
  .pause-layout { gap: 40px; }
}
@media (max-width: 720px) {
  body::before { background: linear-gradient(90deg,rgba(10,9,8,.94),rgba(10,9,8,.58)); }
  main { padding: 27px 6vw 22px; }
  .brand { margin-bottom: 4px; }
  .brand h1, header h1 { font-size: clamp(4.3rem,17vw,7.5rem); margin-top: 19px; letter-spacing: .12em; }
  .home-copy .brand h1 { font-size:17vw; }
  .brand > .eyebrow { font-size: .57rem; letter-spacing: .13em; }
  .folio { position: static; display: block; font-size: .52rem; letter-spacing: .13em; margin-top: 6px; margin-left: 17px; }
  .rule { margin-top: 20px; }
  .home-layout { grid-template-columns: 1fr; min-height: 0; }
  .home-copy { padding-top: 26px; }
  .tagline { font-size: clamp(2.5rem,8vw,3.5rem); max-width: 490px; }
  .intro { max-width: 440px; font-size: .82rem; margin-bottom: 24px; }
  .home-copy .kicker { margin-bottom: 16px; }
  .home-copy .menu { width: 100%; max-width: 540px; gap: 2px 23px; }
  .home-copy .menu button { font-size: .78rem; min-height: 47px; }
  .home-art { display: none; }
  .home-footer { margin-top: 30px; padding-top: 18px; gap: 10px; }
  .home-footer p { font-size: .59rem; }
  .screen-shell header { margin-bottom: 32px; }
  body:not([data-screen="home"]) header h1 { font-size: 3.2rem; }
  h2 { font-size: 2.5rem; }
  .settings, .bindings { grid-template-columns: 1fr; }
  .setup-steps { grid-template-columns:1fr; }
  .result-stats { gap:24px; }
  .settings label { padding: 18px 20px; min-height: 100px; }
  .settings label:has(input[type="checkbox"]) { min-height: 80px; }
  .play { min-height: calc(100svh - 49px); }
  .play-top { padding-bottom: 19px; align-items: flex-start; gap: 12px; }
  .brand-small { font-size: 1.2rem; }
  .session-label { font-size: .54rem; max-width: 200px; text-align: right; }
  .mission-panel { padding-top: 33px; }
  .mission-panel h2 { font-size: clamp(2.5rem,7.5vw,3.6rem); }
  .journey { padding-top: 55px; flex-wrap: wrap; gap: 24px 0; }
  .journey-step { width: 50%; padding-top: 14px; font-size: .64rem; }
  .play-bottom { padding-top: 26px; padding-bottom: 115px; }
  .play .controls { font-size: .67rem; line-height: 1.85; }
  .pause-layout { grid-template-columns: 1fr; gap: 30px; }
  .pause-summary { padding-left: 22px; }
  #caption { width: 92%; bottom: max(12px,env(safe-area-inset-bottom)); padding: 10px 14px; max-height: 40svh; overflow-y: auto; }
  .qa-map { width: 45vw; top: auto; bottom: 7rem; }
}
@media (max-width: 390px) {
  .home-copy .menu { grid-template-columns: 1fr; }
  .home-copy .menu .menu-primary { grid-column: auto; }
  .home-copy .menu button { font-size: .8rem; }
  .brand h1 { font-size: 17vw; }
  .play-actions { width: 100%; }
  .play-actions button { flex: 1; padding-left: 10px; padding-right: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
