/* ============================================================
   EREBUS - obsidian dream space
   Tune the whole mood from these tokens.
   ============================================================ */
:root {
  --bg: #030307;
  --ink: #eceaf6;
  --dim: #8a86a3;
  --ghost: #4a4763;
  --violet: #8b7bff;
  --cyan: #7de8ff;
  --panel-w: min(560px, 86vw);
  --font-body: "Space Grotesk", system-ui, -apple-system, sans-serif;
  --font-display: "Instrument Serif", Georgia, serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: auto; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--violet); color: #06060c; }

a { color: inherit; }

/* ---------- canvas ---------- */
#erebus {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  z-index: 0;
}

/* ---------- skip link ---------- */
.skip {
  position: fixed;
  top: -100px;
  left: 1rem;
  z-index: 100;
  background: var(--ink);
  color: var(--bg);
  padding: 0.5rem 1rem;
  font-size: 13px;
  text-decoration: none;
  transition: top 0.2s;
}
.skip:focus { top: 1rem; }

/* ---------- loader ---------- */
#loader {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--bg);
  display: grid;
  place-items: center;
  transition: opacity 1.2s var(--ease), visibility 1.2s;
}
.loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}
.loader-label {
  font-size: 11px;
  letter-spacing: 0.45em;
  text-transform: uppercase;
  color: var(--dim);
  animation: pulse 2.2s ease-in-out infinite;
}
.loader-count {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(3rem, 8vw, 5.5rem);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
@keyframes pulse { 50% { opacity: 0.35; } }

body.world-ready #loader { opacity: 0; visibility: hidden; pointer-events: none; }

/* ---------- HUD ---------- */
.hud, .hud-bottom {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  padding: 22px 28px;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--dim);
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.4s var(--ease) 0.6s;
}
body.world-ready .hud, body.world-ready .hud-bottom { opacity: 1; }

.hud { top: 0; justify-content: space-between; }
.hud-left, .hud-right { display: flex; align-items: baseline; gap: 1.1rem; }
.hud-mono {
  color: var(--ink);
  font-weight: 500;
  border: 1px solid var(--ghost);
  padding: 0.35em 0.55em;
  letter-spacing: 0.12em;
}
#hud-sector { color: var(--violet); }

.hud-bottom { bottom: 0; gap: 1.25rem; }
#hud-index { color: var(--ink); font-variant-numeric: tabular-nums; }
.progress {
  width: 140px;
  height: 1px;
  background: rgba(138, 134, 163, 0.25);
  overflow: hidden;
}
#progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--violet), var(--cyan));
  transition: width 0.15s linear;
}
.hud-hint { margin-left: auto; animation: pulse 3s ease-in-out infinite; }

/* ---------- content panels ---------- */
.panel {
  position: fixed;
  z-index: 10;
  left: 7vw;
  top: 50%;
  width: var(--panel-w);
  transform: translateY(calc(-50% + 28px));
  opacity: 0;
  visibility: hidden;
  filter: blur(6px);
  transition:
    opacity 0.9s var(--ease),
    transform 0.9s var(--ease),
    filter 0.9s var(--ease),
    visibility 0.9s;
  pointer-events: none;
}
.panel.is-active {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%);
  filter: blur(0);
  pointer-events: auto;
}

.panel { --accent: var(--cyan); }

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--accent, var(--cyan));
  margin-bottom: 1.2rem;
}

h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.3rem, 5.4vw, 4.4rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin-bottom: 1.4rem;
}
h1 em, h2 em { font-style: italic; }

.lede { color: var(--dim); max-width: 42ch; }

.p-num {
  display: block;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(4rem, 10vw, 7rem);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px var(--ghost);
  margin-bottom: 0.6rem;
  user-select: none;
}

h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 4.6vw, 3.6rem);
  line-height: 1.1;
  margin-bottom: 0.8rem;
}

.p-tags {
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent, var(--violet));
  margin-bottom: 1.1rem;
}

/* room-title panels read a touch bigger and airier */
.panel.room-title h2 { font-size: clamp(2.6rem, 5.4vw, 4.2rem); font-style: italic; }

.p-desc { color: var(--dim); max-width: 46ch; margin-bottom: 1.6rem; }

.p-link {
  display: inline-block;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 1px solid var(--ghost);
  padding-bottom: 0.35em;
  transition: color 0.3s, border-color 0.3s;
}
.p-link::after { content: "  \2192"; white-space: pre; } /* escaped, so no upload can mangle it again */
.p-link:hover, .p-link:focus-visible { color: var(--cyan); border-color: var(--cyan); }
.p-link:focus-visible { outline: 1px dashed var(--cyan); outline-offset: 6px; }

.contact-link { font-size: 15px; text-transform: none; letter-spacing: 0.05em; }

/* ---------- dive rooms (immersive 360 degrees) ---------- */
body.immersive {
  overflow: hidden;
  touch-action: none;
  overscroll-behavior: none;
}
body.immersive #void, body.immersive #erebus { cursor: grab; }
body.immersive:active #erebus { cursor: grabbing; }
body.immersive #hud-index,
body.immersive .hud-hint,
body.immersive .progress { display: none; }

#hud-exit {
  position: fixed;
  right: 26px;
  bottom: 22px;
  z-index: 25;
  display: none;
  background: none;
  border: 1px solid var(--ghost);
  border-radius: 99px;
  color: var(--dim);
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  padding: 0.7em 1.4em;
  cursor: pointer;
  transition: color 0.3s, border-color 0.3s, opacity 1.2s var(--ease);
}
#hud-exit:hover { color: var(--ink); border-color: var(--dim); }
body.immersive #hud-exit { display: block; }

/* dive-room title: appears, then dissolves - the room speaks visually */
.panel.ephemeral { transition: opacity 2.4s var(--ease), filter 2.4s var(--ease), visibility 2.4s; }
.panel.ephemeral.gone { opacity: 0; visibility: hidden; filter: blur(8px); pointer-events: none; }

/* ---------- cinematic vignette ---------- */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: radial-gradient(ellipse 120% 90% at 50% 48%, transparent 55%, rgba(1, 1, 4, 0.55) 100%);
}

/* ---------- world-jump fade (portal transitions) ---------- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 45;
  pointer-events: none;
  background: #010103;
  opacity: 0;
  transition: opacity 0.6s var(--ease);
}
body.world-jump::before { opacity: 1; }

/* ---------- easter-egg veil ---------- */
#egg-veil {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: rgba(2, 2, 6, 0.88);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s var(--ease), visibility 0.6s;
}
body.egg-open #egg-veil { opacity: 1; visibility: visible; }
.egg-card {
  max-width: min(520px, 84vw);
  text-align: center;
  padding: 2rem;
}
.egg-card .p-desc { margin-left: auto; margin-right: auto; }
.egg-close { background: none; border: none; border-bottom: 1px solid var(--ghost); cursor: pointer; font-family: var(--font-body); }

/* ---------- scroll runway ---------- */
#scroll-space { position: relative; z-index: -1; width: 1px; }

/* ---------- no-WebGL fallback ---------- */
body.no-webgl #erebus, body.no-webgl #loader { display: none; }
body.no-webgl {
  background:
    radial-gradient(ellipse 80% 60% at 70% 110%, #14102b 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 20% -10%, #0a1420 0%, transparent 60%),
    var(--bg);
}
body.no-webgl .panel {
  position: static;
  opacity: 1;
  visibility: visible;
  transform: none;
  filter: none;
  pointer-events: auto;
  margin: 18vh 7vw;
}
body.no-webgl .hud, body.no-webgl .hud-bottom { opacity: 1; }
body.no-webgl #scroll-space { display: none; }

/* ---------- the screening room: flat fullscreen cinema ---------- */
#cinema {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: #000;
  display: none;
  opacity: 0;
  transition: opacity 0.9s ease;
}
body.cinema-open #cinema { display: block; }
#cinema.on { opacity: 1; }
#cinema video {
  width: 100%;
  height: 100%;
  object-fit: cover; /* full-bleed takeover - the film IS the page */
  display: block;
  background: #000;
}
.cin-head {
  position: absolute;
  top: 26px;
  left: 30px;
  pointer-events: none;
  transition: opacity 1.2s ease;
}
.cin-eyebrow {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 10px;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: #8b88a3;
  margin-bottom: 8px;
}
.cin-title {
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  font-size: clamp(22px, 3vw, 34px);
  letter-spacing: 0.03em;
  color: #e6e4f2;
}
.cin-ui {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 24px;
  display: flex;
  justify-content: space-between;
  padding: 0 28px;
  transition: opacity 1.2s ease;
}
.cin-ui button {
  background: rgba(2, 2, 7, 0.4);
  border: 1px solid rgba(230, 228, 242, 0.22);
  color: #e6e4f2;
  font: 10px/1 'Space Grotesk', system-ui, sans-serif;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  padding: 11px 15px;
  cursor: pointer;
  transition: border-color 0.4s ease, opacity 0.4s ease;
}
.cin-ui button:hover { border-color: rgba(230, 228, 242, 0.6); }
#cinema.ui-idle .cin-ui, #cinema.ui-idle .cin-head { opacity: 0; }
body.cinema-open .hud, body.cinema-open .hud-bottom, body.cinema-open #hud-exit { opacity: 0; pointer-events: none; }

/* ---------- the listening room: wood-dark spotify deck ---------- */
#listen {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: none;
  place-content: center;
  background: rgba(4, 2, 4, 0.82);
  opacity: 0;
  transition: opacity 0.7s ease;
}
body.listen-open #listen { display: grid; }
#listen.on { opacity: 1; }
.lst-panel {
  width: min(92vw, 560px);
  background: linear-gradient(160deg, #17100a 0%, #0d0806 55%, #120a12 100%);
  border: 1px solid rgba(234, 162, 94, 0.35);
  box-shadow: 0 0 80px rgba(234, 162, 94, 0.12), inset 0 1px 0 rgba(234, 162, 94, 0.2);
  padding: 26px 26px 20px;
}
.lst-eyebrow {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 10px;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: #c98d5a;
  margin-bottom: 8px;
}
.lst-title {
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  font-size: clamp(22px, 3vw, 30px);
  color: #f0e2d0;
  margin-bottom: 18px;
}
.lst-panel iframe {
  width: 100%;
  height: 420px;
  border: 0;
  border-radius: 12px;
  display: block;
  background: #0d0806;
}
.lst-exit {
  margin-top: 16px;
  background: rgba(4, 2, 4, 0.5);
  border: 1px solid rgba(234, 162, 94, 0.35);
  color: #f0e2d0;
  font: 10px/1 'Space Grotesk', system-ui, sans-serif;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  padding: 11px 15px;
  cursor: pointer;
  transition: border-color 0.4s ease;
}
.lst-exit:hover { border-color: rgba(234, 162, 94, 0.8); }
@media (max-width: 720px) { .lst-panel iframe { height: 352px; } }

/* ---------- entry film: the first link ---------- */
#entry {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: #000;
  transition: opacity 1.5s ease;
}
#entry.gone { opacity: 0; pointer-events: none; }
#entry video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.entry-ui {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 26px;
  display: flex;
  justify-content: space-between;
  padding: 0 26px;
}
.entry-ui button {
  background: rgba(2, 2, 7, 0.35);
  border: 1px solid rgba(230, 228, 242, 0.25);
  color: #e6e4f2;
  font: 10px/1 'Space Grotesk', system-ui, sans-serif;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  padding: 11px 15px;
  cursor: pointer;
  transition: border-color 0.4s ease;
}
.entry-ui button:hover { border-color: rgba(230, 228, 242, 0.65); }
body.entry-active { overflow: hidden; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .panel { transition-duration: 0.01s; }
  .loader-label, .hud-hint { animation: none; }
}

/* ---------- mobile ---------- */
@media (max-width: 720px) {
  .hud, .hud-bottom { padding: 16px 18px; }
  .hud-sub, .hud-hint { display: none; }
  .panel {
    left: 6vw;
    top: auto;
    bottom: 12vh;
    transform: translateY(28px);
  }
  .panel.is-active { transform: translateY(0); }
  .progress { width: 90px; }
}

/* the temple asks for silence at the top */
body.hud-off .hud { display: none; }
.lst-embed { min-height: 420px; }
.lst-embed iframe { width: 100%; height: 420px; border: 0; border-radius: 12px; display: block; background: #0d0806; }
@media (max-width: 720px) { .lst-embed { min-height: 352px; } .lst-embed iframe { height: 352px; } }

/* no badge, no banner - the world is the interface */
.hud { display: none !important; }


/* ---------- v14 - the clickable law: orb in ring, breathing ---------- */
@keyframes orbPulse {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.22); opacity: 1; }
}
@keyframes btnBreath {
  0%, 100% { box-shadow: 0 0 0 rgba(234, 162, 94, 0); }
  50% { box-shadow: 0 0 16px rgba(234, 162, 94, 0.3); }
}
.p-link { position: relative; padding-left: 24px; }
.p-link::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.42em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0), 0 0 0 4px currentColor, 0 0 14px currentColor;
  animation: orbPulse 2.8s ease-in-out infinite;
}
#hud-exit, .lst-exit, .cin-exit, .cin-mute { animation: btnBreath 3.6s ease-in-out infinite; border-radius: 999px; }

/* the listening deck melts into the temple */
#listen { background: rgba(3, 2, 2, 0.9); backdrop-filter: blur(16px) saturate(0.85); -webkit-backdrop-filter: blur(16px) saturate(0.85); }
.lst-panel {
  border: 0;
  border-radius: 20px;
  background: radial-gradient(130% 150% at 50% 0%, rgba(30, 16, 6, 0.92) 0%, rgba(11, 6, 4, 0.97) 55%, rgba(8, 4, 3, 0.99) 100%);
  box-shadow: 0 0 130px rgba(234, 162, 94, 0.10), 0 30px 90px rgba(0, 0, 0, 0.65);
  position: relative;
}
.lst-panel::before {
  content: "";
  position: absolute;
  inset: -90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(234, 162, 94, 0.13) 0%, rgba(234, 162, 94, 0.04) 42%, transparent 70%);
  z-index: -1;
  pointer-events: none;
  animation: orbHalo 6s ease-in-out infinite;
}
@keyframes orbHalo {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}
.lst-embed { position: relative; }
.lst-panel iframe { border-radius: 16px; box-shadow: 0 0 46px rgba(234, 162, 94, 0.10); }
.lst-embed::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  pointer-events: none;
  box-shadow: inset 0 0 44px 10px rgba(8, 4, 3, 0.5);
}
@media (prefers-reduced-motion: reduce) {
  .p-link::before, #hud-exit, .lst-exit, .cin-exit, .cin-mute, .lst-panel::before { animation: none; }
}

/* v15.1 - the deck docks: records spin over the room, not over a menu */
#listen { pointer-events: none; background: none; }
body.listen-open #listen { display: block; }
.lst-panel {
  pointer-events: auto;
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
  width: min(560px, 94vw); margin: 0; padding: 12px 14px 12px;
  background: linear-gradient(160deg, rgba(23,16,10,.82), rgba(13,8,6,.88));
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(234,162,94,.25); border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0,0,0,.55);
}
.lst-title { font-size: 15px; margin: 0 0 6px; }
.lst-eyebrow { font-size: 9px; margin: 0 0 2px; }
.lst-embed, .lst-embed iframe, .lst-panel iframe { min-height: 152px; height: 152px; }
.lst-exit { position: absolute; top: 8px; right: 10px; padding: 4px 10px; font-size: 10px; }
@media (max-width: 720px) { .lst-embed, .lst-embed iframe, .lst-panel iframe { min-height: 152px; height: 152px; } }

/* the room stays sharp behind the docked deck */
#listen { backdrop-filter: none; -webkit-backdrop-filter: none; }

/* dock centering, animation-proof */
.lst-panel, #listen.on .lst-panel { left: 0; right: 0; margin: 0 auto; transform: none !important; width: min(560px, 94vw); bottom: 18px; top: auto; position: fixed; }

/* door markers - every door says its name and is a real click target */
#markers { position: fixed; inset: 0; z-index: 40; pointer-events: none; }
.dm {
  position: absolute; top: 0; left: 0; opacity: 0;
  display: block; 
  padding: 4px 9px; margin: 0;
  font: 400 8px/1 'Space Grotesk', system-ui, sans-serif; letter-spacing: .16em; text-transform: uppercase;
  color: rgba(238,230,246,.92); white-space: nowrap; cursor: pointer;
  background: rgba(8,4,16,.42); border: 1px solid rgba(201,162,255,.20); border-radius: 999px;
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  transition: opacity .5s ease, border-color .3s ease, background .3s ease, transform .08s linear;
}
.dm:hover, .dm:focus-visible { background: rgba(20,10,32,.72); border-color: rgba(234,162,94,.75); color: #fff; outline: none; }
.dm-dot { width: 6px; height: 6px; border-radius: 50%; background: #eaa25e; box-shadow: 0 0 10px 2px rgba(234,162,94,.75); animation: dmPulse 2.8s ease-in-out infinite; }
@keyframes dmPulse { 0%,100% { opacity: .55; transform: scale(.85); } 50% { opacity: 1; transform: scale(1.15); } }
body.cinema-open #markers, body.egg-open #markers { display: none; }
@media (max-width: 720px) { .dm { padding: 5px 10px; font-size: 11px; } }

.dm { color: rgba(232,224,244,.72); }
.dm:hover, .dm:focus-visible { color: #fff; }

.dm { color: rgba(232,224,244,.72); border-color: rgba(201,162,255,.20); }
.dm:hover, .dm:focus-visible { color: #fff; }
.dm-dot { display: none; }

/* the doors speak for themselves */
#markers { display: none !important; }


/* v20-no-index-counter */
#hud-index { display: none !important; }

/* ---------- v25.2 the deck is a strip, not a billboard ---------- */
.lst-embed { min-height: 152px; }
.lst-embed iframe, .lst-panel iframe { height: 152px; }
@media (max-width: 720px) { .lst-embed { min-height: 152px; } .lst-embed iframe, .lst-panel iframe { height: 152px; } }

/* rail worlds you can look around in: sideways drags turn your head, vertical ones still scroll */
body.look-rail { touch-action: pan-y; }

/* ---------- v25.5 the deck closes from its corner too ---------- */
.lst-panel { position: relative; }
.lst-x {
  position: absolute; top: 10px; right: 12px;
  width: 34px; height: 34px; border: 0; border-radius: 50%;
  background: transparent; color: #f0e2d0; opacity: 0.7;
  font: 300 22px/1 'Space Grotesk', system-ui, sans-serif; cursor: pointer;
  transition: opacity 0.3s ease, background 0.3s ease;
}
.lst-x:hover, .lst-x:focus-visible { opacity: 1; background: rgba(234, 162, 94, 0.14); }
