/* ========================================
   Dr Kimberley Wells - Animations
   Scroll reveals + micro-interactions
   ======================================== */

/* ---- Scroll Reveal Animations ---- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

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

.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-scale.visible {
    opacity: 1;
    transform: scale(1);
}

/* Staggered children */
.stagger-children > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.stagger-children.visible > *:nth-child(1) { transition-delay: 0s; }
.stagger-children.visible > *:nth-child(2) { transition-delay: 0.1s; }
.stagger-children.visible > *:nth-child(3) { transition-delay: 0.2s; }
.stagger-children.visible > *:nth-child(4) { transition-delay: 0.3s; }
.stagger-children.visible > *:nth-child(5) { transition-delay: 0.35s; }
.stagger-children.visible > *:nth-child(6) { transition-delay: 0.4s; }
.stagger-children.visible > *:nth-child(7) { transition-delay: 0.45s; }
.stagger-children.visible > *:nth-child(8) { transition-delay: 0.5s; }
.stagger-children.visible > *:nth-child(9) { transition-delay: 0.55s; }

.stagger-children.visible > * {
    opacity: 1;
    transform: translateY(0);
}

/* ---- Hero Animations ---- */
.hero-animate .hero-content > * {
    opacity: 0;
    transform: translateY(20px);
    animation: heroFadeUp 0.8s ease forwards;
}

.hero-animate .hero-content > *:nth-child(1) { animation-delay: 0.1s; }
.hero-animate .hero-content > *:nth-child(2) { animation-delay: 0.25s; }
.hero-animate .hero-content > *:nth-child(3) { animation-delay: 0.4s; }
.hero-animate .hero-content > *:nth-child(4) { animation-delay: 0.55s; }
.hero-animate .hero-content > *:nth-child(5) { animation-delay: 0.65s; }
.hero-animate .hero-content > *:nth-child(6) { animation-delay: 0.75s; }

@keyframes heroFadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Page hero animation */
.page-hero h1 {
    animation: heroFadeUp 0.7s ease 0.1s forwards;
    opacity: 0;
    transform: translateY(15px);
}

.page-hero > .container > p {
    animation: heroFadeUp 0.7s ease 0.25s forwards;
    opacity: 0;
    transform: translateY(15px);
}

/* ---- Link Underline Animation ---- */
.animated-underline {
    position: relative;
    text-decoration: none;
}

.animated-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

.animated-underline:hover::after {
    width: 100%;
}

/* ---- Button Shine Effect ---- */
.btn-shine {
    position: relative;
    overflow: hidden;
}

.btn-shine::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-shine:hover::before {
    left: 100%;
}

/* ---- Card Hover Glow ---- */
.card-glow {
    position: relative;
}

.card-glow::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(201,167,124,0), rgba(201,167,124,0.3));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.card-glow:hover::before {
    opacity: 1;
}

/* ---- Floating Badge Animation ---- */
@keyframes gentleFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.float-badge {
    animation: gentleFloat 3s ease-in-out infinite;
}

/* ---- Pulse Dot ---- */
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.1); }
}

.pulse-dot {
    animation: pulse 2s ease-in-out infinite;
}

/* ---- Counter/Number Animation ---- */
@keyframes countUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.count-animate {
    animation: countUp 0.6s ease forwards;
}

/* ---- Smooth Section Transitions ---- */
section {
    transition: opacity 0.3s ease;
}

/* ---- Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .reveal,
    .reveal-left,
    .reveal-right,
    .reveal-scale,
    .stagger-children > * {
        opacity: 1 !important;
        transform: none !important;
    }

    .hero-animate .hero-content > * {
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
    }

    .page-hero h1,
    .page-hero > .container > p {
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
    }
}
