/* =========================================================
   Trichy Dev Cabs — animations.css
   Motion system: three levels + reduced-motion fallbacks
   ========================================================= */

/* ---------------------------------------------------------
   Level 2 — section entrance variants (500–900ms)
   Deliberately mixed so the page never repeats one fade-up.
   Hidden start states are scoped to .js so the content is
   fully visible when JavaScript is unavailable.
   --------------------------------------------------------- */
.js [data-reveal] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity var(--t-section, 720ms) var(--ease-out),
                transform var(--t-section, 720ms) var(--ease-out),
                clip-path .9s var(--ease-out),
                letter-spacing .9s var(--ease-out);
    transition-delay: var(--d, 0ms);
    will-change: opacity, transform;
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* Wipe: images and media blocks reveal sideways */
.js [data-reveal="wipe"] {
    opacity: 1;
    transform: none;
    clip-path: inset(0 100% 0 0);
}
.js [data-reveal="wipe"].is-in { clip-path: inset(0 0 0 0); }

/* Rise: headings rise out of their own mask */
.js [data-reveal="rise"] {
    opacity: 1;
    transform: none;
    clip-path: inset(0 0 110% 0);
}
.js [data-reveal="rise"].is-in { clip-path: inset(0 0 -10% 0); }

/* Scale: full-bleed media settles into place */
.js [data-reveal="scale"] {
    opacity: 1;
    transform: scale(1.06);
}
.js [data-reveal="scale"].is-in { transform: scale(1); }

/* Line: thin rules draw themselves */
.js [data-reveal="line"] {
    opacity: 1;
    transform: none;
    transform-origin: left;
    scale: 0 1;
    transition: scale .9s var(--ease-out);
}
.js [data-reveal="line"].is-in { scale: 1 1; }

/* ---------------------------------------------------------
   Level 3 — scroll storytelling helpers
   --------------------------------------------------------- */
.story-step h3,
.story-step p {
    transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.story-step:not(.is-active) h3 { transform: translateY(8px); }

.sc-panel.is-active .sc-copy > * {
    animation: panelRise .7s var(--ease-out) both;
}
.sc-panel.is-active .sc-copy > *:nth-child(2) { animation-delay: .08s; }
.sc-panel.is-active .sc-copy > *:nth-child(3) { animation-delay: .16s; }
.sc-panel.is-active .sc-copy > *:nth-child(4) { animation-delay: .24s; }
.sc-panel.is-active .sc-copy > *:nth-child(5) { animation-delay: .32s; }
.sc-panel.is-active .sc-copy > *:nth-child(6) { animation-delay: .40s; }
@keyframes panelRise {
    from { opacity: 0; transform: translateY(22px); }
    to   { opacity: 1; transform: none; }
}

/* Route map node entrance */
.map .map-node { will-change: opacity, transform; }

/* Micro-interaction: arrow nudge shared by CTAs */
.bento-link svg, .map-foot .btn svg { transition: transform var(--t-micro) var(--ease-out); }
.bento-link:hover svg { transform: translateX(6px); }

/* Nav underline draw (Level 1) */
.nav-link::after { will-change: transform; }

/* Scroll progress */
#scrollProgress span { will-change: width; }

/* ---------------------------------------------------------
   Reduced motion — everything collapses to a static page
   --------------------------------------------------------- */
@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;
    }

    [data-reveal],
    [data-reveal="wipe"],
    [data-reveal="rise"],
    [data-reveal="scale"],
    [data-reveal="line"] {
        opacity: 1 !important;
        transform: none !important;
        clip-path: none !important;
        scale: none !important;
    }

    .hero-display .d-in,
    .sc-title .d-in,
    .cta-title .d-in { transform: none !important; }
    .hero-lead, .hero-tags, .hero-cta, .cta-sub, .cta-actions { opacity: 1 !important; transform: none !important; }
    .hero-word { opacity: 1 !important; transform: none !important; }
    .hr-path { stroke-dashoffset: 0 !important; }
    .hero-photo, .hero-bg, .cine-media { transform: none !important; }
    .map .map-node { opacity: 1 !important; }
}
