/* ============================================
   MUJUN.DEV — Retro-Futuristic Developer Gazette
   ============================================ */

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

:root {
    --deep-brown: #2A1A10;
    --medium-brown: #4A3A30;
    --retro-red: #DC503C;
    --warm-cream: #F8F2E8;
    --particle-gold: #D0A060;
    --glitch-cyan: #40D0D0;
    --glitch-magenta: #D040A0;
    --column-border: #E0D4C4;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Lora', Georgia, serif;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    line-height: 1.85;
    color: var(--medium-brown);
    background-color: var(--warm-cream);
    overflow-x: hidden;
    position: relative;
}

/* --- PARTICLE CANVAS --- */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--particle-gold);
    border-radius: 50%;
    opacity: 0.10;
}

/* --- HERO SECTION --- */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.hero-inner {
    text-align: center;
    padding: 2rem;
}

.hero-title {
    font-family: 'Bebas Neue', Impact, sans-serif;
    font-weight: 400;
    font-size: clamp(4rem, 15vw, 12rem);
    text-transform: uppercase;
    color: var(--deep-brown);
    letter-spacing: 0.05em;
    line-height: 0.9;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-family: 'Lora', Georgia, serif;
    font-weight: 400;
    font-size: clamp(0.9rem, 1.5vw, 1.2rem);
    color: var(--medium-brown);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    opacity: 0.7;
}

/* --- PULSE-ATTENTION ANIMATION --- */
.pulse-attention {
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 0 rgba(220, 80, 60, 0);
    }
    50% {
        box-shadow: 0 0 20px rgba(220, 80, 60, 0.15);
    }
}

/* For text elements, use text-shadow variant */
h1.pulse-attention {
    box-shadow: none;
    animation: pulseGlowText 2s ease-in-out infinite;
}

@keyframes pulseGlowText {
    0%, 100% {
        text-shadow: 0 0 0 rgba(220, 80, 60, 0);
    }
    50% {
        text-shadow: 0 0 30px rgba(220, 80, 60, 0.2), 0 0 60px rgba(220, 80, 60, 0.1);
    }
}

/* --- GLITCH-ART DIVIDERS --- */
.glitch-divider {
    position: relative;
    height: 4px;
    background: var(--column-border);
    margin: 2rem auto;
    max-width: 80%;
    overflow: visible;
}

.glitch-divider::before,
.glitch-divider::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    opacity: 0;
}

.glitch-divider::before {
    background: var(--glitch-cyan);
    transform: translateX(-3px);
}

.glitch-divider::after {
    background: var(--glitch-magenta);
    transform: translateX(3px);
}

.glitch-divider.glitch-active::before,
.glitch-divider.glitch-active::after {
    animation: glitchFlash 150ms steps(2) forwards;
}

@keyframes glitchFlash {
    0% { opacity: 0.8; }
    50% { opacity: 0.4; }
    100% { opacity: 0; }
}

.glitch-divider--top,
.glitch-divider--bottom {
    max-width: 200px;
}

.glitch-divider--section {
    max-width: 90%;
    margin: 4rem auto;
}

/* --- EDITORIAL LAYOUT --- */
#editorial {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem 4rem;
}

/* Issue Header */
.issue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 0;
    border-bottom: 2px solid var(--column-border);
    margin-bottom: 3rem;
}

.issue-label {
    font-family: 'Bebas Neue', Impact, sans-serif;
    font-size: 1.4rem;
    color: var(--deep-brown);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.issue-date {
    font-family: 'Lora', Georgia, serif;
    font-weight: 500;
    color: var(--retro-red);
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Editorial Rows */
.editorial-row {
    display: grid;
    grid-template-columns: 65% 35%;
    gap: 0;
    margin-bottom: 2rem;
}

.editorial-row--reversed {
    direction: ltr;
}

.col-main {
    padding-right: 3rem;
    border-right: 1px solid var(--column-border);
}

.col-sidebar {
    padding-left: 2rem;
}

/* Article Styles */
.article-category {
    font-family: 'Bebas Neue', Impact, sans-serif;
    font-size: 0.95rem;
    color: var(--retro-red);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.article-title {
    font-family: 'Bebas Neue', Impact, sans-serif;
    font-weight: 400;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    text-transform: uppercase;
    color: var(--deep-brown);
    line-height: 1;
    margin-bottom: 1rem;
}

.article-meta {
    font-family: 'Lora', Georgia, serif;
    font-size: 0.85rem;
    color: var(--medium-brown);
    opacity: 0.7;
    margin-bottom: 2rem;
}

.author-name {
    color: var(--retro-red);
    font-weight: 500;
}

.article-body {
    margin-bottom: 1.5rem;
    text-align: justify;
    hyphens: auto;
}

/* Code Blocks */
.code-block {
    background: var(--deep-brown);
    border-radius: 4px;
    margin: 2rem 0;
    overflow: hidden;
}

.code-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1.2rem;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.code-lang {
    font-family: 'Bebas Neue', Impact, sans-serif;
    font-size: 0.8rem;
    color: var(--retro-red);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.code-file {
    font-family: 'Fira Code', monospace;
    font-size: 0.75rem;
    color: var(--particle-gold);
    opacity: 0.6;
}

.code-block pre {
    padding: 1.2rem;
    overflow-x: auto;
}

.code-block code {
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--retro-red);
    tab-size: 2;
}

/* Pull Quotes */
.pull-quote {
    margin: 0 0 2rem;
    padding: 1.5rem 0;
    border-top: 3px solid var(--retro-red);
    border-bottom: 1px solid var(--column-border);
}

.pull-quote blockquote {
    font-family: 'Lora', Georgia, serif;
    font-weight: 500;
    font-size: 1.15rem;
    color: var(--deep-brown);
    line-height: 1.6;
    font-style: italic;
}

/* Sidebar Elements */
.sidebar-note {
    background: rgba(224, 212, 196, 0.4);
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-left: 3px solid var(--particle-gold);
}

.sidebar-title {
    font-family: 'Bebas Neue', Impact, sans-serif;
    font-size: 1.1rem;
    color: var(--deep-brown);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.sidebar-note p {
    font-size: 0.9rem;
    line-height: 1.7;
}

.sidebar-links {
    margin-bottom: 2rem;
}

.sidebar-links ul {
    list-style: none;
}

.sidebar-links li {
    font-size: 0.9rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--column-border);
    color: var(--retro-red);
    cursor: default;
    transition: padding-left 0.2s ease;
}

.sidebar-links li:hover {
    padding-left: 0.5rem;
}

/* Sidebar Stat */
.sidebar-stat {
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 2rem;
    background: var(--deep-brown);
    border-radius: 4px;
}

.stat-number {
    font-family: 'Fira Code', monospace;
    font-size: 2.5rem;
    color: var(--glitch-cyan);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-family: 'Lora', Georgia, serif;
    font-size: 0.8rem;
    color: var(--warm-cream);
    opacity: 0.7;
    line-height: 1.5;
}

/* Type Specimens */
.type-specimens {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.type-specimen {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.specimen-label {
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    color: var(--medium-brown);
    min-width: 80px;
}

.specimen-shape {
    display: block;
    width: 40px;
    height: 40px;
}

.specimen-shape--sharp {
    background: var(--retro-red);
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}

.specimen-shape--angular {
    background: var(--particle-gold);
    clip-path: polygon(25% 0%, 100% 0%, 75% 100%, 0% 100%);
}

.specimen-shape--fluid {
    background: var(--glitch-cyan);
    border-radius: 50% 20% 50% 20%;
}

/* --- SHORT TAKES --- */
.short-takes {
    margin-bottom: 2rem;
}

.section-heading {
    font-family: 'Bebas Neue', Impact, sans-serif;
    font-weight: 400;
    font-size: clamp(2rem, 4vw, 3rem);
    text-transform: uppercase;
    color: var(--deep-brown);
    margin-bottom: 2rem;
    letter-spacing: 0.05em;
}

.short-takes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.short-take {
    padding: 1.5rem;
    border: 1px solid var(--column-border);
    position: relative;
    transition: box-shadow 0.3s ease;
}

.short-take:hover {
    box-shadow: 0 0 20px rgba(220, 80, 60, 0.1);
}

.short-take-number {
    font-family: 'Bebas Neue', Impact, sans-serif;
    font-size: 3rem;
    color: var(--column-border);
    line-height: 1;
    display: block;
    margin-bottom: 0.5rem;
}

.short-take-title {
    font-family: 'Bebas Neue', Impact, sans-serif;
    font-weight: 400;
    font-size: 1.4rem;
    text-transform: uppercase;
    color: var(--deep-brown);
    margin-bottom: 0.75rem;
    letter-spacing: 0.05em;
}

.short-take p {
    font-size: 0.9rem;
    line-height: 1.75;
}

/* --- COLOPHON / FOOTER --- */
.colophon {
    margin-top: 2rem;
    padding: 3rem 0;
    border-top: 2px solid var(--column-border);
}

.colophon-inner {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
    align-items: start;
}

.colophon-title {
    font-family: 'Bebas Neue', Impact, sans-serif;
    font-size: 2rem;
    color: var(--deep-brown);
    letter-spacing: 0.1em;
    display: block;
}

.colophon-tagline {
    font-family: 'Lora', Georgia, serif;
    font-style: italic;
    font-size: 0.85rem;
    color: var(--retro-red);
    display: block;
    margin-top: 0.25rem;
}

.colophon-details p {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    line-height: 1.7;
}

.colophon-copy {
    font-size: 0.8rem;
    opacity: 0.6;
}

/* --- SCROLL-TRIGGERED ANIMATIONS --- */
.editorial-row,
.short-take {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.editorial-row.visible,
.short-take.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered reveal for short takes */
.short-take:nth-child(2) { transition-delay: 0.1s; }
.short-take:nth-child(3) { transition-delay: 0.2s; }
.short-take:nth-child(4) { transition-delay: 0.3s; }

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
    .editorial-row {
        grid-template-columns: 1fr;
    }

    .col-main {
        padding-right: 0;
        border-right: none;
        border-bottom: 1px solid var(--column-border);
        padding-bottom: 2rem;
        margin-bottom: 2rem;
    }

    .col-sidebar {
        padding-left: 0;
    }

    .short-takes-grid {
        grid-template-columns: 1fr;
    }

    .colophon-inner {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .issue-header {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .hero-title {
        font-size: clamp(3rem, 12vw, 8rem);
    }
}

@media (max-width: 600px) {
    #editorial {
        padding: 0 1rem 3rem;
    }

    .glitch-divider--section {
        max-width: 100%;
    }

    .code-block code {
        font-size: 0.75rem;
    }
}

/* --- SELECTION STYLES --- */
::selection {
    background: var(--retro-red);
    color: var(--warm-cream);
}
