/* ==========================================================================
   causality.club -- Styles
   Color Palette:
     Abyss:          #0D0509
     Chamber:         #1A0A12
     Oxblood:         #5E1A2D
     Burnished Gold:  #C49A2B
     Tarnished Brass: #9A7B22
     Parchment:       #E8DCC8
     Foxed Ivory:     #D4C4A8
     Ink:             #2A1A10
   ========================================================================== */

/* --- CSS Custom Properties --- */
:root {
    --abyss: #0D0509;
    --chamber: #1A0A12;
    --oxblood: #5E1A2D;
    --burnished-gold: #C49A2B;
    --tarnished-brass: #9A7B22;
    --parchment: #E8DCC8;
    --foxed-ivory: #D4C4A8;
    --ink: #2A1A10;
    --bg-color: #1A0A12;
}

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

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

body {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    line-height: 1.75;
    color: var(--parchment);
    background-color: var(--bg-color);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Typography --- */
h1, h2, h3 {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
}

h1 {
    font-size: clamp(3rem, 10vw, 7rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--parchment);
    line-height: 1.1;
}

h2 {
    font-size: clamp(1.6rem, 4vw, 3rem);
    letter-spacing: 0.03em;
    color: var(--parchment);
    margin-bottom: 1.5rem;
}

h3 {
    font-size: clamp(1.2rem, 2.5vw, 2rem);
    letter-spacing: 0.03em;
    color: var(--parchment);
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1.25em;
    color: var(--parchment);
}

em {
    font-style: italic;
}

a {
    color: var(--burnished-gold);
    text-decoration: none;
}

blockquote {
    font-style: italic;
}

sup {
    font-size: 0.65em;
    color: var(--burnished-gold);
    vertical-align: super;
    line-height: 0;
}

/* --- Section Label (IM Fell English SC) --- */
.section-label {
    display: block;
    font-family: 'IM Fell English SC', serif;
    font-weight: 400;
    font-size: clamp(0.7rem, 1.2vw, 0.85rem);
    letter-spacing: 0.15em;
    color: var(--burnished-gold);
    margin-bottom: 1.5rem;
    text-transform: uppercase;
}

.section-label-centered {
    text-align: center;
}

/* --- Ouroboros Emblem (Fixed) --- */
#ouroboros-emblem {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 48px;
    height: 48px;
    z-index: 100;
    opacity: 0.85;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(26, 10, 18, 0.7);
    border: 1px solid rgba(196, 154, 43, 0.3);
}

#ouroboros-emblem:hover {
    opacity: 1;
}

/* --- Causal Thread SVG --- */
#causal-thread {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 100%;
    z-index: 5;
    pointer-events: none;
}

/* --- Sections (General) --- */
.section {
    position: relative;
    min-height: 100vh;
    width: 100%;
}

/* --- Ornament Dividers --- */
.ornament-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3em 0;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.5rem;
    color: var(--burnished-gold);
    position: relative;
    z-index: 10;
}

/* --- Section I: The Premise --- */
.section-premise {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-color: var(--chamber);
    position: relative;
    overflow: hidden;
}

.candlelight-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80vw;
    height: 80vw;
    max-width: 800px;
    max-height: 800px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(94, 26, 45, 0.12) 0%, transparent 70%);
    pointer-events: none;
    animation: candleFlicker 8s ease-in-out infinite;
    z-index: 1;
}

@keyframes candleFlicker {
    0%, 100% { opacity: 0.08; }
    50% { opacity: 0.15; }
}

.premise-content {
    position: relative;
    z-index: 10;
    padding: 2rem;
}

.domain-title {
    margin-bottom: 0.4em;
    text-shadow: 0 0 80px rgba(94, 26, 45, 0.5);
}

.subtitle {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    font-weight: 400;
    font-style: italic;
    color: var(--foxed-ivory);
    letter-spacing: 0.05em;
}

/* --- Section II: The First Cause --- */
.section-first-cause {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8vh 5vw;
    background-color: var(--chamber);
}

.split-layout {
    display: flex;
    align-items: flex-start;
    gap: 4vw;
    max-width: 1200px;
    width: 100%;
}

.split-text {
    flex: 0 0 55%;
    max-width: 55%;
}

.split-text p {
    text-align: justify;
    hyphens: auto;
    -webkit-hyphens: auto;
}

.split-image {
    flex: 0 0 40%;
    max-width: 40%;
}

/* Drop Cap */
.drop-cap::first-letter {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: 3.5em;
    float: left;
    line-height: 0.85;
    margin-right: 0.08em;
    color: var(--burnished-gold);
}

/* Marginalia Notes */
.marginalia-note {
    font-size: clamp(0.7rem, 1vw, 0.8rem);
    color: var(--foxed-ivory);
    font-style: italic;
    opacity: 0.7;
    padding-left: 1.5em;
    border-left: 1px solid rgba(196, 154, 43, 0.3);
    margin-top: 2em;
}

/* Duotone Image Container */
.duotone-container {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(196, 154, 43, 0.15);
}

.duotone-container::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--oxblood);
    mix-blend-mode: multiply;
    opacity: 0.25;
    pointer-events: none;
}

.duotone-placeholder {
    width: 100%;
}

.duotone-placeholder svg {
    width: 100%;
    height: auto;
    display: block;
    filter: grayscale(100%) contrast(1.1) brightness(0.9);
}

/* --- Section III: The Chain (Zigzag) --- */
.section-chain {
    padding: 10vh 5vw;
    background-color: var(--chamber);
    position: relative;
}

.chain-title {
    text-align: center;
    margin-bottom: 6vh;
}

.zigzag-container {
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
}

.zigzag-block {
    max-width: 420px;
    margin-bottom: 30vh;
    position: relative;
    padding: 2rem 2.5rem;
}

.zigzag-block:last-child {
    margin-bottom: 5vh;
}

.zigzag-left {
    margin-right: auto;
    margin-left: 0;
    border-left: 2px solid rgba(196, 154, 43, 0.4);
}

.zigzag-right {
    margin-left: auto;
    margin-right: 0;
    border-right: 2px solid rgba(196, 154, 43, 0.4);
    text-align: right;
}

.zigzag-block h3 {
    color: var(--parchment);
}

.zigzag-block p {
    color: var(--foxed-ivory);
    font-size: clamp(0.95rem, 1.5vw, 1.1rem);
}

.zigzag-right p {
    text-align: right;
}

.footnote-num {
    position: absolute;
    top: 0.5rem;
    color: var(--burnished-gold);
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 0.85rem;
    opacity: 0.6;
}

.zigzag-left .footnote-num {
    right: -1.5rem;
}

.zigzag-right .footnote-num {
    left: -1.5rem;
}

/* --- Section IV: The Debate Floor --- */
.section-debate {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10vh 5vw;
    background-color: var(--chamber);
    position: relative;
    overflow: hidden;
}

.debate-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 1;
}

/* Interlocking circles pattern overlay */
.pattern-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Ccircle cx='30' cy='30' r='20' fill='none' stroke='%23C49A2B' stroke-width='0.5' opacity='0.04'/%3E%3Ccircle cx='0' cy='30' r='20' fill='none' stroke='%23C49A2B' stroke-width='0.5' opacity='0.04'/%3E%3Ccircle cx='60' cy='30' r='20' fill='none' stroke='%23C49A2B' stroke-width='0.5' opacity='0.04'/%3E%3Ccircle cx='30' cy='0' r='20' fill='none' stroke='%23C49A2B' stroke-width='0.5' opacity='0.04'/%3E%3Ccircle cx='30' cy='60' r='20' fill='none' stroke='%23C49A2B' stroke-width='0.5' opacity='0.04'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

.debate-content {
    position: relative;
    z-index: 10;
    max-width: 680px;
    width: 100%;
}

.debate-content p {
    text-align: justify;
    hyphens: auto;
    -webkit-hyphens: auto;
}

.debate-content h2 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 2rem;
}

/* Pull Quote */
.pull-quote {
    margin: 3rem 0;
    padding: 2rem 0;
    border-top: 1px solid rgba(196, 154, 43, 0.4);
    border-bottom: 1px solid rgba(196, 154, 43, 0.4);
}

.pull-quote p {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-style: italic;
    font-size: clamp(1.1rem, 2.2vw, 1.5rem);
    color: var(--foxed-ivory);
    line-height: 1.6;
    text-align: left;
    margin-bottom: 0.75em;
}

.pull-quote cite {
    display: block;
    font-family: 'IM Fell English SC', serif;
    font-size: clamp(0.7rem, 1vw, 0.8rem);
    color: var(--tarnished-brass);
    letter-spacing: 0.1em;
    font-style: normal;
}

/* --- Section V: The Verdict --- */
.section-verdict {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 100vh;
    background-color: var(--abyss);
    position: relative;
    overflow: hidden;
}

.verdict-content {
    position: relative;
    z-index: 10;
    padding: 2rem;
}

.thread-flourish {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2rem;
    color: var(--burnished-gold);
    margin-bottom: 3rem;
}

.verdict-statement {
    font-size: clamp(1.8rem, 4.5vw, 3.5rem);
    letter-spacing: 0.02em;
    line-height: 1.3;
    margin-bottom: 2rem;
    color: var(--parchment);
}

.verdict-coda {
    font-family: 'IM Fell English SC', serif;
    font-size: clamp(0.8rem, 1.5vw, 1rem);
    letter-spacing: 0.2em;
    color: var(--burnished-gold);
    margin-bottom: 3rem;
}

.verdict-emblem {
    opacity: 0.5;
}

/* --- Content Reveal Animations --- */
.content-reveal {
    opacity: 0;
    transition: opacity 800ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 800ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal-left {
    transform: translateX(-60px);
}

.reveal-right {
    transform: translateX(60px);
}

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

/* --- Responsive --- */
@media (max-width: 768px) {
    .split-layout {
        flex-direction: column;
    }

    .split-text,
    .split-image {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .split-text p {
        text-align: left;
    }

    .zigzag-left,
    .zigzag-right {
        max-width: 90%;
        margin-left: auto;
        margin-right: auto;
    }

    .zigzag-right {
        text-align: left;
        border-right: none;
        border-left: 2px solid rgba(196, 154, 43, 0.4);
    }

    .zigzag-right p {
        text-align: left;
    }

    .zigzag-block {
        margin-bottom: 15vh;
    }

    .debate-content p {
        text-align: left;
    }

    #causal-thread {
        display: none;
    }

    .footnote-num {
        position: static;
    }

    #ouroboros-emblem {
        top: 12px;
        left: 12px;
        width: 40px;
        height: 40px;
    }

    #ouroboros-emblem svg {
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 480px) {
    .section-first-cause {
        padding: 5vh 4vw;
    }

    .section-chain {
        padding: 5vh 4vw;
    }

    .section-debate {
        padding: 5vh 4vw;
    }

    h1 {
        letter-spacing: 0.06em;
    }

    .zigzag-block {
        padding: 1.5rem;
    }
}

/* --- Scrollbar Styling --- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--chamber);
}

::-webkit-scrollbar-thumb {
    background: var(--tarnished-brass);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--burnished-gold);
}

/* --- Selection --- */
::selection {
    background: rgba(94, 26, 45, 0.6);
    color: var(--parchment);
}
