/* GGIGGL.com - Pop Art Laughter Celebration */
/* Palette: #FF6B9D, #FFE156, #4ECDC4, #FF6F61, #2C2C54, #FFF8E8, #A8E6CF */
/* Zero gradients. Flat colors only. Pop-art halftone. Broken grid. */

:root {
    --pink: #FF6B9D;
    --yellow: #FFE156;
    --blue: #4ECDC4;
    --coral: #FF6F61;
    --ink: #2C2C54;
    --cream: #FFF8E8;
    --mint: #A8E6CF;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--cream);
    color: var(--ink);
    font-family: 'Nunito', sans-serif;
    overflow-x: hidden;
}

/* ========================================
   FLOATING PILL NAV
   ======================================== */
.pill-nav {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    border: 3px solid var(--ink);
    border-radius: 50px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(255, 248, 232, 0.6);
}

.nav-item {
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--ink);
    text-decoration: none;
    padding: 0.4rem 1rem;
    border-radius: 30px;
    transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.nav-item:hover {
    background: var(--pink);
    color: var(--cream);
    transform: rotate(-3deg);
}

/* ========================================
   AMBIENT SOUND EFFECT TEXT LAYER
   ======================================== */
.ambient-text-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.ambient-text {
    position: absolute;
    font-family: 'Bangers', cursive;
    font-size: clamp(120px, 15vw, 200px);
    color: var(--ink);
    opacity: 0.04;
    transform: rotate(var(--rot, 0deg));
    user-select: none;
    line-height: 1;
}

/* ========================================
   GENERAL SECTION STYLES
   ======================================== */
.section {
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6rem 2rem;
    overflow: hidden;
    z-index: 2;
}

/* ========================================
   HALFTONE OVERLAYS & STRIPS
   ======================================== */
.halftone-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle, var(--ink) 1px, transparent 1px);
    background-size: 12px 12px;
    opacity: 0.04;
    pointer-events: none;
    z-index: 0;
}

.halftone-overlay.pink {
    background-image: radial-gradient(circle, var(--pink) 1.5px, transparent 1.5px);
    background-size: 10px 10px;
    opacity: 0.08;
}

.halftone-strip-separator {
    width: 100%;
    height: 60px;
    background-image: radial-gradient(circle, var(--dot-color) 3px, transparent 3px);
    background-size: 16px 16px;
    opacity: 0.2;
    position: relative;
    z-index: 2;
    animation: halftoneShift 4s ease-in-out infinite;
}

@keyframes halftoneShift {
    0%, 100% { opacity: 0.15; }
    50% { opacity: 0.3; }
}

/* ========================================
   SECTION TITLES - per-character color
   ======================================== */
.section-title {
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    letter-spacing: 0.03em;
    margin-bottom: 3rem;
    text-align: center;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    position: relative;
    z-index: 3;
}

.section-title span {
    display: inline-block;
}

/* ========================================
   HERO SECTION - The Spark
   ======================================== */
.hero-section {
    background-color: var(--cream);
}

.hero-letters {
    display: flex;
    align-items: baseline;
    gap: 0.3rem;
    flex-wrap: wrap;
    justify-content: center;
    position: relative;
    z-index: 3;
}

.bounce-letter {
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    font-size: clamp(5rem, 16vw, 14rem);
    color: var(--color);
    display: inline-block;
    transform: translateY(120vh) rotate(var(--rot, 0deg));
    opacity: 0;
    animation: bounceIn 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation-delay: var(--delay, 0s);
    text-shadow: 4px 4px 0 var(--ink);
    letter-spacing: 0.03em;
}

.bounce-dot {
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    font-size: clamp(5rem, 16vw, 14rem);
    color: var(--color);
    display: inline-block;
    transform: translateY(120vh);
    opacity: 0;
    animation: bounceInDot 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation-delay: var(--delay, 1.2s);
    text-shadow: 4px 4px 0 var(--ink);
}

@keyframes bounceIn {
    0% {
        transform: translateY(120vh) rotate(var(--rot, 0deg));
        opacity: 0;
    }
    60% {
        opacity: 1;
    }
    100% {
        transform: translateY(0) rotate(var(--rot, 0deg));
        opacity: 1;
    }
}

@keyframes bounceInDot {
    0% {
        transform: translateY(120vh);
        opacity: 0;
    }
    50% {
        transform: translateY(-40px);
        opacity: 1;
    }
    70% {
        transform: translateY(-15px);
    }
    85% {
        transform: translateY(-5px);
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Wobble Lines */
.wobble-line {
    width: 80%;
    max-width: 900px;
    height: 60px;
    position: relative;
    z-index: 3;
}

.hero-wobble {
    margin-top: 2rem;
    opacity: 0;
    animation: fadeInWobble 0.8s ease forwards;
    animation-delay: 1.8s;
}

.hero-wobble path {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    animation: drawLine 1.5s ease forwards;
    animation-delay: 1.8s;
}

@keyframes drawLine {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes fadeInWobble {
    to {
        opacity: 1;
    }
}

.section-wobble {
    margin-top: 3rem;
}

.section-wobble path,
.erratic-wobble path {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
}

.section-wobble.draw path,
.erratic-wobble.draw path {
    animation: drawLine 1.5s ease forwards;
}

.erratic-wobble {
    margin-top: 3rem;
    height: 80px;
}

/* Hero confetti container */
.confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 5;
}

.confetti-piece {
    position: absolute;
    top: -20px;
    animation: confettiFall var(--duration, 3s) ease-in forwards;
    animation-delay: var(--fall-delay, 0s);
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* ========================================
   BROKEN GRID & COMIC CARDS
   ======================================== */
.broken-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2.5rem;
    max-width: 1100px;
    width: 100%;
    position: relative;
    z-index: 3;
}

.comic-card {
    width: clamp(260px, 40%, 450px);
    transform: rotate(var(--card-tilt, 0deg));
    position: relative;
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.comic-card.card-from-left {
    transform: translateX(-80px) rotate(var(--card-tilt, 0deg));
}

.comic-card.card-from-right {
    transform: translateX(80px) rotate(var(--card-tilt, 0deg));
}

.comic-card.visible {
    opacity: 1;
    transform: translateX(0) rotate(var(--card-tilt, 0deg));
}

/* Speech Bubbles */
.speech-bubble {
    background: var(--cream);
    border: 3px solid var(--ink);
    border-radius: 24px;
    padding: 2rem 1.8rem;
    position: relative;
    box-shadow: 4px 4px 0 var(--shadow-color, var(--pink));
}

.bubble-tail {
    position: absolute;
    bottom: -18px;
    left: 30px;
    width: 0;
    height: 0;
    border-left: 16px solid transparent;
    border-right: 16px solid transparent;
    border-top: 18px solid var(--ink);
    transform: rotate(var(--tail-angle, 0deg));
}

.card-title {
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 0.6rem;
    letter-spacing: 0.03em;
}

.card-body {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--ink);
}

/* Sound Effect Bursts */
.sound-burst {
    font-family: 'Bangers', cursive;
    font-size: 2.2rem;
    color: var(--shadow-color, var(--coral));
    text-transform: uppercase;
    position: absolute;
    bottom: -8px;
    right: 15px;
    transform: rotate(calc(var(--card-tilt, 0deg) * -2));
    text-shadow: 2px 2px 0 var(--ink);
    opacity: 0.85;
    animation: burstPulse 2s ease-in-out infinite;
}

@keyframes burstPulse {
    0%, 100% { transform: rotate(calc(var(--card-tilt, 0deg) * -2)) scale(1); }
    50% { transform: rotate(calc(var(--card-tilt, 0deg) * -2)) scale(1.05); }
}

/* Giant Background Text */
.giant-bg-text {
    position: absolute;
    font-family: 'Bangers', cursive;
    font-size: clamp(200px, 30vw, 400px);
    color: var(--coral);
    opacity: 0;
    z-index: 1;
    pointer-events: none;
    right: -5%;
    top: 50%;
    transform: translateY(-50%) rotate(0deg);
    transition: opacity 1s ease;
    line-height: 1;
}

.giant-bg-text.visible {
    opacity: 0.06;
    animation: slowRotate 60s linear infinite;
}

.giant-lol {
    color: var(--pink);
    left: -5%;
    right: auto;
}

@keyframes slowRotate {
    from { transform: translateY(-50%) rotate(0deg); }
    to { transform: translateY(-50%) rotate(360deg); }
}

/* ========================================
   BUILD SECTION (Joy Facts)
   ======================================== */
.build-section {
    background-color: var(--cream);
}

.facts-grid {
    gap: 2rem;
}

.wiggle-card {
    background: var(--accent, var(--mint));
    border: 3px solid var(--ink);
    border-radius: 20px;
    padding: 2rem 1.5rem;
    min-width: 200px;
    max-width: 280px;
    text-align: center;
    transform: rotate(var(--card-tilt, 0deg));
    box-shadow: 4px 4px 0 var(--shadow-color, var(--ink));
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.wiggle-card.card-from-left {
    transform: translateX(-60px) rotate(var(--card-tilt, 0deg));
}

.wiggle-card.card-from-right {
    transform: translateX(60px) rotate(var(--card-tilt, 0deg));
}

.wiggle-card.visible {
    opacity: 1;
    transform: translateX(0) rotate(var(--card-tilt, 0deg));
    animation: wiggle 3s ease-in-out infinite;
    animation-delay: var(--wiggle-delay, 0s);
}

@keyframes wiggle {
    0%, 100% { transform: rotate(var(--card-tilt, 0deg)); }
    25% { transform: rotate(calc(var(--card-tilt, 0deg) + 2deg)); }
    75% { transform: rotate(calc(var(--card-tilt, 0deg) - 2deg)); }
}

.wiggle-number {
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    font-size: 3.5rem;
    color: var(--ink);
    display: block;
    line-height: 1.1;
}

.wiggle-label {
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--ink);
    opacity: 0.85;
    display: block;
    margin-top: 0.5rem;
}

/* ========================================
   CRESCENDO SECTION
   ======================================== */
.crescendo-section {
    background-color: var(--cream);
}

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

.crescendo-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 3rem;
    max-width: 1200px;
    width: 100%;
    position: relative;
    z-index: 3;
}

.crescendo-card {
    width: clamp(300px, 45%, 500px);
    transform: rotate(var(--card-tilt, 0deg));
    position: relative;
    opacity: 0;
    transition: opacity 0.7s ease, transform 0.9s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.crescendo-card.card-from-left {
    transform: translateX(-100px) rotate(var(--card-tilt, 0deg));
}

.crescendo-card.card-from-right {
    transform: translateX(100px) rotate(var(--card-tilt, 0deg));
}

.crescendo-card.visible {
    opacity: 1;
    transform: translateX(0) rotate(var(--card-tilt, 0deg));
}

.large-bubble {
    padding: 2.5rem 2rem;
}

.large-bubble .card-title {
    font-size: 1.8rem;
}

.large-bubble .card-body {
    font-size: 1.05rem;
    line-height: 1.8;
}

/* ========================================
   PUNCHLINE SECTION (Final)
   ======================================== */
.punchline-section {
    background-color: var(--yellow);
    min-height: 100vh;
    position: relative;
}

.punchline-halftone-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle, var(--pink) 2px, transparent 2px);
    background-size: 14px 14px;
    opacity: 0.12;
    pointer-events: none;
    z-index: 0;
    animation: halftoneColorShift 8s ease-in-out infinite;
}

@keyframes halftoneColorShift {
    0%, 100% { opacity: 0.12; }
    25% { opacity: 0.18; }
    50% { opacity: 0.08; }
    75% { opacity: 0.2; }
}

.punchline-bubble {
    position: relative;
    z-index: 3;
    max-width: 800px;
    width: 90%;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.punchline-bubble.visible {
    opacity: 1;
    transform: scale(1);
    animation: bubbleWobble 4s ease-in-out infinite;
}

@keyframes bubbleWobble {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.01) rotate(0.5deg); }
    50% { transform: scale(0.99) rotate(-0.5deg); }
    75% { transform: scale(1.01) rotate(0.3deg); }
}

.punchline-bubble-inner {
    background: var(--cream);
    border: 4px solid var(--ink);
    border-radius: 40px;
    padding: 4rem 3rem;
    text-align: center;
    position: relative;
    box-shadow: 6px 6px 0 var(--pink);
}

.punchline-tail {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 25px solid transparent;
    border-right: 25px solid transparent;
    border-top: 25px solid var(--ink);
}

.punchline-text {
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 3.5rem);
    letter-spacing: 0.03em;
    line-height: 1.3;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.3em;
}

.punchline-text span {
    display: inline-block;
}

.punchline-sub {
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--ink);
    margin-top: 1.5rem;
    opacity: 0.7;
}

/* LOL Sticker */
.lol-sticker {
    position: absolute;
    bottom: 40px;
    right: 40px;
    z-index: 10;
    transform: rotate(12deg);
    opacity: 0;
    transition: opacity 0.6s ease;
}

.lol-sticker.visible {
    opacity: 1;
}

.sticker-text {
    font-family: 'Bangers', cursive;
    font-size: 3.5rem;
    color: var(--ink);
    background: var(--cream);
    border: 3px solid var(--ink);
    border-radius: 12px;
    padding: 0.5rem 1.2rem;
    display: block;
    box-shadow: 3px 3px 0 var(--coral);
    position: relative;
}

.sticker-peel {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 24px;
    height: 24px;
    background: var(--cream);
    border-left: 2px solid var(--ink);
    border-top: 2px solid var(--ink);
    clip-path: polygon(100% 0, 100% 100%, 0 100%);
    transform: rotate(0deg);
    box-shadow: -2px -2px 4px rgba(44, 44, 84, 0.15);
    animation: peelUp 3s ease forwards;
    animation-delay: 1s;
    animation-play-state: paused;
}

.lol-sticker.visible .sticker-peel {
    animation-play-state: running;
}

@keyframes peelUp {
    0% {
        clip-path: polygon(100% 0, 100% 100%, 0 100%);
        width: 24px;
        height: 24px;
    }
    100% {
        clip-path: polygon(100% 0, 100% 100%, 0 100%);
        width: 40px;
        height: 40px;
    }
}

/* ========================================
   STAR BURST BEHIND CTA / EMPHASIS
   ======================================== */
.star-burst {
    position: absolute;
    width: 120px;
    height: 120px;
    background: var(--yellow);
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    z-index: 0;
    animation: burstPulse 2s ease-in-out infinite;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .pill-nav {
        top: 10px;
        padding: 0.3rem 0.5rem;
        gap: 0;
    }

    .nav-item {
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
    }

    .broken-grid,
    .crescendo-grid {
        flex-direction: column;
        align-items: center;
    }

    .comic-card,
    .crescendo-card {
        width: 90%;
        max-width: 400px;
    }

    .facts-grid {
        flex-direction: column;
        align-items: center;
    }

    .wiggle-card {
        min-width: 80%;
        max-width: 320px;
    }

    .ambient-text {
        font-size: 100px;
    }

    .punchline-bubble-inner {
        padding: 2.5rem 1.5rem;
    }

    .lol-sticker {
        bottom: 20px;
        right: 20px;
    }

    .sticker-text {
        font-size: 2.5rem;
    }

    .giant-bg-text {
        font-size: 150px;
    }
}

@media (max-width: 480px) {
    .hero-letters {
        gap: 0.1rem;
    }

    .bounce-letter,
    .bounce-dot {
        font-size: clamp(3.5rem, 14vw, 6rem);
    }

    .section {
        padding: 4rem 1rem;
    }
}
