/* ============================================================
   QUIRK.BAR - WATERCOLOR AESTHETIC STYLES
   ============================================================ */

:root {
    /* Color Palette */
    --color-slate: #8899A6;
    --color-sage: #7A9A7E;
    --color-rust: #8B4D32;
    --color-brown: #6B5A4E;
    --color-blush: #E8B9A0;
    --color-cream: #FAF5EE;
    --color-terracotta: #C07850;
    --color-sand: #D4956A;
    --color-ink-primary: #2E2420;
    --color-ink-secondary: #6B5A4E;

    /* Typography */
    --font-display: 'Playfair Display', serif;
    --font-body: 'Lora', serif;
    --font-ui: 'Inter', sans-serif;
    --font-handwritten: 'Caveat', cursive;
}

/* ============================================================
   GLOBAL STYLES
   ============================================================ */

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

html, body {
    width: 100%;
    height: 100%;
    font-family: var(--font-body);
    background-color: var(--color-cream);
    color: var(--color-brown);
    line-height: 1.8;
    overflow-x: hidden;
}

/* Subtle paper texture via noise */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="4" result="noise" seed="2"/></filter><rect width="100" height="100" fill="%23FAF5EE" filter="url(%23noise)" opacity="0.03"/></svg>');
    pointer-events: none;
    z-index: 1;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */

h1 {
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 6vw, 4.5rem);
    font-weight: 700;
    letter-spacing: 0.02em;
    font-style: italic;
    color: var(--color-ink-primary);
    line-height: 1.2;
}

h2 {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 600;
    letter-spacing: 0.015em;
    color: var(--color-rust);
    margin-bottom: 1.5rem;
    font-style: italic;
}

p {
    font-family: var(--font-body);
    font-size: clamp(1rem, 2vw, 1.25rem);
    line-height: 1.9;
    margin-bottom: 1.5rem;
}

.essay-text {
    color: var(--color-brown);
    font-weight: 400;
    max-width: 45rem;
}

/* ============================================================
   OPENING WASH SECTION
   ============================================================ */

.opening-wash {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Base watercolor gradient background */
.opening-wash .watercolor-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg,
        rgba(250, 245, 238, 1) 0%,
        rgba(232, 185, 160, 0.6) 25%,
        rgba(136, 153, 166, 0.5) 50%,
        rgba(107, 90, 78, 0.4) 100%);
    z-index: 1;
}

/* Watercolor bloom effects */
.opening-wash .watercolor-bloom-1 {
    position: absolute;
    top: -10%;
    right: -5%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle at 30% 40%,
        rgba(232, 185, 160, 0.8),
        rgba(192, 120, 80, 0.4) 50%,
        transparent 70%);
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    filter: blur(60px);
    z-index: 2;
    opacity: 0.7;
}

.opening-wash .watercolor-bloom-2 {
    position: absolute;
    bottom: -15%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle at 50% 50%,
        rgba(122, 154, 126, 0.6),
        rgba(136, 89, 86, 0.3) 40%,
        transparent 70%);
    border-radius: 60% 40% 50% 50% / 50% 60% 30% 40%;
    filter: blur(80px);
    z-index: 2;
    opacity: 0.6;
}

.opening-content {
    position: relative;
    z-index: 3;
    text-align: center;
    padding: 2rem;
}

.opening-title {
    color: var(--color-ink-primary);
    margin-bottom: 1rem;
    text-shadow: 1px 1px 2px rgba(250, 245, 238, 0.5);
    animation: pulseAttention 4s ease-in-out infinite;
}

.opening-tagline {
    font-family: var(--font-body);
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    color: var(--color-rust);
    font-style: italic;
    font-weight: 500;
    letter-spacing: 0.05em;
}

/* ============================================================
   WAVE DIVIDERS
   ============================================================ */

.wave-divider {
    width: 100%;
    height: 100px;
    display: block;
    margin: 0;
    padding: 0;
    z-index: 5;
}

.wave-divider path {
    filter: drop-shadow(2px 2px 4px rgba(107, 90, 78, 0.1));
}

/* ============================================================
   CONTENT POOLS
   ============================================================ */

.content-pool {
    position: relative;
    width: 100vw;
    min-height: 80vh;
    padding: 8vh 5vw;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.pool-watercolor-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* Pool 1: Sage and terracotta tones */
.pool-bg-1 {
    background: linear-gradient(110deg,
        rgba(250, 245, 238, 1) 0%,
        rgba(232, 185, 160, 0.5) 40%,
        rgba(212, 149, 106, 0.4) 100%);
}

.pool-bg-1::before {
    content: '';
    position: absolute;
    top: -30%;
    left: 10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle at 40% 40%,
        rgba(232, 185, 160, 0.6),
        rgba(122, 154, 126, 0.3) 50%,
        transparent 70%);
    border-radius: 45% 55% 60% 40% / 55% 45% 55% 45%;
    filter: blur(70px);
    z-index: 1;
}

/* Pool 2: Slate and rust accents */
.pool-bg-2 {
    background: linear-gradient(70deg,
        rgba(250, 245, 238, 1) 0%,
        rgba(136, 153, 166, 0.4) 30%,
        rgba(212, 149, 106, 0.3) 100%);
}

.pool-bg-2::before {
    content: '';
    position: absolute;
    bottom: -20%;
    right: 5%;
    width: 55vw;
    height: 55vw;
    background: radial-gradient(circle at 50% 50%,
        rgba(136, 153, 166, 0.5),
        rgba(139, 77, 50, 0.2) 50%,
        transparent 70%);
    border-radius: 50% 50% 40% 60% / 60% 40% 60% 40%;
    filter: blur(80px);
    z-index: 1;
}

/* Pool 3: Brown and blush */
.pool-bg-3 {
    background: linear-gradient(130deg,
        rgba(250, 245, 238, 1) 0%,
        rgba(232, 185, 160, 0.5) 50%,
        rgba(122, 154, 126, 0.3) 100%);
}

.pool-bg-3::before {
    content: '';
    position: absolute;
    top: 10%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle at 30% 50%,
        rgba(192, 120, 80, 0.5),
        rgba(107, 90, 78, 0.2) 50%,
        transparent 70%);
    border-radius: 40% 60% 50% 50% / 50% 50% 50% 50%;
    filter: blur(75px);
    z-index: 1;
}

/* Pool 4: Rust and sage blend */
.pool-bg-4 {
    background: linear-gradient(100deg,
        rgba(250, 245, 238, 1) 0%,
        rgba(212, 149, 106, 0.5) 35%,
        rgba(139, 77, 50, 0.4) 100%);
}

.pool-bg-4::before {
    content: '';
    position: absolute;
    bottom: -25%;
    left: 5%;
    width: 55vw;
    height: 55vw;
    background: radial-gradient(circle at 50% 40%,
        rgba(139, 77, 50, 0.6),
        rgba(122, 154, 126, 0.2) 50%,
        transparent 70%);
    border-radius: 50% 50% 50% 50% / 40% 60% 40% 60%;
    filter: blur(80px);
    z-index: 1;
}

.pool-content {
    position: relative;
    z-index: 3;
    max-width: 55rem;
    margin: 0 auto;
    padding: 3rem;
    background: rgba(250, 245, 238, 0.7);
    border-radius: 5px;
    box-shadow: 0 10px 40px rgba(107, 90, 78, 0.1);
}

.pool-alternate {
    flex-direction: row-reverse;
}

/* ============================================================
   IMAGERY: 3D-PAINTED WATERCOLOR SPHERES
   ============================================================ */

.imagery-sphere {
    position: absolute;
    border-radius: 50%;
    filter: blur(1px);
    opacity: 0.8;
}

.sphere-1 {
    width: 200px;
    height: 200px;
    top: 15%;
    right: 8%;
    background: radial-gradient(circle at 35% 35%,
        rgba(232, 185, 160, 0.9),
        rgba(212, 149, 106, 0.7) 40%,
        rgba(139, 77, 50, 0.5) 70%,
        rgba(107, 90, 78, 0.3) 100%);
    box-shadow: inset -15px -15px 30px rgba(107, 90, 78, 0.3),
                inset 10px 10px 20px rgba(250, 245, 238, 0.5);
    animation: floatSphere 6s ease-in-out infinite;
}

.sphere-2 {
    width: 150px;
    height: 150px;
    bottom: 20%;
    left: 10%;
    background: radial-gradient(circle at 40% 35%,
        rgba(136, 153, 166, 0.8),
        rgba(122, 154, 126, 0.6) 40%,
        rgba(107, 90, 78, 0.4) 70%,
        rgba(139, 77, 50, 0.2) 100%);
    box-shadow: inset -12px -12px 25px rgba(107, 90, 78, 0.25),
                inset 8px 8px 15px rgba(250, 245, 238, 0.4);
    animation: floatSphere 7s ease-in-out infinite 0.5s;
}

.sphere-3 {
    width: 180px;
    height: 180px;
    top: 25%;
    left: 5%;
    background: radial-gradient(circle at 38% 38%,
        rgba(192, 120, 80, 0.85),
        rgba(232, 185, 160, 0.6) 40%,
        rgba(139, 77, 50, 0.5) 70%,
        rgba(107, 90, 78, 0.3) 100%);
    box-shadow: inset -14px -14px 28px rgba(107, 90, 78, 0.3),
                inset 9px 9px 18px rgba(250, 245, 238, 0.45);
    animation: floatSphere 8s ease-in-out infinite 1s;
}

.sphere-4 {
    width: 160px;
    height: 160px;
    top: 30%;
    right: 7%;
    background: radial-gradient(circle at 36% 36%,
        rgba(212, 149, 106, 0.8),
        rgba(192, 120, 80, 0.6) 40%,
        rgba(139, 77, 50, 0.5) 70%,
        rgba(107, 90, 78, 0.35) 100%);
    box-shadow: inset -13px -13px 26px rgba(107, 90, 78, 0.28),
                inset 8px 8px 16px rgba(250, 245, 238, 0.42);
    animation: floatSphere 6.5s ease-in-out infinite 0.3s;
}

@keyframes floatSphere {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-30px);
    }
}

/* ============================================================
   CLOSING SECTION
   ============================================================ */

.closing-section {
    position: relative;
    width: 100vw;
    min-height: 90vh;
    padding: 8vh 5vw;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.closing-watercolor-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(100deg,
        rgba(250, 245, 238, 1) 0%,
        rgba(232, 185, 160, 0.4) 30%,
        rgba(122, 154, 126, 0.3) 65%,
        rgba(107, 90, 78, 0.3) 100%);
    z-index: 0;
}

.closing-watercolor-bg::before {
    content: '';
    position: absolute;
    top: -20%;
    left: -15%;
    width: 70vw;
    height: 70vw;
    background: radial-gradient(circle at 50% 50%,
        rgba(232, 185, 160, 0.5),
        rgba(139, 77, 50, 0.2) 50%,
        transparent 80%);
    border-radius: 50% 50% 40% 60% / 60% 40% 60% 40%;
    filter: blur(100px);
    z-index: 1;
}

.closing-watercolor-bg::after {
    content: '';
    position: absolute;
    bottom: -30%;
    right: -10%;
    width: 65vw;
    height: 65vw;
    background: radial-gradient(circle at 50% 50%,
        rgba(136, 153, 166, 0.4),
        rgba(122, 154, 126, 0.15) 50%,
        transparent 75%);
    border-radius: 45% 55% 50% 50% / 50% 50% 50% 50%;
    filter: blur(90px);
    z-index: 1;
}

.closing-content {
    position: relative;
    z-index: 3;
    max-width: 60rem;
    margin: 0 auto;
    padding: 4rem;
    background: rgba(250, 245, 238, 0.75);
    border-radius: 8px;
    box-shadow: 0 15px 50px rgba(107, 90, 78, 0.15);
    text-align: center;
}

.closing-text {
    font-size: clamp(1rem, 2.2vw, 1.3rem);
    color: var(--color-brown);
    margin-bottom: 2rem;
    line-height: 2;
}

.closing-coda {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(139, 77, 50, 0.2);
}

.closing-coda p {
    font-size: clamp(0.9rem, 1.8vw, 1.1rem);
    color: var(--color-rust);
    font-style: italic;
    letter-spacing: 0.05em;
}

/* ============================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================ */

@media (max-width: 768px) {
    .pool-content {
        padding: 2rem;
        margin: 0 2rem;
    }

    .imagery-sphere {
        display: none;
    }

    .closing-content {
        padding: 2rem;
    }

    .opening-wash .watercolor-bloom-1,
    .opening-wash .watercolor-bloom-2 {
        filter: blur(40px);
    }

    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 1.8rem;
    }
}

/* ============================================================
   SCROLL ANIMATIONS & TRANSITIONS
   ============================================================ */

section {
    opacity: 1;
    animation: fadeInUp 1s ease-out;
}

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

/* Subtle hover effects on text for engagement */
.essay-text {
    transition: color 0.3s ease, transform 0.3s ease;
}

.essay-text:hover {
    color: var(--color-rust);
    transform: translateX(5px);
}

/* Marginalia styles for handwritten annotations */
.marginalia {
    font-family: var(--font-handwritten);
    font-size: 14px;
    color: var(--color-ink-primary);
    font-style: italic;
    letter-spacing: 0.02em;
}

/* Ink primary color accent for depth */
.ink-accent {
    color: var(--color-ink-primary);
}

/* Pulse-attention animation pattern */
@keyframes pulseAttention {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.04);
    }
}

.pulse-attention {
    animation: pulseAttention 3s ease-in-out infinite;
}
