/* ========================================================
   judge.quest — Brutalist Adjudication
   ======================================================== */

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

html {
    scroll-behavior: auto; /* Brutalist: no smooth scroll */
    overflow-x: hidden;
}

body {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    color: #3B3B3B;
    background: #0A0A0A;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- Concrete Noise Texture Overlay --- */
#concrete-texture {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1;
    opacity: 0.06;
}

#concrete-texture::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='400' height='400' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

/* --- Docket Sidebar --- */
#docket-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 48px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 32px;
    z-index: 100;
    background: transparent;
}

.docket-number {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    color: #7A7A7A;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    cursor: default;
    transition: color 0.3s ease;
    user-select: none;
}

.docket-number.active {
    color: #C8102E;
}

/* --- Gavel Stroke --- */
#gavel-stroke {
    position: fixed;
    top: 50%;
    right: 0;
    width: 60vw;
    height: 2px;
    background: #C8102E;
    z-index: 90;
    transform: translateX(100vw);
    pointer-events: none;
    opacity: 0;
}

#gavel-stroke.strike {
    animation: gavelStrike 900ms ease-out forwards;
}

@keyframes gavelStrike {
    0% {
        opacity: 1;
        transform: translateX(100vw);
    }
    44% {
        opacity: 1;
        transform: translateX(40vw);
    }
    66% {
        opacity: 1;
        transform: translateX(40vw);
    }
    100% {
        opacity: 0;
        transform: translateX(100vw);
    }
}

/* --- Chambers (General) --- */
.chamber {
    position: relative;
    width: 100vw;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 2;
}

.chamber-dark {
    background-color: #0A0A0A;
    color: #F5F0E8;
}

.chamber-light {
    background-color: #F5F0E8;
    color: #3B3B3B;
}

/* --- Chamber Dividers --- */
.chamber-divider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0;
    border-top: 4px solid #C8102E;
    z-index: 5;
}

.chamber-divider-dark {
    border-top-color: #C8102E;
}

/* --- Chamber Content --- */
.chamber-content {
    position: relative;
    z-index: 3;
    padding: 48px 48px 48px 72px; /* Left pad for docket sidebar */
    width: 100%;
    max-width: 1440px;
}

/* 12-col grid: content-right = columns 7-12 */
.content-right {
    margin-left: 50%;
    width: 50%;
    padding-right: 48px;
}

/* 12-col grid: content-left = columns 1-6 */
.content-left {
    margin-right: 50%;
    width: 50%;
    padding-left: 72px;
}

/* Center layout */
.chamber-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-left: 48px;
    padding-right: 48px;
}

/* --- Scale SVG Watermarks --- */
.scale-watermark {
    position: absolute;
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.scale-watermark.visible {
    opacity: 1;
}

.scale-watermark svg {
    width: 100%;
    height: 100%;
}

.scale-100vw {
    width: 100vw;
    height: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.03;
}

.scale-100vw.visible {
    opacity: 0.03;
}

.scale-60vw {
    width: 60vw;
    height: auto;
    top: 50%;
    left: -10vw;
    transform: translateY(-50%);
}

.scale-60vw.visible {
    opacity: 0.04;
}

.scale-left-bleed {
    left: -15vw;
}

.scale-30vw {
    width: 30vw;
    height: auto;
    top: 15%;
    left: 50%;
    transform: translateX(-50%);
}

.scale-30vw.visible {
    opacity: 0.05;
}

.scale-10vw {
    width: 10vw;
    height: auto;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
}

.scale-10vw.visible {
    opacity: 0.06;
}

/* --- CHAMBER I: The Indictment --- */
#chamber-1 {
    display: flex;
    align-items: center;
    justify-content: center;
}

#title-judge {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: clamp(4rem, 10vw, 8rem);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #F5F0E8;
    line-height: 1.05;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s cubic-bezier(0.25, 0.1, 0.25, 1),
                transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
}

#title-judge.revealed {
    opacity: 1;
    transform: translateY(0);
}

#title-quest {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 300;
    font-size: clamp(2rem, 5vw, 4rem);
    color: #F5F0E8;
    letter-spacing: 0.06em;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s cubic-bezier(0.25, 0.1, 0.25, 1) 0.6s,
                transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1) 0.6s;
}

#title-quest.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* --- CHAMBER II: The Evidence --- */
.exhibit-card {
    background: #F5F0E8;
    border: 1px solid #D4C5A9;
    box-shadow: inset 0 0 0 4px #E8E0D0;
    padding: 32px 28px 28px;
    position: relative;
    aspect-ratio: 3 / 4;
    max-height: 260px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s cubic-bezier(0.25, 0.1, 0.25, 1),
                transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.exhibit-card + .exhibit-card {
    margin-top: 24px;
}

.exhibit-card.revealed {
    opacity: 1;
    transform: translateY(0);
}

.exhibit-label {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    color: #7A7A7A;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.exhibit-text {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    color: #3B3B3B;
    letter-spacing: 0.01em;
    line-height: 1.65;
}

/* --- FRACTURE Sections --- */
.fracture {
    position: relative;
    width: 100vw;
    height: 50vh;
    background-color: #1A1A1A;
    overflow: hidden;
    z-index: 2;
}

.fracture-word {
    position: absolute;
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: clamp(6rem, 15vw, 12rem);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    line-height: 1;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.fracture-word.revealed {
    opacity: 1;
}

.fracture-objection {
    color: #C8102E;
    opacity: 0;
    top: 40%;
    left: 30%;
    transform: rotate(-2deg);
}

.fracture-objection.revealed {
    opacity: 0.4;
}

.fracture-sustained {
    color: #D4C5A9;
    opacity: 0;
    top: 35%;
    left: 55%;
    transform: rotate(1.5deg);
}

.fracture-sustained.revealed {
    opacity: 0.5;
}

/* --- CHAMBER III: The Testimony --- */
#chamber-3 {
    align-items: stretch;
}

#chamber-3 .chamber-content {
    display: flex;
    align-items: center;
}

.testimony-block {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s cubic-bezier(0.25, 0.1, 0.25, 1),
                transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.testimony-block.revealed {
    opacity: 1;
    transform: translateY(0);
}

.testimony-text {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: 1.1rem;
    line-height: 1.5;
    color: #F5F0E8;
    letter-spacing: 0.01em;
}

.testimony-annotations {
    position: absolute;
    right: 48px;
    top: 50%;
    transform: translateY(-50%);
    width: calc(25% - 48px);
    display: flex;
    flex-direction: column;
    gap: 40px;
    z-index: 4;
}

.annotation {
    font-family: 'Libre Baskerville', serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1.2rem, 2vw, 2rem);
    color: #7A7A7A;
    line-height: 1.4;
    border: none;
    padding: 0;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s cubic-bezier(0.25, 0.1, 0.25, 1),
                transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.annotation.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* --- CHAMBER IV: The Deliberation --- */
.fingerprint-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 48px;
}

.fingerprint {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 1px solid #D4C5A9;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.fingerprint.revealed {
    opacity: 1;
    transform: scale(1);
}

/* CSS-generated fingerprint patterns using repeating-conic-gradient */
.fingerprint::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
}

.fingerprint[data-juror="1"]::before {
    background: repeating-conic-gradient(from 0deg, transparent 0deg, transparent 8deg, #D4C5A9 8deg, #D4C5A9 10deg);
    transform: translate(-48%, -52%);
}
.fingerprint[data-juror="2"]::before {
    background: repeating-conic-gradient(from 15deg, transparent 0deg, transparent 6deg, #D4C5A9 6deg, #D4C5A9 8deg);
    transform: translate(-52%, -48%);
}
.fingerprint[data-juror="3"]::before {
    background: repeating-conic-gradient(from 30deg, transparent 0deg, transparent 10deg, #D4C5A9 10deg, #D4C5A9 12deg);
    transform: translate(-50%, -54%);
}
.fingerprint[data-juror="4"]::before {
    background: repeating-conic-gradient(from 45deg, transparent 0deg, transparent 7deg, #D4C5A9 7deg, #D4C5A9 9deg);
    transform: translate(-46%, -50%);
}
.fingerprint[data-juror="5"]::before {
    background: repeating-conic-gradient(from 60deg, transparent 0deg, transparent 9deg, #D4C5A9 9deg, #D4C5A9 11deg);
    transform: translate(-54%, -48%);
}
.fingerprint[data-juror="6"]::before {
    background: repeating-conic-gradient(from 75deg, transparent 0deg, transparent 5deg, #D4C5A9 5deg, #D4C5A9 7deg);
    transform: translate(-48%, -46%);
}
.fingerprint[data-juror="7"]::before {
    background: repeating-conic-gradient(from 90deg, transparent 0deg, transparent 11deg, #D4C5A9 11deg, #D4C5A9 13deg);
    transform: translate(-52%, -54%);
}
.fingerprint[data-juror="8"]::before {
    background: repeating-conic-gradient(from 105deg, transparent 0deg, transparent 8deg, #3B3B3B 8deg, #3B3B3B 10deg);
    transform: translate(-50%, -48%);
}
.fingerprint[data-juror="9"]::before {
    background: repeating-conic-gradient(from 120deg, transparent 0deg, transparent 6deg, #D4C5A9 6deg, #D4C5A9 8deg);
    transform: translate(-46%, -52%);
}
.fingerprint[data-juror="10"]::before {
    background: repeating-conic-gradient(from 135deg, transparent 0deg, transparent 10deg, #3B3B3B 10deg, #3B3B3B 12deg);
    transform: translate(-54%, -50%);
}
.fingerprint[data-juror="11"]::before {
    background: repeating-conic-gradient(from 150deg, transparent 0deg, transparent 7deg, #D4C5A9 7deg, #D4C5A9 9deg);
    transform: translate(-48%, -54%);
}
.fingerprint[data-juror="12"]::before {
    background: repeating-conic-gradient(from 165deg, transparent 0deg, transparent 9deg, #3B3B3B 9deg, #3B3B3B 11deg);
    transform: translate(-52%, -46%);
}

/* Additional concentric circles for fingerprint effect */
.fingerprint::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60%;
    height: 60%;
    border-radius: 50%;
    border: 1px solid #D4C5A9;
    transform: translate(-50%, -50%);
    box-shadow:
        0 0 0 4px transparent,
        0 0 0 6px #D4C5A9,
        0 0 0 10px transparent,
        0 0 0 12px #D4C5A9,
        0 0 0 16px transparent,
        0 0 0 18px #D4C5A9;
    opacity: 0.4;
}

.jury-statement {
    font-family: 'DM Mono', monospace;
    font-size: 13px;
    color: #3B3B3B;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0;
    transition: opacity 0.6s ease 1.8s;
}

.jury-statement.revealed {
    opacity: 1;
}

/* --- CHAMBER V: The Verdict --- */
#verdict-text {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 6rem);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    line-height: 1.05;
    color: #C8102E;
    min-height: 1.2em;
}

.verdict-rule {
    width: 0%;
    height: 2px;
    background: #D4C5A9;
    margin: 32px auto;
    transition: width 0.8s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.verdict-rule.expanded {
    width: 80%;
}

.verdict-date {
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    color: #7A7A7A;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.verdict-date.revealed {
    opacity: 1;
}

/* --- Typography (Global) --- */
h1, h2 {
    font-family: 'Libre Baskerville', serif;
    color: #0A0A0A;
    letter-spacing: 0.06em;
    line-height: 1.05;
}

h1 {
    font-size: clamp(3rem, 7vw, 6rem);
    text-transform: uppercase;
    font-weight: 700;
}

h2 {
    font-size: clamp(1.8rem, 3.5vw, 3rem);
    font-weight: 700;
}

.chamber-dark h1,
.chamber-dark h2 {
    color: #F5F0E8;
}

/* --- Slide Reveal Animation Base --- */
.slide-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s cubic-bezier(0.25, 0.1, 0.25, 1),
                transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.slide-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* --- Responsive Adjustments --- */
@media (max-width: 900px) {
    .content-right {
        margin-left: 72px;
        width: calc(100% - 120px);
        padding-right: 24px;
    }

    .content-left {
        margin-right: 0;
        width: calc(100% - 120px);
        padding-left: 72px;
    }

    .testimony-annotations {
        position: relative;
        right: auto;
        top: auto;
        transform: none;
        width: calc(100% - 120px);
        margin-left: 72px;
        padding: 32px 24px 48px;
    }

    #chamber-3 {
        flex-direction: column;
    }

    .fracture-word {
        font-size: clamp(3rem, 12vw, 8rem);
    }

    .fingerprint {
        width: 56px;
        height: 56px;
    }

    .fingerprint-grid {
        gap: 16px;
    }

    .scale-60vw {
        width: 80vw;
        left: -20vw;
    }
}

@media (max-width: 600px) {
    #docket-sidebar {
        width: 36px;
    }

    .chamber-content {
        padding: 32px 24px 32px 48px;
    }

    .content-right {
        margin-left: 48px;
        width: calc(100% - 72px);
        padding-right: 16px;
    }

    .content-left {
        margin-right: 0;
        width: calc(100% - 72px);
        padding-left: 48px;
    }

    .exhibit-card {
        max-height: none;
        aspect-ratio: auto;
    }

    .testimony-annotations {
        margin-left: 48px;
        width: calc(100% - 72px);
    }

    .fingerprint {
        width: 48px;
        height: 48px;
    }

    .fingerprint-grid {
        gap: 12px;
    }
}
