/* ============================================
   ROOT & PALETTE
   ============================================ */
:root {
    --bg-deep: #120E1A;
    --bg-surface: #1E1728;
    --neon-magenta: #E05AFF;
    --neon-cyan: #00E5CC;
    --neon-yellow: #D4FF00;
    --text-primary: #E8E2D8;
    --text-secondary: #8B7FA0;
    --border-color: #5A4E6B;
    --grain-opacity: 0.08;
    --leather-dark: #3A2E28;
    --leather-darker: #2A1F1B;
}

/* ============================================
   GLOBAL RESET & BODY
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg-deep);
    color: var(--text-primary);
    font-family: "Work Sans", sans-serif;
    font-size: 16px;
    line-height: 1.7;
    overflow-x: hidden;
    position: relative;
}

/* GRAIN OVERLAY - Global texture */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' seed='1'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23noiseFilter)' opacity='1'/%3E%3C/svg%3E");
    background-size: 100px 100px;
    pointer-events: none;
    mix-blend-mode: overlay;
    opacity: var(--grain-opacity);
    z-index: 9999;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1 {
    font-family: "Bebas Neue", sans-serif;
    font-size: clamp(3rem, 7vw, 6rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

h2 {
    font-family: "Bebas Neue", sans-serif;
    font-size: clamp(1.5rem, 5vw, 3rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

h3 {
    font-family: "Bebas Neue", sans-serif;
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

p {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

code {
    font-family: "Fira Mono", monospace;
    font-size: 13px;
    color: var(--neon-magenta);
    background: rgba(224, 90, 255, 0.1);
    padding: 2px 6px;
    border-radius: 2px;
}

pre {
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

pre code {
    background: none;
    padding: 0;
    color: var(--neon-magenta);
}

/* ============================================
   BENTO GRID SYSTEM
   ============================================ */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: auto;
    gap: 3px;
    background: var(--bg-deep);
    padding: 3px;
    min-height: 100vh;
    align-items: stretch;
}

.bento-cell {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    position: relative;
    overflow: hidden;
    animation: cellEntrance 0.6s ease-out both;
}

/* Stagger animation for cells */
.bento-grid:nth-child(1) .bento-cell:nth-child(1) { animation-delay: 0ms; }
.bento-grid:nth-child(1) .bento-cell:nth-child(2) { animation-delay: 60ms; }
.bento-grid:nth-child(1) .bento-cell:nth-child(3) { animation-delay: 120ms; }
.bento-grid:nth-child(2) .bento-cell:nth-child(1) { animation-delay: 60ms; }
.bento-grid:nth-child(2) .bento-cell:nth-child(2) { animation-delay: 120ms; }
.bento-grid:nth-child(2) .bento-cell:nth-child(3) { animation-delay: 180ms; }
.bento-grid:nth-child(2) .bento-cell:nth-child(4) { animation-delay: 240ms; }
.bento-grid:nth-child(2) .bento-cell:nth-child(5) { animation-delay: 300ms; }
.bento-grid:nth-child(3) .bento-cell:nth-child(1) { animation-delay: 60ms; }
.bento-grid:nth-child(3) .bento-cell:nth-child(2) { animation-delay: 120ms; }
.bento-grid:nth-child(3) .bento-cell:nth-child(3) { animation-delay: 180ms; }
.bento-grid:nth-child(3) .bento-cell:nth-child(4) { animation-delay: 240ms; }
.bento-grid:nth-child(4) .bento-cell { animation-delay: 60ms; }
.bento-grid:nth-child(5) .bento-cell { animation-delay: 60ms; }

@keyframes cellEntrance {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   SPECIAL CELL TYPES
   ============================================ */

/* HERO TITLE CELL */
.hero-title {
    background: linear-gradient(135deg, var(--bg-surface) 0%, rgba(30, 23, 40, 0.95) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 3rem;
}

.hero-title h1 {
    font-size: clamp(4rem, 10vw, 7rem);
    margin-bottom: 0.5rem;
}

.hero-title .subtitle {
    font-size: clamp(1rem, 2vw, 1.5rem);
    color: var(--neon-cyan);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

/* AURORA ACCENT CELL */
.aurora-accent {
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: visible;
    min-height: 150px;
}

.aurora-accent::before {
    content: "";
    position: absolute;
    top: -50%;
    left: 0;
    right: 0;
    height: 200%;
    background: linear-gradient(90deg, transparent 0%, rgba(224, 90, 255, 0.08) 25%, transparent 50%, rgba(0, 229, 204, 0.08) 75%, transparent 100%);
    animation: auroraShift 15s ease-in-out infinite;
    pointer-events: none;
}

@keyframes auroraShift {
    0%, 100% {
        transform: translateX(-100%);
    }
    50% {
        transform: translateX(100%);
    }
}

.neon-label {
    font-family: "Fira Mono", monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--neon-cyan);
    position: relative;
    z-index: 1;
}

/* LEATHER TEXTURE CELL */
.leather-bg {
    background:
        radial-gradient(circle at 20% 30%, rgba(58, 46, 40, 0.04) 0%, transparent 3%),
        radial-gradient(circle at 60% 70%, rgba(42, 31, 27, 0.04) 0%, transparent 3%),
        radial-gradient(circle at 80% 20%, rgba(58, 46, 40, 0.04) 0%, transparent 3%),
        radial-gradient(circle at 40% 80%, rgba(42, 31, 27, 0.04) 0%, transparent 3%),
        var(--bg-surface);
    background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%;
}

/* CODE BLOCK CELL */
.code-block {
    background: linear-gradient(135deg, rgba(224, 90, 255, 0.05) 0%, var(--bg-surface) 100%);
}

/* SMALL STATEMENT CELL */
.small-statement {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    text-align: right;
}

.small-statement p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* STAT ACCENT CELL */
.stat-accent {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.stat-number {
    font-family: "Bebas Neue", sans-serif;
    font-size: 3rem;
    color: var(--neon-yellow);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-label {
    font-family: "Fira Mono", monospace;
    font-size: 10px;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.1em;
}

/* MANIFESTO CELL */
.manifesto {
    background: linear-gradient(135deg, rgba(0, 229, 204, 0.05) 0%, var(--bg-surface) 100%);
}

.manifesto ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.manifesto li {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-primary);
}

.manifesto li::before {
    content: "▸";
    position: absolute;
    left: 0;
    color: var(--neon-magenta);
    font-size: 1.2rem;
}

/* QUOTE CELL */
.quote {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--neon-cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.5rem;
}

/* BADGE ACCENT CELL */
.badge-accent {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
}

.neon-badge {
    font-family: "Bebas Neue", sans-serif;
    font-size: clamp(1rem, 2vw, 1.5rem);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--neon-magenta);
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--neon-magenta);
    background: transparent;
    box-shadow: inset 0 0 10px rgba(224, 90, 255, 0.2);
}

/* HALFTONE ACCENT CELL */
.halftone-accent {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.halftone-pattern {
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, var(--neon-yellow) 3px, transparent 3px),
                radial-gradient(circle, var(--neon-magenta) 2px, transparent 2px),
                radial-gradient(circle, var(--neon-cyan) 1px, transparent 1px);
    background-size: 12px 12px, 18px 18px, 24px 24px;
    background-position: 0 0, 6px 6px, 12px 12px;
    opacity: 0.6;
}

/* CLOSING CELL */
.closing {
    background: linear-gradient(to right, rgba(224, 90, 255, 0.08), rgba(0, 229, 204, 0.08));
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 100vh;
}

.closing p {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    max-width: 600px;
    line-height: 1.9;
}

/* ============================================
   PULSE ATTENTION EFFECT
   ============================================ */
.pulse-attention {
    position: relative;
    color: var(--neon-magenta);
    font-weight: 600;
    display: inline-block;
    animation: pulseGlow 3s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        text-shadow: 0 0 0 rgba(224, 90, 255, 0),
                     0 0 0 rgba(224, 90, 255, 0);
    }
    50% {
        text-shadow: 0 0 20px rgba(224, 90, 255, 0.4),
                     0 0 40px rgba(224, 90, 255, 0.2);
    }
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 1024px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2px;
        padding: 2px;
    }

    .bento-cell {
        grid-column: span 1 !important;
        grid-row: span 1 !important;
        padding: 1.5rem;
    }

    .hero-title {
        grid-column: 1 / -1 !important;
        grid-row: span 1 !important;
    }

    h1 {
        font-size: clamp(2.5rem, 6vw, 4rem);
    }

    h2 {
        font-size: clamp(1.2rem, 4vw, 2rem);
    }
}

@media (max-width: 640px) {
    .bento-grid {
        grid-template-columns: 1fr;
        gap: 2px;
        padding: 2px;
        min-height: auto;
    }

    .bento-cell {
        grid-column: span 1 !important;
        grid-row: span 1 !important;
        padding: 1rem;
    }

    h1 {
        font-size: clamp(2rem, 5vw, 3rem);
    }

    h2 {
        font-size: clamp(1rem, 3vw, 1.5rem);
    }

    .stat-number {
        font-size: 2rem;
    }

    .quote {
        font-size: 1rem;
    }
}

/* ============================================
   LINK & INTERACTION STATES
   ============================================ */
a {
    color: var(--neon-cyan);
    text-decoration: none;
    position: relative;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--neon-magenta);
    text-shadow: 0 0 10px rgba(224, 90, 255, 0.5);
}

/* ============================================
   SCROLL VELOCITY GRAIN RESPONSE
   ============================================ */
body.scrolling-fast {
    --grain-opacity: 0.15;
}
