/* =========================================
   gabs.cx – Styles
   Dopamine-saturated candy universe
   ========================================= */

/* --- CSS Custom Properties --- */
:root {
    /* Rainbow Palette */
    --strawberry-pop: #FF6B8A;
    --strawberry-cream: #FFE0E8;
    --tangerine-fizz: #FF9F43;
    --peach-sorbet: #FFF0DB;
    --lemon-drop: #FECA57;
    --butter-cream: #FFF8E1;
    --melon-mint: #5CD68A;
    --mint-foam: #E0F8E9;
    --blueberry-soda: #54A0FF;
    --sky-cotton: #E0EEFF;
    --grape-bubblegum: #9B59B6;
    --lavender-mist: #F0E6F6;
    --bubblegum-pop: #FF78B4;
    --rose-foam: #FFE8F1;

    /* Neutrals */
    --cloud-white: #F8F6FF;
    --marshmallow: #FFFFFF;
    --deep-grape: #3D2066;
    --soft-plum: #7B6B8A;

    /* Shadows (grape-tinted, never black) */
    --shadow-card: 0 8px 32px rgba(155, 89, 182, 0.15), 0 2px 8px rgba(155, 89, 182, 0.08);
    --shadow-card-hover: 0 16px 48px rgba(155, 89, 182, 0.25), 0 4px 12px rgba(155, 89, 182, 0.12);
    --shadow-nav: 0 8px 32px rgba(155, 89, 182, 0.2);

    /* Typography */
    --font-display: 'Nunito', sans-serif;
    --font-body: 'Quicksand', sans-serif;
    --font-accent: 'Baloo 2', cursive;
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.7;
    color: var(--deep-grape);
    background-color: var(--cloud-white);
    overflow-x: hidden;
    /* Background bubble field texture */
    background-image:
        radial-gradient(circle 3px at 10% 15%, rgba(255, 107, 138, 0.05) 50%, transparent 50%),
        radial-gradient(circle 2px at 30% 40%, rgba(84, 160, 255, 0.05) 50%, transparent 50%),
        radial-gradient(circle 3px at 55% 20%, rgba(254, 202, 87, 0.05) 50%, transparent 50%),
        radial-gradient(circle 2px at 75% 60%, rgba(92, 214, 138, 0.05) 50%, transparent 50%),
        radial-gradient(circle 3px at 90% 30%, rgba(155, 89, 182, 0.05) 50%, transparent 50%),
        radial-gradient(circle 2px at 20% 70%, rgba(255, 120, 180, 0.05) 50%, transparent 50%),
        radial-gradient(circle 3px at 45% 85%, rgba(255, 159, 67, 0.05) 50%, transparent 50%),
        radial-gradient(circle 2px at 65% 45%, rgba(255, 107, 138, 0.05) 50%, transparent 50%),
        radial-gradient(circle 3px at 85% 80%, rgba(84, 160, 255, 0.05) 50%, transparent 50%),
        radial-gradient(circle 2px at 5% 90%, rgba(254, 202, 87, 0.05) 50%, transparent 50%);
}

/* --- Hero Section --- */
.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: var(--cloud-white);
}

/* --- Bubble Field --- */
.bubble-field {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.hero-bubble {
    position: absolute;
    width: var(--size);
    height: var(--size);
    left: var(--x);
    top: var(--y);
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, transparent 40%, var(--color) 100%);
    opacity: 0.15;
    border: 2px solid rgba(255, 255, 255, 0.3);
    animation: bubbleFloat var(--dur) ease-in-out infinite;
    animation-delay: var(--delay);
    will-change: transform, opacity;
}

@keyframes bubbleFloat {
    0%, 100% {
        transform: translateY(0) translateX(0) scale(1);
    }
    25% {
        transform: translateY(-20px) translateX(8px) scale(1.03);
    }
    50% {
        transform: translateY(-35px) translateX(-5px) scale(0.97);
    }
    75% {
        transform: translateY(-15px) translateX(10px) scale(1.02);
    }
}

/* Hero bubble acceleration on scroll */
.hero.scrolling-away .hero-bubble {
    animation: bubbleAccelerate 1.5s ease-in forwards;
}

@keyframes bubbleAccelerate {
    0% {
        transform: translateY(0);
        opacity: 0.15;
    }
    100% {
        transform: translateY(-150vh);
        opacity: 0;
    }
}

/* --- Hero Content --- */
.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 0 24px;
}

.hero-wordmark {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(4rem, 12vw, 9rem);
    letter-spacing: 0.02em;
    line-height: 1.1;
    background: linear-gradient(90deg, #FF6B8A, #FF9F43, #FECA57, #5CD68A, #54A0FF, #9B59B6, #FF78B4);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    margin-bottom: 16px;
}

.hero-tagline {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    color: var(--soft-plum);
    max-width: 500px;
    margin: 0 auto;
}

/* --- Wavy Divider --- */
.wavy-divider {
    width: 100%;
    margin-top: -2px;
    line-height: 0;
}

.wavy-divider svg {
    width: 100%;
    height: 60px;
    display: block;
}

/* --- Card Grid Container --- */
.card-grid-container {
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
    padding: 48px 48px 120px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}

/* --- Cards --- */
.card {
    position: relative;
    border-radius: 28px;
    box-shadow: var(--shadow-card);
    overflow: hidden;
    opacity: 0;
    transform: translateY(60px) scale(0.9);
    transition: transform 250ms cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 250ms ease;
    will-change: transform, opacity;
    background: var(--marshmallow);
}

.card.card-visible {
    animation: bounceIn 600ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes bounceIn {
    0% {
        transform: translateY(60px) scale(0.9);
        opacity: 0;
    }
    50% {
        transform: translateY(-12px) scale(1.02);
        opacity: 1;
    }
    70% {
        transform: translateY(4px) scale(0.99);
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Card sizing */
.card-span-2 {
    grid-column: span 2;
}

.card-featured {
    min-height: 420px;
    display: flex;
    flex-direction: row;
    align-items: stretch;
}

.card-micro {
    min-height: 180px;
}

/* Card inner content */
.card-inner {
    position: relative;
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    z-index: 1;
}

.card-light-text {
    color: #FFFFFF;
}

.card-light-text .card-body {
    color: rgba(255, 255, 255, 0.9);
}

.card-light-text .card-tag {
    color: rgba(255, 255, 255, 0.8);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Card tag */
.card-tag {
    font-family: var(--font-accent);
    font-weight: 600;
    font-size: clamp(0.85rem, 1vw, 1rem);
    letter-spacing: 0.04em;
    color: var(--soft-plum);
    border: 2px solid currentColor;
    border-radius: 999px;
    padding: 4px 14px;
    display: inline-block;
    margin-bottom: 12px;
    width: fit-content;
}

/* Card title */
.card-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    letter-spacing: 0.02em;
    line-height: 1.3;
    margin-bottom: 12px;
}

/* Card body */
.card-body {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.7;
    color: var(--soft-plum);
}

/* Card stat */
.card-stat {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(3rem, 5vw, 4rem);
    color: var(--tangerine-fizz);
    line-height: 1;
    margin-bottom: 8px;
}

/* --- Card Hover Effects --- */
.card:hover {
    transform: translateY(-6px) scale(1.015);
    box-shadow: var(--shadow-card-hover);
}

.card:active {
    transform: translateY(2px) scale(0.98);
}

/* --- Hover Bubbles --- */
.card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 0;
    pointer-events: none;
}

.card .hover-bubble {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    will-change: transform, opacity;
}

.card:hover .hover-bubble {
    animation: hoverBubbleRise 1.2s ease-out forwards;
}

@keyframes hoverBubbleRise {
    0% {
        transform: translateY(0);
        opacity: 0.6;
    }
    100% {
        transform: translateY(-80px);
        opacity: 0;
    }
}

/* --- Card Corner Bubble Clusters --- */
.card-bubble-cluster {
    position: absolute;
    top: 0;
    left: 0;
    width: 80px;
    height: 60px;
    z-index: 0;
    pointer-events: none;
}

.card-bubble-cluster-right {
    left: auto;
    right: 0;
}

.card-bubble {
    position: absolute;
    width: var(--s);
    height: var(--s);
    top: var(--t);
    left: var(--l);
    border-radius: 50%;
    background: currentColor;
    opacity: 0.2;
}

.card-bubble-light {
    background: rgba(255, 255, 255, 0.3);
    opacity: 1;
}

/* --- Card Illustrations --- */
.card-illustration {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    flex-shrink: 0;
}

.card-featured .card-illustration {
    width: 40%;
    max-width: 240px;
    padding: 24px;
}

.card:not(.card-featured) .card-illustration {
    padding: 8px 32px 24px;
}

.illustration {
    width: 100%;
    max-width: 160px;
    height: auto;
}

.card-featured .illustration {
    max-width: 200px;
}

/* --- Floating Annotations --- */
.floating-annotation {
    font-family: var(--font-accent);
    font-weight: 600;
    font-size: clamp(0.9rem, 1.1vw, 1.1rem);
    color: var(--strawberry-pop);
    display: inline-block;
    transform: rotate(var(--rot, -4deg));
    margin-top: 12px;
    letter-spacing: 0.04em;
}

/* --- Confetti Dots --- */
.confetti-dots {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.confetti-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color);
    left: var(--x);
    top: var(--y);
    opacity: 0.4;
}

/* --- Floating Nav Bar --- */
.floating-nav {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 999px;
    box-shadow: var(--shadow-nav);
    z-index: 1000;
    animation: navBob 3s ease-in-out infinite;
    transition: transform 400ms ease, opacity 400ms ease;
}

.floating-nav.nav-hidden {
    transform: translateX(-50%) translateY(120px);
    opacity: 0;
    pointer-events: none;
}

@keyframes navBob {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(-6px);
    }
}

.floating-nav.nav-hidden {
    animation: none;
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    color: var(--soft-plum);
    transition: color 250ms ease, background 250ms ease;
}

.nav-item:hover {
    background: rgba(155, 89, 182, 0.08);
    color: var(--grape-bubblegum);
}

.nav-item.active {
    color: var(--deep-grape);
}

.nav-icon {
    width: 24px;
    height: 24px;
}

.nav-dot {
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%) scale(0);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    transition: transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-item.active .nav-dot {
    transform: translateX(-50%) scale(1);
}

/* --- Responsive --- */

/* 4 columns at 1200px+ handled by auto-fill minmax */

/* 3 columns */
@media (max-width: 1200px) {
    .card-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 2 columns */
@media (max-width: 900px) {
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .card-grid-container {
        padding: 32px 24px 120px;
    }
}

/* 1 column */
@media (max-width: 600px) {
    .card-grid {
        grid-template-columns: 1fr;
    }

    .card-span-2 {
        grid-column: span 1;
    }

    .card-featured {
        min-height: auto;
        flex-direction: column;
    }

    .card-featured .card-illustration {
        width: 100%;
        max-width: none;
        padding: 0 32px 24px;
    }

    .card-grid-container {
        padding: 24px 16px 120px;
    }

    .hero-wordmark {
        font-size: clamp(3rem, 15vw, 5rem);
    }

    .floating-nav {
        bottom: 16px;
        padding: 10px 16px;
        gap: 4px;
    }

    .nav-item {
        width: 42px;
        height: 42px;
    }
}

/* --- Selection Style --- */
::selection {
    background: rgba(255, 120, 180, 0.3);
    color: var(--deep-grape);
}

/* --- Scrollbar Styling --- */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--cloud-white);
}

::-webkit-scrollbar-thumb {
    background: var(--lavender-mist);
    border-radius: 999px;
    border: 2px solid var(--cloud-white);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--grape-bubblegum);
}
