/* Site-wide entrance animations — Sushi Deluxe Studios
   Content stays visible until JS adds html.reveals-ready */

@keyframes sds-rise {
  from {
    opacity: 0;
    transform: translateY(2rem) scale(0.96);
    filter: blur(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes sds-hero-rise {
  from {
    opacity: 0;
    transform: translateY(2.75rem) scale(0.92);
    filter: blur(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes sds-nav-drop {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-1.75rem) scale(0.9);
    filter: blur(14px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes sds-nav-logo-in {
  from {
    opacity: 0;
    transform: scale(0.85) rotate(-6deg);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    filter: blur(0);
  }
}

@keyframes sds-line-grow {
  from {
    width: 0;
    opacity: 0;
  }
  to {
    width: 5.25rem;
    opacity: 1;
  }
}

@keyframes sds-logo-pop {
  from {
    opacity: 0;
    transform: scale(0.92);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
  }
}

/* Undo stale prerender GSAP hidden states before/without JS */
html:not(.reveals-ready) header.liquid-glass-nav {
  opacity: 1 !important;
  transform: translateX(-50%) !important;
  filter: none !important;
}

html:not(.reveals-ready) .hero-brand-wrap {
  opacity: 1 !important;
  transform: translate(-50%, calc(-50% - 0.5in)) !important;
  filter: none !important;
}

html:not(.reveals-ready) .hero-brand__title,
html:not(.reveals-ready) .hero-brand__tagline,
html:not(.reveals-ready) #stats .metrics-heading,
html:not(.reveals-ready) #stats .metrics-subheading,
html:not(.reveals-ready) #stats .stats-cards,
html:not(.reveals-ready) #stats .stats-card,
html:not(.reveals-ready) .worked-with-heading,
html:not(.reveals-ready) .worked-with-logos img,
html:not(.reveals-ready) .games-section-heading,
html:not(.reveals-ready) #games > div {
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
}

/* Pre-animation hidden state (brief — only between reveals-ready and page-loaded) */
html.reveals-ready:not(.page-loaded) header.liquid-glass-nav {
  opacity: 0;
  transform: translateX(-50%) translateY(-1.75rem) scale(0.9);
  filter: blur(14px);
}

html.reveals-ready:not(.page-loaded) header.liquid-glass-nav img {
  opacity: 1;
}

html.reveals-ready:not(.page-loaded) .hero-brand__title,
html.reveals-ready:not(.page-loaded) .hero-brand__tagline {
  opacity: 0;
  transform: translateY(2.75rem) scale(0.92);
  filter: blur(14px);
}

html.reveals-ready.page-intro-skipped .hero-brand-wrap {
  transform: translate(-50%, calc(-50% - 0.5in)) !important;
}

html.reveals-ready.page-intro-skipped header.liquid-glass-nav,
html.reveals-ready.page-intro-skipped header.liquid-glass-nav img,
html.reveals-ready.page-intro-skipped .hero-brand__title,
html.reveals-ready.page-intro-skipped .hero-brand__tagline {
  opacity: 1 !important;
  filter: none !important;
  animation: none !important;
}

html.reveals-ready.page-intro-skipped header.liquid-glass-nav {
  transform: translateX(-50%) !important;
}

html.reveals-ready.page-intro-skipped .hero-brand__title,
html.reveals-ready.page-intro-skipped .hero-brand__tagline {
  transform: none !important;
}

/* ── Initial load: navbar + hero ── */
html.reveals-ready.page-loaded header.liquid-glass-nav {
  animation: sds-nav-drop 1.05s cubic-bezier(0.22, 1.12, 0.36, 1) both;
}

html.reveals-ready.page-loaded header.liquid-glass-nav img {
  animation: sds-nav-logo-in 0.35s cubic-bezier(0.22, 1.08, 0.36, 1) both;
}

html.reveals-ready.page-loaded .hero-brand__title {
  animation: sds-hero-rise 1.1s cubic-bezier(0.22, 1.08, 0.36, 1) 0.28s both;
}

html.reveals-ready.page-loaded .hero-brand__tagline {
  animation: sds-rise 0.95s cubic-bezier(0.22, 1, 0.36, 1) 0.55s both;
}

/* ── Scroll reveal (hidden only once JS marks targets) ── */
html.reveals-ready .reveal-on-scroll:not(.is-visible) {
  opacity: 0 !important;
  transform: translateY(2rem) scale(0.96) !important;
  filter: blur(10px);
  will-change: opacity, transform, filter;
}

html.reveals-ready .reveal-on-scroll.is-visible {
  animation: sds-rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) var(--reveal-delay, 0ms) both;
}

html.reveals-ready .reveal-on-scroll.is-visible.is-revealed-instant {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
}

html.reveals-ready .reveal-on-scroll--group.is-visible.is-revealed-instant,
html.reveals-ready .reveal-on-scroll.is-visible.is-revealed-instant .worked-with-heading__text,
html.reveals-ready .worked-with-logos img.is-visible.is-revealed-instant {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
}

.worked-with-heading.is-visible.is-revealed-instant .worked-with-heading__line {
  animation: none !important;
  opacity: 1 !important;
  width: 5.25rem;
}

@media (min-width: 640px) {
  .worked-with-heading.is-visible.is-revealed-instant .worked-with-heading__line {
    width: 6.5rem;
  }
}

html.reveals-ready .reveal-on-scroll--group:not(.is-visible) {
  opacity: 0 !important;
}

html.reveals-ready .reveal-on-scroll--group.is-visible {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
}

#stats .metrics-heading.is-visible,
#stats .metrics-subheading.is-visible {
  animation-duration: 1s;
}

#stats .stats-card.is-visible {
  animation-duration: 0.85s;
}

.worked-with-heading.is-visible .worked-with-heading__line {
  animation: sds-line-grow 0.75s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.worked-with-heading.is-visible .worked-with-heading__line:first-child {
  animation-delay: 0.05s;
}

.worked-with-heading.is-visible .worked-with-heading__line:last-child {
  animation-delay: 0.15s;
}

.worked-with-heading.is-visible .worked-with-heading__text {
  animation: sds-rise 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
}

.worked-with-logos img.is-visible {
  animation: sds-logo-pop 0.85s cubic-bezier(0.22, 1, 0.36, 1) var(--reveal-delay, 0ms) both;
}

.games-section-heading.is-visible {
  animation-duration: 1s;
}

#games > div.is-visible {
  animation-duration: 0.9s;
}

@media (min-width: 640px) {
  @keyframes sds-line-grow {
    to {
      width: 6.5rem;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  html.reveals-ready .reveal-on-scroll:not(.is-visible) {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }

  html.reveals-ready.page-loaded header.liquid-glass-nav,
  html.reveals-ready.page-loaded header.liquid-glass-nav img,
  html.reveals-ready.page-loaded .hero-brand__title,
  html.reveals-ready.page-loaded .hero-brand__tagline,
  html.reveals-ready .reveal-on-scroll.is-visible,
  html.reveals-ready.page-loaded .contact-page__hero,
  html.reveals-ready.page-loaded .contact-page__card,
  html.reveals-ready.page-loaded .contact-page__form-panel,
  html.reveals-ready.page-loaded .contact-page__social,
  html.reveals-ready.page-loaded .contact-page__footnote {
    animation: none !important;
    opacity: 1 !important;
    filter: none !important;
  }

  html.reveals-ready.page-loaded header.liquid-glass-nav {
    transform: translateX(-50%) !important;
  }

  html.reveals-ready.page-loaded .hero-brand__title,
  html.reveals-ready.page-loaded .hero-brand__tagline,
  html.reveals-ready .reveal-on-scroll.is-visible {
    transform: none !important;
  }
}
