:root {
    /* Color Palette - Dark Noir & Detective System Theme */
    --bg-base: #09090b;
    --bg-panel: #131316;
    --bg-card: #1c1c21;
    --bg-overlay: rgba(9, 9, 11, 0.85);
    
    --text-main: #f4f4f5;
    --text-muted: #a1a1aa;
    --text-dark: #18181b;
    
    --accent-gold: #d4af37;
    --accent-gold-hover: #eab308;
    --accent-blue: #3b82f6;
    
    --border-color: #27272a;
    --border-light: #3f3f46;
    --alert-red: #ef4444;
    --status-green: #10b981;

    /* Typography */
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, monospace;

    /* Layout */
    --sidebar-width: 260px;
    --header-height: 70px;
    --transition-speed: 0.3s;
}

/* =========================================
   Reset & Base Styles
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-base);
    color: var(--text-main);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-speed);
}

ul {
    list-style: none;
}

/* Typography Utilities */
h1, h2, h3, h4 {
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.2;
}

.mono-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 400;
}

.gold-text {
    color: var(--accent-gold);
}

.muted {
    color: var(--text-muted);
}

/* =========================================
   Animations
   ========================================= */
.fade-in {
    animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* =========================================
   Buttons
   ========================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    border-radius: 2px;
}

.btn-outline {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
    background: transparent;
}

.btn-outline:hover {
    background-color: var(--accent-gold);
    color: var(--bg-base);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
}

.btn-solid {
    background-color: var(--accent-gold);
    color: var(--bg-base);
    border-color: var(--accent-gold);
}

.btn-solid:hover {
    background-color: var(--accent-gold-hover);
    border-color: var(--accent-gold-hover);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
}

/* =========================================
   Sidebar / Investigation Panel
   ========================================= */
.investigation-panel {
    background-color: var(--bg-panel);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 50;
    position: relative;
}

.panel-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}

.panel-header .mono-label {
    color: var(--accent-gold);
    font-weight: 700;
}

.panel-nav {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
}

.panel-nav::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
}

.nav-item svg {
    opacity: 0.7;
    transition: opacity var(--transition-speed);
}

.nav-item:hover {
    color: var(--text-main);
    background-color: rgba(255,255,255,0.02);
}

.nav-item.active {
    color: var(--accent-gold);
    border-bottom-color: var(--accent-gold);
}

.nav-item.active svg {
    opacity: 1;
}

.panel-footer {
    display: none; /* Hidden on mobile by default */
}

/* =========================================
   Main Content Layout
   ========================================= */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.top-disclaimer {
    background-color: #000;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-align: center;
    padding: 0.5rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* =========================================
   Case Control Bar (Header)
   ========================================= */
.case-control-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background-color: rgba(9, 9, 11, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 40;
    height: var(--header-height);
}

.logo-mark {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-name {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.875rem;
    letter-spacing: 0.1em;
}

.header-right .btn {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

/* =========================================
   Hero Section
   ========================================= */
.hero-intro {
    position: relative;
    padding: 4rem 1.5rem;
    min-height: 60vh;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.bg-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(80%) contrast(1.2);
}

.bg-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, var(--bg-base) 0%, rgba(9, 9, 11, 0.8) 50%, transparent 100%),
                linear-gradient(0deg, var(--bg-base) 0%, transparent 50%);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.hero-headline {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 300;
    letter-spacing: -0.02em;
    color: #fff;
}

.hero-headline::after {
    content: '_';
    color: var(--accent-gold);
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

.hero-subtext {
    font-size: 1.125rem;
    color: var(--text-muted);
    font-weight: 300;
    max-width: 90%;
}

.hero-actions {
    margin-top: 1rem;
}

/* =========================================
   Detective Slot Module
   ========================================= */
.section-container {
    padding: 4rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.section-header {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border-left: 3px solid var(--accent-gold);
    padding-left: 1rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 500;
}

.game-module-container {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.game-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.25rem;
    background-color: #0f0f13;
    border-bottom: 1px solid var(--border-color);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--status-green);
    animation: pulse 2s infinite;
}

.iframe-wrapper {
    position: relative;
    width: 100%;
    height: 60vh;
    min-height: 400px;
    background-color: #000;
}

.iframe-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* =========================================
   Evidence Grid (Features)
   ========================================= */
.evidence-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.evidence-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 2px;
    position: relative;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.evidence-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background-color: var(--border-light);
    transition: background-color 0.3s ease;
}

.evidence-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-light);
    box-shadow: 0 10px 20px rgba(0,0,0,0.4);
}

.evidence-card:hover::before {
    background-color: var(--accent-gold);
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px dashed var(--border-color);
    background-color: rgba(255,255,255,0.01);
}

.card-body {
    padding: 1.5rem;
}

.card-body h3 {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.card-body p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* =========================================
   Bureau Records (Footer)
   ========================================= */
.bureau-records {
    background-color: var(--bg-panel);
    border-top: 1px solid var(--border-color);
    padding: 3rem 1.5rem 1.5rem;
    margin-top: auto;
}

.records-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto 3rem;
}

.record-desc {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    font-family: var(--font-mono);
}

.record-col h4 {
    color: var(--text-main);
    margin-bottom: 1rem;
}

.record-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.record-links a {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.record-links a:hover {
    color: var(--accent-gold);
    padding-left: 0.25rem;
}

.records-legal {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.legal-warning {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-family: var(--font-mono);
}

.legal-warning svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.copyright {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--border-light);
}

/* =========================================
   Desktop & Tablet Media Queries
   ========================================= */
@media (min-width: 768px) {
    body {
        flex-direction: row;
    }

    /* Fixed Sidebar Layout */
    .investigation-panel {
        position: fixed;
        top: 0;
        left: 0;
        width: var(--sidebar-width);
        height: 100vh;
        border-bottom: none;
        border-right: 1px solid var(--border-color);
    }

    .panel-nav {
        flex-direction: column;
        overflow-x: visible;
        margin-top: 1rem;
    }

    .nav-item {
        border-bottom: none;
        border-left: 3px solid transparent;
        padding: 1rem 2rem;
    }

    .nav-item.active {
        border-left-color: var(--accent-gold);
        background: linear-gradient(90deg, rgba(212,175,55,0.05) 0%, transparent 100%);
    }

    .panel-footer {
        display: block;
        margin-top: auto;
        padding: 1.5rem;
        border-top: 1px solid var(--border-color);
    }

    /* Main Content Offset */
    .main-content {
        margin-left: var(--sidebar-width);
        width: calc(100% - var(--sidebar-width));
    }

    .evidence-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .records-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .records-legal {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

@media (min-width: 1024px) {
    .evidence-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .hero-intro {
        padding-left: 4rem;
        min-height: 70vh;
    }
    
    .iframe-wrapper {
        height: 70vh;
    }
}