/* ============================================================
   SCROLL CINEMATIQUE — Coeur-Satellite Builder
   ============================================================ */

/* Fix: overflow-x:hidden on html breaks position:sticky.
   overflow-x:clip clips the same way but preserves sticky. */
html, body {
    overflow-x: clip !important;
}

/* --- Section (scroll spacer) --- */
.sc-section {
    position: relative;
    height: 420vh; /* fallback — JS adjusts dynamically */
    margin-top: 0;
    background: #060e1a;
}
/* Fade out to ambient bg at the very bottom of the scroll spacer */
.sc-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 400px;
    background: linear-gradient(to bottom,
        transparent 0%,
        rgba(6, 14, 26, 0.95) 10%,
        rgba(15, 30, 55, 0.85) 25%,
        rgba(80, 120, 160, 0.5) 50%,
        rgba(200, 220, 235, 0.7) 75%,
        #e4ecf5 100%);
    pointer-events: none;
    z-index: 3;
}

/* --- Sticky Viewport --- */
.sc-viewport {
    position: -webkit-sticky;
    position: sticky;
    top: 90px;
    height: calc(100vh - 90px);
    height: calc(100dvh - 90px);
    display: flex;
    align-items: center;
    overflow: hidden;
    transition: background 0.5s ease;
    z-index: 2;
    background:
        radial-gradient(ellipse at 60% 50%, rgba(0, 119, 182, 0.06) 0%, transparent 70%),
        linear-gradient(180deg, #060e1a 0%, #0a1628 50%, #060e1a 100%);
}

/* Subtle tech grid overlay */
.sc-viewport::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 180, 216, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 180, 216, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
}
.sc-viewport > .container {
    position: relative;
    width: 100%;
    z-index: 1;
}

/* ============================================================
   SECTION HEADER — sits in light zone above the dark viewport
   ============================================================ */
.sc-top-header {
    position: relative;
    z-index: 5;
    text-align: center;
    padding: 40px 0 0;
    margin-bottom: -10px;
}
.sc-top-header .section-badge {
    position: relative;
    z-index: 5;
}

/* ============================================================
   TWO-COLUMN LAYOUT
   ============================================================ */
.sc-layout {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 48px;
    align-items: center;
    min-height: 58vh;
}

/* ============================================================
   NARRATIVE PANEL (left column)
   ============================================================ */
.sc-narrative {
    position: relative;
    min-height: 280px;
}
.sc-text-block {
    position: absolute;
    top: 0; left: 0; right: 0;
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.55s cubic-bezier(0.25, 0.8, 0.25, 1),
                transform 0.55s cubic-bezier(0.25, 0.8, 0.25, 1);
    pointer-events: none;
    will-change: opacity, transform;
}
.sc-text-block.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Typography (dark mode) */
.sc-text-block h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    color: #f0f7ff;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

/* Phase 0 intro — larger, more impactful */
.sc-text-block[data-phase="0"] h3 {
    font-size: 2.1rem;
    line-height: 1.2;
}
.sc-text-block[data-phase="0"] .sc-meta-item {
    background: rgba(0, 180, 216, 0.08);
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid rgba(0, 180, 216, 0.12);
}
/* Shimmer override for dark background */
.sc-section .shimmer {
    background: linear-gradient(90deg, #4dd9f0, #00b4d8, #8be9fd, #00b4d8, #4dd9f0);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmerSlide 4s ease-in-out infinite;
}
@keyframes shimmerSlide {
    0% { background-position: 0% center; }
    50% { background-position: 100% center; }
    100% { background-position: 0% center; }
}
.sc-text-block p {
    font-size: 1rem;
    color: rgba(200, 220, 240, 0.75);
    line-height: 1.75;
    margin-bottom: 16px;
}

/* Scroll hint */
.sc-scroll-hint {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: rgba(100, 180, 220, 0.5);
    margin-top: 4px;
    animation: sc-bounce-hint 2s ease-in-out infinite;
}
.sc-scroll-hint i { width: 16px; height: 16px; }

@keyframes sc-bounce-hint {
    0%, 100% { transform: translateY(0); opacity: 0.5; }
    50% { transform: translateY(6px); opacity: 1; }
}

/* Phase labels */
.sc-phase-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 50px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 14px;
    background: rgba(100, 180, 220, 0.1);
    color: rgba(150, 200, 230, 0.7);
}
.sc-phase-label i { width: 14px; height: 14px; }
.sc-label-core { background: rgba(0, 180, 216, 0.12); color: #4dd9f0; }
.sc-label-inner { background: rgba(0, 119, 182, 0.15); color: #5ab8e0; }
.sc-label-outer { background: rgba(16, 185, 129, 0.12); color: #34d399; }
.sc-label-complete { background: rgba(16, 185, 129, 0.15); color: #34d399; }

/* Meta items */
.sc-meta {
    display: flex;
    gap: 18px;
    margin-top: 4px;
}
.sc-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(150, 200, 230, 0.6);
}
.sc-meta-item i { width: 14px; height: 14px; }

/* ============================================================
   SVG DIAGRAM (right column)
   ============================================================ */
.sc-diagram-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 800px;
}
.sc-svg {
    width: 100%;
    max-width: 520px;
    height: auto;
    transition: transform 0.12s ease-out;
    transform-style: preserve-3d;
}

/* --- Orbit Rings (brighter on dark) --- */
.sc-orbit-ring {
    fill: none;
    stroke-width: 1.5;
    will-change: stroke-dashoffset, opacity;
}
.sc-orbit-inner { stroke: rgba(0, 180, 216, 0.3); }
.sc-orbit-outer { stroke: rgba(16, 185, 129, 0.25); }

/* --- Orbit Group Rotation --- */
.sc-orbit-group-inner,
.sc-orbit-group-outer {
    transform-origin: 250px 250px;
    animation-play-state: paused;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}
.sc-orbit-group-inner {
    animation: sc-rotate-cw 70s linear infinite paused;
}
.sc-orbit-group-outer {
    animation: sc-rotate-ccw 100s linear infinite paused;
}
.sc-orbit-group-inner.rotating {
    animation-play-state: running;
}
.sc-orbit-group-outer.rotating {
    animation-play-state: running;
}

@keyframes sc-rotate-cw {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
@keyframes sc-rotate-ccw {
    from { transform: rotate(0deg); }
    to { transform: rotate(-360deg); }
}

/* --- Ghost Layer (phase 0 placeholder) --- */
.sc-beacon {
    animation: sc-beacon-pulse 2.5s ease-in-out infinite;
}
.sc-beacon-ping {
    animation: sc-beacon-expand 2.5s ease-out infinite;
}
@keyframes sc-beacon-pulse {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.5; }
}
@keyframes sc-beacon-expand {
    0% { r: 10; opacity: 0.4; }
    80% { r: 32; opacity: 0; }
    100% { r: 32; opacity: 0; }
}

/* --- Orbit Particles --- */
.sc-orbit-particle {
    transition: opacity 0.4s ease;
}

/* --- Energy Flow Particles --- */
.sc-energy-dot {
    will-change: cx, cy, opacity;
}

/* --- Core Elements (enhanced glow on dark) --- */
.sc-core-circle {
    will-change: r, opacity;
}
.sc-core-neon {
    animation: sc-core-neon-pulse 3s ease-in-out infinite;
}
@keyframes sc-core-neon-pulse {
    0%, 100% { stroke-opacity: 0.6; stroke-width: 2.5; }
    50% { stroke-opacity: 1; stroke-width: 3.5; }
}
.sc-core-gauge {
    animation: sc-core-spin 20s linear infinite;
    transform-origin: 250px 250px;
}
@keyframes sc-core-spin {
    to { transform: rotate(360deg); }
}
.sc-core-glow {
    fill: none;
    will-change: opacity;
}
.sc-core-pulse {
    fill: none;
    stroke-width: 2;
    will-change: opacity;
    animation: sc-pulse-ring 3s ease-out infinite;
    transform-origin: 250px 250px;
}
@keyframes sc-pulse-ring {
    0% { transform: scale(1); opacity: 0.5; }
    70% { transform: scale(1.25); opacity: 0; }
    100% { transform: scale(1.25); opacity: 0; }
}
.sc-core-icon-spin {
    animation: sc-icon-spin 8s linear infinite;
    transform-origin: 12px 12px;
}
@keyframes sc-icon-spin {
    to { transform: rotate(360deg); }
}

.sc-core-label {
    font-family: 'Montserrat', sans-serif;
    fill: rgba(200, 225, 245, 0.9);
    font-weight: 800;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    filter: drop-shadow(0 0 4px rgba(0, 180, 216, 0.4));
}

/* --- Satellites (Neon Tech Node) --- */
.sc-satellite {
    will-change: opacity;
}
.sc-sat-glow {
    animation: sc-neon-pulse 3s ease-in-out infinite;
}
@keyframes sc-neon-pulse {
    0%, 100% { stroke-opacity: 0.7; stroke-width: 2.5; }
    50% { stroke-opacity: 1; stroke-width: 3; }
}

/* --- Phase 8: Satellite Orbit Wrappers --- */
.sc-inner-sat-orbit,
.sc-outer-sat-orbit {
    transform-origin: 250px 250px;
}
.sc-inner-sat-orbit.orbiting {
    animation: sc-rotate-cw 180s linear infinite;
}
.sc-outer-sat-orbit.orbiting {
    animation: sc-rotate-ccw 240s linear infinite;
}

/* --- Connection Lines (visible on dark) --- */
.sc-connection {
    fill: none;
    stroke-width: 1.5;
    will-change: stroke-dashoffset, opacity;
    filter: drop-shadow(0 0 3px currentColor);
}

/* --- Ring Labels --- */
.sc-ring-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    will-change: opacity;
}
.sc-ring-label-inner { fill: rgba(0, 180, 216, 0.5); }
.sc-ring-label-outer { fill: rgba(16, 185, 129, 0.45); }

/* --- Satellite Labels --- */
.sc-sat-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    font-weight: 700;
    fill: rgba(200, 225, 245, 0.8);
}

/* ============================================================
   SCROLL PROGRESS INDICATOR
   ============================================================ */
.sc-progress {
    position: absolute;
    right: -36px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 20;
}
.sc-progress-track {
    width: 3px;
    height: 180px;
    background: rgba(0, 180, 216, 0.1);
    border-radius: 3px;
    overflow: hidden;
}
.sc-progress-fill {
    width: 100%;
    height: 0%;
    background: linear-gradient(180deg, #0077b6, #00b4d8);
    border-radius: 3px;
    transition: height 0.1s linear;
}
.sc-progress-dots {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.sc-progress-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(30, 50, 70, 0.8);
    border: 1.5px solid rgba(0, 180, 216, 0.2);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.sc-progress-dot.active {
    background: #00b4d8;
    border-color: #00b4d8;
    transform: scale(1.3);
    box-shadow: 0 0 10px rgba(0, 180, 216, 0.5);
}

/* ============================================================
   CTA BUTTON
   ============================================================ */
.sc-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 28px;
    background: rgba(0, 180, 216, 0.08);
    color: #4dd9f0;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    border-radius: 12px;
    border: 1px solid rgba(0, 180, 216, 0.25);
    cursor: pointer;
    text-decoration: none;
    backdrop-filter: blur(8px);
    box-shadow: 0 0 20px rgba(0, 180, 216, 0.08);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    margin-top: 8px;
    letter-spacing: 0.02em;
}
.sc-cta-btn:hover {
    background: rgba(0, 180, 216, 0.15);
    border-color: rgba(0, 180, 216, 0.5);
    box-shadow: 0 0 30px rgba(0, 180, 216, 0.18), 0 0 8px rgba(0, 180, 216, 0.12);
    transform: translateY(-2px);
    color: #8be9fd;
}
.sc-cta-btn i { width: 16px; height: 16px; }

/* ============================================================
   DISCLAIMER
   ============================================================ */
.sc-disclaimer {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    font-size: 0.65rem;
    color: rgba(180, 200, 220, 0.55);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 5;
    letter-spacing: 0.02em;
    background: rgba(6, 14, 26, 0.6);
    padding: 4px 14px;
    border-radius: 20px;
    border: 1px solid rgba(150, 180, 210, 0.08);
}
.sc-disclaimer i { width: 12px; height: 12px; opacity: 0.45; }
.sc-disclaimer-short { display: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
    .sc-section { height: 380vh; }
    .sc-top-header { padding: 30px 0 0; margin-bottom: -10px; }
    .sc-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .sc-narrative {
        text-align: center;
        min-height: 200px;
        order: 1;
    }
    .sc-diagram-wrap { order: 0; }
    .sc-viewport {
        top: 50px;
        height: calc(100vh - 50px);
        height: calc(100dvh - 50px);
    }
    .sc-svg { max-width: 340px; }
    .sc-text-block h3 { font-size: 1.4rem; }
    .sc-meta { justify-content: center; flex-wrap: wrap; }
    .sc-progress { right: 8px; }
    .sc-disclaimer { font-size: 0.6rem; white-space: nowrap; }
    .sc-disclaimer-full { display: none; }
    .sc-disclaimer-short { display: inline; }
    .sc-scroll-hint { justify-content: center; }
    .sc-recap-badges { justify-content: center; }
    .uf-step { bottom: 16px; left: 16px; padding: 6px 14px; gap: 8px; }
}

@media (max-width: 640px) {
    .sc-section { height: 300vh; }
    .sc-top-header { padding: 25px 0 0; margin-bottom: -5px; }
    .sc-top-header .section-badge { font-size: 0.75rem; padding: 6px 14px; }
    .sc-viewport {
        align-items: flex-start;
        padding-top: 20px;
        top: 50px;
        height: calc(100vh - 50px);
        height: calc(100dvh - 50px);
    }
    .sc-layout { gap: 10px; min-height: auto; }
    .sc-svg { max-width: 240px; }
    .sc-text-block[data-phase="0"] h3 { font-size: 1.3rem; }
    .sc-text-block h3 { font-size: 1.15rem; }
    .sc-text-block p { font-size: 0.88rem; line-height: 1.6; margin-bottom: 10px; }
    .sc-narrative { min-height: 160px; }
    .sc-meta-item { font-size: 0.75rem; }
    .sc-text-block[data-phase="0"] .sc-meta-item { padding: 4px 10px; font-size: 0.72rem; }
    .sc-progress { right: 4px; }
    .sc-progress-track { height: 120px; }
    .sc-disclaimer { font-size: 0.55rem; bottom: 8px; padding: 3px 10px; }
    .sc-scroll-hint { font-size: 0.78rem; }
    .sc-phase-label { font-size: 0.65rem; padding: 4px 10px; }

    /* Phase 7 — CTA finale mobile */
    .sc-text-block[data-phase="7"] h3 { font-size: 1.1rem; margin-bottom: 8px; }
    .sc-text-block[data-phase="7"] p { font-size: 0.8rem; line-height: 1.5; margin-bottom: 12px; }
    .sc-cta-btn {
        padding: 11px 22px;
        font-size: 0.78rem;
        border-radius: 11px;
        width: 100%;
        justify-content: center;
    }
    .sc-cta-btn i { width: 15px; height: 15px; }
}

@media (max-width: 420px) {
    .sc-section { height: 280vh; }
    .sc-top-header { padding: 20px 0 0; margin-bottom: -5px; }
    .sc-svg { max-width: 200px; }
    .sc-text-block[data-phase="0"] h3 { font-size: 1.15rem; }
    .sc-text-block h3 { font-size: 1.05rem; }
    .sc-text-block p { font-size: 0.82rem; }
    .sc-disclaimer { font-size: 0.5rem; bottom: 6px; padding: 2px 8px; }
    .sc-text-block[data-phase="7"] h3 { font-size: 1rem; }
    .sc-text-block[data-phase="7"] p { font-size: 0.75rem; margin-bottom: 10px; }
    .sc-cta-btn { padding: 10px 18px; font-size: 0.72rem; }
}

/* ============================================================
   RECAP BADGES (satellite phase 0)
   ============================================================ */
.sc-recap-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0 6px;
}
.sc-recap {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 13px;
    border-radius: 50px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.74rem;
    font-weight: 700;
    animation: sc-recap-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.sc-recap:nth-child(2) { animation-delay: 0.1s; }
.sc-recap:nth-child(3) { animation-delay: 0.2s; }
.sc-recap:nth-child(4) { animation-delay: 0.3s; }
.sc-recap i { width: 13px; height: 13px; }

@keyframes sc-recap-pop {
    from { opacity: 0; transform: scale(0.8) translateY(6px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* (Service echo orbit removed — services are now in their own section) */

/* ============================================================
   JOURNEY STEP INDICATOR
   ============================================================ */
.uf-step {
    position: fixed;
    bottom: 32px;
    left: 32px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 18px;
    background: rgba(3, 4, 94, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 50px;
    font-family: 'Montserrat', sans-serif;
    z-index: 100;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}
.uf-step.visible {
    opacity: 1;
    transform: translateY(0);
}
.uf-step-num {
    font-size: 0.82rem;
    font-weight: 800;
    color: #00b4d8;
    letter-spacing: 0.04em;
}
.uf-step-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ============================================================
   REDUCED MOTION — show everything at once
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .sc-section { height: auto !important; }
    .sc-viewport {
        position: relative !important;
        height: auto !important;
        padding: 80px 0;
    }
    .sc-text-block {
        position: relative !important;
        opacity: 1 !important;
        transform: none !important;
        pointer-events: auto !important;
        margin-bottom: 32px;
    }
    .sc-progress { display: none; }
    .sc-orbit-group-inner,
    .sc-orbit-group-outer,
    .sc-inner-sat-orbit,
    .sc-outer-sat-orbit,
    .sc-core-pulse,
    .sc-core-neon,
    .sc-core-gauge,
    .sc-core-icon-spin,
    .sc-sat-glow,
    .sc-scroll-hint,
    .sc-beacon,
    .sc-beacon-ping { animation: none !important; }
    .sc-energy-dot { display: none; }
    .sc-svg { transition: none !important; }
    .sc-recap { animation: none !important; opacity: 1 !important; transform: none !important; }
    .uf-step { display: none; }
}
