/* ============================================
   MMIDDL.com - Memphis Design System
   ============================================ */

/* Custom Properties */
:root {
    --coral: #FF6B6B;
    --teal: #4ECDC4;
    --yellow: #FFE66D;
    --charcoal: #0D0D0D;
    --cream: #FFF8F0;
    --lavender: #E8D5F5;
    --graphite: #1A1A2E;
    --white: #FFFFFF;
    --magenta: #FF2E9F;
    --ease-bounce: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --font-display: 'Bungee', cursive;
    --font-body: 'DM Sans', sans-serif;
    --font-accent: 'Caveat', cursive;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 17px;
    line-height: 1.65;
    color: var(--graphite);
    background-color: var(--cream);
    overflow-x: hidden;
}

/* ============================================
   NAVIGATION
   ============================================ */
#main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    height: 56px;
    background-color: var(--charcoal);
}

.nav-logo {
    font-family: var(--font-display);
    font-size: 1.4rem;
    color: var(--white);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.nav-dots {
    display: flex;
    gap: 14px;
    align-items: center;
}

.nav-dot {
    display: block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    transition: transform 0.3s var(--ease-bounce), box-shadow 0.3s ease;
    cursor: pointer;
}

.nav-dot:hover {
    transform: scale(1.5);
    box-shadow: 0 0 12px currentColor;
}

.nav-dot.active {
    transform: scale(1.4);
}

/* ============================================
   SECTIONS - COMMON
   ============================================ */
.section {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    padding: 80px 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.section-heading {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 7rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 48px;
    position: relative;
    z-index: 2;
}

/* Caveat Annotations */
.caveat-note {
    font-family: var(--font-accent);
    font-weight: 700;
    font-size: 24px;
    position: absolute;
    transform: rotate(-2deg);
    z-index: 5;
}

/* Geometric Shapes - Common */
.geo-shape {
    position: absolute;
    z-index: 1;
    pointer-events: none;
}

/* Float Animation */
.float-shape {
    animation: shapeFloat 5s ease-in-out infinite;
}

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

/* ============================================
   BOUNCE-IN ANIMATIONS
   ============================================ */

/* Standard bounce-in (sections 2-5) */
.bounce-in {
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 0.6s ease, transform 0.8s var(--ease-bounce);
}

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

/* Hero bounce from edges */
.bounce-edge {
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.9s var(--ease-bounce);
}

.bounce-from-left {
    transform: translateX(-200px) translateY(0);
}

.bounce-from-right {
    transform: translateX(200px) translateY(0);
}

.bounce-from-top {
    transform: translateY(-200px) translateX(0);
}

.bounce-from-bottom {
    transform: translateY(200px) translateX(0);
}

.bounce-edge.visible {
    opacity: 1;
    transform: translateX(0) translateY(0);
}

/* Text Reveal Animation */
.text-reveal {
    clip-path: inset(0 100% 0 0);
    transition: clip-path 0.6s ease;
}

.text-reveal.visible {
    clip-path: inset(0 0% 0 0);
}

/* ============================================
   SECTION 1: HERO
   ============================================ */
.section-hero {
    background-color: var(--cream);
    padding-top: 100px;
    position: relative;
}

/* Confetti dots background */
.section-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle, var(--coral) 2px, transparent 2px),
        radial-gradient(circle, var(--teal) 2px, transparent 2px),
        radial-gradient(circle, var(--yellow) 2px, transparent 2px),
        radial-gradient(circle, var(--magenta) 1.5px, transparent 1.5px);
    background-size:
        120px 100px,
        100px 130px,
        140px 90px,
        80px 110px;
    background-position:
        10px 10px,
        50px 60px,
        30px 30px,
        70px 80px;
    opacity: 0.25;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    max-width: 1100px;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(4rem, 10vw, 12rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--graphite);
    line-height: 1.05;
}

.hero-note {
    bottom: 80px;
    right: 10%;
    color: var(--magenta);
    font-size: 28px;
}

/* Hero shape positions */
.shape-circle-coral {
    top: 12%;
    left: 5%;
}

.shape-circle-coral.visible {
    animation: shapeFloat 5s ease-in-out infinite;
}

.shape-triangle-teal {
    top: 15%;
    right: 8%;
}

.shape-triangle-teal.visible {
    animation: shapeFloat 4.5s ease-in-out 0.5s infinite;
}

.shape-circle-yellow {
    bottom: 18%;
    left: 10%;
}

.shape-circle-yellow.visible {
    animation: shapeFloat 6s ease-in-out 1s infinite;
}

.shape-triangle-coral {
    bottom: 25%;
    right: 15%;
}

.shape-triangle-coral.visible {
    animation: shapeFloat 4s ease-in-out 0.3s infinite;
}

.shape-zigzag-top {
    top: 30%;
    left: -20px;
}

.shape-zigzag-top.visible {
    animation: shapeFloat 5.5s ease-in-out 0.7s infinite;
}

.shape-circle-magenta {
    top: 60%;
    right: 5%;
}

.shape-circle-magenta.visible {
    animation: shapeFloat 4.8s ease-in-out 1.2s infinite;
}

.shape-squiggle-hero {
    bottom: 12%;
    right: 25%;
}

.shape-squiggle-hero.visible {
    animation: shapeFloat 5.2s ease-in-out 0.9s infinite;
}

.shape-triangle-yellow {
    top: 40%;
    left: 15%;
}

.shape-triangle-yellow.visible {
    animation: shapeFloat 4.6s ease-in-out 0.4s infinite;
}

/* Confetti container (JS populated) */
.confetti-container {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    opacity: 0;
    animation: confettiBurst 0.8s ease-out forwards;
}

@keyframes confettiBurst {
    0% {
        opacity: 1;
        transform: translate(0, 0) rotate(0deg) scale(0.5);
    }
    60% {
        opacity: 1;
    }
    100% {
        opacity: 0.7;
        transform: var(--confetti-end) rotate(var(--confetti-rotate)) scale(1);
    }
}

/* ============================================
   PATTERN STRIP DIVIDERS
   ============================================ */
.pattern-strip {
    height: 48px;
    width: 100%;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.checkerboard-strip {
    background-image:
        repeating-conic-gradient(var(--coral) 0% 25%, var(--yellow) 0% 50%);
    background-size: 32px 32px;
}

.dotgrid-strip {
    background-color: var(--cream);
    background-image: radial-gradient(circle, var(--teal) 4px, transparent 4px);
    background-size: 24px 24px;
}

.diagonal-strip {
    background: repeating-linear-gradient(
        45deg,
        var(--graphite) 0px,
        var(--graphite) 12px,
        var(--lavender) 12px,
        var(--lavender) 24px
    );
}

/* ============================================
   SECTION 2: PHILOSOPHY
   ============================================ */
.section-philosophy {
    background-color: var(--teal);
    padding-top: 100px;
}

.section-philosophy .section-heading {
    color: var(--white);
}

.phil-circle-1 {
    top: 8%;
    right: 12%;
    animation-delay: 0.3s;
}

.phil-triangle-1 {
    bottom: 12%;
    left: 5%;
    animation-delay: 0.8s;
}

.phil-squiggle {
    top: 50%;
    left: 2%;
    animation-delay: 1.1s;
}

.philosophy-cards {
    display: flex;
    gap: 40px;
    max-width: 1100px;
    width: 100%;
    position: relative;
    z-index: 2;
    flex-wrap: wrap;
    justify-content: center;
}

.card {
    flex: 1;
    min-width: 280px;
    max-width: 340px;
    background-color: var(--cream);
    border: 3px solid var(--graphite);
    padding: 32px;
    position: relative;
    transition: transform 0.4s var(--ease-bounce), box-shadow 0.4s var(--ease-bounce);
    box-shadow: 8px 8px 0 var(--graphite);
}

.card:hover {
    box-shadow: 12px 16px 0 var(--graphite);
}

.card-1 { transform: rotate(-3deg) translateY(60px); opacity: 0; }
.card-2 { transform: rotate(2deg) translateY(60px); opacity: 0; }
.card-3 { transform: rotate(-1deg) translateY(60px); opacity: 0; }

.card-1.visible { transform: rotate(-3deg) translateY(0); opacity: 1; }
.card-2.visible { transform: rotate(2deg) translateY(0); opacity: 1; }
.card-3.visible { transform: rotate(-1deg) translateY(0); opacity: 1; }

.card-1:hover { transform: rotate(-3deg) scale(1.04) translateY(-12px); }
.card-2:hover { transform: rotate(2deg) scale(1.04) translateY(-12px); }
.card-3:hover { transform: rotate(-1deg) scale(1.04) translateY(-12px); }

.card-inner {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.card-icon {
    width: 64px;
    height: 64px;
}

.card h3 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    letter-spacing: 0.05em;
    color: var(--graphite);
}

.card p {
    color: var(--graphite);
    font-size: 15px;
    line-height: 1.6;
}

.philosophy-note {
    bottom: 40px;
    left: 8%;
    color: var(--yellow);
    font-size: 26px;
}

/* ============================================
   SECTION 3: THE METHOD (Terrazzo Background)
   ============================================ */
.section-method {
    background-color: var(--lavender);
    padding-top: 100px;
}

/* Terrazzo texture overlay */
.terrazzo-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(ellipse 8px 6px at 15% 25%, rgba(255, 107, 107, 0.2) 50%, transparent 50%),
        radial-gradient(ellipse 5px 10px at 35% 65%, rgba(78, 205, 196, 0.2) 50%, transparent 50%),
        radial-gradient(circle 4px at 55% 15%, rgba(255, 230, 109, 0.2) 50%, transparent 50%),
        radial-gradient(ellipse 10px 5px at 75% 45%, rgba(255, 46, 159, 0.15) 50%, transparent 50%),
        radial-gradient(circle 6px at 25% 80%, rgba(232, 213, 245, 0.25) 50%, transparent 50%),
        radial-gradient(ellipse 7px 4px at 85% 75%, rgba(255, 107, 107, 0.15) 50%, transparent 50%),
        radial-gradient(circle 3px at 45% 40%, rgba(78, 205, 196, 0.2) 50%, transparent 50%),
        radial-gradient(ellipse 6px 9px at 65% 90%, rgba(255, 230, 109, 0.2) 50%, transparent 50%),
        radial-gradient(circle 5px at 10% 55%, rgba(255, 46, 159, 0.15) 50%, transparent 50%),
        radial-gradient(ellipse 9px 5px at 90% 20%, rgba(78, 205, 196, 0.15) 50%, transparent 50%),
        radial-gradient(circle 4px at 50% 70%, rgba(255, 107, 107, 0.18) 50%, transparent 50%),
        radial-gradient(ellipse 6px 8px at 70% 30%, rgba(232, 213, 245, 0.2) 50%, transparent 50%);
    background-size:
        200px 180px,
        180px 200px,
        150px 160px,
        220px 190px,
        170px 210px,
        190px 170px,
        160px 180px,
        210px 200px,
        180px 190px,
        200px 160px,
        190px 210px,
        170px 180px;
    pointer-events: none;
    z-index: 0;
}

/* Terrazzo alt for proof section */
.terrazzo-bg-alt::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(ellipse 6px 8px at 20% 30%, rgba(26, 26, 46, 0.08) 50%, transparent 50%),
        radial-gradient(ellipse 9px 5px at 40% 70%, rgba(255, 107, 107, 0.12) 50%, transparent 50%),
        radial-gradient(circle 5px at 60% 20%, rgba(78, 205, 196, 0.12) 50%, transparent 50%),
        radial-gradient(ellipse 7px 6px at 80% 50%, rgba(232, 213, 245, 0.15) 50%, transparent 50%),
        radial-gradient(circle 4px at 30% 85%, rgba(255, 46, 159, 0.1) 50%, transparent 50%),
        radial-gradient(ellipse 8px 4px at 70% 60%, rgba(26, 26, 46, 0.06) 50%, transparent 50%),
        radial-gradient(circle 3px at 50% 45%, rgba(78, 205, 196, 0.1) 50%, transparent 50%),
        radial-gradient(ellipse 5px 7px at 15% 65%, rgba(255, 107, 107, 0.1) 50%, transparent 50%),
        radial-gradient(circle 6px at 85% 85%, rgba(232, 213, 245, 0.12) 50%, transparent 50%),
        radial-gradient(ellipse 4px 6px at 45% 15%, rgba(255, 46, 159, 0.08) 50%, transparent 50%);
    background-size:
        190px 170px,
        210px 200px,
        170px 190px,
        180px 210px,
        200px 180px,
        160px 200px,
        220px 170px,
        190px 190px,
        180px 200px,
        200px 180px;
    pointer-events: none;
    z-index: 0;
}

.section-method .section-heading {
    color: var(--graphite);
}

.method-squiggle {
    top: 15%;
    right: 5%;
    animation-delay: 0.5s;
}

.method-circle {
    bottom: 10%;
    left: 3%;
    animation-delay: 0.2s;
}

.method-triangle {
    top: 55%;
    right: 2%;
    animation-delay: 0.9s;
}

.method-layout {
    display: grid;
    grid-template-columns: 1fr 1.2fr 1fr;
    gap: 40px;
    max-width: 1100px;
    width: 100%;
    position: relative;
    z-index: 2;
    align-items: center;
}

.method-text-left,
.method-text-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.method-text-left p,
.method-text-right p {
    color: var(--graphite);
    font-size: 16px;
}

.zigzag-inline {
    display: block;
    margin: 8px 0;
}

.method-illustration {
    display: flex;
    justify-content: center;
    align-items: center;
}

.memphis-shelf {
    width: 100%;
    max-width: 300px;
    height: auto;
}

.method-note {
    bottom: 40px;
    right: 10%;
    color: var(--coral);
    font-size: 24px;
}

/* ============================================
   SECTION 4: THE PROOF
   ============================================ */
.section-proof {
    background-color: var(--yellow);
    padding-top: 100px;
}

.section-proof .section-heading {
    color: var(--graphite);
}

.proof-triangle {
    top: 10%;
    left: 6%;
    animation-delay: 0.4s;
}

.proof-circle {
    bottom: 8%;
    right: 4%;
    animation-delay: 0.7s;
}

.proof-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    max-width: 900px;
    width: 100%;
    position: relative;
    z-index: 2;
}

.proof-thumb {
    position: relative;
    border: 3px solid var(--graphite);
    box-shadow: 8px 8px 0 var(--graphite);
    cursor: pointer;
    transition: transform 0.4s var(--ease-bounce), box-shadow 0.4s var(--ease-bounce);
    overflow: hidden;
}

.proof-thumb:hover {
    transform: translateY(-12px);
    box-shadow: 12px 16px 0 var(--graphite);
}

.proof-thumb svg {
    display: block;
    width: 100%;
    height: auto;
}

.thumb-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--charcoal);
    color: var(--white);
    font-family: var(--font-display);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-align: center;
    padding: 8px 0;
}

.proof-note {
    bottom: 40px;
    right: 8%;
    color: var(--graphite);
    font-size: 24px;
}

/* ============================================
   SECTION 5: THE CALL
   ============================================ */
.section-call {
    background-color: var(--charcoal);
    text-align: center;
}

.call-pulse-circle {
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background-color: var(--coral);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: pulse 3s ease-in-out infinite;
    z-index: 1;
}

@keyframes pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
    50% { transform: translate(-50%, -50%) scale(1.15); opacity: 0.9; }
}

.call-heading {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 7rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--white);
    position: relative;
    z-index: 2;
    max-width: 900px;
}

.call-subtext {
    color: var(--teal);
    font-size: 18px;
    margin-top: 24px;
    position: relative;
    z-index: 2;
    max-width: 600px;
    font-weight: 400;
}

.call-note {
    bottom: 60px;
    right: 12%;
    color: var(--yellow);
    font-size: 28px;
}

/* ============================================
   FOOTER
   ============================================ */
#footer {
    background-color: var(--charcoal);
    border-top: 3px solid var(--graphite);
    padding: 24px 48px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-logo {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--white);
    letter-spacing: 0.08em;
}

.footer-year {
    font-family: var(--font-body);
    font-size: 14px;
    color: #666;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
    .section {
        padding: 60px 24px;
    }

    .philosophy-cards {
        flex-direction: column;
        align-items: center;
    }

    .card {
        max-width: 100%;
    }

    .card-1, .card-2, .card-3 {
        transform: translateY(60px);
        opacity: 0;
    }
    .card-1.visible, .card-2.visible, .card-3.visible {
        transform: translateY(0);
        opacity: 1;
    }
    .card-1:hover, .card-2:hover, .card-3:hover {
        transform: scale(1.02) translateY(-8px);
    }

    .method-layout {
        grid-template-columns: 1fr;
    }

    .method-illustration {
        order: -1;
    }

    .proof-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-title {
        font-size: clamp(2.5rem, 8vw, 6rem);
    }

    /* Reduce edge bounce distance on mobile */
    .bounce-from-left { transform: translateX(-100px); }
    .bounce-from-right { transform: translateX(100px); }
    .bounce-from-top { transform: translateY(-100px); }
    .bounce-from-bottom { transform: translateY(100px); }
}

@media (max-width: 600px) {
    .proof-grid {
        grid-template-columns: 1fr;
        max-width: 320px;
    }

    .nav-dots {
        gap: 10px;
    }

    .nav-dot {
        width: 10px;
        height: 10px;
    }

    #main-nav {
        padding: 0 16px;
    }

    .caveat-note {
        position: relative;
        display: block;
        text-align: center;
        bottom: auto;
        right: auto;
        left: auto;
        margin-top: 32px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .bounce-in {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .bounce-edge {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .card-1, .card-2, .card-3 {
        opacity: 1;
    }

    .text-reveal {
        clip-path: none;
        transition: none;
    }

    .float-shape {
        animation: none;
    }

    .call-pulse-circle {
        animation: none;
        opacity: 0.7;
    }

    .confetti-piece {
        animation: none;
        display: none;
    }

    .pattern-strip {
        animation: none;
    }

    .shape-circle-coral.visible,
    .shape-triangle-teal.visible,
    .shape-circle-yellow.visible,
    .shape-triangle-coral.visible,
    .shape-zigzag-top.visible,
    .shape-circle-magenta.visible,
    .shape-squiggle-hero.visible,
    .shape-triangle-yellow.visible {
        animation: none;
    }
}
