/* ===========================================================
   PPUZZL.BAR — Bento-box street-style / dopamine-neon
   Palette
     #D4FF00  Acid Yellow   (primary neon)
     #FF4D6A  Electric Coral (secondary neon)
     #00E5C4  Vivid Teal    (tertiary neon)
     #1E1410  Espresso      (ground dark)
     #3D2B1F  Bark Brown    (ground mid / gap color)
     #C24B1A  Terracotta    (ground warm accent)
     #B08A3E  Ochre         (accent earthy)
     #F0E8D8  Warm Cream    (surface light)
   Fonts
     Commissioner (variable, wght 100-900, wdth axis)
=========================================================== */

/* === Google Fonts Import === */
@import url('https://fonts.googleapis.com/css2?family=Commissioner:wght@100..900&display=swap');

/* === CSS Custom Properties === */
:root {
    --yellow: #D4FF00;
    --coral: #FF4D6A;
    --teal: #00E5C4;
    --espresso: #1E1410;
    --bark: #3D2B1F;
    --terracotta: #C24B1A;
    --ochre: #B08A3E;
    --cream: #F0E8D8;

    /* Type system — Commissioner variable axes */
    --font: 'Commissioner', sans-serif;

    /* Hero / banners: condensed heavy */
    --var-hero: 'wght' 900, 'wdth' 75;
    /* Sub-headings: normal weight */
    --var-sub: 'wght' 700, 'wdth' 100;
    /* Body: wide light */
    --var-body: 'wght' 400, 'wdth' 125;
    /* Tags: condensed small */
    --var-tag: 'wght' 500, 'wdth' 75;

    --gap: 4px;
    --border: 2px solid var(--bark);
    --cell-pad: 28px;
}

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

/* === Base === */
html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    background: var(--espresso);
    color: var(--cream);
    font-family: var(--font);
    font-variation-settings: var(--var-body);
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

/* === Cursor Trail SVG === */
#cursor-trail {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: visible;
}

/* === Bento Surface === */
.bento-surface {
    background: var(--espresso);
    min-height: 100vh;
    padding: var(--gap);
}

/* === Bento Grid === */
.bento {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: 300px 120px 240px 320px 100px;
    gap: var(--gap);
    background: var(--bark);
    max-width: 1440px;
    margin: 0 auto;
}

/* === Cell Base === */
.cell {
    position: relative;
    border: var(--border);
    overflow: hidden;
    background: var(--espresso);
    transition: transform 0.3s ease;
}

/* === Cell Placement === */
/* Row 1 */
.cell--hero {
    grid-column: span 4;
    grid-row: 1;
    background: var(--espresso);
}

.cell--sidebar-top {
    grid-column: span 2;
    grid-row: 1;
    /* We'll split row 1 for the sidebar using sub-grid or manual trick */
    /* Actually use a wrapper to split: we split row 1 col 5-6 into two sub-rows */
    /* Achieved by making sidebar-top a single span-2 at half the row height */
    /* We use grid within a wrapper — let's use a nested approach with JS-free CSS */
    /* Override: give sidebar-top 150px, sidebar-bottom 150px but they share row 1 */
    /* Simplest: use align-self start / end with height 50% */
    align-self: start;
    height: 50%;
    border-bottom: none;
}

.cell--sidebar-bottom {
    grid-column: span 2;
    grid-row: 1;
    align-self: end;
    height: 50%;
    border-top: 1px solid var(--bark);
}

/* Row 2 */
.cell--banner {
    grid-column: span 6;
    grid-row: 2;
    background: var(--bark);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Row 3 */
.cell--trio {
    grid-column: span 2;
    grid-row: 3;
}

.cell--trio-1 { background: var(--espresso); }
.cell--trio-2 { background: var(--espresso); }
.cell--trio-3 { background: var(--espresso); }

/* Row 4 */
.cell--feature {
    grid-column: span 3;
    grid-row: 4;
    background: var(--cream);
    color: var(--espresso);
}

.cell--micro-grid {
    grid-column: span 3;
    grid-row: 4;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: var(--gap);
    background: var(--bark);
    padding: 0;
    border: none;
    overflow: visible;
}

/* Row 5 */
.cell--marquee {
    grid-column: span 6;
    grid-row: 5;
    background: var(--espresso);
    display: flex;
    align-items: center;
    overflow: hidden;
}

/* === Cell Content === */
.cell-content {
    position: relative;
    z-index: 2;
    padding: var(--cell-pad);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.cell-content--center {
    align-items: center;
    justify-content: center;
}

/* === Blob Base === */
.blob {
    position: absolute;
    z-index: 1;
    border-radius: 60% 40% 55% 45% / 45% 55% 40% 60%;
    animation: morph 10s ease-in-out infinite alternate;
}

.blob.paused {
    animation-play-state: paused;
}

/* === Blob Variants === */
.blob--yellow {
    background: var(--yellow);
    opacity: 0.85;
}

.blob--coral {
    background: var(--coral);
    opacity: 0.80;
}

.blob--teal {
    background: var(--teal);
    opacity: 0.80;
}

.blob--terracotta {
    background: var(--terracotta);
    opacity: 0.65;
}

/* Hero blob — large, fills most of cell */
#blob-hero {
    width: 90%;
    height: 90%;
    top: -10%;
    left: -5%;
    animation-delay: 0s;
}

/* Static teal blob in sidebar top */
.blob--static {
    animation: none;
    border-radius: 55% 45% 60% 40% / 50% 60% 40% 50%;
}

/* Trio blobs */
.blob--trio {
    width: 85%;
    height: 85%;
    top: -15%;
    left: -10%;
}

#blob-trio-1 { animation-delay: 0s; }
#blob-trio-2 { animation-delay: 3s; }
#blob-trio-3 { animation-delay: 6s; }

/* Feature blob */
.blob--feature {
    width: 60%;
    height: 70%;
    bottom: -20%;
    right: -15%;
    animation-delay: 2s;
    opacity: 0.30;
}

/* === Morph Keyframes === */
@keyframes morph {
    0%   { border-radius: 60% 40% 55% 45% / 45% 55% 40% 60%; }
    33%  { border-radius: 45% 55% 40% 60% / 60% 40% 55% 45%; }
    66%  { border-radius: 55% 45% 60% 40% / 40% 60% 45% 55%; }
    100% { border-radius: 40% 60% 45% 55% / 55% 45% 60% 40%; }
}

/* === Hero Cell Typography === */
.hero-title {
    font-family: var(--font);
    font-variation-settings: var(--var-hero);
    font-size: clamp(64px, 8vw, 108px);
    color: var(--yellow);
    text-transform: uppercase;
    letter-spacing: -0.02em;
    line-height: 0.9;
    margin-bottom: 16px;
}

.hero-sub {
    font-family: var(--font);
    font-variation-settings: var(--var-body);
    font-size: clamp(16px, 1.4vw, 22px);
    color: var(--cream);
    line-height: 1.4;
}

/* === Sidebar === */
.teal-blob-icon {
    width: 80px;
    height: 80px;
}

.puzzle-spin {
    width: 64px;
    height: 64px;
    animation: spin 20s linear infinite;
    display: block;
    margin-bottom: 12px;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.rotating-stat {
    font-family: var(--font);
    font-variation-settings: var(--var-tag);
    font-size: 11px;
    color: var(--ochre);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    text-align: center;
}

/* === Feature Banner Typography === */
.banner-text {
    font-family: var(--font);
    font-variation-settings: var(--var-hero);
    font-size: clamp(28px, 4.5vw, 64px);
    text-transform: uppercase;
    letter-spacing: -0.02em;
    background: linear-gradient(90deg, var(--yellow) 0%, var(--coral) 50%, var(--yellow) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 var(--cell-pad);
}

/* === Trio Cells === */
.puzzle-arc {
    position: absolute;
    width: 40px;
    height: 40px;
    opacity: 0.6;
}

.puzzle-arc--tl { top: 8px; left: 8px; }
.puzzle-arc--tr { top: 8px; right: 8px; }
.puzzle-arc--br { bottom: 8px; right: 8px; }
.puzzle-arc--bl { bottom: 8px; left: 8px; }

.trio-label {
    font-family: var(--font);
    font-variation-settings: var(--var-tag);
    font-size: 11px;
    color: var(--espresso);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    opacity: 0.7;
    margin-bottom: 8px;
}

.trio-title {
    font-family: var(--font);
    font-variation-settings: var(--var-sub);
    font-size: clamp(22px, 2.2vw, 34px);
    text-transform: uppercase;
    letter-spacing: -0.01em;
    line-height: 1.0;
    color: var(--espresso);
    margin-bottom: 12px;
}

.trio-desc {
    font-family: var(--font);
    font-variation-settings: var(--var-body);
    font-size: 13px;
    color: var(--espresso);
    opacity: 0.8;
    line-height: 1.5;
}

/* === Feature Card === */
.cell--feature .cell-content {
    justify-content: center;
    gap: 16px;
}

.feature-heading {
    font-family: var(--font);
    font-variation-settings: var(--var-sub);
    font-size: clamp(18px, 1.8vw, 28px);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--terracotta);
    margin-bottom: 8px;
}

.feature-body {
    font-family: var(--font);
    font-variation-settings: var(--var-body);
    font-size: clamp(13px, 1vw, 15px);
    color: var(--espresso);
    line-height: 1.7;
}

/* === Micro Grid === */
.micro-cell {
    background: var(--espresso);
    border: var(--border);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.micro-label {
    font-family: var(--font);
    font-variation-settings: var(--var-tag);
    font-size: 10px;
    color: var(--ochre);
    text-transform: uppercase;
    letter-spacing: 0.16em;
}

.micro-value {
    font-family: var(--font);
    font-variation-settings: var(--var-body);
    font-size: 12px;
    color: var(--cream);
    line-height: 1.6;
}

.micro-link {
    color: var(--yellow);
    text-decoration: underline;
    text-decoration-color: rgba(212,255,0,0.4);
}

/* === Marquee === */
.marquee-track {
    display: flex;
    overflow: hidden;
    width: 100%;
}

.marquee-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    white-space: nowrap;
    animation: scroll-left 30s linear infinite;
    padding-left: 20px;
}

@keyframes scroll-left {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

.tag {
    font-family: var(--font);
    font-variation-settings: var(--var-tag);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--ochre);
}

.tag-sep {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
}

/* === Parallax cells (applied by JS) === */
.cell {
    will-change: transform;
}

/* === Hover: blob pause via JS-added class === */
/* .blob.paused defined above */

/* === Scrollbar styling === */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--espresso);
}
::-webkit-scrollbar-thumb {
    background: var(--bark);
}

/* === Responsive fallback === */
@media (max-width: 900px) {
    .bento {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto;
    }

    .cell--hero,
    .cell--sidebar-top,
    .cell--sidebar-bottom,
    .cell--banner,
    .cell--trio,
    .cell--feature,
    .cell--micro-grid,
    .cell--marquee {
        grid-column: span 2;
        grid-row: auto;
    }

    .cell--sidebar-top,
    .cell--sidebar-bottom {
        height: auto;
        min-height: 140px;
        align-self: auto;
        border-bottom: var(--border);
        border-top: var(--border);
    }

    .cell--hero,
    .cell--sidebar-top,
    .cell--sidebar-bottom {
        min-height: 180px;
    }

    .cell--trio { min-height: 200px; }
    .cell--feature,
    .cell--micro-grid { min-height: 260px; }
    .cell--marquee { min-height: 80px; }

    .banner-text {
        font-size: 20px;
        white-space: normal;
        text-overflow: clip;
    }
}
