/* =========================================================
   doublestandard.xyz
   Split-screen editorial broadsheet — Swiss order vs. Victorian botany
   International Style; IntersectionObserver` watching section markers — as each section scrolls into the center of the viewport. IntersectionObserver` when the heading enters the viewport. IntersectionObserver` with threshold values of 0; Space Grotesk (400; Space Grotesk" (Google Fonts.
   ========================================================= */

:root {
    --bg-left: #F2EDE8;           /* warm parchment */
    --bg-right: #2C2420;          /* deep umber */
    --bg-convergence: #3D352E;    /* center merge */
    --text-left: #1A1714;         /* editorial ink */
    --text-right: #D4C9B8;        /* bleached linen */
    --accent-hinge: #8B6F47;      /* burnt sienna */
    --accent-botanical: #5A7247;  /* muted sage */
    --accent-geometric: #9E8A6E;  /* tarnished brass */
    --accent-gold: #C4A46C;       /* aged gold */

    --split-left: 50%;
    --split-right: 50%;

    --ease-elastic: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background: var(--bg-left);
    color: var(--text-left);
    font-family: 'Space Grotesk', 'Inter', Arial, Helvetica, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: geometricPrecision;
}

.stage {
    position: relative;
    width: 100%;
}

.split {
    position: relative;
    width: 100%;
}

/* ---------- Elastic seam (SVG line along column boundary) ---------- */
.seam {
    position: fixed;
    top: 0;
    left: var(--split-left);
    transform: translateX(-50%);
    width: 40px;
    height: 100vh;
    pointer-events: none;
    z-index: 20;
    transition: left 0.8s var(--ease-elastic);
}

.seam path {
    stroke: var(--accent-hinge);
    stroke-width: 2;
    fill: none;
    vector-effect: non-scaling-stroke;
    filter: drop-shadow(0 0 0.5px rgba(139, 111, 71, 0.4));
}

/* ---------- Panel (row with two columns) ---------- */
.panel {
    display: grid;
    grid-template-columns: var(--split-left) var(--split-right);
    min-height: 100vh;
    position: relative;
    transition: grid-template-columns 0.8s var(--ease-elastic);
    overflow: hidden;
}

.panel-opening {
    min-height: 100vh;
}

/* ---------- Columns ---------- */
.col {
    position: relative;
    padding: clamp(3rem, 7vh, 7rem) clamp(1.5rem, 4vw, 5rem);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-width: 0;
}

.col-left {
    background: var(--bg-left);
    color: var(--text-left);
    font-family: 'Space Grotesk', 'Inter', Arial, Helvetica, sans-serif;
    border-right: 1px solid transparent;
}

.col-right {
    background: var(--bg-right);
    color: var(--text-right);
    font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
}

/* ---------- Eyebrows / small captions ---------- */
.eyebrow,
.left-eyebrow {
    font-family: 'Space Grotesk', Arial, Helvetica, sans-serif;
    font-size: 0.72rem;
    font-weight: 400;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--accent-hinge);
    border-top: 1px solid var(--accent-hinge);
    padding-top: 0.6rem;
    margin-bottom: 0.5rem;
}

.right-eyebrow {
    font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    font-style: italic;
    font-size: 0.95rem;
    letter-spacing: 0.005em;
    color: var(--accent-gold);
    border-top: 1px solid var(--accent-hinge);
    padding-top: 0.6rem;
    margin-bottom: 0.5rem;
}

/* ---------- Kinetic typography — LEFT (mechanical) ---------- */
.kinetic-left {
    font-family: 'Space Grotesk', Arial, Helvetica, sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.05;
    color: var(--text-left);
    font-size: clamp(2.5rem, 6vw, 5rem);
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0 0.02em;
}

.kinetic-left.small {
    font-size: clamp(1.8rem, 4vw, 3rem);
}

.kinetic-left .char {
    display: inline-block;
    transform: translateY(-120%);
    opacity: 0;
    will-change: transform, opacity;
}

.kinetic-left.animate .char {
    animation: charDropElastic 0.9s var(--ease-elastic) forwards;
}

@keyframes charDropElastic {
    0% {
        transform: translateY(-120%);
        opacity: 0;
    }
    60% {
        transform: translateY(14%);
        opacity: 1;
    }
    80% {
        transform: translateY(-6%);
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ---------- Kinetic typography — RIGHT (organic) ---------- */
.kinetic-right {
    font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    font-weight: 600;
    font-size: clamp(2.8rem, 7vw, 5.5rem);
    letter-spacing: -0.02em;
    line-height: 1.08;
    color: var(--text-right);
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0 0.02em;
}

.kinetic-right.italic {
    font-style: italic;
}

.kinetic-right.small {
    font-size: clamp(2rem, 4.5vw, 3.2rem);
}

.kinetic-right.big {
    font-size: clamp(3rem, 8vw, 6rem);
}

.kinetic-right .char {
    display: inline-block;
    opacity: 0;
    transform: rotate(-5deg) translateY(8px);
    transform-origin: 50% 100%;
    will-change: transform, opacity;
}

.kinetic-right.animate .char {
    animation: charFadeRotate 1.1s var(--ease-elastic) forwards;
}

@keyframes charFadeRotate {
    0% {
        opacity: 0;
        transform: rotate(-5deg) translateY(8px);
    }
    70% {
        opacity: 1;
        transform: rotate(1.2deg) translateY(-2px);
    }
    100% {
        opacity: 1;
        transform: rotate(0deg) translateY(0);
    }
}

.kinetic-left .space,
.kinetic-right .space {
    width: 0.34em;
}

/* ---------- Body typography ---------- */
.body-left {
    font-family: 'Space Grotesk', Arial, Helvetica, sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.4vw, 1.18rem);
    letter-spacing: 0.01em;
    line-height: 1.65;
    color: var(--text-left);
    max-width: 40ch;
    margin: 0;
}

.body-right {
    font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.05rem, 1.5vw, 1.25rem);
    letter-spacing: 0.005em;
    line-height: 1.7;
    color: var(--text-right);
    max-width: 42ch;
    margin: 0;
}

.body-right em {
    font-style: normal;
    color: var(--accent-gold);
}

/* ---------- Measurement lines ---------- */
.measure-line {
    position: relative;
    height: 12px;
    width: 0;
    margin: 1rem 0;
    border-top: 1px solid var(--accent-hinge);
    opacity: 0;
    transition: width 0.5s linear, opacity 0.3s linear;
}

.measure-line::before,
.measure-line::after {
    content: '';
    position: absolute;
    top: -5px;
    width: 1px;
    height: 9px;
    background: var(--accent-hinge);
}

.measure-line::before { left: 0; }
.measure-line::after { right: 0; }

.col-left.in-view .measure-line {
    width: 100%;
    opacity: 1;
}

/* ---------- Geometric shapes ---------- */
.geo-stack {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 0;
}

.geo-row {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    padding: 0.75rem 0;
}

.geo-shape {
    width: clamp(110px, 18vw, 220px);
    height: auto;
    flex-shrink: 0;
    transform: scale(0) rotate(-90deg);
    transition: transform 1.1s var(--ease-spring);
    transform-origin: center;
}

.geo-shape.geo-small {
    width: clamp(70px, 9vw, 120px);
}

.geo-shape.geo-medium {
    width: clamp(140px, 20vw, 240px);
}

.col-left.in-view .geo-shape {
    transform: scale(1) rotate(0deg);
}

.col-right-inverted .geo-shape,
.inverted-geo-stack .geo-shape {
    transform: scale(0) rotate(-90deg);
    transition: transform 1.1s var(--ease-spring);
}

.col-right-inverted.in-view .geo-shape {
    transform: scale(1) rotate(0deg);
}

/* ---------- Botanical SVG illustrations ---------- */
.botanical-stage {
    margin-top: auto;
    padding-top: 1.5rem;
    position: relative;
    display: flex;
    justify-content: flex-start;
}

.botanical-stage-small {
    max-width: 260px;
}

.botanical-stage-wide {
    width: 100%;
}

.botanical {
    width: clamp(180px, 30vw, 320px);
    height: auto;
    overflow: visible;
}

.botanical.vine {
    width: 100%;
    max-width: 600px;
}

.botanical .draw {
    stroke-dasharray: var(--len, 1000);
    stroke-dashoffset: var(--len, 1000);
    transition: stroke-dashoffset 2.5s ease-out;
}

.col-right.in-view .botanical .draw,
.col-left-inverted.in-view .botanical .draw {
    stroke-dashoffset: 0;
}

.botanical text {
    opacity: 0;
    transition: opacity 0.6s ease-out 1.8s;
}

.col-right.in-view .botanical text,
.col-left-inverted.in-view .botanical text {
    opacity: 1;
}

/* ---------- Convergence panel ---------- */
.panel-convergence {
    display: block;
    min-height: 100vh;
    background: var(--bg-convergence);
    color: var(--accent-gold);
    position: relative;
    overflow: hidden;
    transition: background 0.9s ease;
}

.panel-convergence::before,
.panel-convergence::after {
    content: none;
}

.convergence-inner {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem clamp(1.5rem, 5vw, 6rem);
    gap: 2rem;
}

.convergence-eyebrow {
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: 0.5em;
    font-size: 0.8rem;
    text-transform: lowercase;
    color: var(--accent-gold);
    opacity: 0.8;
}

.convergence-title {
    font-family: 'Syne', Arial Black, Arial, Helvetica, sans-serif;
    font-weight: 800;
    font-size: clamp(3.5rem, 9vw, 7rem);
    letter-spacing: -0.03em;
    line-height: 1.02;
    color: var(--accent-gold);
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35em;
    justify-content: center;
    align-items: baseline;
}

.convergence-title .word {
    display: inline-block;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 1.2s var(--ease-elastic), transform 1.2s var(--ease-elastic);
}

.convergence-title .word.italic {
    font-style: italic;
    font-weight: 400;
}

.convergence-title .ampersand {
    font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    font-weight: 300;
    font-style: italic;
    color: var(--accent-hinge);
    opacity: 0;
    transform: scale(0.4) rotate(-20deg);
    transition: opacity 0.9s var(--ease-spring) 0.4s, transform 0.9s var(--ease-spring) 0.4s;
}

.panel-convergence.in-view .convergence-title .word {
    opacity: 1;
    transform: translateY(0);
}

.panel-convergence.in-view .convergence-title .word:nth-child(3) {
    transition-delay: 0.6s;
}

.panel-convergence.in-view .convergence-title .ampersand {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.convergence-art {
    width: min(90vw, 800px);
    margin: 0 auto;
}

.convergence-art svg {
    width: 100%;
    height: auto;
    overflow: visible;
}

.convergence-art .draw {
    stroke-dasharray: var(--len, 1200);
    stroke-dashoffset: var(--len, 1200);
    transition: stroke-dashoffset 3.5s ease-out;
}

.panel-convergence.in-view .convergence-art .draw {
    stroke-dashoffset: 0;
}

.convergence-body {
    font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    font-style: italic;
    font-weight: 300;
    font-size: clamp(1.1rem, 1.6vw, 1.35rem);
    max-width: 48ch;
    color: var(--text-right);
    line-height: 1.6;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.9s ease 0.9s, transform 0.9s ease 0.9s;
    margin: 0;
}

.panel-convergence.in-view .convergence-body {
    opacity: 0.95;
    transform: translateY(0);
}

/* ---------- Verdict (inverted) ---------- */
.col-left-inverted {
    background: var(--bg-right);
    color: var(--text-right);
    font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
}

.col-right-inverted {
    background: var(--bg-left);
    color: var(--text-left);
    font-family: 'Space Grotesk', Arial, Helvetica, sans-serif;
}

.col-left-inverted .inverted-eyebrow {
    color: var(--accent-gold);
    border-top-color: var(--accent-hinge);
    font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    font-style: italic;
    text-transform: lowercase;
    letter-spacing: 0.08em;
    font-size: 0.95rem;
}

.col-right-inverted .inverted-eyebrow {
    color: var(--accent-hinge);
    font-family: 'Space Grotesk', Arial, Helvetica, sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.24em;
    font-size: 0.72rem;
}

.inverted-type {
    color: var(--text-right) !important;
}

.inverted-type-geo {
    color: var(--text-left) !important;
}

.inverted-body {
    color: var(--text-right);
    font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    font-style: italic;
    font-weight: 300;
    font-size: clamp(1.05rem, 1.5vw, 1.25rem);
    line-height: 1.7;
    max-width: 42ch;
}

.inverted-body-geo {
    color: var(--text-left);
    font-family: 'Space Grotesk', Arial, Helvetica, sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.4vw, 1.18rem);
    line-height: 1.65;
    max-width: 40ch;
}

/* ---------- Closing field (scattered hybrid glyphs) ---------- */
.closing-field {
    position: relative;
    min-height: 60vh;
    background: var(--bg-left);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    overflow: hidden;
}

.closing-field::before {
    content: '';
    position: absolute;
    inset: 0 0 0 50%;
    background: var(--bg-right);
}

.scatter-field {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.scatter-field svg {
    position: absolute;
    opacity: 0.55;
    transform-origin: center;
    width: 60px;
    height: 60px;
}

.closing-mark {
    position: relative;
    z-index: 2;
    font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    font-style: italic;
    font-size: clamp(0.9rem, 1.2vw, 1.1rem);
    letter-spacing: 0.12em;
    color: var(--accent-hinge);
    background: transparent;
    padding: 0.8rem 1.2rem;
    border-top: 1px solid var(--accent-hinge);
    border-bottom: 1px solid var(--accent-hinge);
}

/* ---------- Tick marks generated in JS inherit styles via attributes ---------- */
#tick-marks line {
    stroke: var(--accent-geometric);
    stroke-width: 0.8;
}

/* ---------- In-view helper ---------- */
.col.in-view .body-left,
.col.in-view .body-right,
.col.in-view .eyebrow,
.col.in-view .left-eyebrow,
.col.in-view .right-eyebrow,
.col.in-view .inverted-body,
.col.in-view .inverted-body-geo {
    transition: opacity 0.7s ease 0.2s, transform 0.7s ease 0.2s;
}

/* Progressive fade for bodies on first entry */
.body-left,
.body-right,
.inverted-body,
.inverted-body-geo {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.col.in-view .body-left,
.col.in-view .body-right,
.col.in-view .inverted-body,
.col.in-view .inverted-body-geo {
    opacity: 1;
    transform: translateY(0);
}

.eyebrow,
.left-eyebrow,
.right-eyebrow {
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.col.in-view .eyebrow,
.col.in-view .left-eyebrow,
.col.in-view .right-eyebrow {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
    .panel {
        grid-template-columns: 1fr !important;
    }

    .col {
        min-height: 80vh;
    }

    .seam {
        display: none;
    }

    .panel-verdict .col-left-inverted {
        order: 1;
    }

    .panel-verdict .col-right-inverted {
        order: 2;
    }

    .closing-field {
        background: var(--bg-left);
    }
}
