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

:root {
    --obsidian-earth: #1a1510;
    --smoked-clay: #2a2018;
    --terracotta-signal: #c8784a;
    --fired-amber: #e8a862;
    --ceramic-cream: #f2e8d8;
    --kiln-ash: #8a7e6e;
    --desert-rose: #d4605a;
    --copper-patina: #5a8a72;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--obsidian-earth);
    color: var(--ceramic-cream);
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.2vw, 1.15rem);
    line-height: 1.72;
    overflow-x: hidden;
}

/* === PANEL SYSTEM === */
.panel {
    background: rgba(42, 32, 24, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(200, 120, 74, 0.15);
    border-radius: 20px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    padding: 2rem;
}

/* Chrome corners */
.chrome-corners::before,
.chrome-corners::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-color: rgba(200, 120, 74, 0.4);
    border-style: solid;
    pointer-events: none;
}

.chrome-corners::before {
    top: 8px;
    left: 8px;
    border-width: 2px 0 0 2px;
}

.chrome-corners::after {
    top: 8px;
    right: 8px;
    border-width: 2px 2px 0 0;
}

.panel > .chrome-corners ~ *:last-child::before,
.panel::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-color: rgba(200, 120, 74, 0.4);
    border-style: solid;
    pointer-events: none;
}

.panel::before {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 8px;
    width: 16px;
    height: 16px;
    border-color: rgba(200, 120, 74, 0.4);
    border-style: solid;
    border-width: 0 0 2px 2px;
    pointer-events: none;
    z-index: 1;
}

.panel::after {
    content: '';
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 16px;
    height: 16px;
    border-color: rgba(200, 120, 74, 0.4);
    border-style: solid;
    border-width: 0 2px 2px 0;
    pointer-events: none;
    z-index: 1;
}

/* === TYPEWRITER CURSOR === */
.cursor {
    color: var(--terracotta-signal);
    animation: blink 1.2s steps(2) infinite;
    font-weight: 300;
}

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

/* === OBSERVATION DECK === */
#observation-deck {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 2rem;
}

.grid-bg {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(200, 120, 74, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(200, 120, 74, 0.08) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
}

#hero-title {
    font-family: 'Recursive', sans-serif;
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-variation-settings: 'wght' 300, 'MONO' 0.5, 'CASL' 0.3;
    letter-spacing: 0.04em;
    line-height: 1.12;
    color: var(--terracotta-signal);
    animation: breathe 6s cubic-bezier(0.37, 0, 0.63, 1) infinite;
    text-align: center;
}

@keyframes breathe {
    0%, 100% { font-variation-settings: 'wght' 300, 'MONO' 0.3, 'CASL' 0.3; }
    50% { font-variation-settings: 'wght' 700, 'MONO' 0.7, 'CASL' 0.3; }
}

#hero-status {
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    color: rgba(200, 120, 74, 0.8);
    margin-top: 2rem;
}

/* === INSTRUMENT CLUSTER === */
#instrument-cluster {
    display: grid;
    grid-template-columns: 60% 1fr;
    gap: 1.5rem;
    padding: 0 3vw;
    margin-top: 10vh;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.panel-main {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#field-canvas {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 20px;
}

.panel-side-group {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.panel-status h2 {
    font-family: 'Recursive', sans-serif;
    font-size: clamp(1rem, 2vw, 1.3rem);
    font-variation-settings: 'wght' 500, 'MONO' 0.7, 'CASL' 0.2;
    letter-spacing: 0.04em;
    color: var(--terracotta-signal);
    margin-bottom: 1rem;
}

.status-line {
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    color: rgba(200, 120, 74, 0.8);
    margin-bottom: 0.6rem;
    min-height: 1.4em;
}

.panel-skyline {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
}

#skyline-svg {
    width: 100%;
    flex: 1;
    min-height: 0;
}

.antenna-node {
    fill: var(--terracotta-signal);
    animation: pulse-node 4s ease-in-out infinite;
}

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

@keyframes pulse-node {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

.panel-label {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    color: var(--kiln-ash);
    text-align: center;
    padding-top: 0.8rem;
}

/* === RESEARCH LOG === */
#research-log {
    max-width: 800px;
    margin: 12vh auto;
    padding: 0 3vw;
    display: flex;
    flex-direction: column;
    gap: 8vh;
}

.log-entry {
    padding: 2.5rem;
    position: relative;
}

.log-date {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: var(--kiln-ash);
    display: block;
    margin-bottom: 1rem;
}

.log-entry h2 {
    font-family: 'Recursive', sans-serif;
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    font-variation-settings: 'wght' 500, 'MONO' 0.5, 'CASL' 0.3;
    letter-spacing: 0.04em;
    line-height: 1.12;
    color: var(--ceramic-cream);
    margin-bottom: 1.2rem;
}

.log-entry p {
    color: var(--ceramic-cream);
    font-weight: 300;
}

.log-art {
    position: absolute;
    pointer-events: none;
}

.dirac-string {
    right: 20px;
    top: 0;
    height: 100%;
    width: 40px;
    opacity: 0.6;
}

.spectrometer-canvas {
    position: relative;
    width: 100%;
    height: 120px;
    margin-top: 1.5rem;
    display: block;
}

.polar-map {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 120px;
    height: 120px;
    opacity: 0.5;
}

.topology-svg {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 120px;
    height: 120px;
    opacity: 0.5;
}

/* Reveal animation for panels */
.reveal-panel {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

/* === SIGNAL FLOOR === */
#signal-floor {
    margin-top: 12vh;
    padding: 2rem 0;
    border-top: 1px solid rgba(200, 120, 74, 0.1);
}

.ticker-wrap {
    overflow: hidden;
    width: 100%;
}

.ticker {
    display: flex;
    gap: 3rem;
    white-space: nowrap;
    animation: ticker 60s linear infinite;
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    color: var(--kiln-ash);
}

.ticker span {
    flex-shrink: 0;
}

@keyframes ticker {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

.footer-msg {
    text-align: center;
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    color: var(--kiln-ash);
    letter-spacing: 0.04em;
    padding: 2rem 1rem 1rem;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    #instrument-cluster {
        grid-template-columns: 1fr;
    }
    .panel-main {
        min-height: 300px;
    }
    .log-entry {
        padding: 1.5rem;
    }
    .polar-map, .topology-svg {
        position: relative;
        right: auto;
        top: auto;
        transform: none;
        margin-top: 1.5rem;
        opacity: 0.5;
    }
    .dirac-string {
        opacity: 0.3;
    }
}
