.extension-frame {
  position: relative;
}

.intro-line {
  display: inline-block;
}

.chapter-sweep {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(
    144deg,
    transparent 24%,
    rgba(var(--accent-rgb), 0.58) 49%,
    #ffffffb0 51%,
    transparent 65%
  );
}

@media (prefers-reduced-motion: no-preference) {
  .has-intro {
    --intro-lead: 1900ms;
  }
  .has-intro .extension-frame {
    transform-origin: center bottom;
    animation: extension-drop 760ms calc(var(--intro-lead) + 80ms) backwards;
  }
  .has-intro :is(.extension-bar, .extension-content, .extension-controls) {
    animation: interface-reveal 470ms calc(var(--intro-lead) + 775ms) cubic-bezier(.16, 1, .3, 1) backwards;
  }
  .has-intro .start-actions [data-reveal] {
    animation: interface-reveal 320ms calc(var(--intro-lead) + 895ms + var(--card-delay, 0ms)) cubic-bezier(.16, 1, .3, 1) backwards;
  }
  .start-actions [data-reveal]:nth-child(2) { --card-delay: 84ms; }
  .start-actions [data-reveal]:nth-child(3) { --card-delay: 168ms; }
  .start-actions [data-reveal]:nth-child(4) { --card-delay: 252ms; }
  .has-intro :is(.site-nav, .beta-link, .stage-footer, .chapter-note, .start-link) {
    animation: interface-reveal 430ms calc(var(--intro-lead) + 1060ms) cubic-bezier(.16, 1, .3, 1) backwards;
  }
  .has-intro .chapter-kicker {
    animation: type-reveal 420ms calc(var(--intro-lead) + 745ms) cubic-bezier(.16, 1, .3, 1) backwards;
  }
  .has-intro .intro-line {
    animation: type-reveal 590ms calc(var(--intro-lead) + 855ms) cubic-bezier(.16, 1, .3, 1) backwards;
  }
  .has-intro .chapter-message h1 em {
    animation: type-reveal 570ms calc(var(--intro-lead) + 990ms) cubic-bezier(.16, 1, .3, 1) backwards;
  }
}

@keyframes extension-drop {
  0% {
    opacity: 0;
    transform: translateY(-75vh) scale(.91) rotate(-3deg);
    animation-timing-function: cubic-bezier(.52, .04, .8, .53);
  }
  20% {
    opacity: 1;
  }
  67% {
    opacity: 1;
    transform: translateY(7px) scale(1.024, .965);
    animation-timing-function: cubic-bezier(.21, .68, .32, 1);
  }
  85% {
    transform: translateY(-11px) scale(.997, 1.016);
    animation-timing-function: cubic-bezier(.23, .88, .34, 1);
  }
  100% {
    transform: none;
  }
}

@keyframes type-reveal {
  from {
    opacity: 0;
    clip-path: inset(0 0 100% 0);
    transform: translateY(26px) skewY(4deg);
  }
  to {
    opacity: 1;
    clip-path: inset(-18% -10% -18% -10%);
    transform: none;
  }
}

@keyframes interface-reveal {
  from {
    opacity: 0;
    transform: translateY(9px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
