/* lovebot.quest Styles */

:root {
    --color-cream-primary: #F5F0E8;
    --color-deep-sage: #3D4F3D;
    --color-warm-charcoal: #3A3530;
    --color-pale-parchment: #EDE8DF;
    --color-weathered-gold: #C4A882;
    --color-faded-sage: #6B7B6E;
    --color-dusty-rose: #C49A8A;
    --color-soft-umber: #7A6B5A;
    --color-pressed-flower-pink: #D4A0A0;
    --color-brown-grey: #8A7B6A;

    --font-display: 'Playfair Display', serif;
    --font-body: 'Source Serif 4', serif;
    --font-mono: 'DM Mono', monospace;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--color-cream-primary);
    color: var(--color-warm-charcoal);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.75;
    font-weight: 400;
    letter-spacing: 0.01em;
}

main.scroll-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100vh;
}

/* Sections & Chapters */
.chapter {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(2rem, 8vw, 4rem);
    position: relative;
    overflow: hidden;
}

.chapter-content {
    max-width: 800px;
    width: 100%;
    text-align: center;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 2;
}

.chapter-content p {
    margin-bottom: 1.5rem;
    letter-spacing: 0.3px;
}

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

/* Opening Section */
.chapter.opening {
    background: linear-gradient(135deg, var(--color-cream-primary) 0%, var(--color-pale-parchment) 100%);
}

.domain-title {
    font-family: var(--font-display);
    font-size: clamp(2.8rem, 7vw, 5.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--color-warm-charcoal);
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.epigraph {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    color: var(--color-soft-umber);
    letter-spacing: 0.05em;
    text-transform: lowercase;
    margin-top: 2rem;
}

/* Chapter Headings */
.chapter-heading {
    font-family: var(--font-display);
    font-size: clamp(2.8rem, 7vw, 5.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--color-warm-charcoal);
    margin-bottom: 2.5rem;
    line-height: 1.1;
    text-align: center;
}

/* Illustrations */
.illustration-frame {
    width: 100%;
    max-width: 500px;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 3rem;
    animation: float 4s ease-in-out infinite;
}

.illustration-frame.staggered {
    animation: float 5s ease-in-out infinite;
    animation-delay: 0.5s;
}

.intro-illustration,
.chapter-illustration,
.closing-illustration {
    width: 100%;
    height: 100%;
    max-width: 400px;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
        opacity: 0.95;
    }
    50% {
        transform: translateY(-20px);
        opacity: 1;
    }
}

/* Stagger pattern for layout */
.chapter {
    /* Gentle wobble from center */
    margin-left: clamp(-40px, -5vw, -20px);
    margin-right: clamp(-40px, -5vw, -20px);
}

.chapter:nth-child(even) {
    margin-left: clamp(-40px, 3vw, 20px);
    margin-right: clamp(-40px, -3vw, -20px);
}

.chapter:nth-child(3n) {
    margin-left: clamp(-40px, -2vw, -10px);
    margin-right: clamp(-40px, 2vw, 10px);
}

/* Chapter-specific backgrounds */
.chapter-1 {
    background-color: var(--color-cream-primary);
}

.chapter-2 {
    background-color: var(--color-pale-parchment);
}

.chapter-3 {
    background-color: var(--color-cream-primary);
}

.chapter-4 {
    background-color: var(--color-pale-parchment);
}

.chapter-5 {
    background-color: var(--color-cream-primary);
}

.chapter-6 {
    background-color: var(--color-pale-parchment);
}

.chapter-7 {
    background-color: var(--color-cream-primary);
}

/* Closing section styling */
.chapter.closing {
    background: linear-gradient(180deg, var(--color-cream-primary) 0%, var(--color-pale-parchment) 100%);
}

.closing-epigraph {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1.1rem, 2.5vw, 1.6rem);
    color: var(--color-soft-umber);
    letter-spacing: 0.05em;
    margin-top: 2rem;
}

/* Colophon */
.chapter.colophon {
    background-color: var(--color-deep-sage);
    color: var(--color-pale-parchment);
    min-height: 40vh;
}

.colophon-text {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 400;
    font-size: 1.1rem;
    letter-spacing: 0.05em;
    text-transform: lowercase;
    color: var(--color-pale-parchment);
    margin-bottom: 1rem;
}

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

/* Typography adjustments */
em {
    font-family: var(--font-body);
    font-style: italic;
    font-weight: 400;
    color: var(--color-soft-umber);
}

strong {
    font-weight: 600;
    color: var(--color-warm-charcoal);
}

/* Responsive design */
@media (max-width: 768px) {
    .chapter {
        padding: clamp(1.5rem, 4vw, 2.5rem);
        min-height: auto;
        padding-top: 20vh;
        padding-bottom: 20vh;
    }

    .chapter-content {
        max-width: 100%;
        padding: 1rem;
    }

    .illustration-frame {
        max-width: 300px;
        margin-top: 2rem;
    }

    .domain-title {
        font-size: clamp(2rem, 6vw, 3.5rem);
    }

    .chapter-heading {
        font-size: clamp(1.8rem, 5vw, 3rem);
    }

    .epigraph,
    .closing-epigraph {
        font-size: clamp(1rem, 2.5vw, 1.4rem);
    }

    body {
        font-size: 1rem;
        line-height: 1.6;
    }
}

@media (max-width: 480px) {
    .chapter {
        padding: 1rem;
        padding-top: 15vh;
        padding-bottom: 15vh;
    }

    .chapter-content {
        padding: 0.5rem;
    }

    .domain-title {
        font-size: clamp(1.5rem, 5vw, 2.5rem);
        margin-bottom: 1rem;
    }

    .chapter-heading {
        font-size: clamp(1.4rem, 4vw, 2rem);
        margin-bottom: 1.5rem;
    }

    .illustration-frame {
        max-width: 250px;
        margin-top: 1.5rem;
    }

    body {
        font-size: 0.95rem;
        line-height: 1.5;
    }

    .chapter-content p {
        margin-bottom: 1rem;
    }
}

/* Smooth transitions and animations */
section {
    transition: opacity 0.3s ease;
}

/* SVG line animations */
svg line,
svg path {
    transition: stroke 0.3s ease, fill 0.3s ease;
}

/* Scroll-triggered fade-in for sections (fallback for JavaScript) */
.chapter {
    opacity: 0.8;
    transition: opacity 0.6s ease-out;
}

.chapter.in-view {
    opacity: 1;
}
