/* ==========================================================================
   causality.club - Styles
   Victorian debate chamber aesthetic with adversarial split-screen layout
   ========================================================================== */

/* --- Custom Properties --- */
:root {
    --proposition-crimson: #8B1A2B;
    --opposition-slate: #2B3A4A;
    --chamber-mahogany: #2C1810;
    --parchment-ivory: #F2E8D5;
    --gavel-gold: #C4943A;
    --ink-black: #0F0E0D;
    --chalk-white: #EDEDEB;

    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Source Serif 4', 'Georgia', serif;
    --font-ui: 'DM Sans', 'Helvetica Neue', sans-serif;
    --font-accent: 'Cormorant Garamond', 'Georgia', serif;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--chamber-mahogany);
    color: var(--parchment-ivory);
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.65;
    overflow-x: hidden;
}

/* --- Scroll Progress Bar --- */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    z-index: 1000;
    display: flex;
    pointer-events: none;
}

#progress-left {
    width: 50%;
    height: 100%;
    background: var(--proposition-crimson);
    transform-origin: left center;
    transform: scaleX(0);
}

#progress-right {
    width: 50%;
    height: 100%;
    background: var(--opposition-slate);
    transform-origin: right center;
    transform: scaleX(0);
}

/* --- Navigation --- */
#main-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    background: rgba(44, 24, 16, 0.95);
    backdrop-filter: blur(8px);
    z-index: 900;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.5s ease;
}

#main-nav.nav-hidden {
    transform: translateY(-100%);
    opacity: 0;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-logo span {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 14px;
    letter-spacing: 0.08em;
    color: var(--parchment-ivory);
}

.nav-scales {
    flex-shrink: 0;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 28px;
}

.nav-link {
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--chalk-white);
    text-decoration: none;
    text-transform: uppercase;
    transition: color 0.3s ease;
    position: relative;
    padding-bottom: 4px;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--gavel-gold);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.3s ease;
}

.nav-link.active {
    color: var(--gavel-gold);
}

.nav-link.active::after {
    transform: scaleX(1);
}

.nav-link:hover {
    color: var(--gavel-gold);
}

/* --- Leather Texture Overlay --- */
.leather-texture {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(15,14,13,0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, rgba(15,14,13,0.15) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(196,148,58,0.03) 0%, transparent 70%),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(15,14,13,0.04) 2px,
            rgba(15,14,13,0.04) 4px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 3px,
            rgba(15,14,13,0.03) 3px,
            rgba(15,14,13,0.03) 6px
        );
    opacity: 0.8;
    z-index: 0;
}

/* --- Scales Watermark --- */
.scales-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    opacity: 0.03;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 180'%3E%3Cline x1='100' y1='20' x2='100' y2='140' stroke='%23C4943A' stroke-width='2'/%3E%3Cline x1='30' y1='50' x2='170' y2='50' stroke='%23C4943A' stroke-width='2'/%3E%3Ccircle cx='100' cy='20' r='6' fill='none' stroke='%23C4943A' stroke-width='2'/%3E%3Cpath d='M30,50 L15,100 Q30,115 45,100 Z' fill='none' stroke='%23C4943A' stroke-width='2'/%3E%3Cpath d='M170,50 L155,100 Q170,115 185,100 Z' fill='none' stroke='%23C4943A' stroke-width='2'/%3E%3C/svg%3E") no-repeat center center;
    background-size: contain;
    pointer-events: none;
    z-index: 0;
}

/* --- Panels --- */
.panel {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

/* --- Section 1: The Threshold (Hero) --- */
#threshold {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--chamber-mahogany);
}

.threshold-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
}

.hero-scales {
    opacity: 0;
    margin-bottom: 24px;
}

.hero-scales.animating {
    opacity: 1;
}

.hero-scales.animating .scales-draw {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    animation: drawPath 1200ms ease-in-out forwards;
}

.hero-scales.animating .scales-draw-circle {
    opacity: 0;
    animation: fadeInElement 400ms ease-in-out 800ms forwards;
}

@keyframes drawPath {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes fadeInElement {
    to {
        opacity: 1;
    }
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(3rem, 6vw, 6rem);
    letter-spacing: 0.08em;
    line-height: 1.1;
    color: var(--parchment-ivory);
    opacity: 0;
    transition: opacity 0.6s ease;
}

.hero-title.visible {
    opacity: 1;
}

.title-left {
    color: var(--proposition-crimson);
}

.title-mid {
    color: var(--parchment-ivory);
}

.title-right {
    color: var(--opposition-slate);
}

.hero-tagline {
    font-family: var(--font-ui);
    font-weight: 500;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--gavel-gold);
    opacity: 0;
    transition: opacity 0.6s ease 0.2s;
}

.hero-tagline.visible {
    opacity: 1;
}

.hero-provocation {
    font-family: var(--font-accent);
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    color: var(--chalk-white);
    max-width: 600px;
    margin-top: 20px;
    min-height: 2em;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.hero-provocation.visible {
    opacity: 1;
}

/* --- Hero Scales Transition to Nav --- */
.hero-scales.shrink-to-nav {
    position: fixed;
    top: 16px;
    left: 32px;
    width: 24px;
    height: 24px;
    z-index: 950;
    transition: all 600ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- Section 2: The Floor --- */
#floor {
    background-color: var(--chamber-mahogany);
    padding: 100px 40px 80px;
}

.section-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(2rem, 4vw, 3.5rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-align: center;
    color: var(--parchment-ivory);
    margin-bottom: 60px;
    position: relative;
    z-index: 1;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 2px;
    background: var(--gavel-gold);
    margin: 16px auto 0;
}

.adversarial-grid {
    display: grid;
    grid-template-columns: 1fr 48px 1fr;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.debate-column {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.debate-card {
    background: var(--parchment-ivory);
    color: var(--ink-black);
    padding: 32px;
    border-radius: 2px;
    box-shadow: 0 2px 12px rgba(15, 14, 13, 0.25);
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.debate-card.proposition {
    border-left: 4px solid var(--proposition-crimson);
    transform: translateX(-60px);
}

.debate-card.opposition {
    border-left: 4px solid var(--opposition-slate);
    transform: translateX(60px);
}

.debate-card.revealed {
    opacity: 1;
    transform: translateX(0);
}

.debate-card:hover {
    animation: gavelStrike 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
    border-left-color: var(--gavel-gold);
    box-shadow: 0 4px 20px rgba(15, 14, 13, 0.35);
}

@keyframes gavelStrike {
    0% { transform: scale(1); }
    40% { transform: scale(0.97); }
    100% { transform: scale(1.02); }
}

.card-label {
    font-family: var(--font-ui);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 12px;
}

.proposition .card-label {
    color: var(--proposition-crimson);
}

.opposition .card-label {
    color: var(--opposition-slate);
}

.debate-card h3 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.25rem, 2vw, 1.5rem);
    letter-spacing: -0.01em;
    color: var(--ink-black);
    margin-bottom: 12px;
    line-height: 1.3;
}

.debate-card p {
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.65;
    color: rgba(15, 14, 13, 0.85);
}

/* Lectern Divider */
.lectern-divider {
    display: flex;
    align-items: stretch;
    justify-content: center;
    position: relative;
    z-index: 1;
    transition: opacity 0.8s ease;
}

.lectern-svg {
    width: 48px;
    height: 100%;
}

/* --- Pull Quote Section --- */
.pull-quote-section {
    position: relative;
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--ink-black);
    padding: 80px 40px;
}

.pull-quote {
    position: relative;
    z-index: 1;
    max-width: 720px;
    text-align: center;
    opacity: 0;
    filter: blur(4px);
    transition: opacity 0.6s ease 0.2s, filter 0.6s ease 0.2s;
}

.pull-quote.revealed {
    opacity: 1;
    filter: blur(0);
}

.pull-quote p {
    font-family: var(--font-accent);
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    line-height: 1.8;
    color: var(--parchment-ivory);
}

.pull-quote cite {
    display: block;
    margin-top: 20px;
    font-family: var(--font-ui);
    font-style: normal;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--gavel-gold);
}

/* --- Section 3: The Chain --- */
.chain-section {
    background-color: var(--ink-black);
    padding: 100px 0 80px;
    min-height: auto;
}

.section-title-light {
    color: var(--chalk-white);
}

.chain-subtitle {
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.04em;
    color: var(--chalk-white);
    text-align: center;
    margin-bottom: 48px;
    opacity: 0.7;
}

.causal-graph-container {
    width: 100%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding: 40px;
    -webkit-overflow-scrolling: touch;
}

.causal-graph-container::-webkit-scrollbar {
    height: 4px;
}

.causal-graph-container::-webkit-scrollbar-track {
    background: rgba(237, 237, 235, 0.05);
}

.causal-graph-container::-webkit-scrollbar-thumb {
    background: var(--gavel-gold);
    border-radius: 2px;
}

.causal-graph {
    position: relative;
    width: 1240px;
    height: 300px;
    margin: 0 auto;
}

.graph-connections {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.causal-arrow {
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
    transition: stroke-dashoffset 0.8s ease-out;
}

.causal-arrow.drawn {
    stroke-dashoffset: 0;
}

.graph-nodes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.graph-node {
    position: absolute;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--gavel-gold);
    background: var(--ink-black);
    scroll-snap-align: center;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.graph-node:hover {
    animation: gavelStrike 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 0 20px rgba(196, 148, 58, 0.3);
}

.graph-node span {
    font-family: var(--font-ui);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--chalk-white);
    text-align: center;
    line-height: 1.2;
}

.node-origin {
    border-color: var(--gavel-gold);
    background: rgba(196, 148, 58, 0.1);
}

.node-proposition {
    border-color: var(--proposition-crimson);
    background: rgba(139, 26, 43, 0.1);
}

.node-opposition {
    border-color: var(--opposition-slate);
    background: rgba(43, 58, 74, 0.1);
}

.node-verdict {
    border-color: var(--gavel-gold);
    background: rgba(196, 148, 58, 0.15);
    width: 72px;
    height: 72px;
    margin-top: -4px;
}

.node-final {
    border-color: var(--gavel-gold);
    border-width: 3px;
    background: rgba(196, 148, 58, 0.2);
    width: 72px;
    height: 72px;
    margin-top: -4px;
    box-shadow: 0 0 24px rgba(196, 148, 58, 0.2);
}

/* --- Section 4: The Verdict --- */
.verdict-section {
    background-color: var(--chamber-mahogany);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 40px;
    min-height: 100vh;
}

.verdict-content {
    position: relative;
    z-index: 1;
    max-width: 680px;
    margin: 0 auto;
    text-align: center;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.verdict-content.revealed {
    opacity: 1;
    transform: translateY(0);
}

.verdict-seal {
    margin-bottom: 32px;
}

.seal-circle {
    stroke-dasharray: 565;
    stroke-dashoffset: 565;
    transition: stroke-dashoffset 1.2s ease-in-out;
}

.verdict-content.revealed .seal-circle {
    stroke-dashoffset: 0;
}

.seal-inner {
    stroke-dasharray: 440;
    stroke-dashoffset: 440;
    transition: stroke-dashoffset 1.2s ease-in-out 0.3s;
}

.verdict-content.revealed .seal-inner {
    stroke-dashoffset: 0;
}

.verdict-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(2.5rem, 5.5vw, 5rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--parchment-ivory);
    margin-bottom: 40px;
}

.verdict-text {
    margin-bottom: 40px;
}

.verdict-statement {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    line-height: 1.5;
    color: var(--parchment-ivory);
    margin-bottom: 24px;
    letter-spacing: -0.01em;
}

.verdict-closing {
    font-family: var(--font-body);
    font-size: 18px;
    font-weight: 400;
    line-height: 1.65;
    color: var(--chalk-white);
    margin-bottom: 24px;
}

.verdict-final {
    font-family: var(--font-accent);
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    line-height: 1.8;
    color: var(--gavel-gold);
}

.verdict-sigil {
    margin-top: 32px;
    opacity: 0.6;
}

/* --- Footer --- */
.site-footer {
    background-color: var(--ink-black);
    padding: 32px 40px;
    text-align: center;
    border-top: 1px solid rgba(196, 148, 58, 0.2);
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.footer-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.04em;
    color: var(--parchment-ivory);
}

.footer-divider {
    color: var(--gavel-gold);
    font-size: 14px;
}

.footer-motto {
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.04em;
    color: var(--chalk-white);
    opacity: 0.6;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .adversarial-grid {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 0 16px;
    }

    .lectern-divider {
        display: none;
    }

    .debate-card.proposition,
    .debate-card.opposition {
        transform: translateY(30px);
    }

    .debate-card.revealed {
        transform: translateY(0);
    }

    #floor {
        padding: 80px 20px 60px;
    }

    .nav-links {
        display: none;
    }

    .causal-graph {
        width: 1000px;
    }

    .pull-quote-section {
        padding: 60px 24px;
    }

    .verdict-section {
        padding: 80px 24px;
    }

    .footer-content {
        flex-direction: column;
        gap: 6px;
    }

    .footer-divider {
        display: none;
    }
}
