/* ============================================
   MMIDDL.com - Pop Art on Clay
   ============================================ */

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

html {
    scroll-snap-type: y mandatory;
    overflow-y: scroll;
    scroll-behavior: smooth;
}

body {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    font-size: 18px;
    line-height: 1.75;
    color: #3D2B1F;
    background-color: #FAF0E6;
    overflow-x: hidden;
}

/* SVG filters hidden */
.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* --- Linen base texture --- */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 2px,
        rgba(196, 112, 63, 0.03) 2px,
        rgba(196, 112, 63, 0.03) 4px
    );
    pointer-events: none;
    z-index: 0;
}

/* --- Scroll Container --- */
.scroll-container {
    height: 100vh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
}

/* --- Panel Base --- */
.panel {
    position: relative;
    width: 100%;
    min-height: 100vh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* --- Grain Overlay (every panel) --- */
.grain-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    opacity: 0.1;
    mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='1' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

/* --- Panel Border Bottom --- */
.panel-border-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 8px;
    background-color: #5C3D2E;
    z-index: 10;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='8'%3E%3Cpath d='M0,4 Q50,2 100,4 Q150,6 200,4 Q250,2 300,5 Q350,6 400,3 Q450,2 500,5 Q550,7 600,4 Q650,1 700,4 Q750,6 800,3 Q850,2 900,5 Q950,7 1000,4 Q1050,2 1100,5 Q1150,6 1200,4' stroke='%235C3D2E' stroke-width='8' fill='none'/%3E%3C/svg%3E");
    background-size: 100% 100%;
}

.panel-border-light {
    background-color: #8B4513;
}

/* --- Panel Content --- */
.panel-content {
    position: relative;
    z-index: 6;
    max-width: 1100px;
    width: 100%;
    padding: 60px 40px;
}

/* --- Halftone Field (Ben-Day Dots) --- */
.halftone-field {
    position: absolute;
    pointer-events: none;
    z-index: 2;
    background-image: radial-gradient(circle, #E84545 3px, transparent 3px);
    background-size: 14px 14px;
    opacity: 0.2;
    transition: transform 0.3s ease-out;
}

.halftone-hero {
    top: 0;
    right: 0;
    width: 55%;
    height: 60%;
    opacity: 0.18;
}

.halftone-left {
    top: 10%;
    left: 0;
    width: 30%;
    height: 80%;
    opacity: 0.12;
}

/* Halftone hover pulse */
.panel:hover .halftone-field {
    transform: scale(1.12);
}

/* ============================================
   PANEL 1: HERO
   ============================================ */
.panel-hero {
    background-color: #C4703F;
    justify-content: center;
    text-align: center;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hero-title {
    font-family: 'Jost', sans-serif;
    font-weight: 700;
    font-size: clamp(72px, 12vw, 120px);
    letter-spacing: -0.02em;
    text-transform: uppercase;
    color: #FAF0E6;
    position: relative;
    display: inline-block;
    margin-bottom: 24px;
}

.hero-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 0;
    height: 6px;
    background-color: #D4A03C;
    transition: width 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.hero-title.animate-underline::after {
    width: 100%;
}

.hero-tagline-wrap {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
}

.hero-tagline {
    font-family: 'Caveat', cursive;
    font-size: 26px;
    font-weight: 400;
    color: #D4A03C;
}

/* Candle Flame Icon */
.candle-flame-icon {
    display: inline-flex;
    animation: candleFlicker 3s ease-in-out infinite;
}

@keyframes candleFlicker {
    0% { opacity: 0.75; transform: scale(1); }
    33% { opacity: 1; transform: scale(1.02); }
    66% { opacity: 0.85; transform: scale(0.98); }
    100% { opacity: 0.75; transform: scale(1); }
}

/* ============================================
   PANEL 2: CREAM SMOKE
   ============================================ */
.panel-cream {
    background-color: #F5E6D3;
}

.panel-cream-content {
    display: flex;
    justify-content: flex-end;
}

.content-block {
    background-color: rgba(250, 240, 230, 0.6);
    border: 5px solid #5C3D2E;
    padding: 48px;
    max-width: 650px;
    position: relative;
}

.content-block-offset {
    margin-right: 5%;
}

.section-headline {
    font-family: 'Jost', sans-serif;
    font-weight: 700;
    font-size: clamp(40px, 6vw, 72px);
    letter-spacing: -0.02em;
    text-transform: uppercase;
    color: #3D2B1F;
    position: relative;
    display: inline-block;
    margin-bottom: 16px;
}

.section-headline::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 5px;
    background-color: #D4A03C;
    transition: width 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.section-headline.animate-underline::after {
    width: 100%;
}

.headline-light {
    color: #FAF0E6;
}

.section-subheadline {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(20px, 3vw, 30px);
    letter-spacing: 0.06em;
    color: #5C3D2E;
    margin-bottom: 24px;
}

.subheadline-light {
    color: #F5E6D3;
}

.body-text {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    font-size: 18px;
    line-height: 1.75;
    color: #3D2B1F;
    margin-bottom: 16px;
}

.body-text-light {
    color: #FAF0E6;
}

.annotation {
    font-family: 'Caveat', cursive;
    font-size: 20px;
    font-weight: 400;
    color: #D4A03C;
    margin-top: 12px;
}

/* ============================================
   PANEL 3: DARK UMBER
   ============================================ */
.panel-dark {
    background-color: #2C1810;
}

.panel-dark-content {
    display: flex;
    justify-content: center;
}

.content-block-dark {
    background: transparent;
    border: 5px solid #8B4513;
    padding: 56px;
    max-width: 700px;
    text-align: center;
}

/* Candlelight glow effect */
.candlelight-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 600px;
    height: 600px;
    transform: translate(-50%, -50%);
    background: radial-gradient(
        ellipse at center,
        rgba(212, 160, 60, 0.15) 0%,
        rgba(196, 112, 63, 0.08) 35%,
        rgba(44, 24, 16, 0) 70%
    );
    border-radius: 50%;
    z-index: 1;
    animation: candlelightSway 10s ease-in-out infinite;
    pointer-events: none;
}

@keyframes candlelightSway {
    0% { transform: translate(-50%, -50%) translate(0, 0); opacity: 0.8; }
    25% { transform: translate(-50%, -50%) translate(15px, -10px); opacity: 1; }
    50% { transform: translate(-50%, -50%) translate(-10px, 5px); opacity: 0.85; }
    75% { transform: translate(-50%, -50%) translate(8px, 12px); opacity: 0.95; }
    100% { transform: translate(-50%, -50%) translate(0, 0); opacity: 0.8; }
}

/* ============================================
   PANEL 4: TERRACOTTA
   ============================================ */
.panel-terracotta {
    background-color: #C4703F;
}

.panel-terracotta-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.clay-slab-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(139, 69, 19, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 60%, rgba(92, 61, 46, 0.12) 0%, transparent 45%),
        radial-gradient(ellipse at 50% 80%, rgba(139, 69, 19, 0.1) 0%, transparent 40%);
    z-index: 1;
    pointer-events: none;
}

.content-block-terracotta {
    background: transparent;
    border: none;
    padding: 48px;
    max-width: 700px;
    text-align: left;
}

.flame-row {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.flame-bullet {
    display: inline-flex;
    flex-shrink: 0;
    margin-top: 4px;
    animation: candleFlicker 2.5s ease-in-out infinite;
}

.flame-row:nth-child(odd) .flame-bullet {
    animation-duration: 3.2s;
}

.flame-row:nth-child(even) .flame-bullet {
    animation-duration: 2.8s;
    animation-delay: 0.5s;
}

/* ============================================
   PANEL 5: LINEN WHITE + SPEECH BUBBLES
   ============================================ */
.panel-linen {
    background-color: #FAF0E6;
}

.panel-linen-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.speech-bubbles-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    justify-content: center;
    margin-top: 40px;
    max-width: 1000px;
}

.speech-bubble {
    position: relative;
    background-color: #F5E6D3;
    border: 4px solid #5C3D2E;
    border-radius: 24px;
    padding: 32px 36px;
    max-width: 340px;
    flex: 1 1 280px;
}

.speech-text {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    font-size: 17px;
    line-height: 1.65;
    color: #3D2B1F;
    font-style: italic;
}

.speech-tail {
    position: absolute;
    bottom: -20px;
    width: 0;
    height: 0;
}

.speech-tail-left {
    left: 30px;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 20px solid #5C3D2E;
}

.speech-tail-left::after {
    content: '';
    position: absolute;
    top: -24px;
    left: -8px;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 17px solid #F5E6D3;
}

.speech-tail-right {
    right: 30px;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 20px solid #5C3D2E;
}

.speech-tail-right::after {
    content: '';
    position: absolute;
    top: -24px;
    left: -8px;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 17px solid #F5E6D3;
}

.speech-tail-center {
    left: 50%;
    transform: translateX(-50%);
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 20px solid #5C3D2E;
}

.speech-tail-center::after {
    content: '';
    position: absolute;
    top: -24px;
    left: -8px;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 17px solid #F5E6D3;
}

/* Pop coral highlight dots on speech bubbles */
.speech-bubble::before {
    content: '';
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #E84545;
    z-index: 7;
}

/* ============================================
   PANEL 6: CLOSING
   ============================================ */
.panel-closing {
    background-color: #2C1810;
    text-align: center;
}

/* Wax Drips at top */
.wax-drips {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 8;
    animation: waxDripSway 6s ease-in-out infinite;
    transform-origin: top center;
}

.wax-drip-svg {
    width: 100%;
    height: 60px;
    display: block;
}

@keyframes waxDripSway {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(0.5deg); }
    50% { transform: rotate(0deg); }
    75% { transform: rotate(-0.5deg); }
    100% { transform: rotate(0deg); }
}

/* Closing candle glow */
.closing-candle-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 500px;
    height: 500px;
    transform: translate(-50%, -50%);
    background: radial-gradient(
        circle at center,
        rgba(212, 160, 60, 0.2) 0%,
        rgba(232, 69, 69, 0.06) 30%,
        rgba(44, 24, 16, 0) 65%
    );
    border-radius: 50%;
    z-index: 1;
    animation: closingGlowPulse 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes closingGlowPulse {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.7; }
    50% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 0.7; }
}

.closing-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.closing-headline {
    font-family: 'Jost', sans-serif;
    font-weight: 700;
    font-size: clamp(48px, 8vw, 80px);
    letter-spacing: -0.02em;
    text-transform: uppercase;
    color: #FAF0E6;
    display: flex;
    flex-wrap: wrap;
    gap: 16px 24px;
    justify-content: center;
    margin-bottom: 32px;
}

.closing-word {
    position: relative;
    display: inline-block;
}

.closing-word::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 5px;
    background-color: #D4A03C;
    transition: width 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.closing-word.animate-underline::after {
    width: 100%;
}

.closing-tagline {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 500;
    font-size: 24px;
    letter-spacing: 0.12em;
    color: #D4A03C;
    text-transform: uppercase;
}

/* ============================================
   PANEL ENTRANCE ANIMATIONS
   ============================================ */
.panel-content {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

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

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .panel-content {
        padding: 40px 24px;
    }

    .content-block {
        padding: 32px 24px;
        max-width: 100%;
    }

    .content-block-offset {
        margin-right: 0;
    }

    .content-block-dark {
        padding: 36px 24px;
    }

    .speech-bubbles-grid {
        flex-direction: column;
        align-items: center;
        gap: 32px;
    }

    .speech-bubble {
        max-width: 100%;
        flex: 1 1 auto;
    }

    .closing-headline {
        gap: 8px 16px;
    }

    .hero-tagline-wrap {
        flex-direction: column;
        gap: 12px;
    }

    .candlelight-glow,
    .closing-candle-glow {
        width: 350px;
        height: 350px;
    }

    .halftone-hero {
        width: 70%;
        height: 40%;
    }

    .halftone-left {
        width: 40%;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 56px;
    }

    .section-headline {
        font-size: 36px;
    }

    .closing-headline {
        font-size: 36px;
    }

    .content-block {
        padding: 24px 18px;
        border-width: 4px;
    }

    .speech-bubble {
        padding: 24px 20px;
    }
}
