/* mujun.xyz — Paradox Engine */
/* Colors: #1a1008, #2d1a0a, #c4622a, #d4953a, #e8a540, #f0e2cc, #a88c6a, #ff7a3d */

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

html {
    scroll-behavior: smooth;
}

body {
    background: radial-gradient(ellipse at 50% 40%, #2d1a0a 0%, #1a1008 70%);
    color: #f0e2cc;
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: clamp(16px, 1.2vw, 20px);
    line-height: 1.65;
    overflow: hidden;
}

/* ======================== */
/* KANJI WATERMARK          */
/* ======================== */
.kanji-watermark {
    position: fixed;
    top: 45%;
    left: 55%;
    transform: translate(-50%, -50%);
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-weight: 700;
    font-size: clamp(200px, 30vw, 500px);
    color: #c4622a;
    opacity: 0.03;
    pointer-events: none;
    z-index: 0;
    line-height: 1;
    user-select: none;
}

/* ======================== */
/* HUD BRACKETS             */
/* ======================== */
.hud-bracket {
    position: fixed;
    width: 48px;
    height: 48px;
    z-index: 100;
    pointer-events: none;
}

.hud-bracket path {
    stroke-dasharray: 96;
    stroke-dashoffset: 96;
    transition: stroke-dashoffset 600ms ease-out;
}

.hud-bracket.drawn path {
    stroke-dashoffset: 0;
}

.hud-bracket-tl {
    top: 16px;
    left: 16px;
}

.hud-bracket-tr {
    top: 16px;
    right: 16px;
}

.hud-bracket-bl {
    bottom: 16px;
    left: 16px;
}

.hud-bracket-br {
    bottom: 16px;
    right: 16px;
}

/* ======================== */
/* HUD READOUTS             */
/* ======================== */
.hud-readout {
    position: fixed;
    font-family: 'Space Grotesk', monospace;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #a88c6a;
    opacity: 0.5;
    z-index: 100;
    pointer-events: none;
}

.hud-readout-tr {
    top: 12px;
    right: 72px;
}

.hud-readout-bl {
    bottom: 12px;
    left: 72px;
}

/* ======================== */
/* HUD THIRDS GRID          */
/* ======================== */
.hud-thirds-line {
    position: fixed;
    left: 0;
    right: 0;
    height: 1px;
    background: #a88c6a;
    opacity: 0.08;
    z-index: 50;
    pointer-events: none;
}

.hud-thirds-top {
    top: 33.333vh;
}

.hud-thirds-bottom {
    top: 66.666vh;
}

/* ======================== */
/* CHAMBER NAVIGATION       */
/* ======================== */
.chamber-nav {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 100;
}

.chamber-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #a88c6a;
    opacity: 0.3;
    cursor: pointer;
    transition: opacity 400ms ease, background-color 400ms ease, transform 400ms ease;
}

.chamber-dot.active {
    background: #e8a540;
    opacity: 1;
    transform: scale(1.4);
}

/* ======================== */
/* SCROLL CONTAINER         */
/* ======================== */
.scroll-container {
    width: 100vw;
    height: 100vh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
}

.scroll-container::-webkit-scrollbar {
    display: none;
}

/* ======================== */
/* CHAMBERS - GENERAL       */
/* ======================== */
.chamber {
    width: 100%;
    height: 100vh;
    scroll-snap-align: start;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.chamber-bg-pattern {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 400ms ease;
    pointer-events: none;
}

.chamber.active .chamber-bg-pattern {
    opacity: 1;
}

.chamber-content {
    position: relative;
    z-index: 10;
    max-width: 38em;
    padding: 2em;
}

.chamber-title {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-weight: 700;
    font-size: clamp(48px, 8vw, 120px);
    letter-spacing: -0.02em;
    line-height: 1.05;
    color: #f0e2cc;
    margin-bottom: 0.4em;
}

.title-word {
    display: inline-block;
    position: relative;
}

.title-word::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: #e8a540;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 800ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.chamber.active .title-word::after {
    transform: scaleX(1);
}

.chamber-prose {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: clamp(16px, 1.2vw, 20px);
    line-height: 1.65;
    color: #f0e2cc;
    max-width: 38em;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 600ms ease 300ms, transform 600ms ease 300ms;
}

.chamber.active .chamber-prose {
    opacity: 1;
    transform: translateY(0);
}

.chamber-kanji {
    display: block;
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-weight: 700;
    font-size: clamp(60px, 10vw, 140px);
    color: #d4953a;
    opacity: 0.12;
    margin-top: 0.2em;
    user-select: none;
}

/* ======================== */
/* WATERMARK GLYPHS         */
/* ======================== */
.watermark-glyph {
    position: absolute;
    width: 40px;
    height: 40px;
    opacity: 0.06;
    pointer-events: none;
}

.chamber-spear .watermark-glyph {
    top: 20%;
    right: 15%;
    transform: rotate(15deg);
}

.watermark-rotated {
    top: 60% !important;
    left: 10% !important;
    right: auto !important;
    transform: rotate(-45deg) !important;
}

.watermark-collision {
    top: 30% !important;
    left: 50% !important;
    right: auto !important;
    transform: rotate(90deg) !important;
}

/* ======================== */
/* CHAMBER 1: THE SPEAR     */
/* ======================== */
.chamber-spear {
    background: radial-gradient(ellipse at 30% 50%, #2d1a0a 0%, #1a1008 70%);
}

.chamber-spear .chamber-bg-pattern {
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 31px,
        rgba(196, 98, 42, 0.08) 31px,
        rgba(196, 98, 42, 0.08) 32px
    );
}

.chamber-content-spear {
    text-align: left;
    padding-left: 10vw;
}

/* ======================== */
/* CHAMBER 2: THE SHIELD    */
/* ======================== */
.chamber-shield {
    background: radial-gradient(ellipse at 70% 50%, #2d1a0a 0%, #1a1008 70%);
}

.chamber-shield .chamber-bg-pattern {
    background-image: repeating-radial-gradient(
        circle at 50% 50%,
        transparent,
        transparent 47px,
        rgba(212, 149, 58, 0.06) 47px,
        rgba(212, 149, 58, 0.06) 48px
    );
}

.chamber-content-shield {
    text-align: right;
    padding-right: 10vw;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* ======================== */
/* CHAMBER 3: THE COLLISION */
/* ======================== */
.chamber-collision {
    background: radial-gradient(ellipse at 50% 50%, #2d1a0a 0%, #1a1008 70%);
}

.chamber-bg-collision {
    background-image:
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 31px,
            rgba(196, 98, 42, 0.08) 31px,
            rgba(196, 98, 42, 0.08) 32px
        ),
        repeating-radial-gradient(
            circle at 50% 50%,
            transparent,
            transparent 47px,
            rgba(212, 149, 58, 0.06) 47px,
            rgba(212, 149, 58, 0.06) 48px
        );
}

.contradiction-line {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 40px;
    transform: translateY(-50%);
    z-index: 5;
    pointer-events: none;
}

.fracture-line {
    stroke: #ff7a3d;
    stroke-width: 1;
}

.chamber-collision.active .fracture-top {
    animation: fracture-up 2s ease-in-out infinite alternate;
}

.chamber-collision.active .fracture-bottom {
    animation: fracture-down 2s ease-in-out infinite alternate;
}

@keyframes fracture-up {
    0% { transform: translateY(0); }
    100% { transform: translateY(-20px); }
}

@keyframes fracture-down {
    0% { transform: translateY(0); }
    100% { transform: translateY(20px); }
}

.collision-split {
    display: flex;
    gap: 2vw;
    align-items: baseline;
    margin-bottom: 0.4em;
}

.collision-left {
    transform: translateX(0);
    transition: transform 1.2s ease;
}

.collision-right {
    transform: translateX(0);
    transition: transform 1.2s ease;
}

.chamber-collision.active .collision-left {
    transform: translateX(-10px);
}

.chamber-collision.active .collision-right {
    transform: translateX(10px);
}

.chamber-content-collision {
    text-align: center;
}

/* ======================== */
/* CHAMBER 4: THE RESOLUTION*/
/* ======================== */
.chamber-resolution {
    background: radial-gradient(ellipse at 50% 40%, #2d1a0a 0%, #1a1008 60%);
}

.resolution-glyph {
    position: absolute;
    width: 120px;
    height: 120px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 1s ease 400ms;
    z-index: 5;
}

.chamber-resolution.active .resolution-glyph {
    opacity: 0.8;
}

.chamber-content-resolution {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.resolution-title {
    color: #e8a540;
}

.domain-dot {
    color: #ff7a3d;
}

.resolution-prose {
    margin-top: 1em;
}

.resolution-kanji {
    font-size: clamp(40px, 6vw, 80px);
    opacity: 0.2;
    color: #e8a540;
}

/* ======================== */
/* GEOMETRIC BG SHAPES      */
/* ======================== */
.chamber::before {
    content: '';
    position: absolute;
    width: clamp(200px, 40vw, 600px);
    height: clamp(200px, 40vw, 600px);
    border: 1px solid #c4622a;
    border-radius: 50%;
    opacity: 0.04;
    pointer-events: none;
    animation: slow-rotate 60s linear infinite;
}

.chamber-spear::before {
    top: -10%;
    right: -10%;
}

.chamber-shield::before {
    bottom: -10%;
    left: -10%;
}

.chamber-collision::before {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 0;
    transform-origin: center;
}

.chamber-resolution::before {
    display: none;
}

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

/* ======================== */
/* RESPONSIVE               */
/* ======================== */
@media (max-width: 768px) {
    .chamber-content-spear {
        padding-left: 5vw;
    }

    .chamber-content-shield {
        padding-right: 5vw;
    }

    .hud-readout {
        font-size: 8px;
    }

    .chamber-nav {
        right: 12px;
    }

    .chamber-kanji {
        font-size: clamp(40px, 8vw, 80px);
    }
}
