/* REALITY GLITCHES CSS */

:root {
    --bg-paper: #f0eee9;
    --bg-dark-paper: #e5e3db;
    --ink-black: #1a1a1a;
    --stamp-red: #c0392b;
    --redacted-black: #111;

    --font-typewriter: 'Courier Prime', 'Courier New', monospace;
    --font-stamp: 'Special Elite', 'Courier New', monospace;
}

body {
    margin: 0;
    padding: 40px;
    background-color: #333;
    /* Dark background behind the paper */
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: var(--font-typewriter);
    color: var(--ink-black);
    line-height: 1.6;
}

/* Base Page Layout */
.page {
    background-color: var(--bg-paper);
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.02) 1px, transparent 1px);
    background-size: 20px 20px;
    width: 8.5in;
    min-height: 11in;
    margin-bottom: 40px;
    padding: 1in;
    box-sizing: border-box;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

/* Subtle texture overlay */
.page::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    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.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 10;
}

/* --- CLASSIFIED STAMPS --- */
.stamp {
    font-family: var(--font-stamp);
    color: var(--stamp-red);
    font-size: 24px;
    font-weight: bold;
    text-transform: uppercase;
    border: 4px solid var(--stamp-red);
    padding: 10px 20px;
    border-radius: 4px;
    display: inline-block;
    opacity: 0.8;
    transform: rotate(-5deg);
    letter-spacing: 2px;
}

.top-secret {
    position: absolute;
    top: 40px;
    left: 40px;
}

.declassified {
    position: absolute;
    bottom: 80px;
    right: 40px;
    transform: rotate(3deg);
    font-size: 32px;
    border-width: 6px;
}

.warning-stamp {
    border: 2px solid var(--stamp-red);
    font-size: 14px;
    padding: 4px 8px;
    transform: rotate(0);
}

/* --- TEXT REDACTION --- */
.redacted-line {
    background-color: var(--redacted-black);
    color: var(--redacted-black);
    display: inline-block;
    height: 1.2em;
    vertical-align: middle;
}

.redacted-line.short {
    width: 80px;
}

.redacted-line.medium {
    width: 140px;
}

.redacted-line.long {
    width: 220px;
}

/* --- COVER PAGE SPECIFICS --- */
.cover-page {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.pre-title {
    font-size: 16px;
    letter-spacing: 4px;
    margin-bottom: 40px;
    border-bottom: 2px dashed var(--ink-black);
    padding-bottom: 10px;
}

.main-title {
    font-size: 48px;
    margin: 0 0 20px 0;
    letter-spacing: 6px;
    line-height: 1.2;
}

.sub-title {
    font-size: 20px;
    font-weight: normal;
    letter-spacing: 2px;
}

.cover-meta {
    margin-top: 80px;
    text-align: left;
    border: 2px solid var(--ink-black);
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.3);
}

.cover-meta p {
    margin: 10px 0;
}

/* --- INNER PAGE ELEMENTS --- */
.header-meta {
    display: flex;
    justify-content: space-between;
    border-bottom: 2px solid var(--ink-black);
    padding-bottom: 10px;
    margin-bottom: 40px;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 1px;
}

.section-title {
    border-bottom: 2px solid var(--ink-black);
    padding-bottom: 5px;
    margin-bottom: 20px;
    text-transform: uppercase;
    font-size: 24px;
}

/* Case File Headers */
.case-file-header {
    margin: 40px 0;
    font-weight: bold;
}

.dashed-line {
    border-top: 2px dashed var(--ink-black);
    margin: 10px 0;
}

/* Interview & Notes Boxes */
.interview-box {
    border-left: 4px solid var(--ink-black);
    padding-left: 20px;
    margin: 20px 0;
    background-color: var(--bg-dark-paper);
    padding: 15px;
}

.warning-box {
    border: 2px solid var(--stamp-red);
    color: var(--stamp-red);
    padding: 15px;
    margin: 20px 0;
    font-weight: bold;
    background-color: rgba(192, 57, 43, 0.05);
}

/* Data Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.data-table td {
    border-bottom: 1px dotted #ccc;
    padding: 8px 0;
}

.highlight-red {
    color: var(--stamp-red);
    font-weight: bold;
}

/* Investigation Board */
.investigation-board {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 40px 0;
}

.board-node {
    border: 2px solid var(--ink-black);
    padding: 15px 30px;
    text-align: center;
    background-color: white;
    box-shadow: 3px 3px 0 var(--ink-black);
    font-weight: bold;
}

.board-arrow {
    font-size: 24px;
    margin: 15px 0;
    font-weight: bold;
}

.research-note {
    border: 1px solid var(--ink-black);
    padding: 20px;
    margin: 30px 0;
    background-color: #fff9e6;
    /* Yellowed sticky note feel */
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
    transform: rotate(-1deg);
}

.note-header {
    font-weight: bold;
    border-bottom: 1px solid var(--ink-black);
    margin-bottom: 10px;
    padding-bottom: 5px;
}

/* Observation Logs */
.log-entry {
    border: 1px solid var(--ink-black);
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.5);
}

.log-field {
    margin-bottom: 10px;
}

.log-lines {
    border-bottom: 1px solid #999;
    height: 30px;
    margin-bottom: 10px;
}

/* Utilities */
.mt-4 {
    margin-top: 40px;
}

.mt-3 {
    margin-top: 20px;
}

.mt-5 {
    margin-top: 50px;
}

.page-break {
    display: none;
}

/* 
  PRINT MEDIA STYLING
  Ensures the dark background disappears and it breaks properly when "Save as PDF" is clicked.
*/
@media print {
    body {
        background-color: white;
        padding: 0;
    }

    .page {
        box-shadow: none;
        margin: 0;
        width: 100%;
        height: 100%;
        page-break-after: always;
    }

    .page-break {
        display: block;
        page-break-after: always;
        height: 0;
    }
}