/* ============================================================
   gabs.review - Judicial Scholarship Design System
   ============================================================ */

/* --- CSS Custom Properties --- */
:root {
    --vellum-cream: #F4EDE4;
    --parchment-tan: #E8DDD0;
    --ink-wash: #2B231B;
    --bench-oak: #1C1410;
    --seal-gold: #8B6914;
    --aged-brass: #A89070;
    --ledger-line: #C4B49A;
    --barrister-green: #3D6B4E;
    --docket-width: 12vw;
    --content-max: 680px;
    --content-gap: 48px;
    --section-spacing: 160px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--vellum-cream);
    color: var(--ink-wash);
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.85;
    overflow-x: hidden;
    position: relative;
}

/* --- Paper Grain Overlay --- */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.03;
    filter: url(#paperGrain);
    background: var(--vellum-cream);
}

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

/* ============================================================
   HERO SECTION - The Seal (0-100vh)
   ============================================================ */
.hero-section {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.hero-seal {
    position: relative;
    opacity: 0;
    animation: sealFadeIn 2s ease-in-out 0.6s forwards;
}

.seal-large .seal-ring-outer {
    stroke-dasharray: 604;
    stroke-dashoffset: 604;
    animation: drawRing 1.5s ease-out 0.6s forwards;
}

.seal-large .seal-ring-inner {
    stroke-dasharray: 553;
    stroke-dashoffset: 553;
    animation: drawRing 1s ease-out 1.1s forwards;
}

.seal-large .seal-monogram {
    opacity: 0;
    animation: monogramFadeIn 0.8s ease-in-out 2s forwards;
}

@keyframes sealFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes drawRing {
    to { stroke-dashoffset: 0; }
}

@keyframes monogramFadeIn {
    from { opacity: 0; }
    to { opacity: 0.5; }
}

/* Wax Drip Texture */
.wax-drip {
    position: absolute;
    top: -12px;
    right: -8px;
    width: 24px;
    height: 18px;
    border-radius: 50% 40% 60% 30% / 50% 40% 60% 50%;
    background: var(--seal-gold);
    opacity: 0.15;
    box-shadow:
        2px 3px 6px rgba(139, 105, 20, 0.1),
        -1px 2px 4px rgba(139, 105, 20, 0.08);
}

/* Hero Title */
.hero-title {
    font-family: 'Cinzel', serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.15em;
    color: var(--seal-gold);
    margin-top: 32px;
    opacity: 0;
    animation: titleFadeIn 1s ease-in-out 2.5s forwards;
}

@keyframes titleFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ============================================================
   MARGIN RULE
   ============================================================ */
.margin-rule {
    position: absolute;
    top: 100vh;
    left: var(--docket-width);
    width: 1px;
    height: 0;
    background-color: var(--ledger-line);
    opacity: 0.25;
    z-index: 2;
    pointer-events: none;
}

/* ============================================================
   DOCKET STRIP (left 12%)
   ============================================================ */
.docket-strip {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--docket-width);
    height: 100vh;
    z-index: 10;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.6s ease-out;
}

.docket-strip.visible {
    opacity: 1;
}

.docket-label {
    position: absolute;
    left: 50%;
    transform: translateX(-50%) rotate(-90deg);
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.15em;
    color: var(--aged-brass);
    opacity: 0.6;
    white-space: nowrap;
    transition: opacity 0.4s ease-out;
}

.docket-label.active {
    opacity: 1;
    color: var(--seal-gold);
}

/* ============================================================
   RULINGS CONTAINER
   ============================================================ */
.rulings-container {
    position: relative;
    padding-left: calc(var(--docket-width) + var(--content-gap));
    padding-right: 24px;
    padding-top: 20vh;
    padding-bottom: 300px;
    z-index: 1;
}

/* ============================================================
   RULING SECTIONS
   ============================================================ */
.ruling {
    max-width: var(--content-max);
    margin-bottom: var(--section-spacing);
    position: relative;
}

/* Tick marks on margin rule */
.ruling::before {
    content: '';
    position: absolute;
    left: calc(-1 * var(--content-gap));
    top: 0;
    width: 16px;
    height: 1px;
    background-color: var(--ledger-line);
    opacity: 0.4;
}

/* Horizontal Rule */
.ruling-hr {
    width: 100%;
    height: 1px;
    background-color: var(--aged-brass);
    opacity: 0.3;
    margin-bottom: 24px;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.6s ease-out;
}

.ruling.revealed .ruling-hr {
    transform: scaleX(1);
}

/* Section Header */
.ruling-header {
    font-family: 'Libre Baskerville', serif;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--bench-oak);
    margin-bottom: 12px;
    opacity: 0;
    transform: translateX(-24px);
    transition: opacity 0.6s ease-out 0.15s, transform 0.6s ease-out 0.15s;
}

.ruling.revealed .ruling-header {
    opacity: 1;
    transform: translateX(0);
}

/* Meta / Date Line */
.ruling-meta {
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.08em;
    color: var(--aged-brass);
    margin-bottom: 32px;
    display: flex;
    gap: 24px;
    opacity: 0;
    transform: translateX(-24px);
    transition: opacity 0.6s ease-out 0.3s, transform 0.6s ease-out 0.3s;
}

.ruling.revealed .ruling-meta {
    opacity: 1;
    transform: translateX(0);
}

/* Body Text */
.ruling-body {
    opacity: 0;
    transform: translateX(-24px);
    transition: opacity 0.6s ease-out 0.45s, transform 0.6s ease-out 0.45s;
}

.ruling.revealed .ruling-body {
    opacity: 1;
    transform: translateX(0);
}

.ruling-body p {
    margin-bottom: 24px;
}

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

/* Disposition Line */
.ruling-disposition {
    margin-top: 40px;
    padding-left: 24px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    opacity: 0;
    transition: opacity 0.6s ease-out 0.6s;
}

.ruling.revealed .ruling-disposition {
    opacity: 1;
}

.disposition-dash {
    display: inline-block;
    width: 24px;
    height: 1px;
    background-color: var(--aged-brass);
    margin-top: 14px;
    flex-shrink: 0;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease-out 0.7s;
}

.ruling.revealed .disposition-dash {
    transform: scaleX(1);
}

.ruling-disposition em {
    font-family: 'Source Serif 4', Georgia, serif;
    font-style: italic;
    font-weight: 400;
    color: var(--ink-wash);
    opacity: 0;
    transition: opacity 0.6s ease-in-out 0.9s;
}

.ruling.revealed .ruling-disposition em {
    opacity: 1;
}

/* ============================================================
   GAVEL STRIKE
   ============================================================ */
.gavel-strike {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    margin-top: 48px;
    opacity: 0;
    transition: opacity 0.6s ease-out 1s;
}

.ruling.revealed .gavel-strike {
    opacity: 1;
}

.gavel-line {
    height: 2px;
    background-color: var(--aged-brass);
    opacity: 0.4;
}

.gavel-line-1 { width: 24px; }
.gavel-line-2 { width: 16px; }
.gavel-line-3 { width: 8px; }

/* ============================================================
   SECTION SEAL SEPARATOR
   ============================================================ */
.section-seal {
    display: flex;
    justify-content: center;
    align-items: center;
    height: var(--section-spacing);
    position: relative;
}

.seal-small {
    opacity: 0.5;
    transition: opacity 0.6s ease-out;
}

.section-seal.scrolled-past .seal-small {
    opacity: 0.3;
}

/* ============================================================
   FINIS SECTION
   ============================================================ */
.finis-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-top: 200px;
    position: relative;
    padding-left: 0;
}

.finis-tick {
    width: 16px;
    height: 1px;
    background-color: var(--aged-brass);
    opacity: 0.4;
    margin-bottom: 12px;
    position: relative;
    left: calc(-1 * var(--content-gap));
}

.finis-text {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.2em;
    color: var(--aged-brass);
    opacity: 0.4;
}

/* ============================================================
   RESPONSIVE - Mobile (< 768px)
   ============================================================ */
@media (max-width: 768px) {
    :root {
        --docket-width: 0px;
        --content-gap: 0px;
    }

    body {
        font-size: 16px;
    }

    .docket-strip {
        display: none;
    }

    .margin-rule {
        display: none;
    }

    .rulings-container {
        padding-left: 24px;
        padding-right: 24px;
        border-left: 4px solid var(--bench-oak);
    }

    .ruling {
        max-width: 100%;
    }

    .ruling::before {
        display: none;
    }

    .ruling-header {
        font-size: 22px;
    }

    .finis-tick {
        left: 0;
    }

    .hero-seal .seal-svg {
        width: 140px;
        height: 140px;
    }
}

/* ============================================================
   LINK STYLES (Barrister Green for positive indicators)
   ============================================================ */
a {
    color: var(--barrister-green);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease-out;
}

a:hover {
    border-bottom-color: var(--barrister-green);
}

/* ============================================================
   SELECTION STYLES
   ============================================================ */
::selection {
    background-color: var(--parchment-tan);
    color: var(--bench-oak);
}
