/* ============================================================
   Animations & Interactions — animations.css
   ============================================================ */

/* ── Scroll Reveal ─────────────────────────────────────────── */
.reveal {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity .65s cubic-bezier(.22,1,.36,1), transform .65s cubic-bezier(.22,1,.36,1);
}
.reveal.reveal-left  { transform: translateX(-40px); }
.reveal.reveal-right { transform: translateX(40px); }
.reveal.reveal-scale { transform: scale(.94); }

.reveal.visible {
    opacity: 1;
    transform: none;
}

/* Stagger children */
.reveal-stagger > * {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity .55s cubic-bezier(.22,1,.36,1), transform .55s cubic-bezier(.22,1,.36,1);
}
.reveal-stagger.visible > *:nth-child(1) { transition-delay: .05s; opacity:1; transform:none; }
.reveal-stagger.visible > *:nth-child(2) { transition-delay: .15s; opacity:1; transform:none; }
.reveal-stagger.visible > *:nth-child(3) { transition-delay: .25s; opacity:1; transform:none; }
.reveal-stagger.visible > *:nth-child(4) { transition-delay: .35s; opacity:1; transform:none; }
.reveal-stagger.visible > *:nth-child(5) { transition-delay: .45s; opacity:1; transform:none; }
.reveal-stagger.visible > *:nth-child(6) { transition-delay: .55s; opacity:1; transform:none; }

/* ── Hero Animated Blobs ────────────────────────────────────── */
.hero-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: .35;
    animation: blobFloat 8s ease-in-out infinite;
    pointer-events: none;
}
.hero-blob-1 {
    width: 520px; height: 520px;
    background: radial-gradient(circle, #0098a6, transparent 70%);
    top: -120px; right: -100px;
    animation-delay: 0s;
}
.hero-blob-2 {
    width: 360px; height: 360px;
    background: radial-gradient(circle, #1a6fa6, transparent 70%);
    bottom: -80px; left: -60px;
    animation-delay: -3s;
}
.hero-blob-3 {
    width: 260px; height: 260px;
    background: radial-gradient(circle, #0098a6, transparent 70%);
    top: 40%; left: 35%;
    animation-delay: -5s;
    opacity: .18;
}

@keyframes blobFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%       { transform: translate(30px, -25px) scale(1.04); }
    66%       { transform: translate(-20px, 20px) scale(.97); }
}

/* ── Floating particles in hero ─────────────────────────────── */
.hero-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}
.particle {
    position: absolute;
    width: 4px; height: 4px;
    border-radius: 50%;
    background: rgba(255,255,255,.3);
    animation: particleDrift linear infinite;
}

@keyframes particleDrift {
    0%   { transform: translateY(100vh) scale(0); opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: .6; }
    100% { transform: translateY(-10vh) scale(1.5); opacity: 0; }
}

/* ── Pulse CTA ──────────────────────────────────────────────── */
.btn-primary {
    position: relative;
    overflow: visible !important;
}
.btn-primary::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50px;
    border: 2px solid var(--accent);
    opacity: 0;
    animation: btnPulse 2.8s ease-out infinite;
    pointer-events: none;
}
@keyframes btnPulse {
    0%   { transform: scale(1);   opacity: .7; }
    70%  { transform: scale(1.18); opacity: 0; }
    100% { transform: scale(1.18); opacity: 0; }
}

/* ── Stat numbers animate ───────────────────────────────────── */
.stat-num {
    transition: transform .3s;
}
.stats-bar.visible .stat-num {
    animation: statPop .5s cubic-bezier(.22,1,.36,1) both;
}
@keyframes statPop {
    0%   { transform: scale(.7); opacity: 0; }
    80%  { transform: scale(1.08); }
    100% { transform: scale(1); opacity: 1; }
}

/* ── Scroll progress bar ────────────────────────────────────── */
#scroll-progress {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), #00c6d7);
    width: 0%;
    z-index: 9999;
    transition: width .1s linear;
}

/* ── Card hover tilt ────────────────────────────────────────── */
.benefit-card,
.indication-card,
.commitment-card,
.protocol-card {
    transform-style: preserve-3d;
    will-change: transform;
}

/* ── Typewriter cursor on hero h1 ───────────────────────────── */
.hero-cursor {
    display: inline-block;
    width: 3px;
    height: 1em;
    background: var(--accent);
    margin-left: 4px;
    vertical-align: text-bottom;
    animation: cursorBlink .8s step-end infinite;
}
@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

/* ── Section tag entrance ───────────────────────────────────── */
.section-tag {
    transition: letter-spacing .4s;
}
.section-tag:hover {
    letter-spacing: .16em;
}

/* ── FAQ open animation ─────────────────────────────────────── */
details.faq-item > p {
    animation: fadeDown .3s ease forwards;
}
@keyframes fadeDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Nav link underline slide ───────────────────────────────── */
.main-nav a:not(.btn-nav) {
    position: relative;
}
.main-nav a:not(.btn-nav)::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 0;
    width: 0; height: 2px;
    background: var(--accent);
    transition: width .3s ease;
}
.main-nav a:not(.btn-nav):hover::after,
.main-nav a:not(.btn-nav).active::after { width: 100%; }

/* ── Hero badge entrance ────────────────────────────────────── */
.hero-badges .badge {
    animation: badgeSlide .5s cubic-bezier(.22,1,.36,1) both;
}
.hero-badges .badge:nth-child(1) { animation-delay: .6s; }
.hero-badges .badge:nth-child(2) { animation-delay: .75s; }
.hero-badges .badge:nth-child(3) { animation-delay: .9s; }

@keyframes badgeSlide {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.hero-badges .badge { opacity: 0; animation-fill-mode: forwards; }

/* ── Gradient text shimmer on highlight class ───────────────── */
@keyframes shimmer {
    0%   { background-position: -200% center; }
    100% { background-position:  200% center; }
}
.highlight {
    background: linear-gradient(90deg, #0098a6 0%, #00d4e8 40%, #0098a6 80%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 4s linear infinite;
}
