/* ============================================================
   "Wow" animation layer (design preview, /preview/home).
   Loaded only when the layout receives $wowMode. Pure presentation:
   the page content is byte-identical to the live homepage.
   ============================================================ */

/* ---- Pre-hide the hero so the GSAP entrance starts clean.
       wow.js restores everything; if anything fails, .wow-fallback
       force-reveals, and reduced-motion users never hide at all. */
.wow-mode section:first-of-type h1,
.wow-mode section:first-of-type h1 ~ *,
.wow-mode section:first-of-type picture {
    opacity: 0;
}
.wow-fallback section:first-of-type h1,
.wow-fallback section:first-of-type h1 ~ *,
.wow-fallback section:first-of-type picture {
    opacity: 1 !important;
}
@media (prefers-reduced-motion: reduce) {
    .wow-mode section:first-of-type h1,
    .wow-mode section:first-of-type h1 ~ *,
    .wow-mode section:first-of-type picture {
        opacity: 1 !important;
    }
}

/* ---- Scroll progress bar (brand gradient, top of viewport) */
.wow-progress {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #224685, #3b82f6 55%, #8b5cf6);
    transform: scaleX(0);
    transform-origin: 0 50%;
    z-index: 9999;
    pointer-events: none;
}

/* ---- Three.js hero canvas sits behind the hero content */
.wow-hero { position: relative; overflow: hidden; }
.wow-hero > .container-page { position: relative; z-index: 1; }
.wow-canvas {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

/* ---- Headline word-reveal wrappers. The padding/negative-margin pair
       keeps descenders (g, y, p) inside the mask instead of clipped. */
.wow-w {
    display: inline-block;
    overflow: hidden;
    vertical-align: bottom;
    padding-bottom: 0.14em;
    margin-bottom: -0.14em;
}
.wow-w > span { display: inline-block; will-change: transform; }

/* ---- Section-heading character reveal (3D flip + focus pull) */
.wow-ch-wrap { perspective: 700px; }
.wow-cw { display: inline-block; white-space: pre; }
.wow-c  {
    display: inline-block;
    will-change: transform, filter, opacity;
    transform-origin: 50% 100%;
    backface-visibility: hidden;
}

/* ---- One-time light sweep over a landed heading. Implemented as an
       overlay bar (NOT background-clip:text, which goes invisible when
       the per-character spans carry their own transforms). */
.wow-sweep { position: relative; }
.wow-sweep::after {
    content: "";
    position: absolute;
    top: -10%; bottom: -10%;
    left: -30%;
    width: 22%;
    background: linear-gradient(105deg, transparent,
                var(--wow-sweep-c, rgba(59, 130, 246, .18)), transparent);
    transform: skewX(-18deg);
    pointer-events: none;
    animation: wow-sweep .9s ease-in-out forwards;
}
@keyframes wow-sweep {
    from { left: -30%; }
    to   { left: 115%; }
}

/* ---- 3D tilt cards: cursor-tracked glow via CSS vars set in JS */
.wow-tilt {
    transform-style: preserve-3d;
    will-change: transform;
    position: relative;
}
.wow-tilt::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 50%),
                rgba(59, 130, 246, 0.10), transparent 65%);
    opacity: 0;
    transition: opacity .35s ease;
    pointer-events: none;
}
.wow-tilt:hover::after { opacity: 1; }

/* ---- Primary pill buttons get a sheen sweep on hover */
.wow-mode a.rounded-full {
    position: relative;
    overflow: hidden;
}
.wow-mode a.rounded-full::before {
    content: "";
    position: absolute;
    top: 0; bottom: 0;
    left: -75%;
    width: 50%;
    background: linear-gradient(105deg, transparent, rgba(255, 255, 255, .35), transparent);
    transform: skewX(-20deg);
    transition: left .6s ease;
    pointer-events: none;
}
.wow-mode a.rounded-full:hover::before { left: 125%; }

/* ---- Drifting colour orbs in tinted bands (bolder than v1) */
.wow-orb {
    position: absolute;
    border-radius: 9999px;
    filter: blur(64px);
    pointer-events: none;
    z-index: 0;
    will-change: transform;
}
.wow-orb-host { position: relative; overflow: hidden; }
.wow-orb-host > .container-page { position: relative; z-index: 1; }

/* ---- Cursor spotlight across the navy bands */
.wow-spot::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(560px circle at var(--mx, 50%) var(--my, 50%),
                rgba(255, 255, 255, .09), transparent 70%);
    opacity: 0;
    transition: opacity .4s ease;
    pointer-events: none;
    z-index: 0;
}
.wow-spot:hover::after { opacity: 1; }

/* ---- 1-2-3 journey line (decorative SVG behind the step numbers) */
.wow-steps-svg {
    position: absolute;
    left: 0; right: 0;
    top: -18px;
    width: 100%;
    height: 150px;
    pointer-events: none;
}

/* ---- Sticky header lift once the page is scrolled */
.wow-mode header { transition: box-shadow .3s ease; }
.wow-scrolled header { box-shadow: 0 6px 24px -12px rgba(15, 23, 42, .25); }

/* ============================================================
   Brand intro overlay (~2s). Server-rendered, JS-choreographed.
   The CSS failsafe animation guarantees it disappears even if
   every script on the page fails to load.
   ============================================================ */
#wow-intro {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(120% 120% at 50% 40%, #2d5aa8 0%, #224685 45%, #122541 100%);
    animation: wow-intro-bail .5s ease 5.8s forwards;
}
.wow-intro-skip { display: none !important; }
@keyframes wow-intro-bail {
    to { opacity: 0; visibility: hidden; pointer-events: none; }
}
@media (prefers-reduced-motion: reduce) {
    #wow-intro { display: none !important; }
}
.wow-intro-inner {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.wow-intro-s {
    height: 220px;
    width: auto;
    opacity: 0; /* hidden until GSAP animates it in: no static flash */
    will-change: transform, filter, opacity;
    position: relative;
    z-index: 1;
}
.wow-intro-words {
    position: absolute;
    inset: 0;
    z-index: 2;          /* the column rises IN FRONT of the glowing S */
    pointer-events: none;
}
.wow-intro-words span {
    position: absolute;
    left: 50%;
    top: 50%;
    color: #fff;
    font-size: 3.4rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    opacity: 0;
    will-change: transform, opacity;
    white-space: nowrap;
    text-shadow: 0 2px 28px rgba(18, 37, 65, .85);
}
.wow-intro-words .wow-intro-brand {
    background: linear-gradient(90deg, #93c5fd, #fff 50%, #c4b5fd);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
@media (max-width: 640px) {
    .wow-intro-s { height: 150px; }
    .wow-intro-words span { font-size: 2rem; }
}
