/* ===================================================
   ppzz.lu - Candy-Bright Cyberpunk Bento Grid
   =================================================== */

/* --- Typography: "Space Mono" (Google Fonts), "IBM Plex Mono" (Google Fonts), "Silkscreen" (Google Fonts)
   Easing: spring-approximation easing (cubic-bezier(0.34, 1.56, 0.64, 1))
   IntersectionObserver at 0.15 threshold for triggering cluster animations.
   All animations use requestAnimationFrame for throttling.
   #FFFFFF used at 60% opacity for ghost-white elements. --- */

/* --- CSS Custom Properties --- */
:root {
    --bubblegum: #FF6FB7;
    --electric-mint: #00F5D4;
    --digital-lavender: #B388FF;
    --lemon-fizz: #F9F871;
    --deep-void: #0A0A1A;
    --midnight-ink: #141428;
    --soft-fog: #E8E0F0;
    --ghost-white: rgba(255, 255, 255, 0.6); /* #FFFFFF at 60% opacity */
    --cell-gap: 2px;
    --accent-primary: #FF6FB7;
    --accent-glow: rgba(255, 111, 183, 0.3);
    --spring-ease: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
    scroll-behavior: smooth;
    background: var(--deep-void);
}

body {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 16px;
    line-height: 1.7;
    color: var(--soft-fog);
    background: var(--deep-void);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- Scanline Overlay --- */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 3px,
        rgba(255, 255, 255, 0.04) 3px,
        rgba(255, 255, 255, 0.04) 4px
    );
    animation: scanline-scroll 120s linear infinite;
}

@keyframes scanline-scroll {
    0% { transform: translateY(0); }
    100% { transform: translateY(100vh); }
}

/* --- Scroll Progress Oscilloscope --- */
.scroll-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 20px;
    z-index: 999;
    opacity: 0.8;
}

.oscilloscope {
    width: 100%;
    height: 100%;
}

.wave-path {
    transition: d 0.3s ease;
}

/* --- Particles --- */
#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    opacity: 0.2;
    animation: particle-rise linear infinite;
    will-change: transform;
}

@keyframes particle-rise {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.2;
    }
    90% {
        opacity: 0.2;
    }
    100% {
        transform: translateY(-20px) rotate(180deg);
        opacity: 0;
    }
}

/* --- Ambient Ripples --- */
#ambient-ripples {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 4;
    overflow: hidden;
}

.ambient-ripple {
    position: absolute;
    border-radius: 50%;
    border: 1px solid var(--digital-lavender);
    opacity: 0;
    animation: ambient-ripple-expand 2s ease-out forwards;
    will-change: transform, opacity;
}

@keyframes ambient-ripple-expand {
    0% {
        transform: scale(0);
        opacity: 0.08;
    }
    100% {
        transform: scale(8);
        opacity: 0;
    }
}

/* --- Bento Wall --- */
.bento-wall {
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 16px;
}

/* --- Wave Separators --- */
.wave-separator {
    display: block;
    width: 100%;
    height: 20px;
    margin-bottom: 24px;
    opacity: 0.5;
}

.wave-line {
    animation: wave-undulate 6s ease-in-out infinite alternate;
}

@keyframes wave-undulate {
    0% { transform: translateX(0); }
    100% { transform: translateX(-20px); }
}

/* --- Bento Grid --- */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--cell-gap);
    margin-bottom: 48px;
}

/* --- Bento Cluster --- */
.bento-cluster {
    margin-bottom: 0;
}

/* --- Cell Base Styles --- */
.cell {
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(2px);
    transition: box-shadow 0.4s ease;
}

/* --- Ghost Cells --- */
.ghost-cell {
    opacity: 0;
    background: rgba(179, 136, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.03);
    min-height: 80px;
}

.ghost-cell.revealed {
    opacity: 0.15;
    transition: opacity 0.3s ease;
}

.ghost-grid-lines {
    width: 100%;
    height: 100%;
    background:
        repeating-linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.05) 0px,
            rgba(255, 255, 255, 0.05) 1px,
            transparent 1px,
            transparent 20px
        ),
        repeating-linear-gradient(
            0deg,
            rgba(255, 255, 255, 0.05) 0px,
            rgba(255, 255, 255, 0.05) 1px,
            transparent 1px,
            transparent 20px
        );
}

.ghost-glitch-fragment {
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(255, 111, 183, 0.05) 0%,
        transparent 40%,
        rgba(0, 245, 212, 0.03) 60%,
        transparent 100%
    );
}

.ghost-glitch-fragment.frag-2 {
    background: linear-gradient(
        225deg,
        rgba(0, 245, 212, 0.05) 0%,
        transparent 40%,
        rgba(179, 136, 255, 0.03) 60%,
        transparent 100%
    );
}

.ghost-glitch-fragment.frag-3 {
    background: linear-gradient(
        45deg,
        rgba(179, 136, 255, 0.05) 0%,
        transparent 50%,
        rgba(249, 248, 113, 0.03) 80%,
        transparent 100%
    );
}

.ghost-glitch-fragment.frag-4 {
    background: linear-gradient(
        315deg,
        rgba(249, 248, 113, 0.05) 0%,
        transparent 40%,
        rgba(255, 111, 183, 0.03) 70%,
        transparent 100%
    );
}

/* --- Data Cells --- */
.data-cell {
    background: var(--midnight-ink);
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 8px;
    min-height: 100px;
    box-shadow: 0 0 8px 1px var(--accent-glow);
    opacity: 0;
    transform: translateX(20px);
}

.data-cell.revealed {
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.4s ease, transform 0.4s var(--spring-ease);
}

.data-label {
    font-family: 'Silkscreen', cursive;
    font-size: 12px;
    color: var(--ghost-white);
    opacity: 0.5;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}

.data-value {
    font-family: 'Space Mono', monospace;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-primary);
    letter-spacing: 0.04em;
}

.data-unit {
    font-size: 0.7em;
    opacity: 0.6;
    margin-left: 2px;
}

/* Color cycle animation for data values */
.color-cycle {
    animation: color-shift 12s ease-in-out infinite;
}

@keyframes color-shift {
    0%, 100% { color: var(--accent-primary); }
    25% { color: var(--electric-mint); }
    50% { color: var(--digital-lavender); }
    75% { color: var(--lemon-fizz); }
}

/* --- Window Cells --- */
.window-cell {
    background: var(--midnight-ink);
    border: 1px solid var(--electric-mint);
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 120px;
    box-shadow: 0 0 8px 1px var(--accent-glow);
    opacity: 0;
    transform: scale(0.85);
}

.window-cell.revealed {
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.5s ease, transform 0.5s var(--spring-ease);
}

.silkscreen-label {
    font-family: 'Silkscreen', cursive;
    font-size: 12px;
    color: var(--ghost-white);
    opacity: 0.4;
    display: block;
    margin-top: 8px;
}

/* Waveform SVG */
.waveform-animation {
    flex: 1;
    display: flex;
    align-items: center;
}

.waveform-svg {
    width: 100%;
    height: 40px;
}

.waveform-path, .waveform-path-alt {
    animation: waveform-drift 4s ease-in-out infinite alternate;
}

@keyframes waveform-drift {
    0% { transform: translateX(0); }
    100% { transform: translateX(-10px); }
}

/* Glitch Panel */
.glitch-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    justify-content: center;
}

.glitch-bar {
    height: 4px;
    background: var(--bubblegum);
    opacity: 0.6;
    animation: glitch-bar-shift 8s ease-in-out infinite;
}

.glitch-bar.bar-1 { width: 80%; animation-delay: 0s; }
.glitch-bar.bar-2 { width: 60%; animation-delay: 0.5s; }
.glitch-bar.bar-3 { width: 90%; animation-delay: 1s; }
.glitch-bar.bar-4 { width: 45%; animation-delay: 1.5s; }
.glitch-bar.bar-5 { width: 70%; animation-delay: 2s; }

@keyframes glitch-bar-shift {
    0%, 48%, 52%, 100% { transform: translateX(0); opacity: 0.6; }
    50% { transform: translateX(6px); opacity: 0.9; }
}

.panel-mint .glitch-bar { background: var(--electric-mint); }
.panel-lavender .glitch-bar { background: var(--digital-lavender); }
.panel-yellow .glitch-bar { background: var(--lemon-fizz); }

.glitch-stripe {
    height: 6px;
    opacity: 0.5;
    animation: glitch-stripe-flicker 10s ease-in-out infinite;
}

.glitch-stripe.stripe-1 {
    background: linear-gradient(90deg, var(--electric-mint), transparent);
    width: 75%;
    animation-delay: 0s;
}

.glitch-stripe.stripe-2 {
    background: linear-gradient(90deg, var(--digital-lavender), transparent);
    width: 90%;
    animation-delay: 2s;
}

.glitch-stripe.stripe-3 {
    background: linear-gradient(90deg, var(--bubblegum), transparent);
    width: 55%;
    animation-delay: 4s;
}

.panel-mint .glitch-stripe.stripe-1 { background: linear-gradient(90deg, var(--electric-mint), transparent); }
.panel-mint .glitch-stripe.stripe-2 { background: linear-gradient(90deg, var(--bubblegum), transparent); }
.panel-mint .glitch-stripe.stripe-3 { background: linear-gradient(90deg, var(--lemon-fizz), transparent); }

.panel-yellow .glitch-stripe.stripe-1 { background: linear-gradient(90deg, var(--lemon-fizz), transparent); }
.panel-yellow .glitch-stripe.stripe-2 { background: linear-gradient(90deg, var(--bubblegum), transparent); }
.panel-yellow .glitch-stripe.stripe-3 { background: linear-gradient(90deg, var(--electric-mint), transparent); }

@keyframes glitch-stripe-flicker {
    0%, 45%, 55%, 100% { transform: translateX(0); opacity: 0.5; }
    50% { transform: translateX(-4px); opacity: 0.8; }
}

/* --- Portal Cells --- */
.portal-cell {
    background: var(--midnight-ink);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 250px;
    box-shadow: 0 0 12px 2px var(--accent-glow);
    opacity: 0;
}

.portal-cell.revealed {
    opacity: 1;
    transition: opacity 0.6s ease;
}

.portal-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(255, 111, 183, 0.12) 0%, transparent 70%);
    z-index: 0;
}

.portal-bg.bg-mint {
    background: radial-gradient(ellipse at center, rgba(0, 245, 212, 0.12) 0%, transparent 70%);
}

.portal-bg.bg-lavender {
    background: radial-gradient(ellipse at center, rgba(179, 136, 255, 0.12) 0%, transparent 70%);
}

.portal-bg.bg-yellow {
    background: radial-gradient(ellipse at center, rgba(249, 248, 113, 0.10) 0%, transparent 70%);
}

.noise-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.08;
    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 baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-size: 128px 128px;
    z-index: 1;
    pointer-events: none;
}

/* Ripple on scroll-enter */
.ripple-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}

.portal-ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin-top: -20px;
    margin-left: -20px;
    border-radius: 50%;
    border: 2px solid var(--accent-primary);
    opacity: 0.4;
    animation: portal-ripple-expand 1.2s ease-out forwards;
    will-change: transform, opacity;
}

@keyframes portal-ripple-expand {
    0% {
        transform: scale(0);
        opacity: 0.4;
    }
    100% {
        transform: scale(12);
        opacity: 0;
    }
}

/* Chromatic aberration text */
.chromatic-wrapper {
    position: relative;
    z-index: 3;
    font-family: 'Space Mono', monospace;
    font-size: clamp(2rem, 5vw + 0.5rem, 5rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.2;
}

.chromatic-wrapper.chromatic-small {
    font-size: clamp(1.5rem, 4vw + 0.3rem, 3.5rem);
}

.chromatic-layer {
    display: block;
}

.chromatic-layer.layer-pink {
    position: absolute;
    top: 0;
    left: 0;
    color: var(--bubblegum);
    opacity: 0.5;
    animation: drift-rgb-pink 10s ease-in-out infinite alternate;
    will-change: transform;
}

.chromatic-layer.layer-mint {
    position: absolute;
    top: 0;
    left: 0;
    color: var(--electric-mint);
    opacity: 0.5;
    animation: drift-rgb-mint 8s ease-in-out infinite alternate;
    will-change: transform;
}

.chromatic-layer.layer-base {
    position: relative;
    color: var(--soft-fog);
    z-index: 1;
}

@keyframes drift-rgb-pink {
    0% { transform: translate(-3px, -2px); }
    25% { transform: translate(2px, -3px); }
    50% { transform: translate(-2px, 3px); }
    75% { transform: translate(3px, 1px); }
    100% { transform: translate(-1px, -2px); }
}

@keyframes drift-rgb-mint {
    0% { transform: translate(3px, 2px); }
    25% { transform: translate(-2px, 3px); }
    50% { transform: translate(2px, -2px); }
    75% { transform: translate(-3px, -1px); }
    100% { transform: translate(1px, 2px); }
}

.portal-sub {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 14px;
    color: var(--ghost-white);
    opacity: 0.6;
    margin-top: 16px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    z-index: 3;
    position: relative;
    animation: bob-float 6s ease-in-out infinite;
}

.portal-text {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 16px;
    line-height: 1.8;
    color: var(--soft-fog);
    z-index: 3;
    position: relative;
    animation: bob-float 8s ease-in-out infinite;
}

.portal-text.portal-text-small {
    font-size: 14px;
    opacity: 0.8;
    margin-top: 16px;
}

.portal-tag {
    font-family: 'Silkscreen', cursive;
    font-size: 12px;
    color: var(--accent-primary);
    opacity: 0.4;
    margin-top: 20px;
    z-index: 3;
    position: relative;
}

@keyframes bob-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* --- Glitch Slip Micro-Animation --- */
@keyframes glitch-slip {
    0%, 48%, 52%, 100% {
        transform: translateX(0);
        filter: none;
    }
    50% {
        transform: translateX(4px);
        filter: hue-rotate(90deg);
    }
}

.data-cell:nth-child(3n+1) .data-value {
    animation: color-shift 12s ease-in-out infinite, glitch-slip 18s ease-in-out infinite;
}

.data-cell:nth-child(3n+2) .data-value {
    animation: color-shift 12s ease-in-out infinite, glitch-slip 22s ease-in-out infinite;
    animation-delay: 0s, 5s;
}

.data-cell:nth-child(3n) .data-value {
    animation: color-shift 12s ease-in-out infinite, glitch-slip 26s ease-in-out infinite;
    animation-delay: 0s, 12s;
}

/* --- Hover Ripple on Data/Window Cells --- */
.data-cell .hover-ripple,
.window-cell .hover-ripple {
    position: absolute;
    border-radius: 50%;
    border: 1px solid var(--electric-mint);
    opacity: 0;
    pointer-events: none;
    animation: hover-ripple-expand 0.8s ease-out forwards;
    will-change: transform, opacity;
}

@keyframes hover-ripple-expand {
    0% {
        transform: scale(0);
        opacity: 0.4;
    }
    100% {
        transform: scale(6);
        opacity: 0;
    }
}

/* ===================================================
   GRID LAYOUTS PER CLUSTER
   =================================================== */

/* Cluster 1: Pink */
.cluster-1 .c1-ghost-1  { grid-column: 1 / 3;   grid-row: 1; }
.cluster-1 .c1-portal-1 { grid-column: 3 / 9;   grid-row: 1 / 3; }
.cluster-1 .c1-data-1   { grid-column: 9 / 11;  grid-row: 1; }
.cluster-1 .c1-data-2   { grid-column: 11 / 13; grid-row: 1; }
.cluster-1 .c1-window-1 { grid-column: 1 / 5;   grid-row: 2; }
.cluster-1 .c1-ghost-2  { grid-column: 9 / 10;  grid-row: 2; }
.cluster-1 .c1-data-3   { grid-column: 10 / 11; grid-row: 2; }
.cluster-1 .c1-window-2 { grid-column: 11 / 13; grid-row: 2; min-height: 100px; }
.cluster-1 .c1-data-4   { grid-column: 5 / 9;   grid-row: 3; min-height: 80px; }

/* Cluster 2: Mint */
.cluster-2 .c2-data-1   { grid-column: 1 / 3;   grid-row: 1; }
.cluster-2 .c2-window-1 { grid-column: 3 / 7;   grid-row: 1; }
.cluster-2 .c2-ghost-1  { grid-column: 7 / 9;   grid-row: 1; }
.cluster-2 .c2-portal-1 { grid-column: 9 / 13;  grid-row: 1 / 3; }
.cluster-2 .c2-data-2   { grid-column: 1 / 3;   grid-row: 2; }
.cluster-2 .c2-data-3   { grid-column: 3 / 5;   grid-row: 2; }
.cluster-2 .c2-window-2 { grid-column: 5 / 9;   grid-row: 2; }
.cluster-2 .c2-ghost-2  { grid-column: 1 / 3;   grid-row: 3; }
.cluster-2 .c2-data-4   { grid-column: 3 / 5;   grid-row: 3; min-height: 80px; }

/* Cluster 3: Lavender */
.cluster-3 .c3-window-1 { grid-column: 1 / 5;   grid-row: 1; }
.cluster-3 .c3-data-1   { grid-column: 5 / 7;   grid-row: 1; }
.cluster-3 .c3-portal-1 { grid-column: 7 / 13;  grid-row: 1 / 3; }
.cluster-3 .c3-ghost-1  { grid-column: 1 / 3;   grid-row: 2; }
.cluster-3 .c3-data-2   { grid-column: 3 / 5;   grid-row: 2; }
.cluster-3 .c3-data-3   { grid-column: 5 / 7;   grid-row: 2; }
.cluster-3 .c3-window-2 { grid-column: 1 / 7;   grid-row: 3; min-height: 100px; }
.cluster-3 .c3-ghost-2  { grid-column: 7 / 9;   grid-row: 3; }
.cluster-3 .c3-data-4   { grid-column: 9 / 13;  grid-row: 3; min-height: 80px; }

/* Cluster 4: Yellow */
.cluster-4 .c4-ghost-1  { grid-column: 1 / 3;   grid-row: 1; }
.cluster-4 .c4-data-1   { grid-column: 3 / 5;   grid-row: 1; }
.cluster-4 .c4-window-1 { grid-column: 5 / 9;   grid-row: 1; }
.cluster-4 .c4-portal-1 { grid-column: 9 / 13;  grid-row: 1 / 3; }
.cluster-4 .c4-data-2   { grid-column: 1 / 3;   grid-row: 2; }
.cluster-4 .c4-window-2 { grid-column: 3 / 7;   grid-row: 2; }
.cluster-4 .c4-data-3   { grid-column: 7 / 9;   grid-row: 2; }
.cluster-4 .c4-ghost-2  { grid-column: 1 / 3;   grid-row: 3; }
.cluster-4 .c4-data-4   { grid-column: 3 / 5;   grid-row: 3; min-height: 80px; }

/* Cluster 5: Pink repeat */
.cluster-5 .c5-data-1   { grid-column: 1 / 3;   grid-row: 1; }
.cluster-5 .c5-portal-1 { grid-column: 3 / 9;   grid-row: 1 / 3; }
.cluster-5 .c5-ghost-1  { grid-column: 9 / 11;  grid-row: 1; }
.cluster-5 .c5-window-1 { grid-column: 11 / 13; grid-row: 1; min-height: 100px; }
.cluster-5 .c5-data-2   { grid-column: 1 / 3;   grid-row: 2; }
.cluster-5 .c5-data-3   { grid-column: 9 / 11;  grid-row: 2; }
.cluster-5 .c5-window-2 { grid-column: 1 / 5;   grid-row: 3; min-height: 100px; }
.cluster-5 .c5-ghost-2  { grid-column: 5 / 7;   grid-row: 3; }
.cluster-5 .c5-data-4   { grid-column: 7 / 9;   grid-row: 3; min-height: 80px; }

/* ===================================================
   TABLET (max 900px) - 6 columns
   =================================================== */
@media (max-width: 900px) {
    .bento-grid {
        grid-template-columns: repeat(6, 1fr);
    }

    /* Cluster 1 */
    .cluster-1 .c1-ghost-1  { grid-column: 1 / 2;  grid-row: 1; }
    .cluster-1 .c1-portal-1 { grid-column: 2 / 6;  grid-row: 1 / 3; }
    .cluster-1 .c1-data-1   { grid-column: 6 / 7;  grid-row: 1; }
    .cluster-1 .c1-data-2   { grid-column: 6 / 7;  grid-row: 2; }
    .cluster-1 .c1-window-1 { grid-column: 1 / 4;  grid-row: 3; }
    .cluster-1 .c1-ghost-2  { grid-column: 4 / 5;  grid-row: 3; }
    .cluster-1 .c1-data-3   { grid-column: 5 / 6;  grid-row: 3; }
    .cluster-1 .c1-window-2 { grid-column: 1 / 4;  grid-row: 4; }
    .cluster-1 .c1-data-4   { grid-column: 4 / 7;  grid-row: 4; }

    /* Cluster 2 */
    .cluster-2 .c2-data-1   { grid-column: 1 / 3;  grid-row: 1; }
    .cluster-2 .c2-window-1 { grid-column: 3 / 7;  grid-row: 1; }
    .cluster-2 .c2-ghost-1  { grid-column: 1 / 2;  grid-row: 2; }
    .cluster-2 .c2-portal-1 { grid-column: 2 / 7;  grid-row: 2 / 4; }
    .cluster-2 .c2-data-2   { grid-column: 1 / 2;  grid-row: 3; }
    .cluster-2 .c2-data-3   { grid-column: 1 / 3;  grid-row: 4; }
    .cluster-2 .c2-window-2 { grid-column: 3 / 7;  grid-row: 4; }
    .cluster-2 .c2-ghost-2  { grid-column: 1 / 3;  grid-row: 5; }
    .cluster-2 .c2-data-4   { grid-column: 3 / 5;  grid-row: 5; }

    /* Cluster 3 */
    .cluster-3 .c3-window-1 { grid-column: 1 / 4;  grid-row: 1; }
    .cluster-3 .c3-data-1   { grid-column: 4 / 7;  grid-row: 1; }
    .cluster-3 .c3-portal-1 { grid-column: 1 / 5;  grid-row: 2 / 4; }
    .cluster-3 .c3-ghost-1  { grid-column: 5 / 7;  grid-row: 2; }
    .cluster-3 .c3-data-2   { grid-column: 5 / 7;  grid-row: 3; }
    .cluster-3 .c3-data-3   { grid-column: 5 / 7;  grid-row: 4; }
    .cluster-3 .c3-window-2 { grid-column: 1 / 5;  grid-row: 4; }
    .cluster-3 .c3-ghost-2  { grid-column: 1 / 3;  grid-row: 5; }
    .cluster-3 .c3-data-4   { grid-column: 3 / 7;  grid-row: 5; }

    /* Cluster 4 */
    .cluster-4 .c4-ghost-1  { grid-column: 1 / 2;  grid-row: 1; }
    .cluster-4 .c4-data-1   { grid-column: 2 / 4;  grid-row: 1; }
    .cluster-4 .c4-window-1 { grid-column: 4 / 7;  grid-row: 1; }
    .cluster-4 .c4-portal-1 { grid-column: 1 / 5;  grid-row: 2 / 4; }
    .cluster-4 .c4-data-2   { grid-column: 5 / 7;  grid-row: 2; }
    .cluster-4 .c4-window-2 { grid-column: 5 / 7;  grid-row: 3; }
    .cluster-4 .c4-data-3   { grid-column: 1 / 3;  grid-row: 4; }
    .cluster-4 .c4-ghost-2  { grid-column: 3 / 5;  grid-row: 4; }
    .cluster-4 .c4-data-4   { grid-column: 5 / 7;  grid-row: 4; }

    /* Cluster 5 */
    .cluster-5 .c5-data-1   { grid-column: 1 / 3;  grid-row: 1; }
    .cluster-5 .c5-portal-1 { grid-column: 3 / 7;  grid-row: 1 / 3; }
    .cluster-5 .c5-ghost-1  { grid-column: 1 / 3;  grid-row: 2; }
    .cluster-5 .c5-window-1 { grid-column: 1 / 4;  grid-row: 3; }
    .cluster-5 .c5-data-2   { grid-column: 4 / 5;  grid-row: 3; }
    .cluster-5 .c5-data-3   { grid-column: 5 / 7;  grid-row: 3; }
    .cluster-5 .c5-window-2 { grid-column: 1 / 4;  grid-row: 4; }
    .cluster-5 .c5-ghost-2  { grid-column: 4 / 5;  grid-row: 4; }
    .cluster-5 .c5-data-4   { grid-column: 5 / 7;  grid-row: 4; }
}

/* ===================================================
   MOBILE (max 600px) - 2 columns
   =================================================== */
@media (max-width: 600px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Ghost cells collapse on mobile */
    .ghost-cell {
        display: none;
    }

    /* Portal cells full-width */
    .portal-cell {
        grid-column: 1 / -1 !important;
        grid-row: auto !important;
        min-height: 200px;
    }

    /* Window cells full-width */
    .window-cell {
        grid-column: 1 / -1 !important;
        grid-row: auto !important;
    }

    /* Data cells 1-col each */
    .data-cell {
        grid-column: auto !important;
        grid-row: auto !important;
    }

    .chromatic-wrapper {
        font-size: clamp(1.5rem, 8vw, 3rem);
    }

    /* Disable chromatic aberration on mobile for performance */
    .chromatic-layer.layer-pink,
    .chromatic-layer.layer-mint {
        display: none;
    }

    /* Simplify glitch to opacity flicker */
    @keyframes glitch-slip {
        0%, 48%, 52%, 100% { opacity: 1; transform: none; filter: none; }
        50% { opacity: 0.7; transform: none; filter: none; }
    }

    .bento-wall {
        padding: 24px 8px;
    }
}

/* --- Background wave-form decoration in portal cells --- */
.portal-cell::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 200%;
    background:
        repeating-linear-gradient(
            0deg,
            transparent 0px,
            transparent 30px,
            rgba(179, 136, 255, 0.03) 30px,
            rgba(179, 136, 255, 0.03) 31px
        );
    animation: bg-wave-scroll 20s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes bg-wave-scroll {
    0% { transform: translateY(0); }
    100% { transform: translateY(-50%); }
}
