/* courthouse.app - Skeuomorphic Neoclassical */

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

:root {
    --obsidian: #131518;
    --judicial-slate: #1e2328;
    --sandstone: #c4b396;
    --tarnished-brass: #8b7d5e;
    --gilded-leaf: #d4a843;
    --parchment: #e8e2d6;
    --walnut-ink: #2a2520;
    --travertine: #9e9a92;
    --seal-wax: #7c2d2d;
    --brass-border: #5a4f3a;
    --brass-highlight: #a89a78;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--judicial-slate);
    color: var(--parchment);
    font-family: 'Lora', serif;
    font-weight: 400;
    font-size: 18px;
    line-height: 1.85;
    overflow-x: hidden;
}

/* Docket Bar */
#docket-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: var(--tarnished-brass);
    z-index: 200;
    will-change: width;
    transition: width 0.1s linear;
}

/* Portico (Hero) */
.section-portico {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(to bottom, var(--judicial-slate) 0%, var(--sandstone) 100%);
    opacity: 0;
    animation: facadeReveal 1.5s ease forwards;
}

@keyframes facadeReveal {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

.column-left,
.column-right {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 120px;
    background: repeating-linear-gradient(
        90deg,
        var(--travertine) 0px,
        var(--sandstone) 4px,
        var(--travertine) 8px,
        var(--sandstone) 12px,
        var(--travertine) 16px
    );
    opacity: 0.3;
    transition: transform 0.6s ease;
}

.column-left {
    left: 15%;
}

.column-right {
    right: 15%;
}

.column-left.scroll-out {
    transform: translateX(-20px);
}

.column-right.scroll-out {
    transform: translateX(20px);
}

.cartouche {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.cartouche-frame {
    position: absolute;
    width: 480px;
    height: 200px;
}

.pediment-path {
    stroke-dasharray: 1600;
    stroke-dashoffset: 1600;
    animation: drawPediment 2s ease forwards 0.5s;
}

@keyframes drawPediment {
    to { stroke-dashoffset: 0; }
}

.hero-title {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: clamp(40px, 7vw, 80px);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--parchment);
    position: relative;
    z-index: 10;
}

.hero-title .letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

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

.hero-tagline {
    font-family: 'Cormorant SC', serif;
    font-weight: 500;
    font-size: 16px;
    letter-spacing: 0.14em;
    color: var(--sandstone);
    margin-top: 20px;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.hero-tagline.visible {
    opacity: 1;
}

/* Section scroll effect */
.section-portico.scrolled {
    transform: scale(0.97);
    filter: blur(1px);
}

/* Vestibule */
.section-vestibule {
    position: relative;
    max-width: 640px;
    margin: 0 auto;
    padding: 120px 20px;
    min-height: 100vh;
}

.molding-rule {
    width: 100%;
    height: 4px;
    background: repeating-linear-gradient(
        90deg,
        var(--tarnished-brass) 0px,
        var(--tarnished-brass) 8px,
        var(--sandstone) 8px,
        var(--sandstone) 16px
    );
    margin-bottom: 60px;
}

.vest-para {
    font-size: 20px;
    line-height: 2.0;
    text-align: left;
    margin-bottom: 2em;
    color: var(--parchment);
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.vest-para.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Great Hall */
.section-great-hall {
    position: relative;
    padding: 120px 5%;
    min-height: 200vh;
}

.coffered-bg {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, 120px);
    grid-template-rows: repeat(auto-fill, 120px);
    gap: 2px;
    overflow: hidden;
    z-index: 0;
    opacity: 0.15;
    background-attachment: fixed;
}

.coffered-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            0deg,
            transparent 0px,
            transparent 118px,
            var(--travertine) 118px,
            var(--travertine) 120px
        ),
        repeating-linear-gradient(
            90deg,
            transparent 0px,
            transparent 118px,
            var(--travertine) 118px,
            var(--travertine) 120px
        );
    background-size: 120px 120px;
}

.coffered-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-conic-gradient(
            from 0deg at 60px 60px,
            rgba(30,35,40,0.4) 0deg 90deg,
            rgba(37,42,48,0.2) 90deg 180deg,
            rgba(30,35,40,0.4) 180deg 270deg,
            rgba(37,42,48,0.2) 270deg 360deg
        );
    background-size: 120px 120px;
}

.hall-layout {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 0;
    align-items: flex-start;
}

.hall-main {
    flex: 0 0 65%;
    padding-right: 40px;
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.hall-main.visible {
    opacity: 1;
    transform: translateX(0);
}

.hall-main p {
    margin-bottom: 1.5em;
}

.pilaster {
    flex: 0 0 8px;
    min-height: 400px;
    background:
        linear-gradient(125deg, rgba(255,255,255,0.08) 0%, transparent 30%),
        linear-gradient(230deg, transparent 20%, rgba(158,154,146,0.15) 50%, transparent 80%),
        linear-gradient(350deg, transparent 0%, rgba(139,125,94,0.08) 100%),
        linear-gradient(to bottom, #9e9a92 0%, #c4b396 50%, #9e9a92 100%);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.8s ease 0.3s;
}

.pilaster.visible {
    transform: scaleY(1);
}

.hall-sidebar {
    flex: 0 0 30%;
    padding-left: 40px;
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.hall-sidebar.visible {
    opacity: 1;
    transform: translateX(0);
}

.section-heading {
    font-family: 'Libre Baskerville', serif;
    font-weight: 400;
    font-size: clamp(28px, 4vw, 48px);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--parchment);
    margin-bottom: 40px;
}

/* Brass Plaque */
.brass-plaque {
    background: var(--tarnished-brass);
    border: 1px solid var(--brass-border);
    border-radius: 2px;
    box-shadow:
        inset 1px 1px 2px rgba(255,255,255,0.15),
        inset -1px -1px 2px rgba(0,0,0,0.3),
        0 2px 8px rgba(0,0,0,0.4);
    padding: 16px 20px;
    margin-bottom: 20px;
    border-top: 1px solid var(--brass-highlight);
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.brass-plaque.visible {
    opacity: 1;
    transform: scale(1);
}

.plaque-label {
    display: block;
    font-family: 'Cormorant SC', serif;
    font-weight: 500;
    font-size: 13px;
    letter-spacing: 0.14em;
    color: var(--parchment);
    margin-bottom: 4px;
}

.plaque-value {
    display: block;
    font-family: 'Cormorant SC', serif;
    font-weight: 500;
    font-size: 15px;
    letter-spacing: 0.08em;
    color: var(--parchment);
}

/* Courtroom */
.section-courtroom {
    position: relative;
    background: var(--judicial-slate);
    padding: 120px 5%;
    min-height: 200vh;
    overflow: hidden;
}

.seal-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 400px;
    height: 400px;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 2s ease;
    z-index: 0;
}

.seal-watermark.visible {
    opacity: 0.04;
}

.seal-watermark svg {
    width: 100%;
    height: 100%;
    animation: sealRotate 120s linear infinite;
}

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

.bar-line {
    display: flex;
    justify-content: center;
    margin-bottom: 60px;
    position: relative;
    z-index: 1;
}

.bar-left,
.bar-right {
    height: 2px;
    background: var(--gilded-leaf);
    width: 0%;
    transition: width 1.2s ease-in-out;
}

.bar-line.visible .bar-left,
.bar-line.visible .bar-right {
    width: 50%;
}

.judges-bench {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto 80px;
    padding: 40px;
    border-bottom: 3px solid var(--tarnished-brass);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    text-align: center;
    transform: translateY(0);
    transition: transform 0.6s ease, box-shadow 0.6s ease;
}

.judges-bench.elevated {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

.counsel-tables {
    display: flex;
    gap: 4%;
    max-width: 800px;
    margin: 0 auto 80px;
    position: relative;
    z-index: 1;
}

.counsel-left,
.counsel-right {
    flex: 0 0 48%;
    opacity: 0;
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.counsel-left {
    transform: translateX(-40px);
}

.counsel-right {
    transform: translateX(40px);
}

.counsel-left.visible,
.counsel-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.counsel-heading {
    font-family: 'Cormorant SC', serif;
    font-weight: 500;
    font-size: 15px;
    letter-spacing: 0.14em;
    color: var(--gilded-leaf);
    margin-bottom: 20px;
}

.counsel-left p,
.counsel-right p {
    margin-bottom: 1.2em;
    font-size: 17px;
}

.verdict-section {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    padding: 60px 40px;
    border-top: 1px solid var(--tarnished-brass);
    position: relative;
    z-index: 1;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.verdict-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.verdict-text {
    font-family: 'Lora', serif;
    font-weight: 600;
    font-size: 20px;
    line-height: 1.9;
    color: var(--sandstone);
    font-style: italic;
}

/* Archive (Footer) */
.section-archive {
    background: var(--obsidian);
    padding: 120px 5%;
    min-height: 100vh;
}

.archive-columns {
    display: flex;
    gap: 40px;
    max-width: 1000px;
    margin: 0 auto 80px;
}

.archive-col {
    flex: 1;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.archive-col.visible {
    opacity: 1;
    transform: translateY(0);
}

.archive-col p {
    color: var(--travertine);
    font-size: 16px;
    line-height: 1.75;
}

.file-tab {
    display: inline-block;
    font-family: 'Cormorant SC', serif;
    font-weight: 500;
    font-size: 14px;
    letter-spacing: 0.14em;
    color: var(--parchment);
    padding: 8px 24px;
    border-bottom: 2px solid var(--tarnished-brass);
    margin-bottom: 20px;
    position: relative;
}

.file-tab::before,
.file-tab::after {
    content: '';
    position: absolute;
    bottom: -2px;
    width: 12px;
    height: 12px;
    border-bottom: 2px solid var(--tarnished-brass);
}

.file-tab::before {
    left: -12px;
    border-left: 2px solid transparent;
    border-right: 0;
    transform: skewX(30deg);
    transform-origin: bottom right;
}

.file-tab::after {
    right: -12px;
    border-right: 2px solid transparent;
    transform: skewX(-30deg);
    transform-origin: bottom left;
}

.adjournment {
    text-align: center;
    font-family: 'Cormorant SC', serif;
    font-weight: 500;
    font-size: 18px;
    letter-spacing: 0.14em;
    color: var(--travertine);
    opacity: 0;
    transition: opacity 1s ease;
}

.adjournment.visible {
    opacity: 0.6;
}

/* Gavel Ripple */
.gavel-ripple {
    position: fixed;
    width: 0;
    height: 0;
    border: 2px solid var(--gilded-leaf);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0;
}

.gavel-ripple.active {
    animation: gavelStrike 0.4s ease-out forwards;
}

@keyframes gavelStrike {
    0% {
        width: 0;
        height: 0;
        opacity: 0.8;
    }
    100% {
        width: 60px;
        height: 60px;
        margin-top: -30px;
        margin-left: -30px;
        opacity: 0;
    }
}

/* Marble texture utility */
.marble-texture {
    background:
        linear-gradient(125deg, rgba(255,255,255,0.06) 0%, transparent 40%),
        linear-gradient(230deg, transparent 20%, rgba(158,154,146,0.15) 50%, transparent 80%),
        linear-gradient(350deg, transparent 0%, rgba(139,125,94,0.08) 100%);
}

/* Responsive */
@media (max-width: 768px) {
    .column-left,
    .column-right {
        width: 60px;
    }

    .column-left {
        left: 5%;
    }

    .column-right {
        right: 5%;
    }

    .cartouche-frame {
        width: 300px;
        height: 140px;
    }

    .hall-layout {
        flex-direction: column;
    }

    .hall-main,
    .hall-sidebar {
        flex: 1 1 100%;
        padding: 0;
    }

    .pilaster {
        width: 100%;
        min-height: 8px;
        flex: 0 0 8px;
        margin: 40px 0;
    }

    .counsel-tables {
        flex-direction: column;
    }

    .counsel-left,
    .counsel-right {
        flex: 1 1 100%;
    }

    .archive-columns {
        flex-direction: column;
    }

    .section-vestibule {
        padding: 80px 20px;
    }
}
