/* =========================================
   double-standard.xyz - Anti-Design Confrontationalism
   ========================================= */

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

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

body {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.7;
    letter-spacing: 0.01em;
    color: #2C2C2C;
    background-color: #FAFAFA;
    overflow-x: hidden;
}

/* --- Color Variables (for reference) ---
   Institutional White: #FAFAFA
   Corporate Charcoal: #2C2C2C
   Cardinal Red: #C41E3A
   Deep Black: #0D0D0D
   Audit Sage: #6B8F71
   Bureaucratic Gray: #B8B8B8
   Caution Amber: #D4A017
   Bruise Purple: #4A2545
   Border Gray: #D0D0D0
   Placeholder Border: #E0E0E0
   Light Text: #F0F0F0
   Near Black: #1A1A1A
*/

/* --- Panels --- */
.panel {
    min-height: 100vh;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.panel-institutional {
    background-color: #FAFAFA;
    color: #2C2C2C;
}

.panel-truth {
    background-color: #0D0D0D;
    color: #F0F0F0;
}

/* --- OPENING SEQUENCE --- */
#opening {
    display: flex;
    align-items: center;
    justify-content: center;
}

.opening-content {
    text-align: center;
    position: relative;
}

.opening-line {
    opacity: 0;
    font-size: 20px;
    line-height: 1.5;
}

.institutional-line {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    color: #2C2C2C;
    animation: fadeInLine 800ms 300ms forwards;
}

.dissident-line {
    font-family: 'Zilla Slab', serif;
    font-weight: 700;
    color: #C41E3A;
    margin-top: 32px;
    animation: fadeInLine 800ms 3100ms forwards;
}

.redaction-bar-opening {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    height: 30px;
    width: 0;
    background-color: #0D0D0D;
    animation: redactSlide 600ms 4600ms forwards;
    pointer-events: none;
}

@keyframes fadeInLine {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes redactSlide {
    from { width: 0; }
    to { width: 420px; }
}

/* --- NAVIGATION --- */
.nav-bar {
    display: flex;
    justify-content: center;
    gap: 48px;
    padding: 24px 0;
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    font-size: 14px;
    letter-spacing: 0.02em;
    color: #2C2C2C;
    border-bottom: 1px solid #D0D0D0;
    grid-column: 1 / -1;
}

.nav-item {
    text-transform: uppercase;
    cursor: default;
}

.nav-scrambled {
    border-bottom: none;
    border-top: 1px solid #D0D0D0;
    margin-top: 48px;
}

.nav-scrambled .nav-item:nth-child(2) {
    transform: translateY(4px);
}

.nav-scrambled .nav-item:nth-child(4) {
    opacity: 0.4;
}

/* --- PRISTINE GRID --- */
.grid-pristine {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
    padding: 48px;
    max-width: 1200px;
    margin: 0 auto;
}

.grid-block {
    border: 1px solid #D0D0D0;
    padding: 48px;
    position: relative;
}

.block-1 {
    grid-column: 1 / 8;
}

.block-2 {
    grid-column: 8 / 13;
}

.block-3 {
    grid-column: 1 / 7;
}

.block-placeholder {
    grid-column: 7 / 13;
    border: 1px dashed #E0E0E0;
    min-height: 120px;
}

.block-wide {
    grid-column: 1 / 10;
}

.block-overlap {
    grid-column: 7 / 13;
    margin-top: -40px;
    z-index: 2;
    background: #FAFAFA;
}

.block-gap {
    grid-column: 1 / 5;
    border: 1px dashed #E0E0E0;
    min-height: 80px;
}

.block-small {
    grid-column: 5 / 13;
}

.block-misaligned {
    grid-column: 1 / 9;
}

.block-stacked {
    grid-column: 9 / 13;
    margin-top: 0;
}

.block-floating {
    grid-column: 2 / 12;
    margin-top: 24px;
}

/* --- DRIFTING GRID (The Drift) --- */
.grid-drifting .drift-3 {
    transform: rotate(-0.5deg);
}

.grid-drifting .drift-4 {
    transform: translateX(12px) rotate(0.3deg);
}

.grid-drifting .drift-5 {
    transform: translateX(-8px);
}

/* --- COLLAPSED GRID (The Collapse) --- */
.grid-collapsed .drift-6 {
    transform: rotate(-1.5deg) translateX(-15px);
}

.grid-collapsed .drift-7 {
    transform: rotate(2deg) translateX(20px) translateY(-10px);
}

.grid-collapsed .block-stacked {
    margin-top: -20px;
}

/* --- TYPOGRAPHY: Institutional --- */
.institutional-heading {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 600;
    font-size: 28px;
    line-height: 1.3;
    letter-spacing: 0.01em;
    color: #2C2C2C;
    margin-bottom: 16px;
}

.institutional-subheading {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 600;
    font-size: 20px;
    line-height: 1.3;
    color: #2C2C2C;
    margin-bottom: 12px;
}

.institutional-text {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.7;
    letter-spacing: 0.01em;
    color: #2C2C2C;
}

.small-text {
    font-size: 13px;
    margin-top: 16px;
    opacity: 0.6;
}

/* --- TYPOGRAPHY: Dissident --- */
.dissident-headline {
    font-family: 'Zilla Slab', serif;
    font-weight: 700;
    font-size: 48px;
    line-height: 1.1;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #C41E3A;
    margin-bottom: 32px;
    position: relative;
}

.dissident-headline[data-echo]::after {
    content: attr(data-echo);
    position: absolute;
    top: 0;
    left: 0;
    transform: translate(4px, 2px);
    color: #4A2545;
    mix-blend-mode: multiply;
    opacity: 0.35;
    pointer-events: none;
}

.dissident-text {
    font-family: 'Zilla Slab', serif;
    font-weight: 400;
    font-size: 22px;
    line-height: 1.5;
    letter-spacing: 0.02em;
    color: #F0F0F0;
}

/* --- TYPOGRAPHY: Data Voice --- */
.data-voice {
    font-family: 'Fira Code', monospace;
    font-weight: 400;
    font-size: 14px;
    line-height: 1.6;
    color: #6B8F71;
}

.data-terminal {
    border-left: 1px solid #C41E3A;
    padding: 24px;
    margin: 24px 0;
    background: rgba(13, 13, 13, 0.5);
}

.data-terminal .data-voice {
    display: block;
    margin-bottom: 4px;
}

/* --- TRUTH PANELS --- */
.truth-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 48px;
    position: relative;
}

.truth-block {
    margin-bottom: 40px;
    position: relative;
}

/* Drift transforms (applied via JS on scroll) */
.drift-zone .drift-1 {
    transform: rotate(-0.8deg) translateX(12px);
}

.drift-zone .drift-2 {
    transform: translateX(-20px);
}

/* Collapse transforms */
.collapse-zone .collapse-1 {
    transform: rotate(0.5deg);
}

.collapse-zone .collapse-2 {
    margin-top: 60px;
}

.full-collapse .collapse-3 {
    transform: rotate(-1.2deg) translateX(25px);
    margin-left: -20px;
}

.full-collapse .collapse-4 {
    transform: translateX(-30px) rotate(0.8deg);
}

/* Upside-down block */
.upside-down {
    transform: rotate(180deg) !important;
    padding: 32px;
    border: 1px solid #C41E3A;
    margin-top: 80px;
}

/* --- REDACTION BARS --- */
.redaction {
    position: relative;
    cursor: pointer;
    display: inline;
}

.redaction::before {
    content: '';
    position: absolute;
    top: 0;
    left: -2px;
    right: -2px;
    bottom: 0;
    background-color: #0D0D0D;
    opacity: 1;
    transition: opacity 400ms ease;
    z-index: 1;
}

.panel-institutional .redaction::before {
    background-color: #0D0D0D;
}

.panel-truth .redaction::before {
    background-color: #FAFAFA;
}

.redaction.revealed::before {
    opacity: 0.08;
}

.redaction .redaction-text {
    position: relative;
    z-index: 2;
    font-family: 'Zilla Slab', serif;
    font-weight: 700;
    color: #C41E3A;
    opacity: 0;
    transition: opacity 400ms ease;
}

.redaction.revealed .redaction-text {
    opacity: 1;
}

/* Permanent redactions - no reveal */
.redaction.permanent::before {
    opacity: 1 !important;
    cursor: default;
}

.redaction.permanent {
    cursor: default;
}

/* --- STAMP MARKS --- */
.stamp {
    width: 120px;
    height: 120px;
    border: 2px solid #C41E3A;
    border-radius: 50%;
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 2px transparent, 0 0 0 4px #C41E3A;
    right: 48px;
    top: 80px;
}

.stamp-text {
    font-family: 'Zilla Slab', serif;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    color: #C41E3A;
    letter-spacing: 0.05em;
}

.stamp-date {
    font-family: 'Fira Code', monospace;
    font-size: 10px;
    color: #C41E3A;
    margin-top: 4px;
}

.stamp-2 {
    right: auto;
    left: 48px;
    top: 120px;
}

.stamp-3 {
    right: 120px;
    top: auto;
    bottom: 80px;
}

/* --- DIAGONAL STRIKETHROUGH --- */
.diagonal-strike {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.diagonal-strike::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 141.4%;
    height: 1px;
    background: #C41E3A;
    transform-origin: 0 0;
    transform: rotate(25deg);
}

/* --- HEXAGONAL CLUSTERS --- */
.hex-section {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.hex-cluster {
    position: relative;
    width: 520px;
    height: 460px;
}

.hex {
    position: absolute;
    width: 160px;
    height: 160px;
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    background-color: #C41E3A;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: transform 800ms cubic-bezier(0.68, -0.55, 0.27, 1.55), opacity 400ms ease;
}

.hex span {
    font-family: 'Fira Code', monospace;
    font-weight: 400;
    font-size: 14px;
    color: #FAFAFA;
    text-align: center;
    z-index: 1;
}

.hex.hex-active {
    opacity: 1;
}

/* Honeycomb positions (center hex at ~180,150) */
.hex-center { left: 180px; top: 150px; }
.hex-top { left: 180px; top: 10px; }
.hex-top-right { left: 300px; top: 80px; }
.hex-bottom-right { left: 300px; top: 220px; }
.hex-bottom { left: 180px; top: 290px; }
.hex-bottom-left { left: 60px; top: 220px; }
.hex-top-left { left: 60px; top: 80px; }

/* Scattered starting positions */
.hex-cluster:not(.assembled) .hex-center { transform: translate(100px, -80px) rotate(45deg); }
.hex-cluster:not(.assembled) .hex-top { transform: translate(-150px, 200px) rotate(-30deg); }
.hex-cluster:not(.assembled) .hex-top-right { transform: translate(200px, -150px) rotate(60deg); }
.hex-cluster:not(.assembled) .hex-bottom-right { transform: translate(-100px, 180px) rotate(-45deg); }
.hex-cluster:not(.assembled) .hex-bottom { transform: translate(180px, 50px) rotate(30deg); }
.hex-cluster:not(.assembled) .hex-bottom-left { transform: translate(-200px, -100px) rotate(-60deg); }
.hex-cluster:not(.assembled) .hex-top-left { transform: translate(150px, 150px) rotate(45deg); }

.hex-cluster.assembled .hex {
    transform: translate(0, 0) rotate(0deg);
}

/* --- TYPEWRITER MARGINS --- */
.typewriter-margin {
    position: absolute;
    font-family: 'Fira Code', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #6B8F71;
    white-space: nowrap;
    overflow: hidden;
    width: 0;
}

.typewriter-left {
    left: -240px;
    top: 120px;
}

.typewriter-right {
    right: -280px;
    top: 120px;
}

.typewriter-margin.typing {
    animation: typewriterExpand 2s steps(60, end) forwards;
}

@keyframes typewriterExpand {
    from { width: 0; }
    to { width: 500px; }
}

/* --- FLOATING FRAGMENTS --- */
.floating-fragments {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

.fragment {
    position: absolute;
    font-family: 'Fira Code', monospace;
    font-size: 11px;
    color: #B8B8B8;
    opacity: 0.6;
}

.fragment-1 {
    left: 20px;
    top: 15%;
    animation: fragmentDrift1 20s ease-in-out infinite;
}

.fragment-2 {
    right: 30px;
    top: 25%;
    animation: fragmentDrift2 22s ease-in-out infinite;
}

.fragment-3 {
    left: 15px;
    top: 45%;
    animation: fragmentDrift1 18s ease-in-out infinite reverse;
}

.fragment-4 {
    right: 25px;
    top: 55%;
    animation: fragmentDrift2 24s ease-in-out infinite;
}

.fragment-5 {
    left: 25px;
    top: 70%;
    animation: fragmentDrift1 21s ease-in-out infinite;
}

.fragment-6 {
    right: 20px;
    top: 80%;
    animation: fragmentDrift2 19s ease-in-out infinite reverse;
}

.fragment-7 {
    left: 10px;
    top: 35%;
    animation: fragmentDrift1 23s ease-in-out infinite;
}

.fragment-8 {
    right: 15px;
    top: 65%;
    animation: fragmentDrift2 17s ease-in-out infinite reverse;
}

@keyframes fragmentDrift1 {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-40px); }
}

@keyframes fragmentDrift2 {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(30px); }
}

/* --- MISREGISTRATION OVERLAYS --- */
.finale-text {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 600;
    font-size: 32px;
    line-height: 1.3;
    text-align: center;
    position: relative;
}

.finale-text[data-echo]::after {
    content: attr(data-echo);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    transform: translate(4px, 2px);
    color: #4A2545;
    mix-blend-mode: multiply;
    opacity: 0.35;
    pointer-events: none;
}

/* --- FINALE --- */
.finale-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 48px;
    gap: 48px;
}

.finale-counter {
    font-family: 'Zilla Slab', serif;
    font-weight: 700;
    font-size: 64px;
    color: #C41E3A;
    opacity: 0;
    transition: opacity 1s ease;
}

.finale-counter.visible {
    opacity: 1;
}

/* --- SCROLL-TRIGGERED VISIBILITY --- */
.truth-block,
.grid-block {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 600ms ease, transform 600ms ease;
}

.truth-block.in-view,
.grid-block.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* Preserve intentional drift transforms when in view */
.drift-zone .drift-1.in-view {
    transform: rotate(-0.8deg) translateX(12px);
}

.drift-zone .drift-2.in-view {
    transform: translateX(-20px);
}

.collapse-zone .collapse-1.in-view {
    transform: rotate(0.5deg);
}

.full-collapse .collapse-3.in-view {
    transform: rotate(-1.2deg) translateX(25px);
}

.full-collapse .collapse-4.in-view {
    transform: translateX(-30px) rotate(0.8deg);
}

.grid-drifting .drift-3.in-view {
    transform: rotate(-0.5deg);
}

.grid-drifting .drift-4.in-view {
    transform: translateX(12px) rotate(0.3deg);
}

.grid-drifting .drift-5.in-view {
    transform: translateX(-8px);
}

.grid-collapsed .drift-6.in-view {
    transform: rotate(-1.5deg) translateX(-15px);
}

.grid-collapsed .drift-7.in-view {
    transform: rotate(2deg) translateX(20px) translateY(-10px);
}

.upside-down.in-view {
    transform: rotate(180deg) !important;
}

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
    .grid-pristine {
        grid-template-columns: 1fr;
        padding: 24px;
    }

    .grid-block,
    .block-1, .block-2, .block-3, .block-placeholder,
    .block-wide, .block-overlap, .block-gap, .block-small,
    .block-misaligned, .block-stacked, .block-floating {
        grid-column: 1 / -1;
    }

    .block-overlap {
        margin-top: 0;
    }

    .dissident-headline {
        font-size: 32px;
    }

    .truth-content {
        padding: 48px 24px;
    }

    .hex-cluster {
        transform: scale(0.65);
    }

    .typewriter-margin {
        display: none;
    }

    .nav-bar {
        gap: 24px;
        flex-wrap: wrap;
        font-size: 12px;
    }

    .floating-fragments {
        display: none;
    }

    .stamp {
        width: 80px;
        height: 80px;
    }

    .stamp-text {
        font-size: 10px;
    }

    .stamp-date {
        font-size: 8px;
    }

    .redaction-bar-opening {
        max-width: 90vw;
    }
}