/* thesecond.world - Terracotta Mission Control Terminal */

/* ============================
   RESET & BASE
   ============================ */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background: #1c1412;
    color: #d6d3d1;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.85rem, 1.2vw, 1.05rem);
    letter-spacing: 0.04em;
    line-height: 1.7;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ============================
   SCANLINES OVERLAY
   ============================ */

#scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 200;
    pointer-events: none;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 2px,
        rgba(28, 20, 16, 0.03) 2px,
        rgba(28, 20, 16, 0.03) 4px
    );
}

/* ============================
   PARTICLE CANVAS
   ============================ */

#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ============================
   STATUS BAR (TOP)
   ============================ */

#status-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 8vh;
    z-index: 100;
    background: rgba(28, 20, 16, 0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-bottom: 1px solid #92400e;
    opacity: 0;
    transition: opacity 800ms cubic-bezier(0.16, 1, 0.3, 1);
}

#status-bar.visible {
    opacity: 1;
}

.status-bar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 4vw;
}

.status-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.signal-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #c2410c;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; box-shadow: 0 0 4px #c2410c; }
    50% { opacity: 0.3; box-shadow: 0 0 1px #c2410c; }
}

.domain-name {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(1rem, 2vw, 1.4rem);
    letter-spacing: 0.12em;
    color: #fbbf24;
    text-transform: uppercase;
}

.cursor-blink {
    animation: blink 1s step-end infinite;
    color: #fbbf24;
}

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

.status-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-label {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(0.65rem, 0.9vw, 0.8rem);
    letter-spacing: 0.18em;
    color: #78350f;
    text-transform: uppercase;
}

/* ============================
   COUNTER VALUES
   ============================ */

.counter-value {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(1.2rem, 2.5vw, 2rem);
    letter-spacing: 0.08em;
    color: #c2410c;
    font-variant-numeric: tabular-nums;
}

.counter-value.large {
    font-size: clamp(2rem, 4vw, 3.5rem);
    color: #c2410c;
}

.counter-value.small {
    font-size: clamp(0.75rem, 1vw, 0.9rem);
    color: #fbbf24;
}

.counter-label {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(0.65rem, 0.9vw, 0.8rem);
    letter-spacing: 0.18em;
    color: #78350f;
    text-transform: uppercase;
    display: block;
    margin-bottom: 4px;
}

.counter-unit {
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(0.75rem, 1vw, 0.9rem);
    color: #a8a29e;
    margin-left: 6px;
}

/* ============================
   SCROLL CONTAINER & HUD PANELS
   ============================ */

#scroll-container {
    position: relative;
    width: 100%;
    height: 400vh;
    z-index: 10;
}

.hud-panel {
    position: fixed;
    top: 8vh;
    left: 0;
    width: 100%;
    height: 84vh;
    display: flex;
    align-items: center;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.1s linear;
}

.hud-panel.active {
    opacity: 1;
    pointer-events: auto;
}

/* Panel positioning - asymmetric, cockpit feel */
#panel-alpha .panel-frame {
    margin-left: 12%;
    margin-right: 20%;
}

#panel-beta .panel-frame {
    margin-left: 20%;
    margin-right: 8%;
}

#panel-gamma .panel-frame {
    margin-left: 5%;
    margin-right: 25%;
}

#panel-delta .panel-frame {
    margin-left: 18%;
    margin-right: 10%;
}

.panel-frame {
    border: 1px solid #92400e;
    background: #292018; background: rgba(41, 32, 24, 0.56);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    padding: clamp(24px, 4vw, 48px);
    max-width: 720px;
    width: 100%;
    position: relative;
    max-height: 74vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #92400e #1c1412;
}

.panel-frame.tall {
    max-height: 78vh;
}

.panel-frame::-webkit-scrollbar {
    width: 4px;
}

.panel-frame::-webkit-scrollbar-track {
    background: #1c1412;
}

.panel-frame::-webkit-scrollbar-thumb {
    background: #92400e;
}

/* ============================
   PANEL TYPOGRAPHY
   ============================ */

.panel-label {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(0.65rem, 0.9vw, 0.8rem);
    letter-spacing: 0.18em;
    color: #78350f;
    text-transform: uppercase;
    display: block;
    margin-bottom: 16px;
}

.panel-title {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: clamp(2.4rem, 5.5vw, 4.8rem);
    letter-spacing: 0.12em;
    line-height: 0.95;
    color: #fbbf24;
    text-transform: uppercase;
    margin-bottom: 24px;
}

.panel-content {
    margin-top: 8px;
}

.mission-date {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    color: #a8a29e;
    margin-bottom: 20px;
    letter-spacing: 0.04em;
}

.mission-text {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    color: #d6d3d1;
    margin-bottom: 16px;
    line-height: 1.7;
}

.year-counter-block {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid #78350f;
}

/* ============================
   DATA TABLE (Panel Beta)
   ============================ */

.data-table {
    width: 100%;
}

.data-row {
    display: flex;
    align-items: baseline;
    padding: 8px 0;
    border-bottom: 1px solid rgba(120, 53, 15, 0.3);
    gap: 12px;
}

.data-key {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(0.65rem, 0.9vw, 0.8rem);
    letter-spacing: 0.18em;
    color: #78350f;
    text-transform: uppercase;
    min-width: 140px;
    flex-shrink: 0;
}

.data-val {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.85rem, 1.1vw, 1rem);
    color: #d6d3d1;
    letter-spacing: 0.04em;
}

.data-unit {
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(0.7rem, 0.85vw, 0.8rem);
    color: #a8a29e;
    font-weight: 300;
}

.data-rule {
    border: none;
    border-top: 1px solid #78350f;
    margin: 24px 0;
}

.frequency-block {
    text-align: left;
}

.frequency-block .counter-value {
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    color: #fbbf24;
}

/* ============================
   SIGNAL LOG (Panel Gamma)
   ============================ */

.coordinate-readout {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: rgba(28, 20, 16, 0.6);
    border: 1px solid rgba(146, 64, 14, 0.4);
}

.coordinate-readout .counter-label {
    display: inline;
    margin-bottom: 0;
    margin-right: 6px;
}

.signal-log {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.log-entry {
    display: grid;
    grid-template-columns: 160px 110px 40px 1fr;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(120, 53, 15, 0.2);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 400ms cubic-bezier(0.16, 1, 0.3, 1), transform 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

.log-time {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.7rem, 0.85vw, 0.8rem);
    color: #c2410c;
    letter-spacing: 0.04em;
}

.log-freq {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.7rem, 0.85vw, 0.8rem);
    color: #a8a29e;
}

.log-dur {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.7rem, 0.85vw, 0.8rem);
    color: #78350f;
    text-align: right;
}

.log-note {
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(0.7rem, 0.85vw, 0.8rem);
    color: #d6d3d1;
    font-weight: 300;
    line-height: 1.5;
}

.corrupted-text {
    color: transparent;
    text-shadow: 0 0 5px rgba(212, 211, 209, 0.3);
    user-select: none;
}

/* ============================
   TRANSMISSION (Panel Delta)
   ============================ */

.transmission-meta {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: clamp(0.7rem, 0.85vw, 0.8rem);
    color: #a8a29e;
    line-height: 1.8;
    margin-bottom: 8px;
}

.transmission-text {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    color: #d6d3d1;
    line-height: 1.8;
    margin-top: 16px;
    position: relative;
}

.typed-content {
    display: inline;
}

.typed-content.typing {
    border-right: none;
}

.transmission-text .cursor-blink {
    display: inline;
}

.transmission-status {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid #78350f;
}

.transmission-status .counter-value {
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
}

/* ============================
   READOUT STRIP (BOTTOM)
   ============================ */

#readout-strip {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 8vh;
    z-index: 100;
    background: rgba(28, 20, 16, 0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-top: 1px solid #92400e;
    opacity: 0;
    transition: opacity 800ms cubic-bezier(0.16, 1, 0.3, 1);
}

#readout-strip.visible {
    opacity: 1;
}

.readout-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    gap: 0;
    padding: 0 4vw;
}

.readout-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 clamp(16px, 3vw, 40px);
}

.readout-label {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(0.6rem, 0.8vw, 0.75rem);
    letter-spacing: 0.18em;
    color: #78350f;
    text-transform: uppercase;
}

.readout-unit {
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(0.65rem, 0.8vw, 0.75rem);
    color: #a8a29e;
    font-weight: 300;
}

.readout-divider {
    width: 1px;
    height: 40%;
    background: #78350f;
}

.readout-cell .counter-value {
    font-size: clamp(0.9rem, 1.5vw, 1.3rem);
}

/* ============================
   RESPONSIVE ADJUSTMENTS
   ============================ */

@media (max-width: 768px) {
    #panel-alpha .panel-frame,
    #panel-beta .panel-frame,
    #panel-gamma .panel-frame,
    #panel-delta .panel-frame {
        margin-left: 4%;
        margin-right: 4%;
        max-width: 100%;
    }

    .log-entry {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .log-time {
        font-size: 0.7rem;
    }

    .log-freq, .log-dur {
        display: inline;
        font-size: 0.65rem;
    }

    .data-row {
        flex-wrap: wrap;
    }

    .data-key {
        min-width: 100%;
    }

    .coordinate-readout {
        flex-wrap: wrap;
        gap: 8px;
    }

    .readout-inner {
        gap: 0;
    }

    .readout-cell {
        padding: 0 8px;
        flex-direction: column;
        gap: 2px;
    }

    .readout-label {
        font-size: 0.55rem;
    }

    .readout-cell .counter-value {
        font-size: 0.8rem;
    }
}


/* Copper flash highlight */
.counter-value.flash {
    color: #ea580c;
    transition: color 300ms ease;
}
