/* A continuous opening scene, following the native page scroll. */
.opening-story {
  --scene-height: max(540px,100svh);
  --scene-veil: 0;
  --scene-blur: 0px;
  --scene-zoom: 1;
  --hero-opacity: 1;
  --hero-lift: 0px;
  --hero-blur: 0px;
  --film-scale: 1;
  --explanation-opacity: 1;
  --explanation-lift: 0px;
  position: relative;
  isolation: isolate;
  background: var(--paper);
}
.opening-story__backdrop {
  position: sticky;
  top: 0;
  z-index: -1;
  width: 100%;
  height: var(--scene-height);
  margin-bottom: calc(var(--scene-height) * -1);
  overflow: hidden;
  isolation: isolate;
  background: var(--ink);
}
.opening-story__backdrop .hero__video {
  transform: scale(var(--scene-zoom));
  filter: blur(var(--scene-blur));
}
.opening-story__veil {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: var(--scene-veil);
  background: var(--paper);
}
.hero { height: var(--scene-height); min-height: 0; isolation: auto; }
.hero__aside, .hero__title, .hero__controls {
  opacity: var(--hero-opacity);
  transform: translateY(var(--hero-lift));
  filter: blur(var(--hero-blur));
}
.header { position: fixed; z-index: 20; transition: color .5s var(--ease); }
.header__links { display: flex; }
.header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg,rgba(243,241,234,.98),rgba(243,241,234,.87) 65%,rgba(243,241,234,0));
  opacity: 0;
  transition: opacity .5s var(--ease);
}
.brand img { transition: opacity .5s var(--ease); }
.brand .brand__ink { position: absolute; inset: 0; opacity: 0; }
.header--light { color: var(--ink); }
.header--light::before { opacity: 1; }
.header--light .brand__white { opacity: 0; }
.header--light .brand__ink { opacity: 1; }

.explanation {
  position: relative;
  height: 100svh;
  color: var(--ink);
  background: var(--paper);
  padding: 104px var(--edge) 24px;
  scroll-margin-top: 0;
}
.has-flow .explanation { background: linear-gradient(180deg,rgba(243,241,234,0),rgba(243,241,234,.94) 150px,var(--paper) 280px); }
.explanation__layout {
  display: grid;
  grid-template-columns: minmax(0,1fr);
  grid-template-rows: auto minmax(0,1fr) auto;
  gap: clamp(18px,2.3svh,24px);
  align-items: stretch;
  width: 100%;
  max-width: 1240px;
  height: 100%;
  margin: 0 auto;
  padding: 0;
}
.has-flow .explanation__layout {
  opacity: var(--explanation-opacity);
  transform: translateY(var(--explanation-lift));
  transition: opacity .25s ease-out,transform .4s var(--ease);
}
.explanation__headings, .explanation__details {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  column-gap: clamp(28px,4vw,65px);
  align-items: start;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}
.explanation h2 { font-size: min(clamp(24px,2.1vw,36px),calc((100vw - var(--edge) * 2 - clamp(28px,4vw,65px)) / 31),33px); line-height: 1.15; }
.explanation__nowrap { white-space: nowrap; }
.explanation__text { max-width: 49ch; margin: 0; font-size: clamp(14px,1vw,16px); line-height: 1.7; color: rgba(21,32,23,.78); }
.explanation__text strong { font-weight: 500; color: var(--ink); }
.demonstration {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-width: 1240px;
  margin: 0 auto;
}
.demonstration__frame {
  flex: none;
  width: min(100%,var(--player-width,calc((100svh - 500px) * 1.7777778)));
  height: auto;
  transform: scale(var(--film-scale));
  transform-origin: center;
  box-shadow: 0 16px 48px rgba(21,32,23,.12);
}
.demonstration__footer { display: flex; justify-content: flex-end; flex: none; width: min(100%,max(280px,var(--player-width,calc((100svh - 500px) * 1.7777778)))); }
.demonstration__channel { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; padding: 4px 0; border-bottom: 1px solid rgba(21,32,23,.25); color: var(--ink); transition: opacity .3s var(--ease); }
.demonstration__channel:hover { opacity: .6; }
.demonstration__channel-play { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border: 1px solid rgba(21,32,23,.35); border-radius: 50%; }
.demonstration__channel-play svg { width: 12px; height: 12px; fill: currentColor; }
.demonstration__channel-copy { display: flex; flex-direction: column; gap: 2px; }
.demonstration__channel-title { font-size: 11px; line-height: 1.5; letter-spacing: .035em; text-transform: uppercase; }
.demonstration__channel-note { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 10px; line-height: 1.5; color: rgba(21,32,23,.6); }
.video-service-logo { display: inline-block; flex: none; width: auto; height: 14px; object-fit: contain; vertical-align: middle; }
.demonstration__error {
  position: absolute;
  inset: auto 0 0;
  margin: 0;
  padding: 6px 10px;
  background: var(--paper);
  color: var(--ink);
}
.models { background: var(--paper); scroll-margin-top: 94px; }

.has-reveal .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .9s var(--ease),transform 1.1s var(--ease);
}
.has-reveal .reveal.is-visible { opacity: 1; transform: translateY(0); }
@media (min-width: 761px) and (max-height: 650px) {
  .opening-story { --scene-height: max(430px,100svh); }
  .explanation { height: auto; min-height: 100svh; padding-top: 94px; }
  .explanation__layout { grid-template-rows: auto auto auto; height: auto; }
  .demonstration { height: auto; }
  .demonstration__frame { width: min(100%,calc(46svh * 1.7777778)); }
  .demonstration__footer { width: min(100%,max(280px,calc(46svh * 1.7777778))); }
}
@media (max-width: 760px) {
  .header { height: 88px; }
  .header__left { gap: 14px; height: 74px; align-self: flex-start; }
  .header__links { position: absolute; left: calc(var(--edge) + 51px); top: 63px; }
  .brand { left: auto; right: var(--edge); transform: none; }
  .explanation { height: auto; min-height: 100svh; padding-top: 94px; padding-bottom: 30px; }
  .explanation__layout { grid-template-rows: auto auto auto; gap: 22px; height: auto; }
  .explanation__headings, .explanation__details { grid-template-columns: minmax(0,1fr); row-gap: 20px; }
  .explanation h2 { font-size: min(clamp(22px,5.4vw,30px),calc((100vw - var(--edge) * 2 - 16px) / 15.5)); }
  .explanation__text { max-width: none; font-size: 14px; line-height: 1.65; }
  .demonstration { height: auto; }
  .demonstration__frame { width: 100%; }
  .demonstration__footer { justify-content: flex-start; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .opening-story__backdrop { position: absolute; margin-bottom: 0; }
  .hero__aside, .hero__title, .hero__controls, .opening-story__backdrop .hero__video, .demonstration__frame { transform: none; filter: none; }
  .has-reveal .reveal { opacity: 1; transform: none; transition: none; }
  .header, .header::before, .brand img { transition: none; }
}
