* { margin: 0; padding: 0; box-sizing: border-box; }

:root { --ink: #0b0b0c; }

body {
  background: #0b0b0c;
  color: #fff;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  overflow-x: hidden;
}

/* While the intro is locked, the page can't scroll. */
body.locked { overflow: hidden; height: 100vh; }

/* ---------- Loader ---------- */
#loader {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: #0b0b0c;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease;
}
#loader.done { opacity: 0; pointer-events: none; }
#pct {
  font-size: clamp(28px, 9vw, 64px);
  font-weight: 700;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

/* ---------- Scrub stage ---------- */
/* Height defines how much scrolling it takes to play the run through once. */
#stage { height: 420vh; position: relative; }

#viewer {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  background: #0b0b0c;
}

#run {
  display: block;
  width: 100%;
  height: 100%;
  /* Punch up the colour, then crush it into flat poster bands on the GPU. */
  filter: saturate(1.35) contrast(1.06) url(#posterize);
}

/* ---------- Flying cut-out ---------- */
#flyer {
  position: fixed;
  top: 50%;
  left: 50%;
  height: 62vh;
  width: auto;
  transform: translate(-50%, calc(-50% - 60vh)) scale(0.6);
  transform-origin: center;
  opacity: 0;
  pointer-events: none;
  z-index: 30;
  will-change: transform, opacity;
  filter: drop-shadow(0 26px 34px rgba(0, 0, 0, 0.45));
}

/* ---------- Badges ---------- */
.badge {
  position: absolute;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 36px);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  z-index: 10;
}
#lock .lock-row {
  font-size: clamp(13px, 3.6vw, 17px);
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 12px 20px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14) inset;
  white-space: nowrap;
}
#skip {
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
}
#skip:hover { color: #fff; }

#hint {
  font-size: clamp(13px, 3.6vw, 16px);
  font-weight: 700;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.6);
  animation: bob 1.5s ease-in-out infinite;
}
/* The bare `hidden` attribute is overridden by `.badge { display:flex }`, so
   re-assert it with matching specificity for both badges. */
.badge[hidden] { display: none !important; }
@keyframes bob {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.95; }
  50%      { transform: translateX(-50%) translateY(7px); opacity: 0.55; }
}

/* ---------- The frame under the video ---------- */
#below {
  position: relative;
  height: 100vh;
  overflow: hidden;
  background: #000;
}
#gif {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
#below .word {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 7vh;
  text-align: center;
  font-size: clamp(46px, 17vw, 200px);
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #fff;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
#below.in .word { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  #hint { animation: none; }
  #below .word { transition: opacity 0.4s ease; transform: none; }
}
