@import url('https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap');

html,
body {
    overflow-x: hidden;
}

/* =====================================================
   GLOBAL & ROOT TOKENS
===================================================== */

:root {
    --ink: currentColor;
    --ink-2: #284F94;
    --ink-3: #22D3EE;
}

#cps-showcase {
    position: relative !important;
    width: 100vw;
    left: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    min-height: 684px;
    overflow: hidden !important;
    box-sizing: border-box;
    isolation: isolate;

    --card-width: 260px;
    --card-height: 410px;

    background:
        radial-gradient(circle at 70% 45%, rgba(37, 99, 235, 0.30) 0%, transparent 38%),
        radial-gradient(circle at 15% 80%, rgba(14, 165, 233, 0.12) 0%, transparent 30%),
        linear-gradient(135deg, #020617 0%, #061a3a 50%, #0b3b82 100%);

    font-family: "Nunito", sans-serif;
}

#cps-showcase,
#cps-showcase * {
    box-sizing: border-box;
}

/* =====================================================
   HEADER
===================================================== */

.cps-header {
    position: relative;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    text-align: center;
    padding: 65px 30px 30px;
}

.cps-heading {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    letter-spacing: -0.045em;
    text-align: center;
}

.cps-heading-line {
    font-size: 48px;
    line-height: 1.5;
    text-align: center;
    color: #ffffff;
    font-weight: 500;
    margin: 0;
}

.heading-line-span {
    display: inline-block;
    font-size: 42px;
    background: linear-gradient(90deg, #cbd5e1 0%, #93c5fd 50%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
    overflow: hidden;
    width: 0;
    border-right: 0.55ch solid var(--ink-3);
    animation:
        heading-type 4s steps(20) infinite,
        heading-caret 0.65s steps(1) infinite;
}

@keyframes heading-type {
    0% {
        width: 0;
    }
    45%, 60% {
        width: 20ch;
    }
    100% {
        width: 0;
    }
}

@keyframes heading-caret {
    50% {
        border-color: transparent;
    }
}

.cps-heading-highlight {
    margin-top: 4px;
    color: #ff1748;
    font-size: clamp(38px, 4.5vw, 72px);
    line-height: 1.02;
    font-weight: 400;
}

/* =====================================================
   STAGE & 3D ENVIRONMENT
===================================================== */

.cps-stage {
    position: absolute;
    left: 0;
    right: 0;
    top: 224px;
    bottom: 0;
    height: auto;
    overflow: visible;
    perspective: 1400px;
    perspective-origin: 50% 35%;
    z-index: 10;
}

.cps-stage::after {
    content: "";
    position: absolute;
    left: -15%;
    bottom: -470px;
    width: 130%;
    height: 500px;
    border-radius: 50% 50% 0 0;
    background: #000000;
    pointer-events: none;
    z-index: 1;
}

/* =====================================================
   CARD TRACK
===================================================== */

.cps-card-track {
    position: absolute;
    left: 50%;
    top: 40px;
    width: 0;
    height: 0;
    transform-style: preserve-3d;
    z-index: 30;
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translate3d(0, 0, 0);
}

/* =====================================================
   CARD
===================================================== */

.cps-card {
    position: absolute;
    left: calc(var(--card-width) / -2);
    top: 0;
    width: var(--card-width);
    height: var(--card-height);
    overflow: hidden;
    border-radius: 18px;
    background: #111111;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
    transform-style: preserve-3d;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    will-change: transform, opacity;
    cursor: pointer;
    contain: layout style;
}

.cps-card.is-clicked {
    outline: 2px solid #3b82f6;
    box-shadow: 0 0 35px rgba(59, 130, 246, 0.7);
}

/* =====================================================
   CARD IMAGE & VIDEO
===================================================== */

.cps-card-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.cps-card-image img,
.cps-card-image video,
.cps-card-video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    user-select: none;
    -webkit-user-drag: none;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translate3d(0, 0, 0);
}

.cps-card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.75) 100%);
    pointer-events: none;
}

/* =====================================================
   CARD CONTENT
===================================================== */

.cps-card-content {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    padding: 20px;
    color: #ffffff;
    pointer-events: none;
}

.cps-card-category {
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.7;
    margin-bottom: 4px;
}

.cps-card-title {
    font-size: 18px;
    line-height: 1.15;
    font-weight: 600;
    margin: 0;
}

/* =====================================================
   BOTTOM LABEL
===================================================== */

/* .cps-bottom-label {
    position: absolute;
    z-index: 60;
    left: 75px;
    right: 75px;
    bottom: 30px;
    display: flex;
    align-items: center;
    gap: 17px;
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    opacity: 0.5;
    color: #ffffff;
} */

.cps-line {
    width: 70px;
    height: 1px;
    background: rgba(255, 255, 255, 0.4);
}

/* =====================================================
   PREVIEW MODAL
===================================================== */

.cps-preview-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.cps-preview-modal.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.cps-preview-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    cursor: pointer;
}

.cps-preview-container {
    position: relative;
    z-index: 10;
    max-width: 90vw;
    max-height: 88vh;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.85);
    border-radius: 16px;
    overflow: hidden;
    background: #0a0a0a;
}

.cps-preview-modal.is-active .cps-preview-container {
    transform: scale(1);
}

.cps-preview-close {
    position: absolute;
    top: 24px;
    right: 28px;
    z-index: 30;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: background 0.2s ease, transform 0.2s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    outline: none;
}

.cps-preview-close:hover {
    background: #ff1748;
    border-color: #ff1748;
    transform: scale(1.08) rotate(90deg);
}

.cps-preview-close svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2.2;
    fill: none;
    pointer-events: none;
}

.cps-preview-media-wrapper {
    position: relative;
    max-width: 100%;
    max-height: 88vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.cps-preview-image,
.cps-preview-video {
    max-width: 90vw;
    max-height: 85vh;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    border-radius: 12px;
}

/* =====================================================
   RESPONSIVE MEDIA QUERIES
===================================================== */

@media (max-width: 1024px) {
    #cps-showcase {
        --card-width: 210px;
        --card-height: 335px;
        min-height: 596px;
    }

    .cps-header {
        padding: 45px 30px 20px;
    }

    .cps-stage {
        top: 216px;
    }

    .cps-bottom-label {
        left: 45px;
        right: 45px;
    }
}

@media (max-width: 767px) {
    #cps-showcase {
        --card-width: 240px;
        --card-height: 345px;
        min-height: 580px;
    }

    .cps-header {
        padding: 35px 20px 15px;
    }

    .cps-heading-line {
        font-size: 30px;
    }

    .heading-line-span {
        font-size: 26px;
    }

    .cps-stage {
        top: 190px;
        perspective: 900px;
    }

    .cps-stage::after {
        bottom: -280px;
        height: 380px;
    }

    .cps-card {
        border-radius: 14px;
    }

    .cps-card-title {
        font-size: 14px;
    }

    .cps-bottom-label {
        left: 25px;
        right: 25px;
        bottom: 20px;
    }

    .cps-preview-modal {
        padding: 16px;
    }

    .cps-preview-close {
        top: 16px;
        right: 16px;
        width: 38px;
        height: 38px;
    }

    .cps-preview-image,
    .cps-preview-video {
        max-width: 94vw;
        max-height: 80vh;
    }
}

@media (max-width: 480px) {
    #cps-showcase {
        --card-width: 220px;
        --card-height: 335px;
        min-height: 520px;
    }

    .cps-heading-line {
        font-size: 26px;
    }

    .heading-line-span {
        font-size: 22px;
    }

    .cps-stage {
        top: 180px;
    }
}

/* =====================================================
   REDUCED MOTION
===================================================== */

@media (prefers-reduced-motion: reduce) {
    .cps-card,
    .cps-card-track,
    .heading-line-span {
        animation: none !important;
        transition: none !important;
    }
}