/* =====================================================
   COVERFLOW CAROUSEL
   ===================================================== */

.cf-section {
    padding: 80px 0 64px;
    background: linear-gradient(180deg, #f0f4f8 0%, #e8eef5 100%);
    overflow: hidden;
    position: relative;
}

/* Subtle grid texture */
.cf-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(31,37,75,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(31,37,75,0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

/* ── Header ─────────────────────────────────── */
.cf-header {
    text-align: center;
    margin-bottom: 52px;
    padding: 0 24px;
    position: relative;
}

.cf-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 16px;
}

.cf-eyebrow::before,
.cf-eyebrow::after {
    content: '';
    width: 24px;
    height: 1.5px;
    background: var(--accent);
    opacity: 0.5;
}

.cf-headline {
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    font-weight: 800;
    color: var(--ink);
    margin: 0 0 14px;
    line-height: 1.15;
    letter-spacing: -0.025em;
}

.cf-subline {
    font-size: 1.05rem;
    color: var(--muted);
    margin: 0;
    max-width: 480px;
    margin-inline: auto;
    line-height: 1.6;
}

/* ── Scene ──────────────────────────────────── */
.cf-scene-wrap {
    overflow: visible;
    position: relative;
}

.cf-scene {
    perspective: 1000px;
    perspective-origin: 50% 52%;
    height: 520px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    position: relative;
}

/* ── Track ──────────────────────────────────── */
.cf-track {
    transform-style: preserve-3d;
    position: relative;
    width: 215px;
    height: 452px;
    flex-shrink: 0;
}

/* ── Phone Base ─────────────────────────────── */
.cf-phone {
    position: absolute;
    width: 215px;
    height: 452px;
    top: 0;
    left: 0;
    transition:
        transform 0.55s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.55s cubic-bezier(0.4, 0, 0.2, 1),
        filter 0.55s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center center;
    /* Default: hidden state */
    transform: translateX(0) translateZ(-240px) rotateY(0deg) scale(0.5);
    opacity: 0;
    z-index: 1;
    pointer-events: none;
}

/* ── Phone States ───────────────────────────── */
.cf-phone.state-fg {
    transform: translateX(0) translateZ(0px) rotateY(0deg) scale(1.0);
    opacity: 1;
    z-index: 10;
    cursor: default;
    pointer-events: auto;
    filter: none;
}

.cf-phone.state-left {
    transform: translateX(-220px) translateZ(-120px) rotateY(25deg) scale(0.75);
    opacity: 0.65;
    z-index: 5;
    cursor: pointer;
    pointer-events: auto;
    filter: brightness(0.9);
}

.cf-phone.state-right {
    transform: translateX(220px) translateZ(-120px) rotateY(-25deg) scale(0.75);
    opacity: 0.65;
    z-index: 5;
    cursor: pointer;
    pointer-events: auto;
    filter: brightness(0.9);
}

.cf-phone.state-hidden {
    transform: translateX(0) translateZ(-240px) rotateY(0deg) scale(0.5);
    opacity: 0;
    z-index: 1;
    pointer-events: none;
}

/* ── Hover states ───────────────────────────── */
.cf-phone.state-left:hover {
    opacity: 0.82;
    filter: brightness(1.0);
    transform: translateX(-210px) translateZ(-100px) rotateY(22deg) scale(0.78);
}

.cf-phone.state-right:hover {
    opacity: 0.82;
    filter: brightness(1.0);
    transform: translateX(210px) translateZ(-100px) rotateY(-22deg) scale(0.78);
}

/* ── Phone shadow (separate from frame) ─────── */
.cf-phone.state-fg .cf-shadow {
    box-shadow:
        0 32px 80px rgba(31, 37, 75, 0.28),
        0 12px 32px rgba(31, 37, 75, 0.16);
}

.cf-phone.state-left .cf-shadow,
.cf-phone.state-right .cf-shadow {
    box-shadow:
        0 12px 36px rgba(31, 37, 75, 0.18),
        0 4px 12px rgba(31, 37, 75, 0.10);
}

/* ── Phone Frame ────────────────────────────── */
.cf-frame {
    width: 100%;
    height: 100%;
    background: #0e0e10;
    border-radius: 40px;
    padding: 10px 6px 8px;
    position: relative;
    box-sizing: border-box;
    /* Subtle inner highlight on top edge */
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.08),
        0 32px 80px rgba(31, 37, 75, 0.28),
        0 12px 32px rgba(31, 37, 75, 0.16);
}

.cf-phone.state-left .cf-frame,
.cf-phone.state-right .cf-frame {
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.08),
        0 12px 36px rgba(31, 37, 75, 0.18),
        0 4px 12px rgba(31, 37, 75, 0.10);
}

/* Side buttons (left volume) */
.cf-frame::before {
    content: '';
    position: absolute;
    left: -2.5px;
    top: 76px;
    width: 2.5px;
    height: 26px;
    background: #1e1e22;
    border-radius: 2px 0 0 2px;
    box-shadow: 0 34px 0 #1e1e22, 0 66px 0 #1e1e22;
}

/* Right power button */
.cf-frame::after {
    content: '';
    position: absolute;
    right: -2.5px;
    top: 98px;
    width: 2.5px;
    height: 56px;
    background: #1e1e22;
    border-radius: 0 2px 2px 0;
}

/* ── Screen ─────────────────────────────────── */
.cf-screen {
    width: 100%;
    height: 100%;
    border-radius: 32px;
    overflow: hidden;
    position: relative;
    background: #050507;
}

/* Dynamic island */
.cf-island {
    position: absolute;
    top: 9px;
    left: 50%;
    transform: translateX(-50%);
    width: 75px;
    height: 21px;
    background: #0e0e10;
    border-radius: 11px;
    z-index: 25;
}

/* Video */
.cf-screen video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Feature label overlay at bottom */
.cf-phone-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 36px 16px 14px;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.78) 0%,
        rgba(0, 0, 0, 0.4) 50%,
        transparent 100%
    );
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    text-align: center;
    z-index: 15;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Glare overlay */
.cf-glare {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        140deg,
        rgba(255,255,255,0.10) 0%,
        rgba(255,255,255,0.04) 25%,
        rgba(255,255,255,0.01) 50%,
        transparent 60%
    );
    pointer-events: none;
    z-index: 20;
    border-radius: 32px;
}

/* ── Tabs ────────────────────────────────────── */
.cf-tabs {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 36px;
    padding: 0 24px;
    flex-wrap: wrap;
    position: relative;
}

.cf-tab {
    background: none;
    border: 1.5px solid var(--border);
    border-radius: 100px;
    padding: 9px 20px;
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.22s ease;
    font-family: inherit;
    white-space: nowrap;
    line-height: 1;
}

.cf-tab:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(73, 195, 179, 0.06);
}

.cf-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow:
        0 4px 14px rgba(73, 195, 179, 0.38),
        0 1px 3px rgba(73, 195, 179, 0.2);
}

/* ── Mobile Nav Arrows ───────────────────────── */
.cf-mobile-nav {
    display: none;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
}

.cf-nav-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--ink);
}

.cf-nav-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(73, 195, 179, 0.06);
}

/* ── Responsive ──────────────────────────────── */
@media (max-width: 768px) {
    .cf-section {
        padding: 56px 0 48px;
    }

    .cf-scene {
        height: 490px;
        perspective: 800px;
    }

    /* Hide side phones on mobile */
    .cf-phone.state-left,
    .cf-phone.state-right {
        opacity: 0 !important;
        pointer-events: none !important;
    }

    .cf-mobile-nav {
        display: flex;
    }

    .cf-tabs {
        gap: 6px;
        margin-top: 24px;
    }

    .cf-tab {
        padding: 7px 14px;
        font-size: 0.78rem;
    }
}

@media (max-width: 480px) {
    .cf-headline {
        font-size: 1.6rem;
    }

    .cf-tabs {
        gap: 5px;
    }

    .cf-tab {
        padding: 6px 12px;
        font-size: 0.75rem;
    }
}
