/* Animations — Apple-esque smooth and deliberate */

/* --- Keyframes --- */
@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(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);
    }
}

/* --- Hero entrance (staggered brand reveal) --- */
.hero__logo {
    animation: hero-logo 1s 0.1s var(--ease-expo) both;
}

@keyframes hero-logo {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.hero__wordmark {
    animation: fade-up 0.9s 0.25s var(--ease-expo) both;
}

.hero__tagline {
    animation: fade-up 0.8s 0.45s var(--ease-expo) both;
}

.hero__subheadline {
    animation: fade-up 0.8s 0.6s var(--ease-expo) both;
}

.hero__cta {
    animation: fade-up 0.8s 0.75s var(--ease-expo) both;
}

/* --- Scroll-triggered --- */
[data-animate] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s var(--ease-expo), transform 0.8s var(--ease-expo);
}

[data-animate].visible {
    opacity: 1;
    transform: translateY(0);
}

[data-animate="scale"] {
    transform: scale(0.96);
}

[data-animate="scale"].visible {
    transform: scale(1);
}

/* --- Stagger children --- */
[data-animate="stagger"].visible > * {
    opacity: 0;
    animation: fade-up 0.6s var(--ease-expo) both;
}

[data-animate="stagger"].visible > :nth-child(1) { animation-delay: 0.05s; }
[data-animate="stagger"].visible > :nth-child(2) { animation-delay: 0.1s; }
[data-animate="stagger"].visible > :nth-child(3) { animation-delay: 0.15s; }
[data-animate="stagger"].visible > :nth-child(4) { animation-delay: 0.2s; }
[data-animate="stagger"].visible > :nth-child(5) { animation-delay: 0.25s; }
[data-animate="stagger"].visible > :nth-child(6) { animation-delay: 0.3s; }
[data-animate="stagger"].visible > :nth-child(7) { animation-delay: 0.35s; }
[data-animate="stagger"].visible > :nth-child(8) { animation-delay: 0.4s; }
[data-animate="stagger"].visible > :nth-child(9) { animation-delay: 0.45s; }
[data-animate="stagger"].visible > :nth-child(10) { animation-delay: 0.5s; }
[data-animate="stagger"].visible > :nth-child(11) { animation-delay: 0.55s; }

/* --- Spotlight alternating directions --- */
.spotlight.visible .spotlight__visual {
    animation: scale-in 0.8s var(--ease-expo) both;
}

.spotlight.visible .spotlight__text {
    animation: fade-up 0.8s 0.15s var(--ease-expo) both;
}

/* --- Cookie chat reveal --- */
.chat-mockup.visible .chat-bubble:nth-child(1) { animation: fade-up 0.5s 0.2s var(--ease-expo) both; }
.chat-mockup.visible .chat-bubble:nth-child(2) { animation: fade-up 0.5s 0.5s var(--ease-expo) both; }
.chat-mockup.visible .chat-bubble:nth-child(3) { animation: fade-up 0.5s 0.8s var(--ease-expo) both; }
.chat-mockup.visible .chat-bubble:nth-child(4) { animation: fade-up 0.5s 1.1s var(--ease-expo) both; }
.chat-mockup.visible .typing-indicator { animation: fade-up 0.5s 1.4s var(--ease-expo) both; }

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    [data-animate] {
        opacity: 1;
        transform: none;
    }

    .scroll-indicator__line::after,
    .typing-indicator span,
    .chat-mockup__status::before {
        animation: none;
    }
}
