/* ============================================
   mystery.boo — Grainy Noir Detective Board
   Color Palette:
   #1a1520 (near-black)    #2e2633 (dark purple)
   #2a5c4a (deep green)    #2d4a6e (navy)
   #8b2942 (crimson)       #c9943e (gold/amber)
   #a0845c (muted amber)   #6b6272 (lavender grey)
   #d4c8b0 (parchment)     #f5ead0 (cream)
   ============================================ */

:root {
    --noir-black: #1a1520;
    --dark-purple: #2e2633;
    --deep-green: #2a5c4a;
    --navy: #2d4a6e;
    --crimson: #8b2942;
    --gold: #c9943e;
    --amber: #a0845c;
    --lavender: #6b6272;
    --parchment: #d4c8b0;
    --cream: #f5ead0;
    --grain-opacity: 0.06;
    --amber-glow: 0.4;
    --section-bg: var(--noir-black);
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--noir-black);
    color: var(--cream);
    overflow-x: hidden;
    cursor: default;
}

/* ============================================
   Film Grain Overlay
   ============================================ */
#grain-overlay {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    pointer-events: none;
    z-index: 9999;
    opacity: var(--grain-opacity);
    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 type="fractalNoise" baseFrequency="0.9" numOctaves="4" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noise)" opacity="1"/%3E%3C/svg%3E');
    background-size: 256px 256px;
    animation: grainShift 0.1s steps(1) infinite;
}

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

/* ============================================
   Amber Glow Cursor Follower
   ============================================ */
#amber-glow {
    position: fixed;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(201, 148, 62, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
}

/* ============================================
   ACT I: THE CITY (Hero)
   ============================================ */
#act-city {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    overflow: hidden;
    background: linear-gradient(180deg, #0d0a12 0%, var(--noir-black) 40%, var(--dark-purple) 100%);
}

#rain-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.city-skyline {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60%;
    z-index: 1;
}

.skyline-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.hero-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -55%);
    text-align: center;
    z-index: 10;
}

.hero-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.3em;
    color: var(--gold);
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: fadeSlideUp 1s ease 0.5s forwards;
}

.hero-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(3rem, 10vw, 7rem);
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.08;
    color: var(--cream);
    text-shadow: 0 0 60px rgba(201, 148, 62, 0.3), 0 0 120px rgba(201, 148, 62, 0.1);
    opacity: 0;
    animation: fadeSlideUp 1.2s ease 0.8s forwards;
}

.hero-title .boo {
    color: var(--gold);
}

.hero-tagline {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    font-weight: 400;
    font-style: italic;
    color: var(--lavender);
    margin-top: 1rem;
    opacity: 0;
    animation: fadeSlideUp 1s ease 1.2s forwards;
}

.scroll-indicator {
    margin-top: 3rem;
    opacity: 0;
    animation: fadeSlideUp 1s ease 1.8s forwards;
}

.scroll-text {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--amber);
    display: block;
    margin-bottom: 0.5rem;
}

.scroll-arrow {
    animation: bobUpDown 2s ease-in-out infinite;
}

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

@keyframes bobUpDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

/* ============================================
   Section Headers (shared)
   ============================================ */
.section-header {
    text-align: center;
    padding: 6rem 2rem 3rem;
}

.section-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: var(--gold);
    display: block;
    margin-bottom: 1rem;
}

.section-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.08;
    color: var(--cream);
}

.section-desc {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.15rem;
    font-style: italic;
    color: var(--lavender);
    margin-top: 0.75rem;
}

/* ============================================
   ACT II: THE EVIDENCE BOARD
   ============================================ */
#act-evidence {
    position: relative;
    min-height: 100vh;
    background: linear-gradient(180deg, var(--noir-black) 0%, #1e1822 50%, var(--dark-purple) 100%);
    padding-bottom: 4rem;
}

.cork-board {
    position: relative;
    width: 90%;
    max-width: 1200px;
    height: 800px;
    margin: 0 auto;
    background: linear-gradient(135deg, #3a2f25 0%, #2d2318 50%, #3a2f25 100%);
    border: 3px solid #4a3d2e;
    border-radius: 2px;
    box-shadow: inset 0 0 40px rgba(0,0,0,0.5), 0 10px 40px rgba(0,0,0,0.6);
    overflow: hidden;
}

.cork-board::before {
    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="cork"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="4" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23cork)" opacity="0.15"/%3E%3C/svg%3E');
    background-size: 200px 200px;
    pointer-events: none;
}

.thread-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.red-thread {
    stroke: var(--crimson);
    stroke-width: 1.5;
    stroke-dasharray: 8 4;
    opacity: 0.7;
    filter: drop-shadow(0 0 2px rgba(139, 41, 66, 0.5));
}

.evidence-card {
    position: absolute;
    left: var(--card-x);
    top: var(--card-y);
    transform: rotate(var(--rotation));
    z-index: 2;
    transition: transform 0.4s ease, z-index 0s;
    cursor: pointer;
}

.evidence-card:hover {
    transform: rotate(0deg) scale(1.08);
    z-index: 10;
}

.pin {
    width: 14px;
    height: 14px;
    background: radial-gradient(circle at 40% 40%, #e05555, #8b2942);
    border-radius: 50%;
    position: absolute;
    top: -7px;
    left: 50%;
    margin-left: -7px;
    z-index: 5;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.card-inner {
    padding: 1rem;
    max-width: 240px;
}

.card-inner.polaroid {
    background: var(--cream);
    padding: 0.75rem 0.75rem 1.25rem;
    box-shadow: 2px 3px 12px rgba(0,0,0,0.4);
}

.polaroid-image {
    width: 200px;
    height: 150px;
    overflow: hidden;
}

.polaroid-image svg {
    width: 100%;
    height: 100%;
}

.polaroid-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.6rem;
    color: var(--dark-purple);
    margin-top: 0.5rem;
    text-align: center;
}

.card-inner.clipping {
    background: var(--parchment);
    padding: 1rem;
    box-shadow: 2px 3px 12px rgba(0,0,0,0.4);
    max-width: 260px;
    border: 1px solid #b8a88a;
}

.clipping-source {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.55rem;
    letter-spacing: 0.15em;
    color: var(--lavender);
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.5rem;
}

.clipping-headline {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--noir-black);
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.clipping-body {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    color: #4a4050;
    line-height: 1.5;
}

.clipping-date {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.55rem;
    color: var(--amber);
    display: block;
    margin-top: 0.5rem;
}

.card-inner.note {
    background: #f0e8c0;
    padding: 1rem;
    box-shadow: 2px 3px 12px rgba(0,0,0,0.4);
    max-width: 220px;
    transform: rotate(-1deg);
}

.note-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.95rem;
    font-style: italic;
    color: var(--dark-purple);
    line-height: 1.4;
}

.note-signature {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem;
    color: var(--amber);
    display: block;
    margin-top: 0.5rem;
    text-align: right;
}

.note-sketch {
    width: 80px;
    height: 40px;
    margin-top: 0.5rem;
    display: block;
}

/* ============================================
   ACT III: THE DOSSIER
   ============================================ */
#act-dossier {
    position: relative;
    min-height: 100vh;
    background: linear-gradient(180deg, var(--dark-purple) 0%, var(--noir-black) 30%, #0d0a12 100%);
    padding-bottom: 6rem;
}

.dossier-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 2rem;
}

.dossier-page {
    position: relative;
    background: linear-gradient(135deg, rgba(46, 38, 51, 0.6) 0%, rgba(26, 21, 32, 0.8) 100%);
    border: 1px solid rgba(160, 132, 92, 0.15);
    border-radius: 2px;
    padding: 2.5rem;
    margin-bottom: 2.5rem;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.dossier-page.visible {
    opacity: 1;
    transform: translateY(0);
}

.page-stamp {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.25em;
    color: var(--crimson);
    border: 2px solid var(--crimson);
    padding: 0.25rem 0.75rem;
    transform: rotate(3deg);
    opacity: 0.7;
}

.entry-date {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    font-weight: 300;
    letter-spacing: 0.15em;
    color: var(--amber);
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.75rem;
}

.entry-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--cream);
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

.entry-body {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 300;
    line-height: 1.8;
    color: var(--parchment);
}

.typewriter-text {
    overflow: hidden;
}

.typewriter-text.revealed {
    border-right: 2px solid var(--gold);
    animation: blinkCaret 0.8s step-end infinite;
}

@keyframes blinkCaret {
    50% { border-color: transparent; }
}

.testimony-block {
    border-left: 2px solid var(--crimson);
    padding-left: 1.5rem;
    margin: 1rem 0;
}

.testimony-quote {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.15rem;
    font-style: italic;
    color: var(--cream);
    line-height: 1.6;
}

.testimony-witness {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    color: var(--lavender);
    display: block;
    margin-top: 0.75rem;
}

.redacted-line {
    height: 1.2rem;
    background: var(--noir-black);
    margin: 0.75rem 0;
    width: 80%;
    border-radius: 1px;
}

.redacted-line.short {
    width: 45%;
}

.stamp-closed {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1.5rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    color: var(--crimson);
    border: 3px solid var(--crimson);
    padding: 0.5rem 1.5rem;
    display: inline-block;
    margin: 1.5rem 0;
    transform: rotate(-5deg);
    opacity: 0.8;
}

.entry-addendum {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.2rem;
    font-style: italic;
    color: var(--gold);
    margin-top: 1rem;
}

/* ============================================
   ACT IV: THE MAP
   ============================================ */
#act-map {
    position: relative;
    min-height: 100vh;
    background: linear-gradient(180deg, #0d0a12 0%, var(--noir-black) 30%, var(--dark-purple) 100%);
    padding-bottom: 4rem;
}

.isometric-city {
    width: 90%;
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
}

.iso-grid {
    position: relative;
    width: 100%;
    height: 500px;
    perspective: 800px;
}

.iso-block {
    position: absolute;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.iso-block:hover {
    transform: translateY(-8px);
}

.iso-block:hover .iso-label {
    opacity: 1;
}

/* Isometric building faces */
.iso-top, .iso-left, .iso-right {
    position: absolute;
}

/* Building A - Warehouse 14 */
.building-a {
    left: 12%;
    top: 30%;
    width: 100px;
    height: 120px;
}
.building-a .iso-top {
    width: 100px;
    height: 50px;
    background: var(--crimson);
    opacity: 0.7;
    transform: skewX(-30deg);
    top: 0;
    left: 10px;
}
.building-a .iso-left {
    width: 80px;
    height: 70px;
    background: #5a1828;
    top: 35px;
    left: 0;
}
.building-a .iso-right {
    width: 60px;
    height: 70px;
    background: #3d1020;
    top: 35px;
    left: 80px;
    transform: skewY(-30deg);
}

/* Building B - Harbor Pier */
.building-b {
    left: 45%;
    top: 15%;
    width: 120px;
    height: 80px;
}
.building-b .iso-top {
    width: 120px;
    height: 40px;
    background: var(--navy);
    opacity: 0.8;
    transform: skewX(-30deg);
    top: 0;
    left: 10px;
}
.building-b .iso-left {
    width: 100px;
    height: 50px;
    background: #1d3252;
    top: 25px;
    left: 0;
}
.building-b .iso-right {
    width: 50px;
    height: 50px;
    background: #152640;
    top: 25px;
    left: 100px;
    transform: skewY(-30deg);
}

/* Building C - The Missing Building */
.building-c {
    left: 60%;
    top: 45%;
    width: 90px;
    height: 130px;
}
.building-c .iso-top {
    width: 90px;
    height: 45px;
    background: var(--gold);
    opacity: 0.5;
    transform: skewX(-30deg);
    top: 0;
    left: 8px;
    animation: mysteryPulse 3s ease-in-out infinite;
}
.building-c .iso-left {
    width: 70px;
    height: 80px;
    background: rgba(201, 148, 62, 0.3);
    top: 30px;
    left: 0;
    border: 1px dashed rgba(201, 148, 62, 0.4);
}
.building-c .iso-right {
    width: 50px;
    height: 80px;
    background: rgba(201, 148, 62, 0.2);
    top: 30px;
    left: 70px;
    transform: skewY(-30deg);
    border: 1px dashed rgba(201, 148, 62, 0.3);
}

@keyframes mysteryPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

/* Building D - Detective's Office */
.building-d {
    left: 25%;
    top: 60%;
    width: 80px;
    height: 100px;
}
.building-d .iso-top {
    width: 80px;
    height: 40px;
    background: var(--deep-green);
    opacity: 0.6;
    transform: skewX(-30deg);
    top: 0;
    left: 8px;
}
.building-d .iso-left {
    width: 65px;
    height: 60px;
    background: #1a3d2e;
    top: 28px;
    left: 0;
}
.building-d .iso-right {
    width: 40px;
    height: 60px;
    background: #122b20;
    top: 28px;
    left: 65px;
    transform: skewY(-30deg);
}

/* Building E - Daily Phantom */
.building-e {
    left: 78%;
    top: 25%;
    width: 85px;
    height: 110px;
}
.building-e .iso-top {
    width: 85px;
    height: 42px;
    background: var(--lavender);
    opacity: 0.5;
    transform: skewX(-30deg);
    top: 0;
    left: 8px;
}
.building-e .iso-left {
    width: 68px;
    height: 65px;
    background: #4a4355;
    top: 30px;
    left: 0;
}
.building-e .iso-right {
    width: 42px;
    height: 65px;
    background: #3a3345;
    top: 30px;
    left: 68px;
    transform: skewY(-30deg);
}

/* Building F - Police Station */
.building-f {
    left: 50%;
    top: 70%;
    width: 95px;
    height: 100px;
}
.building-f .iso-top {
    width: 95px;
    height: 48px;
    background: var(--navy);
    opacity: 0.5;
    transform: skewX(-30deg);
    top: 0;
    left: 10px;
}
.building-f .iso-left {
    width: 76px;
    height: 55px;
    background: #1d3252;
    top: 32px;
    left: 0;
}
.building-f .iso-right {
    width: 48px;
    height: 55px;
    background: #152640;
    top: 32px;
    left: 76px;
    transform: skewY(-30deg);
}

.iso-marker {
    position: absolute;
    top: -12px;
    left: 50%;
    width: 10px;
    height: 10px;
    margin-left: -5px;
    border-radius: 50%;
    background: var(--crimson);
    z-index: 5;
}

.iso-marker.pulse {
    animation: markerPulse 2s ease-in-out infinite;
}

.iso-marker.glow {
    background: var(--gold);
    box-shadow: 0 0 15px rgba(201, 148, 62, 0.6), 0 0 30px rgba(201, 148, 62, 0.3);
}

@keyframes markerPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.6; }
}

.iso-label {
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.55rem;
    letter-spacing: 0.1em;
    color: var(--amber);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
    text-transform: uppercase;
}

.iso-connections {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.triangle-zone {
    fill: rgba(139, 41, 66, 0.08);
    stroke: none;
}

.connection-line {
    stroke: var(--crimson);
    stroke-width: 1.5;
    stroke-dasharray: 6 4;
    opacity: 0.5;
}

.map-tooltip {
    display: none;
    position: absolute;
    background: var(--noir-black);
    border: 1px solid var(--gold);
    padding: 0.5rem 1rem;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    color: var(--cream);
    pointer-events: none;
    z-index: 20;
    white-space: nowrap;
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
    margin-top: 6rem;
    padding: 3rem 2rem;
    border-top: 1px solid rgba(160, 132, 92, 0.15);
}

.footer-content {
    text-align: center;
}

.footer-case {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    color: var(--lavender);
    text-transform: uppercase;
}

.status-text {
    color: var(--gold);
    animation: statusBlink 3s ease-in-out infinite;
}

@keyframes statusBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.footer-domain {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--cream);
    margin: 1rem 0 0.5rem;
}

.footer-note {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    font-style: italic;
    color: var(--lavender);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .cork-board {
        height: 600px;
        width: 95%;
    }

    .evidence-card {
        transform: rotate(0deg) scale(0.8) !important;
    }

    .card-inner {
        max-width: 180px;
    }

    .card-inner.clipping {
        max-width: 200px;
    }

    .dossier-page {
        padding: 1.5rem;
    }

    .iso-grid {
        height: 400px;
    }

    .iso-block {
        transform: scale(0.75);
    }
}

@media (max-width: 480px) {
    .hero-label {
        font-size: 0.6rem;
    }

    .cork-board {
        height: 900px;
    }

    .evidence-card {
        position: relative !important;
        left: auto !important;
        top: auto !important;
        display: block;
        margin: 1.5rem auto;
        transform: none !important;
    }

    .thread-lines {
        display: none;
    }

    .section-header {
        padding: 4rem 1rem 2rem;
    }
}