/* The waiting word and ENTER share the same center and the same sweep width. */
#intro-entry-slot {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(420px, calc(100% - 32px));
  height: 84px;
  z-index: 999991;
}
.intro-readout {
  position: absolute;
  inset: 0;
  margin: auto;
  width: max-content;
  height: max-content;
  color: #00ff00;
  font: 400 56px/1.2 'Coral Pixels', monospace;
  letter-spacing: 8px;
  white-space: nowrap;
  --beam-duration: 610ms;
  --beam-easing: cubic-bezier(.33, 0, .67, 1);
}
#intro-loading, .intro-ray {
  display: grid;
  place-items: center;
  pointer-events: none;
}
#intro-loading { visibility: hidden; }
html.intro-font-ready #intro-loading { visibility: visible; }
#intro-loading-label, .intro-scan { grid-area: 1 / 1; }
.intro-scan {
  filter: grayscale(.64) brightness(2.6);
  mask-image: linear-gradient(100deg, transparent 35%, #0005 43%, black 49%, #000c 53%, transparent 65%);
  mask-size: 260% 100%;
  mask-repeat: no-repeat;
  animation: intro-readout-scan 2.55s cubic-bezier(.36,.02,.24,1) infinite;
}
@keyframes intro-readout-scan { 0%,11% { mask-position: 110% 0; } 77%,100% { mask-position: -10% 0; } }
#loading-overlay[aria-busy="false"] .intro-scan { display: none; }
.intro-enter-track, .intro-ray { position: absolute; inset: 0; pointer-events: none; }
.intro-enter-track { container-type: inline-size; }
.intro-ray { opacity: 0; z-index: 999992; filter: grayscale(.65) brightness(2.1); }
#enter-text {
  font: inherit;
  letter-spacing: inherit;
  width: max-content;
  border: 0;
  padding: 0;
}
#enter-text:disabled { opacity: 0; pointer-events: none; }
#enter-text:enabled { pointer-events: auto; }
#enter-text:focus-visible { outline: 1px solid #00ff0080; outline-offset: 10px; }
.intro-enter-face { display: block; }
html.intro-ready #intro-loading {
  visibility: hidden;
  animation: intro-erase-word var(--beam-duration) var(--beam-easing);
}
html.intro-ready .intro-enter-face {
  animation: intro-reveal-word var(--beam-duration) var(--beam-easing);
}
html.intro-ready .intro-ray {
  animation: intro-beam-tip var(--beam-duration) var(--beam-easing);
}
@keyframes intro-erase-word {
  from { visibility: visible; clip-path: inset(-.15em 0 -.15em 0); }
  to   { visibility: visible; clip-path: inset(-.15em 0 -.15em 100%); }
}
/* Convert the beam position from the wider LOADING line into the button's coordinates. */
@keyframes intro-reveal-word {
  from { clip-path: inset(-.15em calc(50% + 50cqw) -.15em 0); }
  to   { clip-path: inset(-.15em calc(50% - 50cqw) -.15em 0); }
}
@keyframes intro-beam-tip {
  from { opacity: .88; clip-path: inset(-.15em 100% -.15em -7%); }
  to   { opacity: .88; clip-path: inset(-.15em 0 -.15em 93%); }
}
#loading-overlay:is(.glitching, .done) :is(#intro-loading, .intro-ray) { display: none; }
#loading-overlay:is(.glitching, .done) .intro-enter-face { animation: none; }
html.intro-font-fallback .intro-readout { font-family: 'MS Sans Serif', Arial, sans-serif; }
@media (max-width: 639px) { .intro-readout { font-size: 36px; letter-spacing: 6px; } }
@media (prefers-reduced-motion: reduce) {
  .intro-scan, .intro-ray { display: none; }
  html.intro-ready #intro-loading, html.intro-ready .intro-enter-face { animation: none; }
}

#intro-retry { position: absolute; z-index: 1; top: calc(100% + 20px); left: 50%; transform: translateX(-50%); padding: 8px 16px; color: #00ff00; border: 1px solid currentColor; background: #111; font: 14px monospace; cursor: pointer; }
.bank-flow { position: relative; width: 264px; height: 573.969px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.bank-play { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); cursor: pointer; font: inherit; padding: 6px 14px; }

/* Match the square film inside the same scaled portrait crop until a frame is on screen. */
.bank-flow::after { content: ''; position: absolute; inset: 0; transform: scale(2.3); background: center / contain no-repeat; pointer-events: none; }
[data-project="sbp-case"] .bank-flow::after { background-image: url(hero-sbp.jpg); }
[data-project="qr-case"] .bank-flow::after { background-image: url(hero-qr.jpg); }
.bank-flow.has-frame::after { opacity: 0; }
.bank-play { z-index: 1; }
