: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);
  transition: transform 3200ms var(--easing-quiet);
}
#massive-text[data-state="on"] .mt-inner { transform: translateY(0); }

#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);
}

/* 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;
  }
}
