/* ============================================
   gabs.news - Decommissioned Orbital Surveillance
   ============================================ */

:root {
    --deep-void: #0e1117;
    --fog-panel: #1c2029;
    --slate-signal: #384152;
    --muted-steel: #6b7a8d;
    --phosphor-dim: #8fa4b8;
    --aero-glass: #a8c4d4;
    --signal-pulse: #4a9eaf;
    --interference: #2d6b5a;
    --ghost-glow: #c8dbe6;
}

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

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

body {
    background: var(--deep-void);
    color: var(--phosphor-dim);
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.6vw, 1.1rem);
    line-height: 1.72;
    overflow-x: hidden;
    display: flex;
    min-height: 100vh;
}

/* --- Scanning Line --- */
.scan-line {
    position: fixed;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--signal-pulse);
    opacity: 0.12;
    z-index: 200;
    pointer-events: none;
    animation: scanDown 12s linear infinite;
}

@keyframes scanDown {
    0% { top: -1px; }
    100% { top: 100vh; }
}

/* --- Sidebar --- */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 240px;
    height: 100vh;
    z-index: 100;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, rgba(28, 32, 41, 0.95), rgba(14, 17, 23, 0.98));
    backdrop-filter: blur(16px) saturate(120%);
    -webkit-backdrop-filter: blur(16px) saturate(120%);
    box-shadow: inset 0 1px 0 rgba(168, 196, 212, 0.06);
    transform: translateX(0);
    transition: transform 0.6s ease-out;
}

.sidebar-inner {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 32px 20px;
    overflow-y: auto;
}

.sidebar-border-glow {
    position: absolute;
    right: 0;
    top: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg, transparent, var(--signal-pulse), transparent);
    background-size: 100% 200%;
    animation: borderFlow 8s linear infinite;
}

@keyframes borderFlow {
    0% { background-position: 0 0; }
    100% { background-position: 0 200%; }
}

/* --- Sidebar Brand --- */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 40px;
}

.brand-text {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--ghost-glow);
    letter-spacing: 0.04em;
}

.brand-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--signal-pulse);
}

.brand-sub {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    color: var(--muted-steel);
    letter-spacing: 0.08em;
}

/* --- Sidebar Nav --- */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.nav-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    text-decoration: none;
    border: 1px solid transparent;
    transition: background 0.3s ease, border-color 0.4s ease-out, box-shadow 0.4s ease;
}

.nav-pill:hover {
    background: rgba(28, 32, 41, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-color: var(--signal-pulse);
    box-shadow: 0 0 16px rgba(74, 158, 175, 0.12);
}

.nav-pill:hover .status-pip {
    opacity: 1;
}

.status-pip {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--signal-pulse);
    opacity: 0.3;
    flex-shrink: 0;
    transition: opacity 0.4s ease;
}

.pip-1 { animation: pipPulse 2s ease-in-out infinite; }
.pip-2 { animation: pipPulse 3s ease-in-out infinite; }
.pip-3 { animation: pipPulse 5s ease-in-out infinite; }
.pip-4 { animation: pipPulse 2.5s ease-in-out infinite; }
.pip-5 { animation: pipPulse 4s ease-in-out infinite; }

@keyframes pipPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

.nav-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.7rem, 1.2vw, 0.85rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted-steel);
    transition: color 0.3s ease;
}

.nav-pill:hover .nav-label {
    color: var(--aero-glass);
}

/* --- Sidebar Clock --- */
.sidebar-clock {
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid var(--slate-signal);
}

.clock-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.6rem;
    letter-spacing: 0.12em;
    color: var(--muted-steel);
    display: block;
    margin-bottom: 4px;
}

.clock-time {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    color: var(--signal-pulse);
}

/* --- Mobile Top Bar --- */
.mobile-bar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 56px;
    background: rgba(14, 17, 23, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 110;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid var(--slate-signal);
}

.mobile-brand {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--ghost-glow);
    letter-spacing: 0.04em;
}

.mobile-toggle {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
}

.toggle-bar {
    width: 20px;
    height: 1.5px;
    background: var(--phosphor-dim);
    border-radius: 1px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* --- Content Area --- */
.content-area {
    margin-left: 240px;
    flex: 1;
    padding: clamp(48px, 6vw, 80px) clamp(24px, 4vw, 64px);
    max-width: calc(780px + 240px + 128px);
}

/* --- Signal Blocks --- */
.signal-block {
    max-width: 780px;
    margin-bottom: clamp(48px, 6vh, 80px);
    opacity: 0;
    transform: translateX(12px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.signal-block.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Signal Header */
.signal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.signal-bars {
    display: flex;
    align-items: flex-end;
    gap: 2px;
}

.bar {
    width: 4px;
    background: var(--interference);
    border-radius: 1px;
}

.bar-1 { height: 8px; }
.bar-2 { height: 14px; }
.bar-3 { height: 20px; }
.bar-dim { opacity: 0.25; }

.signal-cat {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.7rem, 1.2vw, 0.85rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted-steel);
}

.signal-ts {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.6rem, 1vw, 0.75rem);
    letter-spacing: 0.04em;
    color: var(--slate-signal);
    margin-left: auto;
}

/* Signal Body */
.signal-title {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 700;
    font-size: clamp(1.4rem, 3.2vw, 2.6rem);
    letter-spacing: -0.01em;
    color: var(--ghost-glow);
    margin-bottom: 16px;
    line-height: 1.2;
}

.signal-text {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.6vw, 1.1rem);
    line-height: 1.72;
    color: var(--phosphor-dim);
    max-width: 40em;
}

/* Signal Footer */
.signal-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.signal-source,
.signal-meta {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.6rem, 1vw, 0.75rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--slate-signal);
}

.signal-source {
    color: var(--muted-steel);
}

/* --- Feed Divider --- */
.feed-divider {
    max-width: 780px;
    height: 1px;
    background: var(--slate-signal);
    margin-bottom: clamp(48px, 6vh, 80px);
    opacity: 0.4;
    transition: background 0.6s ease;
}

.feed-divider.lit {
    background: var(--signal-pulse);
    opacity: 0.6;
}

/* --- Content End --- */
.content-end {
    max-width: 780px;
    padding: 60px 0;
    text-align: center;
}

.end-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--slate-signal);
    display: block;
    margin-bottom: 8px;
}

.end-domain {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--muted-steel);
    opacity: 0.5;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .sidebar {
        width: 56px;
    }

    .sidebar-inner {
        padding: 20px 8px;
        align-items: center;
    }

    .sidebar-brand {
        flex-direction: column;
        gap: 2px;
    }

    .brand-sub,
    .nav-label,
    .sidebar-clock {
        display: none;
    }

    .nav-pill {
        justify-content: center;
        padding: 10px;
    }

    .content-area {
        margin-left: 56px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 240px;
        z-index: 150;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar.open ~ .content-area::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(14, 17, 23, 0.7);
        backdrop-filter: blur(4px);
        z-index: 140;
    }

    .sidebar-inner {
        padding: 32px 20px;
        align-items: flex-start;
    }

    .brand-sub,
    .nav-label,
    .sidebar-clock {
        display: block;
    }

    .nav-pill {
        justify-content: flex-start;
        padding: 10px 14px;
    }

    .mobile-bar {
        display: flex;
    }

    .content-area {
        margin-left: 0;
        padding-top: calc(56px + clamp(32px, 4vh, 48px));
    }

    .signal-block {
        margin-bottom: clamp(32px, 4vh, 48px);
    }

    .feed-divider {
        margin-bottom: clamp(32px, 4vh, 48px);
    }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    .scan-line {
        animation: none;
        display: none;
    }

    .sidebar-border-glow {
        animation: none;
    }

    .status-pip {
        animation: none;
        opacity: 0.5;
    }

    .signal-block {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .sidebar {
        transition: none;
    }
}
