.intro-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  background: radial-gradient(ellipse at 50% 44%, #262c1e, #171a14 39%, #10110f 77%);
  color: var(--ink);
  visibility: hidden;
  pointer-events: none;
}

.intro-screen.is-playing {
  visibility: visible;
  animation: intro-open 1650ms cubic-bezier(.75, 0, .2, 1) both;
}

.intro-grid {
  position: absolute;
  z-index: -1;
  inset: 0;
  background-image:
    linear-gradient(90deg, #dfff8812 1px, transparent 1px),
    linear-gradient(#dfff8812 1px, transparent 1px);
  background-position: center;
  background-size: clamp(24px, 4vw, 48px) clamp(24px, 4vw, 48px);
  mask-image: radial-gradient(ellipse at center, #000 4%, transparent 72%);
}

.intro-lockup {
  display: grid;
  justify-items: center;
  gap: .8rem;
  max-width: calc(100% - 2.5rem);
  text-align: center;
}

.intro-mark {
  display: block;
  width: clamp(86px, 15vmin, 144px);
  margin-bottom: clamp(.1rem, 1.2vmin, .7rem);
  filter: drop-shadow(0 14px 34px #bde66b26);
}

.intro-mark img {
  width: 100%;
  height: auto;
}

.intro-wordmark {
  display: block;
  font-family: var(--sans);
  font-size: clamp(1.9rem, 6.8vw, 5.3rem);
  font-weight: 800;
  letter-spacing: -.072em;
  line-height: 1.12;
}

.intro-wordmark span:last-child {
  color: var(--accent);
}

.intro-label {
  color: #c2c5b7;
  font: 500 clamp(.58rem, 1.7vw, .73rem)/1.42 var(--mono);
  letter-spacing: .17em;
}

.intro-track {
  position: absolute;
  inset: auto 0 clamp(1.75rem, 7vh, 4rem);
  width: min(9rem, 36vw);
  height: 1px;
  margin-inline: auto;
  background: #404735;
}

.intro-track::after {
  content: '';
  display: block;
  height: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
}

.intro-screen.is-playing .intro-grid {
  animation: intro-grid-in 900ms ease-out both;
}

.intro-screen.is-playing .intro-mark {
  animation: intro-mark-in 540ms cubic-bezier(.18, .71, .28, 1) 70ms both;
}

.intro-screen.is-playing .intro-wordmark {
  animation: intro-wordmark-in 510ms cubic-bezier(.2, .75, .26, 1) 275ms both;
}

.intro-screen.is-playing .intro-label {
  animation: intro-label-in 360ms ease-out 505ms both;
}

.intro-screen.is-playing .intro-track::after {
  animation: intro-fill 930ms cubic-bezier(.28, .7, .38, 1) 110ms both;
}

@keyframes intro-grid-in {
  from { opacity: 0; transform: scale(1.12); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes intro-mark-in {
  from {
    opacity: 0;
    clip-path: polygon(0 0, 0 0, 0 100%, 0 100%);
    transform: translate(-16px, 11px) scale(.91);
  }
  to {
    opacity: 1;
    clip-path: polygon(0 0, 132% 0, 100% 100%, 0 100%);
    transform: translate(0, 0) scale(1);
  }
}

@keyframes intro-wordmark-in {
  from { opacity: 0; clip-path: inset(0 0 100%); transform: translateY(10px); }
  to { opacity: 1; clip-path: inset(0 0 -10%); transform: translateY(0); }
}

@keyframes intro-label-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes intro-fill {
  to { transform: scaleX(1); }
}

@keyframes intro-open {
  0%, 67% { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
  100% { clip-path: polygon(0 0, 100% 0, 100% -12%, 0 0); }
}

[data-progress] {
  position: fixed;
  z-index: 90;
  inset: 0 0 auto;
  height: 2px;
  background: #dfff88;
  pointer-events: none;
  transform: scaleX(var(--reading-progress, 0));
  transform-origin: left;
}

[data-enter]:is(.enters, .enters-after-intro) {
  animation: enter-content 620ms cubic-bezier(.2, .72, .28, 1) both;
  animation-delay: calc(var(--intro-offset, 0ms) + var(--enter-index, 0) * 65ms);
}

[data-enter].enters-after-intro {
  --intro-offset: 1120ms;
}

@keyframes enter-content {
  from { opacity: 0; transform: translateY(13px); }
  to { opacity: 1; transform: translateY(0); }
}

[data-reveal].is-revealed {
  animation: reveal-content 560ms cubic-bezier(.2, .75, .25, 1);
}

@keyframes reveal-content {
  from { opacity: .6; translate: 0 14px; }
  to { opacity: 1; translate: 0 0; }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  [data-stage] {
    transform: perspective(1200px) rotateX(var(--stage-tilt-x, 0deg)) rotateY(var(--stage-tilt-y, 0deg));
    transition: transform 210ms ease-out;
  }
}

@media (prefers-reduced-motion: reduce) {
  .intro-screen, [data-progress], [data-replay-intro] { display: none; }
  [data-enter]:is(.enters, .enters-after-intro), [data-reveal].is-revealed { animation: none; }
}
