/* worlds.css — Five Worlds prototype (Heaven / Earth / Hell vertical journey)
   Placeholder art: everything here is gradients, shapes, and filters.
   Video loops and PNG props drop into the scene layers later. */

/* ─── Custom properties ─────────────────────────────────────────────────── */
:root {
  --cream: #f5ecd9;
  --burgundy: #6b2c2c;
  --gold: #b8893a;
  --gold-light: #e8c877;
  --charcoal: #2c2820;
  --charcoal-light: #5a5347;

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Sky colors — JS interpolates these with scroll elevation */
  --sky-top: #adc4d6;
  --sky-bot: #ecdfc5;
}

/* ─── Minimal reset ─────────────────────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }

/* clip, NOT hidden: overflow-x hidden on html/body turns the body into a
   scroll container, which silently breaks position: sticky for every scene */
html { overflow-x: clip; }

body {
  font-family: var(--font-body);
  color: var(--charcoal);
  overflow-x: clip;
  background: var(--sky-bot);
}

/* ─── Fixed backdrop layers ─────────────────────────────────────────────── */
.sky {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: linear-gradient(to bottom, var(--sky-top), var(--sky-bot));
}

#particles {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ─── Prototype badge ───────────────────────────────────────────────────── */
.prototype-badge {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 50;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--charcoal-light);
  background: rgba(245, 236, 217, 0.72);
  border: 1px solid rgba(184, 137, 58, 0.4);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  pointer-events: none;
}

body[data-world="hell-1"] .prototype-badge {
  color: rgba(245, 236, 217, 0.75);
  background: rgba(30, 12, 8, 0.55);
  border-color: rgba(232, 200, 119, 0.3);
}

/* ─── Sound toggle ──────────────────────────────────────────────────────── */
.sound-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 50;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  border: 1px solid rgba(184, 137, 58, 0.55);
  background: rgba(245, 236, 217, 0.72);
  color: var(--charcoal);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.sound-toggle svg { width: 1.15rem; height: 1.15rem; }

.sound-toggle:hover { background: var(--gold); color: var(--cream); }

.sound-toggle:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 3px; }

.sound-toggle.on { box-shadow: 0 0 12px rgba(232, 200, 119, 0.65); }

.sound-toggle:not(.on) .icon-waves { display: none; }
.sound-toggle.on .icon-slash { display: none; }

body[data-world="hell-1"] .sound-toggle {
  background: rgba(30, 12, 8, 0.55);
  color: rgba(245, 236, 217, 0.85);
  border-color: rgba(232, 200, 119, 0.35);
}

/* ─── Elevation gauge ───────────────────────────────────────────────────── */
.elevation-gauge {
  position: fixed;
  right: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
}

.gauge-rail {
  position: relative;
  width: 2px;
  height: 34vh;
  border-radius: 999px;
  background: linear-gradient(to bottom, var(--gold-light), #a8c0d8 50%, #7a2410);
}

.gauge-thumb {
  position: absolute;
  left: 50%;
  top: 0;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at 35% 35%, #fff8e2, var(--gold));
  box-shadow: 0 0 10px 2px rgba(232, 200, 119, 0.55);
  /* JS moves it via transform (compositor-only) — animating `top` forced
     layout work on every scroll frame */
  transition: transform 0.15s linear;
  pointer-events: none;
}

.gauge-stop {
  position: absolute;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
}

.stop-dot {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1px solid rgba(44, 40, 32, 0.55);
  background: rgba(245, 236, 217, 0.65);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.gauge-stop.active .stop-dot {
  background: var(--gold);
  box-shadow: 0 0 8px 1px rgba(232, 200, 119, 0.7);
}

.stop-label {
  display: none;
  position: absolute;
  right: calc(100% + 0.3rem);
  top: 50%;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--charcoal-light);
  white-space: nowrap;
  opacity: 0;
  transform: translate(6px, -50%);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

body[data-world="hell-1"] .stop-label,
body[data-world="hell-1"] .gauge-current { color: rgba(245, 236, 217, 0.8); }
body[data-world="hell-1"] .stop-dot { border-color: rgba(245, 236, 217, 0.5); }

.gauge-current {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--charcoal-light);
  writing-mode: vertical-rl;
  letter-spacing: 0.08em;
}

/* ─── World sections ────────────────────────────────────────────────────── */
.world {
  position: relative;
  height: 220vh;
  height: 220svh;
}

.world-scene {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── Background video layers ───────────────────────────────────────────── */
.world-video {
  position: absolute;
  inset: 0;
  opacity: var(--vfade, 1);
  pointer-events: none;
  /* Feather the footage into the sky so scene boundaries never show a hard line */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 16%, black 84%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, black 16%, black 84%, transparent 100%);
}

/* Middle world: deep feather top and bottom — the tall 6:5 clips leave
   plenty of content to dissolve through on both edges */
.world-earth .world-video {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 26%, black 74%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, black 26%, black 74%, transparent 100%);
}

/* Topmost world: nothing above it, so only feather the bottom.
   Deeper fade — the taller clip has vertical content to spare. */
.world-heaven-1 .world-video {
  -webkit-mask-image: linear-gradient(to bottom, black 0%, black 70%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 0%, black 70%, transparent 100%);
}

/* Bottommost world: deep feather at the top only. The bottom stays fully
   opaque — its edge is handled by darkening overlay, not by masking, so
   the backdrop can never show through as a band */
.world-hell-1 .world-video {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 30%, black 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, black 30%, black 100%);
}

.world-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Second clip of a crossfade pair stacks on top; JS drives the opacity swap */
.world-video video + video {
  position: absolute;
  inset: 0;
}

/* Effect footage layer: black-background clips blended so only light shows */
.world-fx {
  position: absolute;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: calc(var(--vfade, 1) * 0.55);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 16%, black 84%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, black 16%, black 84%, transparent 100%);
}

.world-fx video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Scrim over each video so plaque text stays readable */
.world-video::after {
  content: '';
  position: absolute;
  inset: 0;
}

.world-heaven-1 .world-video::after {
  background:
    radial-gradient(ellipse at 50% 55%, rgba(255, 248, 230, 0.5), transparent 68%),
    linear-gradient(to bottom, rgba(255, 250, 233, 0.2), rgba(243, 226, 175, 0.3));
}

.world-earth .world-video::after {
  background:
    radial-gradient(ellipse at 50% 55%, rgba(245, 240, 225, 0.5), transparent 68%),
    linear-gradient(to bottom, rgba(236, 223, 197, 0.2), rgba(44, 40, 32, 0.12));
}

.world-hell-1 .world-video::after {
  background:
    radial-gradient(ellipse at 50% 55%, rgba(15, 6, 4, 0.45), transparent 72%),
    linear-gradient(to bottom, transparent 62%, rgba(12, 5, 3, 0.92) 100%),
    linear-gradient(to bottom, rgba(24, 10, 10, 0.35), rgba(24, 10, 10, 0.5));
}

/* Real footage replaces the placeholder terrain and cloud blobs */
.has-video .hill,
.has-video .cloud { display: none; }

/* Embers: quieter than the soft light, and with a deep bottom feather so
   the footage's lower edge dissolves instead of ending in a hard line */
.world-hell-1 .world-fx {
  opacity: calc(var(--vfade, 1) * 0.15);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 22%, black 62%, transparent 94%);
  mask-image: linear-gradient(to bottom, transparent 0%, black 22%, black 62%, transparent 94%);
}

/* ─── Portals: inhabit the empty transition zones between worlds ────────── */
/* Fixed overlay. Each portal is visible only while the viewport is inside
   its gap; opacity peaks mid-gap, scale grows in the direction of travel,
   so you approach, pass through, and leave it behind — both directions. */
.portal-layer {
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  /* Hidden unless its gap is active — a full-screen blend layer costs
     compositor work even when its content is at opacity 0 */
  visibility: hidden;
}

.portal-layer.portal-active { visibility: visible; }

/* Extra scroll runway inside the Earth↔Heaven gap */
.gap-spacer {
  height: 120vh;
  height: 120svh;
}

/* Threshold clips: full-bleed, playhead driven by scroll (JS).
   Fade in at the gap edges, hold through the middle. */
.portal-layer-gates video,
.portal-layer-fissure video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 14%, black 86%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, black 14%, black 86%, transparent 100%);
}

.portal-layer-gates video {
  opacity: min(calc(min(var(--bh, 1), 1 - var(--bh, 1)) * 5), 1);
}

.portal-layer-fissure video {
  opacity: min(calc(min(var(--bb, 0), 1 - var(--bb, 0)) * 5), 1);
}


/* ─── Content plaques ───────────────────────────────────────────────────── */
.world-content {
  position: relative;
  z-index: 5;
  max-width: 36rem;
  padding: 2rem 1.5rem;
  text-align: center;
  /* Scroll-driven: fully visible while the world is settled, fades out
     toward its edges so text never overlaps the portal gaps */
  opacity: var(--cfade, 1);
}

.world-eyebrow {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
}

.world-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(3.2rem, 12vw, 6.5rem);
  line-height: 1;
  margin-bottom: 1.4rem;
}

.world-plaque {
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--charcoal-light);
  max-width: 30rem;
  margin: 0 auto;
}

.world-cues {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 2.2rem;
  flex-wrap: wrap;
}

.cue {
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--charcoal);
  background: rgba(245, 236, 217, 0.55);
  border: 1px solid var(--gold);
  border-radius: 999px;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.cue:hover,
.cue:focus-visible {
  background: var(--gold);
  color: var(--cream);
  transform: translateY(-2px);
}

.cue:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 3px; }

.cue-down { border-color: var(--burgundy); }
.cue-down:hover, .cue-down:focus-visible { background: var(--burgundy); }

.cue-light {
  color: var(--cream);
  background: rgba(245, 236, 217, 0.08);
  border-color: rgba(232, 200, 119, 0.7);
}

/* ─── Reveal choreography ───────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  clip-path: inset(0 0 100% 0);
  transition: opacity 0.9s ease, transform 0.9s ease, clip-path 0.9s ease;
}

.delay-1 { transition-delay: 0.15s; }
.delay-2 { transition-delay: 0.3s; }
.delay-3 { transition-delay: 0.45s; }

.world-content.visible .reveal {
  opacity: 1;
  transform: none;
  clip-path: inset(0 0 -8% 0);
}

/* ─── World guides: companion + paged notes ─────────────────────────────── */
.world-guide {
  position: absolute;
  left: 4%;
  top: 16%;
  width: min(22rem, 40vw);
  pointer-events: none;
  /* Sits clear of the elevation gauge on the right edge */
  /* No z-index or opacity here: either would create a stacking context
     that isolates the dove's screen blend and render its black square.
     Fades and parallax live on the video/card elements themselves. */
}

/* Mirrored placement so consecutive worlds don't stack their guides
   in the same corner */
.world-guide-right {
  left: auto;
  right: 7%;
}

.world-guide-right .guide-card { transform-origin: 100% 0; }

.guide-media {
  position: relative;
  width: min(23rem, 32vw);
}

/* The angel reads smaller in its frame than the dove — size it up */
.world-guide-right .guide-media { width: min(26rem, 36vw); }

/* Dark card for the Depths: charred parchment instead of cream */
.world-guide-dark .guide-card {
  background: rgba(22, 10, 8, 0.88);
  border-color: rgba(217, 138, 74, 0.45);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.5);
}

.world-guide-dark .guide-name { color: #d98a4a; }
.world-guide-dark .guide-page { color: rgba(240, 224, 200, 0.85); }
.world-guide-dark .guide-arrow {
  color: rgba(240, 224, 200, 0.9);
  border-color: rgba(217, 138, 74, 0.6);
}
.world-guide-dark .guide-arrow:hover:not(:disabled),
.world-guide-dark .guide-arrow:focus-visible {
  background: #d98a4a;
  color: #160a08;
}
.world-guide-dark .guide-dots .dot { background: rgba(240, 224, 200, 0.3); }
.world-guide-dark .guide-dots .dot.active { background: #d98a4a; }

/* Ember glow behind the demon rather than the guides' warm-white halo */
.world-guide-dark .guide-media::before {
  background: radial-gradient(closest-side, rgba(255, 96, 32, 0.34), rgba(150, 40, 10, 0.16) 55%, transparent 76%);
}

/* Soft radiance behind the companion — reads as its glow, and swallows any
   trace of the video frame's edges against darker backdrops */
.guide-media::before {
  content: '';
  position: absolute;
  inset: -28% -35%;
  background: radial-gradient(closest-side, rgba(255, 250, 235, 0.6), rgba(255, 250, 235, 0.25) 55%, transparent 75%);
  opacity: var(--cfade, 1);
  pointer-events: none;
}

/* The companion drifts faster than the scenery — a depth layer of its own.
   A transparent PNG cutout: alpha images render identically everywhere,
   unlike alpha video. The wrapper carries a slow hover; the image carries
   the scroll parallax. */
.guide-media {
  animation: guide-float 6s ease-in-out infinite alternate;
}

@keyframes guide-float {
  from { translate: 0 0; rotate: -1.5deg; }
  to   { translate: 0 -14px; rotate: 1.5deg; }
}

.guide-media picture { display: block; }

.guide-media img {
  width: 100%;
  display: block;
  opacity: var(--cfade, 1);
  transform: translate(
    calc((var(--p, 0.5) - 0.5) * 70px),
    calc((var(--p, 0.5) - 0.5) * -170px)
  );
}

/* The note card trails at a slower parallax rate than the companion */
.guide-card {
  position: relative;
  max-width: 19rem;
  /* The new clip has generous black margins — tuck the card up under the bird */
  margin-top: -3.5rem;
  background: rgba(245, 236, 217, 0.93);
  border: 1px solid rgba(184, 137, 58, 0.5);
  border-radius: 6px;
  padding: 1rem 1.15rem 0.8rem;
  box-shadow: 0 10px 32px rgba(44, 40, 32, 0.2);
  opacity: var(--cfade, 1);
  transform: translateY(calc((var(--p, 0.5) - 0.5) * -60px)) rotate(-1.2deg);
  pointer-events: auto;
}

.guide-name {
  display: block;
  font-size: 0.62rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.guide-page {
  display: none;
  font-size: 0.85rem;
  font-weight: 300;
  line-height: 1.65;
  color: var(--charcoal-light);
}

.guide-page.active { display: block; }

.guide-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.75rem;
}

.guide-arrow {
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  border: 1px solid var(--gold);
  background: none;
  color: var(--charcoal);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, opacity 0.25s ease;
}

.guide-arrow:hover:not(:disabled),
.guide-arrow:focus-visible {
  background: var(--gold);
  color: var(--cream);
}

.guide-arrow:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 2px; }

.guide-arrow:disabled {
  opacity: 0.3;
  cursor: default;
}

.guide-dots { display: flex; gap: 0.4rem; }

.guide-dots .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(44, 40, 32, 0.25);
  transition: background 0.25s ease;
}

.guide-dots .dot.active { background: var(--gold); }

@media (max-width: 767px) {
  .world-guide {
    left: 1rem;
    right: 1rem;
    top: auto;
    bottom: 4rem;
    width: auto;
  }

  .guide-card { max-width: none; margin-top: 0; transform: none; }
}

/* ─── HEAVEN ────────────────────────────────────────────────────────────── */
.title-heaven {
  background: linear-gradient(110deg, #8a6a2a 0%, var(--gold-light) 25%, #fff3d6 50%, var(--gold-light) 75%, #8a6a2a 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 6s linear infinite;
}

@keyframes shimmer {
  from { background-position: 0% 0; }
  to   { background-position: 200% 0; }
}

.heaven-halo {
  position: absolute;
  top: -25%;
  left: 50%;
  transform: translateX(-50%);
  width: 130vw;
  height: 75vh;
  background: radial-gradient(ellipse at center, rgba(255, 247, 221, 0.85), rgba(255, 247, 221, 0) 65%);
  pointer-events: none;
  animation: halo-breathe 9s ease-in-out infinite;
}

@keyframes halo-breathe {
  0%, 100% { opacity: 0.75; }
  50%      { opacity: 1; }
}

.god-rays {
  position: absolute;
  inset: -25% -12%;
  background: repeating-conic-gradient(
    from 172deg at 50% -15%,
    rgba(255, 244, 214, 0) 0deg 3deg,
    rgba(255, 244, 214, 0.16) 4.5deg 6deg,
    rgba(255, 244, 214, 0) 7.5deg 13deg
  );
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 72%);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 72%);
  transform-origin: 50% -15%;
  animation: rays-sway 16s ease-in-out infinite alternate, rays-pulse 9s ease-in-out infinite;
  pointer-events: none;
}

@keyframes rays-sway {
  from { transform: rotate(-2deg); }
  to   { transform: rotate(2deg); }
}

@keyframes rays-pulse {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 0.9; }
}

.cloud {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0));
  filter: blur(14px);
  pointer-events: none;
}

.cloud-1 {
  width: 46vw; height: 20vh; left: -8vw; top: 22%;
  transform: translateY(calc((var(--p, 0.5) - 0.5) * -70px));
  animation: cloud-drift 30s ease-in-out infinite alternate;
}

.cloud-2 {
  width: 55vw; height: 24vh; right: -12vw; bottom: 12%;
  transform: translateY(calc((var(--p, 0.5) - 0.5) * -110px));
  animation: cloud-drift 38s ease-in-out infinite alternate-reverse;
}

.cloud-3 {
  width: 34vw; height: 15vh; right: 14vw; top: 10%;
  transform: translateY(calc((var(--p, 0.5) - 0.5) * -45px));
  animation: cloud-drift 26s ease-in-out infinite alternate;
}

@keyframes cloud-drift {
  from { margin-left: 0; }
  to   { margin-left: 5vw; }
}

/* ─── EARTH ─────────────────────────────────────────────────────────────── */
.title-earth { color: var(--burgundy); }

.hill {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.hill-back {
  width: 120vw; height: 50vh; left: -10vw; bottom: -30vh;
  background: radial-gradient(ellipse at top, #9b8d66, #877a56 70%);
  opacity: 0.55;
  transform: translateY(calc((var(--p, 0.5) - 0.5) * 30px));
}

.hill-left {
  width: 95vw; height: 46vh; left: -34vw; bottom: -24vh;
  background: radial-gradient(ellipse at top, #8a7d57, #6d5f44 70%);
  transform: translateY(calc((var(--p, 0.5) - 0.5) * 55px));
}

.hill-right {
  width: 100vw; height: 48vh; right: -38vw; bottom: -27vh;
  background: radial-gradient(ellipse at top, #7c6b4e, #62543c 70%);
  transform: translateY(calc((var(--p, 0.5) - 0.5) * 75px));
}

.earth-fog {
  position: absolute;
  left: -20%;
  right: -20%;
  bottom: 14%;
  height: 20vh;
  background: linear-gradient(to bottom, transparent, rgba(240, 235, 220, 0.55), transparent);
  filter: blur(18px);
  animation: fog-drift 28s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes fog-drift {
  from { transform: translateX(-3%); }
  to   { transform: translateX(3%); }
}

/* ─── HELL ──────────────────────────────────────────────────────────────── */
.world-hell-1 .world-eyebrow { color: #d98a4a; }

.world-hell-1 .world-plaque { color: rgba(240, 224, 200, 0.82); }

.title-hell {
  color: #f0d9c8;
  animation: hell-flicker 7s linear infinite;
}

@keyframes hell-flicker {
  0%, 100% { text-shadow: 0 0 18px rgba(255, 110, 40, 0.5), 0 0 60px rgba(255, 60, 10, 0.25); }
  46%      { text-shadow: 0 0 18px rgba(255, 110, 40, 0.5), 0 0 60px rgba(255, 60, 10, 0.25); }
  48%      { text-shadow: 0 0 26px rgba(255, 140, 60, 0.8), 0 0 80px rgba(255, 80, 20, 0.4); }
  50%      { text-shadow: 0 0 14px rgba(255, 100, 30, 0.4), 0 0 50px rgba(255, 50, 5, 0.2); }
  53%      { text-shadow: 0 0 24px rgba(255, 130, 55, 0.7), 0 0 75px rgba(255, 75, 18, 0.38); }
  56%      { text-shadow: 0 0 18px rgba(255, 110, 40, 0.5), 0 0 60px rgba(255, 60, 10, 0.25); }
}

/* Breathing molten glow. Compositor-only (opacity + transform) — the old
   SVG displacement shimmer re-rasterized on the CPU every frame and janked
   scrolling once the scenes actually pinned. */
.hell-glow {
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: -25%;
  height: 72%;
  background: radial-gradient(ellipse at 50% 100%, rgba(255, 96, 32, 0.6), rgba(120, 20, 5, 0.28) 45%, transparent 75%);
  transform-origin: 50% 100%;
  animation: glow-pulse 5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0.8; transform: scaleY(1); }
  50%      { opacity: 1; transform: scaleY(1.07); }
}

/* Subtle rumble while dwelling in the Depths */
body[data-world="hell-1"] .world-hell-1 .world-scene {
  animation: rumble 6s linear infinite;
}

@keyframes rumble {
  0%, 100% { transform: translate(0, 0); }
  20%      { transform: translate(0.4px, -0.3px); }
  40%      { transform: translate(-0.3px, 0.4px); }
  60%      { transform: translate(0.3px, 0.3px); }
  80%      { transform: translate(-0.4px, -0.3px); }
}

/* ─── Mobile: fewer decorations ─────────────────────────────────────────── */
@media (max-width: 767px) {
  .decoration-hide-mobile { display: none; }
  .stop-label { display: none; }
  .gauge-current { display: none; }
  .elevation-gauge { right: 0.35rem; }
}

/* ─── Tablet & desktop ──────────────────────────────────────────────────── */
@media (min-width: 768px) {
  .elevation-gauge { right: 1.6rem; }

  .stop-label { display: block; }

  .gauge-stop:hover .stop-label,
  .gauge-stop:focus-visible .stop-label,
  .gauge-stop.active .stop-label {
    opacity: 1;
    transform: translate(0, -50%);
  }

  .world-plaque { font-size: 1.08rem; }
}

/* ─── Reduced motion ────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  #particles { display: none; }

  .reveal {
    opacity: 1;
    transform: none;
    clip-path: none;
  }
}
