/* ==========================================================================
   Scene two — the tech universe.
   A live WebGL room (src/scene2/universe.js): the twelve tech-stack cards,
   the red light-painting and the embers are all drawn in real time and react
   to the pointer. The DOM adds the chapter title, the corner captions and a
   hover label.
   ========================================================================== */

.flow {
  position: relative;
  z-index: 2;
}

/* The hero is position:fixed, so its scroll height has to be reserved here or
   the universe would start at the top of the document and sit on top of it. */
.hero-spacer {
  height: 100svh;
  pointer-events: none;
}

.universe {
  position: relative;
  height: 100svh;
  background: #000;
  overflow: hidden;
  /* hard cut from the hero: two scenes, not a gradient between them */
  box-shadow: 0 -1px 0 0 #000;
}

#uniStage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transition: opacity 1.4s var(--ease-out);
}
.universe.is-on #uniStage { opacity: 1; }

/* the name of the card under the pointer */
.universe__tip {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 3;
  padding: 0.45em 0.8em 0.4em;
  font-family: var(--ui);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #f1e6dc;
  background: rgba(20, 6, 6, 0.72);
  border: 1px solid rgba(222, 27, 28, 0.55);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.universe__tip.is-on { opacity: 1; }

/* the corner captions that used to be part of the film */
.universe__cap {
  position: absolute;
  z-index: 2;
  margin: 0;
  font-family: var(--ui);
  font-size: clamp(8px, 0.68vw, 11px);
  font-weight: 500;
  line-height: 1.75;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(214, 196, 186, 0.42);
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.4s var(--ease-out) 1.6s;
}
.universe.is-on .universe__cap { opacity: 1; }
.universe__cap--l { left: clamp(14px, 2.2vw, 34px); top: 34%; }
.universe__cap--r { right: clamp(14px, 2.2vw, 34px); top: 48%; text-align: right; }
.universe__cap--bl { left: clamp(14px, 2.2vw, 34px); bottom: 8%; color: rgba(222, 60, 50, 0.7); }
.universe__cap--br { right: clamp(14px, 2.2vw, 34px); bottom: 8%; text-align: right; color: rgba(222, 60, 50, 0.7); }
@media (max-width: 760px) {
  .universe__cap--l, .universe__cap--r { display: none; }
}

/* --------------------------------------------------------------------------
   The chapter title, set over the film. Top-centre is the one region the
   footage keeps dark (the ceiling above the figure), so the text lives there
   and clears the Ps and Claude cards that hold the upper corners.
   -------------------------------------------------------------------------- */

.universe__title {
  position: absolute;
  top: clamp(26px, 6.5vh, 66px);
  left: 50%;
  transform: translate(-50%, 14px);
  z-index: 2;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.3s var(--ease-out) 0.75s,
              transform 1.6s var(--ease-out) 0.75s;
}
.universe.is-on .universe__title { opacity: 1; transform: translate(-50%, 0); }

.universe__over {
  margin: 0 0 0.9em;
  font-family: var(--ui);
  font-size: clamp(7.5px, 0.62vw, 9.5px);
  font-weight: 500;
  letter-spacing: 0.5em;
  text-indent: 0.5em;        /* recentre what the tracking pushes right */
  text-transform: uppercase;
  color: #b98a6a;
}
.universe__name {
  margin: 0;
  font-family: 'Bodoni Moda', 'Times New Roman', serif;
  font-weight: 400;
  font-size: clamp(20px, 2.3vw, 36px);
  line-height: 1.22;
  letter-spacing: 0.26em;
  text-indent: 0.26em;
  text-transform: uppercase;
  color: #f2e8dc;
  text-shadow: 0 0 0.6em rgba(0, 0, 0, 0.9), 0 0 2em rgba(0, 0, 0, 0.7);
}
.universe__sub {
  margin: 1.1em 0 0;
  font-family: var(--ui);
  font-size: clamp(7.5px, 0.6vw, 9.5px);
  font-weight: 400;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  text-transform: uppercase;
  color: rgba(222, 200, 180, 0.55);
}

@media (max-width: 760px) {
  .universe__name { letter-spacing: 0.18em; text-indent: 0.18em; }
}

.universe.is-fallback::after {
  content: '';
  position: absolute;
  inset: 0;
  background: #000 url('../../public/media/universe.jpg') center / cover no-repeat;
}

@media (prefers-reduced-motion: reduce) {
  #uniStage, .universe__cap, .universe__title { transition-duration: 0.01ms; transition-delay: 0s; transform: none; }
  .universe.is-on .universe__title { transform: translate(-50%, 0); }
}
