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

:root {
    --walnut: #2C1810;
    --walnut-deep: #4A3828;
    --brass: #8B6914;
    --brass-light: #C9A96E;
    --cream: #F5F0E0;
    --cream-dark: #EDE4D0;
    --crimson: #7A1B2A;
    --mahogany: #5C2E0E;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--walnut);
    color: var(--cream);
    font-family: 'Lora', serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.7;
    overflow-x: hidden;
}

/* ============================================================
   CHAMBER ENTRANCE - HERO
   ============================================================ */

#chamber-entrance {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--walnut);
    background-image:
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 40px,
            rgba(139, 105, 20, 0.02) 40px,
            rgba(139, 105, 20, 0.02) 41px
        ),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 8px,
            rgba(92, 46, 14, 0.06) 8px,
            rgba(92, 46, 14, 0.06) 9px
        );
    overflow: hidden;
}

.entrance-lines {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    display: flex;
    justify-content: center;
    pointer-events: none;
}

#brass-line-left,
#brass-line-right {
    position: absolute;
    top: 0;
    width: 50%;
    height: 2px;
    opacity: 0;
}

#brass-line-left {
    right: 50%;
    transform-origin: right center;
    transform: scaleX(0);
}

#brass-line-right {
    left: 50%;
    transform-origin: left center;
    transform: scaleX(0);
}

#brass-line-left.animate {
    opacity: 1;
    transform: scaleX(1);
    transition: transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.3s ease;
}

#brass-line-right.animate {
    opacity: 1;
    transform: scaleX(1);
    transition: transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.3s ease;
}

.entrance-title {
    position: relative;
    z-index: 2;
    text-align: center;
    opacity: 0;
    transform: translateY(10px);
}

.entrance-title.animate {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 1.5s ease, transform 1.5s ease;
}

#site-title {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: 64px;
    color: var(--cream);
    letter-spacing: 0.01em;
    margin-bottom: 12px;
}

#site-subtitle {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: 13px;
    letter-spacing: 0.2em;
    color: var(--brass-light);
    text-transform: uppercase;
}

#court-seal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    z-index: 1;
}

#court-seal.animate {
    opacity: 1;
    transition: opacity 3s ease;
}

#scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    animation: none;
}

#scroll-indicator.animate {
    opacity: 0.6;
    animation: scrollBounce 2s ease-in-out infinite;
}

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

/* ============================================================
   CASE TIMELINE
   ============================================================ */

#case-timeline {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    padding: 80px 20px 120px;
}

.spine-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background-color: var(--brass);
    transform: translateX(-50%);
}

.case-entry {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 80px;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.case-entry.visible {
    opacity: 1;
    transform: translateY(0);
}

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

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

.connector-line {
    position: absolute;
    top: 50%;
    width: 30px;
    height: 2px;
    background-color: var(--brass);
}

.case-left .connector-line {
    right: calc(50% - 1px);
}

.case-right .connector-line {
    left: calc(50% - 1px);
}

.case-panel {
    background-color: var(--cream);
    border-top: 4px solid var(--brass);
    padding: 32px 28px 28px;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 3px,
            rgba(201, 169, 110, 0.04) 3px,
            rgba(201, 169, 110, 0.04) 4px
        );
}

.case-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 1px solid rgba(139, 105, 20, 0.15);
    pointer-events: none;
}

.case-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
}

.case-number {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: 11px;
    letter-spacing: 0.15em;
    color: var(--brass);
    text-transform: uppercase;
}

.case-date {
    font-family: 'Lora', serif;
    font-style: italic;
    font-size: 12px;
    color: var(--walnut-deep);
    opacity: 0.6;
}

.brass-ornament {
    margin-bottom: 16px;
}

.brass-ornament svg {
    width: 100%;
    height: 10px;
}

.case-title {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: 20px;
    color: var(--walnut);
    margin-bottom: 12px;
    letter-spacing: 0.01em;
}

.case-text {
    font-family: 'Lora', serif;
    font-weight: 400;
    font-size: 15px;
    line-height: 1.8;
    color: var(--walnut-deep);
}

.gavel-icon {
    margin-top: 20px;
    text-align: right;
    opacity: 0.5;
}

/* ============================================================
   FOOTER
   ============================================================ */

#court-footer {
    text-align: center;
    padding: 60px 20px 80px;
    background-color: var(--walnut);
    border-top: 1px solid rgba(139, 105, 20, 0.2);
}

.footer-ornament {
    max-width: 400px;
    margin: 0 auto 30px;
}

.footer-ornament svg {
    width: 100%;
    height: 10px;
}

.footer-text {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: 16px;
    color: var(--cream);
    letter-spacing: 0.01em;
    margin-bottom: 8px;
}

.footer-latin {
    font-family: 'Lora', serif;
    font-style: italic;
    font-size: 13px;
    color: var(--brass-light);
    letter-spacing: 0.05em;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
    #site-title {
        font-size: 40px;
    }

    #case-timeline {
        padding: 40px 16px 80px;
    }

    .spine-line {
        left: 20px;
    }

    .case-entry.case-left,
    .case-entry.case-right {
        padding-left: 50px;
        padding-right: 0;
        justify-content: flex-start;
    }

    .case-left .connector-line,
    .case-right .connector-line {
        left: 19px;
        right: auto;
        width: 20px;
    }

    .case-entry {
        margin-bottom: 50px;
    }

    .case-panel {
        padding: 24px 20px 20px;
    }

    .case-title {
        font-size: 18px;
    }
}
