/* ============================================================
   Animations — Subtile Fade-Ins, Reduced-Motion freundlich.
   ============================================================ */

:root {
  --ease-editorial: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur-reveal: 700ms;
  --dur-reveal-mobile: 500ms;
}

.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--dur-reveal) var(--ease-editorial),
              transform var(--dur-reveal) var(--ease-editorial);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger via CSS Custom Property (--i) */
.reveal[data-stagger] { transition-delay: calc(var(--i, 0) * 90ms); }

/* Home only: editorial heading reveal */
body.page-home .reveal--heading {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity var(--dur-reveal) var(--ease-editorial),
    transform var(--dur-reveal) var(--ease-editorial);
}

body.page-home .reveal--heading.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Home only: calm clip reveal for selected content blocks */
body.page-home .reveal--clip {
  clip-path: inset(0 0 100% 0);
  transition: clip-path 900ms var(--ease-editorial);
  will-change: clip-path;
}

body.page-home .reveal--clip.is-visible {
  clip-path: inset(0 0 0 0);
}

body.page-home .reveal--clip-frame.is-visible .reveal--clip {
  clip-path: inset(0 0 0 0);
}

@media (max-width: 720px) {
  body.page-home .reveal--heading {
    transition-duration: var(--dur-reveal-mobile);
  }

  body.page-home .reveal--clip {
    transition-duration: 600ms;
  }
}

/* Burger -> Close */
.menu-open .burger span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.menu-open .burger span:nth-child(2) {
  opacity: 0;
}
.menu-open .burger span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
  width: 26px;
}

/* Soft entrance for hero */
.hero-copy > *,
.hero-visual {
  animation: heroIn 900ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
.hero-copy .preline { animation-delay: 50ms; }
.hero-copy h1 { animation-delay: 120ms; }
.hero-copy .lead { animation-delay: 240ms; }
.hero-copy .btn-row { animation-delay: 320ms; }
.hero-copy .hero-meta { animation-delay: 400ms; }
.hero-visual { animation-delay: 200ms; }

@keyframes heroIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .reveal,
  body.page-home .reveal--heading,
  body.page-home .reveal--clip-frame,
  body.page-home .reveal--clip {
    opacity: 1;
    transform: none;
    clip-path: none;
    transition: none;
    will-change: auto;
  }
  .hero-copy > *,
  .hero-visual { animation: none; }
  html { scroll-behavior: auto; }
  .toast { transition: opacity 120ms linear; }
}
