/* =========================================================
   rational.quest -- styles.css
   A chain of reasoning, in 6 propositions.
   Palette: dark library + aged brass + parchment cream.
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
    --bg-primary: #0d0d0d;
    --bg-secondary: #1a1a14;
    --accent-gold: #c8b87a;
    --highlight-gold: #d4a843;
    --text-warm: #e8e0cc;
    --text-cool: #7a8e9e;
    --accent-red: #8b4049;

    --thread-glow: 0 0 4px rgba(200, 184, 122, 0.3);

    --serif-display: "Playfair Display", "Lora", Georgia, serif;
    --serif-body: "Source Serif 4", "Source Serif Pro", Georgia, serif;
    --sans-tech: "Space Grotesk", "Inter", system-ui, sans-serif;

    --ease-quill: cubic-bezier(0.65, 0, 0.35, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

    --rule-spacing: 28px;
}

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

html {
    scroll-behavior: smooth;
    background: var(--bg-primary);
}

html, body {
    height: 100%;
}

body {
    background: var(--bg-primary);
    color: var(--text-warm);
    font-family: var(--serif-body);
    font-size: 18px;
    line-height: 1.8;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: "kern" 1, "liga" 1;
}

img, svg {
    display: block;
    max-width: 100%;
}

::selection {
    background: rgba(200, 184, 122, 0.25);
    color: var(--text-warm);
}

/* ---------- Golden Thread (continuous svg overlay) ---------- */
.golden-thread {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    overflow: visible;
}

.golden-thread #threadPath {
    will-change: stroke-dashoffset;
    transition: stroke-dashoffset 120ms linear;
}

/* ---------- Candle flicker ambient ---------- */
.candle-flicker {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background:
        radial-gradient(ellipse 60vw 60vh at 12% 90%, rgba(212, 168, 67, 0.06), transparent 60%),
        radial-gradient(ellipse 50vw 50vh at 88% 8%, rgba(200, 184, 122, 0.04), transparent 60%);
    animation: candle-flicker 8s ease-in-out infinite;
}

@keyframes candle-flicker {
    0%, 100% { opacity: 0.85; }
    23% { opacity: 0.6; }
    47% { opacity: 1; }
    71% { opacity: 0.7; }
    88% { opacity: 0.95; }
}

/* ---------- Masthead ---------- */
.masthead {
    position: fixed;
    top: 28px;
    left: 36px;
    z-index: 30;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-family: var(--sans-tech);
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent-gold);
    pointer-events: none;
}

.masthead-mark {
    color: var(--accent-gold);
}

.masthead-sub {
    color: var(--accent-gold);
    opacity: 0.55;
    font-size: 10px;
    letter-spacing: 0.22em;
}

/* ---------- Progress Indicator ---------- */
.progress-indicator {
    position: fixed;
    top: 50%;
    right: 28px;
    transform: translateY(-50%);
    height: 60vh;
    z-index: 30;
    display: flex;
    align-items: stretch;
    pointer-events: none;
}

.progress-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    background: rgba(200, 184, 122, 0.3);
    transform: translateX(-50%);
}

.progress-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    margin: 0;
    padding: 0;
    position: relative;
    z-index: 1;
    pointer-events: auto;
}

.progress-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    cursor: pointer;
    transition: transform 600ms var(--ease-spring), color 300ms ease;
    color: var(--accent-gold);
}

.progress-mark {
    font-family: var(--serif-display);
    font-size: 18px;
    line-height: 1;
    color: var(--accent-gold);
    opacity: 0.5;
    transition: color 320ms ease, opacity 320ms ease, text-shadow 320ms ease, transform 600ms var(--ease-spring);
    background: var(--bg-primary);
    padding: 2px 6px;
}

.progress-label {
    font-family: var(--sans-tech);
    font-weight: 500;
    font-size: 9px;
    letter-spacing: 0.2em;
    color: var(--accent-gold);
    opacity: 0.4;
    transition: opacity 320ms ease, color 320ms ease;
}

.progress-item:hover .progress-mark,
.progress-item:hover .progress-label {
    opacity: 1;
    color: var(--highlight-gold);
}

.progress-item.active .progress-mark {
    color: var(--highlight-gold);
    opacity: 1;
    text-shadow: 0 0 8px rgba(212, 168, 67, 0.6);
    transform: scale(1.15);
}

.progress-item.active .progress-label {
    color: var(--highlight-gold);
    opacity: 1;
}

/* ---------- Main chain & panels ---------- */
.chain {
    position: relative;
    scroll-snap-type: y mandatory;
    overflow-y: auto;
    height: 100vh;
    z-index: 5;
}

.panel {
    position: relative;
    min-height: 100vh;
    padding: 96px clamp(28px, 6vw, 96px) 120px;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    z-index: 1;
}

/* ruled-paper background for text-heavy sections */
.ruled-paper {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        repeating-linear-gradient(
            to bottom,
            transparent 0,
            transparent calc(var(--rule-spacing) - 1px),
            rgba(200, 184, 122, 0.04) calc(var(--rule-spacing) - 1px),
            rgba(200, 184, 122, 0.04) var(--rule-spacing)
        );
    z-index: 0;
}

.panel > *:not(.ruled-paper) {
    position: relative;
    z-index: 1;
}

/* marginalia */
.panel-marginalia {
    position: absolute;
    font-family: var(--sans-tech);
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent-gold);
    opacity: 0.45;
    z-index: 4;
}

.panel-marginalia.top-left { top: 32px; left: clamp(28px, 6vw, 96px); }
.panel-marginalia.top-right {
    top: 32px;
    right: 80px;
    font-style: italic;
    text-transform: lowercase;
    letter-spacing: 0.1em;
    font-family: var(--serif-body);
    font-weight: 400;
    font-size: 12px;
}

/* eyebrow */
.proposition-eyebrow,
.panel-eyebrow {
    font-family: var(--sans-tech);
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--accent-gold);
    opacity: 0.7;
    margin-bottom: 28px;
}

/* quill divider */
.quill-divider {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: clamp(280px, 40vw, 600px);
    height: 24px;
    opacity: 0.55;
}

.quill-divider svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* ---------- Reveal animation (blur-focus) ---------- */
.reveal {
    opacity: 0;
    filter: blur(8px);
    transform: translateY(8px);
    transition: opacity 800ms ease-out, filter 800ms ease-out, transform 800ms ease-out;
}

.reveal.is-visible {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
}

.reveal-line {
    display: block;
}

/* ---------- SVG draw-stroke base ---------- */
.draw-stroke {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    transition: stroke-dashoffset 1400ms var(--ease-quill);
}

.draw-stroke.is-drawn {
    stroke-dashoffset: 0;
}

/* ---------- Section 1: Axiom ---------- */
.panel--axiom {
    text-align: center;
    align-items: center;
    background: var(--bg-primary);
}

.axiom-wrap {
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 2;
}

.proposition {
    font-family: var(--serif-display);
    font-weight: 700;
    font-size: clamp(2.5rem, 6vw, 5.5rem);
    line-height: 1.06;
    letter-spacing: -0.02em;
    color: var(--text-warm);
    text-wrap: balance;
    margin-bottom: 36px;
}

.proposition .reveal-line:first-child {
    transition-delay: 0ms;
}

.proposition .reveal-line:last-child {
    color: var(--accent-gold);
    font-style: italic;
    font-weight: 400;
    transition-delay: 240ms;
}

.proposition-coda {
    font-family: var(--serif-body);
    font-style: italic;
    font-size: 1rem;
    color: var(--accent-gold);
    opacity: 0.7;
    letter-spacing: 0.04em;
    margin-bottom: 64px;
    transition-delay: 480ms;
}

.axiom-mark {
    width: 56px;
    height: 56px;
    margin: 0 auto 56px;
    opacity: 0.7;
}

.scroll-hint {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--accent-gold);
    opacity: 0;
    animation: scroll-hint-rise 1200ms ease-out 1.6s forwards, scroll-hint-bob 2.6s ease-in-out 2.8s infinite;
}

@keyframes scroll-hint-rise {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 0.85; transform: translateY(0); }
}

@keyframes scroll-hint-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

.scroll-hint-label {
    font-family: var(--sans-tech);
    font-weight: 500;
    font-size: 10px;
    letter-spacing: 0.32em;
    text-transform: uppercase;
}

.scroll-hint-arrow {
    width: 12px;
    height: 40px;
}

/* ---------- Section 2: Deduction ---------- */
.panel--deduction {
    background: var(--bg-primary);
}

.panel-header {
    max-width: 760px;
    margin: 0 auto 64px;
    text-align: center;
}

.panel-title {
    font-family: var(--serif-display);
    font-weight: 700;
    font-size: clamp(1.8rem, 3.6vw, 3.2rem);
    line-height: 1.12;
    letter-spacing: -0.015em;
    color: var(--text-warm);
    text-wrap: balance;
    margin-bottom: 20px;
}

.panel-lede {
    font-family: var(--serif-body);
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-warm);
    opacity: 0.78;
    text-wrap: balance;
    transition-delay: 200ms;
}

.syllogism {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 64px;
    max-width: 1280px;
    margin: 0 auto;
    align-items: center;
}

.syllogism-stage {
    position: relative;
    perspective: 1400px;
    min-height: 460px;
}

.syllogism-lines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: visible;
}

.premise,
.conclusion {
    position: absolute;
    background: var(--bg-secondary);
    border: 1px solid rgba(200, 184, 122, 0.35);
    padding: 26px 28px;
    width: min(320px, 38%);
    z-index: 2;
    transform-style: preserve-3d;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(200, 184, 122, 0.06);
}

.premise--major {
    top: 16px;
    left: 4%;
    transform: rotateY(-4deg) rotateX(2deg) translateZ(0);
    transition-delay: 0ms;
}

.premise--minor {
    top: 16px;
    right: 4%;
    transform: rotateY(4deg) rotateX(2deg) translateZ(0);
    transition-delay: 240ms;
}

.conclusion {
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%) translateZ(20px);
    width: min(380px, 46%);
    border-color: rgba(212, 168, 67, 0.7);
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.6), 0 0 24px rgba(212, 168, 67, 0.08), inset 0 0 0 1px rgba(212, 168, 67, 0.1);
    transition-delay: 480ms;
}

.premise-label,
.conclusion-label {
    display: block;
    font-family: var(--sans-tech);
    font-weight: 500;
    font-size: 10px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--accent-gold);
    opacity: 0.7;
    margin-bottom: 14px;
}

.conclusion-label {
    color: var(--highlight-gold);
    opacity: 0.95;
}

.premise-statement,
.conclusion-statement {
    font-family: var(--serif-display);
    font-weight: 400;
    font-size: clamp(1.05rem, 1.4vw, 1.4rem);
    line-height: 1.32;
    color: var(--text-warm);
    letter-spacing: -0.01em;
}

.conclusion-statement {
    font-weight: 600;
    color: var(--text-warm);
}

.premise-mark,
.conclusion-mark {
    position: absolute;
    top: 12px;
    right: 18px;
    font-family: var(--serif-display);
    color: var(--accent-gold);
    opacity: 0.4;
    font-size: 18px;
    line-height: 1;
}

.conclusion-mark {
    color: var(--highlight-gold);
    opacity: 0.85;
    font-size: 22px;
}

.syllogism-aside {
    border-left: 1px solid rgba(200, 184, 122, 0.3);
    padding: 8px 0 8px 24px;
}

.aside-mark {
    font-family: var(--serif-display);
    font-size: 28px;
    color: var(--accent-gold);
    opacity: 0.6;
    line-height: 1;
    margin-bottom: 14px;
}

.aside-text {
    font-family: var(--serif-body);
    font-style: italic;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-warm);
    opacity: 0.78;
}

/* ---------- Section 3: Evidence ---------- */
.panel--evidence {
    background: var(--bg-primary);
}

.evidence-grid {
    display: grid;
    grid-template-columns: 60% 40%;
    gap: 56px;
    max-width: 1320px;
    width: 100%;
    margin: 0 auto;
    align-items: center;
}

.evidence-figure {
    position: relative;
    border-right: 1px solid rgba(200, 184, 122, 0.18);
    padding-right: 48px;
}

.figure-caption {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.figure-label {
    font-family: var(--sans-tech);
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--accent-gold);
    opacity: 0.8;
}

.figure-sub {
    font-family: var(--serif-body);
    font-style: italic;
    font-size: 13px;
    color: var(--text-warm);
    opacity: 0.6;
}

.telescope {
    width: 100%;
    max-width: 460px;
    height: auto;
    margin: 0 auto;
    aspect-ratio: 1 / 1;
}

.star-dot {
    opacity: 0;
    transition: opacity 600ms ease;
}

.evidence-figure.is-active .star-dot {
    opacity: 0.85;
}

.evidence-figure.is-active .star-dot:nth-of-type(1) { transition-delay: 800ms; }
.evidence-figure.is-active .star-dot:nth-of-type(2) { transition-delay: 1000ms; }
.evidence-figure.is-active .star-dot:nth-of-type(3) { transition-delay: 1200ms; }
.evidence-figure.is-active .star-dot:nth-of-type(4) { transition-delay: 1400ms; }
.evidence-figure.is-active .star-dot:nth-of-type(5) { transition-delay: 1600ms; }

.figure-note {
    margin-top: 24px;
    font-family: var(--serif-body);
    font-style: italic;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-warm);
    opacity: 0.62;
    max-width: 380px;
}

.evidence-fragments {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.fragment {
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(200, 184, 122, 0.12);
    opacity: 0;
    filter: blur(6px);
    transform: translateX(8px);
    transition: opacity 700ms ease-out, filter 700ms ease-out, transform 700ms ease-out;
}

.fragment.is-visible {
    opacity: 1;
    filter: blur(0);
    transform: translateX(0);
}

.fragment:nth-child(1).is-visible { transition-delay: 0ms; }
.fragment:nth-child(2).is-visible { transition-delay: 180ms; }
.fragment:nth-child(3).is-visible { transition-delay: 360ms; }
.fragment:nth-child(4).is-visible { transition-delay: 540ms; }
.fragment:nth-child(5).is-visible { transition-delay: 720ms; }
.fragment:nth-child(6).is-visible { transition-delay: 900ms; }

.fragment-num {
    font-family: var(--sans-tech);
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent-gold);
    opacity: 0.7;
    padding-top: 4px;
}

.fragment-text {
    font-family: var(--serif-body);
    font-size: 15px;
    line-height: 1.55;
    color: var(--text-warm);
    opacity: 0.86;
}

.fragment-pattern {
    border-bottom: none;
    border-top: 1px solid rgba(212, 168, 67, 0.4);
    padding-top: 18px;
    margin-top: 8px;
}

.fragment-pattern .fragment-num {
    color: var(--highlight-gold);
    opacity: 1;
    font-family: var(--serif-display);
    font-size: 18px;
    letter-spacing: 0;
}

.fragment-pattern .fragment-text {
    color: var(--text-warm);
}

.fragment-pattern .fragment-text strong {
    color: var(--highlight-gold);
    font-weight: 600;
    font-style: normal;
    letter-spacing: 0.04em;
}

.evidence-coda {
    margin-top: 28px;
    font-family: var(--serif-body);
    font-style: italic;
    font-size: 14px;
    line-height: 1.65;
    color: var(--text-warm);
    opacity: 0.65;
    padding-left: 16px;
    border-left: 1px solid rgba(200, 184, 122, 0.3);
}

.evidence-coda-mark {
    display: block;
    font-family: var(--serif-display);
    font-size: 16px;
    color: var(--accent-gold);
    opacity: 0.7;
    margin-bottom: 4px;
    font-style: normal;
}

/* ---------- Section 4: Paradox ---------- */
.panel--paradox {
    background: var(--bg-primary);
}

.paradox-header {
    max-width: 800px;
    margin: 0 auto 56px;
    text-align: center;
}

.paradox-eyebrow {
    color: var(--accent-red);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    opacity: 0.85;
}

.paradox-mark-red {
    color: var(--accent-red);
    font-family: var(--serif-display);
    font-size: 14px;
    line-height: 1;
}

.paradox-title {
    font-family: var(--serif-display);
    font-weight: 700;
    font-size: clamp(1.8rem, 3.6vw, 3.2rem);
    line-height: 1.12;
    letter-spacing: -0.015em;
    color: var(--text-warm);
    text-wrap: balance;
}

.paradox-stage {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1px 1fr;
    gap: 0;
    max-width: 1280px;
    margin: 0 auto;
    min-height: 320px;
    align-items: center;
}

.paradox-side {
    padding: 48px clamp(20px, 4vw, 56px);
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: relative;
}

.paradox-side--warm {
    color: var(--text-warm);
    text-align: right;
    background: linear-gradient(to left, rgba(200, 184, 122, 0.04), transparent 70%);
}

.paradox-side--cool {
    color: var(--text-cool);
    text-align: left;
    background: linear-gradient(to right, rgba(122, 142, 158, 0.06), transparent 70%);
}

.paradox-side-label {
    font-family: var(--sans-tech);
    font-weight: 500;
    font-size: 10px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    opacity: 0.7;
}

.paradox-side--warm .paradox-side-label { color: var(--accent-gold); }
.paradox-side--cool .paradox-side-label { color: var(--text-cool); }

.paradox-statement {
    font-family: var(--serif-display);
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1.15rem, 1.8vw, 1.65rem);
    line-height: 1.4;
    letter-spacing: -0.01em;
    position: relative;
}

.paradox-side--warm .paradox-statement { color: var(--text-warm); }
.paradox-side--cool .paradox-statement { color: #b6c5d2; }

.paradox-quote {
    font-family: var(--serif-display);
    font-size: 1.4em;
    line-height: 0;
    opacity: 0.7;
    color: var(--accent-gold);
}

.paradox-side--cool .paradox-quote { color: var(--text-cool); }

.paradox-attrib {
    font-family: var(--serif-body);
    font-style: italic;
    font-size: 13px;
    opacity: 0.6;
    letter-spacing: 0.02em;
}

.paradox-divider {
    position: relative;
    height: 100%;
    width: 1px;
    align-self: stretch;
    justify-self: center;
    z-index: 2;
    cursor: crosshair;
    animation: paradox-oscillate 12s ease-in-out infinite;
    pointer-events: auto;
}

.paradox-divider-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    background: linear-gradient(to bottom,
        transparent 0%,
        rgba(200, 184, 122, 0.6) 12%,
        rgba(200, 184, 122, 0.6) 88%,
        transparent 100%);
    transform: translateX(-50%);
}

.paradox-divider-mark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--serif-display);
    font-size: 22px;
    color: var(--accent-red);
    background: var(--bg-primary);
    padding: 6px;
    line-height: 1;
}

.paradox-ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    transform: translate(-50%, -50%) scale(0);
    border-radius: 50%;
    background: rgba(200, 184, 122, 0.18);
    pointer-events: none;
    opacity: 0;
}

.paradox-ripple.is-active {
    animation: ripple-pulse 700ms ease-out forwards;
}

@keyframes ripple-pulse {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(20); opacity: 0; }
}

@keyframes paradox-oscillate {
    0%, 100% { transform: translateX(-2vw); }
    50% { transform: translateX(2vw); }
}

.paradox-coda {
    max-width: 720px;
    margin: 56px auto 0;
    text-align: center;
    font-family: var(--serif-body);
    font-style: italic;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-warm);
    opacity: 0.78;
    text-wrap: balance;
    transition-delay: 300ms;
}

/* ---------- Section 5: Synthesis ---------- */
.panel--synthesis {
    background: var(--bg-primary);
}

.synthesis-flow {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
        "lead diagram"
        "right diagram"
        "coda coda";
    gap: 32px 56px;
    align-items: start;
}

.synthesis-text {
    font-family: var(--serif-body);
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-warm);
    text-wrap: pretty;
}

.synthesis-text--lead {
    grid-area: lead;
    font-size: 1.18rem;
    line-height: 1.65;
    transition-delay: 0ms;
}

.synthesis-text--lead em {
    color: var(--highlight-gold);
    font-style: italic;
}

.synthesis-text--right {
    grid-area: right;
    transition-delay: 220ms;
    opacity: 0.88;
}

.synthesis-text--coda {
    grid-area: coda;
    text-align: center;
    font-style: italic;
    font-size: 0.95rem;
    color: var(--accent-gold);
    opacity: 0.85;
    max-width: 720px;
    margin: 24px auto 0;
    transition-delay: 440ms;
    border-top: 1px solid rgba(200, 184, 122, 0.18);
    padding-top: 24px;
    text-wrap: balance;
}

.synthesis-coda-mark {
    display: block;
    font-family: var(--serif-display);
    font-size: 18px;
    color: var(--accent-gold);
    opacity: 0.8;
    margin-bottom: 6px;
    font-style: normal;
}

.synthesis-diagram {
    grid-area: diagram;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.synthesis-diagram svg {
    width: 100%;
    max-width: 340px;
    aspect-ratio: 1 / 1;
}

.synthesis-diagram figcaption {
    font-family: var(--sans-tech);
    font-weight: 500;
    font-size: 10px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--accent-gold);
    opacity: 0.65;
    text-align: center;
}

/* ---------- Section 6: Quest ---------- */
.panel--quest {
    text-align: center;
    align-items: center;
    background: var(--bg-primary);
}

.quest-wrap {
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
    position: relative;
}

.quest-question {
    font-family: var(--serif-display);
    font-weight: 700;
    font-size: clamp(2.2rem, 5vw, 4.8rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--text-warm);
    text-wrap: balance;
    margin-bottom: 64px;
    cursor: default;
    transition: transform 700ms var(--ease-spring), filter 800ms ease-out, opacity 800ms ease-out;
    transform-origin: center;
}

.quest-question:hover {
    transform: scale(1.02);
}

.quest-question .reveal-line:nth-child(1) { transition-delay: 0ms; }
.quest-question .reveal-line:nth-child(2) { transition-delay: 240ms; }
.quest-question .reveal-line:nth-child(3) {
    transition-delay: 480ms;
    color: var(--accent-gold);
}

.quest-question em {
    font-style: italic;
    color: var(--highlight-gold);
}

.quest-spiral {
    width: 140px;
    height: 140px;
    margin: 0 auto 56px;
    opacity: 0.75;
}

.quest-coda {
    font-family: var(--serif-body);
    font-style: italic;
    font-size: 1rem;
    color: var(--accent-gold);
    opacity: 0.75;
    letter-spacing: 0.02em;
    margin-bottom: 80px;
}

.quest-coda-mark {
    display: block;
    font-family: var(--serif-display);
    font-size: 22px;
    color: var(--accent-gold);
    opacity: 0.8;
    margin-bottom: 8px;
    font-style: normal;
}

.quest-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    max-width: 720px;
    margin: 0 auto;
}

.footer-line {
    flex: 1;
    height: 1px;
    background: rgba(200, 184, 122, 0.25);
}

.footer-text {
    font-family: var(--sans-tech);
    font-weight: 500;
    font-size: 10px;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--accent-gold);
    opacity: 0.7;
    white-space: nowrap;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .syllogism {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .syllogism-stage {
        min-height: 520px;
    }
    .premise,
    .conclusion {
        width: min(360px, 80%);
    }
    .premise--major { left: 0; transform: rotateY(-2deg) translateZ(0); }
    .premise--minor { right: 0; transform: rotateY(2deg) translateZ(0); }
    .syllogism-aside {
        border-left: none;
        border-top: 1px solid rgba(200, 184, 122, 0.3);
        padding: 18px 0 0 0;
    }

    .evidence-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .evidence-figure {
        border-right: none;
        border-bottom: 1px solid rgba(200, 184, 122, 0.18);
        padding-right: 0;
        padding-bottom: 32px;
    }

    .synthesis-flow {
        grid-template-columns: 1fr;
        grid-template-areas:
            "lead"
            "diagram"
            "right"
            "coda";
    }

    .paradox-stage {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 60px 1fr;
        min-height: 520px;
    }
    .paradox-side--warm,
    .paradox-side--cool {
        text-align: center;
    }
    .paradox-divider {
        width: 100%;
        height: 1px;
        animation: paradox-oscillate-h 12s ease-in-out infinite;
    }
    .paradox-divider-line {
        top: 50%;
        left: 0;
        right: 0;
        bottom: auto;
        width: auto;
        height: 1px;
        background: linear-gradient(to right,
            transparent 0%,
            rgba(200, 184, 122, 0.6) 12%,
            rgba(200, 184, 122, 0.6) 88%,
            transparent 100%);
        transform: translateY(-50%);
    }
    @keyframes paradox-oscillate-h {
        0%, 100% { transform: translateY(-2vh); }
        50% { transform: translateY(2vh); }
    }

    .progress-indicator { right: 14px; }
    .masthead { left: 18px; top: 18px; }
    .panel-marginalia.top-right { right: 44px; }
}

@media (max-width: 560px) {
    body { font-size: 16px; }
    .panel { padding: 88px 22px 100px; }
    .progress-indicator { display: none; }
    .panel-marginalia.top-right { display: none; }
}
