/* ═══════════════════════════════════════════════════════════════════
   MOTION
   One restrained motion language for the whole site:
   - hero text rises out of masks on load (no layout shift)
   - content fades up once as it scrolls into view (main.js adds .reveal)
   Everything is transform/opacity only, and switched off for
   prefers-reduced-motion.
   ═══════════════════════════════════════════════════════════════════ */

:root {
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Scroll reveal */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
    transition-delay: var(--reveal-delay, 0s);
}

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

/* Hero entrance: each title line rises out of its own mask */
.hero-title .line {
    display: block;
    overflow: hidden;
    padding-bottom: 0.04em;
}

.hero-title .line > span {
    display: block;
    animation: lineRise 1.1s var(--ease-out) both;
}

.hero-title .line:nth-child(1) > span {
    animation-delay: 0.15s;
}

.hero-title .line:nth-child(2) > span {
    animation-delay: 0.27s;
}

.hero-title .line:nth-child(3) > span {
    animation-delay: 0.39s;
}

.hero-dark .hero-subtitle {
    animation: fadeRise 0.9s var(--ease-out) 0.05s both;
}

.hero-dark .hero-lead {
    animation: fadeRise 0.9s var(--ease-out) 0.6s both;
}

.hero-dark .hero-actions {
    animation: fadeRise 0.9s var(--ease-out) 0.72s both;
}

.hero-dark .hero-scroll {
    animation: fadeIn 1s ease 1.2s both;
}

@keyframes lineRise {
    from {
        transform: translateY(105%);
    }

    to {
        transform: none;
    }
}

@keyframes fadeRise {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Keep wide decorative elements from causing sideways scroll on phones */
@media (max-width: 968px) {
    html,
    body {
        overflow-x: hidden;
        max-width: 100vw;
    }
}

@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
    }

    .hero-title .line > span,
    .hero-dark .hero-subtitle,
    .hero-dark .hero-lead,
    .hero-dark .hero-actions,
    .hero-dark .hero-scroll {
        animation: none;
    }
}
