/* CSS Variables for Vintage/Parchment Theme */
:root {
    --paper-base: #e6dfcc;
    --paper-dark: #d4c5a9;
    --ink-black: #1a1715;
    --ink-faded: #3a322b;
    --stamp-red: #9e1b1b;
    --redacted-bg: #1a1715;
    
    --font-typewriter: 'Courier Prime', 'Special Elite', monospace;
    --font-serif: 'Playfair Display', 'Zen Old Mincho', serif;
}

body {
    margin: 0;
    padding: 0;
    background-color: #111; /* Dark background behind the paper */
    color: var(--ink-faded);
    font-family: var(--font-serif);
    display: flex;
    justify-content: center;
    padding: 40px 20px;
    background-image: radial-gradient(circle at center, #222 0%, #000 100%);
    min-height: 100vh;
}

/* Hide the SVG used for filters */
.noise-filter {
    position: absolute;
    width: 0;
    height: 0;
    visibility: hidden;
}

/* The Paper Document */
.document-container {
    background-color: var(--paper-base);
    /* CSS only parchment effect using gradients and SVG filter */
    background-image: 
        radial-gradient(circle at 50% 50%, transparent 20%, rgba(0,0,0,0.05) 80%, rgba(0,0,0,0.1) 100%),
        linear-gradient(90deg, rgba(255,255,255,0.1) 0%, transparent 5%, transparent 95%, rgba(0,0,0,0.05) 100%);
    filter: url('#paper-noise') sepia(20%) contrast(95%);
    
    width: 100%;
    max-width: 800px;
    padding: 60px 50px;
    box-shadow: 
        0 20px 50px rgba(0,0,0,0.8),
        inset 0 0 60px rgba(139, 115, 85, 0.2);
    position: relative;
    box-sizing: border-box;
    border-radius: 2px;
}

/* Creepy subtle effect on the whole document */
.document-container::after {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    background: radial-gradient(circle at center, transparent 0%, rgba(0,0,0,0) 80%, rgba(0,0,0,0.1) 100%);
    mix-blend-mode: multiply;
}

/* Classification Header */
.classification-header {
    font-family: var(--font-typewriter);
    font-weight: bold;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--ink-black);
    padding-bottom: 10px;
    margin-bottom: 40px;
    letter-spacing: 1px;
}

.stamp {
    font-family: 'Courier Prime', monospace;
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--stamp-red);
    border: 3px solid var(--stamp-red);
    padding: 5px 10px;
    border-radius: 4px;
    transform: rotate(-5deg);
    opacity: 0.8;
    mix-blend-mode: multiply;
    letter-spacing: 3px;
    box-shadow: inset 0 0 0 2px transparent; /* rough edge feel */
}

/* Header Section */
.report-header {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 50px;
    border-bottom: 1px solid var(--ink-faded);
    padding-bottom: 30px;
}

.seal-container {
    flex-shrink: 0;
    width: 140px;
    height: 140px;
    opacity: 0.85;
    mix-blend-mode: multiply;
}

.foundation-seal {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: sepia(0.5) contrast(1.2);
}

.title-block h1 {
    font-family: var(--font-typewriter);
    font-size: 2.2rem;
    margin: 0 0 5px 0;
    color: var(--ink-black);
    letter-spacing: -1px;
}

.ja-title {
    font-family: 'Zen Old Mincho', serif;
    font-size: 1.5rem;
    color: var(--ink-faded);
    font-weight: 700;
    letter-spacing: 2px;
}

.meta-info {
    font-family: var(--font-typewriter);
    font-size: 0.9rem;
    margin-top: 20px;
    line-height: 1.6;
}

.meta-info p {
    margin: 5px 0;
}

/* Sections */
.report-section {
    margin-bottom: 40px;
}

.section-title {
    font-family: var(--font-typewriter);
    font-size: 1.2rem;
    border-bottom: 1px dashed var(--ink-faded);
    padding-bottom: 5px;
    margin-bottom: 15px;
    display: flex;
    align-items: baseline;
    gap: 15px;
}

.ja-subtitle {
    font-family: 'Zen Old Mincho', serif;
    font-size: 0.9rem;
    font-weight: normal;
}

/* Content Box (like a typed paragraph) */
.content-box {
    font-family: 'Zen Old Mincho', serif;
    font-size: 1.05rem;
    line-height: 1.8;
    text-align: justify;
    text-justify: inter-ideograph;
}

.content-box p {
    margin-bottom: 15px;
}

/* Redacted Text / Glitch Effect */
.redacted-text {
    position: relative;
}

.creepy-glitch {
    position: relative;
    display: inline-block;
    transition: all 0.3s;
    cursor: default;
}

.creepy-glitch::after {
    content: attr(data-text);
    position: absolute;
    left: 0;
    top: 0;
    color: var(--stamp-red);
    opacity: 0;
    transform: translate(-2px, 1px);
    z-index: 2;
    transition: opacity 0.5s;
    pointer-events: none;
    font-family: var(--font-typewriter);
    font-size: 0.9em;
    mix-blend-mode: multiply;
}

.creepy-glitch:hover {
    color: transparent;
}
.creepy-glitch:hover::after {
    opacity: 0.9;
    animation: jitter 0.2s infinite;
}

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

/* Data Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-typewriter);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.data-table th, .data-table td {
    border: 1px solid var(--ink-black);
    padding: 8px 12px;
    text-align: left;
}

.data-table th {
    background-color: rgba(0,0,0,0.05);
    font-weight: bold;
}

.warning-text {
    color: var(--stamp-red);
    font-weight: bold;
}

/* Attachments / Notes */
.attachment-note {
    font-family: var(--font-typewriter);
    font-size: 0.85rem;
    background-color: rgba(0,0,0,0.03);
    border-left: 3px solid var(--ink-black);
    padding: 10px 15px;
    font-style: italic;
    color: var(--ink-black);
}

/* Footer / Signature */
.signature-section {
    margin-top: 60px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.signature-block {
    text-align: right;
    margin-bottom: 20px;
}

.signature-block p {
    font-family: var(--font-typewriter);
    font-size: 0.9rem;
    margin: 0 0 10px 0;
}

.signature {
    border-bottom: 1px solid var(--ink-black);
    padding: 0 20px 5px 20px;
    display: inline-block;
}

.scribble {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 1.5rem;
    letter-spacing: -2px;
    opacity: 0.8;
}

.warning-footer {
    width: 100%;
    text-align: center;
    font-family: var(--font-typewriter);
    font-size: 0.8rem;
    letter-spacing: 2px;
    border-top: 2px solid var(--ink-black);
    padding-top: 15px;
    margin-top: 20px;
}

/* Extremely subtle horror text fixed to screen */
.whisper-text {
    position: fixed;
    bottom: 20px;
    right: 30px;
    font-family: 'Playfair Display', serif;
    font-style: italic;
    color: #fff;
    opacity: 0;
    font-size: 0.8rem;
    pointer-events: none;
    transition: opacity 2s ease-in-out;
    z-index: 10;
}

/* Responsive */
@media (max-width: 600px) {
    .document-container {
        padding: 30px 20px;
    }
    .report-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    .seal-container {
        width: 100px;
        height: 100px;
        align-self: center;
    }
    .stamp {
        font-size: 1rem;
        padding: 3px 5px;
    }
    .classification-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .title-block h1 {
        font-size: 1.5rem;
    }
    .data-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    .memo-column {
        width: 100%;
        margin-left: 0;
        box-sizing: border-box;
    }
    .nova-stamp {
        font-size: 1.2rem;
        letter-spacing: 2px;
    }
}

/* Detail Page Specific Styles */
.nova-stamp {
    color: #6a0000;
    border-color: #6a0000;
    background-color: rgba(106, 0, 0, 0.05);
    font-size: 2rem;
    letter-spacing: 5px;
    animation: nova-pulse 3s infinite alternate;
    text-shadow: 0 0 5px rgba(106, 0, 0, 0.5);
}

@keyframes nova-pulse {
    0% { transform: rotate(-5deg) scale(1); }
    100% { transform: rotate(-5deg) scale(1.05); }
}

.memo-column {
    background-color: #f9f6e8;
    border: 1px solid #d4c5a9;
    padding: 20px;
    margin: 30px 0;
    font-family: 'Zen Old Mincho', serif;
    font-size: 0.95rem;
    color: #4a4036;
    box-shadow: 2px 5px 15px rgba(0,0,0,0.2);
    position: relative;
    transform: rotate(1deg);
    width: 80%;
    margin-left: auto;
}

.memo-column::before {
    content: "※研究員メモ";
    display: block;
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 0.8rem;
    color: #8b1e1e;
    margin-bottom: 10px;
    border-bottom: 1px dashed #d4c5a9;
    padding-bottom: 5px;
}

/* A simple CSS paper clip */
.paper-clip {
    position: absolute;
    top: -15px;
    left: 20px;
    width: 15px;
    height: 40px;
    border: 3px solid #888;
    border-radius: 10px;
    background-color: transparent;
    z-index: 5;
    box-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    transform: rotate(-10deg);
}
.paper-clip::after {
    content: "";
    position: absolute;
    top: 5px;
    left: 2px;
    width: 5px;
    height: 25px;
    border: 3px solid #888;
    border-radius: 5px;
    border-bottom: none;
    border-right: none;
}
