/* ============================================
   luminant.dev - Mission Control Console
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --midnight-core: #0B1624;
    --console-steel: #162034;
    --crt-blue: #1E2D47;
    --steel-edge: #3D4F6B;
    --signal-blue: #8FA4C4;
    --muted-blue: #9BAFC8;
    --amber-signal: #D4A056;
    --lamp-gold: #E8B96A;
    --phosphor-green: #7DC4A0;
    --fog-gray: #4A5A72;
    --warm-text: #C7B89B;
    --deep-blue: #2A3A54;
    --mid-blue: #6B8BA4;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--midnight-core);
    color: var(--muted-blue);
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 300;
    font-size: clamp(0.9rem, 1.2vw, 1.1rem);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Dot grid background pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle, #1E2D47 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: 0.4;
    pointer-events: none;
    z-index: 0;
}

/* --- Typography Classes --- */
.section-title {
    font-family: 'Archivo Black', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: clamp(1.4rem, 3vw, 2.8rem);
    color: var(--signal-blue);
}

.panel-label {
    font-family: 'Roboto Slab', serif;
    font-weight: 400;
    font-size: clamp(0.7rem, 1vw, 0.85rem);
    color: var(--warm-text);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 16px;
}

.mono-text {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--mid-blue);
    opacity: 0.8;
}

/* --- HUD Overlay --- */
#hud-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.15;
    transition: opacity 1.5s ease-in-out;
}

#hud-overlay.faded {
    opacity: 0;
}

#hud-svg {
    width: 100%;
    height: 100%;
}

.hud-coord {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    fill: var(--signal-blue);
    opacity: 0.7;
}

/* --- Section 1: Station Activation --- */
#station-activation {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--midnight-core);
    z-index: 1;
    overflow: hidden;
}

#activation-light {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--amber-signal);
    box-shadow: 0 0 20px rgba(212, 160, 86, 0.6), 0 0 60px rgba(212, 160, 86, 0.2);
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    z-index: 2;
}

#activation-light.visible {
    opacity: 1;
}

#crosshair-lines {
    position: absolute;
    width: 200px;
    height: 200px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
}

#crosshair-lines line {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    transition: stroke-dashoffset 2s ease-in-out;
}

#crosshair-lines.active line {
    stroke-dashoffset: 0;
}

/* --- Section 2: Console Dashboard --- */
#console-dashboard {
    position: relative;
    width: 100%;
    min-height: 100vh;
    padding: 40px;
    z-index: 2;
    opacity: 0;
    filter: blur(8px);
    transition: opacity 1.5s ease-in-out, filter 1.5s ease-in-out;
}

#console-dashboard.revealed {
    opacity: 1;
    filter: blur(0);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 24px;
    max-width: 1400px;
    margin: 0 auto;
    min-height: calc(100vh - 80px);
}

/* --- Station Panel (shared) --- */
.station-panel {
    position: relative;
    opacity: 0;
    filter: blur(8px);
    transition: opacity 1.5s ease-in-out, filter 1.5s ease-in-out;
}

.station-panel.panel-visible {
    opacity: 1;
    filter: blur(0);
}

.panel-bezel {
    width: 100%;
    height: 100%;
    border: 3px solid var(--steel-edge);
    border-radius: 8px;
    box-shadow:
        inset 0 1px 0 rgba(141, 164, 196, 0.1),
        inset 0 -1px 0 rgba(11, 22, 36, 0.5),
        0 4px 20px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(212, 160, 86, 0.05);
    background: linear-gradient(135deg, #1a2840 0%, var(--console-steel) 50%, #121c2e 100%);
    transition: box-shadow 1.5s ease-in-out, transform 0.3s ease-out;
    transform-style: preserve-3d;
    will-change: transform;
}

.panel-bezel:hover {
    box-shadow:
        inset 0 1px 0 rgba(141, 164, 196, 0.15),
        inset 0 -1px 0 rgba(11, 22, 36, 0.5),
        0 8px 30px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(212, 160, 86, 0.12);
}

.panel-glass {
    width: 100%;
    height: 100%;
    padding: 24px;
    border-radius: 5px;
    background: radial-gradient(ellipse at 30% 20%, rgba(30, 45, 71, 0.85) 0%, rgba(22, 32, 52, 0.95) 100%);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Glass reflection effect */
.panel-glass::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(180deg, rgba(143, 164, 196, 0.03) 0%, transparent 100%);
    pointer-events: none;
    border-radius: 5px 5px 0 0;
}

/* Status indicator */
.panel-status-indicator {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--amber-signal);
    animation: pulse-indicator 4s ease-in-out infinite;
}

@keyframes pulse-indicator {
    0%, 100% { opacity: 0.3; box-shadow: 0 0 4px rgba(212, 160, 86, 0.2); }
    50% { opacity: 1; box-shadow: 0 0 10px rgba(212, 160, 86, 0.6); }
}

.panel-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* --- Panel 1: Luminance Index --- */
.luminance-readout {
    text-align: center;
    margin-bottom: 16px;
}

.readout-value {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: clamp(2.5rem, 5vw, 4rem);
    color: var(--lamp-gold);
    letter-spacing: 0.05em;
    text-shadow: 0 0 30px rgba(232, 185, 106, 0.3);
}

.readout-unit {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1rem;
    color: var(--fog-gray);
    margin-left: 8px;
    vertical-align: super;
}

.readout-sublabel {
    text-align: center;
    font-family: 'Roboto Slab', serif;
    font-size: 0.7rem;
    color: var(--fog-gray);
    letter-spacing: 0.2em;
    margin-bottom: 20px;
}

.readout-bar {
    width: 80%;
    height: 4px;
    background: var(--deep-blue);
    margin: 0 auto 16px;
    border-radius: 2px;
    overflow: hidden;
}

.readout-bar-fill {
    width: 70.6%;
    height: 100%;
    background: linear-gradient(90deg, var(--amber-signal), var(--lamp-gold));
    border-radius: 2px;
    transition: width 2s ease-in-out;
}

.readout-meta {
    display: flex;
    justify-content: space-between;
    padding: 0 10%;
}

.readout-meta .mono-text {
    font-size: 0.7rem;
}

.beacon-pulse {
    position: absolute;
    bottom: 30%;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 160, 86, 0.15), transparent 70%);
    animation: beacon-breathe 5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes beacon-breathe {
    0%, 100% { transform: translateX(-50%) scale(0.9); opacity: 0.4; }
    50% { transform: translateX(-50%) scale(1.1); opacity: 0.8; }
}

/* --- Panel 2: Signal Log --- */
.signal-feed {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: hidden;
    max-height: 100%;
}

.signal-entry {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(61, 79, 107, 0.3);
    animation: feed-scroll 20s linear infinite;
}

.signal-time {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    color: var(--amber-signal);
    white-space: nowrap;
    flex-shrink: 0;
}

.signal-msg {
    font-size: 0.85rem;
    color: var(--muted-blue);
    line-height: 1.5;
}

/* --- Panel 3: Observation Window --- */
.observation-viewport {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.observation-image {
    width: 80%;
    padding-bottom: 80%;
    border-radius: 50%;
    clip-path: circle(45%);
    background:
        radial-gradient(circle, transparent 30%, rgba(11, 22, 36, 0.8) 70%),
        radial-gradient(circle at 40% 35%, rgba(212, 160, 86, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 60% 65%, rgba(125, 196, 160, 0.08) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 50%, #1a2540 0%, #0d1825 100%);
    filter: sepia(0.15) contrast(1.1) brightness(0.85);
    position: relative;
}

/* Star field dots inside observation */
.observation-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,0.6), transparent),
        radial-gradient(1px 1px at 40% 65%, rgba(255,255,255,0.4), transparent),
        radial-gradient(1px 1px at 60% 20%, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 80% 75%, rgba(255,255,255,0.3), transparent),
        radial-gradient(1px 1px at 15% 80%, rgba(255,255,255,0.4), transparent),
        radial-gradient(1.5px 1.5px at 70% 45%, rgba(232, 185, 106, 0.7), transparent),
        radial-gradient(1px 1px at 30% 50%, rgba(255,255,255,0.35), transparent),
        radial-gradient(1px 1px at 85% 25%, rgba(255,255,255,0.45), transparent),
        radial-gradient(1px 1px at 50% 85%, rgba(255,255,255,0.3), transparent),
        radial-gradient(1px 1px at 10% 55%, rgba(255,255,255,0.5), transparent);
    border-radius: 50%;
}

.observation-crosshair {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.observation-crosshair svg {
    width: 80%;
    height: 80%;
    opacity: 0.4;
}

.observation-vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, transparent 30%, rgba(11, 22, 36, 0.9) 70%);
    pointer-events: none;
}

/* --- Panel 4: Waveform Display --- */
.waveform-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#waveform-svg {
    width: 100%;
    height: 60%;
    margin-bottom: 12px;
}

.waveform-data {
    display: flex;
    justify-content: space-between;
}

/* --- Panel 5: Station Identity --- */
.identity-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 16px;
    position: relative;
}

.identity-beacon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 160, 86, 0.3), transparent 70%);
    animation: beacon-breathe 5s ease-in-out infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -70%);
}

.identity-wordmark {
    font-family: 'Archivo Black', sans-serif;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    color: var(--signal-blue);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    position: relative;
    z-index: 1;
}

.identity-subtitle {
    font-family: 'Roboto Slab', serif;
    font-size: 0.75rem;
    color: var(--warm-text);
    letter-spacing: 0.25em;
}

.identity-meta {
    font-size: 0.7rem;
}

/* --- Panel 6: Transmission Status --- */
.transmission-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100%;
    justify-content: center;
}

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

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--fog-gray);
}

.status-dot.active {
    background: var(--phosphor-green);
    box-shadow: 0 0 10px rgba(125, 196, 160, 0.5);
    animation: pulse-green 3s ease-in-out infinite;
}

@keyframes pulse-green {
    0%, 100% { opacity: 0.6; box-shadow: 0 0 6px rgba(125, 196, 160, 0.3); }
    50% { opacity: 1; box-shadow: 0 0 14px rgba(125, 196, 160, 0.7); }
}

.status-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    color: var(--phosphor-green);
    letter-spacing: 0.1em;
}

.transmission-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.transmission-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    border-bottom: 1px solid rgba(61, 79, 107, 0.2);
}

.status-good {
    color: var(--phosphor-green);
}

.signal-line,
.signal-line-wide {
    position: relative;
    width: 100%;
    height: 1px;
    background: var(--steel-edge);
    overflow: hidden;
    margin-top: 12px;
}

.signal-line-pulse {
    position: absolute;
    top: 0;
    left: -30%;
    width: 30%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--amber-signal), transparent);
    animation: signal-travel 3s ease-in-out infinite;
}

@keyframes signal-travel {
    0% { left: -30%; }
    100% { left: 100%; }
}

/* --- Ember Particles --- */
#ember-particles,
#end-embers {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 5;
}

.ember {
    position: absolute;
    border-radius: 50%;
    background: var(--amber-signal);
    pointer-events: none;
}

@keyframes float-up {
    0% {
        transform: translateY(0) translateX(0);
        opacity: var(--ember-opacity, 0.3);
    }
    50% {
        transform: translateY(-40vh) translateX(15px);
        opacity: var(--ember-opacity, 0.3);
    }
    100% {
        transform: translateY(-100vh) translateX(-10px);
        opacity: 0;
    }
}

/* --- Section 3: Signal Archive --- */
#signal-archive {
    position: relative;
    width: 100%;
    min-height: 100vh;
    padding: 80px 40px;
    z-index: 2;
}

.archive-header {
    max-width: 900px;
    margin: 0 auto 60px;
    text-align: center;
}

.archive-header .signal-line-wide {
    margin-top: 24px;
}

.archive-entries {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 48px;
}

.archive-entry {
    padding: 32px 0;
    transition: filter 1.5s ease-in-out, opacity 1.5s ease-in-out;
}

.archive-entry.blurred {
    filter: blur(4px);
    opacity: 0.4;
}

.archive-entry.focused {
    filter: blur(0);
    opacity: 1;
}

.entry-date {
    font-family: 'Archivo Black', sans-serif;
    font-size: clamp(1rem, 2vw, 1.4rem);
    color: var(--warm-text);
    letter-spacing: 0.1em;
    margin-bottom: 4px;
}

.entry-time {
    font-size: 0.8rem;
    color: var(--amber-signal);
    margin-bottom: 16px;
    display: block;
}

.entry-content p {
    color: var(--muted-blue);
    font-size: clamp(0.9rem, 1.2vw, 1.05rem);
    line-height: 1.8;
}

.entry-rule {
    width: 100%;
    height: 1px;
    margin-top: 32px;
    background: linear-gradient(90deg, transparent, var(--steel-edge) 20%, var(--amber-signal) 50%, var(--steel-edge) 80%, transparent);
    opacity: 0.4;
}

/* --- Section 4: Transmission End --- */
#transmission-end {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    overflow: hidden;
}

.end-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    z-index: 2;
}

.end-beacon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--amber-signal);
    box-shadow: 0 0 30px rgba(212, 160, 86, 0.4), 0 0 80px rgba(212, 160, 86, 0.15);
    animation: end-pulse 6s ease-in-out infinite;
}

@keyframes end-pulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(212, 160, 86, 0.3), 0 0 60px rgba(212, 160, 86, 0.1);
        transform: scale(0.95);
    }
    50% {
        box-shadow: 0 0 40px rgba(212, 160, 86, 0.6), 0 0 100px rgba(212, 160, 86, 0.2);
        transform: scale(1.05);
    }
}

.end-wordmark {
    font-family: 'Roboto Slab', serif;
    font-weight: 400;
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    color: var(--signal-blue);
    letter-spacing: 0.15em;
    opacity: 0;
    transition: opacity 3s ease-in-out;
}

.end-wordmark.visible {
    opacity: 0.8;
}

.end-tagline {
    font-size: 0.75rem;
    color: var(--fog-gray);
    letter-spacing: 0.2em;
    opacity: 0;
    transition: opacity 3s ease-in-out 0.5s;
}

.end-tagline.visible {
    opacity: 0.7;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(3, minmax(280px, 1fr));
    }

    #console-dashboard {
        padding: 24px;
    }
}

@media (max-width: 680px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 16px;
    }

    .station-panel {
        min-height: 300px;
    }

    .panel-glass {
        padding: 16px;
    }

    #console-dashboard {
        padding: 16px;
    }

    #signal-archive {
        padding: 40px 20px;
    }

    .readout-meta {
        flex-direction: column;
        align-items: center;
        gap: 4px;
        padding: 0;
    }

    .transmission-row .mono-text {
        font-size: 0.75rem;
    }
}

/* --- Noise texture overlay (inline SVG) --- */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    opacity: 0.5;
    pointer-events: none;
    z-index: 999;
    mix-blend-mode: overlay;
}
