/* ============================================
   judge.bar — Styles
   Luxury-premium retro-futuristic courtroom
   Ma-negative-space / Tilt-3D / Glitch-art
   ============================================ */

/* ---------- CSS Custom Properties ---------- */
:root {
    /* Palette */
    --deep-obsidian: #0a0b0f;
    --charcoal-bench: #141519;
    --graphite-chamber: #1e1f26;
    --verdict-cyan: #00e5ff;
    --sentencing-magenta: #ff006e;
    --brass-authority: #c9a84c;
    --platinum-mist: #c8c8d0;
    --fog: #6b6b78;
    --phosphor-green: #39ff14;

    /* Typography */
    --font-display: 'Abril Fatface', serif;
    --font-body: 'DM Sans', sans-serif;
    --font-mono: 'Source Code Pro', monospace;

    /* Sizes */
    --hero-text: clamp(3.5rem, 9vw, 10rem);
    --heading-text: clamp(1.8rem, 4vw, 3.5rem);
    --body-text: clamp(0.95rem, 1.2vw, 1.15rem);
    --mono-text: clamp(0.6rem, 0.8vw, 0.75rem);

    /* Grid */
    --grid-columns: 16;
    --grid-gap: clamp(1rem, 2vw, 2.5rem);

    /* Tilt */
    --tilt-x: 0deg;
    --tilt-y: 0deg;
    --glow-angle: 180deg;
}

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

html {
    scroll-behavior: smooth;
    background: var(--deep-obsidian);
    overflow-x: hidden;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: var(--body-text);
    line-height: 1.75;
    color: var(--platinum-mist);
    background: var(--deep-obsidian);
    overflow-x: hidden;
    cursor: none;
    letter-spacing: 0.01em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---------- SVG Filters (Hidden) ---------- */
.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* ---------- Custom Cursor ---------- */
.custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 48px;
    height: 48px;
    pointer-events: none;
    z-index: 10001;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

body:hover .custom-cursor {
    opacity: 1;
}

.custom-cursor svg {
    position: absolute;
    top: 0;
    left: 0;
}

.cursor-circle {
    transition: r 0.2s ease;
}

.cursor-ring {
    opacity: 0;
    transition: opacity 0.2s ease;
    animation: cursor-spin 4s linear infinite;
    transform-origin: center;
}

body.cursor-hover .cursor-circle {
    r: 18;
}

body.cursor-hover .cursor-ring {
    opacity: 1;
}

@keyframes cursor-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ---------- Scan-line Overlay ---------- */
.scanline-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 229, 255, 0.03) 2px,
        rgba(0, 229, 255, 0.03) 4px
    );
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.scanline-overlay.visible {
    opacity: 1;
}

/* ---------- Glitch Flash ---------- */
.glitch-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 8px;
    background: var(--verdict-cyan);
    mix-blend-mode: difference;
    pointer-events: none;
    z-index: 9998;
    opacity: 0;
    transform: translateY(-100%);
    transition: none;
}

.glitch-flash.active {
    opacity: 1;
    animation: glitch-sweep 0.1s linear forwards;
}

@keyframes glitch-sweep {
    0% { transform: translateY(0); }
    100% { transform: translateY(100vh); }
}

/* ---------- Scroll Indicator ---------- */
.scroll-indicator {
    position: fixed;
    top: 15vh;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 0;
    max-height: 60px;
    background: var(--brass-authority);
    opacity: 0.4;
    z-index: 100;
    transition: height 0.3s ease;
}

/* ---------- The Bench (Header) ---------- */
.the-bench {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 15vh;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 clamp(2rem, 5vw, 6rem);
}

.bench-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bench-wordmark {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(0.7rem, 1vw, 0.9rem);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--platinum-mist);
    opacity: 0.7;
}

.bench-nav-trigger {
    position: relative;
    padding: 10px 0;
    cursor: none;
    width: clamp(40px, 8vw, 100px);
}

.bench-nav-line {
    width: 100%;
    height: 1px;
    background: var(--verdict-cyan);
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.bench-nav-trigger:hover .bench-nav-line {
    opacity: 1;
}

.bench-nav-panel {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: clamp(2rem, 4vw, 4rem);
    padding: clamp(1rem, 2vh, 2rem) clamp(2rem, 5vw, 6rem);
    background: rgba(30, 31, 38, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transform: perspective(800px) rotateX(-15deg);
    transform-origin: top center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, transform 0.4s ease, visibility 0.4s;
}

.bench-nav-panel.open {
    opacity: 1;
    visibility: visible;
    transform: perspective(800px) rotateX(0deg);
}

.nav-link {
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--platinum-mist);
    opacity: 0.5;
    position: relative;
    padding: 4px 8px;
    transition: color 0.3s ease, opacity 0.3s ease;
}

.nav-link::before,
.nav-link::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    border-color: var(--verdict-cyan);
    border-style: solid;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.nav-link::before {
    top: -2px;
    left: -4px;
    border-width: 1px 0 0 1px;
    transform: translate(4px, 4px);
}

.nav-link::after {
    bottom: -2px;
    right: -4px;
    border-width: 0 1px 1px 0;
    transform: translate(-4px, -4px);
}

.nav-link:hover::before,
.nav-link:hover::after {
    opacity: 0.6;
    transform: translate(0, 0);
}

.nav-link:hover {
    opacity: 1;
}

.nav-link.active {
    color: var(--verdict-cyan);
    opacity: 1;
}

.bench-border {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--verdict-cyan);
    animation: bench-pulse 3s ease-in-out infinite;
}

@keyframes bench-pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* ---------- Main Scroll Container ---------- */
.scroll-container {
    scroll-snap-type: y proximity;
    padding-top: 15vh;
}

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

.section-chamber {
    flex-direction: column;
    justify-content: center;
    padding: clamp(2rem, 4vh, 4rem) 0;
}

/* ---------- Hero Section ---------- */
.section-hero {
    min-height: 100vh;
    flex-direction: column;
}

.hero-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(1.5rem, 3vh, 3rem);
}

.hero-wordmark {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: var(--hero-text);
    letter-spacing: 0.02em;
    text-transform: uppercase;
    background: linear-gradient(135deg, #00e5ff 0%, #ff006e 50%, #c9a84c 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
    position: relative;
    min-height: 1.2em;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.hero-wordmark.glitch-pulse {
    animation: chromatic-pulse 0.3s steps(3) forwards;
}

@keyframes chromatic-pulse {
    0% {
        text-shadow: -6px 0 #ff006e, 6px 0 #00e5ff, 0 0 transparent;
        -webkit-text-fill-color: var(--platinum-mist);
        background: none;
    }
    50% {
        text-shadow: -3px 0 #ff006e, 3px 0 #00e5ff, 0 0 transparent;
        -webkit-text-fill-color: var(--platinum-mist);
        background: none;
    }
    100% {
        text-shadow: none;
        -webkit-text-fill-color: transparent;
        background: linear-gradient(135deg, #00e5ff 0%, #ff006e 50%, #c9a84c 100%);
        -webkit-background-clip: text;
        background-clip: text;
    }
}

.hero-tagline {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(0.75rem, 1.2vw, 1rem);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--fog);
    opacity: 0;
    transition: opacity 0.8s ease;
}

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

/* ---------- Verdict Line ---------- */
.verdict-line {
    position: relative;
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--brass-authority) 30%, var(--brass-authority) 70%, transparent 100%);
    transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.verdict-line.visible {
    width: 60%;
}

.verdict-line-divider {
    margin: 0 auto;
    animation: verdict-pulse 4s ease-in-out infinite;
}

.verdict-line-divider.visible {
    width: 60%;
}

@keyframes verdict-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

.verdict-diamond {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--brass-authority);
    transform: rotate(45deg);
    flex-shrink: 0;
}

/* ---------- Void Spacer ---------- */
.void-spacer {
    height: 30vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.void-spacer-final {
    height: 20vh;
}

/* ---------- Chamber Grid (16-column) ---------- */
.chamber-grid {
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    gap: var(--grid-gap);
    width: 100%;
    padding: 0 var(--grid-gap);
}

/* ---------- Content Blocks ---------- */
.content-block {
    background: var(--charcoal-bench);
    padding: clamp(2rem, 4vw, 4rem);
    position: relative;
    box-shadow: 0 0 40px rgba(0, 229, 255, 0.04);
    filter: url(#noise-filter);
    transform: perspective(1200px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
    transition: transform 0.15s ease-out;
    opacity: 0;
    will-change: transform, opacity;
}

.content-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(var(--glow-angle), rgba(0, 229, 255, 0.05), transparent);
    pointer-events: none;
    z-index: 0;
}

.content-block > * {
    position: relative;
    z-index: 1;
}

.content-block.animate-in {
    animation: content-enter 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes content-enter {
    from {
        opacity: 0;
        transform: perspective(1200px) translateY(40px);
    }
    to {
        opacity: 1;
        transform: perspective(1200px) translateY(0);
    }
}

.content-left {
    grid-column: 2 / 8;
    --base-rotate-y: -2deg;
}

.content-right {
    grid-column: 9 / 16;
    --base-rotate-y: 2deg;
}

/* ---------- Corner Brackets ---------- */
.corner-bracket {
    position: absolute;
    width: 16px;
    height: 16px;
    border-color: var(--verdict-cyan);
    border-style: solid;
    opacity: 0.6;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 2;
}

.corner-bracket.tl {
    top: -8px;
    left: -8px;
    border-width: 2px 0 0 2px;
}

.corner-bracket.tr {
    top: -8px;
    right: -8px;
    border-width: 2px 2px 0 0;
}

.corner-bracket.bl {
    bottom: -8px;
    left: -8px;
    border-width: 0 0 2px 2px;
}

.corner-bracket.br {
    bottom: -8px;
    right: -8px;
    border-width: 0 2px 2px 0;
}

.content-block:hover .corner-bracket.tl {
    top: 0;
    left: 0;
}

.content-block:hover .corner-bracket.tr {
    top: 0;
    right: 0;
}

.content-block:hover .corner-bracket.bl {
    bottom: 0;
    left: 0;
}

.content-block:hover .corner-bracket.br {
    bottom: 0;
    right: 0;
}

/* ---------- Section Headings ---------- */
.section-heading {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: var(--heading-text);
    letter-spacing: 0.02em;
    color: var(--platinum-mist);
    margin-bottom: 1.5em;
    text-shadow: -2px 0 var(--sentencing-magenta), 2px 0 var(--verdict-cyan), 0 0 transparent;
    transition: text-shadow 0.2s steps(3);
}

.section-heading:hover {
    text-shadow: -4px 0 var(--sentencing-magenta), 4px 0 var(--verdict-cyan), 0 0 transparent;
}

/* ---------- Body Text ---------- */
.content-block p {
    color: rgba(200, 200, 208, 0.75);
    margin-bottom: 1.5em;
    line-height: 1.75;
    font-weight: 400;
}

/* ---------- Pull Quotes ---------- */
.pull-quote {
    display: flex;
    gap: clamp(1rem, 2vw, 1.5rem);
    margin: 2em 0 1em;
    align-items: stretch;
}

.quote-rule {
    display: block;
    width: 2px;
    min-height: 100%;
    background: var(--brass-authority);
    flex-shrink: 0;
}

.quote-text {
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    font-weight: 400;
    color: var(--verdict-cyan);
    line-height: 1.4;
}

/* ---------- Data Readout Strips ---------- */
.data-readout-strip {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 var(--grid-gap);
    width: 100%;
    overflow: hidden;
}

.data-readout-strip.top {
    margin-bottom: clamp(1rem, 2vh, 2rem);
}

.data-readout-strip.bottom {
    margin-top: clamp(1rem, 2vh, 2rem);
}

.readout-label {
    font-family: var(--font-mono);
    font-weight: 300;
    font-size: var(--mono-text);
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--verdict-cyan);
    opacity: 0.5;
    white-space: nowrap;
    flex-shrink: 0;
}

.readout-line {
    flex: 0 0 auto;
    width: 60px;
    height: 1px;
    background: var(--verdict-cyan);
    opacity: 0.3;
}

.readout-scroll-text {
    font-family: var(--font-mono);
    font-weight: 300;
    font-size: var(--mono-text);
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--verdict-cyan);
    opacity: 0.3;
    white-space: nowrap;
    animation: marquee 30s linear infinite;
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* ---------- The Docket (Footer HUD) ---------- */
.the-docket {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: auto;
    padding: clamp(0.5rem, 1vh, 1rem) clamp(2rem, 5vw, 6rem);
    display: flex;
    align-items: center;
    gap: clamp(0.5rem, 2vw, 2rem);
    font-family: var(--font-mono);
    font-weight: 300;
    font-size: 10px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--platinum-mist);
    opacity: 0.4;
    z-index: 1000;
    background: linear-gradient(to top, rgba(10, 11, 15, 0.8), transparent);
    flex-wrap: wrap;
}

.docket-separator {
    color: var(--fog);
    opacity: 0.4;
}

.docket-section,
.docket-scroll,
.docket-timestamp,
.docket-status {
    white-space: nowrap;
}

/* ---------- Glitch Slice Animation on Content Blocks ---------- */
.content-block::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: inherit;
    clip-path: inset(40% 0 55% 0);
    transform: translateX(0);
    pointer-events: none;
    z-index: 3;
    opacity: 0;
}

.content-block.glitch-slice::after {
    opacity: 1;
    animation: glitch-slice-anim 0.05s steps(1) forwards;
}

@keyframes glitch-slice-anim {
    0% { transform: translateX(10px); clip-path: inset(30% 0 60% 0); }
    50% { transform: translateX(-8px); clip-path: inset(45% 0 45% 0); }
    100% { transform: translateX(0); opacity: 0; }
}

/* ---------- Links ---------- */
a:not(.nav-link) {
    color: var(--platinum-mist);
    text-decoration: none;
    position: relative;
    transition: color 0.3s ease;
}

a:not(.nav-link)::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--verdict-cyan);
    transition: width 0.3s ease;
}

a:not(.nav-link):hover {
    color: var(--verdict-cyan);
}

a:not(.nav-link):hover::after {
    width: 100%;
}

/* ---------- Buttons (Outlined Style) ---------- */
button, .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75em 2em;
    background: transparent;
    border: 1px solid var(--verdict-cyan);
    color: var(--verdict-cyan);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    cursor: none;
    position: relative;
    transition: background 0.3s ease, border-color 0.3s ease;
}

button:hover, .btn:hover {
    background: rgba(0, 229, 255, 0.08);
    border-color: var(--verdict-cyan);
}

/* ---------- Selection ---------- */
::selection {
    background: rgba(0, 229, 255, 0.2);
    color: var(--platinum-mist);
}

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

    .the-bench {
        height: auto;
        min-height: 10vh;
        padding: 1rem clamp(1rem, 3vw, 3rem);
    }

    .scroll-container {
        padding-top: 10vh;
    }

    .bench-nav-panel {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .void-spacer {
        height: 15vh;
    }

    .hero-wordmark {
        font-size: clamp(2rem, 12vw, 4rem);
    }

    .the-docket {
        font-size: 8px;
        letter-spacing: 0.15em;
    }

    .section-chamber {
        padding: clamp(1rem, 2vh, 2rem) 0;
    }

    body {
        cursor: auto;
    }

    .custom-cursor {
        display: none;
    }
}

@media (max-width: 480px) {
    .content-left,
    .content-right {
        grid-column: 1 / -1;
    }

    .content-block {
        padding: clamp(1.5rem, 4vw, 2rem);
    }

    .docket-separator:nth-child(n+4),
    .docket-status {
        display: none;
    }
}
