/* ============================================
   double-standard.xyz — Styles
   Forensic exhibit of hypocrisy
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: #D4D0C8;
    color: #2B2B2B;
    font-family: 'Source Serif 4', 'Georgia', serif;
    font-size: 1.1rem;
    line-height: 1.65;
    overflow-x: hidden;
    position: relative;
}

/* --- Noise / Grain Overlay --- */
#noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* --- Highlighter Mark --- */
mark {
    background: none;
    /* Evidence Yellow: #E8D44D at 60% opacity */
    background-image: linear-gradient(to bottom, transparent 55%, #E8D44D99 55%);
    color: inherit;
    padding: 0 2px;
}

/* --- Margin of Dissent (Left Sidebar) --- */
#margin-of-dissent {
    position: fixed;
    top: 0;
    left: 0;
    width: 60px;
    height: 100vh;
    z-index: 100;
    pointer-events: none;
    overflow: hidden;
}

#margin-of-dissent .annotation {
    position: absolute;
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: 0.95rem;
    color: #C41E3A;
    white-space: nowrap;
    transform: rotate(-90deg);
    transform-origin: left center;
    left: 30px;
}

/* Hide sidebar on narrow viewports */
@media (max-width: 900px) {
    #margin-of-dissent {
        display: none;
    }
}

/* --- Evidence Wall (Opening 100vh) --- */
#evidence-wall {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 700px;
    overflow: hidden;
    background: #D4D0C8;
}

/* --- SVG Thread Lines --- */
#thread-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.thread {
    stroke: #C41E3A;
    stroke-width: 2;
    fill: none;
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.thread.drawn {
    stroke-dashoffset: 0;
}

.pin {
    fill: #C41E3A;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pin.visible {
    opacity: 1;
}

/* --- Document Fragments --- */
.doc-fragment {
    position: absolute;
    background: #F5F5F0;
    padding: 20px 24px;
    max-width: 280px;
    box-shadow: 2px 3px 8px rgba(0, 0, 0, 0.15);
    z-index: 3;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.25, 0.1, 0.25, 1.0);
    clip-path: polygon(0% 0%, 100% 0.3%, 99.8% 100%, 0.2% 99.7%);
}

.doc-fragment.visible {
    opacity: 1;
}

.doc-fragment p {
    font-family: 'Source Serif 4', serif;
    font-size: 0.95rem;
    line-height: 1.55;
    color: #1A1A1A;
    margin-bottom: 10px;
}

/* --- Document Metadata Stamps --- */
.doc-meta {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    color: #6B6B6B;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    display: block;
    margin-bottom: 8px;
}

/* --- Redaction Bars --- */
.redaction-bar {
    position: relative;
    width: 100%;
    height: 22px;
    margin: 6px 0;
    cursor: pointer;
}

.redaction-bar::before {
    content: attr(data-hidden);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    font-family: 'Source Serif 4', serif;
    font-size: 0.8rem;
    line-height: 22px;
    color: #C41E3A;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.redaction-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0D0D0D;
    opacity: 1;
    transition: opacity 0.3s cubic-bezier(0.25, 0.1, 0.25, 1.0);
    clip-path: polygon(0% 2%, 99.5% 0%, 100% 97%, 0.5% 100%);
}

.redaction-bar:hover::after,
.redaction-bar.revealed::after {
    opacity: 0.15;
}

.redaction-bar.scroll-tease::after {
    opacity: 0.85;
}

/* --- Stamp Marks --- */
.stamp {
    font-family: 'Archivo Black', sans-serif;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    padding: 4px 10px;
    border: 2px solid;
    display: inline-block;
    position: absolute;
    pointer-events: none;
}

.stamp-classified {
    color: #2B4570;
    opacity: 0.4;
    border-color: #2B4570;
    transform: rotate(-12deg);
    top: 10px;
    right: -5px;
}

.stamp-contradicted {
    color: #C41E3A;
    opacity: 0.5;
    border-color: #C41E3A;
    transform: rotate(8deg);
    bottom: 10px;
    right: 10px;
}

.stamp-exhibit {
    color: #2B4570;
    opacity: 0.4;
    border-color: #2B4570;
    transform: rotate(-10deg);
    bottom: 8px;
    right: 8px;
}

/* --- Coffee Stain --- */
/* Coffee stain color: #8B6914 at 4% opacity */
.coffee-stain {
    position: absolute;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: radial-gradient(circle, #8B69140A 30%, transparent 70%);
    top: -10px;
    right: -10px;
    pointer-events: none;
}

/* --- Central Stamp Title --- */
#stamp-title {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    z-index: 10;
    text-align: center;
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1.0), opacity 0.3s ease;
    filter: blur(4px);
}

#stamp-title.stamped {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    filter: blur(0);
}

#stamp-title h1 {
    font-family: 'Archivo Black', sans-serif;
    font-size: clamp(2.5rem, 6vw, 5rem);
    color: #1A1A1A;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    line-height: 1.05;
    border: 4px solid #1A1A1A;
    padding: 15px 30px;
    background: rgba(212, 208, 200, 0.85);
}

/* --- Section Dividers --- */
.section-divider {
    position: relative;
    width: 100%;
    height: 40px;
    margin: 0;
    overflow: hidden;
}

.divider-line {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    background: #3C3C3C;
    transform: translateY(-50%);
}

.divider-redaction {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 10px;
    width: 60px;
    background: #0D0D0D;
}

.divider-redaction.r1 { left: 35%; }
.divider-redaction.r2 { left: 55%; }
.divider-redaction.r3 { left: 75%; }

/* --- Dossier Sections --- */
.dossier-section {
    max-width: 960px;
    margin: 0 auto;
    padding: 60px 40px;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s cubic-bezier(0.25, 0.1, 0.25, 1.0), transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.dossier-section.in-view {
    opacity: 1;
    transform: translateY(0);
}

.dossier-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    padding-bottom: 10px;
    border-bottom: 1px solid #3C3C3C;
}

/* --- Contradiction Pairs --- */
.contradiction-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
}

@media (max-width: 768px) {
    .contradiction-pair {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .dossier-header {
        flex-direction: column;
        gap: 4px;
    }

    .dossier-section {
        padding: 40px 20px;
    }
}

/* --- Cards --- */
.card-white {
    background: #F5F5F0;
    padding: 28px 24px;
    box-shadow: 2px 3px 8px rgba(0, 0, 0, 0.15);
    position: relative;
    clip-path: polygon(0% 0%, 100% 0.2%, 99.8% 100%, 0.1% 99.8%);
}

.card-yellowed {
    background: #F0E8D0;
    padding: 28px 24px;
    box-shadow: 2px 3px 8px rgba(0, 0, 0, 0.12);
    position: relative;
    clip-path: polygon(0.2% 0%, 99.8% 0.3%, 100% 99.7%, 0% 100%);
}

.card-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    color: #6B6B6B;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    display: block;
    margin-bottom: 14px;
    padding-bottom: 6px;
    border-bottom: 1px solid #D4D0C8;
}

.card-white p,
.card-yellowed p {
    font-family: 'Source Serif 4', serif;
    font-size: 1rem;
    line-height: 1.65;
    color: #2B2B2B;
}

/* --- Annotation Inline (Caveat handwriting) --- */
.annotation-inline {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: 1.1rem;
    color: #C41E3A;
    display: block;
    margin-top: 14px;
    transform: rotate(-1.5deg);
}

/* --- Transcript Styling --- */
.transcript-lines {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.transcript-q {
    padding-left: 20px;
    font-style: italic;
}

.transcript-a {
    padding-left: 40px;
}

/* --- Clipping Style --- */
.clipping-style p.clipping-text {
    column-count: 2;
    column-gap: 20px;
    text-align: justify;
    font-size: 0.95rem;
}

@media (max-width: 600px) {
    .clipping-style p.clipping-text {
        column-count: 1;
    }
}

/* --- Z-Pattern: Alternate alignment in dossier sections --- */
#dossier-1 .official-statement { text-align: left; }
#dossier-1 .contradicting-evidence { text-align: right; }

#dossier-2 .official-statement { text-align: right; }
#dossier-2 .contradicting-evidence { text-align: left; }

#dossier-3 .official-statement { text-align: left; }
#dossier-3 .contradicting-evidence { text-align: right; }

#dossier-4 .official-statement { text-align: right; }
#dossier-4 .contradicting-evidence { text-align: left; }

#dossier-5 .official-statement { text-align: left; }
#dossier-5 .contradicting-evidence { text-align: right; }

/* --- Slight rotation on cards for pinned effect --- */
#dossier-1 .card-white { transform: rotate(-0.5deg); }
#dossier-1 .card-yellowed { transform: rotate(0.8deg); }
#dossier-2 .card-white { transform: rotate(0.6deg); }
#dossier-2 .card-yellowed { transform: rotate(-0.7deg); }
#dossier-3 .card-white { transform: rotate(-0.4deg); }
#dossier-3 .card-yellowed { transform: rotate(1.0deg); }
#dossier-4 .card-white { transform: rotate(0.5deg); }
#dossier-4 .card-yellowed { transform: rotate(-0.9deg); }
#dossier-5 .card-white { transform: rotate(-0.6deg); }
#dossier-5 .card-yellowed { transform: rotate(0.7deg); }

/* --- Final Section --- */
#final-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    position: relative;
    transition: background-color 0.8s ease;
    background: #D4D0C8;
}

#final-section.darkened {
    background: #0D0D0D;
}

.final-card {
    max-width: 560px;
    text-align: center;
    padding: 50px 40px;
    position: relative;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s cubic-bezier(0.25, 0.1, 0.25, 1.0), transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.final-card.in-view {
    opacity: 1;
    transform: translateY(0);
}

.final-statement {
    font-family: 'Archivo Black', sans-serif;
    font-size: clamp(1.4rem, 3vw, 2rem);
    color: #1A1A1A;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

#final-section.darkened .final-statement {
    color: #F5F5F0;
}

#final-section.darkened .final-card {
    background: rgba(245, 245, 240, 0.05);
    box-shadow: 2px 3px 8px rgba(0, 0, 0, 0.4);
}

.stamp-case-closed {
    font-family: 'Archivo Black', sans-serif;
    font-size: 1.2rem;
    color: #2B4570;
    opacity: 0.3;
    border: 3px solid #2B4570;
    padding: 8px 20px;
    display: inline-block;
    margin-top: 30px;
    transform: rotate(12deg);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

#final-section.darkened .stamp-case-closed {
    color: #2B4570;
    opacity: 0.5;
    border-color: #2B4570;
}

/* --- Responsive adjustments for evidence wall fragments --- */
@media (max-width: 768px) {
    .doc-fragment {
        max-width: 200px;
        padding: 14px 16px;
        font-size: 0.85rem;
    }

    .doc-fragment p {
        font-size: 0.82rem;
    }

    #stamp-title h1 {
        font-size: clamp(1.8rem, 8vw, 3rem);
        padding: 10px 18px;
        border-width: 3px;
    }

    .fragment-5 {
        display: none;
    }

    .fragment-6 {
        display: none;
    }
}

@media (max-width: 480px) {
    .doc-fragment {
        max-width: 160px;
        padding: 10px 12px;
    }

    .fragment-3,
    .fragment-4 {
        top: 55% !important;
    }
}

/* --- Scrollbar styling --- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #D4D0C8;
}

::-webkit-scrollbar-thumb {
    background: #3C3C3C;
}
