/* ================= RESET ================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: #05060a;
    color: #eaeaf0;
    line-height: 1.7;
}
img {
    width: 100%;
    display: block;
}

/* ================= HERO ================= */
.product-hero {
    background:
        radial-gradient(900px 300px at 50% -120px,
        rgba(99,102,241,0.18), transparent),
        linear-gradient(180deg, #0b0f1a, #06070c);
    padding: 6rem 1.5rem 7rem;
}

.product-hero-inner {
    max-width: 1200px;
    margin: auto;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 4rem;
    align-items: center;
}

.product-hero h1 {
    font-size: clamp(2.2rem, 4vw, 3.4rem);
    margin-bottom: 1rem;
}

.product-subtitle {
    font-size: 1.1rem;
    color: #b8bbff;
    margin-bottom: 1.4rem;
}

.product-hero p {
    color: #cfd2ff;
    max-width: 520px;
}

/* video placeholder */
.product-hero-media {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    background: linear-gradient(135deg, #14162a, #0c0e1a);
    box-shadow: 0 40px 120px rgba(0,0,0,0.6);
    aspect-ratio: 16 / 9;
}

.video-preview {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.play-btn {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(6px);
    position: relative;
}
.play-btn::after {
    content: '';
    position: absolute;
    left: 28px;
    top: 22px;
    border-style: solid;
    border-width: 14px 0 14px 22px;
    border-color: transparent transparent transparent white;
}

/* ================= PRODUCT PREVIEW ================= */

.product-preview {
    padding: 7rem 1.5rem;
    background: linear-gradient(180deg, #06070c, #05060a);
    overflow: hidden;
}

.preview-wrapper {
    max-width: 1100px;
    margin: auto;
    position: relative;
}

.preview-glow {
    position: absolute;
    inset: -60px;
    background: radial-gradient(circle at center,
        rgba(99,102,241,0.25),
        transparent 65%);
    filter: blur(80px);
    opacity: 0.7;
    pointer-events: none;
}

.preview-track {
    position: relative;
    aspect-ratio: 1200 / 800; /* IMPORTANT */
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 40px 140px rgba(0,0,0,0.8);
}

.preview-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: scale(1.04);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.preview-slide.active {
    opacity: 1;
    transform: scale(1);
}

.preview-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* navigation */
.nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    border: none;
    color: white;
    font-size: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
}
.nav.prev { left: -24px; }
.nav.next { right: -24px; }

/* ================= DETAILS ================= */
.product-details {
    padding: 6rem 1.5rem 7rem;
    background: #05060a;
}

.details-inner {
    max-width: 900px;
    margin: auto;
}

.product-details h2 {
    font-size: 2rem;
    margin-bottom: 1.4rem;
}

.product-details p {
    color: #cfd2ff;
    margin-bottom: 1.2rem;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 900px) {
    .product-hero-inner {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    .nav.prev { left: 12px; }
    .nav.next { right: 12px; }
}

/* ================= PRODUCT DETAILS ================= */
.product-details {
    padding: 6rem 1.5rem;
    background: linear-gradient(180deg, #05060a, #070914);
}

.details-wrapper {
    max-width: 1000px;
    margin: auto;
}

.product-details h2 {
    font-size: clamp(1.8rem, 3vw, 2.2rem);
    margin-bottom: 1.2rem;
}

.product-details p {
    max-width: 760px;
    margin-bottom: 1.1rem;
    color: #cfd2ff;
}

/* feature grid */
.details-grid {
    margin-top: 2.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.detail-item {
    padding: 1.1rem 1.2rem;
    background: rgba(255,255,255,0.03);
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.06);
    font-size: 0.95rem;
    color: #e6e8ff;
    transition: transform 0.3s ease, background 0.3s ease;
}

.detail-item:hover {
    transform: translateY(-4px);
    background: rgba(255,255,255,0.06);
}

/* ================= USE CASES ================= */
.product-usecases {
    padding: 6rem 1.5rem 7rem;
    background: #05060a;
}

.usecase-wrapper {
    max-width: 900px;
    margin: auto;
    text-align: center;
}

.product-usecases h2 {
    font-size: clamp(1.8rem, 3vw, 2.2rem);
    margin-bottom: 0.8rem;
}

.usecase-intro {
    max-width: 620px;
    margin: 0 auto 2.2rem;
    color: #cfd2ff;
}

/* usecase grid */
.usecase-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.9rem;
}

.usecase-grid div {
    padding: 0.9rem 1rem;
    background: rgba(255,255,255,0.04);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.06);
    font-size: 0.95rem;
    color: #e6e8ff;
}

/* ================= ANIMATION ================= */
.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: all 0.6s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ================= RESPONSIVE ================= */
@media (max-width: 768px) {
    .product-details,
    .product-usecases {
        padding: 4.5rem 1.25rem;
    }

    .details-grid,
    .usecase-grid {
        gap: 0.8rem;
    }
}

/* ================= MOBILE OVERFLOW FIX (THIS PAGE ONLY) ================= */
@media (max-width: 768px) {

    /* Prevent preview from bleeding */
    .product-preview {
        overflow-x: hidden;
    }

    .preview-wrapper {
        padding: 1.25rem; /* reduce from 2.5rem */
        max-width: 100%;
    }

    .preview-glow {
        display: none; /* glow causes width expansion on mobile */
    }

    /* Force track to respect viewport */
    .preview-track {
        width: 100%;
        max-width: 100%;
    }

    .preview-slide {
        width: 100%;
        max-width: 100%;
    }

    /* Safety clamp for grids */
    .details-wrapper,
    .usecase-wrapper {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .details-grid,
    .usecase-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

.product-video {
    padding: 4rem 1rem;
    background: #000;
}

.video-wrapper {
    max-width: 900px;
    margin: auto;
    aspect-ratio: 16 / 9;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0,0,0,0.6);
}

.video-wrapper iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

@media (max-width: 768px) {

    .preview-track {
        aspect-ratio: 3 / 4;
    }

    .preview-slide {
        position: absolute;
        inset: 0;
        opacity: 0;
        transform: scale(1.02);
        transition: opacity 0.5s ease, transform 0.5s ease;
    }

    .preview-slide.active {
        opacity: 1;
        transform: scale(1);
        z-index: 1;
    }

    .preview-slide img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .nav {
        display: block;
    }
}