/* ============================================================
   double-standard.org
   Mid-century modern / diagonal-sections / marble-texture
   Interactions: Interactions:** IntersectionObserver` combined tracking create movement along axis. viewport: Animation: Animation:**
   ============================================================ */

:root {
    --void-black: #0A0A0A;
    --bone-white: #F5F0EB;
    --warm-stone: #C4B8A8;
    --marble-vein: #4A4541;
    --accent-gold: #B8860B;
    --accent-blush: #D4A89A;
    --deep-slate: #1E1E24;
    --burgundy: #6B3A3A;

    --font-display: "Nunito Sans", system-ui, sans-serif;
    --font-body: "Varela Round", system-ui, sans-serif;
    --font-accent: "Josefin Sans", system-ui, sans-serif;
    --font-mono: "DM Mono", ui-monospace, monospace;

    --divider-width: 52px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.75;
    background-color: var(--void-black);
    color: var(--bone-white);
    overflow-x: hidden;
}

.svg-defs,
.marble-library {
    position: absolute;
    width: 0;
    height: 0;
    pointer-events: none;
    overflow: hidden;
}

/* ---------- Particle canvas ---------- */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2;
    pointer-events: none;
}

/* ---------- Narrative container ---------- */
.narrative {
    position: relative;
    scroll-snap-type: y proximity;
    z-index: 1;
}

.scene {
    position: relative;
    min-height: 100vh;
    width: 100%;
    overflow: hidden;
    scroll-snap-align: start;
}

/* ===================================================
   WEDGE SYSTEM (two overlapping clip-path divs)
   =================================================== */
.wedge {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1.5rem, 4vw, 4rem);
    transition: transform 0.8s cubic-bezier(0.22, 0.61, 0.36, 1);
    will-change: transform;
}

.wedge-inner {
    position: relative;
    max-width: 46vw;
    width: 100%;
    padding: 2rem;
}

.wedge-content-left {
    padding-right: 6vw;
}

.wedge-content-right {
    padding-left: 6vw;
}

/* ---- 15 degree forward slash: dark on left ---- */
.scene[data-angle="15"] .wedge-dark {
    background-color: var(--void-black);
    color: var(--bone-white);
    clip-path: polygon(0 0, 100% 0, 80% 100%, 0 100%);
    justify-content: flex-start;
}

.scene[data-angle="15"] .wedge-light {
    background-color: var(--bone-white);
    color: var(--void-black);
    clip-path: polygon(100% 0, 100% 100%, 0 100%, 20% 0);
    justify-content: flex-end;
}

/* ---- 18 degree forward slash: dark on left ---- */
.scene[data-angle="18"] .wedge-dark {
    background-color: var(--void-black);
    color: var(--bone-white);
    clip-path: polygon(0 0, 100% 0, 75% 100%, 0 100%);
    justify-content: flex-start;
}

.scene[data-angle="18"] .wedge-light {
    background-color: var(--bone-white);
    color: var(--void-black);
    clip-path: polygon(100% 0, 100% 100%, 0 100%, 25% 0);
    justify-content: flex-end;
}

/* ---- -12 degree backslash: light on left ---- */
.scene[data-angle="-12"] .wedge-light {
    background-color: var(--bone-white);
    color: var(--void-black);
    clip-path: polygon(0 0, 82% 0, 100% 100%, 0 100%);
    justify-content: flex-start;
}

.scene[data-angle="-12"] .wedge-dark {
    background-color: var(--void-black);
    color: var(--bone-white);
    clip-path: polygon(82% 0, 100% 0, 100% 100%, 100% 100%, 0 100%, 18% 100%);
    clip-path: polygon(100% 0, 82% 0, 100% 100%, 100% 100%);
    clip-path: polygon(82% 0, 100% 0, 100% 100%, 18% 100%);
    justify-content: flex-end;
}

/* ---- 12 degree forward (used in interstitial 4) ---- */
.scene[data-angle="12"] .wedge-dark {
    background-color: var(--void-black);
    color: var(--bone-white);
    clip-path: polygon(0 0, 100% 0, 82% 100%, 0 100%);
}

.scene[data-angle="12"] .wedge-light {
    background-color: var(--bone-white);
    color: var(--void-black);
    clip-path: polygon(100% 0, 100% 100%, 0 100%, 18% 0);
}

/* ===================================================
   DIAGONAL DIVIDERS (marble strips)
   =================================================== */
.divider {
    position: absolute;
    top: -5%;
    left: 50%;
    width: var(--divider-width);
    height: 110%;
    z-index: 3;
    pointer-events: none;
    overflow: visible;
}

.divider-marble {
    position: absolute;
    inset: 0;
    background-color: var(--bone-white);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='400' viewBox='0 0 120 400'><rect width='120' height='400' fill='%23F5F0EB'/><path d='M0,90 Q40,40 80,110 T120,80' stroke='%234A4541' stroke-width='1.2' fill='none' opacity='0.55'/><path d='M0,200 Q60,150 90,220 T120,180' stroke='%234A4541' stroke-width='0.9' fill='none' opacity='0.45'/><path d='M0,320 Q50,280 90,340 T120,310' stroke='%234A4541' stroke-width='1.5' fill='none' opacity='0.6'/><path d='M30,0 Q60,80 50,180 T80,400' stroke='%234A4541' stroke-width='0.6' fill='none' opacity='0.35'/><circle cx='60' cy='140' r='1.4' fill='%23B8860B' opacity='0.5'/><circle cx='40' cy='280' r='1' fill='%23B8860B' opacity='0.4'/></svg>");
    background-size: 120px 400px;
    background-repeat: repeat;
    box-shadow:
        0 0 0 1px rgba(184, 134, 11, 0.45),
        0 0 40px rgba(184, 134, 11, 0.15),
        inset 0 0 60px rgba(74, 69, 65, 0.25);
}

.divider-15 {
    transform: translateX(-50%) rotate(15deg) translateY(0);
    transform-origin: center center;
    left: 82%;
}

.divider-15-mirror {
    transform: translateX(-50%) rotate(15deg) translateY(0);
    transform-origin: center center;
    left: 82%;
}

.divider-neg12 {
    transform: translateX(-50%) rotate(-12deg);
    transform-origin: center center;
    left: 82%;
}

.divider-18 {
    transform: translateX(-50%) rotate(18deg);
    transform-origin: center center;
    left: 77%;
}

.divider-12 {
    transform: translateX(-50%) rotate(12deg);
    transform-origin: center center;
    left: 82%;
}

.divider-ornaments {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 140%;
    height: 100%;
    overflow: visible;
    opacity: 0.55;
    transition: opacity 0.6s ease;
}

.scene.in-view .divider-ornaments {
    opacity: 0.9;
}

/* ===================================================
   MONOLITH (opening)
   =================================================== */
.monolith-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(3rem, 8vw, 7rem);
    line-height: 0.92;
    letter-spacing: 0.06em;
    text-transform: lowercase;
    margin: 0.5em 0;
    position: relative;
}

.monolith-title em {
    font-style: italic;
    font-weight: 300;
}

.monolith-title-dark {
    color: var(--bone-white);
}

.monolith-title-light {
    color: var(--void-black);
    text-align: right;
}

.monolith-subtitle {
    font-family: var(--font-mono);
    font-weight: 300;
    font-size: 0.85rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    line-height: 1.9;
    margin-top: 2em;
    opacity: 0.85;
}

.monolith-subtitle-light {
    text-align: right;
}

.chevron-down {
    position: absolute;
    bottom: 2.4rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 4px;
    animation: chevron-pulse 2.4s ease-in-out infinite;
}

.chevron-down svg {
    width: 38px;
    height: 18px;
    display: block;
    filter: drop-shadow(0 0 6px rgba(184, 134, 11, 0.6));
}

@keyframes chevron-pulse {
    0%, 100% { transform: translate(-50%, 0); opacity: 0.7; }
    50% { transform: translate(-50%, 8px); opacity: 1; }
}

/* ===================================================
   ARGUMENT WEDGES (thesis / antithesis)
   =================================================== */
.arg-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(2.2rem, 5.2vw, 4.6rem);
    line-height: 1.05;
    letter-spacing: 0.04em;
    text-transform: lowercase;
    margin-bottom: 1.2em;
    position: relative;
}

.arg-title em {
    font-style: italic;
    font-weight: 300;
    letter-spacing: 0.02em;
}

.arg-title-dark { color: var(--bone-white); }
.arg-title-light { color: var(--void-black); text-align: right; }

.arg-body {
    font-family: var(--font-body);
    font-size: clamp(1rem, 1.25vw, 1.2rem);
    line-height: 1.85;
    max-width: 34ch;
    letter-spacing: 0.01em;
}

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

.arg-body-dark { color: var(--bone-white); }
.arg-body-dark em { color: var(--accent-blush); }
.arg-body-light { color: var(--void-black); text-align: right; margin-left: auto; }
.arg-body-light em { color: var(--burgundy); }

.arg-caption {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    margin-top: 2.5em;
    opacity: 0.6;
}

.arg-caption-light { text-align: right; }

/* ===================================================
   DOUBLE-LINE MOTIF
   =================================================== */
.double-line {
    display: block;
    position: relative;
    height: 10px;
    width: 80px;
    margin: 0.6em 0;
}

.double-line::before,
.double-line::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: currentColor;
    transition: all 0.6s cubic-bezier(0.25, 1.4, 0.4, 1);
}

.double-line::before { top: 2px; }
.double-line::after { top: 6px; }

.double-line-dark::before,
.double-line-dark::after { background-color: var(--bone-white); opacity: 0.9; }

.double-line-light::before,
.double-line-light::after { background-color: var(--void-black); opacity: 0.85; }

.double-line-stone::before,
.double-line-stone::after { background-color: var(--marble-vein); opacity: 0.7; }

.monolith-title-light .double-line,
.arg-title-light .double-line {
    margin-left: auto;
}

h1:hover .double-line::before,
h2:hover .double-line::before { top: 0; }

h1:hover .double-line::after,
h2:hover .double-line::after { top: 8px; }

/* ===================================================
   META MARKS (mono labels)
   =================================================== */
.meta-mark {
    position: absolute;
    font-family: var(--font-mono);
    font-weight: 300;
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    display: flex;
    flex-direction: column;
    gap: 0.2em;
    z-index: 6;
    opacity: 0.75;
}

.meta-num {
    font-weight: 400;
    letter-spacing: 0.4em;
}

.meta-angle {
    opacity: 0.7;
}

.meta-top-left { top: 2rem; left: 2rem; }
.meta-bottom-right { bottom: 2rem; right: 2rem; text-align: right; }
.meta-center-right { top: 50%; right: 2.5rem; transform: translateY(-50%); text-align: right; }

.scene-interstitial .meta-mark {
    color: var(--accent-gold);
    mix-blend-mode: difference;
}

/* ===================================================
   INTERSTITIAL SECTIONS (giant single word)
   =================================================== */
.scene-interstitial {
    background-color: var(--void-black);
    display: flex;
    align-items: center;
    justify-content: center;
}

.interstitial-bg-dark,
.interstitial-bg-light {
    position: absolute;
    inset: 0;
}

.interstitial-bg-dark {
    background-color: var(--void-black);
}

.interstitial-bg-light {
    background-color: var(--bone-white);
}

.interstitial-1 .interstitial-bg-dark { clip-path: polygon(0 0, 100% 0, 80% 100%, 0 100%); }
.interstitial-1 .interstitial-bg-light { clip-path: polygon(100% 0, 100% 100%, 0 100%, 20% 0); }

.interstitial-2 .interstitial-bg-light { clip-path: polygon(0 0, 82% 0, 100% 100%, 0 100%); }
.interstitial-2 .interstitial-bg-dark { clip-path: polygon(82% 0, 100% 0, 100% 100%, 18% 100%); }

.interstitial-3 .interstitial-bg-dark { clip-path: polygon(0 0, 100% 0, 75% 100%, 0 100%); }
.interstitial-3 .interstitial-bg-light { clip-path: polygon(100% 0, 100% 100%, 0 100%, 25% 0); }

.interstitial-4 .interstitial-bg-dark { clip-path: polygon(0 0, 100% 0, 82% 100%, 0 100%); }
.interstitial-4 .interstitial-bg-light { clip-path: polygon(100% 0, 100% 100%, 0 100%, 18% 0); }

.interstitial-word {
    position: relative;
    z-index: 4;
    font-family: var(--font-accent);
    font-weight: 100;
    font-size: clamp(6rem, 22vw, 28rem);
    line-height: 0.9;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    mix-blend-mode: difference;
    color: var(--bone-white);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
    text-align: center;
    padding: 0 2vw;
}

.interstitial-word .interstitial-shadow,
.interstitial-word .interstitial-fill {
    display: block;
    grid-area: 1 / 1;
}

.interstitial-word {
    display: grid;
    place-items: center;
}

.interstitial-shadow {
    color: transparent;
    -webkit-text-stroke: 1px var(--accent-gold);
    text-shadow: 0 0 18px rgba(184, 134, 11, 0.25);
    transform: translate(6px, 6px);
    opacity: 0.6;
}

.interstitial-fill {
    color: var(--bone-white);
    position: relative;
}

.scene-interstitial.in-view .interstitial-word {
    opacity: 1;
    transform: translateY(0);
}

/* interstitial dividers */
.scene-interstitial .divider {
    z-index: 3;
}

/* ===================================================
   RESOLUTION (final section, flat horizon)
   =================================================== */
.scene-resolution {
    background: linear-gradient(to bottom, var(--void-black) 0%, var(--deep-slate) 30%, var(--marble-vein) 55%, var(--warm-stone) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 2rem;
    overflow: hidden;
}

.resolution-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 50% 110%, rgba(245, 240, 235, 0.35) 0%, transparent 60%),
        radial-gradient(ellipse at 50% 0%, rgba(10, 10, 10, 0.85) 0%, transparent 55%);
    pointer-events: none;
}

.resolution-marble {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='800' height='800' viewBox='0 0 800 800'><rect width='800' height='800' fill='%23C4B8A8'/><path d='M0,180 Q200,100 400,200 T800,150' stroke='%234A4541' stroke-width='1.5' fill='none' opacity='0.35'/><path d='M0,400 Q220,340 440,420 T800,380' stroke='%234A4541' stroke-width='1' fill='none' opacity='0.3'/><path d='M0,620 Q240,560 460,640 T800,600' stroke='%234A4541' stroke-width='1.8' fill='none' opacity='0.4'/><path d='M150,0 Q220,200 180,400 T260,800' stroke='%234A4541' stroke-width='0.8' fill='none' opacity='0.25'/><path d='M580,0 Q540,200 620,400 T560,800' stroke='%234A4541' stroke-width='1.2' fill='none' opacity='0.3'/><circle cx='240' cy='300' r='2' fill='%23B8860B' opacity='0.4'/><circle cx='540' cy='180' r='1.5' fill='%23B8860B' opacity='0.35'/><circle cx='420' cy='560' r='2.5' fill='%23B8860B' opacity='0.3'/></svg>");
    background-size: 50vw auto;
    background-position: center;
    opacity: 0.55;
    mix-blend-mode: overlay;
    pointer-events: none;
}

.resolution-inner {
    position: relative;
    z-index: 3;
    max-width: 62ch;
    text-align: center;
    color: var(--void-black);
}

.resolution-meta {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: var(--marble-vein);
    margin-bottom: 3rem;
    opacity: 0.8;
    display: flex;
    justify-content: center;
    gap: 1.2em;
}

.resolution-title {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(2.4rem, 5.5vw, 4.4rem);
    line-height: 1.05;
    letter-spacing: 0.05em;
    text-transform: lowercase;
    margin: 0 0 2rem;
    color: var(--void-black);
}

.resolution-title .double-line {
    margin: 0.7em auto;
}

.resolution-body {
    font-family: var(--font-body);
    font-size: clamp(1.05rem, 1.4vw, 1.35rem);
    line-height: 1.85;
    color: var(--deep-slate);
    margin-bottom: 3rem;
}

.resolution-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
    font-family: var(--font-mono);
    color: var(--marble-vein);
}

.resolution-mark .ornament-large {
    width: 36px;
    height: 36px;
    color: var(--accent-gold);
    opacity: 0.7;
}

.resolution-sign {
    font-size: 0.9rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
}

.resolution-caption {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--marble-vein);
    opacity: 0.55;
    margin-top: 2.5rem;
}

/* ===================================================
   ORNAMENT CLUSTERS
   =================================================== */
.ornament-cluster {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 1.2rem;
    opacity: 0.6;
}

.ornament-cluster-right {
    justify-content: flex-end;
}

.ornament {
    width: 28px;
    height: 28px;
    color: var(--accent-gold);
    opacity: 0.65;
    transition: opacity 0.4s ease;
}

.scene.in-view .ornament {
    opacity: 0.85;
}

/* ===================================================
   IN-VIEW ANIMATIONS
   =================================================== */
.scene .wedge-inner > * {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.22, 0.61, 0.36, 1);
    transition-delay: var(--stagger, 0ms);
}

.scene.in-view .wedge-inner > * {
    opacity: 1;
    transform: translateY(0);
}

.scene.in-view .wedge-dark .wedge-inner > * {
    animation: slideFromLeft 0.9s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.scene.in-view .wedge-light .wedge-inner > * {
    animation: slideFromRight 0.9s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

@keyframes slideFromLeft {
    from { opacity: 0; transform: translateX(-50px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideFromRight {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Resolution on view */
.scene-resolution .resolution-inner > * {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1s ease, transform 1s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.scene-resolution.in-view .resolution-inner > * {
    opacity: 1;
    transform: translateY(0);
}

/* ===================================================
   HOVER GLOW on dividers (brass warmth)
   =================================================== */
.scene:hover .divider-marble {
    box-shadow:
        0 0 0 1px rgba(184, 134, 11, 0.7),
        0 0 60px rgba(184, 134, 11, 0.35),
        inset 0 0 80px rgba(74, 69, 65, 0.35);
    transition: box-shadow 0.6s ease;
}

/* ===================================================
   PARALLAX / SHIFT CLASSES (applied by JS)
   =================================================== */
.wedge.shift-left { transform: translate(-2vw, -1vw); }
.wedge.shift-right { transform: translate(2vw, 1vw); }

/* ===================================================
   RESPONSIVE
   =================================================== */
@media (max-width: 760px) {
    .wedge-inner {
        max-width: 82vw;
        padding: 1.25rem;
    }

    .wedge-content-left,
    .wedge-content-right {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .monolith-title,
    .arg-title {
        font-size: clamp(2rem, 9vw, 3.5rem);
    }

    .arg-body {
        font-size: 1rem;
        max-width: none;
    }

    .meta-mark {
        font-size: 0.62rem;
        letter-spacing: 0.22em;
    }

    .meta-top-left { top: 1rem; left: 1rem; }
    .meta-bottom-right { bottom: 1rem; right: 1rem; }

    .divider {
        --divider-width: 32px;
    }

    .interstitial-word {
        font-size: clamp(4rem, 18vw, 12rem);
    }
}

@media (max-width: 480px) {
    .monolith-title {
        font-size: 2.3rem;
    }

    .arg-title {
        font-size: 1.9rem;
    }

    .interstitial-word {
        font-size: 3.5rem;
        letter-spacing: 0.1em;
    }
}
