/* ==========================================================================
   double-standard.xyz — Styles
   Playful dualism / visual essay on contradiction
   ========================================================================== */

/* --- Palette Variables --- */
:root {
    /* Standard A (Warm Earthy) */
    --terracotta: #C8553D;
    --amber: #E8985E;
    --parchment: #F5E6D3;
    /* Standard B (Cool Sage) */
    --sage: #6B8F71;
    --lichen: #A3B899;
    --stone: #E8EDE5;
    /* Shared Neutrals */
    --carbon: #2D2A26;
    --dust: #6E6A65;
    --chalk: #FAFAF8;
    /* Convergence */
    --merge: #D4C4B0;
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Fira Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.1vw, 1.125rem);
    line-height: 1.65;
    letter-spacing: 0.005em;
    color: #2D2A26;
    background-color: #FAFAF8;
    overflow-x: hidden;
    position: relative;
}

/* --- Noise Texture Overlay --- */
#noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    filter: url(#noiseFilter);
    background: white;
}

/* ==========================================================================
   SECTION 1: THE SPLIT
   ========================================================================== */

#the-split {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 100;
    display: flex;
    align-items: stretch;
    transition: none;
}

#the-split.exited .split-left {
    transform: translateX(-100%);
    opacity: 0;
}

#the-split.exited .split-right {
    transform: translateX(100%);
    opacity: 0;
}

#the-split.exited {
    pointer-events: none;
}

.split-left {
    width: 50%;
    height: 100%;
    background-color: #F5E6D3;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    transition: transform 800ms cubic-bezier(0.76, 0, 0.24, 1), opacity 600ms ease;
    will-change: transform, opacity;
}

.split-right {
    width: 50%;
    height: 100%;
    background-color: #E8EDE5;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    transition: transform 800ms cubic-bezier(0.76, 0, 0.24, 1), opacity 600ms ease;
    will-change: transform, opacity;
}

.split-divider {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 100%;
    background-color: rgba(45, 42, 38, 0.2);
    z-index: 2;
    transition: opacity 600ms ease;
}

#the-split.exited .split-divider {
    opacity: 0;
}

.split-content-left {
    padding-right: 0.25em;
}

.split-content-right {
    padding-left: 0.25em;
}

.split-word-left {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: clamp(2rem, 5.5vw, 4.5rem);
    letter-spacing: 0.01em;
    line-height: 1.15;
    color: #C8553D;
}

.split-word-right {
    font-family: 'Fira Sans', sans-serif;
    font-weight: 500;
    font-size: clamp(2rem, 5.5vw, 4.5rem);
    letter-spacing: 0.01em;
    line-height: 1.15;
    color: #6B8F71;
}

.split-scale-container {
    position: absolute;
    bottom: 15vh;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    transition: opacity 600ms ease;
}

#the-split.exited .split-scale-container {
    opacity: 0;
}

.tipping-scale .scale-beam {
    transform-origin: 100px 30px;
    animation: rock 4s ease-in-out infinite;
}

@keyframes rock {
    0%, 100% { transform: rotate(-2deg); }
    50% { transform: rotate(2deg); }
}

/* ==========================================================================
   SECTION 2: THE GRID OF CONTRADICTIONS
   ========================================================================== */

#the-grid {
    position: relative;
    z-index: 10;
    margin-top: 100vh;
    padding: 4rem 0 6rem;
}

/* --- Masonry Grid --- */
.masonry-grid {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px 24px;
    align-items: start;
}

/* --- Card Base --- */
.card {
    background: #FAFAF8;
    padding: 24px 20px;
    position: relative;
    box-shadow: 0 2px 12px rgba(45, 42, 38, 0.04);
    transition: box-shadow 200ms ease;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.card:hover {
    box-shadow: 0 4px 20px rgba(45, 42, 38, 0.08);
}

/* --- Card A (Warm / Left-leaning) --- */
/* Background tint: #E8985E (Amber Equivocation) at 8% opacity */
.card-a {
    border: 1px solid rgba(200, 85, 61, 0.3);
    border-radius: 16px 2px 2px 16px;
    grid-column: span 6;
    background: linear-gradient(135deg, rgba(232, 152, 94, 0.08), #FAFAF8 60%);
}

/* --- Card B (Cool / Right-leaning) --- */
/* Background tint: #A3B899 (Lichen Rationalization) at 8% opacity */
.card-b {
    border: 1px solid rgba(107, 143, 113, 0.3);
    border-radius: 2px 16px 16px 2px;
    grid-column: span 6;
    background: linear-gradient(135deg, rgba(163, 184, 153, 0.08), #FAFAF8 60%);
}

/* --- Card tall variant --- */
.card-tall {
    min-height: 320px;
}

/* --- Card Label --- */
.card-label {
    font-family: 'Fira Code', monospace;
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6E6A65;
    display: block;
}

/* --- Card Content --- */
.card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    flex: 1;
    justify-content: center;
}

.card-phrase {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: clamp(1rem, 1.8vw, 1.35rem);
    line-height: 1.4;
    text-align: center;
    color: #2D2A26;
}

/* --- Card Bottom Border --- */
.card-bottom-border {
    height: 4px;
    border-radius: 2px;
    margin-top: auto;
    transition: height 200ms ease;
}

.card:hover .card-bottom-border {
    height: 6px;
}

.card-bottom-a {
    background-color: #C8553D;
}

.card-bottom-b {
    background-color: #6B8F71;
}

/* --- Fade Reveal (initial state) --- */
.fade-reveal {
    opacity: 0;
    transform: translateX(var(--entry-direction, -30px));
    transition: opacity 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.fade-reveal[data-direction="left"] {
    --entry-direction: -30px;
}

.fade-reveal[data-direction="right"] {
    --entry-direction: 30px;
}

.fade-reveal.revealed {
    opacity: 1;
    transform: translateX(0);
}

/* ==========================================================================
   CONTRADICTION BREAKS
   ========================================================================== */

.contradiction-break {
    width: 100%;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(90deg, #F5E6D3, #E8EDE5);
    margin: 2rem 0;
    position: relative;
}

.contradiction-text {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: clamp(1rem, 2vw, 1.5rem);
    color: #2D2A26;
    text-align: center;
    padding: 0 2rem;
    letter-spacing: 0.01em;
    line-height: 1.15;
}

/* ==========================================================================
   GEOMETRIC MOTIFS
   ========================================================================== */

/* --- Split Circle --- */
.split-circle-container {
    width: 120px;
    height: 120px;
    position: relative;
    border-radius: 50%;
    border: 1px solid rgba(45, 42, 38, 0.1);
    overflow: hidden;
}

.split-circle-container.large {
    width: 140px;
    height: 140px;
}

.split-circle-left {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background-color: rgba(200, 85, 61, 0.15);
}

.split-circle-right {
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background-color: rgba(107, 143, 113, 0.15);
}

/* --- Perspective Triangles --- */
.perspective-triangles {
    display: block;
    margin: 0 auto;
}

/* --- Nested Squares --- */
.nested-squares {
    width: 100px;
    height: 100px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nested-squares .outer-square {
    width: 80px;
    height: 80px;
    border: 1.5px solid rgba(200, 85, 61, 0.3);
    border-radius: 2px;
    position: absolute;
}

.nested-squares .inner-diamond {
    width: 50px;
    height: 50px;
    border: 1.5px solid rgba(107, 143, 113, 0.4);
    background: rgba(107, 143, 113, 0.06);
    transform: rotate(45deg);
    position: absolute;
}

.nested-squares.reversed .outer-square {
    border-color: rgba(107, 143, 113, 0.3);
}

.nested-squares.reversed .inner-diamond {
    border-color: rgba(200, 85, 61, 0.4);
    background: rgba(200, 85, 61, 0.06);
}

/* --- Card SVGs --- */
.card-geo {
    display: block;
    margin: 0 auto;
}

/* ==========================================================================
   CIRCUIT TRACES
   ========================================================================== */

.circuit-traces {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    overflow: visible;
}

.trace-line {
    transition: stroke-dashoffset 1200ms ease-out;
}

/* ==========================================================================
   SECTION 3: THE CONVERGENCE
   ========================================================================== */

#the-convergence {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #D4C4B0;
}

.convergence-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    padding: 4rem 2rem;
    text-align: center;
    position: relative;
    width: 100%;
}

.convergence-shapes {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    opacity: 0.5;
}

.converge-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: rgba(212, 196, 176, 0.6);
    border: 1.5px solid rgba(45, 42, 38, 0.12);
}

.converge-triangles {
    display: block;
}

.converge-square-container {
    width: 60px;
    height: 60px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.converge-outer-square {
    width: 50px;
    height: 50px;
    border: 1.5px solid rgba(45, 42, 38, 0.12);
    position: absolute;
}

.converge-inner-diamond {
    width: 32px;
    height: 32px;
    border: 1.5px solid rgba(45, 42, 38, 0.12);
    background: rgba(212, 196, 176, 0.3);
    transform: rotate(45deg);
    position: absolute;
}

.convergence-statement {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 3.5vw, 2.8rem);
    line-height: 1.3;
    color: #2D2A26;
    letter-spacing: 0.01em;
    max-width: 700px;
}

.convergence-scale-container {
    margin-top: 1rem;
}

.tipping-scale.balanced .scale-beam-balanced {
    transform-origin: 100px 28px;
    animation: none;
    transform: rotate(0deg);
}

.convergence-line {
    position: absolute;
    bottom: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(45, 42, 38, 0.12) 20%, rgba(45, 42, 38, 0.12) 80%, transparent 100%);
    z-index: -1;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

/* Tablet */
@media (max-width: 1024px) {
    .masonry-grid {
        grid-template-columns: repeat(6, 1fr);
    }

    .card-a,
    .card-b {
        grid-column: span 3;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .masonry-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
        padding: 0 1rem;
    }

    .card-a,
    .card-b {
        grid-column: span 2;
        border-radius: 12px;
    }

    .card-tall {
        min-height: auto;
    }

    /* Split screen stacks vertically on mobile */
    #the-split {
        flex-direction: column;
    }

    .split-left,
    .split-right {
        width: 100%;
        height: 50%;
        justify-content: center;
    }

    .split-content-left {
        padding-right: 0;
    }

    .split-content-right {
        padding-left: 0;
    }

    .split-divider {
        top: 50%;
        left: 0;
        width: 100%;
        height: 1px;
        transform: none;
    }

    #the-split.exited .split-left {
        transform: translateY(-100%);
    }

    #the-split.exited .split-right {
        transform: translateY(100%);
    }

    .contradiction-break {
        height: 60px;
    }

    .contradiction-text {
        font-size: clamp(0.875rem, 3.5vw, 1.125rem);
    }

    .split-circle-container {
        width: 80px;
        height: 80px;
    }

    .split-circle-container.large {
        width: 100px;
        height: 100px;
    }

    .convergence-shapes {
        gap: 1.5rem;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .masonry-grid {
        grid-template-columns: 1fr;
    }

    .card-a,
    .card-b {
        grid-column: span 1;
    }

    .split-word-left,
    .split-word-right {
        font-size: clamp(1.8rem, 8vw, 3rem);
    }
}
