/* =============================================
   courts.studio — Cinematic Judicial Design
   ============================================= */

/* --- CSS Custom Properties --- */
:root {
    --deep-chamber: #2c2218;
    --warm-wood: #5c4a3a;
    --sepia-glow: #c4a06a;
    --parchment: #f2ead8;
    --frost-glass: rgba(244, 236, 220, 0.12);
    --frost-glass-light: rgba(244, 236, 220, 0.08);
    --frost-glass-heavy: rgba(244, 236, 220, 0.15);
    --accent-steel: #6b7b8a;
    --signal-copper: #b87333;
    --mid-chamber: #3a2e22;
    --warm-mid: #4a3c2e;
    --glass-border: rgba(196, 160, 106, 0.2);
    --glass-shadow: rgba(44, 34, 24, 0.3);
    --bounce-easing: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
    scroll-behavior: smooth;
    overflow: hidden;
    height: 100%;
}

body {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 300;
    font-size: 1.125rem;
    line-height: 1.7;
    letter-spacing: 0.005em;
    color: var(--parchment);
    background: var(--deep-chamber);
    overflow: hidden;
    height: 100%;
}

/* --- Scroll Container --- */
.scroll-container {
    height: 100vh;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
}

/* --- Sections --- */
.section {
    position: relative;
    width: 100%;
    height: 100vh;
    scroll-snap-align: start;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Vignette Overlay --- */
.vignette {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.2) 100%);
    z-index: 1;
}

/* --- Navigation Bar --- */
.nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    z-index: 100;
    background: rgba(44, 34, 24, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.nav-logo {
    font-family: 'Commissioner', sans-serif;
    font-weight: 200;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--parchment);
}

.nav-hamburger {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
}

.hamburger-line {
    display: block;
    width: 24px;
    height: 1px;
    background: var(--warm-wood);
    transition: all 0.3s var(--bounce-easing);
}

.nav-hamburger.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

.nav-hamburger.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.nav-hamburger.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
}

/* --- Navigation Overlay --- */
.nav-overlay {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    max-width: 80vw;
    height: 100vh;
    z-index: 99;
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    background: rgba(44, 34, 24, 0.85);
    transform: translateX(100%);
    transition: transform 0.6s var(--bounce-easing);
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-overlay.active {
    transform: translateX(0);
}

.nav-overlay-content {
    display: flex;
    flex-direction: column;
    gap: 32px;
    padding: 40px;
}

.nav-link {
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-size: 1.25rem;
    color: var(--parchment);
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--signal-copper);
}

/* =============================================
   SECTION 1: The Antechamber
   ============================================= */
.section-antechamber {
    background: var(--deep-chamber);
    justify-content: flex-start;
    align-items: center;
}

.antechamber-content {
    position: relative;
    z-index: 2;
    margin-left: 15vw;
    margin-right: auto;
}

.antechamber-title {
    font-family: 'Commissioner', sans-serif;
    font-weight: 600;
    font-size: clamp(2.5rem, 6vw, 5rem);
    letter-spacing: -0.02em;
    line-height: 1.08;
    color: var(--parchment);
    opacity: 0;
    transform: translateY(20px);
}

.antechamber-title.animated {
    animation: bounceEnter 600ms var(--bounce-easing) forwards;
    animation-delay: 200ms;
}

.antechamber-subtitle {
    margin-top: 40px;
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 300;
    font-size: 1rem;
    color: var(--accent-steel);
    opacity: 0;
}

.antechamber-subtitle.animated {
    animation: fadeIn 600ms ease forwards;
    animation-delay: 600ms;
}

/* Gavel Pulse */
.gavel-pulse {
    position: absolute;
    bottom: 15%;
    left: 50%;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    z-index: 2;
}

.gavel-pulse.active {
    animation: gavelPulse 3s ease-out infinite;
}

.gavel-pulse.pulse-played {
    animation: gavelPulse 3s ease-out 1;
}

/* =============================================
   SECTION 2: The Evidence Chamber
   ============================================= */
.section-evidence {
    background: var(--mid-chamber);
}

/* Court Lines SVG */
.court-lines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.court-lines line,
.court-lines path,
.court-lines rect {
    stroke: var(--accent-steel);
    stroke-opacity: 0.15;
    stroke-width: 1;
    fill: none;
}

/* Glassmorphic Cards */
.glass-card {
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    background: var(--frost-glass);
    border: 1px solid var(--glass-border);
    border-radius: 2px;
    box-shadow: 0 8px 32px var(--glass-shadow);
    padding: 40px;
    opacity: 0;
    transform: translateY(20px);
}

.glass-card.animated {
    animation: bounceEnter 600ms var(--bounce-easing) forwards;
}

.evidence-card {
    position: absolute;
    z-index: 2;
}

.card-1 {
    top: 15%;
    left: 10%;
    width: 35vw;
    max-width: 500px;
    transform: rotate(-2deg) translateY(20px);
}

.card-1.animated {
    animation: bounceEnterRotateNeg2 600ms var(--bounce-easing) forwards;
}

.card-2 {
    top: 35%;
    left: 40%;
    width: 30vw;
    max-width: 420px;
    transform: rotate(1.5deg) translateY(20px);
    z-index: 3;
}

.card-2.animated {
    animation: bounceEnterRotatePos15 600ms var(--bounce-easing) forwards;
}

.card-3 {
    top: 55%;
    left: 20%;
    width: 32vw;
    max-width: 450px;
    transform: rotate(-0.5deg) translateY(20px);
}

.card-3.animated {
    animation: bounceEnterRotateNeg05 600ms var(--bounce-easing) forwards;
}

.card-label {
    font-family: 'Commissioner', sans-serif;
    font-weight: 200;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent-steel);
    display: block;
    margin-bottom: 16px;
}

.card-title {
    font-family: 'Commissioner', sans-serif;
    font-weight: 600;
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    letter-spacing: -0.02em;
    line-height: 1.08;
    color: var(--parchment);
    margin-bottom: 16px;
}

.card-body {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 300;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--parchment);
    opacity: 0.85;
}

/* Card hover */
.evidence-card {
    transition: transform 0.4s var(--bounce-easing), box-shadow 0.4s ease;
}

.card-1.animated:hover {
    transform: rotate(-2deg) translateY(-4px);
    box-shadow: 0 12px 40px var(--glass-shadow);
}

.card-2.animated:hover {
    transform: rotate(1.5deg) translateY(-4px);
    box-shadow: 0 12px 40px var(--glass-shadow);
}

.card-3.animated:hover {
    transform: rotate(-0.5deg) translateY(-4px);
    box-shadow: 0 12px 40px var(--glass-shadow);
}

/* =============================================
   SECTION 3: The Proceedings Chamber
   ============================================= */
.section-proceedings {
    background: var(--deep-chamber);
}

.timeline-container {
    position: relative;
    width: 80vw;
    max-width: 900px;
    height: 60vh;
    z-index: 2;
}

.timeline-svg {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 80px;
    transform: translateY(-50%);
    overflow: visible;
}

.timeline-line {
    stroke: var(--warm-wood);
    stroke-width: 1;
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    transition: stroke-dashoffset 1.5s ease;
}

.timeline-line.drawn {
    stroke-dashoffset: 0;
}

.timeline-node {
    fill: var(--sepia-glow);
    opacity: 0;
    transform-origin: center;
    transition: opacity 0.4s ease, transform 0.6s var(--bounce-easing);
    transform: scale(0);
}

.timeline-node.active {
    opacity: 1;
    transform: scale(1);
}

/* Timeline Labels */
.timeline-labels {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.timeline-item {
    position: absolute;
    top: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 25%;
    opacity: 0;
    transform: translateY(20px);
}

.timeline-item.animated {
    animation: bounceEnter 400ms var(--bounce-easing) forwards;
}

.timeline-item[data-node='0'] {
    left: 12.5%;
}

.timeline-item[data-node='1'] {
    left: 37.5%;
}

.timeline-item[data-node='2'] {
    left: 62.5%;
}

.timeline-label-top {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 300;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--parchment);
    display: block;
    margin-bottom: 60px;
    transform: translateY(-100%);
}

.timeline-label-bottom {
    font-family: 'Commissioner', sans-serif;
    font-weight: 200;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent-steel);
    display: block;
    margin-top: 20px;
}

.proceedings-pulse {
    bottom: auto;
    top: 50%;
    left: 75%;
    transform: translate(-50%, -50%);
}

/* =============================================
   SECTION 4: The Deliberation Chamber
   ============================================= */
.section-deliberation {
    background: var(--warm-mid);
}

.deliberation-panel {
    position: relative;
    z-index: 2;
    width: 70vw;
    max-width: 900px;
    padding: 60px 80px;
    backdrop-filter: blur(30px) saturate(1.2);
    -webkit-backdrop-filter: blur(30px) saturate(1.2);
    background: var(--frost-glass-heavy);
}

.deliberation-quote {
    font-family: 'Commissioner', sans-serif;
    font-weight: 600;
    font-size: clamp(1.25rem, 2.5vw, 2rem);
    line-height: 1.4;
    color: var(--parchment);
    margin-bottom: 40px;
    border: none;
    padding: 0;
}

.deliberation-body {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 300;
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--parchment);
    opacity: 0.85;
    margin-bottom: 24px;
}

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

/* =============================================
   SECTION 5: The Verdict
   ============================================= */
.section-verdict {
    background: var(--deep-chamber);
    justify-content: flex-end;
}

.verdict-content {
    position: relative;
    z-index: 2;
    margin-left: auto;
    margin-right: 15vw;
    text-align: right;
}

.verdict-title {
    font-family: 'Commissioner', sans-serif;
    font-weight: 600;
    font-size: clamp(2.5rem, 6vw, 5rem);
    letter-spacing: -0.02em;
    line-height: 1.08;
    color: var(--parchment);
    opacity: 0;
    transform: translateY(20px);
}

.verdict-title.animated {
    animation: bounceEnter 600ms var(--bounce-easing) forwards;
}

.verdict-tagline {
    margin-top: 40px;
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 300;
    font-size: 1.125rem;
    color: var(--sepia-glow);
    opacity: 0;
}

.verdict-tagline.animated {
    animation: fadeIn 600ms ease forwards;
}

.verdict-rule {
    border: none;
    height: 1px;
    background: var(--warm-wood);
    width: 40vw;
    max-width: 500px;
    margin: 40px 0 40px auto;
    opacity: 0;
}

.verdict-rule.animated {
    animation: fadeIn 600ms ease forwards;
}

.verdict-contact {
    font-family: 'Commissioner', sans-serif;
    font-weight: 200;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent-steel);
    opacity: 0;
}

.verdict-contact.animated {
    animation: fadeIn 600ms ease forwards;
}

.verdict-pulse {
    bottom: 20%;
    left: 50%;
}

/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes bounceEnter {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounceEnterRotateNeg2 {
    0% {
        opacity: 0;
        transform: rotate(-2deg) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: rotate(-2deg) translateY(0);
    }
}

@keyframes bounceEnterRotatePos15 {
    0% {
        opacity: 0;
        transform: rotate(1.5deg) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: rotate(1.5deg) translateY(0);
    }
}

@keyframes bounceEnterRotateNeg05 {
    0% {
        opacity: 0;
        transform: rotate(-0.5deg) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: rotate(-0.5deg) translateY(0);
    }
}

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

@keyframes gavelPulse {
    0% {
        box-shadow: 0 0 0 0 var(--signal-copper);
        opacity: 1;
    }
    100% {
        box-shadow: 0 0 0 20px transparent;
        opacity: 0;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .scroll-container {
        scroll-snap-type: none;
    }
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
    .nav-bar {
        padding: 0 20px;
    }

    .antechamber-content {
        margin-left: 8vw;
    }

    .evidence-card {
        position: relative;
        top: auto;
        left: auto;
        width: 85vw;
        max-width: none;
        margin: 20px auto;
    }

    .section-evidence {
        flex-direction: column;
        justify-content: center;
        padding: 80px 0;
        height: auto;
        min-height: 100vh;
    }

    .card-1, .card-2, .card-3 {
        transform: none !important;
    }

    .card-1.animated, .card-2.animated, .card-3.animated {
        animation: bounceEnter 600ms var(--bounce-easing) forwards;
    }

    .card-1.animated:hover,
    .card-2.animated:hover,
    .card-3.animated:hover {
        transform: translateY(-4px) !important;
    }

    .timeline-container {
        width: 95vw;
    }

    .timeline-item {
        width: 30%;
    }

    .timeline-label-top {
        font-size: 0.75rem;
    }

    .deliberation-panel {
        width: 90vw;
        padding: 40px 30px;
    }

    .verdict-content {
        margin-right: 8vw;
    }

    .nav-overlay {
        width: 100vw;
        max-width: 100vw;
    }
}
