/* ═══════════════════════════════════════════════════════════════════════
   EAGLE WAVES — Section Transitions, Depth Layers & Motion System
   v1.0 — Premium wave dividers, parallax depth, micro-interactions
   CSP-safe • GPU-accelerated • Accessible (prefers-reduced-motion)
   ═══════════════════════════════════════════════════════════════════════ */

/* Global overflow safety — Bootstrap .row negative margins can exceed viewport */
html,
body {
    overflow-x: hidden;
}

/* ════════════════════════════════════════════════════════════
   1. WAVE DIVIDER SYSTEM (SVG-based Bézier curves)
   ════════════════════════════════════════════════════════════ */

/* Base wave container — positioned absolutely at top or bottom */
.wave-divider {
    position: absolute;
    left: 0;
    right: 0;
    width: 100%;
    height: 3.5rem;
    overflow: hidden;
    line-height: 0;
    z-index: 10;
    pointer-events: none;
}

.wave-divider--top {
    top: -1px;
    bottom: auto;
}

.wave-divider--bottom {
    top: auto;
    bottom: -1px;
}

/* 
 * Improved Flip logic: 
 * Using scale instead of 180deg rotation where appropriate 
 * to keep the paths predictable relative to their viewBox.
 */
.wave-divider--flip {
    transform: rotate(180deg);
}

.wave-divider--mirror {
    transform: scaleX(-1);
}

.wave-divider svg {
    display: block;
    position: relative;
    height: calc(100% + 2px);
    /* Slight bleed to avoid sub-pixel gaps */
    width: calc(100% + 2px);
    margin-left: -1px;
    margin-right: -1px;
}

/* 
 * Smooth high-performance wave drift 
 * Using small translate & scale to create liquid motion.
 * Added transform-origin to keep waves anchored to their edge.
 */
.wave-animate {
    animation: wave-drift 8s cubic-bezier(0.445, 0.05, 0.55, 0.95) infinite;
    transform-origin: center top;
}

.wave-divider--bottom .wave-animate {
    transform-origin: center bottom;
}

.wave-layer-2 {
    opacity: 0.3;
    animation: wave-drift 12s cubic-bezier(0.445, 0.05, 0.55, 0.95) infinite reverse;
    animation-delay: -2s;
}

@keyframes wave-drift {
    0% {
        transform: scaleY(1) translateX(0);
    }

    50% {
        transform: scaleY(1.05) translateX(-1%);
    }

    100% {
        transform: scaleY(1) translateX(0);
    }
}

/* Color Tokens — using design system variables */
.wave-fill-surface {
    fill: var(--eagle-surface);
}

.wave-fill-background {
    fill: var(--eagle-background);
}

.wave-fill-primary {
    fill: var(--eagle-primary-container);
}

.wave-fill-white {
    fill: #ffffff;
}

.wave-fill-pledge {
    fill: #0a2540;
    /* Matches .eagle-pledge-strip start color */
}

.wave-fill-social {
    fill: #f9f9f7;
    /* Matches .eagle-social-section bg-surface-container-low */
}

/* Section specific spacing helpers */
.eagle-wave-section-top {
    padding-top: 3.5rem;
    margin-top: -0.5rem;
}

/* Wave color fills — matched to section backgrounds */
.wave-fill-white {
    fill: #ffffff;
}

.wave-fill-surface {
    fill: #f9f9f7;
}

.wave-fill-neutral {
    fill: #f4f4f2;
}

.wave-fill-warm {
    fill: #fffaf6;
}

.wave-fill-dark {
    fill: #0a2540;
}

.wave-fill-navy {
    fill: #0c2b52;
}

.wave-fill-pledge {
    fill: #0a2540;
}

.wave-fill-hero {
    fill: var(--eagle-primary-container, #0c2b52);
}

.wave-fill-social {
    fill: #f9f9f7;
}

.wave-fill-footer {
    fill: #071B30;
}


/* ════════════════════════════════════════════════════════════
   2. ANIMATED WAVE MOTION
   ════════════════════════════════════════════════════════════ */

/* Dual-layer animated wave: background layer drifts slowly */
.wave-animate {
    animation: wave-drift 18s ease-in-out infinite alternate;
    transform-origin: center;
    will-change: transform;
}

.wave-animate--slow {
    animation-duration: 25s;
}

.wave-animate--reverse {
    animation-direction: alternate-reverse;
}

@keyframes wave-drift {
    0% {
        transform: translateX(0) scaleY(1);
    }

    50% {
        transform: translateX(-12px) scaleY(1.04);
    }

    100% {
        transform: translateX(8px) scaleY(0.97);
    }
}

/* Secondary wave layer — offset timing for parallax depth */
.wave-layer-2 {
    opacity: 0.45;
    animation: wave-drift-2 22s ease-in-out infinite alternate;
    will-change: transform;
}

@keyframes wave-drift-2 {
    0% {
        transform: translateX(4px) scaleY(0.96);
    }

    50% {
        transform: translateX(-8px) scaleY(1.02);
    }

    100% {
        transform: translateX(12px) scaleY(1);
    }
}


/* ════════════════════════════════════════════════════════════
   3. LAYERED DEPTH SYSTEM
   ════════════════════════════════════════════════════════════ */

/* Section depth wrapper — enables layered positioning */
.eagle-depth-section {
    position: relative;
    overflow: hidden;
}

/* Depth Layer 1: Base gradient background */
.depth-base {
    position: relative;
    z-index: 0;
}

/* Depth Layer 2: Soft blur/shadow overlay */
.depth-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.depth-overlay--top-shadow {
    background: linear-gradient(180deg, rgba(0, 15, 34, 0.06) 0%, transparent 40%);
}

.depth-overlay--bottom-glow {
    background: linear-gradient(0deg, rgba(0, 15, 34, 0.04) 0%, transparent 30%);
}

/* ════════════════════════════════════════════════════════════
   4. DECORATIVE WAVE PATTERN (Footer / Backgrounds)
   ════════════════════════════════════════════════════════════ */

.eagle-footer-wave-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='800' height='200' viewBox='0 0 800 200'%3E%3Cpath d='M0 100 Q 200 150 400 100 T 800 100 V 200 H 0 Z' fill='%23ffffff'/%3E%3C/svg%3E");
    background-size: 800px 200px;
    background-repeat: repeat-x;
    background-position: bottom;
    pointer-events: none;
    z-index: 0;
    animation: footer-wave-drift 40s linear infinite;
}

.eagle-footer-wave-pattern-2 {
    position: absolute;
    inset: 0;
    opacity: 0.02;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1000' height='250' viewBox='0 0 1000 250'%3E%3Cpath d='M0 150 Q 250 100 500 150 T 1000 150 V 250 H 0 Z' fill='%23ffffff'/%3E%3C/svg%3E");
    background-size: 1000px 250px;
    background-repeat: repeat-x;
    background-position: bottom;
    pointer-events: none;
    z-index: 0;
    animation: footer-wave-drift 60s linear infinite reverse;
    bottom: -50px;
}

@keyframes footer-wave-drift {
    from {
        background-position-x: 0;
    }

    to {
        background-position-x: 1000px;
    }
}

.wave-layer-3 {
    opacity: 0.2;
    animation: wave-drift 15s ease-in-out infinite alternate-reverse;
}

.depth-overlay--radial-navy {
    background: radial-gradient(ellipse at 30% 20%, rgba(10, 37, 64, 0.04) 0%, transparent 60%);
}

.depth-overlay--radial-warm {
    background: radial-gradient(ellipse at 70% 80%, rgba(254, 107, 0, 0.03) 0%, transparent 60%);
}

/* Depth Layer 3: Content cards overlap wave edges */
.depth-content {
    position: relative;
    z-index: 5;
}

/* Glassmorphism Utilities */
.eagle-glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.eagle-glass-dark {
    background: rgba(10, 37, 64, 0.6);
    backdrop-filter: blur(12px) saturate(160%);
    -webkit-backdrop-filter: blur(12px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.eagle-card-premium {
    border: none;
    box-shadow: 0 10px 30px rgba(0, 15, 34, 0.05);
    transition: all 0.3s ease;
}

.eagle-card-premium:hover {
    box-shadow: 0 20px 50px rgba(0, 15, 34, 0.1);
}


/* ════════════════════════════════════════════════════════════
   4. SCROLL-REVEAL ANIMATION SYSTEM
   ════════════════════════════════════════════════════════════ */

/* Elements start invisible and slide up when they enter viewport */
.reveal-on-scroll {
    /* opacity: 0; */
    /* transform: translateY(28px); */
    transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: opacity, transform;
}

.reveal-on-scroll.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered delay variants */
.reveal-delay-1 {
    transition-delay: 0.08s;
}

.reveal-delay-2 {
    transition-delay: 0.16s;
}

.reveal-delay-3 {
    transition-delay: 0.24s;
}

.reveal-delay-4 {
    transition-delay: 0.32s;
}

.reveal-delay-5 {
    transition-delay: 0.40s;
}

.reveal-delay-6 {
    transition-delay: 0.48s;
}

/* Reveal from left */
.reveal-from-left {
    /* opacity: 0; */
    transform: translateX(-32px);
    transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: opacity, transform;
}

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

/* Reveal from right */
.reveal-from-right {
    /* opacity: 0; */
    transform: translateX(32px);
    transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: opacity, transform;
}

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

/* Scale-in reveal for cards */
.reveal-scale {
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: opacity, transform;
}

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


/* ════════════════════════════════════════════════════════════
   5. MICRO-INTERACTIONS
   ════════════════════════════════════════════════════════════ */

/* Card hover lift */
.eagle-hover-lift {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.eagle-hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(0, 15, 34, 0.12);
}

/* Button glow effect */
.eagle-btn-glow {
    position: relative;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.eagle-btn-glow::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.eagle-btn-glow:hover::after {
    opacity: 1;
}

.eagle-btn-glow:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(254, 107, 0, 0.35);
}

/* Gradient shift on hover */
.eagle-btn-gradient-shift {
    background-size: 200% 200%;
    transition: background-position 0.4s ease, transform 0.25s ease;
}

.eagle-btn-gradient-shift:hover {
    background-position: 100% 100%;
    transform: translateY(-2px);
}

/* Section heading accent animation */
.sct-accent-bar-animated {
    display: block;
    width: 0;
    height: 3px;
    background: var(--eagle-secondary);
    border-radius: 2px;
    margin-top: 0.75rem;
    transition: width 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.revealed .sct-accent-bar-animated,
.sct-accent-bar-animated.revealed {
    width: 3rem;
}

/* Counter number grow effect */
.stat-number-animate {
    display: inline-block;
    transition: transform 0.3s ease;
}

.stat-number-animate:hover {
    transform: scale(1.08);
}

/* Icon pulse effect for stat cards */
.stat-icon-pulse {
    transition: transform 0.4s ease, opacity 0.4s ease;
}

.impact-stat-card:hover .stat-icon-pulse {
    transform: scale(1.15);
    opacity: 0.5;
}


/* ════════════════════════════════════════════════════════════
   6. PARALLAX DEPTH (CSS-only for performance)
   ════════════════════════════════════════════════════════════ */

/* Parallax container — activated by JS for scroll-linked movement */
.parallax-wave {
    transition: transform 0.1s linear;
    will-change: transform;
}


/* ════════════════════════════════════════════════════════════
   7. FLOATING / BREATHING ANIMATIONS
   ════════════════════════════════════════════════════════════ */

@keyframes float-gentle {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }

    100% {
        transform: translateY(0);
    }
}

.eagle-float-gentle {
    animation: float-gentle 5s ease-in-out infinite;
}

@keyframes pulse-ring {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }

    50% {
        transform: scale(1.08);
        opacity: 0.3;
    }

    100% {
        transform: scale(1);
        opacity: 0.6;
    }
}

.eagle-pulse-ring {
    animation: pulse-ring 3s ease-in-out infinite;
}

/* Radar sweep — for hero section decorative */
@keyframes radar-sweep {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.eagle-radar-sweep {
    animation: radar-sweep 8s linear infinite;
    transform-origin: center;
}

/* Soft glow breathing */
@keyframes glow-breathe {
    0% {
        opacity: 0.3;
        filter: blur(60px);
    }

    50% {
        opacity: 0.5;
        filter: blur(80px);
    }

    100% {
        opacity: 0.3;
        filter: blur(60px);
    }
}

.eagle-glow-breathe {
    animation: glow-breathe 6s ease-in-out infinite;
}


/* ════════════════════════════════════════════════════════════
   8. SECTION TRANSITION ENRICHMENT
   ════════════════════════════════════════════════════════════ */

/* Extra padding on sections with wave dividers to accommodate the wave height */
.eagle-wave-section-top {
    padding-top: calc(3.5rem + 56px);
    /* base padding + wave height */
}

.eagle-wave-section-bottom {
    padding-bottom: calc(3.5rem + 56px);
}

@media (min-width: 992px) {
    .eagle-wave-section-top {
        /* padding-top: calc(4.5rem + 56px); */
        padding-top: calc(4.5rem + 10px);
    }

    .eagle-wave-section-bottom {
        /* padding-bottom: calc(4.5rem + 56px); */
        padding-bottom: calc(4.5rem + 30px);
    }
}

/* Gradient transitions between sections for seamless visual flow */
.section-gradient-bridge {
    position: absolute;
    left: 0;
    right: 0;
    height: 120px;
    pointer-events: none;
    z-index: 0;
}

.section-gradient-bridge--to-neutral {
    bottom: 0;
    background: linear-gradient(180deg, transparent 0%, #f4f4f2 100%);
}

.section-gradient-bridge--to-white {
    bottom: 0;
    background: linear-gradient(180deg, transparent 0%, #ffffff 100%);
}


/* ════════════════════════════════════════════════════════════
   9. RESPONSIVE ADJUSTMENTS
   ════════════════════════════════════════════════════════════ */

@media (max-width: 767.98px) {
    .wave-divider svg {
        height: 32px;
    }

    .wave-divider--lg svg {
        height: 48px;
    }

    .eagle-wave-section-top {
        padding-top: calc(2.5rem + 32px);
    }

    .eagle-wave-section-bottom {
        padding-bottom: calc(2.5rem + 32px);
    }

    .reveal-on-scroll {
        transform: translateY(20px);
    }

    .reveal-from-left,
    .reveal-from-right {
        transform: translateX(0) translateY(20px);
    }
}


/* ════════════════════════════════════════════════════════════
   10. ACCESSIBILITY — Respect prefers-reduced-motion
   ════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {

    .wave-animate,
    .wave-layer-2,
    .eagle-float-gentle,
    .eagle-pulse-ring,
    .eagle-radar-sweep,
    .eagle-glow-breathe {
        animation: none !important;
    }

    .reveal-on-scroll,
    .reveal-from-left,
    .reveal-from-right,
    .reveal-scale {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    .eagle-hover-lift:hover {
        transform: none !important;
    }

    .parallax-wave {
        transform: none !important;
        transition: none !important;
    }
}