/* mujun.quest — Surreal Dark-Academia Paradox Labyrinth */

/* ========================
   Reset & Base
   ======================== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: #1A1420;
    color: #F2E8D5;
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    overflow-x: hidden;
}

/* ========================
   Parchment Texture (CSS noise)
   ======================== */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(139,111,78,0.015) 2px,
            rgba(139,111,78,0.015) 3px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 3px,
            rgba(139,111,78,0.01) 3px,
            rgba(139,111,78,0.01) 4px
        );
    pointer-events: none;
    z-index: 0;
}

/* ========================
   Floating Navigation
   ======================== */
#float-nav {
    position: fixed;
    top: 24px;
    left: 24px;
    z-index: 1000;
}

.kanji-trigger {
    font-family: 'Noto Serif JP', serif;
    font-weight: 500;
    font-size: 20px;
    color: #8B6F4E;
    background: rgba(26,20,32,0.9);
    border: 1px solid #8B6F4E;
    padding: 8px 14px;
    cursor: pointer;
    transition: background 0.3s;
}

.kanji-trigger:hover {
    background: #3D3347;
}

#nav-list {
    display: none;
    flex-direction: column;
    gap: 2px;
    margin-top: 4px;
    background: rgba(26,20,32,0.95);
    border: 1px solid #8B6F4E;
    padding: 8px 0;
}

#float-nav.open #nav-list {
    display: flex;
}

.nav-item {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    font-size: 14px;
    color: #C4B8A8;
    text-decoration: none;
    padding: 6px 18px;
    transition: color 0.2s, background 0.2s;
}

.nav-item:hover {
    color: #F2E8D5;
    background: #3D3347;
}

/* ========================
   Candle Light Pools
   ======================== */
.candle-pool {
    position: fixed;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(139,111,78,0.05) 0%, transparent 70%);
    pointer-events: none;
    z-index: 1;
}

.candle-1 {
    width: 600px;
    height: 600px;
    top: 10%;
    left: -100px;
}

.candle-2 {
    width: 500px;
    height: 500px;
    top: 40%;
    right: -80px;
}

.candle-3 {
    width: 700px;
    height: 700px;
    bottom: -100px;
    left: 30%;
}

/* ========================
   Full Sections
   ======================== */
.full-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

/* ========================
   Hero
   ======================== */
#hero {
    text-align: center;
}

.hero-kanji-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 40px;
}

.hero-kanji {
    font-family: 'Noto Serif JP', serif;
    font-weight: 500;
    font-size: 120px;
    color: #8B6F4E;
    opacity: 0;
    transition: opacity 0.8s ease, transform 0.8s ease;
}

#kanji-spear {
    transform: translateX(-60px);
}

#kanji-shield {
    transform: translateX(60px);
}

.hero-kanji.revealed {
    opacity: 1;
    transform: translateX(0);
}

#diagonal-crack {
    width: 4px;
    height: 120px;
    transform: rotate(15deg);
    opacity: 0;
    transition: opacity 0.6s ease 0.8s;
}

#diagonal-crack.revealed {
    opacity: 1;
    animation: crackPulse 3s ease-in-out infinite 1.4s;
}

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

#hero-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 700;
    font-size: 80px;
    color: #F2E8D5;
    letter-spacing: -0.02em;
    opacity: 0;
    transition: opacity 1s ease 1.2s;
}

#hero-title.revealed {
    opacity: 1;
}

#hero-subtitle {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    font-size: 16px;
    color: #C4B8A8;
    margin-top: 16px;
    opacity: 0;
    transition: opacity 1s ease 1.6s;
}

#hero-subtitle.revealed {
    opacity: 1;
}

/* ========================
   Paradox Sections
   ======================== */
.paradox-section {
    position: relative;
    z-index: 2;
    padding: 80px 40px;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.angle-left {
    clip-path: polygon(0 3%, 100% 0%, 100% 97%, 0% 100%);
    background: #1A1420;
}

.angle-right {
    clip-path: polygon(0 0%, 100% 3%, 100% 100%, 0% 97%);
    background: #3D3347;
}

.paradox-inner {
    display: flex;
    align-items: stretch;
    max-width: 1000px;
    width: 100%;
    gap: 0;
    position: relative;
}

/* Statements */
.paradox-statement,
.paradox-counter {
    flex: 1;
    padding: 40px;
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.paradox-statement {
    transform: translateX(-40px);
}

.paradox-counter {
    transform: translateX(40px);
}

.paradox-statement.visible,
.paradox-counter.visible {
    opacity: 1;
    transform: translateX(0);
}

.statement-red {
    border-left: 3px solid #C4463A;
}

.statement-blue {
    border-right: 3px solid #2E5A6E;
}

.paradox-label {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #8B6F4E;
    display: block;
    margin-bottom: 16px;
}

blockquote {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 700;
    font-size: 32px;
    color: #F2E8D5;
    letter-spacing: -0.02em;
    line-height: 1.3;
    margin-bottom: 20px;
}

.paradox-body {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.7;
    color: #C4B8A8;
}

/* Diagonal Divider */
.diagonal-divider {
    width: 4px;
    flex-shrink: 0;
    position: relative;
    transform: rotate(3deg);
}

.crack-svg {
    width: 4px;
    height: 100%;
    display: block;
}

/* Margin Notes */
.margin-note {
    position: absolute;
    font-family: 'Noto Serif JP', serif;
    font-weight: 500;
    font-size: 14px;
    color: #8B6F4E;
    opacity: 0.6;
    writing-mode: vertical-rl;
}

.left-margin {
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
}

.right-margin {
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
}

.kanji-note {
    font-size: 18px;
    display: block;
    margin-bottom: 6px;
}

/* Paradox Glyphs */
.paradox-glyph {
    position: absolute;
    bottom: 40px;
    right: 60px;
    opacity: 0.6;
}

.glyph-path {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    transition: stroke-dashoffset 1.2s ease;
}

.paradox-glyph.drawn .glyph-path {
    stroke-dashoffset: 0;
}

/* ========================
   Resolution Section
   ======================== */
.resolve-section {
    min-height: 100vh;
    background: #1A1420;
    position: relative;
}

#overlap-layers {
    position: relative;
    width: 400px;
    height: 200px;
    margin-bottom: 60px;
}

.overlap-text {
    position: absolute;
    font-family: 'Cormorant Garamond', serif;
    font-weight: 700;
    font-size: 28px;
    color: #F2E8D5;
    opacity: 0.15;
    white-space: nowrap;
    transition: opacity 3s ease;
}

.overlap-1 { top: 0; left: 0; transform: rotate(-2deg); }
.overlap-2 { top: 40px; left: 20px; transform: rotate(1deg); }
.overlap-3 { top: 80px; left: -10px; transform: rotate(-1deg); }
.overlap-4 { top: 120px; left: 30px; transform: rotate(2deg); }

.resolve-section.resolved .overlap-text {
    opacity: 0;
}

#final-kanji {
    font-family: 'Noto Serif JP', serif;
    font-weight: 500;
    font-size: 120px;
    color: #8B6F4E;
    opacity: 0;
    transition: opacity 3s ease 1s;
}

.resolve-section.resolved #final-kanji {
    opacity: 1;
}

/* ========================
   Responsive
   ======================== */
@media (max-width: 768px) {
    .paradox-inner {
        flex-direction: column;
    }

    .paradox-statement,
    .paradox-counter {
        padding: 24px;
    }

    .statement-red {
        border-left: 2px solid #C4463A;
    }

    .statement-blue {
        border-right: none;
        border-left: 2px solid #2E5A6E;
    }

    .diagonal-divider {
        width: 100%;
        height: 4px;
        transform: rotate(0deg);
    }

    .crack-svg {
        width: 100%;
        height: 4px;
    }

    .margin-note {
        writing-mode: horizontal-tb;
        position: relative;
        left: auto;
        right: auto;
        top: auto;
        transform: none;
        padding: 8px 24px;
    }

    blockquote {
        font-size: 24px;
    }

    #hero-title {
        font-size: 48px;
    }

    .hero-kanji {
        font-size: 72px;
    }

    #final-kanji {
        font-size: 72px;
    }

    .paradox-glyph {
        position: relative;
        bottom: auto;
        right: auto;
        text-align: center;
        padding: 20px;
    }

    #overlap-layers {
        width: 280px;
    }

    .overlap-text {
        font-size: 20px;
    }

    .angle-left,
    .angle-right {
        clip-path: none;
    }
}
