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

html {
    scroll-behavior: smooth;
    background: #0D0D12;
}

body {
    font-family: 'DM Sans', sans-serif;
    color: #E8E6E1;
    background: #0D0D12;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ===== SCAN-LINE CRT OVERLAY ===== */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 1px,
        rgba(0, 0, 0, 0.03) 1px,
        rgba(0, 0, 0, 0.03) 2px
    );
    pointer-events: none;
    z-index: 10000;
}

/* ===== HEADER BAR ===== */
#header-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: #0D0D12;
    display: flex;
    align-items: center;
    z-index: 1000;
    border-bottom: 1px solid rgba(240, 240, 240, 0.1);
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

#header-bar.visible {
    opacity: 1;
    transform: translateY(0);
}

.header-brand {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.4rem;
    letter-spacing: 0.08em;
    color: #F0F0F0;
    padding: 0 24px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ===== TICKER TAPE ===== */
.ticker-wrapper {
    flex: 1;
    overflow: hidden;
    height: 100%;
    display: flex;
    align-items: center;
    margin-left: 16px;
    border-left: 1px solid rgba(240, 240, 240, 0.15);
}

.ticker-track {
    display: flex;
    white-space: nowrap;
    animation: tickerScroll 40s linear infinite;
}

.ticker-content {
    display: inline-flex;
    gap: 12px;
    padding-right: 40px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
}

.ticker-cyan { color: #00E5FF; }
.ticker-amber { color: #FF6B35; }
.ticker-vs { color: #8A8A94; padding: 0 4px; }
.ticker-sep { color: rgba(240, 240, 240, 0.2); padding: 0 8px; }

@keyframes tickerScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ===== COMPARISON AXIS ===== */
#comparison-axis {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 100vh;
    background: #F0F0F0;
    z-index: 500;
    pointer-events: none;
    animation: axisPulse 4s ease-in-out infinite;
    opacity: 0;
    transition: opacity 0.6s ease;
}

#comparison-axis.visible {
    opacity: 1;
}

@keyframes axisPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.5; }
}

/* Override opacity when visible */
#comparison-axis.visible {
    animation: axisPulseVisible 4s ease-in-out infinite;
}

@keyframes axisPulseVisible {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.5; }
}

/* ===== SCROLL CONTAINER ===== */
#scroll-container {
    scroll-snap-type: y mandatory;
    overflow-y: auto;
    height: 100vh;
    scroll-behavior: smooth;
}

/* ===== DOSSIER SECTIONS ===== */
.dossier-section {
    height: 100vh;
    scroll-snap-align: start;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #0D0D12;
}

/* ===== GRID WATERMARK ===== */
.grid-watermark {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(240, 240, 240, 0.05) 0.5px, transparent 0.5px),
        linear-gradient(90deg, rgba(240, 240, 240, 0.05) 0.5px, transparent 0.5px);
    background-size: 48px 48px;
    pointer-events: none;
    z-index: 1;
}

/* ===== OPENING SECTION ===== */
#opening {
    background: #0D0D12;
    padding-top: 64px;
}

.section-inner {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.opening-line-svg {
    position: absolute;
    left: 50%;
    top: 0;
    width: 4px;
    height: 100%;
    transform: translateX(-50%);
    z-index: 2;
    opacity: 0;
}

.opening-line-svg.animate {
    opacity: 1;
}

.opening-line-svg line {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    transition: stroke-dashoffset 0.6s ease-out;
}

.opening-line-svg.animate line {
    stroke-dashoffset: 0;
}

.opening-content {
    position: relative;
    z-index: 10;
    text-align: center;
    opacity: 0;
    transition: opacity 0.5s ease 0.8s;
}

.opening-content.visible {
    opacity: 1;
}

.opening-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(5rem, 14vw, 12rem);
    letter-spacing: 0.08em;
    line-height: 0.95;
    background: linear-gradient(90deg, #00E5FF 0%, #00E5FF 50%, #FF6B35 50%, #FF6B35 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    user-select: none;
}

.opening-arrows {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    margin-top: 20px;
}

.scroll-prompt {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    color: #8A8A94;
    margin-top: 40px;
    animation: promptPulse 2s ease-in-out infinite;
}

@keyframes promptPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* ===== INTERSTITIAL STRIPS ===== */
.interstitial-strip {
    height: 80px;
    scroll-snap-align: start;
    background: #F0F0F0;
    color: #1A1A1E;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    z-index: 2;
}

.interstitial-inner {
    display: flex;
    align-items: baseline;
    gap: 16px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 7vw, 5rem);
}

.interstitial-left {
    color: #00587A;
}

.interstitial-vs {
    font-size: 0.5em;
    color: #8A8A94;
    font-weight: 500;
}

.interstitial-right {
    color: #B34A1E;
}

/* ===== PANELS ===== */
.panel {
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    display: flex;
    align-items: center;
    z-index: 10;
    padding-top: 64px;
}

.panel-left {
    left: 0;
    justify-content: flex-end;
    padding-right: 60px;
}

.panel-right {
    right: 0;
    justify-content: flex-start;
    padding-left: 60px;
}

.panel-content {
    max-width: 380px;
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.panel-left .panel-content {
    transform: translateX(-30px);
}

.panel-right .panel-content {
    transform: translateX(30px);
}

.dossier-section.in-view .panel-left .panel-content {
    opacity: 1;
    transform: translateX(0);
    transition-delay: 0.3s;
}

.dossier-section.in-view .panel-right .panel-content {
    opacity: 1;
    transform: translateX(0);
    transition-delay: 0.38s;
}

.panel-heading {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: 0.08em;
    line-height: 0.95;
    margin-bottom: 16px;
}

.cyan-heading { color: #00E5FF; }
.amber-heading { color: #FF6B35; }

.panel-body {
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    line-height: 1.65;
    letter-spacing: 0.01em;
    color: #E8E6E1;
    margin-bottom: 24px;
}

.panel-stat {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.stat-number {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.2rem, 3vw, 2.4rem);
    font-weight: 700;
}

.cyan-text { color: #00E5FF; }
.amber-text { color: #FF6B35; }

.stat-label {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    color: #8A8A94;
}

/* ===== GEOMETRIC GLYPHS ===== */
.glyph-container {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 20;
    pointer-events: none;
}

.comparison-glyph {
    overflow: visible;
}

.glyph-path-cyan,
.glyph-path-amber {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    transition: stroke-dashoffset 0.8s ease-out;
}

.dossier-section.in-view .glyph-path-cyan,
.dossier-section.in-view .glyph-path-amber {
    stroke-dashoffset: 0;
}

/* ===== BAR CHART OVERLAY ===== */
.bar-chart-overlay {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 15;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    opacity: 0;
    width: 80%;
}

.bar-chart-overlay.active {
    animation: barsAppear 1.4s ease-out forwards;
}

@keyframes barsAppear {
    0% { opacity: 0; }
    5% { opacity: 1; }
    50% { opacity: 1; }
    80% { opacity: 0.3; }
    100% { opacity: 0; }
}

.bar-left,
.bar-right {
    height: 3px;
    transition: width 0.6s ease-out;
}

.bar-left {
    background: #00E5FF;
    margin-left: auto;
    margin-right: 50%;
    width: 0;
}

.bar-right {
    background: #FF6B35;
    margin-left: 50%;
    width: 0;
}

.bar-chart-overlay.active .bar-left {
    width: var(--bar-width);
}

.bar-chart-overlay.active .bar-right {
    width: var(--bar-width);
}

/* ===== FLIP CARDS ===== */
.flip-card {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 280px;
    height: 180px;
    perspective: 1000px;
    z-index: 50;
    cursor: pointer;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s ease-in-out;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner,
.flip-card.flipped .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border-radius: 4px;
}

.flip-card-front {
    background: rgba(13, 13, 18, 0.95);
    border: 1px solid rgba(240, 240, 240, 0.2);
}

.flip-card-back {
    background: linear-gradient(90deg, rgba(0, 229, 255, 0.1), rgba(255, 107, 53, 0.1));
    border: 1px solid rgba(240, 240, 240, 0.15);
    transform: rotateY(180deg);
}

.card-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.2rem;
    letter-spacing: 0.08em;
    color: #F0F0F0;
    margin-bottom: 12px;
}

.card-comparison {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 12px;
}

.card-cyan {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: #00E5FF;
}

.card-divider {
    color: #8A8A94;
    font-size: 1.5rem;
}

.card-amber {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: #FF6B35;
}

.card-hint {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.75rem;
    color: #8A8A94;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.card-analysis {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #E8E6E1;
    text-align: center;
}

/* ===== TERMINAL SECTION ===== */
.terminal-section {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0D0D12;
}

.terminal-window {
    width: 80%;
    max-width: 700px;
    border: 1px solid #8A8A94;
    border-radius: 4px;
    overflow: hidden;
    background: rgba(13, 13, 18, 0.9);
}

.terminal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(26, 26, 30, 0.8);
    border-bottom: 1px solid rgba(138, 138, 148, 0.3);
}

.terminal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot-red { background: #E63946; }
.dot-yellow { background: #FF6B35; }
.dot-green { background: #2EC4B6; }

.terminal-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.75rem;
    color: #8A8A94;
    margin-left: 8px;
}

.terminal-body {
    padding: 30px 24px;
    min-height: 200px;
}

.terminal-line {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 1.1rem;
    color: #2EC4B6;
    line-height: 2;
    min-height: 1.1em;
    white-space: pre-wrap;
}

.terminal-cursor {
    display: inline;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 1.1rem;
    color: #2EC4B6;
    animation: blink 1s step-end infinite;
    border-right: 2px solid #2EC4B6;
    padding-right: 2px;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .panel {
        position: relative;
        width: 100%;
        height: auto;
        padding: 20px;
    }

    .panel-left {
        padding-right: 20px;
        justify-content: center;
    }

    .panel-right {
        padding-left: 20px;
        justify-content: center;
    }

    .dossier-section {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        padding-top: 80px;
    }

    .panel-heading {
        font-size: clamp(2rem, 6vw, 3.5rem);
    }

    .flip-card {
        position: relative;
        left: auto;
        top: auto;
        transform: none;
        margin: 20px auto;
    }

    .glyph-container {
        position: relative;
        left: auto;
        top: auto;
        transform: none;
        margin: 0 auto;
    }

    .bar-chart-overlay {
        display: none;
    }

    #comparison-axis {
        opacity: 0.15 !important;
    }

    .header-brand {
        font-size: 1rem;
        padding: 0 12px;
    }

    .terminal-window {
        width: 92%;
    }
}

@media (max-width: 480px) {
    .opening-title {
        font-size: clamp(3rem, 12vw, 6rem);
    }

    .panel-content {
        max-width: 100%;
    }

    .flip-card {
        width: 240px;
        height: 160px;
    }

    .interstitial-inner {
        font-size: clamp(1.8rem, 5vw, 3rem);
    }
}
