/* mosoon.org - Contradiction Aesthetic / Paradoxical Simultaneity */

:root {
    --primary-a: #2C1B47;
    --primary-b: #C4B73F;
    --secondary-a: #E8D4F1;
    --secondary-b: #4A4A1F;
    --tertiary-a: #6B4D7E;
    --tertiary-b: #9BA340;
    --neutral: #72696B;

    --dominant-section: var(--primary-a);
    --recessive-section: var(--primary-b);

    --tension-bezier: cubic-bezier(0.68, -0.55, 0.27, 1.55);
    --smooth-bezier: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.inverted-section {
    --dominant-section: var(--primary-b);
    --recessive-section: var(--primary-a);
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.9vw, 1.2rem);
    line-height: 1.75;
    color: var(--neutral);
    background-color: var(--primary-a);
    overflow-x: hidden;
    position: relative;
}

/* Paradox Grid Background */
.paradox-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.04;
    background:
        linear-gradient(0deg, var(--neutral) 1px, transparent 1px),
        linear-gradient(90deg, var(--neutral) 1px, transparent 1px),
        linear-gradient(45deg, var(--neutral) 1px, transparent 1px),
        linear-gradient(-45deg, var(--neutral) 1px, transparent 1px);
    background-size:
        60px 60px,
        60px 60px,
        84.85px 84.85px,
        84.85px 84.85px;
}

/* Moire Overlay */
.moire-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* Typography */
.title {
    font-family: 'Clash Display', 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 4.5vw, 3.5rem);
    letter-spacing: 0.04em;
    text-transform: lowercase;
}

.heading-split {
    font-family: 'Clash Display', 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(1.4rem, 3.5vw, 2.5rem);
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.body-text {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.9vw, 1.2rem);
    line-height: 1.75;
    margin-bottom: 1rem;
}

.accent-label {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 500;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    display: inline-block;
}

.rotated-label {
    transform: rotate(180deg);
    writing-mode: vertical-rl;
    position: absolute;
    left: -2rem;
    top: 50%;
    transform: rotate(180deg) translateY(50%);
    color: var(--tertiary-a);
}

.rotated-label-inv {
    writing-mode: vertical-rl;
    position: absolute;
    right: -2rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--tertiary-b);
}

/* Sections */
.section {
    position: relative;
    z-index: 2;
    overflow: hidden;
}

/* ===================== */
/* OPENING SECTION       */
/* ===================== */
.opening {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

.split-viewport {
    width: 100%;
    height: 100%;
    display: flex;
    position: relative;
}

.split-left {
    width: 50%;
    height: 100%;
    background-color: var(--primary-a);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 2;
}

.split-right {
    width: 50%;
    height: 100%;
    background-color: var(--primary-b);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 2;
}

.split-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    opacity: 0;
    pointer-events: none;
}

.title-left {
    color: var(--primary-b);
    text-align: right;
    padding-right: 2rem;
    opacity: 1;
    transition: opacity 1.5s var(--smooth-bezier);
}

.title-right {
    color: var(--primary-a);
    text-align: left;
    padding-left: 2rem;
    opacity: 1;
    transition: opacity 1.5s var(--smooth-bezier);
}

.title-center {
    color: var(--neutral);
    opacity: 0.5;
    font-size: clamp(2.2rem, 5.5vw, 4.5rem);
}

.subtitle-left,
.subtitle-right {
    margin-top: 1rem;
}

.subtitle-left .accent-label {
    color: var(--tertiary-b);
}

.subtitle-right .accent-label {
    color: var(--tertiary-a);
}

/* Title fade animation */
.opening.scrolled .title-left,
.opening.scrolled .title-right {
    opacity: 0.4;
}

.opening.scrolled .split-center {
    opacity: 1;
    transition: opacity 1.5s var(--smooth-bezier) 0.3s;
}

/* Bifurcation Line */
.bifurcation-line {
    position: absolute;
    bottom: 20%;
    left: 0;
    width: 100%;
    height: 100px;
    z-index: 4;
}

/* Scroll Chevrons */
.scroll-chevrons {
    position: absolute;
    bottom: 5%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    z-index: 4;
}

.chevron {
    width: 40px;
    height: 20px;
    animation: chevronPulse 2s ease-in-out infinite;
}

.chevron-up {
    animation-delay: 0s;
}

.chevron-down {
    animation-delay: 1s;
}

@keyframes chevronPulse {
    0%, 100% { opacity: 0.3; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-3px); }
}

/* ===================== */
/* PARADOX NAV           */
/* ===================== */
.paradox-nav {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 100;
    cursor: pointer;
    width: 60px;
    height: 60px;
}

.paradox-indicator {
    width: 60px;
    height: 60px;
    animation: indicatorMorph 8s var(--tension-bezier) infinite;
}

.paradox-shape-rect {
    animation: rectMorph 8s var(--tension-bezier) infinite;
}

.paradox-shape-circle {
    animation: circlePulse 8s var(--tension-bezier) infinite alternate;
}

@keyframes indicatorMorph {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(90deg); }
    50% { transform: rotate(180deg); }
    75% { transform: rotate(270deg); }
    100% { transform: rotate(360deg); }
}

@keyframes rectMorph {
    0%, 100% { rx: 0; stroke-width: 1.5; }
    25% { rx: 10; stroke-width: 0.5; }
    50% { rx: 20; stroke-width: 2.5; }
    75% { rx: 5; stroke-width: 1; }
}

@keyframes circlePulse {
    0% { r: 20; stroke-width: 1.5; }
    50% { r: 18; stroke-width: 2.5; }
    100% { r: 22; stroke-width: 0.5; }
}

/* Radial Menu */
.radial-menu {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    transition: opacity 0.4s var(--tension-bezier), transform 0.4s var(--tension-bezier);
}

.radial-menu.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.3);
}

.radial-menu.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.radial-item {
    position: absolute;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 500;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--secondary-a);
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    background: rgba(44, 27, 71, 0.85);
    border: 1px solid var(--tertiary-a);
    transition: background 0.3s, color 0.3s;
    white-space: nowrap;
}

.radial-item:hover {
    background: var(--primary-b);
    color: var(--primary-a);
}

.radial-item[data-angle="0"] {
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
}

.radial-item[data-angle="90"] {
    top: 50%;
    right: -60px;
    transform: translateY(-50%);
}

.radial-item[data-angle="180"] {
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
}

.radial-item[data-angle="270"] {
    top: 50%;
    left: -50px;
    transform: translateY(-50%);
}

/* ===================== */
/* MAGNETIC SHAPES       */
/* ===================== */
.magnetic-shape {
    position: fixed;
    width: 80px;
    height: 80px;
    pointer-events: none;
    z-index: 5;
    transition: transform 0.2s ease-out;
    opacity: 0;
}

.magnetic-shape.active {
    opacity: 1;
}

.magnetic-primary {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.magnetic-inverted {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* ===================== */
/* DIAGONAL DIVIDERS     */
/* ===================== */
.diagonal-divider,
.bifurcation-divider,
.zigzag-divider {
    position: relative;
    z-index: 3;
    width: 100%;
    overflow: hidden;
}

.diagonal-divider svg,
.bifurcation-divider svg,
.zigzag-divider svg {
    display: block;
    width: 100%;
    height: auto;
}

.divider-1 { background: linear-gradient(to right, var(--secondary-a), var(--secondary-b)); }
.divider-2 { background: linear-gradient(to right, var(--secondary-b), var(--secondary-a)); }
.divider-3 { background: linear-gradient(to right, var(--secondary-a), var(--secondary-b)); }
.divider-4 { background: linear-gradient(to right, var(--secondary-b), var(--secondary-a)); }

/* ===================== */
/* PARADOX INTRO SECTION */
/* ===================== */
.paradox-intro {
    min-height: 150vh;
    padding: 6rem 2rem;
}

.dual-column {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
}

.column {
    flex: 1;
    position: relative;
    padding: 2rem;
}

.column-left {
    background: linear-gradient(135deg, var(--secondary-a) 0%, rgba(232, 212, 241, 0.3) 100%);
    text-align: left;
}

.column-right {
    background: linear-gradient(225deg, var(--secondary-b) 0%, rgba(74, 74, 31, 0.3) 100%);
    text-align: right;
}

.column-left .heading-split { color: var(--primary-a); }
.column-left .body-text { color: var(--primary-a); max-width: 55ch; }

.column-right .heading-split { color: var(--primary-b); }
.column-right .body-text { color: var(--primary-b); max-width: 65ch; margin-left: auto; }

.column-center-morph {
    flex: 0 0 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 0;
    align-self: center;
}

.morphing-form {
    width: 200px;
    height: 200px;
    animation: morphRotate 20s linear infinite;
}

@keyframes morphRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.yin-path,
.yang-path {
    transition: opacity 0.6s var(--tension-bezier);
}

.morphing-form:hover .yin-path { opacity: 0.3; }
.morphing-form:hover .yang-path { opacity: 0.9; }

/* Dual Arrows */
.dual-arrows {
    display: flex;
    justify-content: center;
    margin-top: 4rem;
}

.dual-arrows svg {
    width: 200px;
    height: 60px;
}

/* Paradox entry animation */
.paradox-left,
.paradox-right {
    opacity: 0;
    transition: opacity 0.8s var(--smooth-bezier), transform 0.8s var(--smooth-bezier);
}

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

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

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

/* ===================== */
/* TEMPORAL SECTION      */
/* ===================== */
.temporal-paradox {
    min-height: 150vh;
    padding: 4rem 2rem;
    background: linear-gradient(180deg, var(--secondary-b) 0%, var(--primary-a) 50%, var(--secondary-a) 100%);
}

.temporal-container {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

.temporal-top {
    position: relative;
}

.heading-temporal-top {
    color: var(--primary-b);
    text-align: center;
    margin-bottom: 3rem;
}

.heading-temporal-bottom {
    color: var(--primary-a);
    text-align: center;
    margin-bottom: 3rem;
}

.temporal-sequence {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.temporal-step {
    padding: 1.5rem 2rem;
    border-left: 3px solid var(--primary-b);
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s var(--smooth-bezier), transform 0.6s var(--smooth-bezier);
}

.temporal-step.visible {
    opacity: 1;
    transform: translateY(0);
}

.temporal-forward .temporal-step {
    border-left-color: var(--primary-b);
}

.temporal-forward .accent-label {
    color: var(--tertiary-b);
}

.temporal-forward .body-text {
    color: var(--secondary-a);
}

.temporal-reverse .temporal-step {
    border-left: none;
    border-right: 3px solid var(--primary-a);
    text-align: right;
}

.temporal-reverse .accent-label {
    color: var(--tertiary-a);
}

.temporal-reverse .body-text {
    color: var(--secondary-b);
}

.step-number {
    font-family: 'Clash Display', 'Playfair Display', serif;
    font-weight: 700;
    font-size: 2.5rem;
    opacity: 0.15;
    position: absolute;
    top: 0.5rem;
    right: 1rem;
    color: var(--primary-b);
}

.temporal-reverse .step-number {
    left: 1rem;
    right: auto;
    color: var(--primary-a);
}

.temporal-midpoint {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem 0;
}

.lens-motif {
    width: 100%;
    max-width: 400px;
    height: auto;
}

.midpoint-label {
    color: var(--neutral);
    text-align: center;
}

/* Parallax effect classes */
.temporal-top {
    transition: transform 0.1s linear;
}

.temporal-bottom {
    transition: transform 0.1s linear;
}

/* ===================== */
/* IMPOSSIBLE SECTION    */
/* ===================== */
.impossible-figure {
    min-height: 150vh;
    padding: 6rem 2rem;
    background: linear-gradient(135deg, var(--secondary-a) 0%, var(--secondary-b) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
}

.impossible-container {
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}

.heading-impossible {
    color: var(--primary-a);
    margin-bottom: 0.5rem;
}

.impossible-container > .accent-label {
    color: var(--tertiary-a);
    margin-bottom: 3rem;
    display: block;
}

.impossible-viewport {
    position: relative;
    margin-top: 3rem;
    display: flex;
    align-items: flex-start;
    gap: 2rem;
}

.impossible-svg {
    flex: 2;
    max-width: 500px;
    height: auto;
}

.impossible-group {
    transition: transform 0.6s var(--tension-bezier);
}

.impossible-svg:hover .face-front { opacity: 0.8; fill: var(--primary-b); }
.impossible-svg:hover .face-back { opacity: 0.7; fill: var(--primary-a); }
.impossible-svg:hover .face-top { opacity: 0.7; }
.impossible-svg:hover .face-right { opacity: 0.7; }

.interpretation-left,
.interpretation-right {
    flex: 1;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity 0.6s var(--smooth-bezier), transform 0.6s var(--smooth-bezier);
}

.interpretation-left {
    text-align: left;
    transform: translateX(-20px);
}

.interpretation-right {
    text-align: right;
    transform: translateX(20px);
}

.interpretation-left.visible,
.interpretation-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.interpretation-left .accent-label { color: var(--primary-a); }
.interpretation-left .body-text { color: var(--primary-a); }
.interpretation-right .accent-label { color: var(--primary-b); }
.interpretation-right .body-text { color: var(--secondary-b); }

/* Geometric Sequence animation */
.geo-shape {
    animation: geoFloat 6s var(--tension-bezier) infinite alternate;
}

.geo-1 { animation-delay: 0s; }
.geo-2 { animation-delay: 0.5s; }
.geo-3 { animation-delay: 1s; }
.geo-4 { animation-delay: 1.5s; }
.geo-5 { animation-delay: 2s; }

@keyframes geoFloat {
    0% { transform: translateY(0); opacity: 0.5; }
    50% { transform: translateY(-8px); opacity: 1; }
    100% { transform: translateY(0); opacity: 0.5; }
}

/* ===================== */
/* CLOSING SECTION       */
/* ===================== */
.closing {
    min-height: 100vh;
    padding: 6rem 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(180deg, var(--primary-a) 0%, var(--primary-b) 100%);
}

.closing-container {
    text-align: center;
    max-width: 1000px;
    margin: 0 auto;
}

.closing-split {
    display: flex;
    justify-content: center;
    gap: 4rem;
    margin-bottom: 4rem;
}

.heading-closing-left {
    color: var(--primary-b);
    text-align: right;
}

.heading-closing-right {
    color: var(--secondary-a);
    text-align: left;
}

.closing-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.final-yin-yang {
    width: 150px;
    height: 150px;
    animation: morphRotate 30s linear infinite;
}

.closing-label {
    color: var(--neutral);
    font-size: 0.9rem;
    letter-spacing: 0.15em;
}

/* ===================== */
/* HOVER COLOR SWAP      */
/* ===================== */
.split-left:hover {
    background-color: var(--primary-b);
    transition: background-color 0.5s var(--tension-bezier);
}

.split-left:hover .title-left {
    color: var(--primary-a);
    transition: color 0.5s var(--tension-bezier);
}

.split-left:hover .accent-label {
    color: var(--tertiary-a);
    transition: color 0.5s var(--tension-bezier);
}

.split-right:hover {
    background-color: var(--primary-a);
    transition: background-color 0.5s var(--tension-bezier);
}

.split-right:hover .title-right {
    color: var(--primary-b);
    transition: color 0.5s var(--tension-bezier);
}

.split-right:hover .accent-label {
    color: var(--tertiary-b);
    transition: color 0.5s var(--tension-bezier);
}

/* Transparency overlay zones */
.paradox-intro::before {
    content: '';
    position: absolute;
    top: 0;
    left: 40%;
    width: 20%;
    height: 100%;
    background: linear-gradient(
        180deg,
        rgba(44, 27, 71, 0.3) 0%,
        rgba(196, 183, 63, 0.3) 100%
    );
    pointer-events: none;
    z-index: 0;
}

/* Halftone dot pattern */
.paradox-intro::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle, var(--neutral) 1px, transparent 1px);
    background-size: 12px 12px;
    opacity: 0.03;
    pointer-events: none;
    z-index: 0;
}

/* ===================== */
/* MOBILE RESPONSIVE     */
/* ===================== */
@media (max-width: 768px) {
    .split-viewport {
        flex-direction: column;
    }

    .split-left,
    .split-right {
        width: 100%;
        height: 50%;
    }

    .dual-column {
        flex-direction: column;
    }

    .column-center-morph {
        order: -1;
        flex: none;
        width: 100%;
        justify-content: center;
    }

    .column-left,
    .column-right {
        text-align: left;
    }

    .column-right .body-text {
        margin-left: 0;
    }

    .rotated-label,
    .rotated-label-inv {
        position: relative;
        writing-mode: horizontal-tb;
        transform: none;
        left: auto;
        right: auto;
        top: auto;
        margin-bottom: 1rem;
    }

    .impossible-viewport {
        flex-direction: column;
        align-items: center;
    }

    .interpretation-left,
    .interpretation-right {
        text-align: center;
    }

    .closing-split {
        flex-direction: column;
        gap: 2rem;
    }

    .heading-closing-left,
    .heading-closing-right {
        text-align: center;
    }

    .temporal-reverse .temporal-step {
        border-right: none;
        border-left: 3px solid var(--primary-a);
        text-align: left;
    }

    .temporal-reverse .step-number {
        left: auto;
        right: 1rem;
    }

    .paradox-nav {
        top: 1rem;
        right: 1rem;
    }

    .radial-item[data-angle="90"] { right: -40px; }
    .radial-item[data-angle="270"] { left: -30px; }
}

/* Selection color */
::selection {
    background: var(--tertiary-a);
    color: var(--secondary-a);
}

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

::-webkit-scrollbar-track {
    background: var(--primary-a);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-b);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--tertiary-b);
}
