/* === infra.limited - Decommissioned Control Room === */
/* Palette: #0d0d0d #1a1a1a #5a5a5a #4a7c59 #b8860b #b87333 #708090 #8a8a8a #a0a0a0 #c4a882 #2d6a4f #8b3a3a #ffffff */

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

html {
    scroll-behavior: smooth;
}

body {
    background: #0d0d0d;
    color: #a0a0a0;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 14px;
    line-height: 1.8;
    overflow-x: hidden;
}

/* === CRT Overlay === */
.crt-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 9999;
    background: repeating-linear-gradient(
        0deg, transparent, transparent 1px, rgba(0,0,0,0.08) 1px, rgba(0,0,0,0.08) 2px
    );
}

.crt-vignette {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 9998;
    background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.4) 100%);
}

/* === Section Nav === */
.section-nav {
    position: fixed;
    bottom: 40px;
    right: 24px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #1a1a1a;
    border: 1px solid #5a5a5a;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    box-shadow: none;
}

.nav-dot.active {
    background: #4a7c59;
    box-shadow: 0 0 6px 2px rgba(74, 124, 89, 0.5);
}

/* === Section base === */
.section {
    min-height: 100vh;
    position: relative;
}

/* === Section 1: Boot Sequence === */
#boot {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.boot-screen {
    text-align: center;
    max-width: 700px;
    padding: 20px;
}

.boot-cursor {
    display: inline-block;
    width: 10px;
    height: 20px;
    background: #4a7c59;
    animation: cursorBlink 0.8s step-end infinite;
    margin-bottom: 20px;
    opacity: 0;
}

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

.boot-text {
    font-family: 'Space Mono', monospace;
    font-size: 18px;
    font-weight: 400;
    letter-spacing: 0.15em;
    color: #4a7c59;
    min-height: 30px;
    margin-bottom: 24px;
    text-shadow: 0 0 8px rgba(74, 124, 89, 0.3);
}

.boot-line {
    height: 1px;
    background: #4a7c59;
    width: 0;
    margin: 20px auto;
    transition: width 0.5s ease-in-out;
    box-shadow: 0 0 4px rgba(74, 124, 89, 0.3);
}

.indicator-row {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-top: 32px;
}

.indicator {
    text-align: center;
}

.indicator::after {
    content: attr(data-label);
    display: block;
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.3em;
    color: #8a8a8a;
    margin-top: 8px;
}

.indicator-light {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #1a1a1a;
    margin: 0 auto;
    transition: all 0.4s ease-in-out;
}

.indicator-light.amber {
    background: #b8860b;
    box-shadow: 0 0 6px 2px rgba(184, 134, 11, 0.4);
}

.indicator-light.green {
    background: #4a7c59;
    box-shadow: 0 0 6px 2px rgba(74, 124, 89, 0.5);
    animation: flicker 2s ease-in-out infinite;
}

@keyframes flicker {
    0%, 100% { opacity: 1; }
    20% { opacity: 0.92; }
    40% { opacity: 1; }
    60% { opacity: 0.88; }
    80% { opacity: 0.95; }
}

.scroll-chevron {
    font-size: 24px;
    color: #4a7c59;
    margin-top: 40px;
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
    animation: chevronBob 2s ease-in-out infinite;
}

@keyframes chevronBob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

/* === Section 2: Instrument Panel === */
#instruments {
    padding: 80px 40px;
}

.section-header {
    font-family: 'Space Mono', monospace;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.25em;
    color: #b8860b;
    text-transform: uppercase;
    margin-bottom: 40px;
    text-align: center;
}

.panel-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1000px;
    margin: 0 auto;
}

.panel-module {
    background: #1a1a1a;
    border-top: 2px solid #5a5a5a;
    border-left: 2px solid #5a5a5a;
    border-bottom: 2px solid #0d0d0d;
    border-right: 2px solid #0d0d0d;
    padding: 20px;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-in-out, transform 0.6s ease-in-out;
}

.panel-module.revealed {
    opacity: 1;
    transform: translateY(0);
}

.panel-label {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.3em;
    color: #8a8a8a;
    text-transform: uppercase;
    display: block;
    margin-bottom: 16px;
}

.panel-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.panel-diagram {
    width: 100%;
    max-width: 140px;
    height: auto;
}

.panel-gauge {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gauge-needle {
    transform-origin: 30px 30px;
    animation: needleOscillate 3s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite alternate;
}

@keyframes needleOscillate {
    0% { transform: rotate(-5deg); }
    100% { transform: rotate(5deg); }
}

.gauge-reading {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 16px;
    font-weight: 300;
    color: #a0a0a0;
}

/* === Section 3: Telemetry Stream === */
#telemetry {
    padding: 80px 40px;
}

.telemetry-container {
    max-width: 900px;
    margin: 0 auto;
    height: 50vh;
    overflow: hidden;
    position: relative;
    border: 1px solid #5a5a5a;
    background: #0d0d0d;
}

.telemetry-feed {
    will-change: transform;
    padding: 20px;
}

.telemetry-line {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    font-weight: 400;
    color: #a0a0a0;
    line-height: 2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.telemetry-line .timestamp {
    color: #4a7c59;
}

.telemetry-line .system {
    color: #b8860b;
}

/* === Section 4: Capacity Map === */
#capacity-map {
    padding: 80px 40px;
}

.map-container {
    max-width: 900px;
    margin: 0 auto;
}

.city-iso {
    width: 100%;
    height: auto;
    transition: transform 0.6s ease-in-out;
}

.map-layer {
    transition: opacity 0.3s ease-in-out;
}

.city-iso:hover .map-layer {
    opacity: 0.2;
}

.city-iso .map-layer:hover {
    opacity: 1;
}

.map-layer[data-system="base"] {
    opacity: 0.3;
}

.city-iso:hover .map-layer[data-system="base"] {
    opacity: 0.3;
}

/* === Section 5: Station Log === */
#station-log {
    padding: 80px 40px;
}

.log-grid {
    display: grid;
    grid-template-columns: 30% 70%;
    max-width: 900px;
    margin: 0 auto;
    gap: 0;
}

.log-dates {
    position: sticky;
    top: 80px;
    align-self: start;
    border-right: 1px solid #5a5a5a;
    padding-right: 20px;
}

.log-date {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    font-weight: 500;
    color: #5a5a5a;
    padding: 24px 0;
    border-bottom: 1px solid rgba(90, 90, 90, 0.2);
}

.log-entries {
    padding-left: 24px;
}

.log-entry {
    padding: 24px 0;
    border-bottom: 1px solid rgba(90, 90, 90, 0.1);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.6s ease-in-out, transform 0.6s ease-in-out;
}

.log-entry.revealed {
    opacity: 1;
    transform: translateY(0);
}

.log-handwritten {
    font-family: 'Caveat', cursive;
    font-size: 18px;
    font-weight: 400;
    color: #c4a882;
    display: inline-block;
    transform: rotate(-1deg);
}

.log-entry:nth-child(2) .log-handwritten { transform: rotate(-2deg); }
.log-entry:nth-child(3) .log-handwritten { transform: rotate(-1.5deg); }
.log-entry:nth-child(4) .log-handwritten { transform: rotate(-0.5deg); }
.log-entry:nth-child(5) .log-handwritten { transform: rotate(-2.5deg); }
.log-entry:nth-child(6) .log-handwritten { transform: rotate(-1deg); }

.log-auto {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    font-weight: 400;
    color: #4a7c59;
    letter-spacing: 0.05em;
}

.final-cursor {
    display: inline-block;
    width: 8px;
    height: 16px;
    background: #4a7c59;
    margin-left: 4px;
    animation: cursorBlink 0.8s step-end infinite;
}

/* === Responsive === */
@media (max-width: 768px) {
    .panel-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .log-grid {
        grid-template-columns: 1fr;
    }

    .log-dates {
        position: relative;
        top: auto;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        border-right: none;
        border-bottom: 1px solid #5a5a5a;
        padding-bottom: 16px;
        margin-bottom: 16px;
    }

    .log-date {
        padding: 4px 8px;
        border-bottom: none;
    }

    .indicator-row {
        gap: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
