/* Full-screen welcome intro. Does not change site theme tokens. */

/* Stop iOS horizontal shift after the overlay (avoid 100vw overflow). */
html, body {
  max-width: 100%;
  overflow-x: clip;
}
@supports not (overflow-x: clip) {
  html, body { overflow-x: hidden; }
}

html.ff-intro-open,
html.ff-intro-open body {
  overflow: hidden;
  overflow-x: hidden;
  overscroll-behavior: none;
  max-width: 100%;
  touch-action: manipulation;
}

.ff-intro {
  position: fixed;
  inset: 0;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  max-width: 100%;
  height: 100%;
  height: 100vh;
  z-index: 2147483000; /* above the mood picker and every other overlay while the intro plays */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: #07080a;
  background-image: var(--ff-intro-poster, url('../video/intro-poster.webp'));
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  opacity: 1;
  transition: opacity .45s ease;
  touch-action: manipulation;
}
@supports (height: 100dvh) {
  .ff-intro { height: 100dvh; }
}
@supports not (height: 100dvh) {
  @supports (height: -webkit-fill-available) {
    .ff-intro { height: -webkit-fill-available; }
  }
}

.ff-intro[hidden],
html.ff-intro-skip .ff-intro {
  display: none !important;
}
.ff-intro.is-done {
  opacity: 0;
  pointer-events: none;
}
.ff-intro video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  object-position: center center;
  background: #07080a;
}
@media (min-width: 800px) and (orientation: landscape) {
  .ff-intro { background-size: contain; }
  .ff-intro video { object-fit: contain; }
}

.ff-intro .ff-intro-skipbtn,
.ff-intro .ff-intro-sound,
.ff-intro .ff-intro-tap {
  z-index: 2;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(0, 0, 0, 0.48);
  color: #fff;
  font-family: Outfit, system-ui, sans-serif;
  font-weight: 600;
  cursor: pointer;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.ff-intro .ff-intro-skipbtn {
  position: absolute;
  top: max(12px, env(safe-area-inset-top, 0px));
  right: max(12px, env(safe-area-inset-right, 0px));
  font-size: 0.92rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
}
.ff-intro .ff-intro-sound {
  position: absolute;
  top: max(12px, env(safe-area-inset-top, 0px));
  left: max(12px, env(safe-area-inset-left, 0px));
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
}
.ff-intro .ff-intro-sound svg {
  width: 1.25rem;
  height: 1.25rem;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ff-intro .ff-intro-sound .ff-intro-ic-off { display: none; }
.ff-intro .ff-intro-sound.is-muted .ff-intro-ic-on { display: none; }
.ff-intro .ff-intro-sound.is-muted .ff-intro-ic-off { display: block; }

.ff-intro .ff-intro-skipbtn:hover,
.ff-intro .ff-intro-skipbtn:focus-visible,
.ff-intro .ff-intro-sound:hover,
.ff-intro .ff-intro-sound:focus-visible { background: rgba(0, 0, 0, 0.7); }
.ff-intro .ff-intro-skipbtn:focus-visible,
.ff-intro .ff-intro-sound:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* "Tap for sound" prompt, shown only when the browser blocks sound. */
.ff-intro .ff-intro-tap {
  position: absolute;
  top: calc(max(12px, env(safe-area-inset-top, 0px)) + 3.6rem);
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 1.25rem;
  border-radius: 999px;
  font-size: 1rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  animation: ffIntroTapPulse 1.6s ease-in-out infinite;
}
.ff-intro .ff-intro-tap[hidden] { display: none; }
.ff-intro .ff-intro-tap svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ff-intro.needs-tap { cursor: pointer; }
@keyframes ffIntroTapPulse {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.06); }
}
@media (prefers-reduced-motion: reduce) {
  .ff-intro .ff-intro-tap { animation: none; }
}
