/* ============================================================
   WARZAN 3D — immersive scroll experience
   Inherits the amber tokens from ../css/style.css.
   ============================================================ */

body.exp {
  min-height: 720vh;            /* gives the page its scroll length */
  background: var(--bg-0);
  color: var(--text);
  /* IMPORTANT: keep both axes "visible" so the document (not the body)
     is the scroll container — parent style.css sets body overflow-x:hidden,
     which would otherwise promote overflow-y to auto and break scrollY.
     Horizontal overflow is already clipped by html { overflow-x: clip }. */
  overflow: visible;
}

/* the parent style.css hides the cursor for its custom cursor (main.js),
   which we don't load here — restore a normal cursor. */
@media (hover: hover) and (pointer: fine) {
  body.exp, body.exp a, body.exp button, body.exp input, body.exp textarea { cursor: auto; }
}

/* ---------- WebGL canvas ---------- */
#webgl {
  position: fixed; inset: 0; z-index: 0;
}
#webgl canvas { display: block; width: 100%; height: 100%; }
#webgl.is-hovering { cursor: pointer; }

/* ---------- HUD ---------- */
.hud {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.3rem clamp(1.2rem, 4vw, 3rem);
  pointer-events: none;
}
.hud a { pointer-events: auto; }
.hud__brand {
  font-family: var(--font-display);
  font-size: 1.5rem; letter-spacing: 0.18em;
  color: var(--text); text-decoration: none;
}
.hud__enter {
  font-size: 0.7rem; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--primary-soft); text-decoration: none;
  border: 1px solid rgba(255, 170, 80, 0.3); border-radius: 999px;
  padding: 0.55rem 1.1rem;
  background: rgba(12, 7, 2, 0.4); backdrop-filter: blur(8px);
  transition: color 0.3s, box-shadow 0.3s, border-color 0.3s;
}
.hud__enter:hover { color: var(--gold); border-color: var(--primary-soft); box-shadow: 0 0 22px rgba(255, 138, 30, 0.3); }

/* ---------- Station overlays ---------- */
.overlay { position: fixed; inset: 0; z-index: 20; pointer-events: none; }
.station {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -44%);
  width: min(820px, 92vw);
  text-align: center;
  opacity: 0; visibility: hidden;
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}
.station.is-active { opacity: 1; visibility: visible; transform: translate(-50%, -50%); }
/* lift the headline above the 3D clusters so text and portals don't collide */
.station[data-band="worlds"], .station[data-band="forge"] { top: 34%; }
@media (max-width: 760px) { .station[data-band="worlds"], .station[data-band="forge"] { top: 26%; } }
.station__title {
  font-size: clamp(2rem, 5.4vw, 4.1rem);
  line-height: 1.08;
  margin: 0.5rem 0 1.1rem;
}
.station__title .accent { color: var(--primary-soft); text-shadow: 0 0 30px rgba(255, 138, 30, 0.6); }
.station__sub { color: var(--muted); max-width: 54ch; margin: 0 auto; font-size: 1.02rem; }
.station__cta { margin-top: 1.8rem; }
.station .btn, .station a, .station blockquote { pointer-events: auto; }

/* Voices */
.voices { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; margin-top: 1.8rem; text-align: left; }
@media (max-width: 760px) { .voices { grid-template-columns: 1fr; } .voices .voice:nth-child(2) { display: none; } }
.voice { margin: 0; padding: 1.4rem 1.5rem; }
.voice__stars { color: var(--gold); letter-spacing: 0.3em; margin-bottom: 0.7rem; font-size: 0.95rem; }
.voice p { color: var(--muted); font-size: 0.92rem; line-height: 1.6; }
.voice footer { margin-top: 1.1rem; display: flex; align-items: center; gap: 0.8rem; font-size: 0.85rem; color: var(--muted); }
.voice__avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; flex-shrink: 0;
  font-family: var(--font-display); color: var(--lilac);
  background: linear-gradient(135deg, rgba(226, 100, 10, 0.6), rgba(96, 42, 6, 0.6));
  border: 1px solid rgba(255, 180, 61, 0.4);
}
.voice b { color: var(--text); }

/* Gateway */
.gateway__links { display: flex; flex-wrap: wrap; gap: 0.8rem; justify-content: center; margin-top: 1.9rem; }
.gateway__contact { margin-top: 1.6rem; font-size: 0.8rem; color: var(--faint); letter-spacing: 0.06em; }
.gateway__contact a { color: var(--muted); text-decoration: none; }
.gateway__contact a:hover { color: var(--primary-soft); }

/* ---------- About Me (slides in from the side) ---------- */
.station.station--about {
  left: 7%;
  width: min(540px, 86vw);
  text-align: left;
  padding: 1.9rem 2.1rem;
  border-radius: 20px;
  background: rgba(12, 7, 2, 0.4);
  border: 1px solid rgba(255, 170, 80, 0.14);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  transform: translate(-70px, -50%);
}
.station.station--about.is-active { transform: translate(0, -50%); }
.station--about .station__title { font-size: clamp(1.8rem, 4vw, 3rem); }
.station--about p { color: var(--muted); font-size: 0.98rem; line-height: 1.7; margin-bottom: 1rem; }
.station--about .about__sig {
  font-family: var(--font-display); color: var(--primary-soft);
  font-size: 1.3rem; letter-spacing: 0.2em; margin-top: 0.6rem;
  text-shadow: 0 0 22px rgba(255, 138, 30, 0.55);
}
@media (max-width: 820px) {
  .station.station--about { left: 50%; text-align: center; transform: translate(calc(-50% - 50px), -50%); }
  .station.station--about.is-active { transform: translate(-50%, -50%); }
  .station--about .eyebrow { justify-content: center; }
}

/* ---------- Showcase lightbox (view a render) ---------- */
.shot {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(1rem, 4vw, 3rem);
  opacity: 0; pointer-events: none; transition: opacity 0.4s var(--ease-out);
}
.shot.is-open { opacity: 1; pointer-events: auto; }
.shot__backdrop { position: absolute; inset: 0; background: rgba(6, 3, 1, 0.9); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.shot__box { position: relative; margin: 0; max-width: min(1100px, 94vw); transform: scale(0.96); transition: transform 0.45s var(--ease-elastic); }
.shot.is-open .shot__box { transform: scale(1); }
.shot__box img {
  width: 100%; max-height: 80vh; object-fit: contain; display: block;
  border-radius: 14px; border: 1px solid rgba(255, 180, 61, 0.3);
  box-shadow: 0 0 80px rgba(226, 100, 10, 0.32);
}
.shot__cap {
  text-align: center; margin-top: 1.1rem;
  font-family: var(--font-display); letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--lilac); font-size: 0.92rem;
}
.shot__close {
  position: absolute; top: -0.8rem; right: -0.8rem; z-index: 3;
  width: 42px; height: 42px; display: grid; place-items: center;
  border: 1px solid rgba(255, 180, 61, 0.4); border-radius: 50%;
  background: rgba(12, 7, 2, 0.85); color: var(--lilac); font-size: 1.5rem; line-height: 1; cursor: pointer;
  transition: background 0.3s, box-shadow 0.3s, transform 0.3s;
}
.shot__close:hover { background: rgba(255, 138, 30, 0.2); box-shadow: 0 0 22px rgba(255, 138, 30, 0.35); transform: rotate(90deg); }
.shot__prev, .shot__next {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 46px; height: 46px; display: grid; place-items: center;
  border: 1px solid rgba(255, 170, 80, 0.3); border-radius: 50%;
  background: rgba(12, 7, 2, 0.7); color: var(--primary-soft); font-size: 1.3rem; cursor: pointer;
  transition: background 0.3s, color 0.3s, box-shadow 0.3s;
}
.shot__prev { left: -3.4rem; } .shot__next { right: -3.4rem; }
.shot__prev:hover, .shot__next:hover { background: rgba(255, 138, 30, 0.14); color: var(--gold); box-shadow: 0 0 20px rgba(255, 138, 30, 0.25); }
@media (max-width: 720px) {
  .shot__prev { left: 0.4rem; } .shot__next { right: 0.4rem; }
  .shot__prev, .shot__next { background: rgba(12, 7, 2, 0.85); }
}

/* ---------- Scroll hint + progress ---------- */
.scroll-hint {
  position: fixed; bottom: 1.8rem; left: 50%; transform: translateX(-50%); z-index: 25;
  font-size: 0.64rem; letter-spacing: 0.4em; text-transform: uppercase; color: var(--faint);
  transition: opacity 0.5s; text-align: center;
}
.scroll-hint::after {
  content: ""; display: block; width: 1px; height: 42px; margin: 0.6rem auto 0;
  background: linear-gradient(180deg, var(--primary-soft), transparent);
  animation: scrollPulse 2.2s ease-in-out infinite;
}
@keyframes scrollPulse { 50% { transform: scaleY(0.45); opacity: 0.4; } }
.scroll-hint.is-hidden { opacity: 0; pointer-events: none; }
.progress-rail {
  position: fixed; right: 1.1rem; top: 50%; transform: translateY(-50%);
  width: 2px; height: 38vh; border-radius: 2px; z-index: 25;
  background: rgba(255, 170, 80, 0.14);
}
.progress-rail i {
  position: absolute; left: 0; top: 0; width: 100%; height: 0%;
  background: linear-gradient(180deg, var(--gold), var(--ember));
  box-shadow: 0 0 10px rgba(255, 160, 40, 0.8); border-radius: 2px;
}
@media (max-width: 760px) { .progress-rail { display: none; } }

/* ---------- Floating hover label ---------- */
.hover-label {
  position: fixed; z-index: 26; pointer-events: none;
  transform: translate(-50%, -150%);
  padding: 0.5rem 0.95rem; border-radius: 999px;
  background: rgba(12, 7, 2, 0.82); border: 1px solid rgba(255, 180, 61, 0.4);
  backdrop-filter: blur(8px);
  color: var(--lilac); font-size: 0.74rem; letter-spacing: 0.1em; white-space: nowrap;
  opacity: 0; transition: opacity 0.25s;
  box-shadow: 0 0 24px rgba(255, 138, 30, 0.25);
}
.hover-label.is-on { opacity: 1; }
.hover-label small { color: var(--primary-soft); letter-spacing: 0.2em; text-transform: uppercase; margin-left: 0.5rem; }

/* ---------- Lore reader overlay ---------- */
.lore {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(1rem, 4vw, 3rem);
  opacity: 0; pointer-events: none; transition: opacity 0.4s var(--ease-out);
}
.lore.is-open { opacity: 1; pointer-events: auto; }
.lore__backdrop { position: absolute; inset: 0; background: rgba(6, 3, 1, 0.86); backdrop-filter: blur(14px); }
.lore__box {
  position: relative; width: min(860px, 96vw); max-height: 90vh; overflow-y: auto;
  border-radius: 26px;
  transform: scale(0.95) translateY(12px); transition: transform 0.5s var(--ease-elastic);
}
.lore.is-open .lore__box { transform: none; }
.lore__media { position: relative; }
.lore__media img { width: 100%; max-height: 42vh; object-fit: cover; display: block; }
.lore__media::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 45%; background: linear-gradient(180deg, transparent, var(--glass)); pointer-events: none; }
.lore__close {
  position: absolute; top: 1.1rem; right: 1.1rem; z-index: 3;
  width: 42px; height: 42px; display: grid; place-items: center;
  border: 1px solid rgba(255, 180, 61, 0.4); border-radius: 50%;
  background: rgba(12, 7, 2, 0.6); backdrop-filter: blur(8px);
  color: var(--lilac); font-size: 1.5rem; line-height: 1; cursor: pointer;
  transition: background 0.3s, box-shadow 0.3s, transform 0.3s;
}
.lore__close:hover { background: rgba(255, 138, 30, 0.18); box-shadow: 0 0 22px rgba(255, 138, 30, 0.35); transform: rotate(90deg); }
.lore__content { padding: clamp(1.5rem, 4vw, 2.6rem); }
.lore__no { display: block; font-size: 0.74rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--primary-soft); margin-bottom: 0.9rem; }
.lore__name { font-family: var(--font-display); font-size: clamp(1.9rem, 4.4vw, 2.9rem); line-height: 1.1; margin-bottom: 1.1rem; }
.lore__name::after { content: ""; display: block; width: 3.2rem; height: 2px; margin-top: 1rem; background: linear-gradient(90deg, var(--primary), transparent); }
.lore__quote { font-family: var(--font-display); font-size: 1.18rem; font-style: italic; line-height: 1.5; color: var(--primary-soft); margin-bottom: 1.6rem; text-shadow: 0 0 24px rgba(255, 138, 30, 0.3); }
.lore__lore p { color: var(--muted); font-size: 1.02rem; line-height: 1.85; margin-bottom: 1.2rem; }
.lore__lore p:last-child { margin-bottom: 0; }
.lore__nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 2.2rem; padding-top: 1.5rem; border-top: 1px solid rgba(255, 170, 80, 0.14); }
.lore__prev, .lore__next {
  background: none; border: 1px solid rgba(255, 170, 80, 0.3); border-radius: 999px;
  padding: 0.6rem 1.4rem; color: var(--primary-soft);
  font-family: var(--font-body); font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; cursor: pointer;
  transition: background 0.3s, color 0.3s, box-shadow 0.3s;
}
.lore__prev:hover, .lore__next:hover { background: rgba(255, 138, 30, 0.1); color: var(--gold); box-shadow: 0 0 20px rgba(255, 138, 30, 0.22); }

/* ---------- Fallback / reduced-motion stacked mode ---------- */
.webgl-warn {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  text-align: center; padding: 0.7rem 1rem;
  background: rgba(28, 16, 6, 0.92); border-bottom: 1px solid rgba(255, 180, 61, 0.4);
  color: var(--lilac); font-size: 0.82rem; letter-spacing: 0.04em;
}
.webgl-warn a { color: var(--gold); }
.fallback-card {
  position: fixed; left: 50%; bottom: 2rem; transform: translateX(-50%); z-index: 40;
  padding: 1rem 1.6rem; border-radius: 999px;
  background: rgba(28, 16, 6, 0.92); border: 1px solid rgba(255, 180, 61, 0.4); color: var(--lilac);
}
.fallback-card a { color: var(--gold); }

body.exp.is-static { min-height: auto; }
body.exp.is-static #webgl { opacity: 0.35; }
body.exp.is-static .overlay { position: static; pointer-events: auto; }
body.exp.is-static .scroll-hint, body.exp.is-static .progress-rail { display: none; }
body.exp.is-static .station {
  position: relative; left: auto; top: auto;
  transform: none; opacity: 1; visibility: visible;
  transition: none;            /* fallback/reduced: show instantly, no fade */
  width: min(760px, 92vw); margin: 0 auto; padding: 13vh 0;
}
body.exp.is-static .hud { position: absolute; }

@media (prefers-reduced-motion: reduce) {
  .station, .lore, .lore__box, .hover-label { transition: none; }
  .scroll-hint::after { animation: none; }
}
