/* ============================================
   dilemma.dev — Forking Corridor
   ============================================ */

/* --- Custom Properties --- */
:root {
    --corridor-charcoal: #2a2a2e;
    --concrete-void: #1a1917;
    --halogen-amber: #c4873b;
    --institutional-cream: #d4d0c8;
    --institutional-sage: #6b8f71;
    --hairline-divide: #8a6230;
    --alert-bone: #e8e0d2;
    --corridor-width: 540;
}

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

html {
    scroll-behavior: auto;
}

body {
    background-color: var(--concrete-void);
    color: var(--institutional-cream);
    font-family: 'IBM Plex Serif', serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.75;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* --- Opening Animation Overlay --- */
#opening-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--concrete-void);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

#opening-overlay.fade-out {
    opacity: 0.2;
    transition: opacity 600ms ease;
}

#opening-overlay.hidden {
    display: none;
}

#opening-h-line {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60vw;
    height: 2px;
    background: var(--halogen-amber);
    transform: translate(-50%, -50%) scaleX(0);
    transform-origin: center;
}

#opening-h-line.animate {
    animation: draw-h-line 1400ms ease-out forwards;
}

@keyframes draw-h-line {
    0% { transform: translate(-50%, -50%) scaleX(0); }
    100% { transform: translate(-50%, -50%) scaleX(1); }
}

#opening-v-line {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 40vh;
    background: var(--halogen-amber);
    transform: translate(-50%, 0) scaleY(0);
    transform-origin: top;
    opacity: 0;
}

#opening-v-line.animate {
    animation: draw-v-line 800ms ease-out forwards;
}

@keyframes draw-v-line {
    0% { transform: translate(-50%, 0) scaleY(0); opacity: 1; }
    100% { transform: translate(-50%, 0) scaleY(1); opacity: 1; }
}

/* --- Scroll Progress Indicator --- */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 2px;
    height: 0%;
    background: var(--halogen-amber);
    z-index: 900;
    transition: height 100ms linear;
}

/* --- Main Corridor --- */
#corridor {
    position: relative;
    width: 100%;
    opacity: 0;
    transition: opacity 800ms ease;
}

#corridor.visible {
    opacity: 1;
}

/* --- Single Column Sections --- */
.corridor-section.single-col {
    display: flex;
    justify-content: center;
    padding: 120px 20px;
}

.corridor-inner {
    position: relative;
    max-width: calc(var(--corridor-width) * 1px);
    width: 100%;
    transition: max-width 800ms ease-in-out;
}

/* Ghost Line — faint center divide in single-column mode */
.ghost-line {
    position: absolute;
    top: 0;
    left: 50%;
    width: 1px;
    height: 100%;
    background: var(--hairline-divide);
    opacity: 0.15;
    transform: translateX(-50%);
    pointer-events: none;
}

/* --- Split Column Sections --- */
.corridor-section.split-col {
    width: 100%;
    min-height: 150vh;
    padding: 80px 0;
}

.split-container {
    display: flex;
    width: 100%;
    min-height: 100%;
    position: relative;
}

.split-left,
.split-right {
    flex: 1;
    padding: 60px;
}

.split-left {
    padding-left: 25%;
    padding-right: 8%;
    border-right: 1px solid var(--hairline-divide);
}

.split-right {
    padding-left: 8%;
    padding-right: 25%;
}

/* Split animation initial state */
.split-col .split-left {
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 600ms ease, transform 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.split-col .split-right {
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 600ms ease 200ms, transform 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94) 200ms;
}

.split-col.revealed .split-left {
    opacity: 1;
    transform: translateX(0);
}

.split-col.revealed .split-right {
    opacity: 1;
    transform: translateX(0);
}

/* Hairline divide between split columns opacity transition */
.split-col .split-left {
    border-right-color: rgba(138, 98, 48, 0.15);
    transition: opacity 600ms ease, transform 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94), border-right-color 400ms ease;
}

.split-col.revealed .split-left {
    border-right-color: var(--hairline-divide);
}

/* --- Typography --- */
.dilemma-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(3rem, 7vw, 6rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--halogen-amber);
    line-height: 1.05;
    margin-bottom: 40px;
}

.body-text {
    font-family: 'IBM Plex Serif', serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.75;
    color: var(--institutional-cream);
    margin-bottom: 28px;
    font-feature-settings: "liga" 1, "kern" 1;
    hyphens: manual;
}

.body-text:last-child {
    margin-bottom: 0;
}

.emphasis {
    font-weight: 600;
    color: var(--alert-bone);
}

.section-label {
    display: block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--institutional-sage);
    margin-bottom: 32px;
}

.position-label {
    display: block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--institutional-sage);
    margin-bottom: 24px;
}

.position-label:hover {
    text-decoration: underline;
    text-decoration-color: var(--halogen-amber);
    text-underline-offset: 4px;
    text-decoration-thickness: 1px;
}

/* --- Section Stamp --- */
.section-stamp {
    position: relative;
    width: 100%;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stamp-line {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--corridor-charcoal);
    transform: translateY(-50%);
}

.stamp-square {
    position: relative;
    width: 12px;
    height: 12px;
    background: var(--halogen-amber);
    z-index: 1;
}

/* --- Scroll Reveal --- */
.corridor-section.single-col .corridor-inner {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 500ms ease, transform 500ms ease;
}

.corridor-section.single-col.revealed .corridor-inner {
    opacity: 1;
    transform: translateY(0);
}

/* --- The Void --- */
#the-void {
    min-height: 200vh;
    background: var(--concrete-void);
}

/* --- Responsive: Mobile --- */
@media (max-width: 768px) {
    :root {
        --corridor-width: 92;
    }

    .corridor-inner {
        max-width: calc(var(--corridor-width) * 1vw);
    }

    .corridor-section.single-col {
        padding: 80px 16px;
    }

    .corridor-section.split-col {
        min-height: auto;
        padding: 40px 0;
    }

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

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

    .split-left {
        padding-left: 16px;
        padding-right: 16px;
        border-right: none;
        border-bottom: 1px solid var(--hairline-divide);
    }

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

    .split-col .split-left {
        border-right: none;
        border-bottom-color: rgba(138, 98, 48, 0.15);
        transition: opacity 600ms ease, transform 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94), border-bottom-color 400ms ease;
    }

    .split-col.revealed .split-left {
        border-bottom-color: var(--hairline-divide);
    }

    /* Mobile: progress bar at bottom, horizontal */
    #scroll-progress {
        top: auto;
        bottom: 0;
        left: 0;
        width: 0%;
        height: 2px;
    }

    .dilemma-title {
        font-size: clamp(2rem, 8vw, 3.5rem);
    }
}

/* Desktop-only: corridor-inner uses px-based width */
@media (min-width: 769px) {
    .corridor-inner {
        max-width: calc(var(--corridor-width) * 1px);
    }
}
