/* ============================================
   localcop.dev - Precinct Office Stylesheet
   Skeuomorphic Civic Realism
   ============================================ */

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

html {
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
}

body {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    line-height: 1.72;
    color: #3A3A3A;
    background-color: #5C4033;
    overflow-y: hidden;
    height: 100vh;
    width: 100vw;
}

/* --- Color Variables --- */
:root {
    --filing-cream: #F5ECD7;
    --cork-board: #C4A265;
    --midnight-ink: #1B1F3B;
    --carbon-copy: #3A3A3A;
    --badge-brass: #B8860B;
    --banker-lamp: #2E5E4E;
    --stamp-red: #8B2500;
    --faded-typewriter: #6B6B7B;
    --evidence-tape: #DAA520;
    --oak-desk: #5C4033;
    --cork-dark: #B8944F;
    --cork-light: #D4B275;
    --pin-red: #C0392B;
    --pin-yellow: #F1C40F;
    --pin-blue: #2980B9;
    --pin-green: #27AE60;
}

/* --- Cork Texture Background --- */
.cork-texture {
    background-color: var(--cork-board);
    background-image:
        radial-gradient(circle, var(--cork-dark) 1px, transparent 1px),
        radial-gradient(circle, var(--cork-light) 1px, transparent 1px);
    background-size: 347px 251px, 193px 167px;
    background-position: 0 0, 100px 80px;
}

/* --- Diagonal Rule Lines (z-pattern reinforcement) --- */
.panel-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        14deg,
        transparent,
        transparent 120px,
        rgba(90, 64, 51, 0.06) 120px,
        rgba(90, 64, 51, 0.06) 121px
    );
    pointer-events: none;
    z-index: 0;
}

/* ============================================
   Filing Cabinet Navigation
   ============================================ */
#filing-cabinet {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.drawer-label {
    width: 36px;
    height: 84px;
    background: linear-gradient(135deg, #C8A84E, #A08030);
    border: 2px solid var(--oak-desk);
    border-left: none;
    border-radius: 0 4px 4px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
    position: relative;
    padding: 4px 2px;
}

.drawer-label::before {
    content: '';
    position: absolute;
    inset: 3px;
    border: 1px solid rgba(184, 134, 11, 0.5);
    border-radius: 0 2px 2px 0;
    pointer-events: none;
}

.drawer-label:hover {
    transform: translateX(4px);
    box-shadow: 4px 0 12px rgba(218, 165, 32, 0.4);
}

.drawer-label.active {
    box-shadow: 4px 0 16px rgba(218, 165, 32, 0.6);
    background: linear-gradient(135deg, #DAA520, #B8860B);
}

.drawer-text {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-family: 'Special Elite', cursive;
    font-size: 11px;
    color: var(--oak-desk);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.drawer-label.active .drawer-text {
    color: #1B1F3B;
}

.mini-badge {
    margin-top: 4px;
}

/* ============================================
   Horizontal Scroll Container
   ============================================ */
#evidence-board {
    display: flex;
    height: 100vh;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

#evidence-board::-webkit-scrollbar {
    display: none;
}

/* ============================================
   Panels
   ============================================ */
.panel {
    min-width: 85vw;
    height: 100vh;
    flex-shrink: 0;
    scroll-snap-align: start;
    padding: 24px 48px 48px 56px;
    position: relative;
}

.panel:first-child {
    padding-left: 64px;
}

.panel-inner {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 2px;
    padding: 40px 48px;
    box-shadow:
        0 2px 8px rgba(0,0,0,0.15),
        inset 0 1px 0 rgba(255,255,255,0.1);
    overflow: hidden;
}

/* ============================================
   Case File (Manila Folder)
   ============================================ */
.case-file {
    position: relative;
    background-color: var(--filing-cream);
    border: 1px solid rgba(92, 64, 51, 0.3);
    box-shadow:
        inset 0 1px 3px rgba(0,0,0,0.08),
        2px 3px 8px rgba(0,0,0,0.12);
    padding: 48px 40px 36px;
    max-width: 680px;
    max-height: calc(100vh - 160px);
    overflow-y: auto;
    z-index: 1;
}

.case-file::-webkit-scrollbar {
    width: 6px;
}

.case-file::-webkit-scrollbar-track {
    background: var(--filing-cream);
}

.case-file::-webkit-scrollbar-thumb {
    background: var(--cork-dark);
    border-radius: 3px;
}

/* Folder Tab */
.folder-tab {
    position: absolute;
    top: -24px;
    left: 20px;
    background-color: var(--filing-cream);
    border: 1px solid rgba(92, 64, 51, 0.3);
    border-bottom: 1px solid var(--filing-cream);
    padding: 4px 20px;
    font-family: 'Special Elite', cursive;
    font-size: 13px;
    color: var(--faded-typewriter);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    z-index: 2;
}

/* ============================================
   Typography
   ============================================ */
.site-title {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--midnight-ink);
    margin-bottom: 8px;
    display: inline;
}

.typewriter-cursor {
    display: inline-block;
    width: 3px;
    height: clamp(1.8rem, 4vw, 3.2rem);
    background-color: var(--midnight-ink);
    vertical-align: bottom;
    margin-left: 2px;
    animation: blink 1.06s step-end infinite;
}

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

.subtitle {
    font-family: 'Special Elite', cursive;
    font-size: 15px;
    color: var(--faded-typewriter);
    margin-top: 12px;
    margin-bottom: 20px;
    letter-spacing: 0.03em;
}

.section-heading {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--midnight-ink);
    margin-bottom: 16px;
}

.body-text {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    line-height: 1.72;
    color: var(--carbon-copy);
    margin-bottom: 16px;
}

/* ============================================
   Carbon Copy Lines
   ============================================ */
.carbon-line {
    border: none;
    height: 0;
    border-top: 1px solid rgba(58, 58, 58, 0.3);
    border-bottom: 1px solid rgba(58, 58, 58, 0.15);
    margin: 16px 0;
    position: relative;
}

.carbon-line::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 0;
    right: 0;
    border-top: 1px solid rgba(58, 58, 58, 0.15);
}

/* ============================================
   Badge Emblem
   ============================================ */
.badge-large {
    text-align: center;
    margin-bottom: 24px;
}

.badge-medium {
    text-align: center;
    margin-bottom: 16px;
}

/* ============================================
   Stamp Overlay
   ============================================ */
.stamp-overlay {
    position: absolute;
    top: 40px;
    right: 32px;
    transform: rotate(-4deg);
    border: 3px solid rgba(139, 37, 0, 0.7);
    border-radius: 8px;
    padding: 6px 18px;
    pointer-events: none;
    filter: url(#roughen);
    opacity: 0;
    z-index: 5;
}

.stamp-overlay span {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(139, 37, 0, 0.7);
}

.stamp-overlay.stamp-animate {
    animation: stampLand 150ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes stampLand {
    0% {
        opacity: 0;
        transform: rotate(-4deg) scale(1.3);
    }
    100% {
        opacity: 1;
        transform: rotate(-4deg) scale(1.0);
    }
}

.stamp-filed {
    transform: rotate(-2deg);
    border-width: 4px;
}

.stamp-filed span {
    font-size: 28px;
    letter-spacing: 0.2em;
}

@keyframes stampFiledLand {
    0% {
        opacity: 0;
        transform: rotate(-2deg) scale(1.3);
    }
    100% {
        opacity: 1;
        transform: rotate(-2deg) scale(1.0);
    }
}

.stamp-filed.stamp-animate {
    animation: stampFiledLand 150ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Screen shake */
@keyframes screenShake {
    0% { transform: translate(0, 0); }
    25% { transform: translate(2px, -1px); }
    50% { transform: translate(-1px, 2px); }
    75% { transform: translate(-2px, -1px); }
    100% { transform: translate(0, 0); }
}

body.shaking {
    animation: screenShake 50ms ease-in-out;
}

/* ============================================
   Pinned Notes
   ============================================ */
.pinned-note {
    position: absolute;
    top: var(--note-top, 10%);
    right: var(--note-right, 5%);
    width: 180px;
    background-color: #FFF9C4;
    padding: 24px 14px 14px;
    transform: rotate(var(--rotation, 0deg));
    box-shadow: 2px 3px 8px rgba(0,0,0,0.15);
    z-index: 10;
}

.pushpin {
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #E8E8E8, #A0A0A0, #707070);
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.pushpin::before {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 2px solid transparent;
    border-right: 2px solid transparent;
    border-top: 5px solid var(--pin-color, #C0392B);
}

.note-text {
    font-family: 'Special Elite', cursive;
    font-size: 13px;
    color: var(--carbon-copy);
    line-height: 1.5;
    margin-bottom: 8px;
}

/* ============================================
   Evidence Tags
   ============================================ */
.evidence-tag {
    display: block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--stamp-red);
    letter-spacing: 0.08em;
    margin-top: 8px;
    position: relative;
    padding-left: 16px;
}

.tag-hole {
    position: absolute;
    left: 0;
    top: 2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1px solid var(--faded-typewriter);
    background: rgba(255,255,255,0.5);
}

.tag-string {
    position: absolute;
    left: 4px;
    top: 10px;
    width: 1px;
    height: 12px;
    background: var(--faded-typewriter);
    transform: rotate(15deg);
    transform-origin: top;
}

/* ============================================
   Redacted Strips
   ============================================ */
.redacted-strip {
    margin: 20px 0;
    padding: 12px 16px;
    background-color: rgba(245, 236, 215, 0.5);
    border-left: 3px solid var(--faded-typewriter);
}

.redacted-text {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 14px;
    line-height: 1.8;
    color: var(--carbon-copy);
}

.redaction-bar {
    background: #0A0A0A;
    color: #0A0A0A;
    display: inline;
    padding: 2px 4px;
    user-select: none;
}

/* ============================================
   Incident Entries
   ============================================ */
.incident-entry {
    margin-bottom: 8px;
}

.incident-id {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 13px;
    letter-spacing: 0.08em;
    color: var(--stamp-red);
    display: inline-block;
    margin-right: 12px;
}

.incident-time {
    font-family: 'Special Elite', cursive;
    font-size: 13px;
    color: var(--faded-typewriter);
}

/* ============================================
   Evidence Grid
   ============================================ */
.evidence-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
}

.evidence-item {
    background-color: rgba(245, 236, 215, 0.6);
    border: 1px solid rgba(92, 64, 51, 0.2);
    padding: 14px 18px;
    position: relative;
}

.evidence-item-id {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 13px;
    letter-spacing: 0.08em;
    color: var(--stamp-red);
    display: block;
    margin-bottom: 4px;
}

.evidence-item-status {
    font-family: 'Special Elite', cursive;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 2px 8px;
    border: 1px solid;
    display: inline-block;
    margin-bottom: 8px;
}

.status-secured {
    color: var(--banker-lamp);
    border-color: var(--banker-lamp);
}

.status-processing {
    color: var(--evidence-tape);
    border-color: var(--evidence-tape);
}

.status-released {
    color: var(--faded-typewriter);
    border-color: var(--faded-typewriter);
}

.evidence-item-desc {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--carbon-copy);
}

/* ============================================
   Archive List
   ============================================ */
.archive-list {
    margin-top: 16px;
}

.archive-entry {
    display: flex;
    gap: 16px;
    align-items: baseline;
    padding: 8px 0;
    border-bottom: 1px solid rgba(58, 58, 58, 0.15);
}

.archive-entry:last-child {
    border-bottom: none;
}

.archive-year {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 14px;
    letter-spacing: 0.08em;
    color: var(--badge-brass);
    flex-shrink: 0;
    min-width: 50px;
}

.archive-desc {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--carbon-copy);
}

/* ============================================
   Filing Complete Block
   ============================================ */
.filing-complete-block {
    text-align: center;
    margin-top: 32px;
    padding: 24px;
}

.filed-notice {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: 16px;
    color: var(--midnight-ink);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-top: 12px;
}

.filed-timestamp {
    display: block;
    font-family: 'Special Elite', cursive;
    font-size: 14px;
    color: var(--faded-typewriter);
    margin-top: 8px;
}

/* ============================================
   Ruler Progress Indicator
   ============================================ */
#ruler-progress {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 28px;
    background-color: var(--filing-cream);
    border-top: 2px solid var(--oak-desk);
    z-index: 999;
    padding: 0 56px 0 48px;
}

.ruler-track {
    position: relative;
    width: 100%;
    height: 100%;
}

.ruler-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background-color: rgba(218, 165, 32, 0.25);
    transition: width 0.15s ease;
}

.ruler-markings {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
}

.ruler-mark {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Special Elite', cursive;
    font-size: 10px;
    color: var(--faded-typewriter);
}

.ruler-mark::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 6px;
    background-color: var(--oak-desk);
}

.ruler-ticks {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
}

/* ============================================
   Panel Content Entrance Animations
   ============================================ */
.case-file,
.pinned-note {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.panel.in-view .folder-tab {
    opacity: 1;
}

.panel.in-view .case-file {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0ms;
}

.panel.in-view .pinned-note {
    opacity: 1;
    transform: translateY(0) rotate(var(--rotation, 0deg));
    transition-delay: 300ms;
}

/* ============================================
   Stagger delays for content elements
   ============================================ */
.case-file-content > * {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.panel.in-view .case-file-content > *:nth-child(1) { opacity: 1; transform: translateY(0); transition-delay: 100ms; }
.panel.in-view .case-file-content > *:nth-child(2) { opacity: 1; transform: translateY(0); transition-delay: 150ms; }
.panel.in-view .case-file-content > *:nth-child(3) { opacity: 1; transform: translateY(0); transition-delay: 200ms; }
.panel.in-view .case-file-content > *:nth-child(4) { opacity: 1; transform: translateY(0); transition-delay: 250ms; }
.panel.in-view .case-file-content > *:nth-child(5) { opacity: 1; transform: translateY(0); transition-delay: 300ms; }
.panel.in-view .case-file-content > *:nth-child(6) { opacity: 1; transform: translateY(0); transition-delay: 350ms; }
.panel.in-view .case-file-content > *:nth-child(7) { opacity: 1; transform: translateY(0); transition-delay: 400ms; }
.panel.in-view .case-file-content > *:nth-child(8) { opacity: 1; transform: translateY(0); transition-delay: 450ms; }
.panel.in-view .case-file-content > *:nth-child(9) { opacity: 1; transform: translateY(0); transition-delay: 500ms; }
.panel.in-view .case-file-content > *:nth-child(10) { opacity: 1; transform: translateY(0); transition-delay: 550ms; }
.panel.in-view .case-file-content > *:nth-child(11) { opacity: 1; transform: translateY(0); transition-delay: 600ms; }
.panel.in-view .case-file-content > *:nth-child(12) { opacity: 1; transform: translateY(0); transition-delay: 650ms; }

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 768px) {
    .panel {
        min-width: 95vw;
        padding: 16px 20px 40px 48px;
    }

    .panel-inner {
        padding: 24px 20px;
    }

    .case-file {
        padding: 36px 20px 24px;
        max-width: 100%;
    }

    .pinned-note {
        display: none;
    }

    #filing-cabinet {
        top: auto;
        bottom: 32px;
        transform: none;
    }

    .drawer-label {
        height: 60px;
        width: 30px;
    }

    .drawer-text {
        font-size: 9px;
    }
}
