.opening {
  --city: 0;
  --handoff: 0;
  --opening-travel: clamp(850px, 145svh, 1400px);
}
.opening[data-story="motion"] .hero { position: sticky; top: var(--header-height); min-height: 0; }
.opening[data-story="motion"] .hero-inner { min-height: calc(100svh - var(--header-height) - 1px); }
.opening[data-story="motion"]::after { content: ""; display: block; height: var(--opening-travel); }
.opening .hero::before {
  background:
    radial-gradient(ellipse at 75% 50%, #251c36, #15111e 43%, #100e18 74%);
  opacity: 1;
}
.opening .hero::after { opacity: .25; }
.hero-edge {
  position: absolute;
  bottom: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, #b4a0df, #abffe7, transparent);
  opacity: var(--handoff); transform: scaleX(var(--handoff)); pointer-events: none;
}
.chapter-copy, .scene-nav, .relay-photos { display: none; }
.opening[data-story] .chapter-stack { display: grid; align-items: center; min-width: 0; }
.opening[data-story] .chapter-stack > .hero-copy {
  display: block; grid-area: 1 / 1; 
  transform: translate3d(0, var(--copy-y, 0px), 0);
}
.opening[data-story] .hero-copy[inert] { visibility: hidden; pointer-events: none; }
.chapter-copy h2 {
  display: grid; justify-items: start; gap: .05em; color: var(--text);
  font-size: clamp(47px, 6.4vw, 90px); font-weight: 720; line-height: 1.08;
  letter-spacing: -.071em; white-space: nowrap;
}

.chapter-copy h2 strong { color: var(--violet); font-weight: inherit; }
.chapter-copy[data-scene-copy="2"] h2 strong { color: #b7efdf; }
.chapter-copy h2 strong span { margin-left: .055em; color: var(--mint); }

.relay-sculpture { position: absolute; z-index: 2; inset: 0; opacity: calc(1 - var(--city)); }
#ribbon-scene {
  position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%;
  mask-image: linear-gradient(90deg, transparent, black 10% 90%, transparent);
  opacity: 0; transition: opacity .5s ease;
}
#ribbon-scene.is-live { opacity: 1; }
.opening .hero-art {
  mask-image: none; z-index: 1; opacity: calc(1 - var(--city)); transition: opacity .45s ease;
  transform: translateX(calc(-12% * var(--city))) scale(calc(1 + .14 * var(--city)));
}
.opening .hero-picture img {
  width: 100%; height: 100%; object-fit: contain; margin: 0; filter: none; animation: none;
}
.hero-media:has(#ribbon-scene.is-live) .hero-art { opacity: 0; }
.opening #signal-canvas { z-index: 0; opacity: calc(1 - var(--city)); }
.opening .city-marker, .opening .signal-caption { opacity: calc(1 - var(--city)); }
.opening .city-marker { font-weight: 550; }
.opening .marker-toronto { top: 18%; left: 15%; }
.opening .marker-shenzhen { bottom: 20%; right: 8%; }
.opening .signal-caption { z-index: 2; right: 8%; bottom: 8%; }

.opening[data-story] .relay-photos {
  position: absolute; z-index: 4; inset: 12% 8% 13% 15%;
  display: grid; pointer-events: none;
}
.relay-photo {
  grid-area: 1 / 1; position: relative; margin: 0; overflow: hidden; isolation: isolate;
  background: #151521;
  transform: translate3d(var(--photo-x, 0), 0, 0);
  clip-path: inset(50% 0);
}
.relay-photo img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transform: scale(var(--photo-scale, 1)) translateY(var(--photo-y, 0%));
}
.relay-toronto img { object-position: 50% 17%; }
.relay-shenzhen img { object-position: 48% 50%; }
.relay-photo::after {
  position: absolute; inset: 0; content: "";
  box-shadow: inset 0 0 0 1px #f1e3ff33;
  background: linear-gradient(0deg, #101020ed, #1010205c 26%, transparent 54%);
}
.relay-photo figcaption {
  position: absolute; z-index: 1; left: 6%; right: 6%; bottom: 6%; color: #fff9fa;
  opacity: var(--caption, 0); transform: translateY(calc(16px * (1 - var(--caption, 0))));
}
.relay-photo figcaption b {
  display: block; font: italic 500 clamp(38px, 5.6vw, 90px)/1 Georgia, "Songti SC", serif;
  letter-spacing: -.065em;
}
.relay-photo figcaption span { display: block; margin-top: 9px; font-size: 12px; letter-spacing: .05em; }

.opening[data-story] .scene-nav {
  position: absolute; z-index: 5; inset: auto 0 21px; display: flex; align-items: center;
  gap: 10px;
}
.scene-nav button {
  position: relative; display: flex; align-items: center; width: clamp(78px, 8vw, 115px);
  min-height: 42px; padding: 3px 0 0; border: 0; background: transparent;
  color: #b6abc8; font-size: 12px; font-weight: 580; text-align: start;
}
.scene-nav button::before, .scene-nav button::after {
  content: ""; position: absolute; inset: 0 0 auto; height: 1px; background: #e0d3fa38;
}
.scene-nav button::after { background: var(--mint); transform: scaleX(var(--segment, 0)); transform-origin: left; }
.scene-nav button[aria-current], .scene-nav button:hover { color: #f8f2ff; }
.scene-scrolldown { display: flex; align-items: center; gap: 10px; margin-left: 12px; color: #b6a9c7; font-size: 11px; }
.scene-scrolldown::before {
  content: ""; width: 1px; height: 18px; background: linear-gradient(transparent, var(--mint));
  transform-origin: bottom;
}
.opening[data-story="static"] .scene-scrolldown { display: none; }

@media (prefers-reduced-motion: no-preference) {
  .relay-sculpture { animation: relay-expose 1.2s cubic-bezier(.16,.75,.22,1) backwards; }
  .opening .hero-picture { animation: none; }
  .opening[data-story] h1 { animation: none; }
  .opening[data-story] h1 > * { animation: title-arrive .88s cubic-bezier(.16,.82,.19,1) backwards; }
  .opening[data-story] h1 > :nth-child(2) { animation-delay: .07s; }
  .opening[data-story] h1 > :nth-child(3) { animation-delay: .14s; }
  .chapter-copy:not([inert]) h2 > * { animation: title-arrive .58s cubic-bezier(.16,.82,.19,1) backwards; }
  .chapter-copy:not([inert]) h2 strong { animation-delay: .055s; }
  .chapter-copy:not([inert]) .hero-description { animation: city-copy .55s ease-out backwards; }
  .scene-scrolldown::before { animation: scroll-cue 2.2s ease-in-out 3; }
}
@keyframes relay-expose {
  from {
    clip-path: polygon(0 63%, 100% 35%, 100% 35.4%, 0 63.4%);
    transform: scale(1.12) rotate(-3deg);
  }
  to { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); transform: none; }
}
@keyframes city-copy { from { opacity: .25; translate: 0 8px; } }
@keyframes title-arrive {
  from { clip-path: inset(101% -8% -10%); transform: translateY(.32em) skewY(3deg); }
  to { clip-path: inset(-10% -8% -10%); transform: none; }
}
@keyframes scroll-cue { 0%,100% { transform: scaleY(.45); opacity: .45; } 55% { transform: scaleY(1); opacity: 1; } }

@media (min-width: 821px) {
  .opening .hero-media { width: min(73%, 930px); right: -5%; height: min(100%, 820px); }
  .opening[data-story] .hero-copy { padding: clamp(35px, 6svh, 68px) 0 clamp(85px, 12svh, 125px); }
}
@media (min-width: 821px) and (max-height: 780px) {
  .opening[data-story] .hero-copy { padding-block: 20px 75px; }
  .opening[data-story] :is(h1, .chapter-copy h2) { font-size: clamp(44px, min(6.25vw, 11.1svh), 84px); }
  .opening .location-tag { margin-bottom: 21px; }
  .opening .hero-description { margin-top: 20px; }
  .opening .hero-actions { margin-top: 22px; }
  .opening[data-story] .scene-nav { bottom: 11px; }
}
@media (max-width: 820px) {
  .opening { --opening-travel: clamp(680px, 107svh, 950px); }
  .opening[data-story="motion"] .hero-inner {
    display: grid; grid-template-rows: auto minmax(186px, 1fr) auto; align-items: stretch;
  }
  .opening[data-story] .hero-copy { padding: clamp(23px, 4.2svh, 42px) 0 0; }
  .opening .chapter-copy h2 { font-size: clamp(42px, 10.9vw, 74px); }
  .opening .hero-media { height: clamp(230px, 39svh, 400px); margin-top: 0; }
  .opening[data-story="motion"] .hero-media { height: 100%; min-height: 0; }
  .opening[data-story] .scene-nav { position: relative; inset: auto; padding-bottom: max(7px, env(safe-area-inset-bottom)); }
  .opening[data-story] .relay-photos { inset: 4% 7% 6%; }
  .opening .marker-toronto { left: 8%; top: 13%; }
  .opening .marker-shenzhen { bottom: 17%; right: 5%; }
  .opening .signal-caption { bottom: 5%; right: 7%; }
  .scene-scrolldown { margin-left: auto; }
}
@media (max-width: 540px) {
  .opening .location-tag { margin-bottom: 15px; }
  .opening .hero-description { margin-top: 15px; }
  .opening .hero-actions { margin-top: 18px; }
  .opening .hero h1 { font-size: clamp(39px, 11.1vw, 57px); }
  .opening .hero-media { height: clamp(220px, 36svh, 340px); }
  .scene-nav button { width: min(22%, 78px); }
  .relay-photo figcaption span { font-size: 11px; }
}
@media (max-width: 365px) {
  .scene-scrolldown { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .opening *, .opening *::after { transition: none; }
}

.opening .marker-toronto { top: 14%; }
@media (max-width: 820px) { .opening .marker-toronto { top: 10%; } }
