/* ===== RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    background: #0A0A0F;
    color: #D4D0C8;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: clamp(0.85rem, 1.2vw, 1rem);
    line-height: 1.75;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ===== SCAN LINE OVERLAY ===== */
#scanline-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        transparent 0px,
        transparent 2px,
        rgba(10, 10, 15, 0.3) 2px,
        rgba(10, 10, 15, 0.3) 4px
    );
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.6s ease;
}

#scanline-overlay.active {
    opacity: 0.15;
}

/* ===== SCROLL PROGRESS BAR ===== */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 0%;
    background: #C41E3A;
    z-index: 10000;
    transition: width 0.05s linear;
}

/* ===== PAGE INDICATOR ===== */
#page-indicator {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 500;
    font-size: 0.75rem;
    color: #A8A4A0;
    opacity: 0.6;
    z-index: 9998;
    letter-spacing: 0.15em;
}

/* ===== GHOST TEXT ===== */
.ghost-text {
    position: fixed;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.7rem;
    color: #6B6660;
    opacity: 0.05;
    z-index: 1;
    pointer-events: none;
    white-space: nowrap;
    animation: ghostPulse 8s ease-in-out infinite;
}

.ghost-text-1 { top: 15%; left: 3%; animation-delay: 0s; }
.ghost-text-2 { top: 35%; right: 2%; animation-delay: 1.2s; }
.ghost-text-3 { top: 55%; left: 1%; animation-delay: 2.4s; }
.ghost-text-4 { top: 72%; right: 4%; animation-delay: 3.6s; }
.ghost-text-5 { top: 25%; left: 5%; animation-delay: 4.8s; }
.ghost-text-6 { top: 48%; right: 1%; animation-delay: 6s; }
.ghost-text-7 { top: 85%; left: 2%; animation-delay: 7.2s; }
.ghost-text-8 { top: 62%; right: 3%; animation-delay: 0.8s; }

@keyframes ghostPulse {
    0%, 100% { opacity: 0.05; }
    50% { opacity: 0.25; }
}

/* ===== DOSSIER PAGES ===== */
.dossier-page {
    min-height: 100vh;
    position: relative;
    padding: 4rem 2rem;
    filter: contrast(1.05) brightness(0.98);
}

/* ===== SECTION HEADINGS ===== */
.section-heading {
    font-family: 'Special Elite', cursive;
    font-weight: 400;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    color: #D4D0C8;
    letter-spacing: 0.08em;
    margin-bottom: 2rem;
    text-transform: uppercase;
}

/* ===== CLASSIFICATION STAMPS ===== */
.stamp-mark {
    font-family: 'Special Elite', cursive;
    font-weight: 400;
    color: #C41E3A;
    border: 2px solid #C41E3A;
    padding: 0.3em 0.8em;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    white-space: nowrap;
}

.stamp-float {
    position: absolute;
    z-index: 5;
}

.stamp-draft {
    top: 6rem;
    right: 4rem;
    transform: rotate(-12deg);
    opacity: 0.7;
    font-size: 0.9rem;
}

.stamp-redacted {
    top: 5rem;
    left: 5rem;
    transform: rotate(-8deg);
    opacity: 0.6;
    font-size: 1.1rem;
}

.stamp-eyes-only {
    top: 4rem;
    right: 6rem;
    transform: rotate(5deg);
    opacity: 0.8;
    font-size: 1rem;
}

.stamp-eyes {
    font-size: 0.8rem;
    opacity: 0.5;
    transform: rotate(-12deg);
}

/* =============================================================
   PAGE 01 — THE COVER SHEET
   ============================================================= */
#page-01 {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 0;
}

.cover-sheet {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#center-line {
    width: 60%;
    height: 2px;
    opacity: 0;
    transition: opacity 1s ease;
}

#center-line.drawn {
    opacity: 1;
}

#center-line line {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 1.5s ease-in-out;
}

#center-line.drawn line {
    stroke-dashoffset: 0;
}

.domain-title {
    font-family: 'Special Elite', cursive;
    font-weight: 400;
    font-size: clamp(1.8rem, 4vw, 3.5rem);
    color: #D4D0C8;
    letter-spacing: 0.08em;
    margin-top: 2rem;
    opacity: 0;
    transition: opacity 2s ease;
}

.domain-title.visible {
    opacity: 1;
}

.declassified-stamp {
    font-family: 'Special Elite', cursive;
    font-weight: 400;
    font-size: clamp(1.4rem, 3vw, 2.5rem);
    color: #C41E3A;
    letter-spacing: 0.08em;
    margin-bottom: 2rem;
    min-height: 1.5em;
}

.diagonal-stripe {
    position: absolute;
    width: 150%;
    height: 8px;
    background: rgba(196, 30, 58, 0.4);
    transform: rotate(-35deg);
    top: 50%;
    left: -25%;
    opacity: 0;
    transform-origin: center;
    transition: opacity 0.3s ease;
}

.diagonal-stripe.visible {
    animation: stripeSlide 3s ease forwards;
}

@keyframes stripeSlide {
    0% {
        opacity: 0;
        transform: rotate(-35deg) translateX(-100%);
    }
    30% {
        opacity: 1;
    }
    100% {
        opacity: 1;
        transform: rotate(-35deg) translateX(0);
    }
}

.cover-classification {
    position: absolute;
    top: 8%;
    left: 6%;
}

/* =============================================================
   PAGE 02 — THE BRIEFING
   ============================================================= */
#page-02 {
    background: #0A0A0F;
    padding-top: 6rem;
    padding-bottom: 6rem;
}

.briefing-container {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 4rem;
    max-width: 1200px;
    margin: 0 auto;
}

.briefing-left,
.briefing-right {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.briefing-left.visible,
.briefing-right.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Redacted Text */
.redacted-block {
    margin-top: 1rem;
}

.redacted-text {
    color: #A8A4A0;
    margin-bottom: 1.5rem;
    line-height: 2;
    position: relative;
}

.redaction-bar {
    position: relative;
    display: inline;
}

.redaction-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1.2em;
    background: #0D0D0D;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.6s ease;
    z-index: 2;
}

.redaction-bar.active::after {
    transform: scaleX(1);
}

.redaction-bar.pulse::after {
    box-shadow: 0 0 8px rgba(196, 30, 58, 0.15);
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline-line {
    position: absolute;
    left: 0;
    top: 0;
    width: 2px;
    height: 100%;
}

.timeline-line line {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    transition: stroke-dashoffset 2s ease;
}

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

.timeline-node {
    position: relative;
    margin-bottom: 2.5rem;
    padding-left: 1.5rem;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.timeline-node.visible {
    opacity: 1;
    transform: scale(1);
}

.node-dot {
    position: absolute;
    left: -2.35rem;
    top: 0.5em;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #C41E3A;
    box-shadow: 0 0 0 0 rgba(196, 30, 58, 0.6);
}

.timeline-node.visible .node-dot {
    animation: nodePing 1s ease forwards;
}

@keyframes nodePing {
    0% {
        box-shadow: 0 0 0 0 rgba(196, 30, 58, 0.6);
    }
    100% {
        box-shadow: 0 0 0 20px rgba(196, 30, 58, 0);
    }
}

.node-content {
    display: flex;
    flex-direction: column;
}

.node-date {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 500;
    font-size: 0.75rem;
    color: #D4A017;
    letter-spacing: 0.1em;
    margin-bottom: 0.25rem;
}

.node-text {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    color: #A8A4A0;
    font-size: 0.85rem;
}

/* =============================================================
   PAGE 03 — THE EVIDENCE WALL
   ============================================================= */
#page-03 {
    background: #0A0A0F;
    padding-top: 6rem;
    padding-bottom: 6rem;
    min-height: 120vh;
}

.evidence-heading {
    text-align: center;
}

.evidence-wall {
    position: relative;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 2rem auto 0;
    padding: 2rem;
}

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

.conspiracy-lines line {
    stroke: #D4A017;
    stroke-width: 1;
    opacity: 0.3;
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    transition: stroke-dashoffset 1.5s ease, opacity 0.3s ease;
}

.conspiracy-lines line.drawn {
    stroke-dashoffset: 0;
}

/* Evidence Cards */
.evidence-card {
    background: #1A1A24;
    padding: 0;
    position: relative;
    z-index: 2;
    perspective: 800px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    box-shadow: 4px 4px 0 #0D0D0D;
    cursor: default;
}

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

.evidence-card[data-rotation="1"].visible { transform: rotate(1deg); }
.evidence-card[data-rotation="2"].visible { transform: rotate(2deg); }
.evidence-card[data-rotation="3"].visible { transform: rotate(3deg); }
.evidence-card[data-rotation="4"].visible { transform: rotate(4deg); }
.evidence-card[data-rotation="-1"].visible { transform: rotate(-1deg); }
.evidence-card[data-rotation="-2"].visible { transform: rotate(-2deg); }
.evidence-card[data-rotation="-3"].visible { transform: rotate(-3deg); }

.evidence-card:hover {
    transform: translateY(-4px) rotate(0deg) !important;
    z-index: 10;
}

.card-inner {
    position: relative;
    width: 100%;
    min-height: 200px;
    transition: transform 0.6s ease;
    transform-style: preserve-3d;
}

.evidence-card[data-card="classified"] .card-inner {
    cursor: pointer;
}

.evidence-card[data-card="classified"]:not(.flipped) .card-inner {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    padding: 1.5rem;
    backface-visibility: hidden;
}

.card-front {
    position: relative;
}

.card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotateY(180deg);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1A1A24;
    border: 1px dashed #C41E3A;
}

.classified-label {
    font-family: 'Special Elite', cursive;
    font-size: 1.6rem;
    color: #C41E3A;
    letter-spacing: 0.2em;
    opacity: 0.8;
    transform: rotate(-12deg);
    border: 2px solid #C41E3A;
    padding: 0.3em 0.8em;
}

.card-label {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 500;
    font-size: 0.7rem;
    color: #D4A017;
    letter-spacing: 0.15em;
    display: block;
    margin-bottom: 0.8rem;
}

.card-text {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.8rem;
    color: #A8A4A0;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.card-date {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 500;
    font-size: 0.65rem;
    color: #6B6660;
    letter-spacing: 0.1em;
}

/* Static redaction bars within cards */
.redaction-bar-static {
    display: inline-block;
    background: #0D0D0D;
    width: clamp(40px, 8vw, 100px);
    height: 1.2em;
    vertical-align: middle;
}

/* =============================================================
   PAGE 04 — THE HEARING ROOM
   ============================================================= */
#page-04 {
    background: #0A0A0F;
    padding-top: 6rem;
    padding-bottom: 6rem;
}

.hearing-heading {
    text-align: center;
    margin-bottom: 3rem;
}

.hearing-room {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.transcript-line {
    position: relative;
    margin-bottom: 2rem;
    padding-left: 1rem;
    border-left: 2px solid transparent;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.transcript-line.visible {
    opacity: 1;
    transform: translateY(0);
}

.transcript-line[data-speaker="CHAIR"] {
    border-left-color: #C41E3A;
}

.transcript-line[data-speaker="COUNSEL"] {
    border-left-color: #D4A017;
}

.transcript-line[data-speaker="WITNESS"] {
    border-left-color: #2A4A2A;
}

.speaker-label {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: clamp(0.9rem, 1.2vw, 1.05rem);
    color: #E8E4DF;
    display: block;
    margin-bottom: 0.4rem;
    letter-spacing: 0.05em;
}

.speaker-text {
    font-family: 'Libre Baskerville', serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.4vw, 1.15rem);
    color: #E8E4DF;
    line-height: 2.0;
    display: block;
}

.speaker-text .scramble-word {
    display: inline;
    background: #0D0D0D;
    color: #0D0D0D;
    padding: 0 0.2em;
}

.margin-annotation {
    position: absolute;
    right: -180px;
    top: 0.5rem;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.65rem;
    color: #6B6660;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    white-space: nowrap;
    font-style: italic;
}

.transcript-line.visible .margin-annotation {
    opacity: 0.25;
    transform: translateX(0);
}

/* =============================================================
   PAGE 05 — THE ARCHIVE
   ============================================================= */
#page-05 {
    background: #0A0A0F;
    padding-top: 6rem;
    padding-bottom: 6rem;
    overflow: hidden;
}

.archive-heading {
    text-align: center;
    margin-bottom: 2rem;
}

.archive-shelf {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 4px;
    padding: 2rem;
    height: 70vh;
    align-items: stretch;
    scrollbar-width: thin;
    scrollbar-color: #C41E3A #0A0A0F;
}

.archive-shelf::-webkit-scrollbar {
    height: 4px;
}

.archive-shelf::-webkit-scrollbar-track {
    background: #0A0A0F;
}

.archive-shelf::-webkit-scrollbar-thumb {
    background: #C41E3A;
}

.archive-spine {
    flex: 0 0 60px;
    min-width: 60px;
    background: #1A1A24;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: flex 0.4s ease, min-width 0.4s ease;
    scroll-snap-align: start;
    overflow: hidden;
    border-right: 1px solid rgba(107, 102, 96, 0.15);
}

.archive-spine[data-hue="15"] { background: hsl(240, 10%, 12.5%); }
.archive-spine[data-hue="30"] { background: hsl(240, 8%, 13%); }
.archive-spine[data-hue="45"] { background: hsl(220, 10%, 12%); }
.archive-spine[data-hue="60"] { background: hsl(230, 12%, 13%); }
.archive-spine[data-hue="75"] { background: hsl(250, 10%, 12%); }
.archive-spine[data-hue="90"] { background: hsl(260, 8%, 13%); }
.archive-spine[data-hue="105"] { background: hsl(200, 10%, 12%); }
.archive-spine[data-hue="120"] { background: hsl(210, 12%, 12.5%); }

.archive-spine:hover {
    flex: 0 0 300px;
    min-width: 300px;
}

.spine-label {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 500;
    font-size: 0.7rem;
    color: #A8A4A0;
    letter-spacing: 0.1em;
    white-space: nowrap;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transition: writing-mode 0.3s ease, opacity 0.3s ease;
}

.archive-spine:hover .spine-label {
    writing-mode: horizontal-tb;
    font-size: 0.85rem;
    color: #D4D0C8;
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
}

.spine-preview {
    display: none;
    padding: 1.5rem;
    padding-top: 3.5rem;
}

.archive-spine:hover .spine-preview {
    display: block;
}

.spine-preview p {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.75rem;
    color: #A8A4A0;
    line-height: 1.7;
}

/* End of file spine */
.spine-end {
    background: #0D0D0D;
    border: 1px dashed #C41E3A;
    flex: 0 0 120px;
    min-width: 120px;
    flex-direction: column;
    gap: 1rem;
}

.spine-end:hover {
    flex: 0 0 120px;
    min-width: 120px;
}

.spine-label-end {
    font-family: 'Special Elite', cursive;
    font-size: 0.9rem;
    color: #C41E3A;
    writing-mode: horizontal-tb;
    text-align: center;
}

.archive-spine:hover .spine-label-end {
    position: static;
    font-size: 0.9rem;
    color: #C41E3A;
}

.end-timestamp {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 500;
    font-size: 0.65rem;
    color: #D4A017;
    letter-spacing: 0.05em;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    margin-top: 1rem;
}

.spine-end:hover .end-timestamp {
    writing-mode: horizontal-tb;
}

/* =============================================================
   MOBILE RESPONSIVE
   ============================================================= */
@media (max-width: 768px) {
    .briefing-container {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .margin-annotation {
        position: relative;
        right: auto;
        top: auto;
        display: block;
        margin-top: 0.5rem;
    }

    .stamp-float {
        display: none;
    }

    .evidence-wall {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .archive-shelf {
        flex-direction: column;
        height: auto;
        overflow-x: visible;
        overflow-y: auto;
        scroll-snap-type: y mandatory;
    }

    .archive-spine {
        flex: 0 0 auto;
        min-width: 100%;
        min-height: 80px;
        writing-mode: horizontal-tb;
    }

    .spine-label {
        writing-mode: horizontal-tb;
    }

    .archive-spine:hover {
        flex: 0 0 auto;
        min-width: 100%;
    }

    .spine-end {
        flex: 0 0 auto;
        min-width: 100%;
    }

    .end-timestamp {
        writing-mode: horizontal-tb;
    }
}
