/* moral.quest -- chrome-metallic split-screen with neon accents */

:root {
    --c-base: #0D0D1A;
    --c-thesis: #1A1A2E;
    --c-antithesis: #2A2A3E;
    --c-chrome-mid: #3A3A5C;
    --c-chrome-light: #B8B8C8;
    --c-chrome-pale: #E8E8F0;
    --c-text-soft: #B8B8C8;
    --c-text-mute: #7B7B9A;
    --c-text-bright: #FFFFFF;
    --c-cyan: #00E5FF;
    --c-magenta: #FF00E5;
    --c-gold: #FFD700;
    --c-pale: #E8E8F0;

    --split-left: 60%;
    --split-right: 40%;

    --font-primary: "Commissioner", "Inter", system-ui, -apple-system, sans-serif;
    --font-mono: "Space Mono", "Inter", monospace;
}

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

html, body {
    width: 100%;
    overflow-x: hidden;
}

body {
    background-color: #0D0D1A;
    color: var(--c-chrome-light);
    font-family: var(--font-primary);
    font-weight: 400;
    line-height: 1.65;
    letter-spacing: 0.01em;
    min-height: 100vh;
    position: relative;
}

/* Subtle chrome reflection overlay across body */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, transparent 50%, rgba(255,255,255,0.01) 100%);
    mix-blend-mode: screen;
    transform: rotate(0deg);
    transform-origin: 50% 50%;
    will-change: transform;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Scroll progress indicator */
.scroll-progress {
    position: fixed;
    top: 0;
    right: 12px;
    width: 2px;
    height: 0%;
    background: linear-gradient(180deg, #00E5FF 0%, #FF00E5 100%);
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.6);
    z-index: 50;
    pointer-events: none;
}

/* Persistent generative canvas behind content */
.generative-canvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
}

/* Dynamic dividing line between panels */
.divider {
    position: fixed;
    top: 0;
    left: 60%;
    width: 200px;
    height: 100vh;
    transform: translateX(-100px);
    z-index: 30;
    pointer-events: none;
    overflow: visible;
}

.divider-line {
    stroke-linecap: round;
}

.divider-glow {
    opacity: 0.55;
    stroke-linecap: round;
}

/* Sections */
.section {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--split-left, 60%) var(--split-right, 40%);
    z-index: 2;
    overflow: hidden;
}

.section-hero {
    min-height: 100vh;
}

.section-chapter {
    min-height: 100vh;
}

.section-synthesis {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    background: linear-gradient(180deg, #1A1A2E 0%, #2A2A3E 50%, #1A1A2E 100%);
    position: relative;
}

.section-synthesis::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at 50% 50%, rgba(0, 229, 255, 0.08) 0%, transparent 50%);
}

.section-summit {
    display: block;
    min-height: 100vh;
    background-color: #0D0D1A;
    position: relative;
    overflow: hidden;
}

/* Panels */
.panel {
    position: relative;
    padding: clamp(3rem, 6vh, 6rem) 0;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.panel-thesis {
    background-color: #1A1A2E;
    background-image:
        linear-gradient(135deg, rgba(255,255,255,0.025) 0%, transparent 40%, rgba(255,255,255,0.015) 100%),
        linear-gradient(180deg, #1A1A2E 0%, #1A1A2E 60%, #15152A 100%);
    justify-content: flex-end;
}

.panel-thesis .panel-inner {
    margin-right: 0;
    padding-right: clamp(2rem, 4vw, 6rem);
    padding-left: clamp(1.5rem, 3vw, 4rem);
    max-width: 640px;
    text-align: right;
}

.panel-antithesis {
    background-color: #2A2A3E;
    background-image:
        linear-gradient(135deg, rgba(255,255,255,0.04) 0%, transparent 50%, rgba(255,255,255,0.01) 100%),
        linear-gradient(180deg, #2A2A3E 0%, #2A2A3E 60%, #25253A 100%);
    justify-content: flex-start;
}

.panel-antithesis .panel-inner {
    margin-left: 0;
    padding-left: clamp(2rem, 4vw, 6rem);
    padding-right: clamp(1.5rem, 3vw, 4rem);
    max-width: 640px;
    text-align: left;
}

.panel-inner {
    position: relative;
    z-index: 2;
    width: 100%;
}

/* Typography */
.overline {
    display: inline-block;
    font-family: var(--font-primary);
    font-weight: 300;
    font-size: clamp(0.7rem, 1.2vw, 0.9rem);
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: #00E5FF;
    margin-bottom: 1.5rem;
    text-shadow: 0 0 12px rgba(0, 229, 255, 0.4);
}

.overline-antithesis {
    color: #FF00E5;
    text-shadow: 0 0 12px rgba(255, 0, 229, 0.4);
}

.overline-synthesis {
    color: #FFD700;
    text-shadow: 0 0 14px rgba(255, 215, 0, 0.45);
    margin-bottom: 2rem;
}

.overline-summit {
    color: #FFD700;
    text-shadow: 0 0 14px rgba(255, 215, 0, 0.5);
    margin-bottom: 1.5rem;
}

.hero-title {
    font-weight: 200;
    font-size: clamp(3rem, 7vw, 6.5rem);
    line-height: 0.92;
    letter-spacing: -0.03em;
    color: #E8E8F0;
    text-shadow: 0 0 30px rgba(0, 229, 255, 0.18);
    margin-bottom: 1.5rem;
    font-feature-settings: "ss01";
}

.hero-letters {
    display: inline-block;
    white-space: nowrap;
}

.hero-letters .letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(8px);
    will-change: opacity, transform;
}

.chapter-title {
    font-weight: 800;
    font-size: clamp(2.2rem, 4.5vw, 4rem);
    line-height: 0.96;
    letter-spacing: -0.025em;
    color: #E8E8F0;
    margin-bottom: 1.75rem;
    text-shadow: 0 0 22px rgba(0, 229, 255, 0.12);
}

.chapter-title-small {
    font-size: clamp(1.6rem, 3.2vw, 2.6rem);
}

.lede {
    font-weight: 300;
    font-size: clamp(1.05rem, 1.5vw, 1.35rem);
    line-height: 1.55;
    color: #B8B8C8;
    margin-bottom: 2rem;
    max-width: 38ch;
    margin-left: auto;
}

.body-text {
    font-weight: 400;
    font-size: clamp(1rem, 1.3vw, 1.15rem);
    line-height: 1.65;
    letter-spacing: 0.01em;
    color: #B8B8C8;
    margin-bottom: 1.25rem;
    max-width: 38ch;
    margin-left: auto;
}

.panel-antithesis .body-text,
.body-text-anti {
    margin-left: 0;
    margin-right: auto;
}

.pullquote {
    font-weight: 200;
    font-size: clamp(1.5rem, 3vw, 2.4rem);
    line-height: 1.25;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    max-width: 28ch;
    margin-left: auto;
    border-right: 2px solid #00E5FF;
    padding-right: 1.25rem;
}

.pullquote-anti {
    margin-left: 0;
    margin-right: auto;
    border-right: none;
    border-left: 2px solid #FF00E5;
    padding-right: 0;
    padding-left: 1.25rem;
}

.pullquote .attribution {
    display: block;
    margin-top: 0.75rem;
    font-style: italic;
    font-weight: 300;
    font-size: clamp(0.8rem, 1vw, 0.95rem);
    color: #7B7B9A;
    letter-spacing: 0.05em;
}

/* Data labels and strips */
.meta-row,
.data-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-top: 2rem;
    justify-content: flex-end;
}

.panel-antithesis .meta-row,
.panel-antithesis .data-strip {
    justify-content: flex-start;
}

.data-strip-vertical {
    flex-direction: column;
    gap: 0.6rem;
    align-items: flex-start;
}

.data-label {
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #7B7B9A;
    font-feature-settings: "tnum";
    display: inline-flex;
    gap: 0.5rem;
    align-items: baseline;
}

.data-num {
    color: #B8B8C8;
    font-weight: 400;
}

/* Generative frame inside hero antithesis */
.generative-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 5/3;
    margin-top: 1.5rem;
    border: 1px solid rgba(123, 123, 154, 0.25);
    background:
        linear-gradient(135deg, rgba(255,255,255,0.03) 0%, transparent 50%, rgba(255,255,255,0.01) 100%),
        linear-gradient(180deg, #1A1A2E 0%, #0D0D1A 100%);
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(0, 229, 255, 0.08), inset 0 0 60px rgba(0, 229, 255, 0.04);
}

.ridge-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.ridge {
    stroke: none;
}

.ridge-bg {
    fill: #1A1A2E;
    opacity: 0.5;
}

.ridge-mid {
    fill: url(#ridge-fill-2);
    opacity: 0.85;
}

.ridge-fg {
    fill: url(#ridge-fill-1);
}

.ridge-light {
    fill: none;
    stroke: url(#ridge-edge);
    stroke-width: 1.5;
    opacity: 0.85;
}

.data-readout {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 10px;
    background: rgba(13, 13, 26, 0.72);
    border: 1px solid rgba(0, 229, 255, 0.15);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.readout-row {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #7B7B9A;
}

.readout-row .readout-val {
    color: #00E5FF;
    font-feature-settings: "tnum";
}

/* Pattern tiles (algorithmic line grid) */
.pattern-tile {
    position: relative;
    width: 100%;
    height: 220px;
    margin: 1.5rem 0;
    background-color: rgba(13, 13, 26, 0.4);
    border: 1px solid rgba(123, 123, 154, 0.15);
    overflow: hidden;
}

.pattern-tile-dense {
    height: 180px;
}

.pattern-tile canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Synthesis */
.synthesis-inner {
    width: min(900px, 88vw);
    text-align: center;
    padding: 4rem 2rem;
    position: relative;
    z-index: 2;
}

.synthesis-icon {
    width: clamp(120px, 18vw, 220px);
    height: auto;
    margin: 0 auto 2rem auto;
    display: block;
    filter: drop-shadow(0 0 20px rgba(0, 229, 255, 0.25));
}

.syn-peak {
    will-change: transform;
}

.syn-peak-left {
    transform-origin: 80px 100px;
}

.syn-peak-right {
    transform-origin: 120px 100px;
}

.syn-burst line {
    transform-origin: 100px 100px;
    will-change: transform, opacity;
}

.synthesis-text {
    font-weight: 200;
    font-size: clamp(1.6rem, 3.5vw, 3rem);
    line-height: 1.25;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.78);
    max-width: 24ch;
    margin: 0 auto;
    text-shadow: 0 0 24px rgba(0, 229, 255, 0.2);
}

.synthesis-meta {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-top: 2.5rem;
}

/* Summit finale */
.summit-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.summit-ridge {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.summit-bg {
    fill: url(#summit-fill-bg);
    opacity: 0.7;
}

.summit-mid {
    fill: url(#summit-fill-mid);
    opacity: 0.88;
}

.summit-fg {
    fill: url(#summit-fill-fg);
}

.summit-light {
    fill: none;
    stroke: url(#summit-edge);
    stroke-width: 2;
    opacity: 0.9;
    will-change: opacity, stroke;
}

.summit-light-bg {
    opacity: 0.45;
    stroke-width: 1;
}

.summit-light-mid {
    opacity: 0.7;
    stroke-width: 1.5;
}

.summit-content {
    position: relative;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: clamp(4rem, 12vh, 9rem) 2rem 4rem 2rem;
    min-height: 60vh;
}

.summit-title {
    font-weight: 200;
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 1.18;
    letter-spacing: 0.01em;
    color: rgba(255, 255, 255, 0.85);
    max-width: 22ch;
    text-shadow: 0 0 28px rgba(0, 229, 255, 0.3), 0 0 60px rgba(255, 0, 229, 0.18);
    margin-bottom: 2rem;
    perspective: 800px;
}

.summit-letters {
    display: inline-block;
}

.summit-letters .letter {
    display: inline-block;
    will-change: transform, opacity;
    opacity: 0;
}

.summit-letters .letter.space {
    width: 0.3em;
}

.summit-coords {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 1rem;
    color: #FFD700;
}

.summit-coords .data-label {
    color: #FFD700;
}

.summit-coords .data-num {
    color: #FFD700;
}

/* Responsive */
@media (max-width: 768px) {
    .section,
    .section-chapter,
    .section-hero {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
    }

    .panel {
        min-height: 70vh;
        padding: 4rem 0;
    }

    .panel-thesis .panel-inner,
    .panel-antithesis .panel-inner {
        padding-left: clamp(1.25rem, 5vw, 2.5rem);
        padding-right: clamp(1.25rem, 5vw, 2.5rem);
        max-width: 100%;
        text-align: left;
    }

    .panel-thesis .panel-inner {
        text-align: left;
    }

    .lede,
    .body-text,
    .panel-thesis .body-text,
    .panel-thesis .lede {
        margin-left: 0;
        margin-right: auto;
    }

    .pullquote {
        margin-left: 0;
        margin-right: auto;
        border-right: none;
        border-left: 2px solid #00E5FF;
        padding-right: 0;
        padding-left: 1.25rem;
    }

    .meta-row,
    .data-strip,
    .panel-thesis .meta-row,
    .panel-thesis .data-strip {
        justify-content: flex-start;
    }

    .divider {
        display: none;
    }

    .section-summit {
        min-height: 90vh;
    }
}
