/* ===========================================
   MONOPOLE.NEWS — Vaporwave Broadcast Terminal
   Colors: #FF8040, #E0B060, #C060D0, #F0D0E0, #D0A0C0, #2A1830, #1A1028
   Fonts: VT323, IBM Plex Mono, Share Tech Mono
   =========================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    background-color: #1A1028;
    color: #D0A0C0;
    font-size: clamp(0.9rem, 1.1vw, 1rem);
    line-height: 1.8;
    overflow-x: hidden;
    min-height: 100vh;
}

/* --- CRT Scanline Overlay --- */
#scanline-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.03) 2px,
        rgba(0, 0, 0, 0.03) 4px
    );
}

/* --- Hero Section --- */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(
        180deg,
        #1A1028 0%,
        #2A1830 30%,
        #1A1028 100%
    );
    position: relative;
    overflow: hidden;
}

#hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        ellipse at 50% 50%,
        rgba(192, 96, 208, 0.08) 0%,
        transparent 70%
    );
}

#hero-content {
    text-align: center;
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 900px;
    padding: 0 2rem;
}

#site-title {
    font-family: 'VT323', monospace;
    font-weight: 400;
    font-size: clamp(2rem, 4.5vw, 3.5rem);
    color: #F0D0E0;
    letter-spacing: 0.25em;
    text-shadow:
        0 0 20px rgba(255, 128, 64, 0.4),
        0 0 60px rgba(192, 96, 208, 0.2);
    opacity: 0;
    animation: crtPowerOn 1.2s ease-out 0.3s forwards;
}

#site-tagline {
    font-family: 'Share Tech Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.7rem, 1vw, 0.85rem);
    color: #FF8040;
    letter-spacing: 0.4em;
    margin-top: 1.2rem;
    opacity: 0;
    animation: fadeIn 0.8s ease-out 1.5s forwards;
}

#hero-waveform-top,
#hero-waveform-bottom {
    width: 100%;
    overflow: hidden;
}

#hero-waveform-top {
    margin-bottom: 2rem;
}

#hero-waveform-bottom {
    margin-top: 2rem;
}

#hero-waveform-top svg,
#hero-waveform-bottom svg {
    width: 100%;
    height: 60px;
}

/* --- Waveform Animation --- */
.wave-path {
    animation: waveShift 4s ease-in-out infinite alternate;
}

.wave-1 { animation-delay: 0s; }
.wave-2 { animation-delay: 0.5s; }
.wave-3 { animation-delay: 1s; }
.wave-4 { animation-delay: 1.5s; }

@keyframes waveShift {
    0% {
        d: path("M0,30 Q360,0 720,30 T1440,30");
    }
    100% {
        d: path("M0,30 Q360,60 720,30 T1440,30");
    }
}

/* --- CRT Power-On Flicker --- */
@keyframes crtPowerOn {
    0% {
        opacity: 0;
        transform: scaleY(0.02);
        filter: brightness(5);
    }
    30% {
        opacity: 1;
        transform: scaleY(1.05);
        filter: brightness(2);
    }
    50% {
        opacity: 0.4;
        transform: scaleY(1);
        filter: brightness(0.5);
    }
    70% {
        opacity: 1;
        transform: scaleY(1);
        filter: brightness(1.5);
    }
    100% {
        opacity: 1;
        transform: scaleY(1);
        filter: brightness(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Category Navigation --- */
#category-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    padding: 1.5rem 2rem;
    background-color: #2A1830;
    border-top: 1px solid rgba(192, 96, 208, 0.15);
    border-bottom: 1px solid rgba(192, 96, 208, 0.15);
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 100;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    color: #D0A0C0;
    letter-spacing: 0.15em;
    cursor: pointer;
    transition: color 0.3s ease, transform 0.2s ease;
    padding: 0.3rem 0.6rem;
    border: 1px solid transparent;
}

.category-item:hover,
.category-item.active {
    color: #FF8040;
    border-color: rgba(255, 128, 64, 0.3);
}

.category-item.active {
    background-color: rgba(255, 128, 64, 0.08);
}

.category-icon {
    flex-shrink: 0;
    image-rendering: pixelated;
}

/* --- Wave Divider --- */
.wave-divider {
    width: 100%;
    overflow: hidden;
    padding: 0.5rem 0;
}

.wave-divider svg {
    width: 100%;
    height: 40px;
}

.wave-divider-1, .wave-divider-3 {
    animation: waveShift 5s ease-in-out infinite alternate;
}

.wave-divider-2, .wave-divider-4 {
    animation: waveShift 5s ease-in-out infinite alternate-reverse;
}

/* --- News Grid --- */
#news-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2px;
    padding: 2px;
    max-width: 1400px;
    margin: 0 auto;
    background-color: #2A1830;
}

/* --- News Card --- */
.news-card {
    background: linear-gradient(
        135deg,
        #1A1028 0%,
        rgba(42, 24, 48, 0.8) 100%
    );
    padding: 2rem 2.2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: background 0.4s ease, transform 0.3s ease;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateX(-40px);
}

.news-card[data-direction="right"] {
    transform: translateX(40px);
}

.news-card.visible {
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.news-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #FF8040, #C060D0, #E0B060);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.news-card:hover::before {
    opacity: 1;
}

.news-card:hover {
    background: linear-gradient(
        135deg,
        rgba(42, 24, 48, 0.95) 0%,
        rgba(26, 16, 40, 0.95) 100%
    );
}

/* Featured cards span 2 columns */
.news-card.featured {
    grid-column: span 2;
    padding: 2.8rem 3rem;
}

.news-card.featured .card-title {
    font-size: clamp(1.4rem, 2.5vw, 2rem);
}

.news-card.featured .card-excerpt {
    font-size: clamp(0.9rem, 1.1vw, 1rem);
    max-width: 80%;
}

/* --- Card Category Badge --- */
.card-category {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.65rem;
    color: #FF8040;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.card-cat-icon {
    color: #FF8040;
    image-rendering: pixelated;
}

/* --- Card Title --- */
.card-title {
    font-family: 'VT323', monospace;
    font-weight: 400;
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    color: #F0D0E0;
    line-height: 1.3;
    letter-spacing: 0.03em;
}

/* --- Card Excerpt --- */
.card-excerpt {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: clamp(0.8rem, 0.95vw, 0.9rem);
    color: #D0A0C0;
    line-height: 1.8;
    opacity: 0.85;
}

/* --- Card Meta --- */
.card-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-top: auto;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(192, 96, 208, 0.1);
}

.card-timestamp {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    color: #FF8040;
    letter-spacing: 0.1em;
}

.card-source {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.65rem;
    color: #E0B060;
    letter-spacing: 0.15em;
}

/* --- Footer --- */
#site-footer {
    padding: 2rem;
    background-color: #1A1028;
    border-top: 1px solid rgba(192, 96, 208, 0.1);
    position: relative;
}

.footer-waveform {
    width: 100%;
    overflow: hidden;
    margin-bottom: 1rem;
}

.footer-waveform svg {
    width: 100%;
    height: 30px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-brand {
    font-family: 'VT323', monospace;
    font-size: 1rem;
    color: #F0D0E0;
    letter-spacing: 0.15em;
}

.footer-status {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.65rem;
    color: #C060D0;
    letter-spacing: 0.15em;
    opacity: 0.7;
}

.footer-timestamp {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    color: #FF8040;
    letter-spacing: 0.1em;
}

/* --- Responsive --- */
@media (max-width: 900px) {
    #news-grid {
        grid-template-columns: 1fr;
    }

    .news-card.featured {
        grid-column: span 1;
    }

    .news-card.featured .card-excerpt {
        max-width: 100%;
    }

    #category-nav {
        gap: 1rem;
        padding: 1rem;
    }

    .category-item span {
        display: none;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 600px) {
    .news-card {
        padding: 1.5rem;
    }

    .news-card.featured {
        padding: 1.8rem;
    }

    .card-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* --- Utility: Category Filter Hiding --- */
.news-card.hidden-by-filter {
    display: none;
}

/* --- Subtle glow animation for active signal --- */
@keyframes signalPulse {
    0%, 100% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
}

.footer-status {
    animation: signalPulse 3s ease-in-out infinite;
}

/* --- Selection styling --- */
::selection {
    background-color: rgba(192, 96, 208, 0.3);
    color: #F0D0E0;
}

/* --- Scrollbar styling --- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #1A1028;
}

::-webkit-scrollbar-thumb {
    background: #2A1830;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #C060D0;
}
