/* ============================================
   dilemma.quest — styles.css
   Cool-gray anti-design with diagonal sections
   ============================================ */

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

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

body {
    font-family: 'Work Sans', sans-serif;
    font-weight: 400;
    font-size: 17px;
    line-height: 1.7;
    color: #4A4D55;
    background: #1E2028;
    overflow-x: hidden;
}

/* --- Color Palette ---
   Fog:             #F0F1F4
   Obsidian Dusk:   #1E2028
   Charcoal:        #2B2D33
   Slate:           #6B6E78
   Cool Pewter:     #9194A0
   Indigo Murmur:   #5C6BC0
   Silver Wire:     #D1D3DA
   Silver Ash:      #E8E9EC
--- */

/* --- Grain Overlay --- */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.02;
}

/* --- Fault Line --- */
.fault-line {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 100vh;
    background: #5C6BC0;
    box-shadow: 0 0 20px 4px rgba(92, 107, 192, 0.15);
    z-index: 100;
    pointer-events: none;
    opacity: 0.4;
}

/* --- Navigation --- */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.nav.nav--visible {
    opacity: 1;
}

.nav-wordmark {
    font-family: 'Space Mono', monospace;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: #9194A0;
}

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

.nav-link {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: #9194A0;
    cursor: pointer;
    position: relative;
    transition: color 0.3s cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: #5C6BC0;
    transition: width 0.3s cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.nav-link:hover::after,
.nav-link.nav-link--active::after {
    width: 100%;
}

/* --- Chambers (Sections) --- */
.chamber {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.chamber--dark {
    background: #1E2028;
    color: #E8E9EC;
}

.chamber--light {
    background: #F0F1F4;
    color: #2B2D33;
}

.chamber--interactive {
    background: #F0F1F4;
    color: #2B2D33;
}

/* --- Bokeh Backgrounds --- */
.chamber-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    filter: blur(2px) brightness(0.9);
    pointer-events: none;
}

.chamber--dark .chamber-bg {
    opacity: 0.08;
    background-image: radial-gradient(circle at 20% 30%, rgba(200, 200, 220, 0.4) 0%, transparent 50%),
                       radial-gradient(circle at 70% 60%, rgba(180, 190, 210, 0.3) 0%, transparent 45%),
                       radial-gradient(circle at 45% 80%, rgba(160, 170, 200, 0.35) 0%, transparent 40%),
                       radial-gradient(circle at 85% 20%, rgba(170, 180, 200, 0.25) 0%, transparent 55%),
                       radial-gradient(circle at 10% 70%, rgba(190, 195, 215, 0.3) 0%, transparent 35%),
                       radial-gradient(circle at 60% 15%, rgba(150, 165, 195, 0.2) 0%, transparent 50%);
}

.chamber--light .chamber-bg,
.chamber--interactive .chamber-bg {
    opacity: 0.06;
    background-image: radial-gradient(circle at 30% 40%, rgba(40, 50, 70, 0.3) 0%, transparent 50%),
                       radial-gradient(circle at 80% 30%, rgba(50, 55, 80, 0.25) 0%, transparent 45%),
                       radial-gradient(circle at 50% 70%, rgba(35, 45, 65, 0.2) 0%, transparent 40%),
                       radial-gradient(circle at 15% 85%, rgba(45, 55, 75, 0.3) 0%, transparent 35%),
                       radial-gradient(circle at 65% 55%, rgba(55, 60, 85, 0.15) 0%, transparent 50%);
}

.chamber-bg--warm {
    background-image: radial-gradient(circle at 25% 35%, rgba(200, 190, 170, 0.4) 0%, transparent 50%),
                       radial-gradient(circle at 75% 55%, rgba(190, 180, 165, 0.3) 0%, transparent 45%),
                       radial-gradient(circle at 40% 75%, rgba(180, 175, 160, 0.35) 0%, transparent 40%),
                       radial-gradient(circle at 80% 25%, rgba(195, 185, 170, 0.25) 0%, transparent 55%) !important;
}

/* --- Ghost Numerals --- */
.ghost-numeral {
    position: absolute;
    top: 20px;
    right: 40px;
    font-family: 'Jost', sans-serif;
    font-weight: 100;
    font-size: clamp(150px, 20vw, 280px);
    line-height: 1;
    opacity: 0.04;
    pointer-events: none;
    z-index: 1;
    color: inherit;
}

/* --- Diagonal Cuts --- */
.diagonal-cut {
    position: absolute;
    width: 100%;
    height: 12.3vw; /* tan(7deg) * 100vw ≈ 12.3vw */
    max-height: 180px;
    min-height: 60px;
    z-index: 2;
}

.diagonal-cut--top {
    top: -1px;
    clip-path: polygon(0 0, 100% 0, 100% 0%, 0 100%);
}

.diagonal-cut--top-reverse {
    top: -1px;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 0%);
}

.chamber--light .diagonal-cut {
    background: #1E2028;
}

.chamber--dark .diagonal-cut {
    background: #F0F1F4;
}

.chamber--interactive .diagonal-cut {
    background: #1E2028;
}

.chamber--reflection .diagonal-cut {
    background: #F0F1F4;
}

/* --- Chamber Content --- */
.chamber-content {
    position: relative;
    z-index: 5;
    max-width: 1200px;
    margin: 0 auto;
    padding: 120px 40px 80px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.chamber-content--split {
    display: grid;
    grid-template-columns: 1fr 40px 1fr;
    gap: 0;
    align-items: start;
    padding-top: 160px;
}

.chamber-content--centered {
    align-items: center;
    text-align: center;
}

/* --- Section Headings --- */
.section-heading {
    font-family: 'Jost', sans-serif;
    font-weight: 500;
    font-size: clamp(36px, 5vw, 64px);
    letter-spacing: 0.08em;
    line-height: 1.2;
    margin-bottom: 32px;
    color: #2B2D33;
}

.section-heading--light {
    color: #E8E9EC;
}

/* --- Body Text --- */
.body-text {
    font-family: 'Work Sans', sans-serif;
    font-weight: 400;
    font-size: 17px;
    line-height: 1.7;
    color: #4A4D55;
    max-width: 540px;
    margin-bottom: 24px;
}

.body-text em {
    font-style: italic;
    color: #6B6E78;
}

/* --- Label Text (metadata) --- */
.label-text {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: #9194A0;
    display: block;
    margin-bottom: 16px;
}

.label-text--light {
    color: #9194A0;
}

/* --- Rule Lines --- */
.rule-line {
    width: 120px;
    height: 1px;
    background: #D1D3DA;
    margin-bottom: 32px;
    position: relative;
}

.rule-line::after {
    content: '';
    position: absolute;
    top: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 7px;
    height: 7px;
    border: 1px solid #D1D3DA;
    transform: translateX(-50%) rotate(45deg);
    background: transparent;
}

.rule-line--light {
    background: rgba(209, 211, 218, 0.3);
}

.rule-line--light::after {
    border-color: rgba(209, 211, 218, 0.3);
}

.rule-line--centered {
    margin-left: auto;
    margin-right: auto;
}

/* --- Marginal Annotations --- */
.marginal-annotation {
    position: absolute;
    left: calc(50% - 6px);
    top: 50%;
    z-index: 10;
    pointer-events: none;
}

.marginal-annotation::after {
    content: attr(data-text);
    font-family: 'Jost', sans-serif;
    font-weight: 300;
    font-style: italic;
    font-size: 13px;
    color: #9194A0;
    opacity: 0.35;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    letter-spacing: 0.1em;
}

.marginal-annotation--right {
    left: auto;
    right: calc(50% - 6px);
}

/* ==========================================
   SECTION 1: Opening Chamber
   ========================================== */
.chamber--opening {
    display: flex;
    align-items: center;
    justify-content: center;
}

.chamber--opening .chamber-bg {
    opacity: 0;
}

.chamber--opening .chamber-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 100vh;
}

.fork-svg-container {
    margin-bottom: 60px;
}

.fork-svg {
    width: 120px;
    height: 180px;
}

.fork-path {
    stroke-dasharray: 350;
    stroke-dashoffset: 350;
    animation: drawFork 3s cubic-bezier(0.25, 0.1, 0.25, 1.0) forwards;
}

.fork-path--left {
    animation-delay: 0s;
}

.fork-path--right {
    animation-delay: 0.3s;
}

.fork-origin {
    opacity: 0;
    animation: fadeIn 0.8s cubic-bezier(0.25, 0.1, 0.25, 1.0) 0.2s forwards;
}

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

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

.opening-question {
    font-family: 'Jost', sans-serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.8;
    letter-spacing: 0.12em;
    color: #6B6E78;
    max-width: 700px;
    min-height: 2.4em;
}

.opening-question .cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: #5C6BC0;
    margin-left: 4px;
    vertical-align: text-bottom;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* ==========================================
   SECTION 2: Definition Chamber
   ========================================== */
.chamber--definition {
    padding-top: 80px;
}

.split-left {
    padding-right: 40px;
}

.split-right {
    padding-left: 40px;
}

/* ==========================================
   SECTION 3: Historical Chamber
   ========================================== */
.chamber--history .chamber-content {
    padding-top: 160px;
    padding-bottom: 120px;
    min-height: auto;
}

.history-intro {
    text-align: center;
    margin-bottom: 80px;
}

.history-intro .rule-line {
    margin-left: auto;
    margin-right: auto;
}

.dilemma-pair {
    display: grid;
    grid-template-columns: 1fr 60px 1fr;
    gap: 0;
    align-items: center;
    margin-bottom: 60px;
    padding: 40px 0;
    border-bottom: 1px solid rgba(209, 211, 218, 0.1);
}

.dilemma-pair:last-child {
    border-bottom: none;
}

.dilemma-choice--left {
    text-align: right;
    padding-right: 30px;
}

.dilemma-choice--right {
    text-align: left;
    padding-left: 30px;
}

.dilemma-fork-icon {
    display: flex;
    justify-content: center;
    align-items: center;
}

.dilemma-fork-icon svg {
    width: 30px;
    height: 45px;
    opacity: 0.5;
}

.dilemma-text {
    font-family: 'Jost', sans-serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(18px, 2.5vw, 24px);
    line-height: 1.6;
    letter-spacing: 0.06em;
    color: #E8E9EC;
}

/* Anti-design: rotate every third dilemma pair slightly */
.dilemma-pair:nth-child(3n+1) {
    transform: rotate(-0.5deg);
}

/* ==========================================
   SECTION 4: Interactive Chamber
   ========================================== */
.chamber--interactive {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.interactive-label {
    position: relative;
    z-index: 10;
    text-align: center;
    padding-top: 120px;
}

.interactive-heading {
    position: relative;
    z-index: 10;
    text-align: center;
    margin-bottom: 40px;
}

.interactive-container {
    position: relative;
    display: flex;
    width: 100%;
    flex: 1;
    min-height: 50vh;
    z-index: 5;
}

.interactive-side {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    cursor: pointer;
    transition: background-color 0.6s cubic-bezier(0.25, 0.1, 0.25, 1.0),
                opacity 0.6s cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.interactive-side--left {
    justify-content: flex-end;
}

.interactive-side--right {
    justify-content: flex-start;
}

.interactive-side-content {
    max-width: 380px;
    text-align: center;
}

.interactive-side:hover {
    background-color: rgba(92, 107, 192, 0.08);
}

.interactive-side.interactive-side--dimmed {
    opacity: 0.35;
}

.interactive-divider {
    width: 1px;
    background: #5C6BC0;
    box-shadow: 0 0 30px 6px rgba(92, 107, 192, 0.2);
    align-self: stretch;
}

.dilemma-statement {
    font-family: 'Jost', sans-serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(22px, 3vw, 36px);
    line-height: 1.8;
    letter-spacing: 0.12em;
    color: #6B6E78;
    margin-bottom: 24px;
}

.interactive-label-text {
    margin-bottom: 0;
}

.interactive-response {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 40px;
    min-height: 80px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.1, 0.25, 1.0),
                transform 0.8s cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.interactive-response.interactive-response--visible {
    opacity: 1;
    transform: translateY(0);
}

.response-text {
    font-family: 'Jost', sans-serif;
    font-weight: 300;
    font-style: italic;
    font-size: 20px;
    line-height: 1.8;
    letter-spacing: 0.08em;
    color: #6B6E78;
    max-width: 600px;
    margin: 0 auto;
}

/* ==========================================
   SECTION 5: Reflection Chamber
   ========================================== */
.chamber--reflection {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.chamber--reflection .chamber-content {
    padding-bottom: 160px;
}

.fork-svg-container--inverted {
    margin-bottom: 50px;
}

.fork-svg--small {
    width: 80px;
    height: 120px;
}

.reflection-quote {
    font-family: 'Jost', sans-serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(24px, 3.5vw, 42px);
    line-height: 1.8;
    letter-spacing: 0.12em;
    color: #6B6E78;
    max-width: 700px;
    margin: 0 auto 40px;
}

.reflection-body {
    font-family: 'Work Sans', sans-serif;
    font-weight: 400;
    font-size: 17px;
    line-height: 1.7;
    color: #9194A0;
    max-width: 540px;
    margin: 0 auto 40px;
}

.reflection-closing {
    font-family: 'Jost', sans-serif;
    font-weight: 500;
    font-size: clamp(18px, 2vw, 24px);
    line-height: 1.8;
    letter-spacing: 0.08em;
    color: #E8E9EC;
    max-width: 600px;
    margin: 0 auto;
}

/* --- Footer --- */
.footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 24px 40px;
}

.footer-text {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: #9194A0;
    opacity: 0.5;
}

.footer-divider {
    color: #9194A0;
    opacity: 0.3;
}

/* --- Reveal Animations --- */
.reveal-element {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.1, 0.25, 1.0),
                transform 0.8s cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.reveal-element.reveal-element--visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger for dilemma pairs */
.dilemma-pair .dilemma-choice--left {
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.6s cubic-bezier(0.25, 0.1, 0.25, 1.0),
                transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.dilemma-pair .dilemma-choice--right {
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.6s cubic-bezier(0.25, 0.1, 0.25, 1.0) 0.2s,
                transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1.0) 0.2s;
}

.dilemma-pair .dilemma-fork-icon {
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.25, 0.1, 0.25, 1.0) 0.1s;
}

.dilemma-pair.reveal-element--visible .dilemma-choice--left {
    opacity: 1;
    transform: translateX(0);
}

.dilemma-pair.reveal-element--visible .dilemma-choice--right {
    opacity: 1;
    transform: translateX(0);
}

.dilemma-pair.reveal-element--visible .dilemma-fork-icon {
    opacity: 1;
}

/* --- Anti-design: Off-axis text for every third section --- */
.chamber--history .history-intro .section-heading {
    transform: rotate(-1.5deg);
    transform-origin: center center;
}

/* Off-axis body text in definition chamber */
.split-right .body-text:last-child {
    transform: rotate(0.8deg);
    transform-origin: left top;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .chamber-content--split {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .split-left,
    .split-right {
        padding: 0;
    }

    .marginal-annotation {
        display: none;
    }

    .dilemma-pair {
        grid-template-columns: 1fr;
        gap: 20px;
        text-align: center;
    }

    .dilemma-choice--left,
    .dilemma-choice--right {
        text-align: center;
        padding: 0;
    }

    .dilemma-fork-icon {
        transform: rotate(90deg);
    }

    .nav-links {
        display: none;
    }

    .interactive-container {
        flex-direction: column;
    }

    .interactive-side--left,
    .interactive-side--right {
        justify-content: center;
    }

    .interactive-divider {
        width: 100%;
        height: 1px;
    }

    .fault-line {
        opacity: 0.15;
    }

    .ghost-numeral {
        font-size: 100px;
        right: 20px;
    }
}
