/* ============ opening — the line opens (between Experience and "06 In the open") ============
   The stage is one opaque WebGL canvas (js/gl/opening-gl.js), pinned while two dark slabs part on
   a paper world. It ends on exact paper, and the act rises over that last stretch, so the
   hand-off has no seam. Before JS takes over (or if the module never loads) the section is a
   short dark-to-paper divider, which is also what reduced motion keeps. */

.opening {
  position: relative;
  z-index: 1;
}

/* the divider: dark eases into paper along a curve, not a straight (muddy) ramp */
.opening__stage {
  position: relative;
  height: 38vh;
  overflow: hidden;
  background: linear-gradient(
    to bottom,
    #0a0a0b 0%,
    #0d0d0e 22%,
    #1d1c1b 38%,
    #4b4946 52%,
    #8d8a85 64%,
    #c4c0b9 76%,
    #e2ded7 88%,
    #ece8e1 100%
  );
}
.opening__gl,
.opening__kicker { display: none; }

/* ---------- live: a full-screen pinned stage ---------- */
.opening.is-live .opening__stage {
  height: 100vh;
  height: 100lvh;
  background: #0a0a0b;
  contain: layout paint;
}
.opening.is-live .opening__gl {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
/* the last frame is paper; once there, the canvas steps aside and the stage itself is the paper */
.opening.is-live.is-done .opening__stage { background: #ece8e1; }
.opening.is-live.is-done .opening__gl { visibility: hidden; }

/* a title card printed across the seam: one half on each door, parting as they do */
.opening.is-live .opening__kicker {
  --part: 0vw;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 2.6rem;
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: clamp(1.75rem, 6.5vh, 4rem);
  margin: 0;
  white-space: nowrap;
  color: rgba(236, 232, 225, 0.5);
  pointer-events: none;
}
.opening__kicker span:first-child { text-align: right; transform: translate3d(calc(var(--part) * -1), 0, 0); }
.opening__kicker span:last-child { text-align: left; transform: translate3d(var(--part), 0, 0); }

/* the act rises over the last of the stage: both are paper there, so the seam is invisible */
.opening.is-live + .act { margin-top: -62lvh; }
@media (max-width: 799px) {
  .opening.is-live + .act { margin-top: -46lvh; }
  .opening.is-live .opening__kicker { font-size: 0.66rem; }
}

/* ---------- no WebGL2: CSS doors slide apart over a paper glow ---------- */
.opening__css,
.opening__css > i {
  position: absolute;
  inset: 0;
  display: block;
}
.opening__glow {
  background:
    radial-gradient(60% 45% at 50% 50%, #fffdf8 0%, rgba(255, 253, 248, 0) 70%),
    #ece8e1;
  opacity: 0.35;
}
.opening__door {
  width: 50%;
  background: #0a0a0b;
  will-change: transform;
}
.opening__css > .opening__door--l { right: auto; box-shadow: inset -1px 0 0 rgba(255, 236, 214, 0.5); }
.opening__css > .opening__door--r { left: auto; box-shadow: inset 1px 0 0 rgba(255, 236, 214, 0.5); }
.opening__css > .opening__seam {
  left: 50%;
  right: auto;
  width: 2px;
  margin-left: -1px;
  background: #fffaf2;
  box-shadow: 0 0 18px 4px rgba(255, 214, 170, 0.55), 0 0 80px 16px rgba(255, 190, 140, 0.18);
  opacity: 0;
}

/* ---------- reduced motion: the divider, no pin, no canvas ---------- */
html.is-reduced .opening .opening__gl,
html.is-reduced .opening .opening__kicker,
.opening.is-still .opening__gl,
.opening.is-still .opening__kicker { display: none; }
