/* mujun.io - Chrome Metallic Paradox Descent */
/* Fonts: Recursive (variable), Zen Kaku Gothic New */
/* Palette: #0a0a0e, #141418, #808080, #9a9a9a, #c8c8c8, #e0e0e0, #8b2500, #4a6a8a */

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

html {
    scroll-behavior: smooth;
}

body {
    background: #0a0a0e;
    color: #9a9a9a;
    font-family: 'Recursive', monospace, sans-serif;
    font-variation-settings: 'wght' 400, 'CASL' 0.5, 'slnt' 0, 'MONO' 0;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

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

#grain-overlay svg {
    width: 100%;
    height: 100%;
}

/* Star Field */
#star-field {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1;
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: #505050;
}

.star.star-red {
    background: #6b3030;
}

.star.star-blue {
    background: #3a5a7a;
}

/* Timeline Spine */
#timeline-spine {
    position: fixed;
    left: 50%;
    top: 0;
    width: 1px;
    height: 100vh;
    background: linear-gradient(to bottom, #c0c0c0, #808080, #c0c0c0);
    z-index: 5;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 1s ease-out;
}

#timeline-spine.visible {
    opacity: 1;
}

#timeline-spine.fading {
    opacity: 0;
}

/* Scroll Container */
#scroll-container {
    scroll-snap-type: y mandatory;
    overflow-y: auto;
    height: 100vh;
    position: relative;
    z-index: 10;
}

/* Chapter */
.chapter {
    height: 100vh;
    scroll-snap-align: start;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.chapter-content {
    position: relative;
    width: 45%;
    max-width: 600px;
    filter: blur(6px);
    opacity: 0.3;
    transition: filter 600ms ease-out, opacity 600ms ease-out;
}

.chapter-content.in-view {
    filter: blur(0px);
    opacity: 1;
}

/* Chapter positioning */
.chapter-center {
    width: 80%;
    max-width: 800px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.chapter-left {
    margin-right: auto;
    margin-left: 5%;
    padding-right: 5%;
}

.chapter-right {
    margin-left: auto;
    margin-right: 5%;
    padding-left: 5%;
}

/* Timeline Nodes */
.timeline-node {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e8e8e8;
    border: 1px solid #a0a0a0;
    z-index: 20;
    animation: nodePulse 4s ease-in-out infinite;
    transition: width 200ms ease, height 200ms ease;
}

.chapter-left .timeline-node {
    right: -6%;
    top: 50%;
    transform: translate(50%, -50%);
}

.chapter-right .timeline-node {
    left: -6%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.chapter-center .timeline-node {
    left: 50%;
    top: 10%;
    transform: translate(-50%, -50%);
}

.timeline-node:hover {
    width: 16px;
    height: 16px;
}

.node-spear {
    background: #8b2500;
    border-color: #c8c8c8;
}

.node-shield {
    background: #4a6a8a;
    border-color: #c8c8c8;
}

.node-collision {
    width: 24px;
    height: 24px;
    animation: collisionPulse 8s ease-in-out infinite;
}

.node-neutral {
    background: #e8e8e8;
}

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

@keyframes collisionPulse {
    0%, 100% { background-color: #8b2500; }
    50% { background-color: #4a6a8a; }
}

/* Connector Lines */
.connector-line {
    position: absolute;
    top: 50%;
    height: 1px;
    border-top: 1px dashed #707070;
    z-index: 15;
    transition: border-style 200ms ease;
}

.connector-left {
    right: -5%;
    width: 5%;
}

.connector-right {
    left: -5%;
    width: 5%;
}

.timeline-node:hover ~ .connector-line,
.chapter-content:hover .connector-line {
    border-top-style: solid;
}

/* Domain Title - Chapter 0 */
.domain-title {
    font-family: 'Recursive', monospace, sans-serif;
    font-variation-settings: 'wght' 900, 'CASL' 0, 'slnt' 0, 'MONO' 0;
    font-size: clamp(3.5rem, 9vw, 7rem);
    color: #e0e0e0;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 0.5rem;
}

.domain-subtitle {
    font-family: 'Zen Kaku Gothic New', sans-serif;
    font-weight: 500;
    font-size: 2rem;
    color: #707070;
    opacity: 0.6;
    letter-spacing: 0.2em;
}

/* Kanji Side Elements - Chapter 0 */
.kanji-side {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
}

.kanji-left {
    left: 10%;
}

.kanji-right {
    right: 10%;
}

.kanji-glyph {
    font-family: 'Zen Kaku Gothic New', sans-serif;
    font-weight: 500;
    font-size: 6rem;
    opacity: 0.5;
}

.spear-color {
    color: #8b2500;
}

.shield-color {
    color: #4a6a8a;
}

.kanji-side .connector-line {
    position: relative;
    display: inline-block;
    width: 60px;
    top: auto;
}

.kanji-left .connector-line {
    right: auto;
    margin-left: 20px;
}

.kanji-right .connector-line {
    left: auto;
    margin-right: 20px;
    order: -1;
}

/* Section Headers */
.section-header {
    font-family: 'Recursive', monospace, sans-serif;
    font-variation-settings: 'wght' 700, 'CASL' 0, 'slnt' 0, 'MONO' 0;
    font-size: clamp(1.8rem, 4vw, 3rem);
    color: #c8c8c8;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 1.5rem;
}

/* Body Text */
.body-text {
    font-family: 'Recursive', monospace, sans-serif;
    font-variation-settings: 'wght' 400, 'CASL' 0.5, 'slnt' 0, 'MONO' 0;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    color: #9a9a9a;
    line-height: 1.75;
}

.body-text p {
    margin-bottom: 1.2em;
}

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

.classical-text {
    font-family: 'Zen Kaku Gothic New', sans-serif;
    font-weight: 500;
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    color: #c8c8c8;
    line-height: 2;
    padding: 1.5rem 0;
    border-left: 2px solid #8b2500;
    padding-left: 1.5rem;
    margin-bottom: 1.5em;
}

/* Annotations */
.annotation {
    display: block;
    margin-top: 1.5rem;
    font-family: 'Recursive', monospace, sans-serif;
    font-variation-settings: 'wght' 300, 'CASL' 0, 'slnt' -12, 'MONO' 1;
    font-size: 0.75rem;
    color: #606060;
}

/* Kanji Watermarks */
.kanji-watermark {
    position: absolute;
    font-family: 'Zen Kaku Gothic New', sans-serif;
    font-weight: 500;
    font-size: 100px;
    color: #808080;
    opacity: 0.04;
    z-index: -1;
    pointer-events: none;
    user-select: none;
}

.chapter-left .kanji-watermark {
    right: -10%;
    top: 20%;
}

.chapter-right .kanji-watermark {
    left: -10%;
    top: 20%;
}

/* Glyph Containers */
.spear-glyph-container,
.shield-glyph-container {
    margin-bottom: 2rem;
}

.spear-svg,
.shield-svg {
    display: block;
}

/* Collision Chapter */
.collision-chapter {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.collision-glyphs {
    margin-bottom: 3rem;
}

.collision-question {
    font-family: 'Recursive', monospace, sans-serif;
    font-variation-settings: 'wght' 700, 'CASL' 0, 'slnt' 0, 'MONO' 0;
    font-size: clamp(1.5rem, 3.5vw, 2.5rem);
    color: #e0e0e0;
    max-width: 600px;
    line-height: 1.4;
    transition: filter 600ms ease-out;
}

.collision-chapter.blur-active .collision-question {
    filter: blur(0px);
}

/* Chapter 7 - Final */
.chapter-final {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.final-text {
    font-family: 'Recursive', monospace, sans-serif;
    font-variation-settings: 'wght' 300, 'CASL' 0, 'slnt' 0, 'MONO' 0;
    font-size: 0.9rem;
    color: #9a9a9a;
    margin-bottom: 2rem;
    letter-spacing: 0.05em;
}

.final-domain {
    font-family: 'Recursive', monospace, sans-serif;
    font-variation-settings: 'wght' 300, 'CASL' 0, 'slnt' 0, 'MONO' 0;
    font-size: 0.8rem;
    color: #606060;
    letter-spacing: 0.1em;
}

/* Star entrance animation */
@keyframes starFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.star {
    opacity: 0;
    animation: starFadeIn 0.5s ease-out forwards;
}

/* Responsive */
@media (max-width: 768px) {
    .chapter-left,
    .chapter-right {
        width: 70%;
        margin-left: 15%;
        margin-right: 15%;
        padding-left: 0;
        padding-right: 0;
    }

    .chapter-left .timeline-node,
    .chapter-right .timeline-node {
        display: none;
    }

    .connector-line {
        display: none;
    }

    .kanji-side {
        display: none;
    }

    .domain-title {
        font-size: clamp(2.5rem, 12vw, 5rem);
    }

    .section-header {
        font-size: clamp(1.4rem, 5vw, 2rem);
    }

    #timeline-spine {
        opacity: 0.3;
    }
}
/* Additional design colors used in SVG elements */
.spear-glyph-container svg polygon {
    filter: drop-shadow(0 0 4px rgba(74, 18, 0, 0.5));
}

.shield-glyph-container svg rect {
    filter: drop-shadow(0 0 4px rgba(90, 122, 154, 0.3));
}



/* Design palette references */
:root {
    --spear-dark: #4a1200;
    --crosshatch-accent: #5a7a9a;
}
