/* ============================================================
   MOTION.CSS — Animations, transitions, scroll reveals
   Signature: clip-path wipe reveal on scroll entry
   ============================================================ */

/* ================================================================
   PAGE ENTRANCE — Hero sequence
   ================================================================ */

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes wipe-in-right {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0% 0 0); }
}

@keyframes wipe-in-left {
  from { clip-path: inset(0 0 0 100%); }
  to   { clip-path: inset(0 0 0 0); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes scale-in {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes ghost-drift {
  from { transform: translateY(0) rotate(-1deg); }
  to   { transform: translateY(-2%) rotate(-1deg); }
}

/* Hero entrance — staggered */
.hero__eyebrow {
  animation: fade-up 0.7s var(--ease-out-expo) 0.1s both;
}

.hero__h1 {
  animation: wipe-in-right 0.9s var(--ease-out-expo) 0.2s both;
}

.hero__sub {
  animation: fade-up 0.7s var(--ease-out-expo) 0.5s both;
}

.hero__actions {
  animation: fade-up 0.7s var(--ease-out-expo) 0.7s both;
}

.hero__visual {
  animation: scale-in 1.1s var(--ease-out-expo) 0.15s both;
}

.hero__ghost {
  animation: ghost-drift 12s ease-in-out 0s infinite alternate;
}

/* Logo entrance */
.logo-mark,
.logo-wordmark {
  animation: fade-in 0.5s ease 0.05s both;
}

/* Nav CTA entrance */
.nav-cta {
  animation: wipe-in-left 0.6s var(--ease-out-expo) 0.3s both;
}

/* ================================================================
   SCROLL REVEAL — IntersectionObserver adds .is-visible
   ================================================================ */

.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition:
    opacity 0.7s var(--ease-out-expo),
    transform 0.7s var(--ease-out-expo);
}

.reveal--wipe {
  opacity: 0;
  clip-path: inset(0 100% 0 0);
  transition:
    opacity 0.6s var(--ease-out-expo),
    clip-path 0.7s var(--ease-out-expo);
}

.reveal--scale {
  opacity: 0;
  transform: scale(0.94);
  transition:
    opacity 0.6s var(--ease-out-expo),
    transform 0.6s var(--ease-out-expo);
}

.is-visible.reveal,
.is-visible.reveal--scale {
  opacity: 1;
  transform: none;
}

.is-visible.reveal--wipe {
  opacity: 1;
  clip-path: inset(0 0% 0 0);
}

/* Stagger children within a visible parent */
.reveal-stagger .reveal-item {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.5s var(--ease-out-expo),
    transform 0.5s var(--ease-out-expo);
}

.reveal-stagger.is-visible .reveal-item:nth-child(1) { opacity: 1; transform: none; transition-delay: 0ms; }
.reveal-stagger.is-visible .reveal-item:nth-child(2) { opacity: 1; transform: none; transition-delay: 80ms; }
.reveal-stagger.is-visible .reveal-item:nth-child(3) { opacity: 1; transform: none; transition-delay: 160ms; }
.reveal-stagger.is-visible .reveal-item:nth-child(4) { opacity: 1; transform: none; transition-delay: 240ms; }
.reveal-stagger.is-visible .reveal-item:nth-child(5) { opacity: 1; transform: none; transition-delay: 320ms; }

/* ================================================================
   REASON CARDS — staggered mosaic reveal
   ================================================================ */

.reason-card {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.6s var(--ease-out-expo),
    transform 0.6s var(--ease-out-expo),
    background var(--duration-base) ease;
}

.reason-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reason-card--1.is-visible { transition-delay: 0ms; }
.reason-card--2.is-visible { transition-delay: 80ms; }
.reason-card--3.is-visible { transition-delay: 160ms; }
.reason-card--4.is-visible { transition-delay: 80ms; }
.reason-card--5.is-visible { transition-delay: 160ms; }

/* ================================================================
   INTRO BRIDGE REVEAL
   ================================================================ */

.intro-bridge__label {
  opacity: 0;
  transform: translateX(-12px);
  transition: opacity 0.6s ease 0.1s, transform 0.6s var(--ease-out-expo) 0.1s;
}

.intro-bridge__text {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease 0.2s, transform 0.6s var(--ease-out-expo) 0.2s;
}

.intro-bridge.is-visible .intro-bridge__label,
.intro-bridge.is-visible .intro-bridge__text {
  opacity: 1;
  transform: none;
}

/* ================================================================
   CTA BLOCK REVEAL
   ================================================================ */

.cta-block__img-wrap {
  opacity: 0;
  transform: translateX(-24px);
  transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
}

.cta-block__text {
  opacity: 0;
  transform: translateX(24px);
  transition: opacity 0.8s var(--ease-out-expo) 0.15s, transform 0.8s var(--ease-out-expo) 0.15s;
}

.cta-block.is-visible .cta-block__img-wrap,
.cta-block.is-visible .cta-block__text {
  opacity: 1;
  transform: none;
}

/* ================================================================
   FOOTER BRAND STATEMENT — parallax feel
   ================================================================ */

.brand-statement {
  transition: transform 0.1s linear;
}

/* ================================================================
   HOVER INTERACTIONS
   ================================================================ */

/* Footer nav links */
.footer__nav a {
  position: relative;
}

.footer__nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--brand-accent);
  transition: width var(--duration-base) ease;
}

.footer__nav a:hover::after {
  width: 100%;
}

/* Reason card border accent on hover */
.reason-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--brand-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--duration-base) var(--ease-out-expo);
}

.reason-card:hover::after {
  transform: scaleX(1);
}

/* ================================================================
   ACCESSIBILITY — reduced motion
   ================================================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal,
  .reveal--wipe,
  .reveal--scale,
  .reveal-stagger .reveal-item,
  .reason-card,
  .cta-block__img-wrap,
  .cta-block__text,
  .intro-bridge__label,
  .intro-bridge__text {
    opacity: 1;
    transform: none;
    clip-path: none;
    transition: none;
  }
}
