/* ─── Fade in ──────────────────────────────────────── */
.animate-fade-in {
    animation: fadeIn 0.8s ease-out both;
}

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

/* ─── Slide up ─────────────────────────────────────── */
.animate-slide-up {
    animation: slideUp 1s ease-out both;
}

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

/* ─── Stagger helpers ──────────────────────────────── */
/* Pair with the entrance animations above (they use `both` fill, so a
   delayed element stays invisible until its turn). Used by the welcome
   screen to let the greeting land before the button asks for action —
   one thing at a time for a tired reader. */
.animation-delay-300 { animation-delay: 300ms; }
.animation-delay-600 { animation-delay: 600ms; }

/* ─── Scroll reveal ────────────────────────────────── */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.scroll-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ─── Reduced motion (accessibility gate) ──────────── */
/* Users who ask the OS for less motion get content immediately: entrance
   animations collapse to their end state, scroll-reveal content is simply
   visible, and smooth scrolling (e.g. the journal form scroll-to on "Tap to
   log") snaps instead of gliding. Motion here is decoration, never meaning,
   so nothing is lost. */
@media (prefers-reduced-motion: reduce) {
    .animate-fade-in,
    .animate-slide-up {
        animation: none;
    }
    .scroll-reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
    html {
        scroll-behavior: auto !important;
    }
}
