/* ==========================================================================
   judge.quest — the architecture of judgment
   Palette: #0a0a0a void black / #161616 charcoal / #f0f0f0 bone white
            #d4d4d4 silver / #707070 graphite / #ffffff verdict white
            #e8553d ember / #4a7c9b steel blue / #2a2a2a ash / #000000
   ========================================================================== */

:root {
    --void: #0a0a0a;
    --charcoal: #161616;
    --ash: #2a2a2a;
    --graphite: #707070;
    --silver: #d4d4d4;
    --bone: #f0f0f0;
    --verdict: #ffffff;
    --ember: #e8553d;
    --steel: #4a7c9b;
    --black: #000000;

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

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

html {
    scroll-behavior: smooth;
}

html, body {
    background: var(--void);
    color: var(--bone);
    min-height: 100%;
    overflow-x: hidden;
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    scroll-snap-type: y proximity;
}

/* ==========================================================================
   Canvas — generative line field
   ========================================================================== */
#line-canvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    background: var(--void);
}

/* ==========================================================================
   Cursor trail host
   ========================================================================== */
.cursor-trail {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 60;
}

.cursor-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--verdict);
    transform: translate(-50%, -50%);
    pointer-events: none;
    filter: blur(0.3px);
    will-change: transform, opacity;
}

/* ==========================================================================
   Progress rail
   ========================================================================== */
.progress-rail {
    position: fixed;
    top: 8vh;
    bottom: 8vh;
    right: 2vw;
    width: 1px;
    z-index: 50;
    pointer-events: none;
}

.progress-track {
    position: absolute;
    inset: 0;
    background: var(--ash);
}

.progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 0%;
    background: var(--steel);
    transition: height 120ms linear;
}

.progress-marker {
    position: absolute;
    left: 50%;
    width: 5px;
    height: 5px;
    background: var(--graphite);
    transform: translate(-50%, -50%) rotate(45deg);
}

/* ==========================================================================
   Layout scaffolding
   ========================================================================== */
main {
    position: relative;
    z-index: 1;
}

.section {
    position: relative;
    width: 100vw;
    min-height: 100vh;
    padding: 8vh 8vw;
    scroll-snap-align: start;
    overflow: hidden;
}

.section-number {
    position: absolute;
    top: 4vh;
    left: 4vw;
    font-family: var(--font-ui);
    font-weight: 500;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--graphite);
    z-index: 4;
}

/* Sharp-angle divider — between sections */
.section::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(
        75deg,
        transparent 0%,
        var(--ash) 20%,
        var(--ash) 80%,
        transparent 100%
    );
    transform: skewY(-15deg);
    transform-origin: left bottom;
    opacity: 0.9;
    pointer-events: none;
}

/* ==========================================================================
   Section 1 — The Threshold
   ========================================================================== */
.threshold {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

.threshold-title {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    letter-spacing: -0.03em;
    color: var(--bone);
    z-index: 3;
    mix-blend-mode: screen;
    text-shadow: 0 0 24px rgba(10, 10, 10, 0.75);
}

.scroll-hint {
    position: absolute;
    bottom: 8vh;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-ui);
    font-weight: 500;
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--graphite);
    animation: pulse 3s ease-in-out infinite;
    z-index: 3;
}

.scroll-hint::after {
    content: "";
    display: block;
    width: 1px;
    height: 24px;
    background: var(--graphite);
    margin: 12px auto 0;
    opacity: 0.7;
}

@keyframes pulse {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

/* ==========================================================================
   Section 2 — The Chamber of Questions
   ========================================================================== */
.chamber {
    display: flex;
    align-items: center;
}

.chamber-inner {
    position: relative;
    left: 20vw;
    max-width: 55vw;
    z-index: 3;
}

.chamber-question {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 1.08;
    letter-spacing: -0.03em;
    color: var(--bone);
    clip-path: inset(0 100% 0 0);
    transition: clip-path 2000ms cubic-bezier(0.16, 1, 0.3, 1);
    text-shadow: 0 0 18px rgba(10, 10, 10, 0.85);
}

.chamber-question em {
    font-style: italic;
    color: var(--verdict);
}

.chamber.is-active .chamber-question {
    clip-path: inset(0 0% 0 0);
}

.chamber-aside {
    margin-top: 2.5rem;
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.25rem);
    line-height: 1.72;
    max-width: 32em;
    color: var(--silver);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 900ms 600ms ease-out, transform 900ms 600ms ease-out;
}

.chamber.is-active .chamber-aside {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   Section 3 — The Evidence Wall
   ========================================================================== */
.evidence {
    min-height: 200vh;
    padding-top: 18vh;
    padding-bottom: 18vh;
    display: flex;
    flex-direction: column;
    gap: 14vh;
}

.panel {
    position: relative;
    background: var(--charcoal);
    border: 1px solid var(--ash);
    padding: 3rem 3rem 3rem 3.25rem;
    max-width: 55vw;
    color: var(--silver);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(0.98rem, 1.15vw, 1.2rem);
    line-height: 1.72;
    z-index: 3;
    opacity: 0;
    transform: translateX(var(--entry-dir)) rotate(var(--panel-angle));
    transition:
        opacity 600ms cubic-bezier(0.16, 1, 0.3, 1),
        transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.55),
        inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.panel::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--verdict) 0%, transparent 100%);
    opacity: 0.25;
}

.panel.is-active {
    opacity: 1;
    transform: translateX(0) rotate(var(--panel-angle));
}

.panel-left {
    margin-left: 10vw;
    align-self: flex-start;
}

.panel-right {
    margin-left: 35vw;
    align-self: flex-start;
}

.panel-label {
    display: inline-block;
    font-family: var(--font-ui);
    font-weight: 500;
    font-size: clamp(0.7rem, 0.85vw, 0.82rem);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--graphite);
    margin-bottom: 1rem;
}

.panel-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.4rem, 2.1vw, 2rem);
    letter-spacing: -0.02em;
    line-height: 1.12;
    color: var(--bone);
    margin-bottom: 1.2rem;
}

.panel p {
    max-width: 38em;
}

/* ==========================================================================
   Section 4 — The Deliberation
   ========================================================================== */
.deliberation {
    display: flex;
    align-items: center;
    justify-content: center;
}

.deliberation-inner {
    max-width: 32em;
    width: 100%;
    margin: 0 auto;
    text-align: left;
    z-index: 3;
    position: relative;
}

.deliberation-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1.1rem, 1.4vw, 1.35rem);
    line-height: 1.85;
    color: var(--silver);
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 1400ms ease-out, transform 1400ms ease-out;
}

.deliberation.is-active .deliberation-text {
    opacity: 1;
    transform: translateY(0);
}

.deliberation-text::first-letter {
    font-family: var(--font-display);
    font-weight: 700;
    font-style: italic;
    color: var(--bone);
    float: left;
    font-size: 3.6em;
    line-height: 0.9;
    padding: 0.15em 0.18em 0 0;
}

/* ==========================================================================
   Section 5 — The Verdict
   ========================================================================== */
.verdict {
    background: var(--black);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.verdict::after {
    display: none;
}

.flare-wrap {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200vw;
    height: 40px;
    pointer-events: none;
    z-index: 2;
}

.flare {
    position: absolute;
    left: 0;
    width: 200vw;
    transform-origin: center;
    will-change: height, opacity;
}

.flare-white {
    top: 50%;
    transform: translateY(-50%);
    height: 3px;
    background: radial-gradient(
        ellipse at center,
        rgba(255, 255, 255, 0.85) 0%,
        rgba(255, 255, 255, 0.35) 18%,
        rgba(255, 255, 255, 0.08) 40%,
        transparent 65%
    );
    opacity: 0.6;
    transition: height 800ms cubic-bezier(0.16, 1, 0.3, 1),
                opacity 800ms cubic-bezier(0.16, 1, 0.3, 1);
}

.flare-warm {
    top: calc(50% + 5px);
    transform: translateY(-50%);
    height: 2px;
    background: radial-gradient(
        ellipse at center,
        rgba(232, 85, 61, 0.32) 0%,
        rgba(232, 85, 61, 0.08) 30%,
        transparent 55%
    );
    opacity: 0.5;
    transition: height 800ms cubic-bezier(0.16, 1, 0.3, 1),
                opacity 800ms cubic-bezier(0.16, 1, 0.3, 1);
}

.verdict.is-active .flare-white {
    height: 18px;
    opacity: 1;
}

.verdict.is-active .flare-warm {
    height: 8px;
    opacity: 1;
}

.verdict-text {
    position: relative;
    z-index: 3;
    font-family: var(--font-display);
    font-weight: 700;
    font-style: italic;
    font-size: clamp(1.5rem, 3.5vw, 3rem);
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--verdict);
    text-align: center;
    max-width: 18em;
    padding: 0 4vw;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 1400ms 300ms ease-out, transform 1400ms 300ms ease-out;
}

.verdict.is-active .verdict-text {
    opacity: 1;
    transform: translateY(0);
}

.verdict-sign {
    position: absolute;
    bottom: 6vh;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-ui);
    font-weight: 500;
    font-size: 0.7rem;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--graphite);
    z-index: 3;
    opacity: 0;
    transition: opacity 1400ms 900ms ease-out;
}

.verdict.is-active .verdict-sign {
    opacity: 1;
}

/* ==========================================================================
   Responsive — preserve the architecture at smaller sizes
   ========================================================================== */
@media (max-width: 820px) {
    .section {
        padding: 10vh 6vw;
    }

    .chamber-inner {
        left: 0;
        max-width: 100%;
    }

    .panel-left,
    .panel-right {
        margin-left: 0;
        max-width: 90vw;
    }

    .progress-rail {
        right: 1.2vw;
    }
}
