main {
  --motion-micro: 150ms;
  --motion-fast: 260ms;
  --motion-medium: 560ms;
  --motion-expressive: 820ms;
  --motion-stagger: 100ms;
  --ease-print: cubic-bezier(.2, .7, .15, 1);
  --ease-cut: cubic-bezier(.72, 0, .18, 1);
  --interaction-fast: 160ms;
  --interaction-normal: 260ms;
  --interaction-expressive: 400ms;
  --ambient-cycle: 7s;
  --ambient-rotation: 1.5deg;
  --hover-scale: 1.04;
  --press-scale: .98;
  --ease-interaction: cubic-bezier(.2, .72, .24, 1.12);
}

@property --sticker-drift {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}
@property --sticker-turn {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}

.marquee-track, .marquee-pause { display: none; }

@media (prefers-reduced-motion: no-preference) {
  .motion-ready .show-stamp { animation-timing-function: var(--ease-print); }
  .motion-ready .title-beat {
    display: inline-block;
    transform-origin: 50% 85%;
    animation: type-strike var(--motion-medium) var(--ease-print) backwards;
    animation-delay: calc(var(--beat, 0) * var(--motion-stagger));
  }
  .title-beat:nth-of-type(3) { --beat: 1; }
  .title-beat:nth-of-type(4) { --beat: 2; }
  @keyframes type-strike {
    0% { opacity: 0; translate: 0 .16em; scale: .96 1.09; }
    60% { opacity: 1; translate: 0 -.022em; scale: 1.018 .97; }
    100% { opacity: 1; translate: none; scale: none; }
  }

  .motion-ready .hero-heading + .paper-edge {
    animation: paper-release var(--motion-medium) var(--ease-print) 180ms backwards;
  }
  .motion-ready .hero { position: relative; isolation: isolate; }
  .motion-ready .hero::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    background: var(--cream);
    clip-path: inset(100% 0 0);
    animation: peel-paper var(--motion-medium) var(--ease-cut) 100ms backwards;
  }
  @keyframes peel-paper {
    from { clip-path: polygon(0 0, 25% 0, 50% 0, 75% 0, 100% 0, 100% 100%, 0 100%); }
    to { clip-path: polygon(0 102%, 25% 104%, 50% 101%, 75% 104%, 100% 102%, 100% 106%, 0 106%); }
  }
  .motion-ready .hero-tear {
    animation: tear-open var(--motion-expressive) var(--ease-cut) 130ms backwards;
  }
  @keyframes paper-release {
    from { translate: 0 -8px; }
    65% { translate: 0 2px; }
    to { translate: none; }
  }
  @keyframes tear-open {
    0% { clip-path: polygon(-5% -15%, -5% -15%, -1% 24%, -5% 50%, -1% 76%, -5% 120%, -5% 120%); }
    100% { clip-path: polygon(-5% -15%, 105% -15%, 109% 24%, 105% 50%, 109% 76%, 105% 120%, -5% 120%); }
  }
  .motion-ready .seat-sticker {
    animation: seat-print var(--motion-medium) var(--ease-print) 230ms backwards,
      sticker-drift var(--ambient-cycle) ease-in-out 950ms infinite;
    animation-play-state: running, paused;
  }
  .motion-ready .seat-sticker.motion-visible { animation-play-state: running, running; }
  @keyframes sticker-drift {
    0%, 68%, 100% { --sticker-drift: 0deg; }
    79% { --sticker-drift: var(--ambient-rotation); }
    91% { --sticker-drift: calc(-.65 * var(--ambient-rotation)); }
  }
  @keyframes seat-print {
    0% { opacity: 0; transform: rotate(-5deg) scale(.65); translate: none; }
    67% { opacity: 1; transform: rotate(16deg) scale(1.08); translate: var(--seat-overshoot-inset, 0px); }
    100% { opacity: 1; transform: rotate(12deg) scale(1); translate: none; }
  }

  .hero-figure:nth-child(2), .cast-card:nth-child(2) { --beat: 1; }
  .hero-figure:nth-child(3), .cast-card:nth-child(3) { --beat: 2; }
  .hero-figure:nth-child(4), .cast-card:nth-child(4) { --beat: 3; }
  .cast-card:nth-child(5) { --beat: 4; }
  .hero-cast.is-revealing img {
    animation: stage-entry var(--motion-medium) var(--ease-print) backwards;
    animation-delay: calc(var(--beat, 0) * var(--motion-stagger));
  }
  .hero-cast.is-revealing figcaption {
    animation: name-stamp var(--motion-fast) var(--ease-print) backwards;
    animation-delay: calc(var(--beat, 0) * var(--motion-stagger) + 280ms);
  }
  @keyframes stage-entry {
    from { opacity: 0; translate: 0 9px; }
    to { opacity: 1; translate: none; }
  }
  @keyframes name-stamp {
    0% { opacity: 0; scale: 1.12; rotate: 4deg; }
    67% { opacity: 1; scale: .98; rotate: -1deg; }
    100% { opacity: 1; scale: none; rotate: none; }
  }

  .hero-strip { overflow: clip; }
  .marquee-track, .marquee-group, .marquee-motif { display: flex; align-items: center; width: max-content; }
  .marquee-track {
    position: absolute;
    inset: 0 auto 0 0;
    visibility: hidden;
    white-space: nowrap;
    pointer-events: none;
  }
  .marquee-motif { flex: none; gap: 14px; padding-inline-end: 36px; }
  .marquee-ready .marquee-track {
    visibility: visible;
    animation: register-tape var(--marquee-duration) linear infinite;
  }
  .marquee-ready .marquee-source { opacity: 0; }
  .hero-strip:not(.motion-visible) .marquee-track,
  .marquee-paused .marquee-track { animation-play-state: paused; }
  .marquee-ready .marquee-pause {
    position: absolute;
    inset: 0 0 0 auto;
    display: grid;
    place-items: center;
    width: 44px;
    border: 0;
    background: var(--ink);
    color: var(--cream);
    cursor: pointer;
  }
  .marquee-pause:focus-visible { outline: 2px solid var(--yellow); outline-offset: -4px; }
  @keyframes register-tape { to { transform: translateX(-50%); } }

  .receipt-print.is-revealing {
    animation: print-feed var(--motion-expressive) var(--ease-print) backwards;
  }
  @keyframes print-feed {
    0% { clip-path: inset(-16px -20px calc(100% + 16px) -16px); translate: 0 -5px; }
    85% { clip-path: inset(-16px -20px -20px -16px); translate: 0 2px; }
    100% { clip-path: inset(-16px -20px -20px -16px); translate: none; }
  }
  .is-revealing .receipt-lines > div, .is-revealing .receipt-lines ~ * {
    animation: line-print var(--motion-fast) var(--ease-print) backwards;
    animation-delay: calc(140ms + var(--beat, 0) * var(--motion-stagger));
  }
  .receipt-lines > div:nth-child(2) { --beat: 1; }
  .receipt-lines > div:nth-child(3) { --beat: 2; }
  .receipt-lines > div:nth-child(4) { --beat: 3; }
  .receipt-lines > div:nth-child(5) { --beat: 4; }
  .receipt-lines > div:nth-child(6) { --beat: 5; }
  .receipt-lines > div:nth-child(7) { --beat: 6; }
  .receipt-lines ~ * { --beat: 7; }
  @keyframes line-print {
    from { opacity: 0; translate: -5px 0; }
    to { opacity: 1; translate: none; }
  }

  .cast-card.is-revealing {
    animation: poster-reveal var(--motion-medium) var(--ease-print) backwards;
    animation-delay: calc(var(--beat, 0) * var(--motion-stagger));
  }
  @keyframes poster-reveal {
    from { opacity: 0; translate: 0 9px; scale: .985; }
    to { opacity: 1; translate: none; scale: none; }
  }

  .poster-sticker {
    rotate: calc(var(--poster-angle, 0deg) + var(--sticker-drift, 0deg) + var(--sticker-turn, 0deg));
    transition: scale var(--interaction-normal) var(--ease-interaction),
      translate var(--interaction-normal) var(--ease-interaction),
      --sticker-turn var(--interaction-normal) var(--ease-interaction);
  }
  .cta, .application button[type=button] {
    transition: translate 220ms var(--ease-interaction), scale var(--interaction-fast),
      background-color var(--interaction-fast), color var(--interaction-fast);
  }
  .application :is(input, select, textarea) {
    transition: border-color var(--interaction-fast), background-color var(--interaction-fast),
      box-shadow var(--interaction-fast);
  }
  .cta:not(:disabled):active, .application button[type=button]:enabled:active { translate: 0 2px; scale: var(--press-scale); }
  .cast-social { transition: scale var(--interaction-fast) var(--ease-interaction); }
  .cast-social:active { scale: var(--press-scale); }
  .application > .cta::after { transition: translate 220ms var(--ease-interaction); }
  .application .cta[aria-busy=true]::before {
    content: '';
    width: .85em;
    height: .85em;
    margin-inline-end: .55em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: waiting var(--motion-expressive) linear infinite;
  }
  @keyframes waiting { to { rotate: 360deg; } }
}

@media (max-width: 640px) {
  .seat-sticker { --seat-overshoot-inset: -8px; }
}

.application :is(input, select, textarea):focus { border-color: var(--red-text) !important; }
.application :is(input, select, textarea):disabled { opacity: .65; cursor: wait; }
.application [aria-invalid=true] { background-color: #fff2ee !important; }
.application .application-field :is(input, select, textarea):focus { box-shadow: inset 0 0 0 1px var(--red-text); }
.application > .cta { position: relative; padding-inline: 42px; }
.application > .cta:not([aria-busy=true])::after {
  content: '';
  position: absolute;
  inset-inline-end: 22px;
  inline-size: .5em;
  block-size: .5em;
  border-block-start: 2px solid currentColor;
  border-inline-end: 2px solid currentColor;
  rotate: 45deg;
  pointer-events: none;
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .portrait-media img { transform-origin: center 72%; transition: scale var(--interaction-normal) var(--ease-interaction); }
  .portrait h3 {
    transition: rotate var(--interaction-normal) var(--ease-interaction),
      translate var(--interaction-normal) var(--ease-interaction), box-shadow var(--interaction-normal);
  }
  .cast-card:is(:hover, :focus-within) .portrait-media img { scale: var(--hover-scale); }
  .cast-card:is(:hover, :focus-within) .portrait h3 { rotate: 2deg; translate: 0 -2px; box-shadow: 0 3px 0 #0005; }
  .poster-sticker:not(.ticket-total):hover { --sticker-turn: 2.5deg; scale: var(--hover-scale); }
  .receipt {
    transition: translate var(--interaction-expressive) var(--ease-interaction),
      rotate var(--interaction-expressive) var(--ease-interaction), box-shadow var(--interaction-normal);
  }
  .receipt-print:hover .receipt { translate: 0 -5px; rotate: -.6deg; box-shadow: 8px 13px 0 var(--ink); }
  .cta:not(:disabled):hover:not(:active) { translate: 0 -2px; }
  .application > .cta:enabled:hover::after { translate: 5px 0; }
}

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .audience-sticker {
      animation: paper-drift linear both;
      animation-timeline: view();
      animation-range: entry 0% exit 100%;
    }
    @keyframes paper-drift {
      from { translate: 0 3px; }
      to { translate: 0 -3px; }
    }
  }
}

@media (max-width: 640px) and (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .seat-sticker:hover { translate: -5px; }
}
