/* ========================================
   CSS Variables & Design Tokens
   ======================================== */
:root {
    --color-bg: #000000;
    --color-bg-elevated: #0a0a0f;
    --color-surface: #111118;
    --color-surface-hover: #1a1a24;
    --color-text: #f5f5f7;
    --color-text-secondary: #86868b;
    --color-text-muted: #6e6e73;
    --color-accent: #6366f1;
    --color-accent-secondary: #a855f7;
    --color-border: rgba(255, 255, 255, 0.08);
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --transition-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ========================================
   Reset & Base
   ======================================== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: auto;
    /* We need precise control */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    background: var(--color-bg);
    color: var(--color-text);
    overflow-x: hidden;
    line-height: 1.6;
}

/* ========================================
   Preloader
   ======================================== */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.6s var(--transition-smooth), visibility 0.6s;
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.preloader-content {
    text-align: center;
}

.preloader-icon {
    margin-bottom: 24px;
    display: flex;
    justify-content: center;
}

.preloader-circle {
    animation: preloader-spin 1.5s linear infinite;
    transform-origin: center;
}

@keyframes preloader-spin {
    from {
        stroke-dashoffset: 125.6;
        transform: rotate(0deg);
    }

    50% {
        stroke-dashoffset: 31.4;
    }

    to {
        stroke-dashoffset: 125.6;
        transform: rotate(360deg);
    }
}

.preloader-text {
    font-size: 14px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
}

.preloader-percent {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--color-accent), var(--color-accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-block;
    padding: 6px 16px;
    border: 1px solid var(--color-border);
    border-radius: 100px;
    font-size: 12px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 32px;
    backdrop-filter: blur(10px);
    background: rgba(99, 102, 241, 0.05);
}

.hero-title {
    font-size: clamp(48px, 10vw, 120px);
    font-weight: 900;
    letter-spacing: -0.03em;
    line-height: 0.95;
    margin-bottom: 24px;
    background: linear-gradient(180deg, #ffffff 0%, #a0a0a8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(16px, 2vw, 22px);
    color: var(--color-text-secondary);
    font-weight: 400;
    letter-spacing: -0.01em;
    margin-bottom: 64px;
}

/* Scroll Indicator */
.scroll-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    animation: float 2.5s ease-in-out infinite;
}

.scroll-indicator span {
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.scroll-mouse {
    width: 24px;
    height: 40px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 8px;
}

.scroll-dot {
    width: 3px;
    height: 8px;
    background: var(--color-accent);
    border-radius: 3px;
    animation: scroll-pulse 1.8s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

@keyframes scroll-pulse {
    0% {
        opacity: 1;
        transform: translateY(0);
    }

    50% {
        opacity: 0.3;
        transform: translateY(8px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Video Section
   ======================================== */
.video-section {
    /* Height controls scroll distance = playback length feel */
    height: 500vh;
    position: relative;
}

.video-sticky {
    position: sticky;
    top: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--color-bg);
}

.video-sticky canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* object-fit: cover; — use this for full-bleed effect */
}

/* Progress Bar */
.progress-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.06);
    z-index: 10;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--color-accent), var(--color-accent-secondary));
    transition: width 0.05s linear;
    will-change: width;
}

/* Frame Info */
.frame-info {
    position: absolute;
    bottom: 20px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
    z-index: 10;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    padding: 6px 14px;
    border-radius: 100px;
    border: 1px solid var(--color-border);
}

.frame-separator {
    opacity: 0.3;
}

/* ========================================
   Metrics Section
   ======================================== */
.metrics {
    padding: 120px 24px;
    position: relative;
}

.metrics::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 100px;
    background: linear-gradient(180deg, var(--color-accent), transparent);
}

.metrics-header {
    text-align: center;
    margin-bottom: 80px;
}

.metrics-title {
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #a0a0a8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.metrics-subtitle {
    font-size: clamp(14px, 1.5vw, 18px);
    color: var(--color-text-muted);
    font-weight: 400;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    max-width: 1100px;
    margin: 0 auto;
}

.metric {
    text-align: center;
    padding: 40px 20px;
    position: relative;
}

/* Vertical dividers between metrics */
.metric:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    width: 1px;
    height: 60%;
    background: var(--color-border);
}

.metric-value {
    display: block;
    font-size: clamp(48px, 6vw, 72px);
    font-weight: 500;
    letter-spacing: -0.04em;
    line-height: 1;
    margin-bottom: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #86868b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.metric-label {
    display: block;
    font-size: 13px;
    color: var(--color-text-muted);
    line-height: 1.5;
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* ========================================
   Compatibility Table
   ======================================== */
.compat {
    padding: 0 48px 120px;
    max-width: 1100px;
    margin: 0 auto;
}

.compat-title {
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: 32px;
    text-align: center;
}

.compat-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    table-layout: auto;
}

.compat-table thead th {
    font-weight: 500;
    color: var(--color-text-secondary);
    text-align: left;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.compat-table tbody td {
    padding: 16px 24px;
    color: var(--color-text-secondary);
    border-bottom: 1px solid var(--color-border);
    font-weight: 400;
    white-space: nowrap;
}

.compat-table tbody td:first-child {
    white-space: normal;
}

.compat-table tbody tr:last-child td {
    border-bottom: none;
}

.compat-table tbody tr {
    transition: background 0.2s ease;
}

.compat-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.compat-yes {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(52, 211, 153, 0.1);
    color: #34d399;
    font-size: 13px;
    font-weight: 700;
}

/* Comparison Table Dots */
.dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
}

.dot-red {
    background: #ef4444;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.4);
}

.dot-yellow {
    background: #f59e0b;
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.4);
}

.dot-green {
    background: #34d399;
    box-shadow: 0 0 6px rgba(52, 211, 153, 0.4);
}

.compare-highlight {
    background: rgba(99, 102, 241, 0.06);
}

.compare-highlight td {
    color: var(--color-text-primary) !important;
    font-weight: 500;
}

.compare-highlight td:first-child strong {
    color: #fff;
}

.compare-sub {
    font-size: 12px;
    color: var(--color-text-muted);
    font-weight: 400;
}

/* ========================================
   Conclusion Section
   ======================================== */
.conclusion {
    padding: 80px 48px 120px;
    max-width: 860px;
    margin: 0 auto;
    position: relative;
}

.conclusion::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, var(--color-accent), var(--color-accent-secondary));
    border-radius: 1px;
}

.conclusion-content {
    text-align: center;
}

.conclusion-title {
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: 40px;
}

.conclusion-text {
    font-size: 17px;
    color: var(--color-text-secondary);
    line-height: 1.7;
    margin-bottom: 20px;
    font-weight: 400;
}

.conclusion-text strong {
    color: var(--color-text);
    font-weight: 600;
}

.conclusion-highlight {
    margin-top: 36px;
    font-size: 20px;
    font-weight: 600;
    background: linear-gradient(135deg, #ffffff 0%, var(--color-accent) 50%, var(--color-accent-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
    .video-section {
        height: 400vh;
    }

    .video-sticky canvas {
        object-fit: cover;
    }

    .frame-info {
        bottom: 16px;
        right: 16px;
        font-size: 11px;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .metric:nth-child(2)::after {
        display: none;
    }

    .metric:nth-child(1)::after,
    .metric:nth-child(3)::after {
        height: 50%;
    }

    .metric {
        padding: 28px 16px;
    }

    .compat {
        overflow-x: auto;
        padding: 0 16px 120px;
    }

    .compat-table {
        min-width: 600px;
    }
}