/* masugomi.com - Cyberpunk Media Dissection */
/* Colors: #1a1410 #2a2118 #e8c47a #a8926b #47d4c8 #d4734a #2a7a6e #3d3028 */

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

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

body {
    background-color: #1a1410;
    color: #e8c47a;
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.25rem);
    line-height: 1.65;
    text-rendering: optimizeLegibility;
    font-feature-settings: 'liga' 1, 'kern' 1, 'onum' 1;
    overflow-x: hidden;
}

#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
}

/* ======================== TRANSMISSIONS ======================== */

.transmission {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    perspective: 1200px;
}

.transmission-panel {
    position: relative;
    z-index: 2;
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out;
    width: 100%;
    max-width: 100%;
    padding: clamp(2rem, 5vw, 6rem);
}

/* ======================== STATIC OVERLAY ======================== */

.static-overlay {
    position: absolute;
    top: -2px;
    left: 0;
    right: 0;
    height: 4px;
    z-index: 10;
    opacity: 0;
    background: repeating-linear-gradient(
        0deg,
        #3d3028 0px,
        #1a1410 1px,
        transparent 2px,
        #2a2118 3px
    );
    background-size: 100% 4px;
    animation: staticFlicker 0.08s steps(3) infinite;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.static-overlay.active {
    opacity: 0.6;
    height: 100%;
}

@keyframes staticFlicker {
    0% { background-position: 0 0; }
    33% { background-position: 5px 1px; }
    66% { background-position: -3px -1px; }
    100% { background-position: 2px 0; }
}

/* ======================== BROADCAST SEAL ======================== */

.broadcast-seal {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    opacity: 0.15;
    animation: sealRotate 120s linear infinite;
    z-index: 3;
}

.broadcast-seal::before,
.broadcast-seal::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    border: 1px solid #3d3028;
}

.broadcast-seal::before {
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.broadcast-seal::after {
    top: 25%;
    left: 25%;
    width: 50%;
    height: 50%;
}

@keyframes sealRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ======================== TRANSMISSION 00 - SIGNAL LOCK ======================== */

.signal-lock {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 80vh;
}

.rule-line {
    width: clamp(200px, 40vw, 500px);
    height: 1px;
    background-color: #e8c47a;
    opacity: 0.6;
}

.broadcast-callsign {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 2rem 0;
}

.katakana {
    font-family: 'Noto Serif JP', serif;
    font-weight: 500;
    font-size: clamp(0.9rem, 1.5vw, 1.2rem);
    color: #a8926b;
    letter-spacing: 0.3em;
}

.headline-primary {
    font-family: 'Libre Baskerville', Baskerville, serif;
    font-weight: 700;
    font-size: clamp(4rem, 10vw, 9rem);
    line-height: 1.05;
    letter-spacing: 0.01em;
    color: #e8c47a;
    margin: 0;
}

.transmission-id {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #a8926b;
    margin-top: 2rem;
}

/* ======================== TRANSMISSION 01 - THE DECODE ======================== */

.decode-layout {
    display: flex;
    align-items: center;
    gap: clamp(2rem, 4vw, 5rem);
    min-height: 80vh;
}

.decode-text {
    flex: 0 0 38.2%;
    max-width: 38.2%;
}

.manifesto {
    font-family: 'Libre Baskerville', Baskerville, serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
    line-height: 1.7;
    color: #e8c47a;
    margin-bottom: 1.5rem;
    max-width: 65ch;
}

.decode-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    perspective: 1200px;
}

.kanji-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    background-color: rgba(42, 33, 24, 0.5);
    border: 1px solid #3d3028;
    transform-style: preserve-3d;
    transition: transform 0.6s ease-out, border-color 0.4s ease;
    position: relative;
    overflow: hidden;
}

.kanji-cell:hover {
    border-color: #47d4c8;
}

.kanji-display {
    font-family: 'Noto Serif JP', serif;
    font-weight: 500;
    font-size: clamp(3rem, 5vw, 5rem);
    color: #e8c47a;
    transition: opacity 0.8s ease, color 0.8s ease;
}

.kanji-cell.dissolved .kanji-display {
    opacity: 0;
}

.kanji-cell.revealed .kanji-display {
    opacity: 1;
    color: #47d4c8;
}

/* ======================== TRANSMISSION 02 - THE ARCHIVE ======================== */

.archive-layout {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
    padding: 0;
}

.ticker-band {
    flex: 0 0 auto;
    overflow: hidden;
    padding: 0.75rem 0;
    border-top: 1px solid #3d3028;
    border-bottom: 1px solid #3d3028;
    position: relative;
}

.ticker-band::before,
.ticker-band::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 60px;
    z-index: 2;
    pointer-events: none;
}

.ticker-band::before {
    left: 0;
    background: linear-gradient(to right, #1a1410, transparent);
}

.ticker-band::after {
    right: 0;
    background: linear-gradient(to left, #1a1410, transparent);
}

.ticker-content {
    display: flex;
    white-space: nowrap;
    animation: tickerScroll 40s linear infinite;
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #a8926b;
}

.ticker-content span {
    flex-shrink: 0;
}

.ticker-reverse {
    animation: tickerScrollReverse 55s linear infinite;
}

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

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

.archive-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: clamp(3rem, 6vw, 6rem) clamp(2rem, 5vw, 6rem);
    border-left: 2px solid #d4734a;
    border-right: 2px solid #d4734a;
    margin: 0 clamp(1rem, 3vw, 4rem);
}

.archive-title {
    font-family: 'Libre Baskerville', Baskerville, serif;
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 4rem);
    line-height: 1.05;
    letter-spacing: 0.01em;
    color: #e8c47a;
    margin-bottom: 2rem;
    text-align: center;
}

.archive-body {
    max-width: 65ch;
    text-align: left;
}

.archive-body p {
    margin-bottom: 1.5rem;
    color: #e8c47a;
}

.archive-body p:last-child {
    margin-bottom: 0;
}

/* ======================== TRANSMISSION 03 - THE EVIDENCE ======================== */

.evidence-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    text-align: center;
}

.evidence-quote {
    max-width: 65ch;
    border: none;
    margin: 0;
    padding: 0;
}

.evidence-quote p {
    font-family: 'Libre Baskerville', Baskerville, serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 6vw, 5rem);
    line-height: 1.15;
    letter-spacing: 0.01em;
    color: #e8c47a;
}

.evidence-attribution {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #a8926b;
    margin-top: 3rem;
}

/* ======================== TRANSMISSION 04 - SIGN OFF ======================== */

.signoff-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
}

.signoff-content {
    text-align: center;
}

.signoff-domain {
    font-family: 'Libre Baskerville', Baskerville, serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    line-height: 1.05;
    letter-spacing: 0.01em;
    color: #e8c47a;
    margin-bottom: 1.5rem;
}

.rule-line-short {
    width: clamp(80px, 15vw, 200px);
    margin: 0 auto 1.5rem;
}

.signoff-text {
    font-family: 'Libre Baskerville', Baskerville, serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    color: #e8c47a;
    margin-bottom: 0.5rem;
}

.signoff-japanese {
    font-family: 'Noto Serif JP', serif;
    font-weight: 500;
    font-size: clamp(1rem, 1.5vw, 1.4rem);
    color: #a8926b;
    letter-spacing: 0.2em;
    margin-bottom: 2rem;
}

/* ======================== RESPONSIVE ======================== */

@media (max-width: 768px) {
    .decode-layout {
        flex-direction: column;
    }

    .decode-text {
        flex: none;
        max-width: 100%;
        order: 2;
    }

    .decode-grid {
        order: 1;
        width: 100%;
    }

    .archive-content {
        margin: 0;
        border-left: 1px solid #d4734a;
        border-right: 1px solid #d4734a;
    }
}
