*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #1a1108;
    --bg-secondary: #241c10;
    --accent: #c4570a;
    --accent-hover: #e87a1a;
    --text-primary: #e8dcc8;
    --text-secondary: #8a7d6a;
    --glitch-cyan: #00e5ff;
    --glitch-red: #ff2d2d;
    --surface: #0f0e0d;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Source Serif 4', serif;
    font-size: clamp(1rem, 1.2vw, 1.25rem);
    font-weight: 400;
    line-height: 1.7;
    letter-spacing: 0.005em;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.03;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.65' numOctaves='4' type='fractalNoise'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Dispatch Header */
.dispatch-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 60px;
    background: var(--surface);
    display: flex;
    align-items: center;
    overflow: hidden;
    border-bottom: 1px solid rgba(196, 87, 10, 0.3);
}

.ticker-text {
    white-space: nowrap;
    font-family: 'Recursive', monospace;
    font-variation-settings: 'wght' 400, 'CASL' 0, 'slnt' 0, 'MONO' 1;
    font-size: clamp(0.75rem, 1vw, 0.9rem);
    color: var(--text-primary);
    animation: ticker 45s linear infinite;
}

@keyframes ticker {
    from { transform: translateX(100vw); }
    to { transform: translateX(-100%); }
}

/* Page Grid */
.page-grid {
    display: grid;
    grid-template-columns: 48px 1fr;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.gutter {
    border-right: 1px dashed rgba(196, 87, 10, 0.2);
    position: relative;
}

.content {
    padding-top: 60px;
}

/* Panel I - Evidence Wall */
.evidence-wall {
    min-height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem 2rem 4rem 4rem;
    position: relative;
    background:
        repeating-linear-gradient(0deg, transparent, transparent 79px, rgba(196, 87, 10, 0.06) 79px, rgba(196, 87, 10, 0.06) 80px),
        repeating-linear-gradient(90deg, transparent, transparent 79px, rgba(196, 87, 10, 0.06) 79px, rgba(196, 87, 10, 0.06) 80px);
}

.headline {
    font-family: 'Recursive', sans-serif;
    font-variation-settings: 'wght' 800, 'CASL' 0, 'slnt' 0, 'MONO' 0;
    font-size: clamp(2.5rem, 7vw, 6rem);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-primary);
    animation: weight-pulse 6s steps(12) infinite;
    text-shadow:
        -2px 0 rgba(0, 229, 255, 0.3),
        2px 0 rgba(255, 45, 45, 0.3);
}

@keyframes weight-pulse {
    0%, 100% { font-variation-settings: 'wght' 800, 'CASL' 0, 'slnt' 0, 'MONO' 0; }
    50% { font-variation-settings: 'wght' 300, 'CASL' 0, 'slnt' 0, 'MONO' 0; }
}

.tagline {
    margin-top: 1.5rem;
    overflow: hidden;
}

.tagline-inner {
    display: inline-block;
    font-family: 'Source Serif 4', serif;
    font-size: clamp(1rem, 1.5vw, 1.4rem);
    color: var(--text-secondary);
    animation: slide-reveal 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.5s both;
}

@keyframes slide-reveal {
    from { clip-path: inset(0 100% 0 0); }
    to { clip-path: inset(0 0% 0 0); }
}

/* Panel II - Case Files */
.case-files {
    padding: 4rem 2rem 4rem 2rem;
}

.case-file {
    display: flex;
    margin-bottom: 3rem;
    background: var(--bg-secondary);
    border-top: 1px solid rgba(196, 87, 10, 0.2);
    clip-path: inset(0 100% 0 0);
    transition: clip-path 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.case-file.revealed {
    clip-path: inset(0 0% 0 0);
}

.case-tab {
    width: 12px;
    min-width: 12px;
    background: var(--accent);
    position: relative;
    flex-shrink: 0;
}

.case-tab span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-90deg);
    white-space: nowrap;
    font-family: 'Recursive', monospace;
    font-variation-settings: 'wght' 400, 'CASL' 0, 'slnt' 0, 'MONO' 1;
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    color: var(--bg-primary);
}

.case-content {
    display: grid;
    grid-template-columns: 40% 60%;
    padding: 2rem;
    gap: 2rem;
    flex: 1;
}

.case-meta p {
    font-family: 'Recursive', monospace;
    font-variation-settings: 'wght' 400, 'CASL' 0, 'slnt' 0, 'MONO' 1;
    font-size: clamp(0.75rem, 1vw, 0.9rem);
    margin-bottom: 0.5rem;
}

.meta-key {
    color: var(--accent);
}

.meta-val {
    color: var(--text-secondary);
}

.case-body p {
    color: var(--text-primary);
}

/* Panel III - Circuit Board */
.circuit-panel {
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    background:
        linear-gradient(0deg, transparent 49.5%, rgba(196,87,10,0.15) 49.5%, rgba(196,87,10,0.15) 50.5%, transparent 50.5%) 0 0 / 100% 80px,
        linear-gradient(90deg, transparent 49.5%, rgba(196,87,10,0.15) 49.5%, rgba(196,87,10,0.15) 50.5%, transparent 50.5%) 0 0 / 120px 100%,
        var(--bg-primary);
}

.circuit-node {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    animation: node-pulse 4s ease-in-out infinite;
}

.circuit-node:nth-child(2) { animation-delay: 0.5s; }
.circuit-node:nth-child(3) { animation-delay: 1s; }
.circuit-node:nth-child(4) { animation-delay: 1.5s; }
.circuit-node:nth-child(5) { animation-delay: 2s; }
.circuit-node:nth-child(6) { animation-delay: 2.5s; }
.circuit-node:nth-child(7) { animation-delay: 3s; }

@keyframes node-pulse {
    0%, 100% { box-shadow: 0 0 4px var(--accent); }
    50% { box-shadow: 0 0 12px var(--accent); }
}

.circuit-statement {
    font-family: 'Recursive', sans-serif;
    font-variation-settings: 'wght' 800, 'CASL' 0, 'slnt' 0, 'MONO' 0;
    font-size: clamp(2rem, 5vw, 5rem);
    text-align: center;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-primary);
    text-shadow:
        -2px 0 rgba(0, 229, 255, 0.3),
        2px 0 rgba(255, 45, 45, 0.3);
    position: relative;
    z-index: 2;
}

/* Panel IV - Debrief */
.debrief {
    padding: 6rem 2rem 4rem 4rem;
    background: var(--bg-primary);
}

.evidence-links {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 4rem;
}

.evidence-tag {
    display: inline-block;
    font-family: 'Recursive', monospace;
    font-variation-settings: 'wght' 400, 'CASL' 0, 'slnt' 0, 'MONO' 1;
    font-size: clamp(0.75rem, 1vw, 0.9rem);
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    width: fit-content;
}

.evidence-tag:hover {
    background: var(--accent-hover);
    color: var(--bg-primary);
}

.case-closed {
    font-family: 'Recursive', monospace;
    font-variation-settings: 'wght' 400, 'CASL' 0, 'slnt' 0, 'MONO' 1;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    color: var(--text-secondary);
}

/* Scan line */
.scan-line {
    position: fixed;
    top: -2px;
    left: 0;
    width: 100vw;
    height: 2px;
    background: var(--glitch-cyan);
    opacity: 0;
    z-index: 999;
    pointer-events: none;
}

/* Responsive */
@media (max-width: 768px) {
    .page-grid {
        grid-template-columns: 1fr;
    }

    .gutter {
        display: none;
    }

    .evidence-wall {
        padding: 4rem 1.5rem;
    }

    .case-content {
        grid-template-columns: 1fr;
    }

    .case-files {
        padding: 2rem 1rem;
    }

    .debrief {
        padding: 4rem 1.5rem;
    }
}
