/* ===== 3D Cylinder Feature Carousel ===== */
/*
 * Layout strategy
 * ────────────────
 *  • `.cylinder-section` is the tall scroll region (~6 viewports).
 *    Its `min-height` reserves the space ScrollTrigger needs to pin.
 *  • `.cylinder-stage-fixed` is pinned to the viewport by GSAP.
 *  • Inside the stage, a 2-column grid lays out the cylinder + info.
 */

.cylinder-section {
    background: var(--color-bg);
    position: relative;
    /* Remove overflow:hidden — GSAP pin needs to overflow naturally */
    padding: var(--space-16) 0 0;
}

/* ── Pinned stage ──────────────────────────────────────────────────── */
.cylinder-stage-fixed {
    height: 100vh;
    min-height: 600px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    perspective: 1600px;
    -webkit-perspective: 1600px;
    position: relative;
    padding: var(--space-6) 0;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    box-sizing: border-box;
}

.cylinder-wrapper {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(360px, 1fr);
    align-items: center;
    gap: var(--space-12);
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 var(--container-padding);
    position: relative;
}

/* ── Cylinder 3D stage ─────────────────────────────────────────────── */
.cylinder-stage {
    perspective: 1600px;
    -webkit-perspective: 1600px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 520px;
    position: relative;
}

/* Phone-frame wrapper */
.cylinder-frame {
    position: relative;
    width: 230px;
    height: 460px;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    will-change: transform;
    cursor: grab;
}

.cylinder-frame:active {
    cursor: grabbing;
}

/* Decorative outer glow around the cylinder */
.cylinder-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 360px;
    height: 540px;
    background:
        radial-gradient(ellipse, rgba(155, 89, 182, 0.14) 0%, transparent 60%),
        radial-gradient(ellipse at 30% 50%, rgba(249, 115, 22, 0.10) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 50%, rgba(78, 205, 196, 0.10) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* Floor reflection under the cylinder */
.cylinder-floor {
    position: absolute;
    bottom: 4%;
    left: 50%;
    transform: translateX(-50%);
    width: 280px;
    height: 36px;
    background: radial-gradient(ellipse at center,
        rgba(15, 23, 42, 0.22) 0%,
        rgba(15, 23, 42, 0) 70%);
    filter: blur(8px);
    z-index: -1;
    pointer-events: none;
}

/* ── Panel (phone frame around each screenshot) ────────────────────── */
.cylinder-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 32px;
    overflow: hidden;
    background: #0F172A;
    padding: 8px;
    box-shadow:
        0 30px 60px -15px rgba(15, 23, 42, 0.45),
        0 18px 36px -18px rgba(15, 23, 42, 0.55),
        inset 0 0 0 2px rgba(255, 255, 255, 0.06);
    transition: opacity 0.3s ease;
    transform-origin: center center;
    will-change: transform, opacity;
}

.cylinder-panel-inner {
    width: 100%;
    height: 100%;
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    background: #FDF4DD;
}

.cylinder-panel img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
}

/* Inner border highlight */
.cylinder-panel::after {
    content: '';
    position: absolute;
    inset: 8px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    pointer-events: none;
    z-index: 2;
}

/* Top edge glass reflection */
.cylinder-panel::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    height: 32%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.18) 0%, transparent 100%);
    border-radius: 24px 24px 0 0;
    pointer-events: none;
    z-index: 3;
}

/* ── Scroll progress rail (vertical bar on the left) ───────────────── */
.cylinder-progress {
    position: absolute;
    left: var(--space-6);
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 220px;
    border-radius: var(--radius-pill);
    background: rgba(15, 23, 42, 0.08);
    overflow: hidden;
    z-index: 4;
}

.cylinder-progress-bar {
    width: 100%;
    height: 0%;
    background: linear-gradient(180deg, var(--color-coral), var(--color-purple));
    border-radius: inherit;
    transition: height 0.3s linear;
}

/* ── Feature info panel ────────────────────────────────────────────── */
.cylinder-info {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 440px;
}

.cylinder-info-inner {
    position: relative;
    min-height: 380px;
    flex: 1;
}

.cylinder-feature {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.45s ease, transform 0.45s ease;
    pointer-events: none;
}

.cylinder-feature.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.feature-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    color: var(--accent);
    font-weight: 800;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-5);
}

.cylinder-feature-title {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: clamp(1.625rem, 2.6vw, 2.25rem);
    line-height: 1.15;
    margin-bottom: var(--space-4);
    color: var(--color-text);
}

.cylinder-feature-desc {
    font-size: 1.0625rem;
    line-height: 1.7;
    color: var(--color-text-muted);
    margin-bottom: var(--space-5);
    max-width: 460px;
}

.cylinder-feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cylinder-feature-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    font-weight: 600;
    font-size: 1rem;
    color: var(--color-text);
}

.cylinder-feature-list li::before {
    content: '✓';
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--accent) 15%, transparent);
    color: var(--accent);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 900;
}

/* ── Dot navigation ────────────────────────────────────────────────── */
.cylinder-dots {
    display: flex;
    gap: 0.5rem;
    margin-top: var(--space-6);
    padding-top: var(--space-5);
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    flex-wrap: wrap;
    align-items: center;
}

.cylinder-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid rgba(15, 23, 42, 0.18);
    background: transparent;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    padding: 0;
    position: relative;
    color: transparent;
    font-size: 0;
}

.cylinder-dot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.35);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.cylinder-dot.active {
    border-color: var(--color-coral);
    background: color-mix(in srgb, var(--color-coral) 12%, transparent);
    transform: scale(1.05);
}

.cylinder-dot.active::after {
    width: 12px;
    height: 12px;
    background: var(--color-coral);
}

.cylinder-dot:hover:not(.active) {
    border-color: var(--color-coral);
}

.cylinder-dot:hover:not(.active)::after {
    background: var(--color-coral);
}

/* Feature counter (01 / 06) */
.cylinder-counter {
    margin-left: auto;
    font-size: 0.8125rem;
    font-weight: 800;
    color: var(--color-text-muted);
    letter-spacing: 0.05em;
    font-variant-numeric: tabular-nums;
}

.cylinder-counter strong {
    color: var(--color-coral);
    font-weight: 900;
}

/* ── Drag indicator ────────────────────────────────────────────────── */
.cylinder-drag-indicator {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-text-muted);
    pointer-events: none;
    opacity: 0.85;
    z-index: 5;
    transition: opacity 0.4s ease;
}

.cylinder-drag-indicator.faded {
    opacity: 0;
}

.cylinder-drag-indicator svg {
    animation: hint-pulse 2s ease-in-out infinite;
}

@keyframes hint-pulse {
    0%, 100% { transform: translateX(0); }
    50%      { transform: translateX(3px); }
}

/* ── Top scroll cue ────────────────────────────────────────────────── */
.cylinder-scroll-cue {
    position: absolute;
    top: var(--space-6);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    color: var(--color-text-muted);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.7;
    pointer-events: none;
    z-index: 5;
    transition: opacity 0.4s ease;
}

.cylinder-scroll-cue.faded {
    opacity: 0;
}

.cylinder-scroll-cue svg {
    animation: hint-bounce 2s ease-in-out infinite;
}

@keyframes hint-bounce {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(4px); }
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .cylinder-wrapper {
        grid-template-columns: minmax(280px, 1fr) minmax(320px, 1fr);
        gap: var(--space-8);
    }

    .cylinder-frame {
        width: 210px;
        height: 420px;
    }

    .cylinder-glow {
        width: 320px;
        height: 480px;
    }
}

@media (max-width: 900px) {
    .cylinder-wrapper {
        grid-template-columns: 1fr;
        gap: var(--space-6);
        max-width: 640px;
    }

    .cylinder-stage {
        min-height: 460px;
    }

    .cylinder-frame {
        width: 210px;
        height: 420px;
    }

    .cylinder-info {
        text-align: center;
        min-height: auto;
    }

    .cylinder-info-inner {
        min-height: 320px;
    }

    .cylinder-feature-desc {
        margin-inline: auto;
    }

    .cylinder-feature-list li {
        justify-content: center;
    }

    .cylinder-dots {
        justify-content: center;
    }

    .cylinder-counter {
        margin-left: 0;
        width: 100%;
        text-align: center;
        margin-top: 0.25rem;
    }

    .cylinder-progress,
    .cylinder-scroll-cue,
    .cylinder-drag-indicator {
        display: none;
    }
}

@media (max-width: 480px) {
    .cylinder-frame {
        width: 190px;
        height: 380px;
    }

    .cylinder-stage {
        min-height: 420px;
    }

    .cylinder-feature-title {
        font-size: 1.5rem;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .cylinder-frame,
    .cylinder-panel {
        transition: none;
    }
}
