/* First-visit homepage intro — StudioFork */

html.first-visit body.studiofork-home {
  overflow: hidden;
}

html.first-visit body.studiofork-home .topbar--splash,
html.first-visit body.studiofork-home .footer--splash,
html.first-visit body.studiofork-home .splash-main {
  opacity: 0;
}

html.first-visit body.studiofork-home .hero-splash .reveal {
  opacity: 0 !important;
  translate: 0 24px !important;
  scale: 0.98 !important;
}

html.first-visit.intro-bg-zoom body.studiofork-home::before {
  animation: sf-intro-bg-zoom 2.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes sf-intro-bg-zoom {
  0% {
    transform: scale(1.14);
    filter: brightness(0.55) saturate(0.9);
  }
  100% {
    transform: scale(1);
    filter: brightness(1) saturate(1);
  }
}

.home-intro {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: radial-gradient(
    ellipse 80% 60% at 50% 45%,
    rgba(12, 18, 28, 0.55) 0%,
    rgba(4, 6, 10, 0.94) 70%
  );
  pointer-events: auto;
  transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1),
    visibility 0.75s;
}

.home-intro.is-exiting {
  opacity: 0;
  pointer-events: none;
}

.home-intro.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.home-intro__logo {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  animation: sf-intro-logo 1s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.home-intro__logo img {
  width: 52px;
  height: 52px;
  filter: drop-shadow(0 8px 24px rgba(88, 166, 255, 0.35));
}

.home-intro__logo-text {
  font-family: Figtree, system-ui, sans-serif;
  font-size: clamp(1.75rem, 5vw, 2.35rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: #f4f2ff;
}

.home-intro__logo-text span {
  font-weight: 500;
  color: rgba(244, 242, 255, 0.65);
}

.home-intro__kicker {
  margin-top: 1.1rem;
  font-family: Figtree, system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(63, 185, 80, 0.95);
  animation: sf-intro-kicker 0.85s 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.home-intro__line {
  margin-top: 1.35rem;
  height: 2px;
  width: 0;
  border-radius: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    #58a6ff 20%,
    #3fb950 50%,
    #58a6ff 80%,
    transparent
  );
  box-shadow: 0 0 20px rgba(88, 166, 255, 0.45);
  animation: sf-intro-line 0.9s 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes sf-intro-logo {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.88);
    filter: blur(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes sf-intro-kicker {
  from {
    opacity: 0;
    letter-spacing: 0.08em;
  }
  to {
    opacity: 1;
    letter-spacing: 0.28em;
  }
}

@keyframes sf-intro-line {
  to {
    width: min(220px, 42vw);
  }
}

html.intro-revealed body.studiofork-home .topbar--splash {
  animation: sf-intro-bar-in 0.65s 0.05s cubic-bezier(0.16, 1, 0.3, 1) both;
}

html.intro-revealed body.studiofork-home .footer--splash {
  animation: sf-intro-bar-in 0.65s 0.12s cubic-bezier(0.16, 1, 0.3, 1) both;
}

html.intro-revealed body.studiofork-home .splash-main {
  animation: sf-intro-main-in 0.05s linear both;
}

@keyframes sf-intro-bar-in {
  from {
    opacity: 0;
    transform: translateY(-14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes sf-intro-main-in {
  to {
    opacity: 1;
  }
}

html.intro-revealed .hero-splash .reveal.is-in {
  transition-duration: 0.75s;
  transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

html.intro-revealed .hero-splash .h1-grad.is-in {
  transition-duration: 0.9s;
}

@media (prefers-reduced-motion: reduce) {
  .home-intro,
  html.first-visit body.studiofork-home::before,
  html.intro-revealed body.studiofork-home .topbar--splash,
  html.intro-revealed body.studiofork-home .footer--splash {
    animation: none !important;
  }

  .home-intro__logo,
  .home-intro__kicker,
  .home-intro__line {
    animation: none !important;
    opacity: 1 !important;
    width: min(220px, 42vw);
  }

  .home-intro.is-hidden {
    display: none;
  }
}
