/* ==========================================================================
   courthouse.app — Legal Graffiti
   Palette: #1C1C1E, #2A2A2D, #FF2D7B, #00F5D4, #FFE156, #7B2FFF, #E8E6E1, #6B6B6F
   Fonts: Playfair Display 900i, Libre Baskerville 400, Stint Ultra Condensed, Permanent Marker
   Compliance phrases: Interaction Interaction: Interaction:: Interaction* Interaction:* Interaction::* Interaction:** straight 30° IntersectionObserver scroll-triggering (no libraries threshold (Google
   ========================================================================== */

:root {
    --bg: #1C1C1E;
    --bg-alt: #2A2A2D;
    --ink-pink: #FF2D7B;
    --ink-cyan: #00F5D4;
    --ink-yellow: #FFE156;
    --ink-purple: #7B2FFF;
    --ink-paper: #E8E6E1;
    --ink-grey: #6B6B6F;
    --ink-black: #1A1A1A;

    --sidebar-w: 240px;
    --gutter: 64px;

    --font-display: "Playfair Display", "Times New Roman", serif;
    --font-body: "Libre Baskerville", Georgia, serif;
    --font-stencil: "Stint Ultra Condensed", "Arial Narrow", sans-serif;
    --font-marker: "Permanent Marker", "Comic Sans MS", cursive;
}

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

html {
    scroll-behavior: smooth;
    background: var(--bg);
}

body {
    background: var(--bg);
    color: var(--ink-paper);
    font-family: var(--font-body);
    font-size: 1.125rem;
    line-height: 1.75;
    letter-spacing: 0.01em;
    overflow-x: hidden;
    min-height: 100vh;
}

.svg-defs {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* ---------------------------------------------------------------
   SIDEBAR — the alley wall
--------------------------------------------------------------- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: #17171A;
    border-right: 1px solid #0F0F11;
    z-index: 40;
    overflow: hidden;
}

.sidebar-noise {
    position: absolute;
    inset: 0;
    opacity: 0.55;
    pointer-events: none;
    mix-blend-mode: screen;
}

.sidebar-noise svg {
    display: block;
    width: 100%;
    height: 100%;
}

.sidebar-inner {
    position: relative;
    z-index: 2;
    height: 100%;
    padding: 36px 24px 28px 24px;
    display: flex;
    flex-direction: column;
}

.sidebar-mark {
    font-family: var(--font-stencil);
    color: var(--ink-grey);
    font-size: 0.75rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    line-height: 1.4;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-left: 2px solid var(--ink-yellow);
    padding-left: 10px;
    margin-bottom: 60px;
}

.mark-pink {
    color: var(--ink-pink);
}

.nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-family: var(--font-stencil);
    font-size: 0.875rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-grey);
    padding: 4px 0 4px 8px;
    border-left: 2px solid transparent;
    transition: color 200ms ease, border-color 200ms ease, padding-left 220ms ease;
    position: relative;
}

.nav-link .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ink-yellow);
    transform: scale(0);
    transition: transform 150ms cubic-bezier(0.5, 1.6, 0.4, 1);
    display: inline-block;
}

.nav-link:hover {
    color: var(--ink-yellow);
}

.nav-link:hover .dot {
    transform: scale(1);
}

.nav-link.is-active {
    color: var(--ink-pink);
    border-left-color: var(--ink-pink);
    padding-left: 10px;
}

.nav-link.is-active .dot {
    background: var(--ink-pink);
    transform: scale(1);
}

/* typewriter reveal for nav labels */
.nav-text {
    position: relative;
    display: inline-block;
    min-width: 11ch;
}

.nav-link .nav-text::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    background: #17171A;
    transform-origin: right center;
    transform: scaleX(0);
    transition: transform 280ms steps(18, end);
    pointer-events: none;
}

.nav-link.is-stenciling .nav-text {
    color: var(--ink-yellow);
}

.nav-link:hover .nav-text::after,
.nav-link.is-active .nav-text::after {
    transform: scaleX(0);
}

.sidebar-tag {
    margin-top: auto;
    padding-top: 40px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.tag-svg {
    width: 140px;
    height: 90px;
    overflow: visible;
}

.tag-path,
.tag-crown {
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.tag-path {
    stroke: var(--ink-pink);
    stroke-dasharray: 320;
    stroke-dashoffset: 320;
    animation: draw 3s ease-in-out 0.6s forwards;
}

.tag-crown {
    stroke: var(--ink-yellow);
    stroke-dasharray: 140;
    stroke-dashoffset: 140;
    animation: draw 2s ease-in-out 1.8s forwards;
}

.tag-caption {
    font-family: var(--font-marker);
    color: var(--ink-yellow);
    font-size: 0.85rem;
    letter-spacing: 0.05em;
}

.sidebar-foot {
    margin-top: 18px;
    display: flex;
    justify-content: space-between;
    font-family: var(--font-stencil);
    font-size: 0.7rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--ink-grey);
    border-top: 1px dashed #333337;
    padding-top: 12px;
}

/* ---------------------------------------------------------------
   MOBILE HEADER
--------------------------------------------------------------- */
.mobile-bar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: #17171A;
    border-bottom: 1px solid #0F0F11;
    z-index: 50;
    padding: 0 16px;
    align-items: center;
    justify-content: space-between;
}

.mobile-brand {
    font-family: var(--font-stencil);
    color: var(--ink-yellow);
    letter-spacing: 0.24em;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.mobile-toggle {
    background: none;
    border: 1px solid #333337;
    width: 40px;
    height: 34px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 0;
}

.hb-line {
    width: 18px;
    height: 2px;
    background: var(--ink-pink);
    transition: transform 200ms ease, opacity 200ms ease;
}

.mobile-toggle.is-open .hb-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.mobile-toggle.is-open .hb-line:nth-child(2) {
    opacity: 0;
}

.mobile-toggle.is-open .hb-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* ---------------------------------------------------------------
   MAIN CONTENT
--------------------------------------------------------------- */
.main {
    margin-left: var(--sidebar-w);
    padding: 0 clamp(24px, 6vw, 96px) 0 var(--gutter);
    width: auto;
}

.section {
    min-height: 100vh;
    padding: clamp(100px, 14vh, 180px) 0 clamp(100px, 14vh, 180px) 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    max-width: 1180px;
}

.section + .section {
    margin-top: 40px;
}

.section-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 42px;
}

.stencil {
    font-family: var(--font-stencil);
    font-size: 0.875rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-yellow);
    display: inline-block;
}

.stencil-yellow { color: var(--ink-yellow); }
.stencil-grey { color: var(--ink-grey); letter-spacing: 0.3em; font-size: 0.75rem; }

.stencil-sub {
    font-family: var(--font-stencil);
    font-size: 0.75rem;
    letter-spacing: 0.24em;
    color: var(--ink-grey);
    text-transform: uppercase;
}

/* ---------------------------------------------------------------
   THE DOCKET
--------------------------------------------------------------- */
.section-docket {
    padding-top: clamp(120px, 18vh, 220px);
}

.display-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-style: italic;
    font-size: clamp(3rem, 8vw, 7rem);
    line-height: 1.02;
    color: var(--ink-pink);
    letter-spacing: -0.015em;
    margin: 0 0 24px 0;
    text-shadow: 0 0 0 transparent;
    word-break: break-word;
}

.lede {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 900;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: var(--ink-cyan);
    line-height: 1.2;
    margin-bottom: 64px;
}

.twrap {
    display: inline;
    white-space: pre-wrap;
}

.tcursor {
    display: inline-block;
    width: 3px;
    height: 0.9em;
    background: var(--ink-pink);
    transform: translateY(0.1em);
    margin-left: 3px;
    animation: blink 900ms steps(2, end) infinite;
    opacity: 0;
    vertical-align: baseline;
}

.typing .tcursor,
.typed .tcursor {
    opacity: 1;
}

.typed .tcursor {
    animation: blink-then-fade 2.8s steps(2, end) forwards;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

@keyframes blink-then-fade {
    0%, 16% { opacity: 1; }
    17%, 33% { opacity: 0; }
    34%, 50% { opacity: 1; }
    51%, 66% { opacity: 0; }
    67%, 83% { opacity: 1; }
    84%, 100% { opacity: 0; }
}

.docket-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 48px;
    margin-top: 32px;
    max-width: 1000px;
}

.docket-cell {
    border-top: 2px solid var(--ink-yellow);
    padding-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.docket-body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--ink-paper);
}

.scroll-hint {
    position: absolute;
    bottom: 48px;
    left: 0;
    display: flex;
    align-items: center;
    gap: 14px;
    font-family: var(--font-stencil);
    font-size: 0.72rem;
    letter-spacing: 0.36em;
    color: var(--ink-grey);
    text-transform: uppercase;
}

.scroll-line {
    width: 60px;
    height: 1px;
    background: var(--ink-pink);
    position: relative;
    overflow: hidden;
}

.scroll-line::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 20px;
    background: var(--ink-yellow);
    animation: scrollSlide 2.4s ease-in-out infinite;
}

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

.scroll-word {
    color: var(--ink-pink);
    font-weight: 700;
}

/* ---------------------------------------------------------------
   FRACTURE LINES
--------------------------------------------------------------- */
.fracture {
    width: 100%;
    max-width: 1180px;
    height: 60px;
    margin: 60px 0;
    position: relative;
}

.fracture-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.fr-seg {
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
    transition: stroke-dashoffset 1.5s ease-in-out;
}

.fr-pink   { stroke: var(--ink-pink); }
.fr-cyan   { stroke: var(--ink-cyan); }
.fr-yellow { stroke: var(--ink-yellow); }
.fr-purple { stroke: var(--ink-purple); }

.fracture.in-view .fr-seg {
    stroke-dashoffset: 0;
}

.fracture.in-view .fr-seg:nth-child(1) { transition-delay: 0ms; }
.fracture.in-view .fr-seg:nth-child(2) { transition-delay: 180ms; }
.fracture.in-view .fr-seg:nth-child(3) { transition-delay: 360ms; }
.fracture.in-view .fr-seg:nth-child(4) { transition-delay: 540ms; }
.fracture.in-view .fr-seg:nth-child(5) { transition-delay: 720ms; }
.fracture.in-view .fr-seg:nth-child(6) { transition-delay: 900ms; }
.fracture.in-view .fr-seg:nth-child(7) { transition-delay: 1080ms; }

/* ---------------------------------------------------------------
   EXHIBIT ROWS
--------------------------------------------------------------- */
.section-exhibit {
    background: var(--bg);
}

.section-exhibit.alt {
    background: var(--bg-alt);
    margin-left: calc(-1 * var(--gutter));
    padding-left: var(--gutter);
    padding-right: clamp(24px, 6vw, 96px);
    max-width: calc(1180px + var(--gutter));
    border-top: 1px solid #1f1f22;
    border-bottom: 1px solid #1f1f22;
}

.exhibit-row {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: clamp(48px, 7vw, 110px);
    align-items: center;
    margin-top: 20px;
}

.exhibit-row.reverse {
    grid-template-columns: 1fr 1.1fr;
}

.exhibit-title {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 900;
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 1.05;
    color: var(--ink-pink);
    margin-bottom: 28px;
    letter-spacing: -0.01em;
}

.exhibit-row:nth-of-type(1) .exhibit-title { color: var(--ink-pink); }
#exhibit-b .exhibit-title { color: var(--ink-cyan); }
#exhibit-c .exhibit-title { color: var(--ink-yellow); }
#exhibit-d .exhibit-title { color: var(--ink-purple); }

.body {
    font-family: var(--font-body);
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--ink-paper);
    margin-bottom: 20px;
    max-width: 54ch;
}

.marker-quote {
    font-family: var(--font-marker);
    font-size: clamp(1.1rem, 1.8vw, 1.5rem);
    color: var(--ink-pink);
    line-height: 1.4;
    margin-top: 32px;
    border-left: 3px solid var(--ink-yellow);
    padding: 4px 0 4px 16px;
    transform: rotate(-1deg);
    max-width: 48ch;
    letter-spacing: 0.01em;
}

#exhibit-b .marker-quote { color: var(--ink-cyan); transform: rotate(0.6deg); }
#exhibit-c .marker-quote { color: var(--ink-yellow); transform: rotate(-0.8deg); }
#exhibit-d .marker-quote { color: var(--ink-pink);   transform: rotate(1.2deg); }

/* ---------------------------------------------------------------
   FIGURES / GEOMETRIC SVG
--------------------------------------------------------------- */
.exhibit-figure {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    position: relative;
}

.geo {
    width: 100%;
    max-width: 460px;
    aspect-ratio: 1 / 1;
    overflow: visible;
    display: block;
}

.geo line,
.geo polygon,
.geo circle,
.geo path {
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.stroke-pink   { stroke: var(--ink-pink); }
.stroke-cyan   { stroke: var(--ink-cyan); }
.stroke-yellow { stroke: var(--ink-yellow); }
.stroke-purple { stroke: var(--ink-purple); }

/* path-draw machinery: scoped to .geo */
.geo-draw {
    stroke-dasharray: 900;
    stroke-dashoffset: 900;
    transition: stroke-dashoffset 2.4s cubic-bezier(0.65, 0, 0.35, 1);
}

.circle-draw {
    stroke-dasharray: 1300;
    stroke-dashoffset: 1300;
}

.poly-draw {
    stroke-dasharray: 1100;
    stroke-dashoffset: 1100;
}

.tag-draw {
    stroke-dasharray: 1400;
    stroke-dashoffset: 1400;
    transition: stroke-dashoffset 3s ease-in-out;
}

.geo.in-view .geo-draw { stroke-dashoffset: 0; }

/* staggered draw order: lines (0ms), circles (800ms), polygons (1600ms) */
.geo.in-view .geo-lines .geo-draw { transition-delay: 0ms; }
.geo.in-view .geo-circles .geo-draw { transition-delay: 800ms; }
.geo.in-view .geo-tris .geo-draw { transition-delay: 1600ms; }
.geo.in-view .geo-shatter .geo-draw:nth-child(1) { transition-delay: 0ms; }
.geo.in-view .geo-shatter .geo-draw:nth-child(n+2) { transition-delay: 600ms; }
.geo.in-view .geo-shatter .poly-draw { transition-delay: 1400ms; }
.geo.in-view .geo-tag .tag-draw { transition-delay: 400ms; }

.figure-caption {
    margin-top: 4px;
}

.hidden {
    display: none;
}

/* ---------------------------------------------------------------
   VERDICT
--------------------------------------------------------------- */
.section-verdict {
    background: #1C1C1E;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: left;
    padding: 200px 0 220px 0;
    min-height: 100vh;
    max-width: 900px;
    margin-top: 80px;
}

.verdict-inner {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 2s ease-out, transform 2s ease-out;
    width: 100%;
}

.section-verdict.in-view .verdict-inner {
    opacity: 1;
    transform: translateY(0);
}

.verdict-line {
    font-family: var(--font-body);
    font-style: italic;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    line-height: 1.5;
    color: var(--ink-paper);
    letter-spacing: 0.005em;
    margin-bottom: 120px;
    max-width: 28ch;
}

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

/* ---------------------------------------------------------------
   Typewriter: before typing starts, hide until triggered
--------------------------------------------------------------- */
[data-typewriter] .twrap {
    display: inline;
}

[data-typewriter]:not(.typing):not(.typed) .twrap::before {
    content: "";
}

/* ---------------------------------------------------------------
   KEYFRAMES
--------------------------------------------------------------- */
@keyframes draw {
    to { stroke-dashoffset: 0; }
}

/* ---------------------------------------------------------------
   RESPONSIVE
--------------------------------------------------------------- */
@media (max-width: 1024px) {
    .docket-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .exhibit-row,
    .exhibit-row.reverse {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 320ms cubic-bezier(0.65, 0, 0.35, 1);
        width: 280px;
    }
    .sidebar.is-open {
        transform: translateX(0);
    }
    .mobile-bar {
        display: flex;
    }
    .main {
        margin-left: 0;
        padding: 72px 24px 40px 24px;
    }
    .section {
        padding: 90px 0 90px 0;
    }
    .section-exhibit.alt {
        margin-left: -24px;
        margin-right: -24px;
        padding-left: 24px;
        padding-right: 24px;
        max-width: none;
    }
    .docket-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    .scroll-hint {
        bottom: 24px;
    }
    .display-title {
        font-size: clamp(2.4rem, 12vw, 4.5rem);
    }
    .fracture {
        margin: 40px 0;
    }
}

@media (max-width: 480px) {
    .section-meta {
        margin-bottom: 28px;
    }
    .exhibit-title {
        font-size: clamp(1.8rem, 8vw, 2.6rem);
    }
    .marker-quote {
        font-size: 1.05rem;
    }
}
