/* ============================================================
   ===== VISUAL FLOW UPGRADE =====
   Scroll progress bar, section dividers, per-section entrance
   transitions, aurora backgrounds, cursor card glow, title
   reveal. Decorative elements are injected by enhancements.js.
   ============================================================ */

/*===== SCROLL PROGRESS BAR =====*/
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 2001;
    background: linear-gradient(90deg, var(--gold) 0%, var(--gold-light) 45%, var(--navy-light) 100%);
    box-shadow: 0 0 10px rgba(240, 192, 64, 0.4);
    transform-origin: 0 50%;
    transform: scaleX(0);
    pointer-events: none;
}

/*===== SECTION DIVIDERS =====*/
.sdiv {
    position: relative;
    z-index: 2;
    pointer-events: none;
}

.sdiv--shape {
    height: clamp(44px, 7vw, 92px);
    margin-top: calc(-1 * clamp(44px, 7vw, 92px));
    overflow: hidden;
}

.sdiv__svg {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.sdiv--flip .sdiv__svg {
    transform: scaleX(-1) translateY(16px);
}

.sdiv.sdiv-in .sdiv__svg {
    opacity: 1;
    transform: none;
}

.sdiv--flip.sdiv-in .sdiv__svg {
    transform: scaleX(-1);
}

.sdiv__svg svg {
    display: block;
    width: 100%;
    height: 100%;
}

.sdiv--wave .sdiv__svg svg {
    width: 200%;
    animation: sdivDrift 17s linear infinite;
}

.sdiv--echo-wave .sdiv__svg {
    filter: drop-shadow(0 -10px 22px rgba(27, 58, 107, 0.08));
}

.sdiv--echo-wave .sdiv__svg path:first-of-type {
    fill: rgba(255, 255, 255, 0.78);
}

.sdiv--contact-wave.sdiv--shape {
    height: clamp(42px, 6vw, 76px);
    margin-top: calc(-1 * clamp(22px, 3vw, 40px));
}

.sdiv--contact-wave::before {
    content: '';
    position: absolute;
    inset: -1px 0 auto;
    height: 42%;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(244, 247, 251, 0.42), rgba(244, 247, 251, 0));
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.sdiv--contact-wave .sdiv__svg {
    filter: drop-shadow(0 -8px 18px rgba(17, 35, 71, 0.12));
    transition-duration: 1s;
}

.sdiv--contact-wave .sdiv__svg svg {
    animation-duration: 21s;
}

.sdiv--contact-wave.sdiv-in::before {
    opacity: 1;
    transform: none;
}

@keyframes sdivDrift {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* Ornament divider, used between same-colored sections */
.sdiv--orn {
    height: 0;
    overflow: visible;
}

.sdiv__orn {
    position: absolute;
    left: 50%;
    top: 0;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.sdiv__orn-line {
    width: clamp(56px, 14vw, 170px);
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(27, 58, 107, 0.4));
    transform: scaleX(0);
    transform-origin: right center;
    transition: transform 0.9s 0.1s cubic-bezier(0.22, 1, 0.36, 1);
}

.sdiv__orn-line--r {
    background: linear-gradient(270deg, transparent, rgba(27, 58, 107, 0.4));
    transform-origin: left center;
}

.sdiv__orn-gem {
    width: 9px;
    height: 9px;
    flex-shrink: 0;
    border-radius: 2px;
    background: var(--gold);
    box-shadow: 0 0 0 4px rgba(196, 154, 10, 0.14), 0 0 16px rgba(196, 154, 10, 0.4);
    transform: rotate(45deg) scale(0);
    transition: transform 0.7s 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sdiv.sdiv-in .sdiv__orn-line {
    transform: scaleX(1);
}

.sdiv.sdiv-in .sdiv__orn-gem {
    transform: rotate(45deg) scale(1);
    animation: sdivGemSpin 6s 1.2s ease-in-out infinite;
}

@keyframes sdivGemSpin {
    0%, 100% { transform: rotate(45deg) scale(1); }
    50%      { transform: rotate(225deg) scale(1.18); }
}

/*===== PER-SECTION ENTRANCE TRANSITIONS =====*/
html.stx-enabled .section[data-stx] {
    transition:
        opacity 0.9s ease,
        transform 0.95s cubic-bezier(0.22, 1, 0.36, 1),
        clip-path 1.1s cubic-bezier(0.4, 0, 0.2, 1);
}

html.stx-enabled .section[data-stx="rise"]    { opacity: 0; transform: translateY(48px); }
html.stx-enabled .section[data-stx="zoom"]    { opacity: 0; transform: scale(0.965); }
html.stx-enabled .section[data-stx="slide-l"] { opacity: 0; transform: translateX(-56px); }
html.stx-enabled .section[data-stx="slide-r"] { opacity: 0; transform: translateX(56px); }
html.stx-enabled .section[data-stx="tilt"]    { opacity: 0; transform: perspective(1100px) rotateX(5deg) translateY(36px); transform-origin: 50% 0; }
html.stx-enabled .section[data-stx="wipe"]    { clip-path: inset(0 0 100% 0); }

html.stx-enabled .section[data-stx].stx-in {
    opacity: 1;
    transform: none;
}

html.stx-enabled .section[data-stx="wipe"].stx-in {
    clip-path: inset(0 0 0 0);
}

html.stx-enabled .section[data-stx].stx-settled {
    transition: none;
    clip-path: none;
}

/*===== AURORA BACKGROUND LAYERS =====*/
.section-aurora {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.section-aurora span {
    position: absolute;
    width: clamp(300px, 38vw, 580px);
    aspect-ratio: 1;
    border-radius: 50%;
    filter: blur(64px);
    opacity: 0.5;
}

.section-aurora span:nth-child(1) {
    top: -10%;
    left: -8%;
    background: radial-gradient(circle, rgba(240, 192, 64, 0.30), transparent 64%);
    animation: auroraDriftA 26s ease-in-out infinite alternate;
}

.section-aurora span:nth-child(2) {
    bottom: -14%;
    right: -6%;
    background: radial-gradient(circle, rgba(40, 85, 160, 0.26), transparent 64%);
    animation: auroraDriftB 33s ease-in-out infinite alternate;
}

.section-aurora span:nth-child(3) {
    top: 32%;
    left: 52%;
    width: clamp(220px, 26vw, 420px);
    background: radial-gradient(circle, rgba(86, 160, 128, 0.22), transparent 64%);
    animation: auroraDriftC 39s ease-in-out infinite alternate;
}

.section-aurora--dark span {
    mix-blend-mode: screen;
}

.section-aurora--dark span:nth-child(1) {
    background: radial-gradient(circle, rgba(240, 192, 64, 0.20), transparent 64%);
}

.section-aurora--dark span:nth-child(2) {
    background: radial-gradient(circle, rgba(111, 170, 255, 0.18), transparent 64%);
}

.section-aurora--dark span:nth-child(3) {
    background: radial-gradient(circle, rgba(255, 255, 255, 0.10), transparent 64%);
}

@keyframes auroraDriftA {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to   { transform: translate3d(9%, 14%, 0) scale(1.18); }
}

@keyframes auroraDriftB {
    from { transform: translate3d(0, 0, 0) scale(1.1); }
    to   { transform: translate3d(-11%, -10%, 0) scale(0.94); }
}

@keyframes auroraDriftC {
    from { transform: translate3d(0, 0, 0) scale(0.96); }
    to   { transform: translate3d(-14%, 12%, 0) scale(1.16); }
}

/*===== CURSOR-FOLLOW CARD GLOW =====*/
.glow-host {
    position: relative;
}

.card-glow {
    position: absolute;
    inset: 0;
    z-index: 3;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.35s ease;
    background: radial-gradient(420px circle at var(--gx, 50%) var(--gy, 50%),
        rgba(240, 192, 64, 0.16),
        rgba(240, 192, 64, 0.05) 42%,
        transparent 68%);
}

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

/*===== SECTION TITLE BLUR-RISE REVEAL =====*/
[data-title-anim] {
    opacity: 0;
    transform: translateY(18px);
    filter: blur(6px);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1), filter 0.7s ease;
}

[data-title-anim].title-revealed {
    opacity: 1;
    transform: none;
    filter: none;
}

/*===== SCROLL-LINKED PARALLAX (modern browsers) =====*/
@supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) {
        .section__bg-icons {
            animation: sectionLayerParallax linear both;
            animation-timeline: view();
            animation-range: cover 0% cover 100%;
        }

        .section-aurora {
            animation: auroraParallax linear both;
            animation-timeline: view();
            animation-range: cover 0% cover 100%;
        }
    }
}

@keyframes sectionLayerParallax {
    from { transform: translateY(6%); }
    to   { transform: translateY(-6%); }
}

@keyframes auroraParallax {
    from { transform: translateY(4%); }
    to   { transform: translateY(-4%); }
}

/*===== VISUAL FLOW: SMALL SCREENS =====*/
@media screen and (max-width: 560px) {
    .section-aurora span {
        filter: blur(44px);
    }

    .section-aurora span:nth-child(3) {
        display: none;
    }

    .sdiv__orn-line {
        width: clamp(40px, 18vw, 90px);
    }
}

/*===== VISUAL FLOW: REDUCED MOTION =====*/
@media (prefers-reduced-motion: reduce) {
    .sdiv__svg,
    .sdiv__orn-line,
    .sdiv__orn-gem,
    [data-title-anim] {
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
        animation: none !important;
        transition: none !important;
    }

    .sdiv__orn-gem {
        transform: rotate(45deg) !important;
    }

    .sdiv--flip .sdiv__svg {
        transform: scaleX(-1) !important;
    }

    .sdiv--wave .sdiv__svg svg,
    .section-aurora span,
    .section-aurora,
    .section__bg-icons {
        animation: none !important;
    }
}
