/* ============================================
   gabs.games — Dark Fairycore Gaming Portal
   ============================================ */

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

:root {
    --bg-primary: #0a0a14;
    --bg-secondary: #1a1028;
    --neon-violet: #b347e0;
    --neon-cyan: #00e5cc;
    --neon-rose: #ff3d8a;
    --text-primary: #e8e0f0;
    --text-muted: #8a7ea0;
    --surface-glow: #2a1a3e;
    --cell-radius: clamp(8px, 1vw, 16px);
    --cell-gap: clamp(4px, 0.5vw, 8px);
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Libre Baskerville', serif;
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
    line-height: 1.7;
    overflow-x: hidden;
}

/* ---------- Typography ---------- */
h1, h2, .cell-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
}

.cell-desc, .cell-label, .cell-link, .domain-text, .typewriter-lore, .lore-paragraph {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    letter-spacing: 0.04em;
}

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

.bubble {
    position: absolute;
    border-radius: 50%;
    bottom: -40px;
    animation: float-up 8s ease-in-out infinite;
    will-change: transform, opacity;
}

@keyframes float-up {
    0% { transform: translateY(0) translateX(0); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 0.6; }
    100% { transform: translateY(-110vh) translateX(20px); opacity: 0; }
}

/* ---------- Bento Cells ---------- */
.bento-cell {
    position: relative;
    background: var(--bg-secondary);
    border-radius: var(--cell-radius);
    overflow: hidden;
    transition: box-shadow 0.5s ease, transform 0.5s ease;
}

.bento-cell .cell-content {
    position: relative;
    z-index: 1;
}

/* Reveal animation */
.reveal-cell {
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-cell.visible {
    opacity: 1;
    transform: scale(1);
}

/* ---------- Section 1: Sanctum Gate ---------- */
.section-hero {
    height: 100vh;
    min-height: 600px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(16px, 3vw, 48px);
}

.hero-bento {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: var(--cell-gap);
    width: 100%;
    max-width: 1200px;
    height: 60vh;
    min-height: 350px;
}

.hero-main-cell {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(24px, 4vw, 64px);
    background: linear-gradient(135deg, var(--bg-secondary) 0%, #12082080 100%);
}

#hero-title {
    font-size: clamp(4rem, 10vw, 8rem);
    font-weight: 600;
    color: var(--text-primary);
    position: relative;
    z-index: 1;
    min-height: 1.2em;
    line-height: 1.1;
}

#hero-title .char-glow {
    display: inline-block;
    animation: char-pulse 0.3s ease-out;
}

@keyframes char-pulse {
    0% { text-shadow: 0 0 0 transparent; }
    50% { text-shadow: 0 0 20px #b347e0, 0 0 40px #b347e080; }
    100% { text-shadow: 0 0 0 transparent; }
}

.typewriter-cursor {
    display: inline-block;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    animation: blink 0.8s step-end infinite;
    color: var(--neon-violet);
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.tagline {
    font-family: 'Libre Baskerville', serif;
    font-style: italic;
    font-size: clamp(1rem, 1.8vw, 1.4rem);
    color: var(--text-muted);
    margin-top: 1.5rem;
    position: relative;
    z-index: 1;
}

.tagline-word {
    opacity: 0;
    transition: opacity 0.4s ease;
    display: inline-block;
    margin-right: 0.35em;
}

.tagline-word.show {
    opacity: 1;
}

/* Hero wave cell */
.hero-wave-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, var(--surface-glow) 0%, var(--bg-secondary) 100%);
}

.wave-form-svg {
    width: 100%;
    height: 100%;
}

/* ---------- Fairy Motifs ---------- */
.fairy-motifs {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.fairy-icon {
    position: absolute;
    width: 40px;
    height: 40px;
    opacity: 0.12;
    animation: fairy-drift 20s linear infinite;
}

.fairy-crescent { top: 15%; left: 10%; animation-delay: 0s; }
.fairy-mushroom { top: 60%; left: 75%; animation-delay: -5s; }
.fairy-gem { top: 35%; left: 55%; animation-delay: -10s; }
.fairy-dragonfly { top: 80%; left: 25%; animation-delay: -15s; }

.fairy-mushroom-2 { top: 20%; left: 80%; animation-delay: -3s; }
.fairy-crescent-2 { top: 50%; left: 5%; animation-delay: -8s; }
.fairy-gem-2 { top: 75%; left: 60%; animation-delay: -13s; }

@keyframes fairy-drift {
    0% { transform: translateX(0) translateY(0); }
    50% { transform: translateX(30px) translateY(-10px); }
    100% { transform: translateX(0) translateY(0); }
}

/* ---------- Wave Dividers ---------- */
.wave-divider {
    height: 80px;
    position: relative;
    overflow: hidden;
}

.wave-divider-svg {
    width: 100%;
    height: 100%;
}

/* ---------- Section 2: The Collection ---------- */
.section-collection {
    padding: clamp(24px, 4vw, 64px);
    min-height: 100vh;
}

.collection-bento {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(180px, auto);
    gap: var(--cell-gap);
    max-width: 1200px;
    margin: 0 auto;
}

.cell-2x2 {
    grid-column: span 2;
    grid-row: span 2;
    min-height: 380px;
}

.cell-1x1 {
    min-height: 180px;
}

.cell-3x1 {
    grid-column: span 3;
    min-height: 180px;
}

.game-cell {
    display: flex;
    align-items: flex-end;
    padding: clamp(16px, 2vw, 32px);
    cursor: default;
}

.game-cell:hover {
    box-shadow: 0 0 30px #b347e050, 0 0 60px #00e5cc20;
}

.game-cell:hover .bubble {
    animation-duration: 4s;
}

/* Gradient backgrounds per cell */
.game-cell[data-gradient="1"] {
    background: linear-gradient(135deg, #2a1a3e 0%, #1a082e 40%, #0a1a2e 100%),
                conic-gradient(from 45deg at 70% 30%, #b347e020, #00e5cc15, transparent 50%);
    background-blend-mode: screen;
}
.game-cell[data-gradient="2"] {
    background: linear-gradient(160deg, #1a1028 0%, #2a0a3e 100%);
}
.game-cell[data-gradient="3"] {
    background: linear-gradient(200deg, #0a1a28 0%, #1a1028 100%);
}
.game-cell[data-gradient="4"] {
    background: linear-gradient(135deg, #1a0828 0%, #0a1a1e 100%);
}
.game-cell[data-gradient="5"] {
    background: linear-gradient(90deg, #1a1028 0%, #2a1a3e 50%, #0a1a28 100%);
}
.game-cell[data-gradient="6"] {
    background: linear-gradient(225deg, #2a1a3e 0%, #1a1028 100%);
}

.cell-title {
    font-size: clamp(1.5rem, 3vw, 2.8rem);
    color: var(--text-primary);
    filter: drop-shadow(0 0 clamp(8px, 1.5vw, 20px) #b347e040);
    margin-bottom: 0.3em;
}

.cell-desc {
    font-size: clamp(0.75rem, 0.9vw, 0.95rem);
    color: var(--text-muted);
    line-height: 1.5;
}

/* ---------- Section 3: Lore Chamber ---------- */
.section-lore {
    min-height: 100vh;
    background: var(--bg-secondary);
    position: relative;
    display: flex;
    align-items: center;
    padding: clamp(48px, 8vw, 120px) 0;
    overflow: hidden;
}

.lore-wave-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.lore-text-container {
    position: relative;
    z-index: 1;
    max-width: 48ch;
    margin-left: 15%;
    padding: 0 clamp(16px, 2vw, 32px);
}

.lore-paragraph {
    font-size: clamp(0.75rem, 0.9vw, 0.95rem);
    color: var(--text-primary);
    line-height: 1.8;
    margin-bottom: 2em;
    min-height: 3em;
}

.lore-cursor {
    display: inline;
    font-family: 'IBM Plex Mono', monospace;
    animation: blink 0.8s step-end infinite;
    color: var(--neon-cyan);
}

/* ---------- Section 4: The Depths ---------- */
.section-depths {
    position: relative;
    padding: clamp(24px, 4vw, 64px);
    padding-top: clamp(48px, 6vw, 96px);
}

.depths-wave-border {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
}

.depths-bento {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: minmax(120px, auto);
    gap: var(--cell-gap);
    max-width: 1000px;
    margin: 0 auto;
}

.cell-depths-feature {
    grid-column: span 2;
    grid-row: span 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(24px, 3vw, 48px);
    background: linear-gradient(135deg, var(--surface-glow) 0%, var(--bg-secondary) 100%);
    text-align: center;
}

.cell-depths-feature .cell-title {
    font-size: clamp(2rem, 4vw, 3.5rem);
    margin-bottom: 0.5em;
}

.cell-desc-lore {
    font-family: 'Libre Baskerville', serif;
    font-style: italic;
    color: var(--text-muted);
    font-size: clamp(0.9rem, 1vw, 1.1rem);
}

.cell-depths-sm {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: clamp(12px, 1.5vw, 24px);
    background: var(--surface-glow);
    text-align: center;
}

.cell-label {
    font-size: clamp(0.65rem, 0.8vw, 0.8rem);
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.5em;
}

.cell-link {
    font-size: clamp(0.75rem, 0.9vw, 0.95rem);
    color: var(--neon-cyan);
    filter: drop-shadow(0 0 8px #00e5cc40);
}

.cell-depths-farewell {
    grid-column: span 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(16px, 2vw, 32px);
    background: linear-gradient(135deg, var(--bg-secondary) 0%, #0a0a1480 100%);
}

.farewell-text {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    color: var(--text-muted);
    text-align: center;
}

.cell-depths-domain {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(12px, 1.5vw, 24px);
    background: var(--bg-secondary);
}

.domain-text {
    font-size: clamp(0.9rem, 1.2vw, 1.2rem);
}

.domain-char {
    display: inline-block;
}

/* ---------- Neon Glow Utility ---------- */
.glow-violet { filter: drop-shadow(0 0 clamp(8px, 1.5vw, 20px) #b347e040); }
.glow-cyan { filter: drop-shadow(0 0 clamp(8px, 1.5vw, 20px) #00e5cc40); }
.glow-rose { filter: drop-shadow(0 0 clamp(8px, 1.5vw, 20px) #ff3d8a40); }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .hero-bento {
        grid-template-columns: 1fr;
        height: auto;
    }
    .hero-main-cell { min-height: 50vh; }
    .hero-wave-cell { min-height: 120px; }

    .collection-bento {
        grid-template-columns: repeat(2, 1fr);
    }
    .cell-2x2 { grid-column: span 2; grid-row: span 1; min-height: 240px; }
    .cell-3x1 { grid-column: span 2; }

    .lore-text-container { margin-left: 5%; }

    .depths-bento {
        grid-template-columns: 1fr;
    }
    .cell-depths-feature { grid-column: span 1; grid-row: span 1; }
    .cell-depths-farewell { grid-column: span 1; }
}
