/* =========================================================
   Scroll-driven Section - Working Animation Fix
   This version animates from normal page scroll AND inner scroll.
   If page scrolls, animation still works.
   ========================================================= */

.sds-section {
    position: relative;
    width: 100%;
    min-height: calc(100vh + var(--sds-scroll-distance, 520px));
    overflow: visible;
    background:
        radial-gradient(circle at 50% 48%, rgba(255,255,255,.25), rgba(255,255,255,0) 34%),
        radial-gradient(circle at 14% 84%, rgba(10,22,130,.82), rgba(10,22,130,0) 36%),
        radial-gradient(circle at 88% 10%, rgba(255,255,255,.36), rgba(255,255,255,0) 32%),
        linear-gradient(135deg, rgba(28,31,196,.88) 0%, rgba(83,121,255,.72) 30%, rgba(188,216,255,.82) 56%, rgba(55,78,245,.86) 100%),
        var(--sds-bg, #8fb6ff);
    isolation: isolate;
}

.sds-section,
.sds-section * {
    box-sizing: border-box;
}

/* Use page scroll as primary driver. Shell remains but does not swallow the page scroll. */
.sds-scroll-shell {
    position: relative;
    width: 100%;
    height: calc(100vh + var(--sds-scroll-distance, 520px));
    min-height: 920px;
    overflow: visible;
}

.sds-track {
    position: absolute;
    inset: 0 auto auto 0;
    width: 1px;
    height: 100%;
    opacity: 0;
    pointer-events: none;
}

/* Sticky visual stage like reference video */
.sds-sticky-stage {
    position: sticky;
    top: 0;
    height: 100vh;
    min-height: 720px;
    display: grid;
    place-items: center;
    overflow: hidden;
    transform: translateZ(0);
}

.sds-stage {
    position: relative;
    width: min(1100px, 100vw);
    height: min(850px, 100vh);
    min-height: 720px;
    margin: 0 auto;
    transform: translateZ(0);
}

.sds-background-orb {
    position: absolute;
    z-index: 0;
    border-radius: 999px;
    opacity: .9;
    pointer-events: none;
}

.sds-background-orb--left {
    width: 700px;
    height: 700px;
    left: -255px;
    bottom: -270px;
    background:
        radial-gradient(circle at 60% 42%, rgba(85,104,255,.16), rgba(27,32,150,.58) 48%, rgba(6,12,64,.98) 100%);
    transform: rotate(-18deg);
}

.sds-background-orb--right {
    width: 570px;
    height: 570px;
    right: -150px;
    top: -115px;
    background:
        radial-gradient(circle at 42% 38%, rgba(255,255,255,.22), rgba(90,119,255,.46) 54%, rgba(24,37,170,.88) 100%);
}

.sds-ring,
.sds-center-circle,
.sds-orbit,
.sds-copy {
    position: absolute;
    top: 50%;
    left: 50%;
}

.sds-ring,
.sds-center-circle,
.sds-orbit {
    transform: translate(-50%, -50%);
}

/* Center gradient ring/circle starts small then reveals */
.sds-center-circle {
    z-index: 3;
    width: var(--sds-center-size, 470px);
    height: var(--sds-center-size, 470px);
    border-radius: 50%;
    display: grid;
    place-items: center;
    padding: clamp(28px, 4vw, 58px);
    background:
        radial-gradient(circle at 48% 40%, rgba(255,255,255,.16), rgba(255,255,255,0) 36%),
        linear-gradient(90deg, var(--sds-gradient-start, #bb7bff) 0%, var(--sds-gradient-middle, #ea4aa3) 48%, var(--sds-gradient-end, #ff325d) 100%);
    box-shadow:
        0 58px 130px rgba(24, 30, 126, 0.24),
        inset 0 1px 0 rgba(255,255,255,.18);
    opacity: var(--sds-gradient-opacity, 0);
    transform: translate(-50%, -50%) scale(var(--sds-center-scale, .18));
    will-change: transform, opacity;
}

.sds-ring {
    z-index: 2;
    border-radius: 50%;
    border-style: solid;
    border-width: 2px;
    opacity: 0;
    pointer-events: none;
    will-change: transform, opacity;
}

.sds-ring--inner {
    width: calc(var(--sds-center-size, 470px) + 126px);
    height: calc(var(--sds-center-size, 470px) + 126px);
    border-color: var(--sds-inner-ring, rgba(255,255,255,.72));
    opacity: var(--sds-inner-opacity, 0);
    transform: translate(-50%, -50%) scale(var(--sds-inner-scale, .18));
}

.sds-ring--outer {
    width: calc(var(--sds-center-size, 470px) + 230px);
    height: calc(var(--sds-center-size, 470px) + 230px);
    border-color: var(--sds-outer-ring, rgba(255,255,255,.38));
    opacity: var(--sds-outer-opacity, 0);
    transform: translate(-50%, -50%) scale(var(--sds-outer-scale, .18));
}

.sds-copy {
    z-index: 5;
    width: min(78%, 460px);
    text-align: center;
    opacity: var(--sds-text-opacity, 0);
    transform:
        translate(-50%, -50%)
        translateY(calc((1 - var(--sds-text-opacity, 0)) * 26px))
        scale(calc(.94 + (var(--sds-text-opacity, 0) * .06)));
    transition: opacity .08s linear, transform .08s linear;
    pointer-events: none;
    will-change: opacity, transform;
}

.sds-title {
    margin: 0;
    color: var(--sds-title-color, #fff);
    font-family: var(--lumana-header-font);
    font-size: clamp(34px, calc(var(--sds-title-size, 64px) * .72), var(--sds-title-size, 64px));
    line-height: 1.08;
    font-weight: var(--sds-title-weight, 800);
    letter-spacing: -0.035em;
}

.sds-title span {
    display: block;
}

.sds-description {
    margin: 18px auto 0;
    max-width: 430px;
    color: var(--sds-desc-color, rgba(255,255,255,.92));
    font-family: var(--sds-desc-font, Inter, Arial, sans-serif);
    font-size: clamp(15px, calc(var(--sds-desc-size, 22px) * .74), var(--sds-desc-size, 22px));
    font-weight: var(--sds-desc-weight, 500);
    line-height: 1.32;
}

.sds-orbit {
    z-index: 6;
    width: 1px;
    height: 1px;
    will-change: transform;
}

/* Cards start fully centered. JS moves them outward. */
.sds-profile {
    position: absolute;
    top: 0;
    left: 0;
    width: var(--sds-image-size, 116px);
    height: var(--sds-image-size, 116px);
    margin:
        calc(var(--sds-image-size, 116px) * -.5)
        0
        0
        calc(var(--sds-image-size, 116px) * -.5);
    border-radius: 24px;
    overflow: hidden;
    border: var(--sds-image-border-width, 6px) solid var(--sds-image-border, #f6efe7);
    background: rgba(255,255,255,.28);
    box-shadow:
        0 22px 54px rgba(0,0,0,.22),
        inset 0 1px 0 rgba(255,255,255,.22);
    opacity: .25;
    transform: translate3d(0,0,0) scale(.35);
    will-change: transform, opacity;
}

.sds-profile img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sds-section.is-canvas-mode {
    min-height: 100vh;
}

.sds-section.is-canvas-mode .sds-scroll-shell {
    height: 100vh;
    min-height: 720px;
}

@media (max-width: 900px) {
    .sds-sticky-stage {
        min-height: 700px;
    }

    .sds-stage {
        height: 700px;
        min-height: 700px;
        width: 100%;
    }

    .sds-center-circle {
        width: min(76vw, var(--sds-center-size, 470px));
        height: min(76vw, var(--sds-center-size, 470px));
    }
}

@media (max-width: 640px) {
    .sds-sticky-stage {
        min-height: 620px;
    }

    .sds-stage {
        height: 620px;
        min-height: 620px;
    }

    .sds-center-circle {
        width: min(78vw, 360px);
        height: min(78vw, 360px);
        padding: 26px;
    }

    .sds-ring--inner {
        width: min(92vw, calc(var(--sds-center-size, 470px) + 90px));
        height: min(92vw, calc(var(--sds-center-size, 470px) + 90px));
    }

    .sds-ring--outer {
        width: min(calc(100vw - 18px), calc(var(--sds-center-size, 470px) + 140px));
        height: min(calc(100vw - 18px), calc(var(--sds-center-size, 470px) + 140px));
    }

    .sds-profile {
        width: min(var(--sds-image-size, 116px), 86px);
        height: min(var(--sds-image-size, 116px), 86px);
        margin-top: calc(min(var(--sds-image-size, 116px), 86px) * -.5);
        margin-left: calc(min(var(--sds-image-size, 116px), 86px) * -.5);
        border-radius: 18px;
    }
}
