:root {
    --bg-color: #010101;
    --text-color: #c9c9c9;
    --accent-red: #b30000;
    --accent-dark-red: #4a0404;
    --charcoal: #111111;
    --font-heading: 'Cinzel', serif;
    --font-ui: 'Oswald', sans-serif;
    --font-body: 'Playfair Display', serif;
}

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

body, html {
    width: 100%; height: 100%;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    /* Let Lenis handle scroll */
    cursor: crosshair;
}

/* Lenis Scroll reset */
html.lenis, html.lenis body {
    height: auto;
}
.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}
.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}
.lenis.lenis-stopped {
    overflow: hidden;
}

/* Preloader */
#preloader {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: #000; z-index: 9999;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    transition: opacity 2s ease, visibility 2s ease;
}
.particle-logo-img {
    width: 100%; max-width: 400px;
    filter: drop-shadow(4px 0 0 rgba(179,0,0,0.5)) drop-shadow(-4px 0 0 rgba(0,255,255,0.5));
    animation: coalescing 3s forwards ease-in-out;
}
@keyframes coalescing {
    0% { filter: blur(20px); opacity: 0; transform: scale(1.1); }
    100% { filter: blur(0px) drop-shadow(2px 0 0 rgba(179,0,0,0.8)) drop-shadow(-2px 0 0 rgba(0,255,255,0.8)); opacity: 1; transform: scale(1); }
}
.enter-btn {
    margin-top: 2rem; padding: 1rem 2rem; border: 1px solid var(--accent-red);
    background: transparent; color: var(--accent-red); font-family: var(--font-ui);
    cursor: pointer; text-transform: uppercase; letter-spacing: 0.3em;
    transition: all 0.3s; opacity: 0; pointer-events: none;
}
.enter-btn.ready { opacity: 1; pointer-events: all; }
.enter-btn:hover { background: var(--accent-red); color: #000; }

/* Navigation */
.main-nav {
    position: fixed; top: 0; left: 0; width: 100%; padding: 2rem;
    display: flex; justify-content: space-between; align-items: center;
    z-index: 100; pointer-events: none; /* Let clicks pass through except on links */
}
.main-nav * { pointer-events: auto; }

/* Logo Chromatic Aberration */
.chromatic-logo {
    height: 80px; width: auto;
    position: relative;
    filter: drop-shadow(2px 0 0 rgba(255,0,0,0.8)) drop-shadow(-2px 0 0 rgba(0,255,255,0.8));
    animation: chromatic-pulse 0.2s infinite;
}
@keyframes chromatic-pulse {
    0% { filter: drop-shadow(2px 0 0 rgba(179,0,0,0.8)) drop-shadow(-2px 0 0 rgba(0,255,255,0.8)); }
    50% { filter: drop-shadow(1px 0 0 rgba(179,0,0,0.6)) drop-shadow(-1px 0 0 rgba(0,255,255,0.6)); }
    100% { filter: drop-shadow(3px 0 0 rgba(179,0,0,0.9)) drop-shadow(-3px 0 0 rgba(0,255,255,0.9)); }
}

/* Menu Heartbeat */
.nav-links { list-style: none; display: flex; gap: 2rem; }
.heartbeat-link {
    text-decoration: none; color: var(--text-color); font-family: var(--font-ui);
    font-size: 1rem; letter-spacing: 0.2em; text-transform: uppercase;
    transition: color 0.3s; display: inline-block;
}
.heartbeat-link:hover {
    color: var(--accent-red);
    animation: heartbeat 0.8s infinite cubic-bezier(0.215, 0.610, 0.355, 1.000);
}
@keyframes heartbeat {
    0% { transform: scale(1); }
    20% { transform: scale(1.1); text-shadow: 0 0 10px var(--accent-red); }
    40% { transform: scale(1); }
    60% { transform: scale(1.15); text-shadow: 0 0 15px var(--accent-red); }
    100% { transform: scale(1); }
}

/* Intense Grain Overlay */
.noise-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    pointer-events: none; z-index: 9000; opacity: 0.1;
    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" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)"/%3E%3C/svg%3E');
    mix-blend-mode: normal;
}
.noise-overlay::after {
    content: ""; position: absolute; 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.75" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)"/%3E%3C/svg%3E');
    opacity: 0.5; mix-blend-mode: normal; pointer-events: none;
    animation: noise-shift 0.1s infinite;
}
@keyframes noise-shift { 0% { transform: translate(0, 0); } 100% { transform: translate(1%, 1%); } }

/* 3D Canvas */
#maw-canvas {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: 0; pointer-events: none;
}

/* Content Container */
#content {
    position: relative; z-index: 10; width: 100%;
}
section {
    position: relative; min-height: 100vh;
    display: flex; flex-direction: column; justify-content: center;
    padding: 2rem 5%; border-bottom: 1px solid rgba(255,255,255,0.02);
}

.hero-section { align-items: center; text-align: center; position: relative; overflow: hidden; }
.hero-section::before {
    content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: url('../images/eater.png') no-repeat center center / cover;
    opacity: 0.08; z-index: 1; pointer-events: none;
    mix-blend-mode: screen; 
    filter: grayscale(100%) contrast(1.5);
}
.hero-content { z-index: 2; position: relative; }

h1, h2 { position: relative; display: inline-block; }

/* Violent Glitch on Scroll */
.violent-glitch {
    animation: violent-tear 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}
@keyframes violent-tear {
    0% { transform: translate(0); filter: drop-shadow(0 0 0 transparent); clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
    20% { transform: translate(-10px, 5px) skewX(20deg); filter: drop-shadow(10px 0 0 var(--accent-red)); clip-path: polygon(0 10%, 100% 10%, 100% 20%, 0 20%); }
    40% { transform: translate(10px, -5px) skewX(-20deg); filter: drop-shadow(-10px 0 0 cyan); clip-path: polygon(0 40%, 100% 40%, 100% 60%, 0 60%); }
    60% { transform: translate(-5px, 10px); color: var(--accent-red); clip-path: polygon(0 80%, 100% 80%, 100% 100%, 0 100%); }
    80% { transform: translate(5px, -10px); color: white; clip-path: polygon(0 0%, 100% 0%, 100% 100%, 0 100%); }
    100% { transform: translate(0); filter: drop-shadow(0 0 0 transparent); clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
}

.hero-title { font-family: var(--font-heading); font-size: clamp(3rem, 10vw, 8rem); font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; }
.hero-subtitle { font-family: var(--font-ui); font-size: 1.2rem; letter-spacing: 0.3em; color: var(--accent-red); margin-top: 1rem; text-transform: uppercase; }
.secondary-heading { font-family: var(--font-heading); font-size: clamp(2.5rem, 6vw, 5rem); color: #fff; margin-bottom: 2rem; position: relative; text-transform: uppercase; }

.text-right { align-items: flex-end; text-align: right; }
.center-align { align-items: center; text-align: center; }
.content-block { max-width: 800px; z-index: 20; position: relative; }

/* Hero Image Logo */
.hero-logo-img {
    width: 100%; max-width: 500px; height: auto; margin: 0 auto; display: block;
    filter: drop-shadow(4px 0 0 rgba(179,0,0,0.8)) drop-shadow(-4px 0 0 rgba(0,255,255,0.8));
    animation: chromatic-pulse 2s infinite;
}

/* NIHIL Section */
.nihil-section { background: transparent; }
.nihil-text-block {
    font-family: var(--font-body); font-size: 1.2rem; line-height: 1.8;
    color: var(--text-color); max-width: 600px; margin: 0 auto; text-align: left;
}
.nihil-text-block p { margin-bottom: 1.5rem; }
.void-call {
    font-family: var(--font-ui); color: var(--accent-red);
    letter-spacing: 0.1em; text-transform: uppercase;
}
.glitch-text-subtle {
    font-family: var(--font-heading); font-size: 1.5rem; color: #fff;
    text-shadow: 2px 0 var(--accent-red), -2px 0 cyan;
}

/* Parallax Layers */
.parallax-section { position: relative; overflow: hidden; }
.parallax-bg { position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; pointer-events: none; z-index: 10; opacity: 0.15; }
.layer-smoke { background: radial-gradient(circle at 50% 50%, rgba(139,0,0,0.1) 0%, transparent 60%); filter: blur(20px); }
.layer-dust { background: radial-gradient(circle at 80% 20%, rgba(139,0,0,0.15) 0%, transparent 50%); filter: blur(10px); opacity: 0.2; }

/* Tooltips */
.void-area {
    display: inline-block; position: relative; margin-top: 1rem;
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%238b0000" stroke-width="2"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="8" x2="12" y2="16"></line><line x1="8" y1="12" x2="16" y2="12"></line></svg>') 12 12, crosshair;
}
.void-label { font-family: var(--font-ui); color: var(--charcoal); background: var(--text-color); font-size: 1.2rem; letter-spacing: 0.2em; transition: all 0.3s ease; padding: 0.5rem 1rem; border: 1px solid var(--charcoal); display: inline-block; }
.void-area:hover .void-label { color: var(--accent-red); background: transparent; border-color: var(--accent-red); text-shadow: 0 0 10px var(--accent-red); }
.void-hitbox { position: absolute; top: -20px; left: -20px; right: -20px; bottom: -20px; }
.tooltip { position: fixed; top: 0; left: 0; pointer-events: none; z-index: 100; background: rgba(0,0,0,0.9); border-left: 3px solid var(--accent-red); padding: 1.5rem; max-width: 350px; font-family: var(--font-body); font-size: 1.1rem; line-height: 1.6; color: #fff; opacity: 0; transform: translate(-50%, -100%) scale(0.9); transition: opacity 0.2s ease, transform 0.2s ease; box-shadow: 0 10px 30px rgba(0,0,0,0.8); font-style: italic; }
.tooltip.active { opacity: 1; transform: translate(-50%, -120%) scale(1); }

/* Centered Footer */
.footer-section {
    min-height: 100vh; /* Takes full height to ensure true vertical center */
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    text-align: center; gap: 3rem; background: var(--bg-color);
}
.footer-title { font-size: clamp(2rem, 5vw, 4rem); }
.social-links { display: flex; gap: 2rem; }
.social-link {
    color: var(--charcoal); text-decoration: none; font-family: var(--font-ui);
    font-size: 1.5rem; letter-spacing: 0.4em; position: relative;
    transition: all 0.3s; text-shadow: 0 0 5px rgba(255,255,255,0.1);
}
.social-link:hover { color: var(--text-color); text-shadow: 0 0 15px var(--text-color); }
.legal-info { font-family: var(--font-ui); font-size: 0.9rem; color: var(--charcoal); letter-spacing: 0.2em; display: flex; flex-direction: column; gap: 0.5rem; }

/* Scroll Indicator */
.scroll-indicator { position: absolute; bottom: 10vh; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 1rem; font-family: var(--font-ui); font-size: 0.8rem; letter-spacing: 0.3em; color: var(--charcoal); }
.scroll-indicator .line { width: 1px; height: 50px; background: linear-gradient(to bottom, var(--charcoal), transparent); }

@media (max-width: 768px) {
    .content-block { padding: 0 20px; }
    .main-nav { padding: 1rem; flex-direction: column; gap: 1rem; }
    .chromatic-logo { height: 50px; }
    .nav-links { gap: 1rem; flex-wrap: wrap; justify-content: center; pointer-events: auto; }
    .social-links { flex-direction: column; gap: 1rem; align-items: center; justify-content: center; width: 100%; }
}
