/* =============================================
   kaigenrei.com — Brutalist Anti-Design / Martial Law Decree
   ============================================= */

:root {
    --void: #0A0A0A;
    --paper: #F2EDE4;
    --paper-mid: #E8E0D0;
    --paper-dark: #DDD5C5;
    --ink: #1A1A1A;
    --stamp-red: #8B0000;
    --censored: #0D0D0D;
    --faded: #6B6460;
    --alert: #E8A020;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--void);
    color: var(--ink);
    font-family: 'IBM Plex Serif', Georgia, serif;
    font-weight: 400;
    font-size: 17px;
    line-height: 1.75;
    cursor: default;
    overflow-x: hidden;
}

::selection {
    background: var(--stamp-red);
    color: var(--paper);
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--stamp-red);
}

/* ---- Fixed Site Mark ---- */
.site-mark {
    position: fixed;
    top: 20px;
    left: 20px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 14px;
    font-weight: 500;
    color: var(--stamp-red);
    letter-spacing: 0.04em;
    z-index: 100;
    opacity: 0.8;
}

/* ---- Scroll Progress ---- */
.scroll-progress {
    position: fixed;
    right: 0;
    top: 0;
    width: 2px;
    height: 0%;
    background: var(--stamp-red);
    z-index: 100;
    transition: height 0.1s linear;
}

/* ---- Section Base ---- */
.section {
    position: relative;
    width: 100%;
}

.paper-section {
    background: var(--paper);
    padding: 80px 15vw;
}

.section-label {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 500;
    font-size: 13px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--stamp-red);
    margin-bottom: 40px;
}

/* =============================================
   1. THE DECREE (HERO)
   ============================================= */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--void);
    padding: 40px;
}

.decree-content {
    text-align: center;
    position: relative;
    max-width: 800px;
}

.cursor-blink {
    width: 2px;
    height: 48px;
    background: var(--paper);
    margin: 0 auto 20px;
    opacity: 0;
    animation: blink 1s step-start infinite;
    animation-delay: 1.5s;
}

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

.decree-text {
    font-family: 'Special Elite', monospace;
    font-size: clamp(28px, 5vw, 56px);
    font-weight: 400;
    letter-spacing: 0.04em;
    line-height: 1.6;
    color: var(--paper);
    min-height: 1.6em;
}

.decree-text .char {
    display: inline;
    opacity: 0;
}

.decree-text .char.visible {
    opacity: 1;
}

.decree-translation {
    font-family: 'IBM Plex Serif', serif;
    font-size: 20px;
    color: var(--paper);
    opacity: 0;
    transition: opacity 1s ease;
    margin-top: 30px;
}

.decree-translation.visible {
    opacity: 0.8;
}

/* =============================================
   2. HISTORICAL CONTEXT
   ============================================= */
#context {
    position: relative;
}

.official-stamp {
    position: absolute;
    top: -40px;
    right: 10vw;
    width: 120px;
    height: 120px;
    transform: rotate(-12deg) scale(0.8);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
    z-index: 10;
}

.official-stamp.visible {
    transform: rotate(-12deg) scale(1);
    opacity: 0.85;
}

.context-layout {
    display: flex;
    gap: 40px;
}

.context-margin {
    width: 35%;
    border-left: 2px solid var(--stamp-red);
    padding-left: 20px;
    position: relative;
}

.vertical-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--stamp-red);
    opacity: 0.4;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    position: sticky;
    top: 100px;
}

.context-content {
    width: 65%;
}

.context-content p,
.aftermath-content p {
    margin-bottom: 24px;
    color: var(--ink);
}

/* =============================================
   3. THE MECHANISMS
   ============================================= */
#mechanisms {
    padding: 80px 10vw;
}

.document-pile {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    max-width: 900px;
    margin: 0 auto;
}

.doc-card {
    background: var(--bg);
    padding: 30px;
    transform: rotate(var(--rot)) translate(var(--tx, 0px), var(--ty, 0px));
    box-shadow: 2px 3px 8px rgba(0,0,0,0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    opacity: 0;
}

.doc-card:nth-child(1) { --tx: 5px; --ty: -3px; }
.doc-card:nth-child(2) { --tx: -4px; --ty: 5px; }
.doc-card:nth-child(3) { --tx: 7px; --ty: 3px; grid-column: 1 / -1; max-width: 500px; margin: 0 auto; }
.doc-card:nth-child(4) { --tx: -3px; --ty: -5px; }
.doc-card:nth-child(5) { --tx: 6px; --ty: 4px; }

.doc-card.visible {
    opacity: 1;
}

.doc-card:hover {
    transform: rotate(var(--rot)) translate(var(--tx, 0px), var(--ty, 0px)) scale(1.015);
    box-shadow: 3px 5px 14px rgba(0,0,0,0.2);
}

.card-label {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 500;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--stamp-red);
    display: block;
    margin-bottom: 16px;
}

.doc-card p {
    font-size: 15px;
    line-height: 1.7;
    color: var(--ink);
}

.alert-text {
    color: var(--alert);
    font-weight: 600;
}

/* =============================================
   4. VOICES
   ============================================= */
.voices-section {
    background: var(--paper);
    display: flex;
    justify-content: center;
    padding: 120px 15vw;
}

.voices-content {
    max-width: 480px;
}

.testimony {
    margin-bottom: 60px;
}

.testimony blockquote p {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(20px, 2.5vw, 28px);
    line-height: 2.0;
    color: var(--ink);
}

.fade-blur {
    opacity: 0.3;
    filter: blur(2px);
    transition: opacity 0.8s ease, filter 0.8s ease;
}

.fade-blur.in-view {
    opacity: 1;
    filter: blur(0);
}

/* =============================================
   5. THE AFTERMATH
   ============================================= */
#aftermath {
    padding: 80px 15vw 120px;
}

.aftermath-content .closing-line {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 500;
    font-size: 14px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--stamp-red);
    margin-top: 60px;
}

/* =============================================
   REDACTION BARS
   ============================================= */
.redacted {
    position: relative;
    display: inline-block;
    cursor: crosshair;
    margin: 16px 0;
}

.redacted-text {
    font-family: 'IBM Plex Serif', serif;
    font-size: 17px;
    line-height: 1.75;
    color: var(--ink);
    white-space: nowrap;
}

.redaction-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--censored);
    opacity: 0.92;
    transition: transform 0.3s ease;
    cursor: not-allowed;
}

.redacted:hover .redaction-bar {
    transform: translateX(4px);
    cursor: crosshair;
}

.redacted.clicked .redaction-bar {
    animation: slideReveal 0.8s ease forwards;
}

@keyframes slideReveal {
    0% { transform: translateX(0); }
    40% { transform: translateX(15px); }
    100% { transform: translateX(0); }
}

/* =============================================
   TORN-PAPER DIVIDER
   ============================================= */
.torn-divider {
    background: var(--void);
    margin-top: -1px;
}

.torn-divider svg {
    display: block;
    width: 100%;
    height: 20px;
}

/* =============================================
   FADE ANIMATIONS
   ============================================= */
.fade-group > * {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-group.in-view > * {
    opacity: 1;
    transform: translateY(0);
}

.fade-group.in-view > *:nth-child(1) { transition-delay: 0ms; }
.fade-group.in-view > *:nth-child(2) { transition-delay: 80ms; }
.fade-group.in-view > *:nth-child(3) { transition-delay: 160ms; }
.fade-group.in-view > *:nth-child(4) { transition-delay: 240ms; }
.fade-group.in-view > *:nth-child(5) { transition-delay: 320ms; }
.fade-group.in-view > *:nth-child(6) { transition-delay: 400ms; }
.fade-group.in-view > *:nth-child(7) { transition-delay: 480ms; }

.fade-in {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .paper-section {
        padding: 60px 8vw;
    }

    .context-layout {
        flex-direction: column;
    }

    .context-margin {
        width: 100%;
        border-left: none;
        border-top: 2px solid var(--stamp-red);
        padding-left: 0;
        padding-top: 10px;
        margin-bottom: 20px;
    }

    .vertical-label {
        writing-mode: horizontal-tb;
        position: static;
    }

    .context-content {
        width: 100%;
    }

    .document-pile {
        grid-template-columns: 1fr;
    }

    .doc-card:nth-child(3) {
        grid-column: 1;
        max-width: 100%;
    }

    .voices-section {
        padding: 80px 8vw;
    }
}
