/* =====================================================================
   A Tale of Light - "The Ascending Path" sections.
   Loaded after style.css; reuses its brand tokens (:root) and overrides
   the apparition field for the sequential single-line reveal.
   ===================================================================== */

/* ---------- HERO: arrival at Somariel, lit by a cursor torch ---------- */
/* The cursor IS a lit lantern while you're over the hero: you carry it across the dark
   plate and the torch-glow reveals what it passes. Native cursor = crisp, no JS lag;
   interactive controls keep the pointer. Hotspot "27 37" sits on the flame at the 72px
   render height (make_web_glimpses.py), which also rewrites the -<hash> on the URL. */
.hero { cursor: url("../img/lantern-cursor-25064798.png") 27 37, auto; }
.hero a, .hero button { cursor: pointer; }
.hero__plate {
  position: absolute; inset: 0; z-index: 0;
  background: url("../img/somariel-hero-55014241.webp") center 40% / cover no-repeat;
  filter: brightness(0.7) saturate(0.9);
  transform: scale(1.05);
}
.hero__embers { z-index: 1; }
/* the torch: a moving hole of light over the dark scene */
.hero__torch {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: radial-gradient(circle var(--torch, 340px) at var(--mx, 50%) var(--my, 44%),
    rgba(2, 2, 34, 0) 0%, rgba(2, 2, 34, 0.06) 16%, rgba(2, 2, 34, 0.55) 46%, rgba(2, 2, 34, 0.93) 78%);
  transition: background 0.08s linear;
}
.hero__veil {
  z-index: 2;
  background:
    linear-gradient(180deg, rgba(2, 2, 34, 0.45) 0%, transparent 26%, transparent 50%, rgba(1, 1, 20, 0.9) 100%);
}
.hero__inner { z-index: 4; }
.hero__tagline strong { color: var(--sun-gold); font-weight: 400; }

/* ---------- THE TALE ---------- */
.tale {
  background: radial-gradient(120% 80% at 50% 0%, #0a0a30 0%, var(--night) 70%);
}

/* ---------- SOMARIEL: the living city ---------- */
.city { padding: clamp(4rem, 9vw, 7rem) 1.25rem; }
.city__lead {
  max-width: 54ch; margin: -1.5rem auto 0; text-align: center;
  color: var(--ink-dim); font-size: 1.05rem;
}
.city__lead em { color: var(--sun-soft); font-style: italic; }

.townscape {
  position: relative; max-width: 860px; margin: 2.4rem auto 0;
  border: 1px solid rgba(253, 206, 28, 0.18); border-radius: 10px; overflow: hidden;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
}
.townscape img {
  width: 100%; height: auto; display: block;
  filter: brightness(0.6) saturate(0.88) contrast(1.03);
}
.townscape__veil {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(84% 78% at 50% 52%, transparent 38%, rgba(4, 4, 12, 0.54) 100%),
    linear-gradient(rgba(6, 8, 18, 0.24), rgba(6, 8, 18, 0.34));
}

/* venue beacons - bright, ringed, unmistakably interactive */
.beacon {
  position: absolute; transform: translate(-50%, -50%);
  width: 18px; height: 18px; padding: 0; border: 0; background: none; cursor: pointer; z-index: 3;
}
.beacon__dot {
  position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 42% 38%, #fff, #ffe89a 38%, var(--sun-gold) 72%);
  box-shadow: 0 0 10px 3px rgba(255, 212, 96, 0.95), 0 0 32px 13px rgba(253, 170, 40, 0.45);
}
.beacon__ring {
  position: absolute; inset: -2px; border-radius: 50%;
  border: 2px solid rgba(255, 226, 130, 0.85);
  animation: beacon-ripple 2.2s ease-out infinite;
}
.beacon__ring--2 { animation-delay: 1.1s; }
@keyframes beacon-ripple { 0% { transform: scale(0.5); opacity: 0.9; } 100% { transform: scale(3.1); opacity: 0; } }

.beacon__card {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(6px);
  width: 214px; padding: 0.7rem 0.8rem; border-radius: 6px;
  background: rgba(8, 8, 36, 0.96); border: 1px solid rgba(253, 206, 28, 0.35);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.7);
  font-family: var(--font-body); font-size: 0.84rem; line-height: 1.5; color: var(--ink);
  opacity: 0; visibility: hidden; transition: opacity 0.18s ease, transform 0.18s ease; z-index: 9;
}
.beacon:hover .beacon__card,
.beacon:focus-visible .beacon__card { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.beacon__name {
  display: block; font-family: var(--font-display); font-size: 0.78rem; letter-spacing: 0.06em;
  color: var(--sun-gold); margin-bottom: 0.2rem;
}
.beacon:focus-visible { outline: none; }
.beacon:focus-visible .beacon__dot { box-shadow: 0 0 0 3px var(--sun-gold), 0 0 18px var(--sun-gold); }

/* ---------- BY TORCHLIGHT: single-line sequential apparitions ----------
   Overrides the scale-fade .glimpse from style.css with a rise/drop. */
.media { padding: clamp(4rem, 9vw, 7rem) 1.25rem; }
.glimpses {
  position: relative; max-width: 1180px; margin: 0 auto;
  height: clamp(300px, 40vw, 360px); overflow: hidden;
}
.glimpse {
  position: absolute; top: 0; left: 0;
  width: clamp(150px, 22vw, 236px);
  opacity: 0; transform: translateY(30px); transition: opacity 1.3s ease, transform 1.3s ease;
  will-change: opacity, transform; pointer-events: none;
  filter: drop-shadow(0 14px 44px rgba(0, 0, 0, 0.75));
}
.glimpse.is-in  { opacity: var(--peak, 0.86); transform: translateY(0); }
.glimpse.is-out { opacity: 0; transform: translateY(30px); }
.glimpse img { width: 100%; height: auto; display: block; }

/* ---------- A BAND OF YOUR MAKING: hover-lit portrait gallery ---------- */
.roster { padding: clamp(4rem, 9vw, 7rem) 1.25rem; background: linear-gradient(180deg, #06061c, var(--night)); }
.roster__lead {
  max-width: 56ch; margin: -1.5rem auto 0; text-align: center; color: var(--ink-dim); font-size: 1.05rem;
}
.roster__lead strong { color: var(--sun-gold); font-weight: 700; }
.gallery {
  max-width: var(--maxw); margin: 2.4rem auto 0;
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 12px;
}
.face {
  position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden;
  background: radial-gradient(circle at 50% 36%, #15163a, #07071a);
  border: 1px solid rgba(123, 123, 224, 0.16);
  transition: transform 0.2s ease, box-shadow 0.25s ease, border-color 0.2s ease;
}
.face img {
  width: 100%; height: 100%; object-fit: contain; object-position: center bottom;
  filter: brightness(0.6) saturate(0.84) contrast(0.98); transition: filter 0.25s ease; transform: translateY(5%);
}
.face:hover {
  transform: scale(1.5); z-index: 5;
  border-color: rgba(253, 206, 28, 0.6);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.7), 0 0 26px rgba(253, 206, 28, 0.4);
}
.face:hover img { filter: brightness(1.08) saturate(1.08) contrast(1.02); }
.face__label {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 0.6em 0.3em 0.4em;
  font-family: var(--font-display); font-size: 0.5rem; letter-spacing: 0.05em; line-height: 1.3;
  text-transform: uppercase; text-align: center; color: var(--sun-gold);
  background: linear-gradient(transparent, rgba(2, 2, 20, 0.94) 60%);
  opacity: 0; transition: opacity 0.2s ease; pointer-events: none;
}
.face:hover .face__label { opacity: 1; }

/* ---------- THE MARROW (dungeon under Somariel) ---------- */
.marrow { padding: clamp(4.5rem, 10vw, 8rem) 1.25rem; background: #040418; text-align: center; }
.marrow__inner {
  position: relative; max-width: 640px; margin: 0 auto; padding: 2.5rem 1.5rem;
  background: radial-gradient(circle 280px at 50% 40%, rgba(232, 99, 28, 0.14), transparent 70%);
}
.marrow__torch {
  display: block; width: 10px; height: 10px; margin: 0 auto 1.4rem; border-radius: 50%;
  background: radial-gradient(circle, #fff, var(--sun-gold));
  box-shadow: 0 0 30px 8px rgba(253, 170, 50, 0.6);
}
.marrow__inner .section-head__eyebrow { color: var(--ember-lit); }
.marrow__body { color: var(--ink); max-width: 48ch; margin: 1rem auto 0; }

/* Marrow screenshot carousel: wider than town showcase; full UI, no crop */
.marrow__carousel {
  max-width: min(920px, 100%);
  margin: 2rem auto 0;
}
.marrow__carousel .carousel__stage {
  aspect-ratio: 16 / 10;
  border-color: rgba(253, 170, 50, 0.22);
  box-shadow:
    0 0 0 1px rgba(253, 170, 50, 0.12),
    0 18px 48px rgba(0, 0, 0, 0.55);
}
.marrow__carousel .carousel__slide img {
  object-fit: contain;
  background: #08080f;
}
.marrow__carousel .carousel__zoom:hover img {
  transform: scale(1.02);
}

/* ---------- THE ASCENDING PATH: the withheld heights ---------- */
.path {
  position: relative; overflow: hidden;
  padding: clamp(4.5rem, 10vw, 8rem) 1.25rem;
  background: linear-gradient(180deg, #100a26 0%, #0b0720 42%, #1a0a10 100%);
}
.path__mark {
  position: absolute; width: 320px; height: 320px; color: var(--ink); opacity: 0.05; pointer-events: none;
}
.path__mark--a { top: 30px; right: -70px; }
.path__mark--b { bottom: 40px; left: -80px; }
.path__lead { max-width: 60ch; margin: -1.5rem auto 0; text-align: center; color: var(--ink-dim); }
.path__lead em { color: var(--sun-soft); font-style: italic; }

.ladder { list-style: none; max-width: 560px; margin: 2.4rem auto 0; padding: 0; }
.rung {
  display: flex; align-items: center; gap: 1.3rem;
  padding: 1.5rem 1.4rem; margin: 0.9rem 0; border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.rung__sigil { flex: none; width: 70px; height: 70px; }
.rung__sigil svg { width: 100%; height: 100%; }
.rung__role {
  font-family: var(--font-display); font-size: 0.66rem; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--ink-dim); margin: 0;
}
.rung__name { font-size: 1.45rem; margin: 0.1rem 0 0; }
.rung__line { font-family: var(--font-fell); font-style: italic; margin: 0.4rem 0 0; color: var(--ink); font-size: 0.98rem; }
.rung__status {
  display: inline-block; margin-top: 0.6rem; padding: 0.2rem 0.7rem; border-radius: 20px;
  font-family: var(--font-display); font-size: 0.62rem; letter-spacing: 0.18em; text-transform: uppercase;
}
/* Numalor (top): rubedo red-gold, fading */
.rung--numalor { background: radial-gradient(120% 140% at 18% 0%, rgba(224, 73, 47, 0.15), transparent 60%); border-color: rgba(240, 169, 58, 0.28); }
.rung--numalor .rung__sigil { color: #f0a93a; filter: drop-shadow(0 0 12px rgba(240, 120, 50, 0.5)); }
.rung--numalor .rung__name { color: #f0a93a; }
.rung--numalor .rung__status { color: #f0a93a; border: 1px solid rgba(240, 169, 58, 0.4); }
/* Sophiel (mid): albedo silver-white, illusion */
.rung--sophiel { background: radial-gradient(120% 140% at 18% 0%, rgba(180, 190, 255, 0.12), transparent 60%); border-color: rgba(216, 224, 245, 0.24); }
.rung--sophiel .rung__sigil { color: #d8e0f5; filter: drop-shadow(0 0 12px rgba(150, 170, 255, 0.45)); }
.rung--sophiel .rung__name { color: #d8e0f5; }
.rung--sophiel .rung__status { color: #d8e0f5; border: 1px solid rgba(216, 224, 245, 0.36); }
/* Somariel (bottom): nigredo earth, lit and live */
.rung--somariel { background: radial-gradient(120% 140% at 18% 0%, rgba(253, 206, 28, 0.16), transparent 60%); border-color: rgba(253, 206, 28, 0.4); }
.rung--somariel .rung__sigil { color: var(--sun-gold); filter: drop-shadow(0 0 14px rgba(253, 206, 28, 0.6)); }
.rung--somariel .rung__name { color: var(--sun-gold); }
.rung__status--live { color: #2a1d00 !important; background: var(--sun-gold); border: 0 !important; }

.path__note { max-width: 50ch; margin: 2.2rem auto 0; text-align: center; color: var(--ink-dim); font-style: italic; font-size: 0.95rem; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) { .gallery { grid-template-columns: repeat(6, 1fr); } }
@media (max-width: 600px) {
  .gallery { grid-template-columns: repeat(4, 1fr); }
  .rung { flex-direction: row; gap: 1rem; }
  .rung__sigil { width: 54px; height: 54px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .hero__plate { transform: none; }
  .hero__torch { background: radial-gradient(circle 560px at 50% 44%, rgba(2, 2, 34, 0) 0%, rgba(2, 2, 34, 0.88) 80%); transition: none; }
  .beacon__ring { animation: none; opacity: 0.6; }
  .glimpse { transition: opacity 0.4s ease; }
  .face { transition: none; }
}
