/* ========================================
   monopole.quest — styles.css
   Creamy Pastel + Graffiti Warmth
   ======================================== */

/* --- CSS Custom Properties --- */
:root {
    --bg-primary: #faf6f0;
    --bg-secondary: #f5ede3;
    --bg-tertiary: #f0e0d0;
    --bg-dark: #f0e8dc;
    --text-primary: #3d3229;
    --text-secondary: #5a4e42;
    --accent-gold: #c9a96e;
    --accent-terracotta: #b87a56;
    --accent-rose: #d4917e;
    --accent-sage: #8fa889;
    --accent-lavender: #b8a9c9;
    --shadow-base: rgba(61, 50, 41, 0.06);
    --border-color: #e8ddd0;
    --parchment: #d4c5b0;
}

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

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

body {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.1vw, 1.15rem);
    letter-spacing: 0.01em;
    line-height: 1.72;
    color: var(--text-secondary);
    background-color: var(--bg-primary);
    overflow-x: hidden;
    /* Marble texture via layered gradients */
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(180, 170, 155, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(170, 160, 145, 0.025) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 80%, rgba(185, 175, 160, 0.03) 0%, transparent 45%),
        conic-gradient(from 45deg at 30% 40%, rgba(175, 165, 150, 0.02) 0%, transparent 15%, rgba(175, 165, 150, 0.015) 30%, transparent 45%),
        conic-gradient(from 200deg at 70% 60%, rgba(180, 170, 155, 0.02) 0%, transparent 20%, rgba(180, 170, 155, 0.015) 40%, transparent 55%);
}

/* --- Typography --- */
h1, h2 {
    font-family: 'Playfair Display', serif;
    color: var(--text-primary);
    letter-spacing: -0.025em;
    line-height: 1.1;
    text-shadow: 2px 2px 0 rgba(201, 169, 110, 0.15);
}

h1 {
    font-weight: 700;
    font-size: clamp(2.6rem, 6vw, 5.2rem);
}

h2 {
    font-weight: 700;
    font-size: clamp(1.5rem, 3.5vw, 2.8rem);
    margin-bottom: 1.2rem;
}

.caveat-text {
    font-family: 'Caveat', cursive;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.2vw, 1.3rem);
}

.annotation {
    color: var(--accent-gold);
    margin-top: 1.5rem;
    font-size: clamp(1.1rem, 1.4vw, 1.4rem);
}

/* --- Flow Spine SVG --- */
.flow-spine {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
}

/* --- Field Lines SVG --- */
.field-lines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1;
}

.field-lines path {
    transition: stroke-dashoffset 0.1s linear;
}

/* --- Equation Fragments --- */
.equation-fragment {
    position: fixed;
    font-family: 'Caveat', cursive;
    font-size: 1.4rem;
    color: var(--text-secondary);
    opacity: 0.08;
    pointer-events: none;
    z-index: 1;
    transition: opacity 1.5s ease;
}

.eq-1 { top: 18vh; left: 12vw; transform: rotate(-2deg); }
.eq-2 { top: 42vh; right: 8vw; transform: rotate(1.5deg); }
.eq-3 { top: 68vh; left: 25vw; transform: rotate(-1deg); }
.eq-4 { top: 33vh; left: 65vw; transform: rotate(2.5deg); }
.eq-5 { top: 78vh; right: 18vw; transform: rotate(-1.5deg); }

.equation-fragment.highlight {
    opacity: 0.2;
}

/* --- Bubbles --- */
.bubbles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    animation: float 12s ease-in-out infinite alternate;
}

.bubble-rose {
    background: rgba(212, 145, 126, 0.12);
    border: 1px solid rgba(212, 145, 126, 0.2);
}

.bubble-lavender {
    background: rgba(184, 169, 201, 0.1);
    border: 1px solid rgba(184, 169, 201, 0.18);
}

.bubble-sage {
    background: rgba(143, 168, 137, 0.1);
    border: 1px solid rgba(143, 168, 137, 0.18);
}

@keyframes float {
    0% { transform: translateY(0) translateX(0); }
    33% { transform: translateY(-20px) translateX(8px); }
    66% { transform: translateY(-10px) translateX(-5px); }
    100% { transform: translateY(-30px) translateX(12px); }
}

/* --- Moments (Sections) --- */
.moment {
    position: relative;
    z-index: 2;
    min-height: 80vh;
    padding: clamp(2rem, 5vw, 4rem);
}

/* --- Moment 1: Hero --- */
.moment-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
}

.monopole-point {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, #c9a96e 0%, rgba(201, 169, 110, 0) 70%);
    margin-bottom: 3rem;
    animation: monopole-pulse 5s ease-in-out infinite;
}

@keyframes monopole-pulse {
    0%, 100% { box-shadow: 0 0 40px 10px rgba(201, 169, 110, 0.15); }
    50% { box-shadow: 0 0 80px 20px rgba(201, 169, 110, 0.05); }
}

.hero-title {
    opacity: 0;
    margin-bottom: 1.5rem;
}

.hero-title.visible {
    opacity: 1;
}

.hero-title .letter {
    display: inline-block;
    opacity: 0;
    animation: letterFadeIn 0.4s ease forwards;
}

.hero-subtitle {
    color: var(--accent-gold);
    font-size: clamp(1.1rem, 1.5vw, 1.5rem);
    opacity: 0;
    transition: opacity 1.5s ease 1.5s;
    font-style: italic;
}

.hero-subtitle.visible {
    opacity: 1;
}

@keyframes letterFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Content Pods --- */
.content-pod {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 40px;
    padding: clamp(2rem, 5vw, 4rem);
    box-shadow: 0 8px 40px rgba(139, 115, 85, 0.08);
    max-width: 640px;
    position: relative;
}

.content-pod p {
    margin-bottom: 1rem;
    max-width: 32ch;
}

.content-pod p:last-child {
    margin-bottom: 0;
}

.pod-left {
    margin-left: 8vw;
    margin-right: auto;
}

.pod-right {
    margin-right: 8vw;
    margin-left: auto;
}

.pod-wide {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.pod-wide p {
    max-width: 52ch;
}

/* --- Moment 2: Prediction --- */
.moment-prediction {
    padding-top: 15vh;
    padding-bottom: 10vh;
}

/* --- Moment 3: Symmetry --- */
.moment-symmetry {
    padding-top: 15vh;
    padding-bottom: 10vh;
}

.equation-display {
    position: relative;
    margin: 2.5rem 0;
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.equation-main {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.5rem, 5vw, 4rem);
    color: var(--text-primary);
    position: relative;
    display: inline-block;
}

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

.equation-corrected {
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    color: var(--accent-terracotta);
}

/* --- Moment 4: Searches --- */
.moment-searches {
    padding-top: 15vh;
    padding-bottom: 10vh;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.pod-search {
    border-radius: 30px;
}

.pod-search-1 {
    background: var(--bg-secondary);
    margin-left: 10vw;
    margin-right: auto;
    z-index: 3;
}

.pod-search-2 {
    background: var(--bg-tertiary);
    margin-left: 15vw;
    margin-right: auto;
    margin-top: -20px;
    z-index: 2;
}

.pod-search-3 {
    background: var(--bg-secondary);
    margin-left: 8vw;
    margin-right: auto;
    margin-top: -20px;
    z-index: 1;
    border-color: #e5d8c8;
}

/* --- Moment 5: The Almost --- */
.moment-almost {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 10vh 5vw;
}

.almost-text {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1.6rem, 3vw, 2.6rem);
    line-height: 1.4;
    color: var(--text-primary);
    max-width: 700px;
    text-align: center;
}

.almost-word {
    display: inline-block;
    opacity: 0.3;
    transition: opacity 0.6s ease;
    margin-right: 0.3em;
}

.almost-word.active {
    opacity: 1;
}

.almost-word.pause {
    margin-left: 0.5em;
}

/* --- Moment 6: Quest Continues --- */
.moment-quest {
    padding-top: 15vh;
    padding-bottom: 10vh;
    display: flex;
    flex-direction: column;
    gap: 8vh;
    align-items: stretch;
}

.graffiti-mark {
    width: 80px;
    height: 80px;
    align-self: center;
    opacity: 0;
}

.graffiti-mark-2 {
    width: 160px;
    height: 20px;
}

/* --- Moment 7: Invitation --- */
.moment-invitation {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-color: var(--bg-dark);
    padding: 10vh 5vw;
    gap: 2rem;
}

.invitation-heading {
    font-size: clamp(2rem, 5vw, 4rem);
    color: var(--text-primary);
}

.invitation-text {
    max-width: 600px;
    margin-bottom: 3rem;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
}

.invitation-circle {
    position: relative;
    width: 300px;
    height: 300px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.invitation-field-lines {
    width: 100%;
    height: 100%;
}

.invitation-hint {
    position: absolute;
    bottom: -2rem;
    color: var(--accent-gold);
    font-size: 1.2rem;
    opacity: 0.6;
}

/* --- Scroll Indicator --- */
.scroll-indicator {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 2px solid var(--accent-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: breathe 4s ease-in-out infinite;
    color: var(--accent-gold);
    font-size: 1.2rem;
    cursor: pointer;
    transition: opacity 0.5s ease;
}

.scroll-indicator.hidden {
    opacity: 0;
    pointer-events: none;
}

@keyframes breathe {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(201, 169, 110, 0.2); }
    50% { transform: scale(1.05); box-shadow: 0 0 20px 5px rgba(201, 169, 110, 0.1); }
}

/* --- Zoom-Focus Animation --- */
.zoom-focus {
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 600ms cubic-bezier(0.22, 1, 0.36, 1), transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
}

.zoom-focus.in-view {
    opacity: 1;
    transform: scale(1) !important;
}

/* Preserve rotation for pods that have inline rotate */
.content-pod.zoom-focus.in-view {
    transform: scale(1) rotate(var(--rot, 0deg)) !important;
}

/* --- Mobile Responsive --- */
@media (max-width: 768px) {
    .content-pod {
        max-width: 90vw;
        border-radius: 24px;
        padding: clamp(1.5rem, 4vw, 2.5rem);
    }

    .pod-left {
        margin-left: 5vw;
    }

    .pod-right {
        margin-right: 5vw;
        margin-left: 5vw;
    }

    .pod-wide {
        max-width: 90vw;
    }

    .content-pod p {
        max-width: 100%;
    }

    .pod-wide p {
        max-width: 100%;
    }

    .pod-search-1,
    .pod-search-2,
    .pod-search-3 {
        margin-left: 5vw;
    }

    .content-pod.zoom-focus,
    .content-pod.zoom-focus.in-view {
        transform: scale(1) rotate(0deg) !important;
    }

    .equation-fragment {
        display: none;
    }

    .graffiti-mark {
        width: 50px;
        height: 50px;
    }

    .invitation-circle {
        width: 200px;
        height: 200px;
    }

    .moment {
        padding: clamp(1.5rem, 4vw, 3rem);
    }

    .moment-quest {
        gap: 4vh;
    }

    .flow-spine {
        display: none;
    }
}
