:root {
    --bg-color: #050505;
    --surface-color: #0c0c0c;
    --text-color: #f0f0f0;
    --dim-text: #808080;
    --nothing-red: #ff3b30;
    --accent-glow: rgba(255, 59, 48, 0.4);
    --border-color: rgba(255, 255, 255, 0.08);
    --font-mono: 'JetBrains Mono', 'Menlo', monospace;
    --font-main: 'Inter', -apple-system, sans-serif;
    --ease-premium: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    line-height: 1.5;
    overflow-x: hidden;
    cursor: crosshair;
}

.mono { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.15em; text-transform: uppercase; }
.dot-font { font-weight: 700; letter-spacing: -0.02em; }

/* Overlays */
.grain-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: url('https://grainy-gradients.vercel.app/noise.svg');
    opacity: 0.04;
    pointer-events: none;
    z-index: 10000;
}

.scanline-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.2) 50%), 
                linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
    z-index: 9999;
    background-size: 100% 3px, 3px 100%;
    pointer-events: none;
    opacity: 0.5;
}

/* --- Components --- */

/* Hero Section */
.hero {
    height: 100vh;
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-visual {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 1;
}

.hero-visual img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    filter: grayscale(0.1) contrast(1.1) brightness(0.7);
    transition: transform 0.1s linear;
}

.hero-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(180deg, rgba(5,5,5,0.4) 0%, rgba(5,5,5,0.1) 50%, rgba(5,5,5,1) 100%);
    z-index: 2;
}

.hero-title {
    position: relative;
    z-index: 10;
    text-align: center;
}

.hero-title h1 {
    font-size: clamp(4rem, 15vw, 10rem);
    line-height: 1;
    margin-bottom: 2rem;
    color: #fff;
    text-shadow: 0 0 40px rgba(255, 255, 255, 0.1);
}

.logo-text {
    font-family: 'Cinzel', serif;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    font-weight: 700;
    background: linear-gradient(to bottom, #fff 20%, #666 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 20px rgba(255, 59, 48, 0.3));
    display: block;
}

.hero-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    color: var(--nothing-red);
}

/* Dossier Grid */
.dossier-layer {
    padding: 20vh 5vw;
    background: var(--bg-color);
}

.subject-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    background: var(--border-color);
    border: 1px solid var(--border-color);
}

.subject-card {
    background: var(--bg-color);
    padding: 8vh 4vw;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.portrait-frame {
    width: 100%;
    aspect-ratio: 4/5;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-color);
}

.portrait-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(1) brightness(0.8);
    transition: all 0.8s var(--ease-premium);
}

.subject-card:hover .portrait-frame img {
    filter: grayscale(0) brightness(1);
    transform: scale(1.05);
}

.subject-info h2 {
    font-size: 4rem;
    font-weight: 900;
    line-height: 0.9;
    margin-bottom: 1.5rem;
}

.subject-meta {
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
    color: var(--dim-text);
}

.signature-box {
    margin-top: 5vh;
    padding: 3rem;
    border: 1px dashed var(--border-color);
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lina-sig {
    width: 100%;
    max-width: 500px;
    height: auto;
    filter: invert(1) contrast(1.5) brightness(1.2);
    opacity: 0.8;
    mix-blend-mode: screen;
    transition: all 0.8s var(--ease-premium);
}

.subject-card:hover .lina-sig {
    opacity: 1;
    transform: scale(1.02) rotate(-1deg);
}

/* The Evidence Wall - Masonry (No Crop) */
.evidence-section {
    padding: 15vh 4vw;
    background: #000;
}

.evidence-wall {
    column-count: 4;
    column-gap: 20px;
    width: 100%;
}

.evidence-node {
    break-inside: avoid;
    margin-bottom: 20px;
    position: relative;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    transition: all 0.5s var(--ease-premium);
}

.evidence-node img {
    width: 100%;
    height: auto;
    display: block;
    filter: grayscale(0.8) contrast(1.1);
    transition: all 0.6s var(--ease-premium);
}

.evidence-node:hover {
    z-index: 100;
    border-color: var(--nothing-red);
}

.evidence-node:hover img {
    filter: grayscale(0) opacity(1);
    transform: scale(1.1);
}

.node-label {
    position: absolute;
    bottom: 12px; left: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.evidence-node:hover .node-label {
    opacity: 1;
}

/* Grid Variations - Disabled for Masonry */
/* .node-wide { grid-column: span 2; }
.node-tall { grid-row: span 2; }
.node-big { grid-column: span 2; grid-row: span 2; } */

@media (max-width: 1200px) {
    .evidence-wall { column-count: 3; }
}

@media (max-width: 800px) {
    .evidence-wall { column-count: 2; }
    .hero-title h1 { font-size: 4rem; }
}
@media (max-width: 500px) {
    .evidence-wall { column-count: 1; }
}

.terminal-section {
    padding: 15vh 10vw;
    border-top: 1px solid var(--border-color);
}

#chapter-list {
    display: flex;
    flex-direction: column;
}

.chapter-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2.5rem 0;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.4s var(--ease-premium);
}

.chapter-entry:hover {
    background: rgba(255, 255, 255, 0.03);
    padding-left: 2rem;
    padding-right: 2rem;
}

.chapter-entry h3 {
    font-size: 2rem;
    font-weight: 700;
}

/* Overlay Reader */
#reader-overlay {
    position: fixed;
    top: 0; right: 0; width: 60vw; height: 100vh;
    background: #080808;
    z-index: 11000;
    padding: 10vh 6vw;
    transform: translateX(100%);
    transition: transform 0.8s var(--ease-premium);
    border-left: 1px solid var(--nothing-red);
    overflow-y: auto;
}

#reader-overlay.open {
    transform: translateX(0);
}

.reader-content {
    max-width: 650px;
    margin: 0 auto;
}

.reader-content h2 {
    font-size: 4rem;
    line-height: 1;
    margin-bottom: 3rem;
}

.reader-body {
    font-size: 1.15rem;
    line-height: 1.8;
    color: #ccc;
}

.reader-body p { margin-bottom: 1.5rem; }

.close-trigger {
    position: fixed;
    top: 40px; right: 40px;
    background: none; border: none; color: #fff;
    cursor: pointer;
    z-index: 12000;
}

/* Responsive */
@media (max-width: 1024px) {
    .subject-grid { grid-template-columns: 1fr; }
    #reader-overlay { width: 100vw; }
    .hero-title h1 { font-size: 5rem; }
}
