/* ═══════════════════════════════════════════════════════════════════════════
   NEXT.ENERGY — Fintech Ambient Animations v3
   Wireframe cubes, circuit lines, energy grid — premium & subtle
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Reduce motion ──────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .ambient-canvas,
    .hero-glow,
    .page-hero::after,
    .stat-strip::before,
    .spec-card::before,
    .anchor-bar::after,
    .hero-mark::after,
    .phase::before { display: none !important; }

    * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

/* ══════════════════════════════════════════════════════════════════════════
   CANVAS LAYER — shared base for all injected canvases
   ══════════════════════════════════════════════════════════════════════════ */
.ambient-canvas {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.has-particles {
    position: relative;
    overflow: hidden;
}

.has-particles > *:not(.ambient-canvas) {
    position: relative;
    z-index: 1;
}

/* ══════════════════════════════════════════════════════════════════════════
   HERO — keep content above canvas
   ══════════════════════════════════════════════════════════════════════════ */
.hero {
    isolation: isolate;
}

.hero-content,
.hero-mark {
    position: relative;
    z-index: 1;
}

/* ══════════════════════════════════════════════════════════════════════════
   PAGE HERO — subtle radial light drift
   ══════════════════════════════════════════════════════════════════════════ */
.page-hero {
    position: relative;
    overflow: hidden;
}

.page-hero .container {
    position: relative;
    z-index: 1;
}

.page-hero::after {
    content: '';
    position: absolute;
    top: -40%;
    right: -15%;
    width: 55%;
    height: 180%;
    background: radial-gradient(
        ellipse at center,
        rgba(74, 144, 164, 0.1) 0%,
        rgba(74, 144, 164, 0.04) 40%,
        transparent 68%
    );
    animation: heroDrift 14s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
    will-change: transform;
}

@keyframes heroDrift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%       { transform: translate(-5%, 6%) scale(1.08); }
}

/* ══════════════════════════════════════════════════════════════════════════
   STAT STRIP — horizontal energy scan line
   ══════════════════════════════════════════════════════════════════════════ */
.stat-strip {
    position: relative;
    overflow: hidden;
}

.stat-strip::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 40%; height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(74, 144, 164, 0.07) 50%,
        transparent 100%
    );
    animation: scanLine 8s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

.stat-strip-grid {
    position: relative;
    z-index: 1;
}

@keyframes scanLine {
    0%   { left: -40%; opacity: 0; }
    8%   { opacity: 1; }
    60%  { left: 140%; opacity: 0; }
    100% { left: 140%; opacity: 0; }
}

/* ══════════════════════════════════════════════════════════════════════════
   SPEC CARD — data-block sheen sweep
   ══════════════════════════════════════════════════════════════════════════ */
.spec-card {
    position: relative;
    overflow: hidden;
}

.spec-card::before {
    content: '';
    position: absolute;
    top: 0; left: -120%;
    width: 55%; height: 100%;
    background: linear-gradient(
        105deg,
        transparent 0%,
        rgba(74, 144, 164, 0.07) 45%,
        rgba(140, 188, 201, 0.04) 55%,
        transparent 100%
    );
    animation: blockSheen 11s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

.spec-card > * { position: relative; z-index: 1; }

@keyframes blockSheen {
    0%        { left: -120%; opacity: 0; }
    5%        { opacity: 1; }
    45%, 100% { left: 160%; opacity: 0; }
}

/* ══════════════════════════════════════════════════════════════════════════
   ANCHOR BAR — left border pulse
   ══════════════════════════════════════════════════════════════════════════ */
.anchor-bar {
    position: relative;
    overflow: hidden;
}

.anchor-bar::after {
    content: '';
    position: absolute;
    left: 0; top: 0;
    width: 3px; height: 100%;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(74, 144, 164, 0.8) 40%,
        rgba(140, 188, 201, 0.6) 60%,
        transparent 100%
    );
    animation: borderPulse 5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes borderPulse {
    0%, 100% { opacity: 0.5; transform: scaleY(1) translateY(0); }
    50%       { opacity: 1;   transform: scaleY(1.02) translateY(-2px); }
}

/* ══════════════════════════════════════════════════════════════════════════
   HERO MARK — diagonal sweep glint
   ══════════════════════════════════════════════════════════════════════════ */
.hero-mark {
    isolation: isolate;
}

.hero-mark::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        transparent 20%,
        rgba(255, 255, 255, 0.04) 50%,
        transparent 80%
    );
    background-size: 200% 200%;
    animation: markGlint 9s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes markGlint {
    0%   { background-position: 200% 200%; }
    50%  { background-position: -50% -50%; }
    100% { background-position: 200% 200%; }
}

/* ══════════════════════════════════════════════════════════════════════════
   STAT CARDS — hover cube-like border flash
   ══════════════════════════════════════════════════════════════════════════ */
.stat-card {
    transition: box-shadow 0.4s ease, border-color 0.4s ease;
}

.stat-card:hover {
    box-shadow: 0 0 0 1px rgba(74, 144, 164, 0.18),
                0 6px 28px rgba(74, 144, 164, 0.10);
}

/* ══════════════════════════════════════════════════════════════════════════
   MILESTONE CARDS — fintech lift
   ══════════════════════════════════════════════════════════════════════════ */
.milestone {
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.milestone:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(74, 144, 164, 0.13);
}

/* ══════════════════════════════════════════════════════════════════════════
   PHASE CARDS — bottom-up data fill on hover
   ══════════════════════════════════════════════════════════════════════════ */
.phase {
    position: relative;
    overflow: hidden;
}

.phase::before {
    content: '';
    position: absolute;
    bottom: -100%; left: 0; right: 0;
    height: 100%;
    background: linear-gradient(
        0deg,
        rgba(74, 144, 164, 0.06) 0%,
        transparent 100%
    );
    transition: bottom 0.55s ease;
    pointer-events: none;
}

.phase:hover::before {
    bottom: 0;
}

/* ══════════════════════════════════════════════════════════════════════════
   FAQ ITEMS — subtle left edge trace on expand
   ══════════════════════════════════════════════════════════════════════════ */
.faq-question.open {
    border-left: 2px solid rgba(74, 144, 164, 0.5);
    padding-left: 12px;
    transition: border-left 0.3s ease, padding-left 0.3s ease;
}

/* ══════════════════════════════════════════════════════════════════════════
   STEP CIRCLES — outer ring pulse on visible
   ══════════════════════════════════════════════════════════════════════════ */
.step-circle {
    animation: ringBreath 4s ease-in-out infinite;
    will-change: box-shadow;
}

@keyframes ringBreath {
    0%, 100% { box-shadow: 0 0 0 0 rgba(74,144,164,0); }
    50%       { box-shadow: 0 0 0 6px rgba(74,144,164,0.12); }
}


/* ══════════════════════════════════════════════════════════════════════════
   PAGE HERO RIBBON CANVAS - ensure text is above the canvas
   ══════════════════════════════════════════════════════════════════════════ */

.page-hero .container,
.page-hero .container-narrow {
    position: relative;
    z-index: 1;
}

.page-hero canvas.wave-canvas {
    z-index: 0;
}
