/* mosoon.xyz — Evolved Minimal / Editorial Flow */
/* Palette: #F5F0E8 bone-white, #6B1D2A burgundy, #3D0F17 burgundy-dark,
   #2E2A26 charcoal, #A8875A brass, #7A8C72 sage, #C4929A rose-dust */

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    --bg: #F5F0E8;
    --fg: #2E2A26;
    background-color: var(--bg);
    color: var(--fg);
    font-family: 'Lora', Georgia, serif;
    font-weight: 400;
    line-height: 1.75;
    font-size: clamp(1rem, 1.2vw, 1.25rem);
    letter-spacing: 0.01em;
    overflow-x: hidden;
}

::selection {
    background-color: #C4929A;
    color: #3D0F17;
}

/* ---- Label Text (section markers) ---- */
.label-text {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #A8875A;
    opacity: 0.7;
}

/* ---- Progress Indicator ---- */
.progress-indicator {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 100;
    animation: pulse 3s ease-in-out infinite;
}

.progress-bg {
    fill: none;
    stroke: #F5F0E8;
    stroke-width: 2;
}

.progress-fill {
    fill: none;
    stroke: #6B1D2A;
    stroke-width: 2;
    stroke-dasharray: 100.53;
    stroke-dashoffset: 100.53;
    transform: rotate(-90deg);
    transform-origin: center;
    stroke-linecap: round;
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* ---- Sections Base ---- */
.section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(48px, 8vw, 120px);
}

.section__inner {
    max-width: 960px;
    width: 100%;
    position: relative;
}

/* ---- SVG Shapes ---- */
.shape {
    color: #6B1D2A;
    opacity: 0.6;
    transition: opacity 0.6s ease;
}

.shape.shape--visible {
    opacity: 1;
}

/* Stroke draw animation */
.shape--draw line,
.shape--draw circle,
.shape--draw polygon,
.shape--draw path {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    transition: stroke-dashoffset 1.2s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.shape--draw.shape--visible line,
.shape--draw.shape--visible circle,
.shape--draw.shape--visible polygon,
.shape--draw.shape--visible path {
    stroke-dashoffset: 0;
}

/* ---- Fibonacci Rules ---- */
.fib-rule {
    border: none;
    height: 1px;
    background-color: #6B1D2A;
    opacity: 0.3;
    margin: 1.5rem 0;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.8s ease-out;
}

.fib-rule.fib-rule--visible {
    transform: scaleX(1);
}

.fib-rule--382 { width: 38.2%; }
.fib-rule--618 { width: 61.8%; }
.fib-rule--50 { width: 50%; }
.fib-rule--236 { width: 23.6%; }

/* ============================================
   SECTION I: THESIS
   ============================================ */
.section--thesis {
    background-color: #F5F0E8;
    color: #6B1D2A;
    min-height: 100vh;
}

.thesis__rule {
    position: absolute;
    top: 0;
    left: 61.8%;
    width: 2px;
    height: 0;
    background-color: #6B1D2A;
    transition: height 2s ease-in-out;
}

.thesis__rule.thesis__rule--drawn {
    height: 38.2%;
}

.thesis__inner {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 23.6%;
}

.thesis__content {
    position: relative;
}

.thesis__logo {
    margin-bottom: 1.5rem;
    opacity: 0;
    transition: opacity 1.2s ease 0.5s;
}

.thesis__logo.thesis__logo--visible {
    opacity: 1;
}

.thesis__logo .shape--bisected-circle {
    animation: pulseStroke 3s ease-in-out infinite;
}

.thesis__logo .shape--bisected-circle:hover {
    animation: none;
    opacity: 1;
}

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

.thesis__title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(2.5rem, 6vw, 6rem);
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: #6B1D2A;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.1, 0.25, 1) 0.3s,
                transform 0.8s cubic-bezier(0.25, 0.1, 0.25, 1) 0.3s;
}

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

.thesis__tagline {
    font-family: 'Lora', Georgia, serif;
    font-style: italic;
    font-size: clamp(1rem, 1.2vw, 1.25rem);
    color: #2E2A26;
    margin-top: 1.5rem;
    opacity: 0;
    transition: opacity 1s ease 1.2s;
}

.thesis__tagline.thesis__tagline--visible {
    opacity: 1;
}

.thesis__label {
    position: absolute;
    bottom: clamp(32px, 5vw, 64px);
    left: clamp(48px, 8vw, 120px);
}

/* ============================================
   SECTION II: ANTITHESIS
   ============================================ */
.section--antithesis {
    background-color: #F5F0E8;
    min-height: 200vh;
    align-items: flex-start;
    padding-top: clamp(80px, 10vw, 160px);
    padding-bottom: clamp(80px, 10vw, 160px);
}

.antithesis__label {
    margin-bottom: 3rem;
}

.antithesis__grid {
    display: grid;
    grid-template-columns: 38.2fr 2px 61.8fr;
    gap: 32px;
}

.antithesis__left {
    text-align: right;
}

.antithesis__right {
    text-align: left;
}

.antithesis__divider {
    background-color: #6B1D2A;
    opacity: 0.15;
    width: 2px;
    min-height: 100%;
    position: relative;
}

/* Interrupted divider effect */
.antithesis__divider::before,
.antithesis__divider::after {
    content: '';
    position: absolute;
    left: 0;
    width: 2px;
    height: 40px;
    background-color: #F5F0E8;
}

.antithesis__divider::before {
    top: 30%;
}

.antithesis__divider::after {
    top: 65%;
}

.antithesis__entry,
.antithesis__counter {
    margin-bottom: 1rem;
}

.antithesis__entry .shape {
    display: inline-block;
    margin-bottom: 0.75rem;
    color: #6B1D2A;
}

.antithesis__counter .shape {
    display: inline-block;
    margin-bottom: 0.75rem;
    color: #7A8C72;
}

.antithesis__aphorism {
    font-family: 'Lora', Georgia, serif;
    font-size: clamp(1rem, 1.2vw, 1.25rem);
    line-height: 1.75;
    color: #2E2A26;
    letter-spacing: 0.01em;
}

.antithesis__countertext {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 300;
    font-size: clamp(1.1rem, 1.5vw, 1.4rem);
    line-height: 1.6;
    letter-spacing: 0.01em;
    color: #7A8C72;
}

/* Reveal animations */
.antithesis__entry--reveal,
.antithesis__counter--reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s cubic-bezier(0.25, 0.1, 0.25, 1),
                transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.antithesis__entry--reveal.visible,
.antithesis__counter--reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Left-side fib rules align right */
.antithesis__left .fib-rule {
    margin-left: auto;
    transform-origin: right;
}

/* ============================================
   SECTION III: SYNTHESIS
   ============================================ */
.section--synthesis {
    min-height: 100vh;
    background-color: var(--synth-bg, #F5F0E8);
    color: var(--synth-fg, #2E2A26);
    transition: background-color 0.05s linear, color 0.05s linear;
}

.synthesis__inner {
    text-align: center;
    max-width: 680px;
}

.synthesis__label {
    margin-bottom: 3rem;
}

.synthesis__label .label-text {
    color: var(--synth-accent, #A8875A);
}

.synthesis__lemniscate {
    margin-bottom: 2.5rem;
}

.synthesis__lemniscate .shape {
    color: var(--synth-fg, #6B1D2A);
}

.synthesis__body {
    font-family: 'Lora', Georgia, serif;
    font-size: clamp(1rem, 1.2vw, 1.25rem);
    line-height: 1.75;
    color: var(--synth-fg, #2E2A26);
    margin-bottom: 1.5rem;
}

.synthesis__body em {
    font-style: italic;
    color: var(--synth-em, #6B1D2A);
}

.synthesis__body--reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s cubic-bezier(0.25, 0.1, 0.25, 1),
                transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.synthesis__body--reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.synthesis__lemniscate--reveal {
    opacity: 0;
    transition: opacity 1s ease;
}

.synthesis__lemniscate--reveal.visible {
    opacity: 1;
}

/* ============================================
   SECTION IV: CODA
   ============================================ */
.section--coda {
    min-height: 100vh;
    background-color: #F5F0E8;
    color: #2E2A26;
}

.coda__inner {
    text-align: center;
    max-width: 680px;
}

.coda__label {
    margin-bottom: 3rem;
}

.coda__domain {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #6B1D2A;
    margin-bottom: 2rem;
}

.coda__rule {
    width: 38.2%;
    height: 1px;
    background-color: #C4929A;
    margin: 0 auto 2rem;
    animation: codaPulse 6s ease-in-out infinite;
}

@keyframes codaPulse {
    0%, 100% { width: 38.2%; }
    50% { width: 61.8%; }
}

.coda__closing {
    font-family: 'Lora', Georgia, serif;
    font-style: italic;
    font-size: clamp(0.875rem, 1vw, 1rem);
    color: #A8875A;
    opacity: 0.7;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .section {
        padding: clamp(32px, 6vw, 64px);
    }

    .thesis__inner {
        padding-left: 0;
    }

    .antithesis__grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .antithesis__left {
        text-align: left;
    }

    .antithesis__left .fib-rule {
        margin-left: 0;
        transform-origin: left;
    }

    .antithesis__divider {
        display: none;
    }

    .antithesis__counter {
        padding-left: 1.5rem;
        border-left: 2px solid #7A8C72;
    }
}

@media (max-width: 480px) {
    .thesis__title {
        font-size: clamp(2rem, 10vw, 3.5rem);
    }
}
