:root {
  --ink:        #0A0806;
  --ink-deep:   #050302;
  --cream:      #F2E8D9;
  --amber:      #E8A44A;
  --amber-deep: #C4853C;
  --rust:       #C4563A;
  --indigo:     #2A2745;
  --moss:       #6E7E5E;

  --serif: 'Playfair Display', Georgia, serif;
  --mono:  'DM Mono', 'Courier New', monospace;
  --sans:  'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  --easing-quiet:  cubic-bezier(0.22, 1, 0.36, 1);
  --easing-breath: cubic-bezier(0.45, 0, 0.55, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--ink-deep);
  color: var(--cream);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#world {
  position: fixed; inset: 0;
  opacity: 0;
  transition: opacity 2.4s var(--easing-quiet);
}
#world[data-ready="true"] { opacity: 1; }

#stage { display: block; width: 100%; height: 100%; }

#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }

#crosshair {
  position: absolute; top: 50%; left: 50%;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: rgba(232, 164, 74, 0.32);
  transform: translate(-50%, -50%);
  transition: width 0.25s var(--easing-quiet),
              height 0.25s var(--easing-quiet),
              background 0.25s var(--easing-quiet),
              box-shadow 0.25s var(--easing-quiet);
}
#crosshair[data-hover="true"] {
  width: 22px; height: 22px;
  background: rgba(232, 164, 74, 0.10);
  box-shadow: 0 0 0 1.5px rgba(232, 164, 74, 0.6),
              0 0 24px rgba(232, 164, 74, 0.25);
}

#hover-label {
  position: absolute; bottom: 5rem; left: 0; right: 0;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.62rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--cream);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.85);
  opacity: 0;
  transition: opacity 0.3s var(--easing-quiet);
}
#hover-label[data-show="true"] { opacity: 1; }

/* Thread narrator — second voice of the show.
   On phone/web, large italic text top-third.
   On dome, this same element will be projected via world-space mesh. */
#thread-narrator {
  position: fixed; left: 50%; top: 14vh;
  transform: translateX(-50%);
  width: min(80vw, 760px);
  text-align: center;
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: clamp(1.2rem, 3.4vw, 2.4rem);
  color: var(--cream);
  letter-spacing: 0.005em; line-height: 1.35;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.85);
  opacity: 0;
  pointer-events: none;
  z-index: 12;
  transition: opacity 1.6s var(--easing-quiet);
}
#thread-narrator[data-show="true"] { opacity: 1; }

#thread-narrator .t-quote {
  display: block;
  font-style: italic;
  text-wrap: balance;
}
#thread-narrator .t-source {
  display: block;
  margin-top: 1.1rem;
  font-family: var(--mono);
  font-style: normal;
  font-size: 0.5rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(232, 164, 74, 0.72);
}

dialog#media {
  position: fixed; inset: 0;
  width: 100vw; max-width: 100vw;
  height: 100vh; max-height: 100vh;
  margin: 0; padding: 0;
  border: none;
  background: rgba(5, 3, 2, 0.97);
  color: var(--cream);
  display: none;
  z-index: 60;
}
dialog#media[open] { display: flex; flex-direction: column; }
dialog#media::backdrop { background: rgba(0, 0, 0, 0.94); }

dialog#media header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid rgba(232, 164, 74, 0.10);
}
#media-eyebrow {
  font-family: var(--mono);
  font-size: 0.52rem; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--amber);
}
#media-close {
  background: transparent;
  border: 1px solid rgba(242, 232, 217, 0.25);
  color: rgba(242, 232, 217, 0.85);
  font-family: var(--mono);
  font-size: 0.5rem; letter-spacing: 0.2em; text-transform: uppercase;
  padding: 0.45rem 0.9rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
#media-close:hover { border-color: var(--amber); color: var(--amber); }

#media-video {
  flex: 1;
  width: 100%; min-height: 0;
  background: #000;
  object-fit: contain;
}
#media-desc {
  padding: 1rem 1.5rem 1.5rem;
  max-width: 720px; margin: 0 auto;
  font-size: 0.95rem; line-height: 1.75;
  color: rgba(242, 232, 217, 0.85);
}

/* ── ARTIST MODAL ─────────────────────────────────────────────
   Full-bleed cinematic. The art-honor moment for a featured musician
   looking at their own page on a desktop. */
dialog#artist {
  position: fixed; inset: 0;
  width: 100vw; max-width: 100vw;
  height: 100vh; max-height: 100vh;
  margin: 0; padding: 0;
  border: none;
  background: #000;
  color: var(--cream);
  display: none;
  z-index: 70;
  overflow: hidden;
}
dialog#artist[open] { display: block; }
dialog#artist::backdrop { background: #000; }

.artist-bleed {
  position: relative;
  width: 100%; height: 100%;
  overflow: hidden;
}
#artist-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  background: #000;
}
.artist-scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(to bottom,
      rgba(0,0,0,0.78) 0%,
      rgba(0,0,0,0.05) 22%,
      rgba(0,0,0,0.05) 58%,
      rgba(0,0,0,0.92) 100%);
  pointer-events: none;
}

.artist-live-tag {
  position: absolute; top: 1.6rem; left: 2rem;
  font-family: var(--mono);
  font-size: 0.46rem; letter-spacing: 0.32em; text-transform: uppercase;
  color: #fff; background: rgba(196, 86, 58, 0.92);
  padding: 0.32rem 0.78rem 0.3rem;
  border-radius: 2px;
  display: none;
  animation: artist-live-pulse 2.4s ease-in-out infinite;
}
.artist-live-tag[data-live="true"] { display: inline-block; }
@keyframes artist-live-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.6; } }

.artist-overlay {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 2.6rem 2.8rem 2.4rem;
  pointer-events: none;
  z-index: 2;
}
.artist-overlay > * { pointer-events: auto; }
.artist-venue {
  font-family: var(--mono);
  font-size: 0.5rem; letter-spacing: 0.34em; text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 0.7rem;
  opacity: 0.92;
}
.artist-name {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: clamp(2.2rem, 6vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: #fff;
  text-shadow: 0 2px 40px rgba(0,0,0,0.85);
  margin-bottom: 0.6rem;
}
.artist-role {
  font-family: var(--sans);
  font-size: clamp(0.78rem, 1.6vw, 0.95rem);
  color: rgba(255,255,255,0.78);
  letter-spacing: 0.05em;
  margin-bottom: 1.4rem;
}
.artist-actions {
  display: flex; gap: 0.7rem; flex-wrap: wrap;
}
.artist-bio-toggle, .artist-live-toggle, .artist-bio-close, .artist-close {
  font-family: var(--mono);
  font-size: 0.46rem; letter-spacing: 0.24em; text-transform: uppercase;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.22);
  color: rgba(255,255,255,0.78);
  padding: 0.45rem 0.9rem;
  border-radius: 2px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.artist-bio-toggle:hover, .artist-live-toggle:hover, .artist-bio-close:hover, .artist-close:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.55);
  background: rgba(0,0,0,0.7);
}
.artist-live-toggle[data-on="true"] {
  background: rgba(196, 86, 58, 0.85);
  border-color: rgba(196, 86, 58, 1);
  color: #fff;
}

.artist-close {
  position: absolute; top: 1.4rem; right: 1.6rem;
  z-index: 3;
}

.artist-bio {
  position: absolute; left: 0; right: 0; bottom: 0;
  z-index: 4;
  padding: 3rem 2.8rem 2.4rem;
  background: linear-gradient(to top, rgba(0,0,0,0.97) 0%, rgba(0,0,0,0.9) 75%, rgba(0,0,0,0) 100%);
  transform: translateY(100%);
  transition: transform 0.6s var(--easing-quiet);
  pointer-events: none;
}
.artist-bio[data-open="true"] {
  transform: translateY(0);
  pointer-events: auto;
}
.artist-bio-close {
  position: absolute; top: 1.2rem; right: 1.6rem;
}
.artist-bio-eyebrow {
  font-family: var(--mono);
  font-size: 0.44rem; letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 0.7rem; opacity: 0.85;
}
.artist-bio-text {
  font-family: var(--sans);
  font-size: clamp(0.85rem, 1.6vw, 1rem);
  line-height: 1.75;
  color: rgba(255,255,255,0.88);
  max-width: 640px;
}

/* ── VEIL: ceremonial fade-to-black overlay. ────────────────── */
#veil {
  position: fixed; inset: 0;
  z-index: 80;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1500ms var(--easing-quiet);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 2rem;
}
#veil[data-show="true"] { opacity: 1; pointer-events: auto; }
.veil-line {
  font-family: var(--serif);
  font-style: italic; font-weight: 400;
  font-size: clamp(2rem, 5.4vw, 3.6rem);
  color: var(--cream);
  letter-spacing: -0.005em;
  line-height: 1.2;
  text-shadow: 0 2px 30px rgba(0,0,0,0.85);
}
.veil-sub {
  margin-top: 1rem;
  font-family: var(--mono);
  font-size: 0.6rem; letter-spacing: 0.34em; text-transform: uppercase;
  color: var(--amber);
}

/* ── PORTAL HINT ─────────────────────────────────────────────── */
#portal-hint {
  position: fixed; left: 50%; bottom: 8rem;
  transform: translateX(-50%);
  z-index: 12;
  display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s var(--easing-quiet);
  text-shadow: 0 2px 20px rgba(0,0,0,0.9);
}
#portal-hint[data-show="true"] { opacity: 1; }
#portal-hint .ph-line {
  font-family: var(--mono);
  font-size: 0.62rem; letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--amber);
}
#portal-hint .ph-sub {
  font-family: var(--mono);
  font-size: 0.48rem; letter-spacing: 0.24em; text-transform: uppercase;
  color: rgba(242, 232, 217, 0.6);
}

/* ── MASSIVE TEXT ────────────────────────────────────────────
   The keystone lines of the journey arrive here, not in the narrator.
   Center frame, oversized, scrim behind for legibility over any world.
   Emphasis variants tune the typography to the moment. */
#massive-text {
  position: fixed; inset: 0;
  z-index: 40;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 2600ms var(--easing-quiet);
  /* Radial scrim for legibility — only visible when text is on. */
  background: radial-gradient(
    ellipse 80% 55% at 50% 50%,
    rgba(0, 0, 0, 0.68) 0%,
    rgba(0, 0, 0, 0.35) 50%,
    rgba(0, 0, 0, 0) 100%
  );
}
#massive-text[data-state="on"] { opacity: 1; }
#massive-text .mt-inner {
  max-width: min(88vw, 1100px);
  text-align: center;
  padding: 2rem;
  transform: translateY(18px) scale(0.96);
  transition: transform 3200ms var(--easing-quiet);
}
#massive-text[data-state="on"] .mt-inner { transform: translateY(0) scale(1); }

#massive-text .mt-text {
  display: block;
  font-family: var(--serif);
  font-style: italic; font-weight: 400;
  font-size: clamp(1.6rem, 5.8vw, 5.2rem);
  line-height: 1.15;
  letter-spacing: -0.012em;
  color: var(--cream);
  text-shadow: 0 4px 48px rgba(0, 0, 0, 0.92), 0 1px 2px rgba(0, 0, 0, 0.7);
}
#massive-text .mt-attr {
  display: block;
  margin-top: 1.4rem;
  font-family: var(--mono); font-style: normal; font-weight: 300;
  font-size: clamp(0.52rem, 0.95vw, 0.72rem);
  letter-spacing: 0.36em; text-transform: uppercase;
  color: var(--amber);
  opacity: 0.88;
}
#massive-text .mt-attr:empty { display: none; }

/* Emphasis variants — distinct typographic registers per moment. */
#massive-text[data-emphasis="question"] .mt-text {
  font-style: normal; font-weight: 400;
  font-family: var(--serif);
  color: rgba(242, 232, 217, 0.94);
}
#massive-text[data-emphasis="keystone"] .mt-text {
  font-size: clamp(1.9rem, 6.8vw, 6rem);
  text-shadow: 0 6px 60px rgba(0, 0, 0, 0.95), 0 2px 4px rgba(0, 0, 0, 0.7),
               0 0 80px rgba(232, 164, 74, 0.12);
}
#massive-text[data-emphasis="stamp"] .mt-text {
  font-family: var(--mono); font-style: normal; font-weight: 400;
  font-size: clamp(1rem, 2.4vw, 1.8rem);
  letter-spacing: 0.12em; text-transform: uppercase;
}
#massive-text[data-emphasis="close"] .mt-text {
  font-size: clamp(1.4rem, 4.6vw, 3.8rem);
  color: rgba(242, 232, 217, 0.85);
}

/* ── FORMAT TOGGLE ───────────────────────────────────────────
   Tiny corner link, top-left, to switch between shell formats.
   Subtle; expands the "other format" label on hover. */
#format-toggle {
  position: fixed; top: 1rem; left: 1.2rem;
  z-index: 200;
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.85rem;
  background: rgba(8, 6, 4, 0.7);
  border: 1px solid rgba(232, 164, 74, 0.25);
  border-radius: 2px;
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.5rem; letter-spacing: 0.28em; text-transform: uppercase;
  color: rgba(216, 207, 193, 0.55);
  backdrop-filter: blur(8px);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
#format-toggle:hover {
  border-color: rgba(232, 164, 74, 0.7);
  background: rgba(8, 6, 4, 0.9);
  color: var(--cream);
}
#format-toggle .ft-arrow { color: rgba(216, 207, 193, 0.4); font-size: 0.6rem; letter-spacing: 0; }
#format-toggle .ft-here  {
  /* Where you ARE — bright amber, no fade. */
  color: var(--amber);
  font-weight: 400;
}
#format-toggle .ft-other {
  /* Where you can GO — dim, hover to brighten. */
  opacity: 0.5;
  color: rgba(216, 207, 193, 0.7);
}
#format-toggle:hover .ft-other { opacity: 1; color: var(--cream); }

/* ── 360 WEB CONCERT HUD ───────────────────────────────────────
   Mirrors the Deep Space operator HUD. Visible only when ?show=concert is on
   and the cold open has released. Auto-hides after 4s idle; shows on mouse move. */
#op-hud-360 {
  position: fixed; top: 1.2rem; right: 1.6rem;
  z-index: 30;
  display: flex; flex-direction: column; gap: 0.4rem;
  align-items: flex-end;
  pointer-events: none;
  font-family: var(--mono); font-size: 0.52rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: rgba(216, 207, 193, 0.55);
  opacity: 0;
  transition: opacity 0.8s ease;
}
#op-hud-360[data-active="true"] { opacity: 1; }
html[data-chrome-idle="true"] #op-hud-360,
html[data-chrome-idle="true"] #format-toggle,
html[data-chrome-idle="true"] #act-strip-360 {
  opacity: 0.05;
  pointer-events: none;
}
#op-hud-360 .op-keys,
#op-hud-360 .op-build {
  /* Default these to extra-dim — only useful for diagnostics. */
  opacity: 0.4;
}
#op-hud-360:hover .op-keys,
#op-hud-360:hover .op-build {
  opacity: 0.85;
}
#op-hud-360 .op-tag {
  background: rgba(10, 8, 6, 0.75);
  border: 1px solid rgba(232, 164, 74, 0.3);
  padding: 0.4rem 0.7rem;
  backdrop-filter: blur(8px);
}
#op-hud-360 .op-full {
  font-family: var(--mono);
  font-size: 0.52rem; letter-spacing: 0.22em; text-transform: uppercase;
  background: rgba(232, 164, 74, 0.12);
  border: 1px solid rgba(232, 164, 74, 0.55);
  color: var(--amber);
  cursor: pointer;
  pointer-events: auto;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
  white-space: nowrap;
}
#op-hud-360 .op-full:hover {
  background: rgba(232, 164, 74, 0.22);
  border-color: var(--amber);
  color: var(--cream);
}

/* Full Experience exit pill for 360 web. */
#exit-full-360 {
  position: fixed; top: 1rem; right: 1rem;
  z-index: 1000;
  font-family: var(--mono);
  font-size: 0.46rem; letter-spacing: 0.24em; text-transform: uppercase;
  background: rgba(8, 6, 4, 0.5);
  border: 1px solid rgba(232, 164, 74, 0.25);
  color: rgba(216, 207, 193, 0.55);
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  display: none;
  opacity: 0.25;
  transition: opacity 0.3s, color 0.2s, border-color 0.2s, background 0.2s;
}
html[data-fullscreen="true"] #exit-full-360 { display: block; }
#exit-full-360:hover {
  opacity: 1; color: var(--cream); border-color: var(--amber); background: rgba(8, 6, 4, 0.85);
}

/* ── 360 ACT STRIP ARROWS ─── */
#act-strip-360 .as-controls {
  display: flex; align-items: stretch; gap: 0.4rem;
  margin-bottom: 0.5rem;
}
#act-strip-360 .strip-arrow {
  flex: 0 0 auto;
  width: 36px;
  font-family: var(--mono);
  font-size: 1.2rem; line-height: 1;
  background: rgba(20, 16, 12, 0.55);
  border: 1px solid rgba(232, 164, 74, 0.18);
  color: rgba(232, 164, 74, 0.55);
  cursor: pointer;
  pointer-events: auto;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  user-select: none;
}
#act-strip-360 .strip-arrow:hover {
  background: rgba(232, 164, 74, 0.18);
  border-color: rgba(232, 164, 74, 0.65);
  color: var(--amber);
}
#act-strip-360 .strip-arrow:disabled { opacity: 0.25; cursor: default; }
#act-strip-360 .as-row { flex: 1 1 auto; }

/* Hide scrollbar visually but keep scroll functionality. */
body::-webkit-scrollbar { width: 0; height: 0; }
body { scrollbar-width: none; -ms-overflow-style: none; }

#act-strip-360 {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: 110px;
  z-index: 12;
  background: rgba(8, 6, 4, 0.96);
  border-top: 1px solid rgba(232, 164, 74, 0.25);
  padding: 0.7rem 1.2rem 0.4rem;
  pointer-events: none;
  opacity: 0;
  transform: translateY(110px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
#act-strip-360[data-active="true"] {
  opacity: 1;
  transform: translateY(0);
}
#act-strip-360 .as-row {
  display: flex; gap: 0.5rem;
  margin-bottom: 0.5rem;
  pointer-events: auto;
  overflow-x: auto;
  scrollbar-width: thin;
  scroll-behavior: smooth;
  scrollbar-color: rgba(232, 164, 74, 0.3) transparent;
}
#act-strip-360 .as-act {
  flex: 0 0 22%;     /* ~4-5 visible at once on narrow viewports; scroll to reach others */
  min-width: 110px;
}
#act-strip-360 .as-act {
  flex: 1;
  padding: 0.45rem 0.7rem;
  font-family: var(--mono);
  font-size: 0.5rem; letter-spacing: 0.18em; text-transform: uppercase;
  text-align: center;
  background: rgba(20, 16, 12, 0.55);
  border: 1px solid rgba(232, 164, 74, 0.18);
  color: rgba(216, 207, 193, 0.55);
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
  user-select: none;
}
#act-strip-360 .as-act:hover {
  background: rgba(232, 164, 74, 0.10);
  border-color: rgba(232, 164, 74, 0.45);
  color: var(--cream);
}
#act-strip-360 .as-act[data-active="true"] {
  background: rgba(232, 164, 74, 0.18);
  border-color: rgba(232, 164, 74, 0.75);
  color: var(--amber);
}
#act-strip-360 .as-act .as-num {
  display: block;
  color: rgba(216, 207, 193, 0.4);
  font-size: 0.42rem;
  margin-bottom: 0.2rem;
}
#act-strip-360 .as-act[data-active="true"] .as-num { color: var(--amber); }
#act-strip-360 .as-progress {
  height: 2px;
  background: rgba(232, 164, 74, 0.12);
  overflow: hidden;
}
#act-strip-360 .as-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, rgba(232, 164, 74, 0.6) 0%, var(--amber) 100%);
  box-shadow: 0 0 8px rgba(232, 164, 74, 0.5);
  transition: width 0.2s linear;
}

html[data-hud="off"] #op-hud-360,
html[data-hud="off"] #act-strip-360 { display: none; }

/* Mode-specific overrides — applied via [data-mode] on <html>.
   Phone/web get the HUD. Dome and XR hide the chrome (operator/headset drives). */
html[data-mode="dome"] #hud,
html[data-mode="dome"] #crosshair,
html[data-mode="xr"]   #hud {
  display: none;
}

/* Reduced-motion respect. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01s !important;
    transition-duration: 0.01s !important;
  }
}
