/* ============================================
   LegalDebug.com - Pop-Art Courtroom Drama
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --lichtenstein-crimson: #D72631;
    --courtroom-cobalt: #1B4F72;
    --exhibit-gold: #F5B301;
    --gavel-black: #0A0A0A;
    --parchment: #FDF6EC;
    --candlelight: #E8A84C;
    --midnight-brief: #162447;
    --benday-rose: #F4A7BB;

    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Lora', 'Times New Roman', serif;
    --font-mono: 'IBM Plex Mono', 'Courier New', monospace;
    --font-comic: 'Bangers', cursive;

    --panel-border: 6px solid var(--gavel-black);
    --gutter-border: 2px solid var(--parchment);
    --border-radius: 0;
}

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

html {
    scroll-snap-type: y mandatory;
    overflow-y: scroll;
    overflow-x: hidden;
}

body {
    font-family: var(--font-body);
    background: var(--gavel-black);
    color: var(--gavel-black);
    line-height: 1.72;
    font-size: 18px;
    -webkit-font-smoothing: antialiased;
}

/* --- Panel Tracker (Left Edge) --- */
#panel-tracker {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 4px;
    width: 24px;
}

.tracker-item {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 9px;
    color: rgba(253, 246, 236, 0.4);
    cursor: pointer;
    transition: color 0.3s ease, transform 0.3s ease;
    letter-spacing: 0.02em;
}

.tracker-item.active {
    color: var(--exhibit-gold);
    transform: scale(1.2);
}

.tracker-item span {
    display: block;
}

/* --- Main Comic Strip Container --- */
#comic-strip {
    scroll-snap-type: y mandatory;
    overflow-y: scroll;
    overflow-x: hidden;
    height: 100vh;
}

/* --- Panel Base --- */
.panel {
    scroll-snap-align: start;
    min-height: 100vh;
    width: 100vw;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: var(--panel-border);
}

.panel:first-child {
    border-top: var(--panel-border);
}

.panel-inner {
    width: 100%;
    height: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
}

.panel-border {
    width: 100%;
    max-width: 960px;
    position: relative;
    border: var(--gutter-border);
    padding: 48px 40px;
}

/* --- Ben-Day Dot Halftone Overlay (Light) --- */
.panel--halftone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, #F4A7BB 1px, transparent 1px);
    background-size: 8px 8px;
    opacity: 0.15;
    pointer-events: none;
    z-index: 1;
}

/* --- Ben-Day Dot Halftone Overlay (Dark) --- */
.panel--halftone-dark::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, #1B4F72 1px, transparent 1px);
    background-size: 8px 8px;
    opacity: 0.15;
    pointer-events: none;
    z-index: 1;
}

/* --- Mono Label --- */
.mono-label {
    font-family: var(--font-mono);
    font-size: 14px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    display: inline-block;
}

.mono-label--light {
    color: var(--parchment);
}

.mono-label--amber {
    color: var(--candlelight);
}

/* --- Panel Title --- */
.panel-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(36px, 6vw, 72px);
    text-transform: uppercase;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--gavel-black);
    margin: 8px 0 32px 0;
}

.panel-title--light {
    color: var(--parchment);
}

.panel-title--amber {
    color: var(--candlelight);
}

/* ==========================================
   PANEL 1: SPLASH
   ========================================== */
.panel--splash {
    background: var(--parchment);
}

.panel--splash .panel-border {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: calc(100vh - 36px);
}

/* Speed Lines */
.speed-lines {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.speed-lines::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200%;
    height: 200%;
    transform: translate(-50%, -50%);
    background:
        repeating-conic-gradient(
            rgba(10, 10, 10, 0.06) 0deg,
            transparent 2deg,
            transparent 15deg,
            rgba(10, 10, 10, 0.06) 17deg,
            transparent 19deg,
            transparent 30deg
        );
}

.splash-content {
    position: relative;
    z-index: 2;
}

.splash-case-label {
    margin-bottom: 16px;
}

.splash-case-label .mono-label {
    background: var(--gavel-black);
    color: var(--parchment);
    padding: 6px 16px;
    font-size: 12px;
}

.splash-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(40px, 8vw, 96px);
    text-transform: uppercase;
    letter-spacing: -0.02em;
    line-height: 1.05;
    color: var(--lichtenstein-crimson);
    margin: 16px 0 24px 0;
    text-shadow: 4px 4px 0 var(--gavel-black);
}

.splash-subtitle .mono-label {
    color: var(--courtroom-cobalt);
    font-size: 13px;
}

.gavel-icon {
    margin: 32px auto;
    width: 120px;
    height: 120px;
    animation: gavelPulse 2s ease-in-out infinite;
}

@keyframes gavelPulse {
    0%, 100% { transform: scale(1.0); }
    50% { transform: scale(1.06); }
}

.isometric-gavel {
    width: 100%;
    height: 100%;
}

.splash-domain {
    font-family: var(--font-display);
    font-size: clamp(20px, 3vw, 32px);
    font-weight: 700;
    color: var(--courtroom-cobalt);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-top: 8px;
}

/* ==========================================
   PANEL 2: CASE BRIEF
   ========================================== */
.panel--brief {
    background: var(--parchment);
}

.panel--brief .panel-border {
    position: relative;
    overflow: hidden;
}

.brief-grid {
    display: grid;
    grid-template-columns: 62% 38%;
    gap: 32px;
    align-items: center;
}

.brief-heading-wrap {
    margin-bottom: 24px;
}

.brief-heading-wrap .mono-label {
    color: var(--courtroom-cobalt);
}

.brief-heading-wrap .panel-title {
    color: var(--lichtenstein-crimson);
}

.brief-text {
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.72;
    color: var(--gavel-black);
    margin-bottom: 16px;
}

.brief-text strong {
    color: var(--lichtenstein-crimson);
}

.brief-right {
    display: flex;
    align-items: center;
    justify-content: center;
}

.brief-icon-frame {
    width: 200px;
    height: 200px;
    position: relative;
}

.isometric-scales {
    width: 100%;
    height: 100%;
}

/* Candle Glow */
.candle-glow {
    position: absolute;
    pointer-events: none;
    z-index: 0;
}

.candle-glow--brief {
    bottom: -60px;
    right: -60px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle at center, rgba(232, 168, 76, 0.4) 0%, transparent 70%);
    animation: candleFlicker 3s ease-in-out infinite;
}

.candle-glow--closing {
    bottom: -80px;
    right: -80px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle at center, rgba(232, 168, 76, 0.4) 0%, transparent 70%);
    animation: candleFlicker 3s ease-in-out infinite;
}

@keyframes candleFlicker {
    0%, 100% { opacity: 0.35; }
    50% { opacity: 0.45; }
}

/* ==========================================
   PANEL 3: EVIDENCE EXHIBITS
   ========================================== */
.panel--evidence {
    background: var(--midnight-brief);
}

.panel--evidence .panel-border {
    border-color: rgba(253, 246, 236, 0.2);
}

.panel--evidence .mono-label {
    color: var(--exhibit-gold);
}

.evidence-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 16px;
    position: relative;
    z-index: 2;
}

.exhibit-card {
    background: var(--parchment);
    border: 3px solid var(--gavel-black);
    position: relative;
    padding: 0;
    box-shadow: 5px 5px 0 var(--gavel-black);
    transition: transform 0.3s ease;
    overflow: visible;
}

.exhibit-card:hover {
    transform: translateY(-4px);
}

.exhibit-stamp {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--lichtenstein-crimson);
    color: var(--parchment);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    padding: 4px 10px;
    transform: rotate(12deg);
    z-index: 5;
    border: 2px solid var(--gavel-black);
    box-shadow: 2px 2px 0 var(--gavel-black);
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.exhibit-card.in-view .exhibit-stamp {
    opacity: 1;
    transform: rotate(12deg) scale(1);
}

.exhibit-content {
    padding: 28px 20px 20px;
}

.exhibit-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 16px;
}

.exhibit-icon svg {
    width: 100%;
    height: 100%;
}

.exhibit-title {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: -0.01em;
    color: var(--gavel-black);
    margin-bottom: 10px;
}

.exhibit-desc {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.65;
    color: var(--gavel-black);
}

/* Torn paper edge */
.torn-edge {
    height: 16px;
    width: 100%;
    background: var(--parchment);
    clip-path: polygon(
        0% 0%, 4% 50%, 8% 10%, 12% 60%, 16% 20%, 20% 55%, 24% 5%, 28% 70%,
        32% 15%, 36% 50%, 40% 8%, 44% 65%, 48% 20%, 52% 55%, 56% 12%, 60% 60%,
        64% 25%, 68% 50%, 72% 10%, 76% 65%, 80% 18%, 84% 55%, 88% 8%, 92% 60%,
        96% 22%, 100% 0%, 100% 100%, 0% 100%
    );
    margin-top: -1px;
}

/* ==========================================
   PANEL 4: CROSS-EXAMINATION
   ========================================== */
.panel--cross {
    background: var(--parchment);
}

.panel--cross .panel-border {
    min-height: calc(100vh - 36px);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.cross-content {
    position: relative;
    z-index: 2;
}

.cross-content .mono-label {
    color: var(--courtroom-cobalt);
}

.cross-content .panel-title {
    color: var(--lichtenstein-crimson);
    margin-bottom: 48px;
}

/* Speech Bubble Areas */
.speech-bubble-area {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 32px;
}

.speech-bubble-area--response {
    justify-content: flex-end;
}

/* Character Silhouettes */
.character-silhouette {
    flex-shrink: 0;
    width: 70px;
    text-align: center;
}

.silhouette-svg {
    width: 60px;
    height: 90px;
}

.character-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-top: 4px;
    color: var(--gavel-black);
}

/* Speech Bubbles */
.speech-bubble {
    background: white;
    border: 3px solid var(--gavel-black);
    border-radius: 20px;
    padding: 24px 28px;
    position: relative;
    box-shadow: 4px 4px 0 var(--gavel-black);
    max-width: 600px;
    transform: scale(0);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.speech-bubble.visible {
    transform: scale(1);
}

/* Speech bubble tail - left pointing */
.speech-bubble--main::after {
    content: '';
    position: absolute;
    left: -20px;
    top: 30px;
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-right: 20px solid var(--gavel-black);
}

.speech-bubble--main::before {
    content: '';
    position: absolute;
    left: -15px;
    top: 32px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 16px solid white;
    z-index: 1;
}

/* Speech bubble tail - right pointing */
.speech-bubble--response::after {
    content: '';
    position: absolute;
    right: -20px;
    top: 30px;
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 20px solid var(--gavel-black);
}

.speech-bubble--response::before {
    content: '';
    position: absolute;
    right: -15px;
    top: 32px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 16px solid white;
    z-index: 1;
}

.bubble-text {
    font-family: var(--font-comic);
    font-size: 22px;
    line-height: 1.4;
    color: var(--gavel-black);
    letter-spacing: 0.02em;
}

/* Objection Burst */
.objection-burst {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0) rotate(-8deg);
    font-family: var(--font-comic);
    font-size: clamp(48px, 8vw, 80px);
    color: var(--lichtenstein-crimson);
    text-shadow:
        3px 3px 0 var(--gavel-black),
        -1px -1px 0 var(--gavel-black),
        1px -1px 0 var(--gavel-black),
        -1px 1px 0 var(--gavel-black);
    z-index: 10;
    pointer-events: none;
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

.objection-burst.visible {
    transform: translate(-50%, -50%) scale(1) rotate(-8deg);
    opacity: 1;
}

/* ==========================================
   PANEL 5: CLOSING ARGUMENTS
   ========================================== */
.panel--closing {
    background: linear-gradient(
        135deg,
        var(--midnight-brief) 0%,
        #1a2a40 40%,
        #1e3350 100%
    );
}

.panel--closing .panel-border {
    border-color: rgba(232, 168, 76, 0.3);
    min-height: calc(100vh - 36px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.closing-content {
    position: relative;
    z-index: 2;
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}

.closing-quote {
    margin: 24px 0;
}

.closing-quote p {
    font-family: var(--font-display);
    font-style: italic;
    font-size: clamp(20px, 3vw, 28px);
    line-height: 1.6;
    color: var(--parchment);
}

.closing-quote em {
    color: var(--exhibit-gold);
    font-style: italic;
}

.closing-attribution {
    margin-top: 24px;
}

.candle-icon {
    position: absolute;
    bottom: 48px;
    right: 60px;
    width: 60px;
    height: 100px;
    z-index: 3;
    opacity: 0.7;
    animation: candleFlicker 3s ease-in-out infinite;
}

.isometric-candle {
    width: 100%;
    height: 100%;
}

/* ==========================================
   PANEL 6: VERDICT
   ========================================== */
.panel--verdict {
    background: var(--gavel-black);
}

.panel--verdict .panel-border {
    border-color: rgba(253, 246, 236, 0.15);
    min-height: calc(100vh - 36px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.verdict-content {
    text-align: center;
}

.verdict-stamp {
    display: inline-block;
    border: 4px solid var(--lichtenstein-crimson);
    padding: 32px 48px;
    transform: rotate(-3deg);
    margin-bottom: 40px;
    animation: verdictPulse 1.5s ease-in-out infinite;
}

@keyframes verdictPulse {
    0%, 100% { border-color: var(--lichtenstein-crimson); }
    50% { border-color: var(--exhibit-gold); }
}

.verdict-stamp-inner {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.verdict-stamp-top {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.08em;
    color: rgba(253, 246, 236, 0.5);
    text-transform: uppercase;
}

.verdict-stamp-main {
    font-family: var(--font-display);
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--lichtenstein-crimson);
}

.verdict-stamp-date {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    color: rgba(253, 246, 236, 0.4);
    text-transform: uppercase;
}

.verdict-domain {
    font-family: var(--font-display);
    font-size: clamp(20px, 3vw, 32px);
    font-weight: 700;
    color: var(--parchment);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}

.verdict-tagline {
    font-family: var(--font-body);
    font-size: 18px;
    font-style: italic;
    color: var(--candlelight);
    margin-bottom: 32px;
}

.verdict-contact {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.verdict-contact .mono-label {
    color: rgba(253, 246, 236, 0.35);
    font-size: 11px;
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 768px) {
    .panel-border {
        padding: 32px 20px;
    }

    .brief-grid {
        grid-template-columns: 1fr;
    }

    .brief-right {
        display: none;
    }

    .evidence-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .speech-bubble-area {
        flex-direction: column;
        align-items: center;
    }

    .speech-bubble-area--response {
        flex-direction: column-reverse;
        align-items: center;
    }

    .character-silhouette {
        width: 50px;
    }

    .speech-bubble--main::after,
    .speech-bubble--main::before,
    .speech-bubble--response::after,
    .speech-bubble--response::before {
        display: none;
    }

    .bubble-text {
        font-size: 18px;
    }

    #panel-tracker {
        display: none;
    }

    .candle-icon {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 70px;
    }

    .verdict-stamp {
        padding: 24px 32px;
    }
}

@media (max-width: 480px) {
    .splash-title {
        font-size: 36px;
    }

    .panel-title {
        font-size: 28px;
    }

    .closing-quote p {
        font-size: 18px;
    }

    .verdict-stamp-main {
        font-size: 28px;
    }
}
