/* courthouse.stream - Civic Architecture meets Live Broadcast */

/* === CSS Custom Properties === */
:root {
    --limestone: #e8e2d6;
    --walnut-chamber: #2a2520;
    --brief-ink: #3d3730;
    --clerks-note: #6b6156;
    --gallery-brass: #b09060;
    --terrazzo-chip: #8b7d6b;
    --session-active: #c0392b;
    --recess-gray: #95a5a6;
    --transcript-glow: #f5e6c8;
    --pediment-shadow: #1a1714;
    --pale-rose: #c4a0a0;
    --brass-highlight: #c4a46a;
    --brass-dark: #9c7e56;
    --column-light: #d4cfc4;
    --column-dark: #c8c1b3;
    --scroll-y: 0;
}

/* === @property for timecode animation === */
@property --seconds {
    syntax: '<integer>';
    initial-value: 0;
    inherits: false;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--limestone);
    color: var(--brief-ink);
    font-family: 'Literata', Georgia, serif;
    font-size: 17px;
    line-height: 1.85;
    overflow-x: hidden;
}

/* === FACADE SECTION (The Approach) === */
.facade-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 30% 40%, #ede7db 0%, #e8e2d6 100%);
    position: relative;
    padding: 40px 20px;
}

.facade-structure {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.pediment {
    width: 440px;
    height: 100px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    animation: pedimentSlide 1.2s ease-out 0.3s both;
}

.pediment-face {
    width: 440px;
    height: 100px;
    background: linear-gradient(to bottom, var(--column-dark), var(--column-light));
    clip-path: polygon(0 100%, 50% 0, 100% 100%);
}

.facade-inscription {
    font-family: 'Libre Caslon Display', 'Georgia', serif;
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--brief-ink);
    margin: 20px 0;
    opacity: 0;
    animation: fadeIn 1s ease-out 1.5s forwards;
}

.columns-row {
    display: flex;
    gap: 40px;
    justify-content: center;
}

.column.fluted {
    width: 60px;
    height: 400px;
    background: repeating-linear-gradient(to right, #d4cfc4 0px, #c8c1b3 2px, #d4cfc4 4px);
    border-radius: 4px 4px 0 0;
    transform: translateY(100%);
    animation: columnRise 1.2s ease-out calc(var(--col-index) * 0.15s) forwards;
}

.facade-base {
    width: 500px;
    height: 24px;
    background: var(--column-dark);
    border-radius: 0 0 2px 2px;
}

.facade-shadow {
    width: 500px;
    height: 120px;
    background: linear-gradient(to bottom, rgba(26,23,20,0.3), transparent);
    margin-top: -2px;
}

.session-line {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 14px;
    color: var(--clerks-note);
    margin-top: 40px;
    display: flex;
    align-items: center;
}

.typed-text {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid var(--brief-ink);
    width: 0;
    animation: typing 2.5s steps(30, end) 3s forwards, blinkCaret 0.75s step-end infinite 3s;
}

.cursor {
    display: none;
}

/* === GALLERY RAIL === */
.gallery-rail {
    position: relative;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    margin: 0;
    padding: 0 20px;
}

.rail-bar {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(to bottom, #c4a46a, #b09060, #9c7e56);
    transform: translateY(-50%);
    box-shadow: 0 -1px 0 rgba(255,255,255,0.3);
}

.rivets {
    display: flex;
    justify-content: space-around;
    width: 100%;
    max-width: 960px;
    position: relative;
    z-index: 2;
}

.rivet {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #d4c088, #b09060 50%, #8b7d6b 100%);
    cursor: pointer;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.rivet:hover {
    transform: scale(1.4);
}

/* === TRIBUNAL SPLIT LAYOUT === */
.tribunal-layout {
    display: flex;
    position: relative;
    min-height: 100vh;
}

.courtroom-floor {
    width: 58%;
    padding: 60px 60px 60px 84px;
    position: relative;
    background: var(--limestone);
}

.broadcast-booth {
    width: 42%;
    background: var(--walnut-chamber);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    border-left: 2px solid var(--terrazzo-chip);
    box-shadow: inset 2px 0 8px rgba(0,0,0,0.2);
    padding: 30px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* === STENOGRAPH RIBBON === */
.stenograph-ribbon {
    position: absolute;
    left: 0;
    top: 0;
    width: 24px;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.stenograph-ribbon::before {
    content: "⁂ ⸗ ⁕ ⁘ ⸘ ⁖ ⁂ ⸗ ⁕ ⁘ ⸘ ⁖ ⁂ ⸗ ⁕ ⁘ ⸘ ⁖ ⁂ ⸗ ⁕ ⁘ ⸘ ⁖ ⁂ ⸗ ⁕ ⁘ ⸘ ⁖ ⁂ ⸗ ⁕ ⁘ ⸘ ⁖ ⁂ ⸗ ⁕ ⁘ ⸘ ⁖ ⁂ ⸗ ⁕ ⁘ ⸘ ⁖ ⁂ ⸗ ⁕ ⁘ ⸘ ⁖ ⁂ ⸗ ⁕ ⁘ ⸘ ⁖ ⁂ ⸗ ⁕ ⁘ ⸘ ⁖ ⁂ ⸗ ⁕ ⁘ ⸘ ⁖ ⁂ ⸗ ⁕ ⁘ ⸘ ⁖ ⁂ ⸗ ⁕ ⁘ ⸘ ⁖ ⁂ ⸗ ⁕ ⁘ ⸘ ⁖ ⁂ ⸗ ⁕ ⁘ ⸘ ⁖ ⁂ ⸗ ⁕ ⁘ ⸘ ⁖ ⁂ ⸗ ⁕ ⁘ ⸘ ⁖ ⁂ ⸗ ⁕ ⁘ ⸘ ⁖ ⁂ ⸗ ⁕ ⁘ ⸘ ⁖";
    display: block;
    width: 24px;
    font-size: 6px;
    line-height: 1.2;
    color: var(--column-dark);
    word-break: break-all;
    transform: translateY(calc(var(--scroll-y) * -0.3px));
    will-change: transform;
}

/* === PROCEEDINGS / SECTIONS === */
.proceeding {
    padding: 60px 0;
    position: relative;
}

.case-heading {
    font-family: 'Libre Caslon Display', 'Georgia', serif;
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 400;
    font-variant: small-caps;
    letter-spacing: 0.05em;
    color: var(--brief-ink);
    margin-bottom: 30px;
}

.proceeding p {
    margin-bottom: 24px;
    text-indent: 2em;
}

.cited-precedent {
    margin: 30px 0 30px 40px;
    padding: 20px 24px;
    border-left: 3px solid var(--gallery-brass);
    font-style: italic;
    font-weight: 300;
    color: var(--clerks-note);
}

/* === COFFERED CEILING BACKGROUND === */
.coffered-bg {
    position: relative;
}

.coffered-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 79px, rgba(0,0,0,0.04) 79px, rgba(0,0,0,0.04) 80px),
        repeating-linear-gradient(90deg, transparent, transparent 79px, rgba(0,0,0,0.04) 79px, rgba(0,0,0,0.04) 80px);
    background-size: 80px 80px;
    opacity: 0.06;
    pointer-events: none;
    z-index: 0;
}

.coffered-bg > * {
    position: relative;
    z-index: 1;
}

/* === TERRAZZO DIVIDERS === */
.terrazzo-divider {
    height: 12px;
    background-color: #d4cfc4;
    background-image:
        radial-gradient(circle 4px at 12% 50%, var(--gallery-brass) 100%, transparent 100%),
        radial-gradient(circle 3px at 28% 30%, var(--terrazzo-chip) 100%, transparent 100%),
        radial-gradient(circle 5px at 45% 60%, var(--recess-gray) 100%, transparent 100%),
        radial-gradient(circle 3px at 58% 40%, var(--pale-rose) 100%, transparent 100%),
        radial-gradient(circle 4px at 72% 55%, var(--gallery-brass) 100%, transparent 100%),
        radial-gradient(circle 3px at 85% 35%, var(--terrazzo-chip) 100%, transparent 100%),
        radial-gradient(circle 5px at 5% 70%, var(--recess-gray) 100%, transparent 100%),
        radial-gradient(circle 3px at 35% 80%, var(--pale-rose) 100%, transparent 100%),
        radial-gradient(circle 4px at 62% 20%, var(--gallery-brass) 100%, transparent 100%),
        radial-gradient(circle 3px at 92% 65%, var(--terrazzo-chip) 100%, transparent 100%);
    margin: 0;
}

/* === GAVEL MARKER === */
.gavel-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
}

.gavel-icon {
    transform-origin: top center;
    transition: transform 0.2s ease-in-out;
}

.gavel-icon.strike {
    animation: gavelStrike 0.4s ease-in-out;
}

.gavel-rule {
    width: 100%;
    height: 1px;
    background: var(--gallery-brass);
    margin-top: 12px;
}

/* === RECESS SECTION === */
.recess-section {
    min-height: 40vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--limestone);
}

.recess-text {
    font-family: 'Libre Caslon Display', 'Georgia', serif;
    font-style: italic;
    font-size: 28px;
    color: var(--clerks-note);
    text-indent: 0 !important;
}

/* === ADJOURNMENT SIGNOFF === */
.adjournment-signoff {
    text-align: center;
    margin-top: 60px;
    padding: 40px 0;
}

.brass-rule-top,
.brass-rule-bottom {
    height: 2px;
    background: linear-gradient(to right, transparent, var(--gallery-brass), transparent);
    margin: 0 auto;
    max-width: 300px;
}

.signoff-text {
    font-family: 'Literata', Georgia, serif;
    font-style: italic;
    font-size: 20px;
    color: var(--clerks-note);
    margin: 20px 0;
    text-indent: 0 !important;
}

/* === BROADCAST BOOTH === */
.booth-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(139,125,107,0.3);
}

.booth-label {
    font-family: 'Commissioner', sans-serif;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--terrazzo-chip);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 10px;
    background: var(--session-active);
    animation: pulseAttention 2s ease-in-out infinite;
}

.status-badge.recess {
    background: var(--recess-gray);
    animation: none;
}

.status-badge.adjourned {
    background: var(--recess-gray);
    animation: none;
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: white;
}

.badge-text {
    font-family: 'Commissioner', sans-serif;
    font-size: 9px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: white;
}

/* === TIMECODE === */
.timecode-display {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--transcript-glow);
    text-align: center;
    padding: 16px 0;
    background: rgba(0,0,0,0.2);
    border-radius: 6px;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.3);
}

.tc-sep {
    animation: blinkColon 1s step-end infinite;
}

/* === BOOTH PANELS === */
.booth-panel {
    background: rgba(0,0,0,0.15);
    border-radius: 6px;
    padding: 16px;
    box-shadow: inset 0 1px 4px rgba(0,0,0,0.25);
}

.panel-label {
    font-family: 'Commissioner', sans-serif;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--terrazzo-chip);
    margin-bottom: 10px;
}

.transcript-feed {
    max-height: 180px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--terrazzo-chip) transparent;
}

.transcript-line {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    font-weight: 400;
    color: #c8b898;
    line-height: 1.6;
    padding: 2px 0;
    border-bottom: 1px solid rgba(139,125,107,0.1);
}

/* === TOGGLE SWITCHES === */
.booth-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.control-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.control-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    color: #c8b898;
}

.toggle-switch {
    width: 44px;
    height: 24px;
    border-radius: 12px;
    background: rgba(0,0,0,0.3);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.4), 0 1px 0 rgba(255,255,255,0.05);
    position: relative;
    cursor: pointer;
    transition: background 0.3s ease;
}

.toggle-switch.active {
    background: rgba(176,144,96,0.4);
}

.toggle-knob {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 40%, #d4cfc4, #b09060);
    position: absolute;
    top: 2px;
    left: 2px;
    transition: left 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.toggle-switch.active .toggle-knob {
    left: 22px;
}

/* === CHANNEL & DOCKET === */
.channel-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.channel-id {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 14px;
    font-weight: 600;
    color: var(--transcript-glow);
}

.channel-freq {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: #c8b898;
}

.booth-docket {
    padding: 16px;
    background: rgba(0,0,0,0.15);
    border-radius: 6px;
    box-shadow: inset 0 1px 4px rgba(0,0,0,0.25);
}

.docket-entry {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid rgba(139,125,107,0.15);
}

.docket-number {
    font-family: 'Commissioner', sans-serif;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--terrazzo-chip);
}

.docket-title {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: #c8b898;
}

/* === FOOTER === */
.courthouse-footer {
    background: var(--walnut-chamber);
    padding: 40px;
    text-align: center;
}

.footer-text {
    font-family: 'Commissioner', sans-serif;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--terrazzo-chip);
}

/* === ANIMATIONS === */
@keyframes columnRise {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes pedimentSlide {
    from { transform: translateY(-80px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blinkCaret {
    from, to { border-color: var(--brief-ink); }
    50% { border-color: transparent; }
}

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

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

@keyframes gavelStrike {
    0% { transform: rotate(0deg); }
    40% { transform: rotate(20deg); }
    70% { transform: rotate(-5deg); }
    100% { transform: rotate(0deg); }
}

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

    .courtroom-floor {
        width: 100%;
        padding: 40px 24px 40px 48px;
    }

    .broadcast-booth {
        width: 100%;
        position: sticky;
        top: 0;
        height: 60px;
        flex-direction: row;
        align-items: center;
        padding: 0 16px;
        gap: 16px;
        overflow: hidden;
        z-index: 100;
    }

    .booth-header {
        border: none;
        padding: 0;
        flex-shrink: 0;
    }

    .booth-label {
        display: none;
    }

    .timecode-display {
        font-size: 14px;
        padding: 8px 12px;
        flex-shrink: 0;
    }

    .transcript-panel,
    .booth-controls,
    .channel-panel,
    .booth-docket {
        display: none;
    }

    .facade-inscription {
        font-size: clamp(1.5rem, 8vw, 3rem);
    }

    .columns-row {
        gap: 16px;
    }

    .column.fluted {
        width: 36px;
        height: 240px;
    }

    .pediment {
        width: 300px;
        height: 70px;
    }

    .pediment-face {
        width: 300px;
        height: 70px;
    }

    .facade-base {
        width: 340px;
    }

    .facade-shadow {
        width: 340px;
    }
}
