/* ============================================================
   double-standard.org — Contradictory Design Manifesto
   ============================================================ */

/* --- Color Reference ---
   #FAFAFA - Clinical White
   #1A1A1A - True Black
   #0A0A0A - Deep Black
   #E0E0E0 - Grid Ghost (used in SVG patterns)
   #FF003C - Alarm Red
   #FFE81A - Highlighter Yellow
   #FF69B4 - Hot Pink (annotations)
   #2C2C2C - Dark Body
   #F2EADE - Aged Cream
   #333333 - Rule Gray
   #000000 - Black
   Helvetica-adjacent: Space Grotesk
   Instrument Serif, Courier Prime, Bungee Shade, IBM Plex Sans, Space Mono
   IntersectionObserver used for scroll-triggered animations
*/

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

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

body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background: #FAFAFA;
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    color: #2C2C2C;
}

.svg-defs {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* --- The Seam --- */
.seam {
    position: fixed;
    top: 0;
    left: 50%;
    width: 1px;
    height: 100vh;
    background: #000000;
    z-index: 1000;
    pointer-events: none;
    animation: seam-drift 8s ease-in-out infinite, seam-pulse 2s step-end infinite;
    transition: width 1.2s ease-in-out, background 1.2s ease-in-out, opacity 0.3s;
    transform: translateX(-50%);
}

.seam.seam--expanded {
    width: 100vw;
    background: #0A0A0A;
    left: 0;
    transform: translateX(0);
}

.seam.seam--hidden {
    opacity: 0;
}

@keyframes seam-drift {
    0%, 100% { margin-left: 0; }
    50% { margin-left: 3px; }
}

@keyframes seam-pulse {
    0%, 49% { background-color: #000000; }
    50%, 100% { background-color: #FF003C; }
}

/* Glitch flicker */
@keyframes seam-glitch {
    0%, 94%, 96%, 100% { opacity: 1; }
    95% { opacity: 0; }
}

.seam {
    animation: seam-drift 8s ease-in-out infinite, seam-pulse 2s step-end infinite, seam-glitch 6s ease infinite;
}

/* --- Split Section Layout --- */
.split-section {
    display: flex;
    width: 100%;
    min-height: 100vh;
    position: relative;
}

.standard {
    width: 50%;
    position: relative;
    overflow: hidden;
}

.standard--correct {
    background: #FAFAFA;
}

.standard--broken {
    background: #FFE81A;
}

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

.standard--correct .grid-bg {
    opacity: 0;
    transition: opacity 400ms ease;
}

.standard--correct .grid-bg.visible {
    opacity: 0.15;
}

/* --- Typography: Left (Correct) --- */
.standard--correct h1,
.standard--correct h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    color: #1A1A1A;
    letter-spacing: 0.02em;
}

.standard--correct p {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    font-size: 1.05rem;
    line-height: 1.7;
    color: #2C2C2C;
    max-width: 66ch;
}

/* --- Typography: Right (Broken) --- */
.standard--broken h1,
.standard--broken h3 {
    font-family: 'Bungee Shade', cursive;
    font-weight: 400;
    color: #FF003C;
    letter-spacing: -0.03em;
}

.standard--broken p {
    font-family: 'Courier Prime', monospace;
    font-weight: 400;
    font-size: 0.95rem;
    line-height: 1.3;
    color: #1A1A1A;
}

/* --- CSS Annotations --- */
.annotation {
    display: block;
    font-family: 'Space Mono', monospace;
    font-size: 0.65rem;
    color: #FF69B4;
    opacity: 0.7;
    white-space: nowrap;
    position: relative;
    z-index: 2;
}

.css-annotations {
    position: absolute;
    bottom: 18%;
    right: 8%;
    text-align: left;
    z-index: 2;
}

.css-annotations .annotation {
    margin-bottom: 0.4em;
    opacity: 0;
}

.css-annotations .annotation.typed {
    opacity: 0.7;
}

/* Strikethrough motif */
.strikethrough {
    text-decoration: line-through;
    text-decoration-color: #FF003C;
}

/* ============================================================
   SECTION 1: The Declaration
   ============================================================ */
.section-declaration {
    height: 100vh;
    min-height: 100vh;
}

.section-declaration .standard {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

.declaration-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.standard--correct .declaration-word {
    font-size: clamp(2rem, 5vw, 4rem);
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    color: #1A1A1A;
    letter-spacing: 0.02em;
    opacity: 0;
    transition: opacity 600ms ease-out;
}

.standard--broken .declaration-word {
    font-size: clamp(1.8rem, 6vw, 5rem);
    font-family: 'Bungee Shade', cursive;
    font-weight: 400;
    color: #FF003C;
    letter-spacing: -0.03em;
    transform: rotate(3.7deg) translateX(-23px);
    text-transform: lowercase;
    opacity: 0;
    transition: opacity 600ms ease-out;
}

.declaration-word.visible {
    opacity: 1;
}

/* ============================================================
   SECTION 2: The Measurement
   ============================================================ */
.section-measurement {
    min-height: 100vh;
}

.section-measurement .standard {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.measurement-content {
    position: relative;
    z-index: 1;
    padding: 2rem;
    width: 100%;
}

.ruler-container {
    width: 100%;
    margin-bottom: 2rem;
}

.ruler {
    width: 100%;
    height: 60px;
}

.standard--correct .measurement-text {
    max-width: 66ch;
}

.standard--correct .measurement-text p {
    font-size: 1.05rem;
    line-height: 1.7;
}

.standard--broken .measurement-text {
    max-width: none;
}

.standard--broken .measurement-text p {
    font-size: 0.95rem;
    line-height: 1.3;
    font-family: 'Courier Prime', monospace;
}

.standard--broken .measurement-text .annotation {
    margin-top: 1rem;
}

/* --- Ruler Dividers --- */
.ruler-divider {
    position: relative;
    width: 100%;
    height: 60px;
    background: linear-gradient(to right, #FAFAFA 50%, #FFE81A 50%);
    overflow: visible;
}

.ruler-full {
    width: 100%;
    height: 50px;
}

.ruler-triangle {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 12px solid #FF003C;
    z-index: 5;
}

/* ============================================================
   SECTION 3: The Gallery of Rules
   ============================================================ */
.section-gallery {
    min-height: 150vh;
}

.section-gallery .standard {
    min-height: 150vh;
    padding: 4rem 0;
}

.gallery-content {
    position: relative;
    z-index: 1;
    padding: 2rem;
    width: 100%;
}

/* Correct rules grid */
.rules-grid--correct {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}

.rule-card--correct {
    background: #FFFFFF;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    padding: 1.5rem;
}

.rule-card--correct h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: #1A1A1A;
    margin-bottom: 0.75rem;
    letter-spacing: 0.02em;
}

.rule-card--correct p {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 300;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #2C2C2C;
}

/* Broken rules grid */
.rules-grid--broken {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}

.rule-card--broken {
    background: #0A0A0A;
    border-radius: 0;
    box-shadow: 4px 4px 0 #FF003C;
    padding: 1rem;
    position: relative;
}

.rule-card--broken h3 {
    font-family: 'Bungee Shade', cursive;
    font-weight: 400;
    font-size: 0.85rem;
    color: #FF003C;
    margin-bottom: 0.5rem;
    letter-spacing: -0.03em;
}

.rule-card--broken p {
    font-family: 'Courier Prime', monospace;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.3;
    color: #FFE81A;
}

.rule-card--broken .annotation {
    margin-top: 0.8rem;
}

/* Specific broken card overrides */
.rule-card--hierarchy h3 {
    font-size: 0.7rem;
}

.rule-card--hierarchy p {
    font-size: 1.2rem;
    font-weight: 400;
}

.rule-card--nowhitespace {
    padding: 0 !important;
}

.rule-card--nowhitespace h3,
.rule-card--nowhitespace p {
    padding: 0 2px;
}

/* ============================================================
   SECTION 4: The Confession
   ============================================================ */
.section-confession {
    width: 100%;
    min-height: 100vh;
    background: #0A0A0A;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    position: relative;
    z-index: 2;
}

.confession-rule {
    border: none;
    height: 1px;
    background: #333333;
    width: 0;
    max-width: 38ch;
    transition: width 0.8s ease-in-out;
    transform-origin: center;
}

.confession-rule.visible {
    width: 100%;
}

.confession-rule--top {
    margin-bottom: 3rem;
}

.confession-rule--bottom {
    margin-top: 3rem;
}

.confession-text {
    font-family: 'Instrument Serif', serif;
    font-weight: 400;
    font-size: 2.4rem;
    line-height: 1.5;
    color: #F2EADE;
    max-width: 38ch;
    text-align: center;
    border: none;
    padding: 0;
}

.confession-text .word {
    opacity: 0;
    transition: opacity 0.15s ease;
    display: inline;
}

.confession-text .word.visible {
    opacity: 1;
}

/* ============================================================
   SECTION 5: The Colophon
   ============================================================ */
.section-colophon {
    min-height: 50vh;
}

.section-colophon .standard {
    min-height: 50vh;
}

.section-colophon .standard--correct {
    background: #FAFAFA;
}

.section-colophon .standard--broken {
    background: #FFE81A;
}

/* Left: Minimal colophon */
.colophon-content--correct {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 50vh;
    padding: 4rem 2rem;
}

.colophon-domain {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 0.9rem;
    color: #1A1A1A;
    letter-spacing: 0.02em;
    margin-bottom: 0.5rem;
}

.colophon-copy {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 300;
    font-size: 0.8rem;
    color: #2C2C2C;
}

/* Right: Overloaded colophon */
.colophon-content--broken {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    min-height: 50vh;
    justify-content: center;
    overflow: hidden;
}

.fake-nav {
    display: flex;
    gap: 0.5rem;
}

.fake-nav-col {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1;
}

.fake-nav-col a {
    font-family: 'Courier Prime', monospace;
    font-size: 0.7rem;
    color: #1A1A1A;
    text-decoration: underline;
}

.fake-social {
    display: flex;
    gap: 0.6rem;
    align-items: center;
}

.social-icon {
    flex-shrink: 0;
}

.fake-newsletter {
    display: flex;
    gap: 0.3rem;
    align-items: center;
}

.fake-input {
    font-family: 'Courier Prime', monospace;
    font-size: 0.7rem;
    padding: 0.3rem 0.5rem;
    border: 2px solid #FF003C;
    background: #0A0A0A;
    color: #FFE81A;
    width: 140px;
}

.fake-button {
    font-family: 'Bungee Shade', cursive;
    font-size: 0.55rem;
    padding: 0.3rem 0.6rem;
    border: 2px solid #FF003C;
    background: #FF003C;
    color: #FAFAFA;
    cursor: default;
    white-space: nowrap;
}

.fake-cookie {
    background: #0A0A0A;
    padding: 0.5rem;
    border: 1px solid #FF003C;
}

.fake-cookie p {
    font-family: 'Courier Prime', monospace;
    font-size: 0.6rem;
    color: #FFE81A;
    margin-bottom: 0.3rem;
    line-height: 1.3;
}

.cookie-btn {
    font-family: 'Space Mono', monospace;
    font-size: 0.55rem;
    padding: 0.2rem 0.5rem;
    border: 1px solid #FF003C;
    cursor: default;
    margin-right: 0.3rem;
}

.cookie-btn--accept {
    background: #FF003C;
    color: #FAFAFA;
}

.cookie-btn--manage {
    background: transparent;
    color: #FF003C;
}

.back-to-top {
    font-family: 'Space Mono', monospace;
    font-size: 0.65rem;
    color: #FF003C;
    text-decoration: none;
    text-align: right;
    display: block;
}

/* ============================================================
   Scroll Animations
   ============================================================ */
.standard--correct .declaration-content,
.standard--correct .measurement-content,
.standard--correct .gallery-content,
.colophon-content--correct {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 300ms cubic-bezier(0.25, 0.1, 0.25, 1), transform 300ms cubic-bezier(0.25, 0.1, 0.25, 1);
}

.standard--broken .declaration-content,
.standard--broken .measurement-content,
.standard--broken .gallery-content,
.colophon-content--broken {
    opacity: 0;
    transform: translateX(60px);
    transition: opacity 500ms cubic-bezier(0.68, -0.55, 0.265, 1.55), transform 500ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.split-section.in-view .standard--correct .declaration-content,
.split-section.in-view .standard--correct .measurement-content,
.split-section.in-view .standard--correct .gallery-content,
.split-section.in-view .colophon-content--correct {
    opacity: 1;
    transform: translateX(0);
}

.split-section.in-view .standard--broken .declaration-content,
.split-section.in-view .standard--broken .measurement-content,
.split-section.in-view .standard--broken .gallery-content,
.split-section.in-view .colophon-content--broken {
    opacity: 1;
    transform: translateX(0);
}

/* ============================================================
   Responsive: Stack vertically below 768px
   ============================================================ */
@media (max-width: 768px) {
    .split-section {
        flex-direction: column;
    }

    .standard {
        width: 100%;
    }

    .section-declaration .standard {
        height: 50vh;
    }

    .seam {
        display: none;
    }

    .seam--mobile-divider {
        display: block;
        width: 100%;
        height: 2px;
        background: linear-gradient(to right, #000000 50%, #FF003C 50%);
    }

    .section-gallery .standard {
        min-height: auto;
        padding: 2rem 0;
    }

    .section-colophon .standard {
        min-height: 30vh;
    }

    .ruler-divider {
        background: #FAFAFA;
    }

    .section-confession {
        padding: 3rem 1.5rem;
    }

    .confession-text {
        font-size: 1.6rem;
    }

    .rules-grid--correct,
    .rules-grid--broken {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   Ruler SVG styles
   ============================================================ */
.ruler-tick {
    stroke: #1A1A1A;
    stroke-width: 1;
    stroke-dasharray: 30;
    stroke-dashoffset: 30;
    transition: stroke-dashoffset 0.4s ease;
}

.ruler-tick.drawn {
    stroke-dashoffset: 0;
}

.ruler--right .ruler-tick,
.ruler-divider .ruler-full .ruler-tick-right {
    stroke: #FF003C;
}

.ruler-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 8px;
    fill: #1A1A1A;
}

.ruler-label-right {
    font-family: 'Courier Prime', monospace;
    font-size: 8px;
    fill: #FF003C;
}
