/* ============================================
   gabs.wiki - Dopamine-Maximalist Toy Encyclopedia
   Colors: #FF3B6F #FF8C42 #FFD23F #3DDC84 #42A5F5 #9C5BF5 #FF6B9D #FEFCF8 #FFFFFF #2D2D3A #8E8E9A
   Fonts: Nunito 800, Nunito Sans 400/600/700, Baloo 2 800
   ============================================ */

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

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

body {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    color: #2D2D3A;
    background-color: #FEFCF8;
    background-image:
        radial-gradient(circle, rgba(0,0,0,0.03) 1px, transparent 1px),
        linear-gradient(180deg,
            hsl(calc(50 + var(--scroll-hue, 0)), 80%, 97%) 0%,
            hsl(calc(140 + var(--scroll-hue, 0)), 70%, 97%) 33%,
            hsl(calc(220 + var(--scroll-hue, 0)), 70%, 97%) 66%,
            hsl(calc(300 + var(--scroll-hue, 0)), 70%, 97%) 100%
        );
    background-size: 24px 24px, 100% 100%;
    background-attachment: fixed, fixed;
    line-height: 1.72;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    overflow-x: hidden;
    min-height: 100vh;
}

/* ---- Floating Navigation Pill ---- */
.nav-pill {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1000;
    width: 56px;
    height: 56px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 2px solid rgba(45, 45, 58, 0.08);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-pill:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.nav-pill.active {
    background: #2D2D3A;
    transform: scale(1.1) rotate(90deg);
}

.nav-pill-icon {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 22px;
}

.nav-pill-bar {
    display: block;
    height: 3px;
    border-radius: 3px;
    background: #2D2D3A;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-pill.active .nav-pill-bar {
    background: #FFFFFF;
}

.nav-pill.active .nav-pill-bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.nav-pill.active .nav-pill-bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.nav-pill.active .nav-pill-bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* ---- Overlay Navigation Menu ---- */
.nav-overlay {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(45, 45, 58, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.nav-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 20px;
    text-align: center;
}

.nav-link {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: clamp(1.8rem, 4vw, 3rem);
    text-decoration: none;
    color: #FFFFFF;
    opacity: 0;
    transform: translateY(30px) scale(0.9);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    letter-spacing: -0.01em;
}

.nav-overlay.active .nav-link {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.nav-overlay.active .nav-link:nth-child(1) { transition-delay: 0.05s; }
.nav-overlay.active .nav-link:nth-child(2) { transition-delay: 0.1s; }
.nav-overlay.active .nav-link:nth-child(3) { transition-delay: 0.15s; }
.nav-overlay.active .nav-link:nth-child(4) { transition-delay: 0.2s; }
.nav-overlay.active .nav-link:nth-child(5) { transition-delay: 0.25s; }
.nav-overlay.active .nav-link:nth-child(6) { transition-delay: 0.3s; }
.nav-overlay.active .nav-link:nth-child(7) { transition-delay: 0.35s; }

.nav-link:hover {
    transform: scale(1.08);
}

/* ---- Background Bubbles ---- */
.background-bubbles {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.bg-bubble {
    position: absolute;
    border-radius: 50%;
    opacity: 0;
    animation: bubble-rise linear infinite;
}

@keyframes bubble-rise {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.08;
    }
    10% {
        opacity: 0.12;
    }
    90% {
        opacity: 0.04;
    }
    100% {
        transform: translateY(-120px) rotate(15deg);
        opacity: 0;
    }
}

/* ---- Hero Section ---- */
.hero {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 85vh;
    padding: 60px 24px;
    text-align: center;
    overflow: hidden;
    z-index: 1;
}

.hero-blob {
    position: relative;
    width: clamp(160px, 30vw, 260px);
    height: clamp(160px, 30vw, 260px);
    margin-bottom: 32px;
    animation: blob-idle 3s ease-in-out infinite;
}

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

.blob-svg {
    width: 100%;
    height: 100%;
    fill: #FF6B9D;
    filter: drop-shadow(0 8px 32px rgba(255, 107, 157, 0.3));
}

.blob-face {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.blob-eye {
    display: inline-block;
    width: 14px;
    height: 14px;
    background: #2D2D3A;
    border-radius: 50%;
}

.blob-eye.left {
    position: absolute;
    top: -8px;
    left: -16px;
}

.blob-eye.right {
    position: absolute;
    top: -8px;
    right: -16px;
}

.blob-mouth {
    display: block;
    width: 28px;
    height: 14px;
    border-bottom: 4px solid #2D2D3A;
    border-radius: 0 0 28px 28px;
    margin-top: 8px;
}

.hero-title {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: clamp(3rem, 8vw, 6rem);
    letter-spacing: -0.02em;
    color: #2D2D3A;
    line-height: 1.1;
    margin-bottom: 16px;
}

.hero-dot {
    color: #FF3B6F;
}

.hero-subtitle {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 600;
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    color: #8E8E9A;
    max-width: 500px;
    line-height: 1.5;
}

.hero-bubbles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: -1;
}

.hero-bubble {
    position: absolute;
    width: var(--size);
    height: var(--size);
    left: var(--x);
    top: var(--y);
    border-radius: 50%;
    background: var(--color);
    opacity: 0.15;
    animation: hero-bubble-float 4s ease-in-out infinite;
    animation-delay: var(--delay);
}

@keyframes hero-bubble-float {
    0%, 100% {
        transform: translateY(0) scale(1);
        opacity: 0.15;
    }
    50% {
        transform: translateY(-20px) scale(1.1);
        opacity: 0.25;
    }
}

/* ---- Content Sections ---- */
.content-section {
    position: relative;
    padding: 0 24px 80px;
    z-index: 1;
}

.section-wave {
    width: 100%;
    overflow: hidden;
    line-height: 0;
    margin-bottom: 24px;
}

.section-wave svg {
    width: 100%;
    height: 80px;
    display: block;
}

#science .section-wave svg { color: rgba(255, 59, 111, 0.15); }
#technology .section-wave svg { color: rgba(66, 165, 245, 0.15); }
#nature .section-wave svg { color: rgba(61, 220, 132, 0.15); }
#arts .section-wave svg { color: rgba(156, 91, 245, 0.15); }
#culture .section-wave svg { color: rgba(255, 140, 66, 0.15); }
#community .section-wave svg { color: rgba(255, 107, 157, 0.15); }
#featured .section-wave svg { color: rgba(255, 210, 63, 0.15); }

/* ---- Section Header ---- */
.section-header {
    display: flex;
    align-items: center;
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto 40px;
    padding: 0 16px;
    opacity: 0;
    transform: translateY(30px) rotate(-2deg);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.section-header.visible {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
}

.section-blob {
    position: relative;
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    animation: blob-idle 3s ease-in-out infinite;
}

.mini-blob-svg {
    width: 100%;
    height: 100%;
}

.mini-blob-face {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.mini-eye {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #2D2D3A;
    border-radius: 50%;
    position: absolute;
    top: -3px;
}

.mini-eye.left {
    left: -9px;
}

.mini-eye.right {
    right: -9px;
}

.mini-mouth {
    display: block;
    width: 14px;
    height: 7px;
    border-bottom: 2.5px solid #2D2D3A;
    border-radius: 0 0 14px 14px;
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
}

.section-title {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: clamp(2.4rem, 6vw, 4.5rem);
    letter-spacing: -0.01em;
    line-height: 1.1;
}

/* ---- Section Bubble Burst Container ---- */
.section-bubbles-container {
    position: relative;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    height: 0;
    overflow: visible;
    pointer-events: none;
}

.burst-bubble {
    position: absolute;
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
}

.burst-bubble.animate {
    animation: burst-pop 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes burst-pop {
    0% {
        transform: scale(0) translate(0, 0);
        opacity: 0.8;
    }
    60% {
        opacity: 0.6;
    }
    100% {
        transform: scale(1) translate(var(--burst-x), var(--burst-y));
        opacity: 0;
    }
}

/* ---- Card Grid ---- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 16px;
}

@media (min-width: 1400px) {
    .card-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1024px) and (max-width: 1399px) {
    .card-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 640px) and (max-width: 1023px) {
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 639px) {
    .card-grid {
        grid-template-columns: 1fr;
    }
}

/* ---- Cards ---- */
.card {
    position: relative;
    background: #FFFFFF;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    padding: 28px;
    padding-top: 34px;
    overflow: hidden;
    opacity: 0;
    transform: translateY(40px) scale(0.92);
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    background-repeat: repeat;
    display: flex;
    flex-direction: column;
}

.card.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.card:hover {
    transform: translateY(-6px) scale(1.03);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12);
}

.card.visible:hover {
    transform: translateY(-6px) scale(1.03);
}

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

.card-tall {
    grid-row: span 2;
}

@media (max-width: 639px) {
    .card-wide {
        grid-column: span 1;
    }
    .card-tall {
        grid-row: span 1;
    }
}

/* ---- Card Stripe ---- */
.card-stripe {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    border-radius: 20px 20px 0 0;
    transition: filter 0.3s ease;
}

.card:hover .card-stripe {
    filter: brightness(1.2);
}

/* ---- Card Content ---- */
.card-title {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    letter-spacing: -0.01em;
    color: #2D2D3A;
    margin-bottom: 12px;
    line-height: 1.25;
}

.card-body {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    line-height: 1.72;
    color: #2D2D3A;
    margin-bottom: 12px;
}

.card-list {
    list-style: none;
    padding: 0;
    margin-bottom: 16px;
}

.card-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(0.9rem, 1.1vw, 1rem);
    line-height: 1.6;
    color: #2D2D3A;
}

.bubble-bullet {
    display: inline-block;
    width: 8px;
    height: 8px;
    min-width: 8px;
    border-radius: 50%;
    margin-top: 7px;
}

/* ---- Card Tags ---- */
.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    padding-top: 12px;
}

.pill-tag {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--tag-color);
    background: color-mix(in srgb, var(--tag-color) 12%, transparent);
    padding: 4px 12px;
    border-radius: 50px;
    display: inline-block;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.card:hover .pill-tag {
    animation: wiggle 0.3s ease-in-out;
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-3deg); }
    75% { transform: rotate(3deg); }
}

/* ---- Card Featured Bubbles ---- */
.card-featured-bubbles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.card-bubble {
    position: absolute;
    width: var(--cb-size);
    height: var(--cb-size);
    left: var(--cb-x);
    top: var(--cb-y);
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.6), var(--cb-color));
    opacity: 0.2;
}

/* ---- Card Stat / Decorative Numbers ---- */
.card-stat {
    margin-bottom: 8px;
}

.stat-number {
    font-family: 'Baloo 2', cursive;
    font-weight: 800;
    font-size: clamp(2rem, 5vw, 5rem);
    line-height: 1;
    background: linear-gradient(135deg, #FF3B6F, #FF8C42, #FFD23F, #3DDC84, #42A5F5, #9C5BF5);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: rainbow-shift 4s ease infinite;
}

@keyframes rainbow-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ---- Hover Bubble Effect (CSS-only pseudo-elements) ---- */
.card::before,
.card::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    z-index: 10;
    transition: none;
}

.card::before {
    top: 20%;
    right: 12%;
    background: var(--hover-bubble-color, #FF6B9D);
}

.card::after {
    top: 35%;
    right: 8%;
    background: var(--hover-bubble-color2, #42A5F5);
    width: 6px;
    height: 6px;
}

.card:hover::before {
    animation: hover-bubble-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.card:hover::after {
    animation: hover-bubble-pop2 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s forwards;
}

@keyframes hover-bubble-pop {
    0% {
        opacity: 0;
        transform: scale(0) translateY(0);
    }
    40% {
        opacity: 0.6;
        transform: scale(1.2) translateY(-10px);
    }
    100% {
        opacity: 0;
        transform: scale(0.8) translateY(-30px);
    }
}

@keyframes hover-bubble-pop2 {
    0% {
        opacity: 0;
        transform: scale(0) translateY(0);
    }
    40% {
        opacity: 0.5;
        transform: scale(1) translateY(-8px);
    }
    100% {
        opacity: 0;
        transform: scale(0.6) translateY(-25px);
    }
}

/* ---- Footer ---- */
.site-footer {
    position: relative;
    text-align: center;
    padding: 80px 24px 48px;
    background: #2D2D3A;
    overflow: hidden;
    z-index: 1;
}

.footer-blob {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 300px;
    pointer-events: none;
    opacity: 0.08;
}

.footer-blob-svg {
    width: 100%;
    height: 100%;
}

.footer-text {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: #FFFFFF;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.footer-dot {
    color: #FF3B6F;
}

.footer-tagline {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.5vw, 1.15rem);
    color: #8E8E9A;
    margin-bottom: 32px;
}

.footer-rainbow {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.footer-rainbow span {
    display: block;
    width: 32px;
    height: 6px;
    border-radius: 6px;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.footer-rainbow span:hover {
    transform: scaleY(3) translateY(-4px);
}

/* ---- Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .card {
        opacity: 1;
        transform: none;
    }
    .section-header {
        opacity: 1;
        transform: none;
    }
}

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

::-webkit-scrollbar-track {
    background: #FEFCF8;
}

::-webkit-scrollbar-thumb {
    background: #8E8E9A;
    border-radius: 10px;
    border: 2px solid #FEFCF8;
}

::-webkit-scrollbar-thumb:hover {
    background: #9C5BF5;
}
