:root {
    --bg-base: #FFFFFF;
    --bg-surface: #FAFAFA;
    --border-soft: #EFEFEF;
    --border-firm: #E0E0E0;
    
    --text-main: #111111;
    --text-muted: #666666;
    --text-light: #999999;
    
    --accent-blue: #2563EB; 
    --accent-blue-soft: #EFF6FF;
    --accent-amber: #F59E0B; 

    --font-heading: 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
    --shadow-md: 0 6px 16px rgba(0,0,0,0.03), 0 2px 4px rgba(0,0,0,0.02);
    --shadow-lg: 0 20px 40px rgba(0,0,0,0.06), 0 8px 16px rgba(0,0,0,0.04);
    
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
}

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

body {
    background-color: var(--bg-base); color: var(--text-main);
    font-family: var(--font-body); line-height: 1.6;
    -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

kbd {
    font-family: var(--font-mono);
    font-size: 0.7em;
    padding: 0.15rem 0.35rem;
    border: 1px solid var(--border-firm);
    border-radius: 4px;
    background: var(--bg-surface);
    color: var(--text-muted);
    box-shadow: 0 1px 1px rgba(0,0,0,0.05);
}

/* Cursor */
.cursor { position: fixed; width: 6px; height: 6px; border-radius: 50%; background-color: var(--text-main); pointer-events: none; z-index: 9999; transform: translate(-50%, -50%); transition: width 0.2s, height 0.2s, background-color 0.2s; }
.cursor-follower { position: fixed; width: 24px; height: 24px; border-radius: 50%; border: 1px solid rgba(0,0,0,0.2); pointer-events: none; z-index: 9998; transform: translate(-50%, -50%); transition: transform 0.1s ease-out, width 0.2s, height 0.2s, border-radius 0.2s; }
.cursor-follower.active { width: 40px; height: 40px; background: rgba(0,0,0,0.04); border: 1px solid rgba(0,0,0,0.1); }
.cursor-follower.magnetic-snap { border-radius: var(--radius-sm); border: 1px solid rgba(37, 99, 235, 0.4); background: rgba(37, 99, 235, 0.05); }
.cursor-follower.copy-intent { border: 1px solid #10B981; background: rgba(16, 185, 129, 0.05); }

/* Progress & Background */
.reading-progress-container { position: fixed; top: 0; left: 0; width: 100vw; height: 3px; z-index: 1000; background: transparent; }
.reading-progress-bar { height: 100%; width: 0%; background: var(--accent-blue); transition: width 0.1s linear; }

.grid-bg { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: -2; background-size: 40px 40px; background-image: linear-gradient(to right, var(--border-soft) 1px, transparent 1px), linear-gradient(to bottom, var(--border-soft) 1px, transparent 1px); mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0.2) 100%); -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0.2) 100%); }
.noise-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background-image: url('data:image/svg+xml;utf8,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noise"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noise)" opacity="0.03"/%3E%3C/svg%3E'); pointer-events: none; z-index: -1; }

/* Nav */
.nav-bar { position: fixed; top: 1.5rem; left: 50%; transform: translateX(-50%); background: rgba(255, 255, 255, 0.8); backdrop-filter: blur(16px); border: 1px solid var(--border-firm); border-radius: 100px; padding: 0.4rem 1.25rem; display: flex; justify-content: space-between; align-items: center; gap: 2rem; z-index: 100; box-shadow: var(--shadow-sm); }
.nav-brand { font-family: var(--font-heading); font-weight: 600; font-size: 0.9rem; color: var(--text-main); transition: opacity 0.2s;}
.nav-status { display: flex; align-items: center; gap: 0.6rem; font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted); }
.pulse-ring { width: 6px; height: 6px; background: var(--accent-amber); border-radius: 50%; box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); animation: amberPulse 2s infinite; }
@keyframes amberPulse { 0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); } 70% { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); } 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); } }
.separator { width: 1px; height: 12px; background: var(--border-firm); }
.mono-text { font-family: var(--font-mono); color: var(--text-main); font-weight: 500; }
.shortcut-btn { background: none; border: none; font-family: inherit; font-size: inherit; color: inherit; display:flex; align-items:center; gap:0.3rem; transition:color 0.2s; }
.shortcut-btn:hover { color: var(--text-main); }
@media (max-width: 600px) { .hidden-mobile, .shortcut-btn { display: none; } }

/* Layout & Elements */
.container { max-width: 900px; margin: 0 auto; padding: 9rem 2rem 4rem; position: relative; z-index: 10; }
.section { margin-bottom: 7rem; }
.section-badge { margin-bottom: 2.5rem; font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-light); letter-spacing: 0.05em; font-weight: 600; }
.clean-card { background: var(--bg-base); border: 1px solid var(--border-soft); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.hover-lift:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--border-firm); }

/* Tooltips */
.tooltip-trigger { position: relative; border-bottom: 1px dotted var(--text-light); transition: color 0.2s; }
.tooltip-trigger:hover { color: var(--accent-blue); border-bottom-color: var(--accent-blue); }

/* Hero */
.flex-col { display: flex; flex-direction: column; align-items: flex-start; }
.availability-badge { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.8rem; background: var(--bg-surface); border: 1px solid var(--border-soft); border-radius: 100px; font-size: 0.8rem; font-weight: 500; color: var(--text-muted); margin-bottom: 2rem; transition: border-color 0.2s, background 0.2s, color 0.2s; }
.availability-badge:hover { border-color: #10B981; background: rgba(16, 185, 129, 0.05); color: #059669; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #10B981; }
.hover-icon { opacity: 0; font-size: 0.9em; transform: translateX(-5px); transition: all 0.2s;}
.availability-badge:hover .hover-icon { opacity: 1; transform: translateX(0); }

.hero-title { font-family: var(--font-heading); font-size: clamp(2.5rem, 6vw, 4.2rem); font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; margin-bottom: 1.5rem; }
.bg-gradient-text { background: linear-gradient(135deg, var(--text-main), var(--text-muted)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero-desc { font-size: 1.25rem; line-height: 1.6; color: var(--text-main); font-weight: 500; }
.hero-desc .subtitle { display: block; font-size: 1.05rem; color: var(--text-muted); font-weight: 400; margin-top: 0.5rem; max-width: 600px; }

/* Timeline Filtering & Structure */
.flex-between { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 2.5rem; }
.mb-0 { margin-bottom: 0 !important; }
.filter-group { display: flex; gap: 0.5rem; padding: 0.25rem; background: var(--bg-surface); border: 1px solid var(--border-soft); border-radius: 100px; }
.filter-btn { padding: 0.25rem 0.75rem; border-radius: 100px; background: transparent; border: none; font-family: var(--font-body); font-size: 0.75rem; font-weight: 500; color: var(--text-muted); transition: all 0.2s; }
.filter-btn:hover { color: var(--text-main); }
.filter-btn.active { background: var(--bg-base); color: var(--text-main); box-shadow: var(--shadow-sm); border: 1px solid var(--border-firm); }

.timeline-wrapper { position: relative; padding-left: 2rem; }
.timeline { display: flex; flex-direction: column; gap: 3rem; }
.timeline-line { position: absolute; top: 0; bottom: 0; left: 0; width: 2px; background: var(--border-soft); border-radius: 2px; }
.timeline-progress { position: absolute; top: 0; left: 0; width: 100%; height: 0%; background: var(--text-main); border-radius: 2px; transition: height 0.1s linear; }

.tl-item { position: relative; transition: opacity 0.4s, transform 0.4s; }
.tl-item.filtered-out { opacity: 0; transform: scale(0.95); pointer-events: none; position: absolute; } /* Handled via JS logic layout */

.tl-item::before { content: ''; position: absolute; top: 2rem; left: -2rem; width: 10px; height: 10px; background: var(--bg-base); border: 2px solid var(--border-firm); border-radius: 50%; transform: translateX(-5px); transition: border-color 0.4s, background 0.4s; z-index: 1; }
.tl-item.tl-active::before { border-color: var(--text-main); background: var(--text-main); }
.tl-content { padding: 2rem; }
.tl-date { font-family: var(--font-mono); font-size: 0.75rem; font-weight: 600; color: var(--text-muted); margin-bottom: 0.75rem; display: inline-block; }
.tl-role { font-size: 1.25rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--text-main); }
.tl-org { color: var(--text-light); font-weight: 400; }
.tl-content p { color: var(--text-muted); font-size: 0.95rem; }
.network-matrix { margin-top: 1.5rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.matrix-tag { font-family: var(--font-mono); font-size: 0.7rem; padding: 0.25rem 0.6rem; background: var(--bg-surface); border: 1px solid var(--border-soft); border-radius: 4px; color: var(--text-muted); }

/* Arsenal & Dashboard */
.arsenal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.arsenal-card { display: flex; gap: 1rem; align-items: flex-start; padding: 1.5rem; }
.icon-block { font-size: 1.25rem; color: var(--text-light); margin-top: -2px; }
.content-block h4 { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.25rem; }
.content-block p { font-size: 0.85rem; color: var(--text-muted); }

.data-dashboard { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media(max-width: 768px) { .data-dashboard, .case-grid, .flex-between { flex-direction: column; align-items: flex-start; } .filter-group { margin-top: 1rem; flex-wrap: wrap; } .data-dashboard { grid-template-columns: 1fr; } }

.metric-card { padding: 1.5rem; }
.metric-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.metric-header h3 { font-size: 1rem; font-weight: 600; }
.cred-tag { font-family: var(--font-mono); font-size: 0.65rem; padding: 0.2rem 0.5rem; border-radius: 4px; background: var(--border-soft); font-weight: 600;}
.metric-card p { font-size: 0.85rem; color: var(--text-muted); }

.bg-mesh { background: linear-gradient(135deg, rgba(37,99,235,0.03) 0%, rgba(37,99,235,0.08) 100%); border: 1px solid rgba(37,99,235,0.1); grid-column: 1 / -1; }
.data-list { list-style: none; display: flex; flex-direction: column; gap: 0.75rem;}
.data-list li { font-size: 0.9rem; color: var(--text-main); display: flex; gap: 1rem; align-items:baseline; }
.data-key { font-family: var(--font-mono); font-weight: 600; color: var(--accent-blue); font-size: 0.75rem; width: 80px; flex-shrink:0;}

/* Dossiers & Network Graph */
.case-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.case-doc { display: flex; flex-direction: column; text-decoration: none; padding: 1.5rem; height: 100%; color: inherit; }
.doc-meta { margin-bottom: 1.5rem; display: flex; justify-content: space-between;}
.doc-id { font-family: var(--font-mono); font-size: 0.7rem; font-weight: 600; color: var(--text-light); }
.case-title { font-size: 1.15rem; font-weight: 600; margin-bottom: 0.5rem; }
.case-desc { font-size: 0.9rem; color: var(--text-muted); flex-grow: 1; margin-bottom: 1rem;}
.right { margin-left: auto; }
.case-doc:hover .hover-icon { opacity: 1; transform: translateX(0); }

.p-0 { padding: 0 !important; }
.overflow-hidden { overflow: hidden; }
.list-row { display: flex; align-items: center; gap: 1.5rem; padding: 1.25rem 1.5rem; text-decoration: none; color: inherit; border-bottom: 1px solid var(--border-soft); background: transparent; transition: background 0.2s; }
.list-row:last-child { border-bottom: none; }
.list-row:hover { background: var(--bg-surface); }
.row-num { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-light); }
.row-content h4 { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.25rem; }
.row-content p { font-size: 0.85rem; color: var(--text-muted); }
.row-icon { margin-left: auto; color: var(--text-light); font-size: 1.1rem; }
.list-row:hover .row-icon { color: var(--text-main); }

/* Footer */
.footer { padding-bottom: 2rem;}
.footer-grid { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 3rem; }
.footer-btn { padding: 1rem 2rem; background: var(--bg-base); border: 1px solid var(--border-firm); border-radius: 100px; text-decoration: none; color: var(--text-main); font-weight: 500; font-size: 0.95rem; transition: all 0.3s; display: flex; align-items: center; gap: 0.5rem;}
.footer-btn .hover-icon { transform: translateX(0); }
.footer-btn:hover { border-color: var(--text-main); }
.action-focus { background: var(--text-main); color: var(--bg-base); border-color: var(--text-main); }
.action-focus:hover { background: #333333; color: white;}
.footer-meta { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-light); text-align: center; }

/* Animation Utils */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.8s ease, transform 0.8s ease; }
.reveal.active { opacity: 1; transform: translateY(0); }
.stagger-item { opacity: 0; transform: translateY(15px); transition: opacity 0.6s ease, transform 0.6s ease; }
.stagger-item.visible { opacity: 1; transform: translateY(0); }
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }

/* Toast Notifications */
#toast-container { position: fixed; bottom: 2rem; right: 2rem; display: flex; flex-direction: column; gap: 0.5rem; z-index: 10000; pointer-events: none;}
.toast { background: var(--text-main); color: var(--bg-base); padding: 0.75rem 1.25rem; border-radius: var(--radius-sm); font-size: 0.85rem; font-weight: 500; box-shadow: var(--shadow-md); opacity: 0; transform: translateY(10px); transition: opacity 0.3s, transform 0.3s; }
.toast.show { opacity: 1; transform: translateY(0); }

/* Command Palette */
.cmd-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(255,255,255,0.7); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); z-index: 99999; display: flex; justify-content: center; align-items: flex-start; padding-top: 15vh; opacity: 0; transition: opacity 0.2s; }
.cmd-overlay.active { display: flex !important; opacity: 1 !important; }
.cmd-palette { width: 90%; max-width: 600px; box-shadow: var(--shadow-lg); border: 1px solid var(--border-firm); overflow: hidden; display: flex; flex-direction: column; transform: scale(0.95); transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);}
.cmd-overlay.active .cmd-palette { transform: scale(1); }
.cmd-header { padding: 1rem 1.5rem; border-bottom: 1px solid var(--border-soft); }
.cmd-input { width: 100%; border: none; background: transparent; font-family: var(--font-body); font-size: 1.1rem; color: var(--text-main); outline: none; }
.cmd-input::placeholder { color: var(--text-light); }
.cmd-body { max-height: 350px; overflow-y: auto; padding: 0.5rem; }
.cmd-item { display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 1rem; border-radius: var(--radius-sm);  color: var(--text-main); transition: background 0.1s; font-size: 0.95rem; }
.cmd-item.active-cmd, .cmd-item:hover { background: var(--bg-surface);  }
.cmd-item span.cmd-desc { font-size: 0.8rem; color: var(--text-muted); font-family: var(--font-mono);}
.cmd-footer { padding: 0.75rem 1.5rem; background: var(--bg-surface); border-top: 1px solid var(--border-soft); display: flex; gap: 1.5rem; font-size: 0.75rem; color: var(--text-muted); }
.cmd-empty { padding: 2rem; text-align: center; color: var(--text-muted); font-size: 0.9rem;}
