/* ============================================
   gabs.cx - Candy-Bright Neomorphism
   ============================================ */

:root {
    --bg-base: #F0E6F6;
    --bubble-pink: #FF6B9D;
    --mint-fizz: #4ECDC4;
    --sherbet-orange: #FF8A5C;
    --lilac-glow: #C3A6FF;
    --deep-grape: #2B1055;
    --soft-white: #FEFAFF;
    --cyan-pop: #00E5FF;
    --neo-shadow-dark: rgba(43, 16, 85, 0.12);
    --neo-shadow-light: rgba(254, 250, 255, 0.7);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    background: var(--bg-base);
    color: var(--deep-grape);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.6;
    overflow-x: hidden;
}

/* --- Foam Background --- */
.foam-bg {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* --- Scroll Bubble Chain --- */
.bubble-chain {
    position: fixed;
    right: 16px;
    top: 10%;
    height: 80%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 50;
    pointer-events: none;
}

.chain-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--bg-base);
    border: 1px solid var(--lilac-glow);
    transition: background 0.3s ease, transform 0.3s ease;
}

.chain-dot.filled {
    background: var(--mint-fizz);
    border-color: var(--mint-fizz);
    transform: scale(1.2);
}

/* --- HERO SURFACE --- */
.hero-surface {
    position: relative;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 1;
}

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

.hero-bubble-el {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, var(--soft-white), rgba(255, 107, 157, 0.25));
    animation: bubbleDrift var(--duration, 20s) ease-in-out infinite;
    will-change: transform;
}

@keyframes bubbleDrift {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-60px) scale(1.04); }
}

.hero-content {
    position: relative;
    z-index: 5;
    text-align: center;
    padding: 0 24px;
}

.hero-title {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 7rem);
    color: var(--deep-grape);
    text-shadow: 4px 4px 0px var(--lilac-glow), -2px -2px 0px var(--soft-white);
    letter-spacing: 0.04em;
}

.hero-sub {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    color: var(--bubble-pink);
    margin-top: 16px;
}

.scroll-hint {
    position: absolute;
    bottom: 40px;
    animation: hintPulse 2s ease-in-out infinite;
}

.chevron-down {
    width: 20px;
    height: 12px;
}

@keyframes hintPulse {
    0%, 100% { opacity: 0.6; transform: translateY(0); }
    50% { opacity: 0.3; transform: translateY(6px); }
}

/* --- CARD GRID --- */
.card-grid-zone {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: clamp(24px, 4vw, 60px);
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
}

/* --- Neo Cards --- */
.neo-card {
    position: relative;
    background: var(--bg-base);
    border-radius: 20px;
    box-shadow:
        8px 8px 20px var(--neo-shadow-dark),
        -8px -8px 20px var(--neo-shadow-light);
    padding: clamp(20px, 3vw, 32px);
    overflow: hidden;
}

.stagger-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

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

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

.card-square {
    grid-column: span 4;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* --- Card Content --- */
.card-heading {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    color: var(--deep-grape);
    margin-bottom: 12px;
}

.card-text {
    color: var(--deep-grape);
    opacity: 0.8;
    max-width: 40em;
}

.card-text.sm {
    font-size: 0.85rem;
    text-align: center;
    margin-top: 12px;
}

/* --- Accent Bubbles --- */
.accent-bubble {
    position: absolute;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    pointer-events: none;
    transition: transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.ab-pink { background: var(--bubble-pink); opacity: 0.5; }
.ab-mint { background: var(--mint-fizz); opacity: 0.5; width: 14px; height: 14px; }
.ab-orange { background: var(--sherbet-orange); opacity: 0.5; width: 16px; height: 16px; }
.ab-lilac { background: var(--lilac-glow); opacity: 0.5; width: 18px; height: 18px; }

.neo-card:hover .accent-bubble {
    transform: translate(3px, -4px);
}

/* --- Stat Cards --- */
.stat-number {
    font-family: 'Fira Code', monospace;
    font-weight: 400;
    font-size: clamp(2.5rem, 5vw, 4rem);
    color: var(--bubble-pink);
    display: block;
    text-align: center;
}

.stat-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--deep-grape);
    opacity: 0.5;
    margin-top: 8px;
    text-align: center;
}

/* --- Bubble Viewport --- */
.bubble-viewport {
    width: 100%;
    height: 160px;
}

.viewport-svg {
    width: 100%;
    height: 100%;
}

.float-bubble {
    animation: floatBub 6s ease-in-out infinite;
}

.fb1 { animation-delay: 0s; }
.fb2 { animation-delay: 1.5s; }
.fb3 { animation-delay: 3s; }
.fb4 { animation-delay: 4.5s; }

@keyframes floatBub {
    0%, 100% { transform: translateY(0) scale(0.95); }
    50% { transform: translateY(-10px) scale(1.05); }
}

/* --- Path Draw Icon --- */
.path-draw-icon {
    width: 80px;
    height: 80px;
}

.draw-path {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    transition: stroke-dashoffset 2s ease-out;
}

.stagger-card.visible .draw-path {
    stroke-dashoffset: 0;
}

/* --- Bubble Divider --- */
.bubble-divider {
    grid-column: span 12;
    height: 120px;
    position: relative;
    overflow: hidden;
}

.divider-bubbles {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
}

.d-bubble {
    position: absolute;
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    background: var(--color);
    opacity: 0.4;
    animation: driftRight 8s linear var(--delay) infinite;
}

@keyframes driftRight {
    0% { left: -5%; }
    100% { left: 105%; }
}

/* --- DEEP SECTION --- */
.deep-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to bottom, var(--bg-base), var(--deep-grape));
    padding: 60px 24px;
    z-index: 1;
}

.deep-bubble {
    width: clamp(280px, 50vw, 500px);
    height: clamp(280px, 50vw, 500px);
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, var(--soft-white), rgba(195, 166, 255, 0.3));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15%;
    animation: deepPulse 4s ease-in-out infinite;
    box-shadow:
        inset -8px -8px 20px rgba(43, 16, 85, 0.15),
        inset 8px 8px 20px rgba(254, 250, 255, 0.3);
}

@keyframes deepPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

.deep-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.8rem, 1.2vw, 0.95rem);
    color: var(--deep-grape);
    text-align: center;
    line-height: 1.6;
}

.deep-domain {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    color: var(--soft-white);
    opacity: 0.4;
    margin-top: 40px;
}

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

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

    .bubble-divider {
        grid-column: span 2;
    }

    .bubble-chain {
        display: none;
    }
}

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

    .card-wide,
    .card-square,
    .bubble-divider {
        grid-column: span 1;
    }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    .hero-bubble-el,
    .float-bubble,
    .d-bubble {
        animation: none;
    }

    .stagger-card {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .draw-path {
        stroke-dashoffset: 0;
        transition: none;
    }
}
