/* === judge.bar - Bench to Bar === */
/* Palette: #1c1410 #0e1118 #b8964e #d4a843 #f4ede2 #e8c878 #5c1a1a #8a8279 */

:root {
    --walnut-dark: #1c1410;
    --midnight-ink: #0e1118;
    --brass: #b8964e;
    --burnished-gold: #d4a843;
    --foxed-paper: #f4ede2;
    --lamplight: #e8c878;
    --oxblood: #5c1a1a;
    --smoke: #8a8279;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    background: var(--walnut-dark);
    color: var(--foxed-paper);
    font-family: 'Lora', serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.25rem);
    line-height: 1.65;
    overflow-x: hidden;
}

/* === Leather Texture === */
.leather-texture {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(circle 3px at 15% 25%, #3a2a1e 0%, transparent 100%),
        radial-gradient(circle 4px at 45% 70%, #3a2a1e 0%, transparent 100%),
        radial-gradient(circle 3px at 75% 15%, #3a2a1e 0%, transparent 100%),
        radial-gradient(circle 5px at 85% 55%, #3a2a1e 0%, transparent 100%),
        radial-gradient(circle 3px at 25% 85%, #3a2a1e 0%, transparent 100%),
        radial-gradient(circle 4px at 55% 35%, #3a2a1e 0%, transparent 100%),
        radial-gradient(circle 3px at 95% 90%, #3a2a1e 0%, transparent 100%),
        radial-gradient(circle 4px at 5% 50%, #3a2a1e 0%, transparent 100%),
        repeating-linear-gradient(89deg, transparent, transparent 1px, rgba(42, 30, 20, 0.015) 1px, rgba(42, 30, 20, 0.015) 2px);
    opacity: 0.6;
}

/* === Section Base === */
.section {
    position: relative;
    overflow: hidden;
}

/* === Brass Rule === */
.brass-rule {
    background: var(--brass);
}

.hero-rule {
    width: 0;
    height: 2px;
    position: absolute;
    left: 50%;
    top: 61.8%;
    transform: translateX(-50%);
    z-index: 2;
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-rule.drawn {
    width: 80%;
}

/* === Gavel Ornament === */
.gavel-ornament {
    display: block;
    width: 48px;
    height: 24px;
    margin: 40px auto 0;
    position: relative;
    z-index: 2;
    animation: gavelRest 8s ease-in-out infinite;
}

@keyframes gavelRest {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(-3deg); }
}

/* === Witness Mark === */
.witness-mark {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brass);
    opacity: 0.4;
    margin-top: 24px;
    animation: witnessPulse 3s ease-in-out infinite;
}

@keyframes witnessPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.6; }
}

/* =========================================
   Section 1: The Bench (Hero)
   ========================================= */
.bench-section {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--walnut-dark);
}

.bench-title {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: clamp(80px, 20vw, 200px);
    letter-spacing: 0.08em;
    line-height: 0.95;
    color: var(--foxed-paper);
    position: relative;
    z-index: 2;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 2s cubic-bezier(0.4, 0, 0.2, 1), transform 2s cubic-bezier(0.4, 0, 0.2, 1);
}

.bench-title.visible {
    opacity: 1;
    transform: translateY(0);
}

.bench-subtitle {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: 14px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--smoke);
    margin-top: 24px;
    position: relative;
    z-index: 2;
    min-height: 1.5em;
}

.bench-subtitle .cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: var(--brass);
    vertical-align: text-bottom;
    animation: cursorBlink 0.6s step-end infinite;
}

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

/* =========================================
   Section 2: The Chambers
   ========================================= */
.chambers-section {
    min-height: 100vh;
    background: var(--midnight-ink);
    padding: 120px 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    clip-path: polygon(0 0, 100% 4vw, 100% 100%, 0 100%);
    margin-top: -4vw;
}

.ink-stain {
    position: absolute;
    top: 10%;
    right: 5%;
    width: 400px;
    height: 400px;
    pointer-events: none;
    z-index: 0;
}

.ink-stain-svg {
    width: 100%;
    height: 100%;
    animation: inkRotate 120s linear infinite;
}

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

.chambers-content {
    display: flex;
    gap: 5%;
    max-width: 1100px;
    width: 100%;
    position: relative;
    z-index: 1;
}

.chambers-left {
    flex: 0 0 60%;
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.pull-quote {
    font-family: 'Playfair Display', serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1.5rem, 2.5vw, 2.75rem);
    line-height: 1.35;
    letter-spacing: 0.03em;
    color: var(--foxed-paper);
    border-left: 2px solid var(--brass);
    padding-left: 32px;
}

.chambers-right {
    flex: 0 0 35%;
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.4s, transform 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.4s;
}

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

.body-text {
    font-family: 'Lora', serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
    line-height: 1.65;
    letter-spacing: 0.01em;
    color: var(--foxed-paper);
    margin-bottom: 1.5em;
}

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

/* =========================================
   Section 3: The Docket
   ========================================= */
.docket-section {
    min-height: 120vh;
    background: var(--midnight-ink);
    padding: 100px 40px 120px;
    position: relative;
}

.section-heading {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 3.5rem);
    letter-spacing: 0.03em;
    line-height: 1.15;
    color: var(--foxed-paper);
    text-align: center;
    margin-bottom: 80px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.section-heading.revealed {
    opacity: 1;
    transform: translateY(0);
}

.docket-timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.brass-line {
    position: absolute;
    left: 50%;
    top: 0;
    width: 2px;
    height: 0;
    background: var(--brass);
    transform: translateX(-50%);
    transition: height 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.brass-line.drawn {
    height: 100%;
}

.docket-entry {
    display: flex;
    margin-bottom: 60px;
    position: relative;
}

.entry-left {
    justify-content: flex-end;
    padding-right: calc(50% + 30px);
}

.entry-right {
    justify-content: flex-start;
    padding-left: calc(50% + 30px);
}

.docket-card {
    background: var(--foxed-paper);
    padding: 24px 28px;
    max-width: 320px;
    position: relative;
    box-shadow: inset 2px 0 8px rgba(0, 0, 0, 0.08);
    opacity: 0;
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.entry-left .docket-card {
    transform: translateX(-60px);
}

.entry-right .docket-card {
    transform: translateX(60px);
}

.docket-card.revealed {
    opacity: 1;
    transform: translateX(0);
}

/* Paper fold */
.card-fold {
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-top: 20px solid var(--midnight-ink);
    border-left: 20px solid transparent;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: top right;
    z-index: 1;
}

.docket-card:hover .card-fold {
    transform: scale(1.3);
}

.case-number {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: 14px;
    letter-spacing: 0.06em;
    font-variant-caps: all-small-caps;
    color: var(--smoke);
    display: block;
    margin-bottom: 8px;
}

.case-summary {
    font-family: 'Playfair Display', serif;
    font-weight: 400;
    font-style: italic;
    font-size: 1rem;
    line-height: 1.4;
    color: var(--midnight-ink);
    margin-bottom: 12px;
}

.case-date {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: 13px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--smoke);
}

/* =========================================
   Section 4: The Sidebar
   ========================================= */
.sidebar-section {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
}

.sidebar-left {
    flex: 0 0 45%;
    position: relative;
    overflow: hidden;
}

.bar-interior {
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            0deg,
            #2a1e14 0px,
            #1c1410 2px,
            #3a2a1e 4px,
            #2a1e14 6px
        );
    background-size: 100% 6px;
    transition: background-position 0.1s linear;
}

.amber-light {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.amber-1 {
    width: 200px;
    height: 200px;
    top: 30%;
    left: 30%;
    background: radial-gradient(circle, rgba(232, 200, 120, 0.15) 0%, transparent 70%);
}

.amber-2 {
    width: 150px;
    height: 150px;
    top: 55%;
    left: 60%;
    background: radial-gradient(circle, rgba(232, 200, 120, 0.1) 0%, transparent 70%);
}

.vertical-rule {
    width: 2px;
    flex-shrink: 0;
}

.sidebar-right {
    flex: 1;
    background: #14120e;
    padding: 80px 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.sidebar-right .section-heading {
    text-align: left;
    margin-bottom: 40px;
}

.sidebar-right[data-reveal="blur"] .body-text {
    filter: blur(2px);
    opacity: 0.6;
    transition: filter 1s cubic-bezier(0.4, 0, 0.2, 1), opacity 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-right.revealed .body-text {
    filter: blur(0);
    opacity: 1;
}

.sidebar-right.revealed .section-heading {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================
   Section 5: The Brief
   ========================================= */
.brief-section {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--walnut-dark);
    padding: 100px 40px;
}

.brass-frame {
    position: absolute;
    top: 40px;
    left: 40px;
    right: 40px;
    bottom: 40px;
    pointer-events: none;
    z-index: 1;
}

.brass-frame > div {
    position: absolute;
    background: var(--brass);
}

.frame-top {
    top: 0;
    left: 0;
    height: 2px;
    width: 0;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.frame-right {
    top: 0;
    right: 0;
    width: 2px;
    height: 0;
    transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.4s;
}

.frame-bottom {
    bottom: 0;
    right: 0;
    height: 2px;
    width: 0;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.8s;
}

.frame-left {
    bottom: 0;
    left: 0;
    width: 2px;
    height: 0;
    transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1) 1.2s;
}

.brass-frame.drawn .frame-top { width: 100%; }
.brass-frame.drawn .frame-right { height: 100%; }
.brass-frame.drawn .frame-bottom { width: 100%; }
.brass-frame.drawn .frame-left { height: 100%; }

.brief-content {
    max-width: 640px;
    text-align: center;
    position: relative;
    z-index: 2;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1) 1.6s, transform 0.8s cubic-bezier(0.4, 0, 0.2, 1) 1.6s;
}

.brief-content.visible {
    opacity: 1;
    transform: translateY(0);
}

.brief-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 3.5rem);
    letter-spacing: 0.03em;
    line-height: 1.15;
    color: var(--foxed-paper);
    margin-bottom: 32px;
}

.brief-body {
    font-family: 'Lora', serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
    line-height: 1.65;
    letter-spacing: 0.01em;
    color: var(--foxed-paper);
    margin-bottom: 40px;
}

.docket-ref {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: 12px;
    letter-spacing: 0.06em;
    color: var(--smoke);
    display: inline-block;
}

.docket-ref.blink {
    animation: refBlink 0.3s ease-in-out 2;
}

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

/* =========================================
   Responsive
   ========================================= */
@media (max-width: 768px) {
    .chambers-section {
        padding: 80px 24px;
    }

    .chambers-content {
        flex-direction: column;
        gap: 40px;
    }

    .chambers-left,
    .chambers-right {
        flex: 1;
    }

    .docket-section {
        padding: 80px 20px 100px;
    }

    .entry-left {
        padding-right: 0;
        justify-content: center;
    }

    .entry-right {
        padding-left: 0;
        justify-content: center;
    }

    .brass-line {
        display: none;
    }

    .sidebar-section {
        flex-direction: column;
    }

    .sidebar-left {
        flex: 0 0 40vh;
    }

    .sidebar-right {
        padding: 60px 24px;
    }

    .brass-frame {
        top: 20px;
        left: 20px;
        right: 20px;
        bottom: 20px;
    }

    .brief-section {
        padding: 80px 24px;
    }
}
