/* rinji.net - Vintage Newspaper meets Dark Mode */

:root {
    --blackout: #0a0808;
    --newsprint: #e8e4dc;
    --alert: #cc2020;
    --divider: #333333;
    --aged-stock: #b8b0a0;
    --banner: #f0ece4;
    --signal-gray: #888078;
    --standby: #44aa66;
}

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

body {
    font-family: 'Crimson Text', serif;
    font-weight: 400;
    color: var(--newsprint);
    background-color: var(--blackout);
    overflow-x: hidden;
    line-height: 1.75;
    font-size: clamp(0.9rem, 1vw, 1.1rem);
}

h2 {
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
}

/* Grain overlay */
#grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    opacity: 0.04;
    pointer-events: none;
    z-index: 1000;
}

/* Broadcast flash */
.broadcast-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--alert);
    opacity: 0;
    pointer-events: none;
    z-index: 999;
    animation: flashSignal 0.4s ease 0.3s;
}

@keyframes flashSignal {
    0% { opacity: 0; }
    40% { opacity: 0.15; }
    100% { opacity: 0; }
}

/* Section 1: Bulletin Banner */
#bulletin-banner {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--blackout);
    position: relative;
}

.banner-kanji {
    font-family: 'Oswald', sans-serif;
    font-weight: 400;
    font-size: clamp(15rem, 25vw, 25rem);
    color: var(--banner);
    line-height: 0.9;
    opacity: 0;
    animation: kanjiReveal 1s ease-in 0.7s forwards;
}

@keyframes kanjiReveal {
    from { opacity: 0; }
    to { opacity: 1; }
}

.pulse-line {
    width: 0;
    height: 2px;
    background-color: var(--alert);
    margin: 2rem 0;
    animation: lineExpand 0.6s ease-out 1.7s forwards, pulseGlow 1.5s ease-in-out 2.3s infinite alternate;
}

@keyframes lineExpand {
    from { width: 0; }
    to { width: 60vw; }
}

@keyframes pulseGlow {
    from { opacity: 0.6; }
    to { opacity: 1; }
}

.banner-domain {
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    font-size: clamp(1.4rem, 3vw, 2.8rem);
    color: var(--banner);
    letter-spacing: 0.15em;
    opacity: 0;
    animation: kanjiReveal 0.5s ease 2.3s forwards;
}

.banner-dateline {
    font-family: 'Overpass Mono', monospace;
    font-size: 0.75rem;
    color: var(--aged-stock);
    letter-spacing: 0.1em;
    margin-top: 1rem;
    opacity: 0;
    animation: kanjiReveal 0.4s ease 2.8s forwards;
}

/* Section 2: Newspaper Columns */
#columns-section {
    background-color: var(--blackout);
    padding: 8rem 5vw;
}

.newspaper-columns {
    columns: 3;
    column-gap: 2rem;
    column-rule: 1px solid var(--divider);
    max-width: 1100px;
    margin: 0 auto;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.newspaper-columns.visible {
    opacity: 1;
}

.column-article {
    break-inside: avoid;
    margin-bottom: 2rem;
}

.column-headline {
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    color: var(--banner);
    margin-bottom: 0.75rem;
    letter-spacing: 0.05em;
    line-height: 1.2;
}

.column-article p {
    text-align: justify;
    margin-bottom: 1rem;
    color: var(--newsprint);
}

.pull-quote {
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    font-size: clamp(1.3rem, 2vw, 1.8rem);
    color: var(--alert);
    text-align: center;
    padding: 1rem 0;
    border-top: 1px solid var(--divider);
    border-bottom: 1px solid var(--divider);
    margin: 1.5rem 0;
}

.section-divider {
    max-width: 1100px;
    margin: 4rem auto 0;
    display: flex;
    justify-content: center;
}

.pulse-line-thin {
    width: 30vw;
    height: 1px;
    background-color: var(--alert);
    animation: pulseGlow 1.5s ease-in-out infinite alternate;
}

/* Section 3: Signal Section */
#signal-section {
    padding: 8rem 5vw;
    text-align: center;
    overflow: hidden;
    background-color: var(--blackout);
}

.signal-quote {
    font-family: 'Oswald', sans-serif;
    font-weight: 400;
    font-size: clamp(1.2rem, 2.5vw, 2rem);
    color: var(--newsprint);
    margin-bottom: 4rem;
    letter-spacing: 0.05em;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.signal-quote.visible {
    opacity: 1;
}

.morse-track {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    animation: morseScroll 15s linear infinite;
    width: max-content;
}

.morse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--signal-gray);
    opacity: 0.6;
    flex-shrink: 0;
}

.morse-dash {
    width: 24px;
    height: 8px;
    background-color: var(--signal-gray);
    opacity: 0.7;
    flex-shrink: 0;
}

.morse-space {
    width: 16px;
    flex-shrink: 0;
}

.morse-gap {
    width: 40px;
    flex-shrink: 0;
}

@keyframes morseScroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* Section 4: Blackout */
#blackout {
    min-height: 40vh;
    background-color: var(--blackout);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 5vh;
}

.blackout-end {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.blackout-cursor {
    width: 8px;
    height: 1.2em;
    background-color: var(--standby);
    animation: cursorBlink 1s step-end infinite;
}

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

.blackout-text {
    font-family: 'Overpass Mono', monospace;
    font-size: 0.75rem;
    color: var(--standby);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.blackout-text.visible {
    opacity: 1;
}

/* Responsive */
@media (max-width: 900px) {
    .newspaper-columns {
        columns: 2;
    }
}

@media (max-width: 600px) {
    .newspaper-columns {
        columns: 1;
    }

    .banner-kanji {
        font-size: clamp(6rem, 20vw, 15rem);
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .banner-kanji,
    .banner-domain,
    .banner-dateline,
    .newspaper-columns,
    .signal-quote,
    .blackout-text {
        opacity: 1 !important;
    }

    .pulse-line {
        width: 60vw !important;
        opacity: 1 !important;
        animation: none;
    }

    .morse-track {
        animation: none;
    }

    .broadcast-flash {
        animation: none;
    }
}
