/* mystery.boo - Cinematic Mystery Experience */
/* Palette:
   Midnight navy: #0A1828 (primary bg)
   Steel blue: #2A3848 (secondary bg, panels)
   Metallic silver: #A0A8B0 (text on dark)
   Manila cream: #D8C898 (case file headers)
   Evidence red: #C84040 (stamps, alerts)
   Nature moonlight: #E0E8F0 (highlights)
   Fog gray: #6A7888 (fog layers)
   Circuit green: #3A6848 (circuit traces)
*/

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Bitter', serif;
    font-weight: 400;
    font-size: clamp(15px, 1vw, 17px);
    line-height: 1.8;
    color: #A0A8B0;
    background: #000000;
    overflow-x: hidden;
}

/* ============================================
   CINEMATIC LETTERBOX BARS
   ============================================ */
.letterbox-bar {
    position: fixed;
    left: 0;
    right: 0;
    height: 10vh;
    background: #000000;
    z-index: 1000;
    pointer-events: none;
}

.letterbox-top {
    top: 0;
}

.letterbox-bottom {
    bottom: 0;
}

/* ============================================
   CIRCUIT BOARD OVERLAY
   ============================================ */
.circuit-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1200ms ease;
}

.circuit-overlay.visible {
    opacity: 0.03;
}

.circuit-overlay svg {
    width: 100%;
    height: 100%;
}

/* ============================================
   FOG LAYERS (PARALLAX)
   ============================================ */
.fog-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
    opacity: 0;
    transition: opacity 800ms ease;
}

.fog-layer.visible {
    opacity: 1;
}

.fog-layer-1 {
    background: radial-gradient(ellipse 120% 60% at 20% 50%, rgba(106, 120, 136, 0.12) 0%, transparent 70%),
                radial-gradient(ellipse 100% 50% at 80% 30%, rgba(106, 120, 136, 0.08) 0%, transparent 60%);
    --parallax-speed: 0.95;
}

.fog-layer-2 {
    background: radial-gradient(ellipse 150% 40% at 60% 60%, rgba(106, 120, 136, 0.10) 0%, transparent 65%),
                radial-gradient(ellipse 80% 70% at 10% 70%, rgba(106, 120, 136, 0.06) 0%, transparent 55%);
    --parallax-speed: 0.98;
}

.fog-layer-3 {
    background: radial-gradient(ellipse 100% 80% at 50% 40%, rgba(106, 120, 136, 0.07) 0%, transparent 50%),
                radial-gradient(ellipse 120% 40% at 90% 80%, rgba(106, 120, 136, 0.05) 0%, transparent 60%);
    --parallax-speed: 1.02;
}

/* ============================================
   NATURE SILHOUETTES
   ============================================ */
.nature-silhouettes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    opacity: 0.2;
    transition: opacity 500ms ease;
}

.nature-element {
    position: absolute;
    opacity: 0.2;
    transition: opacity 500ms ease;
}

.nature-tree-left {
    left: -2%;
    bottom: 10vh;
    width: 12vw;
    max-width: 180px;
    height: auto;
}

.nature-owl {
    right: 8%;
    top: 18vh;
    width: 5vw;
    max-width: 80px;
    height: auto;
}

.nature-moon {
    right: 15%;
    top: 13vh;
    width: 4vw;
    max-width: 60px;
    height: auto;
    opacity: 0.3;
}

.nature-tree-right {
    right: -3%;
    bottom: 12vh;
    width: 10vw;
    max-width: 150px;
    height: auto;
    transform: scaleX(-1);
}

.nature-hills {
    bottom: 10vh;
    left: 0;
    width: 100%;
    height: auto;
    opacity: 0.04;
}

/* ============================================
   NAVIGATION TOGGLE (MAGNIFYING GLASS)
   ============================================ */
.nav-toggle {
    position: fixed;
    top: calc(10vh + 20px);
    right: 30px;
    z-index: 900;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    opacity: 0.6;
    transition: opacity 300ms ease, transform 300ms ease;
}

.nav-toggle:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* ============================================
   NAVIGATION PANEL
   ============================================ */
.nav-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 420px;
    height: 100%;
    background: rgba(10, 24, 40, 0.97);
    z-index: 950;
    transform: translateX(100%);
    transition: transform 400ms cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 1px solid rgba(58, 104, 72, 0.3);
    backdrop-filter: blur(12px);
}

.nav-panel.open {
    transform: translateX(0);
}

.nav-panel-inner {
    padding: 80px 40px 40px;
    height: 100%;
    overflow-y: auto;
}

.nav-close {
    position: absolute;
    top: calc(10vh + 16px);
    right: 30px;
    background: none;
    border: none;
    color: #A0A8B0;
    font-size: 32px;
    cursor: pointer;
    padding: 8px;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 300ms ease;
}

.nav-close:hover {
    opacity: 1;
}

.nav-search {
    margin-bottom: 40px;
    margin-top: 20px;
}

.nav-search-input {
    width: 100%;
    padding: 14px 20px;
    background: rgba(42, 56, 72, 0.6);
    border: 1px solid rgba(160, 168, 176, 0.2);
    border-radius: 4px;
    color: #E0E8F0;
    font-family: 'Bitter', serif;
    font-size: 15px;
    outline: none;
    transition: border-color 300ms ease;
}

.nav-search-input::placeholder {
    color: #6A7888;
}

.nav-search-input:focus {
    border-color: rgba(58, 104, 72, 0.6);
}

.nav-links {
    list-style: none;
}

.nav-links li {
    margin-bottom: 8px;
}

.nav-link {
    display: block;
    padding: 12px 0;
    color: #A0A8B0;
    text-decoration: none;
    font-family: 'Bitter', serif;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-bottom: 1px solid rgba(160, 168, 176, 0.08);
    transition: color 300ms ease, padding-left 300ms ease;
}

.nav-link:hover {
    color: #D8C898;
    padding-left: 10px;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    position: relative;
    z-index: 10;
    opacity: 0;
    transition: opacity 1000ms ease;
}

.main-content.visible {
    opacity: 1;
}

/* ============================================
   OPENING SHOT (HERO)
   ============================================ */
.opening-shot {
    min-height: 100vh;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 20vh;
    background: linear-gradient(180deg, #0A1828 0%, #1A2838 100%);
    position: relative;
}

.title-card {
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 800ms ease, transform 800ms ease;
}

.title-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.site-title {
    font-family: 'Bitter', serif;
    font-weight: 700;
    font-size: clamp(28px, 3.5vw, 52px);
    letter-spacing: 0.02em;
    color: #E0E8F0;
    margin-bottom: 16px;
}

.site-tagline {
    font-family: 'Bitter', serif;
    font-weight: 400;
    font-style: italic;
    font-size: 13px;
    color: #6A7888;
    letter-spacing: 0.05em;
}

/* ============================================
   CASE FILES
   ============================================ */
.case-file {
    padding: 60px 20px;
    display: flex;
    justify-content: center;
    background: transparent;
    position: relative;
}

.case-file-inner {
    width: 100%;
    max-width: 800px;
    background: rgba(42, 56, 72, 0.4);
    border: 1px solid rgba(160, 168, 176, 0.1);
    border-radius: 2px;
    overflow: hidden;
    opacity: 0;
    transform: translateY(80px);
    transition: opacity 500ms ease, transform 500ms ease, box-shadow 400ms ease;
}

.case-file-inner.visible {
    opacity: 1;
    transform: translateY(0);
}

.case-file-inner:hover {
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4), 0 0 60px rgba(58, 104, 72, 0.05);
}

.case-header {
    background: #D8C898;
    padding: 24px 32px;
    position: relative;
    overflow: hidden;
}

.case-number {
    display: block;
    font-family: 'Bitter', serif;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #2A3848;
    margin-bottom: 6px;
}

.case-title {
    font-family: 'Bitter', serif;
    font-weight: 700;
    font-size: clamp(20px, 2.5vw, 32px);
    letter-spacing: 0.02em;
    color: #0A1828;
    line-height: 1.3;
}

.classified-stamp {
    position: absolute;
    top: 18px;
    right: 20px;
    font-family: 'Bitter', serif;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #C84040;
    border: 2px solid #C84040;
    padding: 4px 12px;
    transform: rotate(-5deg);
    opacity: 0.85;
}

.case-body {
    padding: 32px;
    background: rgba(10, 24, 40, 0.6);
}

.case-excerpt {
    color: #A0A8B0;
    margin-bottom: 24px;
}

.case-details {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 24px;
    padding: 16px 0;
    border-top: 1px solid rgba(160, 168, 176, 0.1);
    border-bottom: 1px solid rgba(160, 168, 176, 0.1);
}

.case-detail {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-label {
    font-family: 'Bitter', serif;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #6A7888;
}

.detail-value {
    font-family: 'Bitter', serif;
    font-weight: 400;
    font-size: 14px;
    color: #E0E8F0;
}

.status-open {
    color: #3A6848;
    font-weight: 700;
}

.case-analysis {
    color: #6A7888;
    font-style: italic;
    font-size: 14px;
    line-height: 1.7;
    padding-top: 8px;
}

/* ============================================
   EVIDENCE BOARDS
   ============================================ */
.evidence-board {
    padding: 80px 20px;
    position: relative;
    min-height: 50vh;
}

.evidence-board-inner {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    min-height: 400px;
    background:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 19px,
            rgba(216, 200, 152, 0.03) 19px,
            rgba(216, 200, 152, 0.03) 20px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 19px,
            rgba(216, 200, 152, 0.03) 19px,
            rgba(216, 200, 152, 0.03) 20px
        ),
        linear-gradient(135deg, rgba(42, 56, 72, 0.3) 0%, rgba(10, 24, 40, 0.5) 100%);
    border: 1px solid rgba(216, 200, 152, 0.1);
    border-radius: 2px;
    padding: 30px;
}

.evidence-board-title {
    font-family: 'Bitter', serif;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #D8C898;
    margin-bottom: 10px;
    text-align: center;
}

.evidence-items {
    position: relative;
    width: 100%;
    height: 350px;
}

.evidence-item {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: default;
    transition: transform 200ms ease;
    z-index: 2;
}

.evidence-item:hover {
    transform: rotate(-1deg);
}

.evidence-item:nth-child(even):hover {
    transform: rotate(1deg);
}

.evidence-icon {
    width: 48px;
    height: 48px;
    background: rgba(10, 24, 40, 0.8);
    border: 1px solid rgba(216, 200, 152, 0.3);
    border-radius: 2px;
    padding: 4px;
}

.evidence-label {
    font-family: 'Bitter', serif;
    font-weight: 400;
    font-style: italic;
    font-size: 13px;
    color: #D8C898;
    text-align: center;
    white-space: nowrap;
}

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

.string-line {
    stroke-dashoffset: 200;
    transition: stroke-dashoffset 1500ms ease;
}

.string-line.drawn {
    stroke-dashoffset: 0;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    padding: 60px 20px;
    text-align: center;
    background: linear-gradient(180deg, transparent 0%, rgba(10, 24, 40, 0.8) 100%);
    position: relative;
}

.footer-inner {
    max-width: 600px;
    margin: 0 auto;
}

.footer-text {
    font-family: 'Bitter', serif;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #6A7888;
    margin-bottom: 8px;
}

.footer-note {
    font-family: 'Bitter', serif;
    font-weight: 400;
    font-style: italic;
    font-size: 12px;
    color: rgba(106, 120, 136, 0.6);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .letterbox-bar {
        height: 6vh;
    }

    .opening-shot {
        padding-bottom: 16vh;
    }

    .case-header {
        padding: 20px 24px;
    }

    .case-body {
        padding: 24px;
    }

    .classified-stamp {
        position: relative;
        top: auto;
        right: auto;
        display: inline-block;
        margin-top: 12px;
    }

    .case-details {
        flex-direction: column;
        gap: 12px;
    }

    .evidence-board-inner {
        min-height: 300px;
    }

    .evidence-items {
        height: 280px;
    }

    .nav-panel {
        max-width: 100%;
    }

    .nature-owl,
    .nature-moon {
        display: none;
    }

    .nav-toggle {
        right: 16px;
    }
}

@media (max-width: 480px) {
    .case-file {
        padding: 30px 12px;
    }

    .evidence-board {
        padding: 40px 12px;
    }

    .site-title {
        font-size: clamp(24px, 8vw, 36px);
    }
}
