/* =========================================================
   Eau de Stocks — Motion & Scroll Animations
   Smooth easeOutQuart curves matching Flutter FadeSlideIn
   ========================================================= */

/* Scroll Reading Hairline */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 0%;
    background-color: var(--accent);
    z-index: 200;
    transition: width 0.08s linear;
}

/* Scroll Reveal Elements */
.reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: var(--delay, 0ms);
    will-change: opacity, transform;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Hero Instant Entrance */
.fade-up {
    animation: fadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: var(--delay, 0ms);
    opacity: 0;
}

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

/* SVG Sparkline Stroke Draw-In */
.spark-line {
    stroke-dasharray: 420;
    stroke-dashoffset: 420;
    animation: drawLine 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes drawLine {
    to {
        stroke-dashoffset: 0;
    }
}

/* Subtle Interactive Card & Button Lift */
.m-card,
.trust-card,
.faq-item {
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
                border-color 0.25s ease,
                background-color 0.25s ease;
}

.m-card:hover,
.trust-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
}

.btn-filled,
.btn-outlined {
    transition: transform 0.16s cubic-bezier(0.22, 1, 0.36, 1),
                background-color 0.18s ease,
                border-color 0.18s ease,
                opacity 0.18s ease;
}

.btn-filled:active,
.btn-outlined:active {
    transform: scale(0.985);
}

/* Smooth FAQ Expand */
.faq-a {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.32s cubic-bezier(0.22, 1, 0.36, 1);
    padding: 0 20px;
}

.faq-a-inner {
    overflow: hidden;
    font-size: 14px;
    color: var(--muted);
    line-height: 1.65;
}

.faq-item.open .faq-a {
    grid-template-rows: 1fr;
    padding-bottom: 18px;
}

.faq-chevron {
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.faq-item.open .faq-chevron {
    transform: rotate(180deg);
}

/* Market Grid Swap Transition */
.market-grid.is-updating {
    opacity: 0.45;
    transform: translateY(4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.market-grid {
    transition: opacity 0.28s ease, transform 0.28s ease;
}

/* Accessibility: Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .reveal, .fade-up, .spark-line {
        animation: none !important;
        transition: none !important;
        opacity: 1 !important;
        transform: none !important;
        stroke-dashoffset: 0 !important;
    }
    html {
        scroll-behavior: auto;
    }
}
