/* ============================================
   LLITTL.com — Dopamine Maximalism Bento Grid
   Navy-Metallic + Aurora Accents
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --midnight-navy: #0B1120;
    --steeled-blue: #152238;
    --gunmetal-sheen: #1E3050;
    --silver-frost: #E8ECF1;
    --clouded-steel: #8A9BB5;
    --boreal-mint: #47EDAE;
    --polar-rose: #F472B6;
    --glacial-cyan: #38BDF8;
    --titanium: #C0C8D4;
    --brushed-chrome: #6B7B8D;

    --aurora-gradient: linear-gradient(135deg, #47EDAE 0%, #38BDF8 40%, #F472B6 80%, #47EDAE 100%);
    --metallic-gradient: linear-gradient(180deg, #C0C8D4 0%, #6B7B8D 100%);
    --gutter-glow: radial-gradient(ellipse, rgba(71,237,174,0.15) 0%, transparent 70%);

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'DM Sans', sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;

    --grid-gap: 8px;
    --cell-radius: 16px;
    --spring-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --smooth-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body {
    background-color: var(--midnight-navy);
    color: var(--silver-frost);
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Aurora Canvas --- */
#aurora-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

/* --- Navigation --- */
#main-nav {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 10px 28px;
    background: rgba(21, 34, 56, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(192, 200, 212, 0.15);
    border-radius: 50px;
    transition: all 0.4s ease;
    overflow: hidden;
    white-space: nowrap;
}

#main-nav.collapsed {
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
    gap: 0;
}

#main-nav.collapsed .nav-links {
    opacity: 0;
    width: 0;
    overflow: hidden;
    pointer-events: none;
}

#main-nav.collapsed:hover {
    width: auto;
    padding: 10px 28px;
    border-radius: 50px;
    gap: 24px;
}

#main-nav.collapsed:hover .nav-links {
    opacity: 1;
    width: auto;
    pointer-events: auto;
}

.nav-brand {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 18px;
    background: var(--metallic-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    flex-shrink: 0;
}

.nav-links {
    display: flex;
    gap: 20px;
    transition: opacity 0.3s ease, width 0.4s ease;
}

.nav-links a {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    color: var(--clouded-steel);
    text-decoration: none;
    transition: color 0.25s ease;
}

.nav-links a:hover {
    color: var(--glacial-cyan);
}

/* --- Bento Sections --- */
.bento-section {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
}

/* --- Bento Grid Base --- */
.bento-grid {
    display: grid;
    gap: var(--grid-gap);
    position: relative;
}

/* Gutter glow effect via background on the grid */
.bento-grid::before {
    content: '';
    position: absolute;
    inset: -4px;
    background: var(--gutter-glow);
    z-index: 0;
    pointer-events: none;
    opacity: 0.5;
}

/* --- Bento Cell Base --- */
.bento-cell {
    background: var(--steeled-blue);
    border-radius: var(--cell-radius);
    padding: 28px;
    position: relative;
    z-index: 1;
    transition: background-color 0.3s ease, transform 0.3s var(--spring-bounce);
    overflow: hidden;
}

.bento-cell:hover {
    background: var(--gunmetal-sheen);
}

/* --- Cell entrance animations --- */
.bento-cell[data-animate],
.section-header[data-animate] {
    opacity: 0;
    transform: translateY(24px) scale(0.95);
    transition: opacity 0.5s var(--spring-bounce), transform 0.5s var(--spring-bounce);
}

.bento-cell[data-animate].visible,
.section-header[data-animate].visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* --- Labels / Mono --- */
.label-mono {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--clouded-steel);
}

/* --- Icons --- */
.bento-icon {
    width: 48px;
    height: 48px;
    filter: drop-shadow(0 0 8px rgba(71, 237, 174, 0.4));
    transition: filter 0.3s ease;
}

.bento-cell:hover .bento-icon {
    filter: drop-shadow(0 0 14px rgba(71, 237, 174, 0.7));
}

.bento-icon.large-icon {
    width: 80px;
    height: 80px;
}

/* ============================================
   HERO GRID
   ============================================ */
.hero-grid {
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: auto auto;
    min-height: 90vh;
    align-content: center;
    perspective: 800px;
}

.hero-icon-cell {
    grid-column: 1 / 3;
    grid-row: 1 / 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-tagline-cell {
    grid-column: 1 / 3;
    grid-row: 2 / 3;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}

.hero-tagline-cell p {
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--clouded-steel);
}

.hero-main-cell {
    grid-column: 3 / 11;
    grid-row: 1 / 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
}

.hero-wordmark {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: clamp(64px, 20vw, 280px);
    letter-spacing: -0.03em;
    line-height: 0.9;
    background: var(--metallic-gradient);
    background-size: 100% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
    will-change: background-position;
}

.hero-wordmark::after {
    content: '';
    position: absolute;
    inset: -20px;
    background: radial-gradient(ellipse at center, rgba(56, 189, 248, 0.15) 0%, transparent 60%);
    z-index: -1;
    pointer-events: none;
}

.hero-subtitle {
    font-family: var(--font-body);
    font-size: 18px;
    color: var(--clouded-steel);
    margin-top: 16px;
}

.hero-orb-cell {
    grid-column: 11 / 13;
    grid-row: 1 / 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aurora-orb {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--aurora-gradient);
    background-size: 300% 300%;
    animation: auroraShift 8s ease infinite;
    filter: blur(1px);
    box-shadow: 0 0 30px rgba(71, 237, 174, 0.4), 0 0 60px rgba(56, 189, 248, 0.2);
}

.hero-scroll-cell {
    grid-column: 11 / 13;
    grid-row: 2 / 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.scroll-arrow {
    width: 32px;
    height: 32px;
    animation: bobDown 2s ease-in-out infinite;
}

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

/* ============================================
   DENSE GRID (Feature Cards)
   ============================================ */
.dense-grid {
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: minmax(200px, auto);
}

/* --- Flippable Cards --- */
.flippable {
    cursor: pointer;
    perspective: 1000px;
    background: transparent;
    padding: 0;
    overflow: visible;
}

.flippable:hover {
    background: transparent;
}

.flippable .card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 200px;
    transform-style: preserve-3d;
    transition: transform 0.6s var(--smooth-ease);
}

.flippable.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: var(--cell-radius);
    padding: 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.card-front {
    background: var(--steeled-blue);
    z-index: 2;
}

.card-back {
    background: var(--gunmetal-sheen);
    transform: rotateY(180deg);
    z-index: 1;
}

.card-back p {
    font-size: 15px;
    color: var(--silver-frost);
    text-align: center;
    line-height: 1.7;
}

.card-label {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 16px;
    color: var(--silver-frost);
}

.flip-hint {
    position: absolute;
    top: 12px;
    right: 12px;
    opacity: 0.5;
}

/* Pulsing aurora border for flippable cards */
.flippable::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: calc(var(--cell-radius) + 2px);
    background: var(--aurora-gradient);
    background-size: 300% 300%;
    animation: auroraShift 4s ease infinite;
    z-index: -1;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.flippable:hover::before {
    opacity: 0.7;
}

/* Aurora edge visible during flip */
.flippable .card-inner::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--cell-radius);
    background: var(--aurora-gradient);
    background-size: 300% 300%;
    animation: auroraShift 4s ease infinite;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 0;
}

.flippable.flipping .card-inner::before {
    opacity: 0.6;
}

/* ============================================
   BREATHING GRID
   ============================================ */
.breathing-grid {
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: minmax(340px, auto);
}

.aurora-gradient-cell {
    padding: 0;
    overflow: hidden;
}

.aurora-gradient-fill {
    width: 100%;
    height: 100%;
    min-height: 340px;
    background: var(--aurora-gradient);
    background-size: 300% 300%;
    animation: auroraShift 8s ease infinite;
    border-radius: var(--cell-radius);
}

.aurora-gradient-fill.small {
    min-height: 160px;
}

.display-text-cell {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 20px;
    padding: 48px 36px;
}

.section-title {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: clamp(48px, 8vw, 120px);
    letter-spacing: -0.03em;
    line-height: 0.95;
    background: var(--metallic-gradient);
    background-size: 100% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    will-change: background-position;
}

.display-body {
    font-size: 17px;
    color: var(--clouded-steel);
    max-width: 420px;
    line-height: 1.7;
}

/* ============================================
   CAROUSEL SECTION
   ============================================ */
.section-header {
    text-align: center;
    margin-bottom: 32px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.carousel-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    position: relative;
}

.carousel-track {
    display: flex;
    gap: var(--grid-gap);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 8px 0;
    width: 100%;
}

.carousel-track::-webkit-scrollbar {
    display: none;
}

.carousel-card {
    flex: 0 0 260px;
    min-height: 280px;
    scroll-snap-align: start;
}

.carousel-controls {
    display: flex;
    gap: 16px;
}

.carousel-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(192, 200, 212, 0.2);
    background: var(--steeled-blue);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.25s ease, border-color 0.25s ease;
}

.carousel-btn:hover {
    background: var(--gunmetal-sheen);
    border-color: var(--glacial-cyan);
}

/* ============================================
   CLOSING GRID
   ============================================ */
.closing-grid {
    grid-template-columns: 2fr 1fr;
    grid-template-rows: auto auto;
    min-height: 60vh;
    align-content: center;
}

.closing-main-cell {
    grid-column: 1 / 2;
    grid-row: 1 / 3;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 20px;
    padding: 60px 48px;
}

.closing-icon-cell {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.closing-accent-cell {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
    padding: 0;
    overflow: hidden;
}

/* CTA Button */
.cta-button {
    display: inline-block;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 15px;
    color: var(--midnight-navy);
    background: var(--boreal-mint);
    padding: 14px 32px;
    border-radius: 50px;
    text-decoration: none;
    transition: transform 0.3s var(--spring-bounce), box-shadow 0.3s ease;
    align-self: flex-start;
    margin-top: 8px;
}

.cta-button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 24px rgba(71, 237, 174, 0.5);
}

/* ============================================
   AURORA ANIMATION KEYFRAMES
   ============================================ */
@keyframes auroraShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .bento-cell[data-animate],
    .section-header[data-animate] {
        opacity: 1;
        transform: none;
    }

    .flippable .card-inner {
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   RESPONSIVE — MOBILE (< 768px)
   ============================================ */
@media (max-width: 767px) {
    html {
        font-size: 15px;
    }

    .bento-section {
        padding: 24px 12px;
    }

    /* Hero collapses */
    .hero-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto auto;
        min-height: 80vh;
    }

    .hero-icon-cell {
        grid-column: 1 / 2;
        grid-row: 1 / 2;
    }

    .hero-tagline-cell {
        grid-column: 2 / 3;
        grid-row: 1 / 2;
    }

    .hero-main-cell {
        grid-column: 1 / 3;
        grid-row: 2 / 3;
        padding: 32px 12px;
    }

    .hero-orb-cell {
        grid-column: 1 / 2;
        grid-row: 3 / 4;
    }

    .hero-scroll-cell {
        grid-column: 2 / 3;
        grid-row: 3 / 4;
    }

    /* Dense grid to 2 columns */
    .dense-grid {
        grid-template-columns: 1fr 1fr;
    }

    /* Breathing grid stacks */
    .breathing-grid {
        grid-template-columns: 1fr;
    }

    .aurora-gradient-fill {
        min-height: 200px;
    }

    /* Closing grid stacks */
    .closing-grid {
        grid-template-columns: 1fr;
    }

    .closing-main-cell {
        grid-column: 1 / -1;
        grid-row: auto;
        padding: 36px 24px;
    }

    .closing-icon-cell,
    .closing-accent-cell {
        grid-column: 1 / -1;
        grid-row: auto;
    }

    .carousel-card {
        flex: 0 0 220px;
        min-height: 240px;
    }

    .section-title {
        font-size: clamp(36px, 12vw, 80px);
    }

    #main-nav {
        padding: 8px 20px;
        gap: 16px;
    }

    .nav-links a {
        font-size: 13px;
    }
}

/* ============================================
   RESPONSIVE — SMALL MOBILE (< 480px)
   ============================================ */
@media (max-width: 479px) {
    .dense-grid {
        grid-template-columns: 1fr;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .hero-icon-cell,
    .hero-tagline-cell,
    .hero-main-cell,
    .hero-orb-cell,
    .hero-scroll-cell {
        grid-column: 1 / -1;
        grid-row: auto;
    }
}
