/* Motion: intro, reveal, hover helpers, reduced motion */

@keyframes heroZoom {
    to { transform: scale(1.16); }
}

@keyframes shineSweep {
    0%, 55% { transform: translateX(-50%); opacity: 0; }
    65% { opacity: 1; }
    100% { transform: translateX(50%); opacity: 0; }
}

@keyframes bounceDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(5px); }
}

@keyframes pageIn {
    to { opacity: 1; transform: none; }
}

@keyframes introLineGrow {
    0% { width: 2px; height: 2px; opacity: 0; }
    18% { opacity: 1; width: 2px; }
    48% { width: min(72vw, 520px); height: 1px; }
    100% { width: min(72vw, 520px); height: 1px; opacity: 0.35; }
}

@keyframes introWord {
    to { opacity: 1; filter: blur(0); }
}

@keyframes introFlash {
    0% { transform: translateX(-120%); opacity: 0; }
    25% { opacity: 1; }
    100% { transform: translateX(120%); opacity: 0; }
}

@keyframes introExit {
    to { transform: translateY(-100%); }
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(28px); }
    to { opacity: 1; transform: none; }
}

@keyframes fadeLeft {
    from { opacity: 0; transform: translateX(28px); }
    to { opacity: 1; transform: none; }
}

@keyframes fadeRight {
    from { opacity: 0; transform: translateX(-28px); }
    to { opacity: 1; transform: none; }
}

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

@keyframes imageReveal {
    from { transform: scale(1.16); filter: saturate(0.7); }
    to { transform: none; filter: none; }
}

.intro.is-playing .intro__line {
    animation: introLineGrow 1.15s var(--ease) forwards;
}

.intro.is-playing .intro__wordmark {
    animation: introWord 0.7s 0.55s var(--ease) forwards;
}

.intro.is-playing .intro__flash {
    animation: introFlash 0.55s 1.15s var(--ease) forwards;
}

.intro.is-leaving {
    animation: introExit 0.7s 0.05s var(--ease) forwards;
}

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

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

.reveal--left {
    transform: translateX(28px);
}

.reveal--right {
    transform: translateX(-28px);
}

.reveal--left.is-in,
.reveal--right.is-in {
    transform: none;
}

.reveal-clip {
    clip-path: inset(0 0 100% 0);
    transition: clip-path 1s var(--ease);
}

.reveal-clip.is-in {
    clip-path: inset(0 0 0 0);
}

.media-reveal {
    overflow: hidden;
}

.media-reveal img {
    transform: scale(1.12);
    transition: transform 1.15s var(--ease);
}

.media-reveal.is-in img {
    transform: scale(1);
}

.stagger > * {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}

.stagger.is-in > *:nth-child(1) { transition-delay: 0.02s; }
.stagger.is-in > *:nth-child(2) { transition-delay: 0.09s; }
.stagger.is-in > *:nth-child(3) { transition-delay: 0.16s; }
.stagger.is-in > *:nth-child(4) { transition-delay: 0.23s; }
.stagger.is-in > *:nth-child(5) { transition-delay: 0.3s; }
.stagger.is-in > *:nth-child(6) { transition-delay: 0.37s; }

.stagger.is-in > * {
    opacity: 1;
    transform: none;
}

.hero.is-ready .hero__kicker,
.hero.is-ready .hero__lead,
.hero.is-ready .hero__actions,
.hero.is-ready .hero__meta {
    animation: fadeUp 0.8s var(--ease) forwards;
}

.hero.is-ready .hero__kicker { animation-delay: 0.05s; opacity: 0; }
.hero.is-ready .hero__lead { animation-delay: 0.28s; opacity: 0; }
.hero.is-ready .hero__actions { animation-delay: 0.4s; opacity: 0; }
.hero.is-ready .hero__meta { animation-delay: 0.5s; opacity: 0; }

.hero.is-ready .hero__title .line span {
    animation: fadeUp 0.85s var(--ease) forwards;
}

.hero.is-ready .hero__title .line:nth-child(1) span { animation-delay: 0.08s; opacity: 0; }
.hero.is-ready .hero__title .line:nth-child(2) span { animation-delay: 0.16s; opacity: 0; }
.hero.is-ready .hero__title .line:nth-child(3) span { animation-delay: 0.24s; opacity: 0; }

.transition-cover {
    animation: none;
}

html.is-leaving .page-transition {
    animation: introExit 0.45s var(--ease) reverse forwards;
    transform: translateY(-100%);
}

html.is-leaving .page-transition.is-covering {
    animation: coverDown 0.45s var(--ease) forwards;
}

@keyframes coverDown {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .reveal,
    .stagger > *,
    .hero__title .line span,
    .hero__kicker,
    .hero__lead,
    .hero__actions,
    .hero__meta,
    .page,
    .intro-pending .page,
    .intro-done .page {
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
        clip-path: none !important;
        animation: none !important;
    }

    .hero__media img,
    .media-reveal img,
    .service-card__media img {
        transform: none !important;
        animation: none !important;
    }

    .intro {
        display: none !important;
    }
}
