/* =============================================
   judge.quest — Dark-Academia Judicial Theater
   ============================================= */

:root {
    --judicial-black: #0B0A0F;
    --chamber-aubergine: #12101A;
    --burgundy-shadow: #3A0E1A;
    --seal-crimson: #6B1A2A;
    --tarnished-gold: #8B6914;
    --verdict-gold: #C4A44A;
    --parchment-cream: #D4C8B0;
    --dusty-violet: #6B6578;
    --parchment-dark: #1A1520;
    --vignette-core: #1A0E12;
    --oxblood-dark: #4A0E1A;
    --seal-mid: #8B2A3A;
    --handle-brown: #6B5010;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--judicial-black);
    color: var(--parchment-cream);
    font-family: 'Crimson Pro', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.2rem);
    line-height: 1.75;
    overflow-x: hidden;
}

.section {
    position: relative;
    width: 100%;
}

.section-spacer {
    height: 2vh;
    background: var(--judicial-black);
}

/* ---- Gold horizontal rule ---- */
.gold-rule {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--tarnished-gold) 15%, var(--verdict-gold) 50%, var(--tarnished-gold) 85%, transparent 100%);
    width: 0%;
    transition: width 0.6s ease-out;
    margin: 0 auto;
}

.gold-rule.visible {
    width: 100%;
}

/* ---- Grain overlay ---- */
.grain-overlay {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(135deg, var(--parchment-dark) 0px, var(--parchment-dark) 1px, transparent 1px, transparent 4px);
    opacity: 0.15;
    pointer-events: none;
    will-change: transform;
}

/* =============================================
   1. THE TRIBUNAL ENTRANCE
   ============================================= */
#tribunal {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--judicial-black);
    position: relative;
}

.tribunal-content {
    text-align: center;
    position: relative;
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: clamp(12rem, 18vw, 22rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1;
    color: var(--parchment-cream);
    margin-bottom: 30px;
}

.marble-text {
    background:
        radial-gradient(ellipse at 30% 40%, #D4C8B0 0%, #8B8070 30%, transparent 70%),
        radial-gradient(ellipse at 70% 60%, #A09585 0%, transparent 60%),
        repeating-conic-gradient(rgba(180,170,155,0.08) 0deg, transparent 0.5deg, transparent 1deg);
    background-color: #B0A690;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-rule {
    max-width: 300px;
    animation: ruleGlow 4s ease-in-out infinite;
}

@keyframes ruleGlow {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.7; }
}

.scroll-chevron {
    position: absolute;
    bottom: -40vh;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    animation: chevronBounce 2s ease-in-out infinite;
}

.chevron-line {
    display: block;
    width: 20px;
    height: 20px;
    border-right: 2px solid var(--tarnished-gold);
    border-bottom: 2px solid var(--tarnished-gold);
    transform: rotate(45deg);
    margin-top: -10px;
}

@keyframes chevronBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(12px); }
}

/* =============================================
   2. THE GALLERY OF PRECEDENTS
   ============================================= */
.gallery-section {
    position: relative;
}

.vertical-spine {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--tarnished-gold);
    opacity: 0.3;
    transform: translateX(-50%);
}

.gallery-panel {
    min-height: 30vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    background: var(--judicial-black);
    position: relative;
}

.gallery-panel.alt {
    background: var(--chamber-aubergine);
}

.gallery-panel blockquote {
    max-width: 55ch;
    text-align: center;
    transform: scale(0.92);
    opacity: 0.2;
    transition: transform 0.8s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.gallery-panel.in-view blockquote {
    transform: scale(1);
    opacity: 1;
}

.quote-text {
    font-family: 'Crimson Pro', serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    letter-spacing: 0.02em;
    line-height: 1.6;
    color: var(--parchment-cream);
    margin-bottom: 20px;
}

.gallery-panel cite {
    font-family: 'Cormorant SC', serif;
    font-weight: 500;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--tarnished-gold);
    display: block;
    font-style: normal;
}

/* =============================================
   3. THE DELIBERATION CHAMBER
   ============================================= */
#deliberation {
    min-height: 150vh;
    background: var(--judicial-black);
}

.deliberation-layout {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.scales-column {
    width: 38.2%;
    background: var(--burgundy-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.scales-svg {
    width: 60vmin;
    max-width: 100%;
    height: auto;
}

.scale-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 3s ease-in-out, fill-opacity 1s ease 3s;
    fill: var(--verdict-gold);
    fill-opacity: 0;
}

.scales-column.in-view .scale-path {
    stroke-dashoffset: 0;
    fill-opacity: 0.08;
}

.content-column {
    width: 61.8%;
    padding: 100px 60px;
}

.delib-block {
    margin-bottom: 80px;
    transform: translateX(60px);
    opacity: 0;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.delib-block.in-view {
    transform: translateX(0);
    opacity: 1;
}

.delib-block:nth-child(2) {
    transition-delay: 400ms;
}

.delib-block:nth-child(3) {
    transition-delay: 800ms;
}

.delib-block h2 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(2.4rem, 5vw, 4rem);
    letter-spacing: 0.06em;
    color: var(--verdict-gold);
    text-transform: uppercase;
    margin-bottom: 16px;
}

.delib-rule {
    max-width: 200px;
    margin: 0 0 24px 0;
}

.delib-block p {
    max-width: 55ch;
    color: var(--parchment-cream);
    font-size: clamp(1rem, 1.2vw, 1.2rem);
    line-height: 1.75;
}

/* =============================================
   4. THE VERDICT HALL
   ============================================= */
#verdict {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, var(--vignette-core) 0%, var(--judicial-black) 70%);
}

.verdict-content {
    text-align: center;
}

.gavel-assembly {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto 30px;
    transform: rotate(-18deg);
    transform-origin: 50% 100%;
    transition: transform 0.15s ease-out;
}

.gavel-assembly.struck {
    animation: gavelStrike 0.3s ease-out forwards;
}

@keyframes gavelStrike {
    0% { transform: rotate(-18deg); }
    70% { transform: rotate(2deg); }
    100% { transform: rotate(0deg); }
}

.gavel-head {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 40px;
    border-radius: 4px;
    background: linear-gradient(180deg, var(--verdict-gold), var(--tarnished-gold));
}

.gavel-junction {
    position: absolute;
    top: 34px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--verdict-gold);
}

.gavel-handle {
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 80px;
    background: var(--handle-brown);
    border-radius: 2px;
}

.strike-line {
    width: 0;
    height: 2px;
    background: var(--verdict-gold);
    margin: 20px auto;
    transition: width 0.3s ease-out;
}

.strike-line.active {
    width: 200px;
}

.verdict-word {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 3.5rem);
    letter-spacing: 0.5em;
    color: var(--verdict-gold);
    opacity: 0;
    transition: opacity 1s ease;
    transition-delay: 1.5s;
    text-transform: uppercase;
}

.verdict-word.visible {
    opacity: 1;
}

/* =============================================
   5. THE SEALED ARCHIVE
   ============================================= */
#archive {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--judicial-black);
}

.archive-content {
    text-align: center;
    max-width: 580px;
    padding: 80px 20px;
}

.wax-seal {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, var(--seal-mid), var(--seal-crimson) 60%, var(--oxblood-dark));
    border: 1px solid var(--seal-mid);
    box-shadow: 0 4px 20px rgba(107,26,42,0.5), inset 0 -2px 6px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 60px;
    transition: transform 0.12s ease-out;
    cursor: default;
}

.seal-text {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: 28px;
    color: var(--verdict-gold);
}

.colophon {
    margin-top: 40px;
}

.colophon p {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    color: var(--dusty-violet);
    letter-spacing: 0.08em;
    line-height: 2.2;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .deliberation-layout {
        flex-direction: column;
    }

    .scales-column {
        width: 100%;
        position: relative;
        height: auto;
        min-height: 50vh;
    }

    .content-column {
        width: 100%;
        padding: 60px 30px;
    }

    .hero-title {
        font-size: clamp(5rem, 15vw, 12rem);
    }
}

/* ---- Mobile seal rotation ---- */
@media (pointer: coarse) {
    .wax-seal {
        animation: sealRotate 30s linear infinite;
    }

    @keyframes sealRotate {
        from { transform: rotate(0deg); }
        to { transform: rotate(360deg); }
    }
}
