/* INTRO CINEMATICO */

.site-intro {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background-color: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.site-intro.is-done {
  display: none;
}

.site-intro__sweep {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(99, 102, 241, 0.08) 50%,
    rgba(0, 212, 170, 0.06) 55%,
    transparent 65%
  );
  transform: translateX(-120%);
  animation: intro-sweep 1.4s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
  pointer-events: none;
}

@keyframes intro-sweep {
  to { transform: translateX(120%); }
}

.site-intro__center {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-6);
}

.site-intro__mark {
  width: 72px;
  height: 72px;
  opacity: 0;
  filter: blur(12px);
  animation: intro-mark-in 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.15s forwards;
}

.site-intro__mark svg {
  width: 100%;
  height: 100%;
}

.site-intro__mark-path {
  stroke-dasharray: 120;
  stroke-dashoffset: 120;
  animation: intro-draw 1s cubic-bezier(0.16, 1, 0.3, 1) 0.35s forwards;
}

@keyframes intro-draw {
  to { stroke-dashoffset: 0; }
}

@keyframes intro-mark-in {
  to {
    opacity: 1;
    filter: blur(0);
    transform: scale(1);
  }
}

.site-intro__mark circle {
  animation: intro-dot-in 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.9s forwards;
}

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

.site-intro__wordmark {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: var(--font-weight-semibold);
  letter-spacing: -0.04em;
  color: var(--color-text-primary);
  opacity: 0;
  filter: blur(8px);
  animation: intro-word-in 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.7s forwards;
}

.site-intro__wordmark span {
  color: var(--color-accent-primary);
}

.site-intro__line {
  width: 48px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-accent-primary), transparent);
  opacity: 0;
  animation: intro-line-in 0.6s cubic-bezier(0.16, 1, 0.3, 1) 1s forwards;
}

@keyframes intro-word-in {
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

@keyframes intro-line-in {
  to { opacity: 0.6; width: 80px; }
}

.site-intro.site-intro--exit {
  animation: intro-fade-out 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: none;
}

@keyframes intro-fade-out {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

body.intro-active {
  overflow: hidden;
}

body.intro-active .page-shell {
  opacity: 0;
  transform: translateY(24px);
}

body.intro-done .page-shell {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

body.intro-reveal .page-shell > * {
  animation: page-stagger-in 0.75s cubic-bezier(0.16, 1, 0.3, 1) both;
}

body.intro-reveal .page-shell > .navbar { animation-delay: 0.05s; }
body.intro-reveal .page-shell > main { animation-delay: 0.12s; }
body.intro-reveal .page-shell > footer { animation-delay: 0.2s; }

@keyframes page-stagger-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-intro {
    display: none;
  }

  body.intro-active .page-shell {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
