/* The title cue starts at first paint. State changes cancel all its layers. */
[data-final-invitation] .orbit-entrance {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 1; opacity: .55;
  mask-image: linear-gradient(90deg,transparent 18%,#0006 48%,#000);
}
[data-final-invitation] .stage[data-state="sealed"] .wait-layout { z-index: 2; }
[data-final-invitation] .stage { --ident-duration: 2200ms; }
.studio-ident { display: none; }
[data-state="sealed"] .studio-ident {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: block;
  overflow: hidden;
  pointer-events: none;
  isolation: isolate;
  background: #0b1514;
  animation: opening-ident-out 420ms var(--ident-duration) ease-in both;
}
.ident-table {
  position: absolute;
  inset: -3%;
  overflow: hidden;
  background:
    url("media/ident-baize.avif") center / 224px 224px repeat,
    radial-gradient(ellipse at 46% 47%, #485a47 0%, #2a4138 25%, #192e29 49%, #0a1515 82%);
  background-blend-mode: soft-light, normal;
  transform-origin: 50% 54%;
  animation: opening-ident-camera var(--ident-duration) cubic-bezier(.16,.65,.26,1) both;
}
.ident-table::before {
  content: "";
  position: absolute;
  inset: -2%;
  background: var(--casino) center 20% / cover;
  filter: blur(14px);
  opacity: .5;
  mask-image: linear-gradient(#0008, transparent 32%);
}
.table-rail {
  position: absolute;
  left: -57%;
  top: 52%;
  width: 170%;
  height: 72%;
  border: 2px solid #c4aa7775;
  border-radius: 50%;
  outline: 1px solid #c4aa774a;
  outline-offset: 6px;
  transform: rotate(-14deg);
  mask-image: linear-gradient(100deg, transparent 15%, #0009 52%, #0007 75%, transparent);
}
.ident-prop {
  --ident-chip-size: 100%;
  position: absolute;
  left: 50%;
  top: 47%;
  width: clamp(156px,min(56vw,52dvh),420px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
}
.ident-roll {
  position: absolute;
  inset: 0;
  animation: opening-ident-roll var(--ident-duration) both;
}
.ident-shadow {
  position: absolute;
  top: 65.7%;
  left: 52%;
  width: 88%;
  height: 65%;
  border-radius: 50%;
  background: radial-gradient(ellipse, #090806ce 0%, #070a09a8 27%, #06100f44 54%, transparent 72%);
  animation: opening-ident-contact var(--ident-duration) ease-out both;
}
.studio-ident .ident-chip { position: absolute; inset: 0; display: block; }
@keyframes opening-ident-roll {
  0% { transform: translate(81%, -10%) scale(.78); animation-timing-function: cubic-bezier(.24,.48,.4,1); }
  58% { transform: translate(-3%, 1%) scale(.99); animation-timing-function: ease-out; }
  82%, 100% { transform: translate(0, 0) scale(1); }
}
@keyframes opening-ident-contact {
  from { transform: translate(-45%,-42%) scale(.48,.25); }
  55% { transform: translate(-49%,-41%) scale(.64,.42); }
  83%, to { transform: translate(-50%,-44%) scale(1.07,1.05); }
}
@keyframes opening-ident-camera {
  from { transform: scale(1.025) translateX(1.4%); }
  to { transform: scale(1.08) translateX(-.7%); }
}
@keyframes opening-ident-out {
  from { visibility: visible; opacity: 1; }
  to { visibility: hidden; opacity: 0; }
}
html[data-ident="loading"] .stage[data-state="sealed"] :is(.opening-credits,.opening-band,.studio-ident,.studio-ident *,.inv-title,.venue-strip,.letter-trigger),
html[data-ident="loading"] .opening-credits::before { animation-play-state: paused; }
html[data-ident="loading"] .studio-ident .ident-chip {
  background: url("media/ident-poster.avif") center / contain no-repeat;
  animation: none;
}
html[data-ident="unavailable"] .stage { --ident-duration: 0ms; }
html[data-ident="unavailable"] .stage .studio-ident { display: none; }
.opening-credits { display: none; }
[data-state="sealed"] .opening-credits {
  position: absolute; inset: 0; z-index: 4;
  display: grid; align-content: center; gap: clamp(4px,.7vh,9px);
  isolation: isolate; overflow: hidden; pointer-events: none;
  animation: opening-clear 2.4s var(--ident-duration) step-end both;
}
.opening-credits::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(115deg,#100c0eff,#140b0ef5 60%,#140c0dc9);
  animation: opening-house-light 2.35s var(--ident-duration) both;
}
.opening-band {
  --from: 101%; --to: -101%; --entry: 0ms;
  position: relative; display: flex; align-items: center;
  isolation: isolate; overflow: hidden;
  height: clamp(86px,24svh,250px); padding-inline: 8%;
  background-color: #772332; color: #f3e4cd;
  box-shadow: inset 0 1px #ffe3b44d,inset 0 -1px #160e1070;
  font-size: clamp(65px,min(12vw,19svh),200px);
  line-height: .88; letter-spacing: -.025em;
  animation: opening-band-slide 2s calc(var(--ident-duration) + var(--entry)) both;
}
.opening-band::before {
  content: ""; position: absolute; z-index: -1; inset: 0 0 0 37%;
  background: url("media/casino.avif") 86% 42% / 140% auto;
  filter: grayscale(1) contrast(1.3); mix-blend-mode: luminosity; opacity: .62;
  mask-image: linear-gradient(105deg,transparent,#0009 27%,#000 77%);
}
.opening-band:nth-child(2) {
  --from: -101%; --to: 101%; --entry: 185ms;
  justify-content: flex-end; color: #e9c790; background-color: #20161b;
}
.opening-band:nth-child(2)::before {
  inset: 0 40% 0 0; background-image: url("media/cards.avif"); background-position: 25% 58%;
  mask-image: linear-gradient(90deg,#000,#0009 50%,transparent);
}
.opening-band:nth-child(3) {
  --entry: 370ms; background-color: #c59b62; color: #241717;
}
.opening-band:nth-child(3)::before {
  inset-inline-start: 52%; background-image: url("media/chips.avif"); background-position: 75% 58%; opacity: .40;
}
.opening-band span { position: relative; white-space: nowrap; }
@keyframes opening-band-slide {
  0% { transform: translateX(var(--from)); animation-timing-function: cubic-bezier(.15,.72,.2,1); }
  28%, 79% { transform: none; animation-timing-function: cubic-bezier(.62,.01,.78,.24); }
  100% { transform: translateX(var(--to)); }
}
@keyframes opening-house-light { 0% {opacity:0} 18%,62% {opacity:1} 100% {opacity:0} }
@keyframes opening-clear { from {visibility:visible} to {visibility:hidden} }

[data-final-invitation] [data-state="sealed"] .inv-title {
  animation: opening-title .78s calc(var(--ident-duration) + 1.87s) cubic-bezier(.17,.7,.23,1) both;
}
[data-final-invitation] [data-state="sealed"] .venue-strip {
  animation: opening-caption .55s calc(var(--ident-duration) + 2.15s) ease-out both;
}
[data-final-invitation] [data-state="sealed"] .letter-trigger {
  animation: opening-delivery .94s calc(var(--ident-duration) + 2.37s) cubic-bezier(.17,.69,.22,1) both;
}
@keyframes opening-title {
  from {opacity:0;transform:translateY(16px)} to {opacity:1;transform:none}
}
@keyframes opening-caption { from {opacity:0} to {opacity:1} }
@keyframes opening-delivery {
  /* The dealer slides the letter toward the guest within its resting bounds. */
  0% {opacity:0;pointer-events:none;transform:translate3d(-2%,-2%,0) rotate(-4deg) scale(.82)}
  23% {pointer-events:auto}
  70% {opacity:1}
  100% {opacity:1;pointer-events:auto;transform:none}
}
/* Keyboard navigation can go straight to the seal during the credits. */
[data-final-invitation] .stage:has(.letter-trigger:focus-visible) :is(.opening-credits,.studio-ident) { display: none; }
[data-final-invitation] .stage:has(.letter-trigger:focus-visible) :is(.letter-trigger,.inv-title,.venue-strip) { animation: none; }
@media (max-width:760px) {
  [data-final-invitation] .orbit-entrance {opacity:.4;mask-image:linear-gradient(180deg,transparent 12%,#0006 48%,#000)}
  .opening-band {height:clamp(90px,18svh,150px);padding-inline:7%;font-size:clamp(55px,17vw,105px)}
}
@media (prefers-reduced-motion:reduce) {
  [data-final-invitation] :is(.opening-credits,.orbit-entrance,.studio-ident) {display:none}
  [data-final-invitation] [data-state="sealed"] :is(.letter-trigger,.inv-title,.venue-strip) {animation:none}
}
