:root {
    --color-parchment: #f5efe6;
    --color-umber: #e8dcc8;
    --color-walnut: #4a3728;
    --color-ink: #8b7355;
    --color-brush: #a0896e;
    --color-gold: #c9a96e;
    --color-sumi: #2c1e12;
    --color-bone: #faf8f4;
    --font-display: 'Shippori Mincho', serif;
    --font-body: 'Cormorant Garamond', serif;
    --font-mono: 'IBM Plex Mono', monospace;
    --ease-natural: cubic-bezier(0.25, 0.1, 0.25, 1);
    --leading-generous: 2.2;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--color-parchment);
    color: var(--color-ink);
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: var(--leading-generous);
    letter-spacing: 0.02em;
    overflow-x: hidden;
}

/* Noise texture overlay */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ===================== */
/* Section 1: Paradox Gate */
/* ===================== */
.paradox-gate {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    overflow: hidden;
}

.gate-left,
.gate-right {
    flex: 1;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.gate-left {
    justify-content: flex-end;
    padding-right: 4vw;
}

.gate-right {
    justify-content: flex-start;
    padding-left: 4vw;
}

.kanji-hero {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(12rem, 22vw, 28rem);
    color: var(--color-sumi);
    line-height: 1;
    user-select: none;
}

.gate-divider {
    position: absolute;
    left: 50%;
    top: 0;
    width: 1px;
    height: 100%;
    background-color: var(--color-ink);
    transform: translateX(-50%);
}

.gate-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 2;
}

.kanji-combined {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.2rem, 2.5vw, 2rem);
    color: var(--color-walnut);
    letter-spacing: 0.3em;
    display: block;
}

.hero-leaf {
    margin-top: 2rem;
    animation: heroLeafDrift 8s ease-in-out infinite;
}

@keyframes heroLeafDrift {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: translateY(20px) rotate(15deg);
        opacity: 0.7;
    }
    100% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
}

/* ===================== */
/* Section 2: Void Passage */
/* ===================== */
.void-passage {
    width: 100vw;
    height: 65vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-bone);
    opacity: 0;
    transition: opacity 2s var(--ease-natural);
}

.void-passage.visible {
    opacity: 1;
}

.brushstroke {
    width: 60vw;
    height: 6px;
}

.brushstroke-path {
    stroke-dasharray: 650;
    stroke-dashoffset: 650;
    transition: stroke-dashoffset 2s var(--ease-natural);
}

.void-passage.visible .brushstroke-path {
    stroke-dashoffset: 0;
}

/* ===================== */
/* Section 3: The Fable */
/* ===================== */
.fable-section {
    padding: clamp(6rem, 12vh, 14rem) 1.5rem;
    display: flex;
    justify-content: center;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1.5s var(--ease-natural), transform 1.5s var(--ease-natural);
}

.fable-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.fable-text {
    max-width: 580px;
    text-align: center;
}

.fable-text p {
    margin-bottom: 1.8em;
    font-family: var(--font-body);
    font-weight: 300;
    color: var(--color-ink);
}

.fable-text .emphasis {
    font-weight: 400;
    font-style: italic;
    color: var(--color-walnut);
}

.mono-question {
    font-family: var(--font-mono) !important;
    font-weight: 300 !important;
    font-size: clamp(0.75rem, 1.2vw, 0.9rem) !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase;
    color: var(--color-walnut) !important;
    margin-top: 2em;
    margin-bottom: 2em;
}

/* ===================== */
/* Leaf Divider */
/* ===================== */
.leaf-divider {
    text-align: center;
    padding: 3rem 0;
}

/* ===================== */
/* Section 4: Contradiction Canvas */
/* ===================== */
.contradiction-canvas {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.spear-svg {
    position: absolute;
    left: 10%;
    transition: transform 0.1s linear;
}

.shield-svg {
    position: absolute;
    right: 10%;
    transition: transform 0.1s linear;
}

/* ===================== */
/* Section 5: Leaf Fall */
/* ===================== */
.leaf-fall {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: linear-gradient(to bottom, var(--color-parchment), var(--color-umber));
    display: flex;
    align-items: center;
    justify-content: center;
}

.falling-leaves {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.falling-leaf {
    position: absolute;
    top: -50px;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

@keyframes leafFallCW {
    0% {
        transform: translateY(-50px) rotate(0deg);
    }
    100% {
        transform: translateY(110vh) rotate(360deg);
    }
}

@keyframes leafFallCCW {
    0% {
        transform: translateY(-50px) rotate(360deg);
    }
    100% {
        transform: translateY(110vh) rotate(0deg);
    }
}

.leaf-fall-title {
    position: relative;
    z-index: 2;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1.5s var(--ease-natural), transform 1.5s var(--ease-natural);
}

.leaf-fall.visible .leaf-fall-title {
    opacity: 1;
    transform: translateY(0);
}

.leaf-fall-title span {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.5rem, 5vw, 4rem);
    color: var(--color-walnut);
    letter-spacing: 0.05em;
}
