* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0d0d12;
    --bg-card: #14141c;
    --accent-primary: #6b5ce7;
    --accent-secondary: #4a42b0;
    --text-primary: #c8c8d4;
    --text-secondary: #5a5a70;
    --flare-highlight: #8b7cf7;
    --border: #2a2a38;
    --danger: #e74c6b;
    --surface-dark: #1a1a28;
    --surface-mid: #3d3d4a;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: clamp(0.875rem, 1.2vw, 1.05rem);
    letter-spacing: 0.01em;
    line-height: 1.65;
    overflow-x: hidden;
}

/* Lens Flare */
.lens-flare {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1;
    background:
        radial-gradient(circle at 75% 15%, #6b5ce720 0%, transparent 35%),
        radial-gradient(circle at 72% 18%, #8b7cf710 0%, transparent 50%),
        radial-gradient(circle at 78% 12%, #4a42b008 0%, transparent 65%);
    transition: opacity 0.5s ease;
}

/* Navigation */
.nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    background: rgba(13, 13, 18, 0.92);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 100;
}

.nav-wordmark {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: 18px;
    color: var(--text-primary);
    letter-spacing: 0.08em;
    text-transform: lowercase;
}

.nav-hamburger {
    display: flex;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
}

.nav-hamburger span {
    display: block;
    width: 24px;
    height: 1px;
    background: var(--text-primary);
}

/* Hero */
.hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.hero-wordmark {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(3.5rem, 8vw, 6rem);
    letter-spacing: 0.12em;
    text-transform: lowercase;
    color: var(--text-primary);
    opacity: 0;
}

.hero-tagline {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: 0.75rem;
    color: var(--text-secondary);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-top: 1.5rem;
    position: relative;
    opacity: 0;
}

.hero-tagline .glitch-band {
    position: absolute;
    left: -4px;
    right: -4px;
    top: 50%;
    height: 2px;
    background: var(--danger);
    opacity: 0.4;
    animation: glitchJitter 3000ms infinite;
}

/* Grid Sections */
.grid-section {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: clamp(2px, 0.5vw, 6px);
    padding: clamp(2px, 0.5vw, 6px);
    position: relative;
    z-index: 2;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.grid-section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: 0;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    will-change: transform;
    transition: transform 400ms cubic-bezier(0.25, 0.46, 0.45, 0.94), background 200ms ease;
}

.card:hover {
    transform: translateY(-2px);
    background: var(--surface-dark);
}

.card.span-2 {
    grid-column: span 2;
}

/* Void Cards */
.void-card {
    background: transparent;
    border: 1px solid rgba(61, 61, 74, 0.15);
}

.void-card:hover {
    background: transparent;
}

/* Word Cards */
.word-card {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(2.8rem, 6vw, 5.5rem);
    letter-spacing: 0.08em;
    line-height: 1.08;
    text-transform: lowercase;
    color: var(--text-primary);
}

/* Text Cards */
.text-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 2rem;
    gap: 1rem;
}

.text-card p {
    color: #a8a8b8;
    line-height: 1.65;
}

.card-label {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--text-secondary);
}

/* Pattern Cards */
.pattern-card {
    min-height: 240px;
    overflow: hidden;
}

.pattern-circles {
    background:
        radial-gradient(circle at 50% 50%, transparent 20%, var(--border) 20.5%, transparent 21%),
        radial-gradient(circle at 50% 50%, transparent 40%, var(--border) 40.5%, transparent 41%),
        radial-gradient(circle at 50% 50%, transparent 60%, var(--border) 60.5%, transparent 61%),
        var(--bg-card);
}

.pattern-dots {
    background-image: radial-gradient(circle, var(--border) 1px, transparent 1px);
    background-size: 16px 16px;
}

.pattern-hatching {
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 8px,
        rgba(107, 92, 231, 0.08) 8px,
        rgba(107, 92, 231, 0.08) 9px
    ), var(--bg-card);
}

/* Collapse Section */
.section-collapse {
    gap: clamp(2px, 0.5vw, 6px);
}

.section-collapse .card {
    margin: -2px;
}

.collapse-card {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(1.6rem, 3vw, 2.5rem);
    letter-spacing: 0.08em;
    text-transform: lowercase;
    color: var(--text-primary);
}

/* Glitch Band on cards */
.has-glitch::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 2px;
    background: var(--danger);
    opacity: 0.4;
    animation: glitchJitter 3000ms infinite;
}

@keyframes glitchJitter {
    0%, 95% { transform: translateX(0); }
    96% { transform: translateX(1px); }
    97% { transform: translateX(-1px); }
    98% { transform: translateX(1px); }
    100% { transform: translateX(0); }
}

/* Section Void - sparse layout */
.section-void {
    grid-template-columns: repeat(3, 1fr);
}

/* Section Signal - dense 4 columns */
.section-signal {
    grid-template-columns: repeat(4, 1fr);
    padding-top: 4rem;
}

/* Noise texture on cards (subtle) */
.card:not(.void-card)::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.03;
    filter: url(#noiseFilter);
    pointer-events: none;
}

/* Vertical line accents */
.section-signal .card:nth-child(3n)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    width: 1px;
    height: 100%;
    background: rgba(107, 92, 231, 0.2);
}

@media (max-width: 768px) {
    .section-signal {
        grid-template-columns: repeat(2, 1fr);
    }
    .section-void {
        grid-template-columns: 1fr;
    }
    .card.span-2 {
        grid-column: span 1;
    }
}
