/* ==========================================================================
   Scene two — the creative universe.
   This is the supplied film played AS the section, not a recreation of it:
   the cards, the red light-painting, the embers and every corner label are
   part of the footage. The page's job is to present it cinematically — arrive
   from black, hold the frame, and breathe over the loop seam — and to stay
   out of its way.
   ========================================================================== */

.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;
}

#uniFilm {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* the film is 16:9; any other viewport crops rather than letterboxes,
     keeping the figure centred and the frame full-bleed */
  object-fit: cover;
  object-position: 50% 42%;
  opacity: 0;
  transform: scale(1.045);
  transition: opacity 1.9s var(--ease-out), transform 3.2s var(--ease-out);
}
.universe.is-on #uniFilm {
  opacity: 1;
  transform: scale(1);
}
/* The film's corner labels sit at rows 30 and 1043 of 1080, so a wider window
   would crop them. Past 1920:1037 the film stops growing with the width and
   its sides fade into the section's black instead. */
@media (min-aspect-ratio: 1851/1000) {
  #uniFilm {
    left: calc(50% - 92.55svh);
    width: 185.1svh;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 1%, #000 99%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 1%, #000 99%, transparent);
  }
}

/* --------------------------------------------------------------------------
   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); }
/* the film's ring burns brightest right behind the copy; shade it softly */
.universe__title::before {
  content: '';
  position: absolute;
  inset: -22% -20%;
  z-index: -1;
  background: radial-gradient(closest-side, rgba(8, 3, 2, 0.74), rgba(8, 3, 2, 0.5) 55%, transparent);
}

.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: #e9b48e;
  text-shadow: 0 0 0.8em rgba(0, 0, 0, 0.9);
}
.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(236, 218, 202, 0.82);
  text-shadow: 0 0 0.8em rgba(0, 0, 0, 0.9);
}
.universe__desc {
  width: min(46ch, 86vw);
  margin: 1em auto 0;
  font-family: var(--ui);
  font-size: clamp(10px, 0.8vw, 12.5px);
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0.04em;
  color: rgba(242, 232, 220, 0.92);
  text-shadow: 0 0 0.8em rgba(0, 0, 0, 0.9);
}

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

/* breathes to black across the film's loop point so the cut is never seen,
   and doubles as the entrance veil */
.universe__veil {
  position: absolute;
  inset: 0;
  background: #000;
  opacity: 1;
  pointer-events: none;
  transition: opacity 0.45s ease;
}

.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) {
  #uniFilm, .universe__title { transition-duration: 0.01ms; transition-delay: 0s; transform: none; }
  .universe.is-on .universe__title { transform: translate(-50%, 0); }
}

/* --------------------------------------------------------------------------
   Brands strip — right after the hero. One list in index.html; main.js
   repeats it once so the track can slide exactly half its width and loop
   without a seam. Spacing is padding on each item (not flex gap) so the two
   halves measure the same.
   -------------------------------------------------------------------------- */

.brands {
  position: relative;
  background: #000;
  padding: clamp(26px, 5vh, 54px) 0 clamp(30px, 5.5vh, 60px);
  border-top: 1px solid rgba(237, 237, 237, 0.08);
  box-shadow: 0 -1px 0 0 #000;
}
.brands__title {
  margin: 0 0 clamp(18px, 3.2vh, 32px);
  text-align: center;
  font-family: var(--ui);
  font-size: clamp(9px, 0.72vw, 11px);
  font-weight: 500;
  letter-spacing: 0.5em;
  text-indent: 0.5em;
  text-transform: uppercase;
  color: #e9b48e;
}
.brands__rail {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
}
.brands__track {
  display: flex;
  align-items: center;
  width: max-content;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--ui);
  font-size: clamp(14px, 1.25vw, 20px);
  animation: brandsLoop calc(var(--n, 14) * 3.2s) linear infinite;
}
.brands__rail:hover .brands__track { animation-play-state: paused; }
.brands__track li {
  display: flex;
  align-items: center;
  height: 2.2em;
  padding: 0 clamp(26px, 3.2vw, 54px);
  color: rgba(237, 237, 237, 0.62);
  transition: color 0.3s ease, opacity 0.3s ease;
}
.brands__track li:hover { color: var(--paper); }
.brands__track span {
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  white-space: nowrap;
}
.brands__track img {
  display: block;
  height: var(--h, 1.4em);
  width: auto;
  /* any source colour becomes the site's white, so logos can be dropped in as supplied */
  filter: brightness(0) invert(1);
  opacity: 0.62;
  transition: opacity 0.3s ease;
}
.brands__track li:hover img { opacity: 1; }

@keyframes brandsLoop {
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .brands__rail { overflow-x: auto; }
  .brands__track { animation: none; }
}
