/* ==========================================================================
   dherk.me — Design System & Custom Stylesheet
   Supports both Neural Deep (Dark) & Quantum Precision (Light) Modes
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');

/* --- Root & Light Theme Design Tokens --- */
:root {
  --surface-void: #f8fafc;
  --surface-abyssal: #ffffff;
  --surface-container-lowest: #ffffff;
  --surface-container-low: #f1f5f9;
  --surface-container: #f8fafc;
  --surface-container-high: #e2e8f0;
  --surface-container-highest: #cbd5e1;
  --surface-bright: #ffffff;

  --primary: #0284c7;
  --primary-container: #0284c7;
  --on-primary-container: #ffffff;

  --secondary: #4f46e5;
  --secondary-container: #4f46e5;
  --on-secondary: #ffffff;

  --tertiary: #059669;
  --tertiary-container: #059669;

  --accent-amber-infra: #d97706;
  --status-error-crimson: #e11d48;

  --text-ice-white: #0f172a;
  --text-ghost-slate: #475569;
  --text-muted-steel: #64748b;
  --on-surface: #1e293b;
  --on-surface-variant: #334155;

  --surface-glass: rgba(255, 255, 255, 0.92);
  --border-glass: rgba(226, 232, 240, 0.9);
  --border-glass-subtle: rgba(226, 232, 240, 0.6);

  --glow-primary: rgba(186, 230, 253, 0.45);
  --glow-secondary: rgba(199, 210, 254, 0.4);
  --grid-color: rgba(15, 23, 42, 0.035);
  --card-shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.06);
  --terminal-shadow: 0 20px 60px rgba(15, 23, 42, 0.2);
  --canvas-bg: #ffffff;
  --timeline-line: linear-gradient(to bottom, #0284c7, #4f46e5, #d97706);
}

/* --- Dark Theme Design Tokens --- */
html.dark {
  --surface-void: #03050a;
  --surface-abyssal: #070b14;
  --surface-container-lowest: #0b0e15;
  --surface-container-low: #181c22;
  --surface-container: #1c2026;
  --surface-container-high: #272a31;
  --surface-container-highest: #32353c;
  --surface-bright: #363940;

  --primary: #cdf7ff;
  --primary-container: #39e7ff;
  --on-primary-container: #00363d;

  --secondary: #d1bcff;
  --secondary-container: #561bb8;
  --on-secondary: #000000;

  --tertiary: #bcffd4;
  --tertiary-container: #51eea3;

  --accent-amber-infra: #ff9e3b;
  --status-error-crimson: #ff8c9c;

  --text-ice-white: #f4f8ff;
  --text-ghost-slate: #8995ad;
  --text-muted-steel: #56617a;
  --on-surface: #e0e2eb;
  --on-surface-variant: #bac9cc;

  --surface-glass: rgba(10, 17, 31, 0.85);
  --border-glass: rgba(255, 255, 255, 0.1);
  --border-glass-subtle: rgba(255, 255, 255, 0.06);

  --glow-primary: rgba(57, 231, 255, 0.1);
  --glow-secondary: rgba(86, 27, 184, 0.15);
  --grid-color: rgba(255, 255, 255, 0.015);
  --card-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  --terminal-shadow: 0 25px 70px rgba(0, 0, 0, 0.95);
  --canvas-bg: #070b14;
  --timeline-line: linear-gradient(to bottom, #39e7ff, #d1bcff, #ff9e3b);
}

/* --- Base Rules --- */
html, body {
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
  transition: background-color 0.25s ease, color 0.25s ease;
}

body {
  background-color: var(--surface-void);
  color: var(--on-surface);
  overscroll-behavior-y: none;
}

::-webkit-scrollbar {
  display: none;
}

/* Custom terminal scrollbar */
#ragChatLogs::-webkit-scrollbar,
#resumeModalBody::-webkit-scrollbar,
#dossierContent::-webkit-scrollbar {
  display: block;
  width: 5px;
}
#ragChatLogs::-webkit-scrollbar-track,
#resumeModalBody::-webkit-scrollbar-track,
#dossierContent::-webkit-scrollbar-track {
  background: transparent;
}
#ragChatLogs::-webkit-scrollbar-thumb,
#resumeModalBody::-webkit-scrollbar-thumb,
#dossierContent::-webkit-scrollbar-thumb {
  background: var(--surface-container-high);
  border-radius: 4px;
}
#ragChatLogs::-webkit-scrollbar-thumb:hover,
#resumeModalBody::-webkit-scrollbar-thumb:hover,
#dossierContent::-webkit-scrollbar-thumb:hover {
  background: var(--surface-container-highest);
}

/* Glass Panels */
.glass-panel {
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  box-shadow: var(--card-shadow);
}

.glass-panel-subtle {
  background: var(--surface-container-low);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass-subtle);
}

/* Creative Header Pill Navigation */
.nav-pill-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  border-radius: 0.75rem;
  font-size: 0.775rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  color: var(--on-surface-variant);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-pill-item:hover {
  color: var(--text-ice-white);
  background-color: var(--surface-container-low);
  transform: translateY(-1px);
}

.nav-pill-item.active {
  color: var(--on-primary-container);
  background-color: var(--primary-container);
  font-weight: 600;
  box-shadow: 0 2px 10px -1px var(--primary-container);
}

/* Timeline Custom Connector */
.timeline-stem::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  background: var(--timeline-line);
}
@media (min-width: 640px) {
  .timeline-stem::before {
    left: 20px;
  }
}

/* Ambient Background Grid */
.ambient-grid {
  background-size: 40px 40px;
  background-image: 
    linear-gradient(to right, var(--grid-color) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-color) 1px, transparent 1px);
}

/* Micro-animations */
@keyframes pulseGlow {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.04); }
}

.animate-glow {
  animation: pulseGlow 4s ease-in-out infinite;
}

/* Terminal Floating Launcher Pill with Highlighter Pulse */
.terminal-launcher-btn {
  background: #090d16 !important;
  color: #f8fafc !important;
  border: 1.5px solid rgba(56, 189, 248, 0.6) !important;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.4), 0 0 18px -2px rgba(56, 189, 248, 0.5) !important;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.terminal-launcher-btn:hover {
  transform: translateY(-3px) scale(1.02);
  border-color: #38bdf8 !important;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5), 0 0 25px rgba(56, 189, 248, 0.7) !important;
}
.terminal-launcher-btn:active {
  transform: translateY(0) scale(0.98);
}

/* Floating Terminal Console - Guaranteed High Contrast In Both Light & Dark Modes */
#floatingTerminalWidget {
  background: #090d16 !important;
  color: #f1f5f9 !important;
  border: 1px solid rgba(56, 189, 248, 0.45) !important;
  box-shadow: 0 25px 70px -10px rgba(0, 0, 0, 0.8), 0 0 25px rgba(2, 132, 199, 0.25) !important;
}

#floatingTerminalWidget .terminal-nav-header {
  background: #0f172a !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

#ragChatLogs {
  background: #04070e !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #e2e8f0 !important;
}

.terminal-prompt-box {
  background: #0e1626 !important;
  border: 1px solid rgba(56, 189, 248, 0.4) !important;
}

.terminal-prompt-box:focus-within {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.3) !important;
}

#ragQueryInput {
  color: #f8fafc !important;
  font-size: 13px !important;
  font-family: 'JetBrains Mono', monospace !important;
}
#ragQueryInput::placeholder {
  color: #94a3b8 !important;
}

.rag-chip {
  background: #111827 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #e2e8f0 !important;
  transition: all 0.15s ease !important;
}
.rag-chip:hover {
  background: #1e293b !important;
  border-color: #38bdf8 !important;
  color: #ffffff !important;
}

/* Interactive Topology Node Hover & Clickable Indicator */
.topology-node {
  cursor: pointer;
  transition: all 0.25s ease;
}
.topology-node:hover {
  transform: translateY(-2px);
  filter: drop-shadow(0 0 12px var(--primary-container));
}
.topology-node:active {
  transform: translateY(0);
}

/* Theme Toggle Button Spin/Scale */
.theme-toggle-btn {
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s ease, border-color 0.2s ease;
}
.theme-toggle-btn:hover {
  transform: scale(1.05);
}
.theme-toggle-btn:active {
  transform: scale(0.95);
}

/* Responsive Modal Animations */
@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.animate-modal-slide {
  animation: modalSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Skill Domain Cards & Tag Pills */
.skill-domain-card {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease, box-shadow 0.25s ease;
}
.skill-domain-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.2);
}
.skill-tag-pill {
  transition: all 0.15s ease;
}
.skill-tag-pill:hover {
  transform: scale(1.04);
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fadeIn {
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Printable Resume Styling for PDF Output */
@media print {
  body {
    background: #ffffff !important;
    color: #0f172a !important;
  }
  header, #floatingTerminalWidget, #floatingTerminalPill, #mobileMenuBtn, .fixed, button, canvas {
    display: none !important;
  }
  #resumeModal {
    display: block !important;
    position: static !important;
    background: #ffffff !important;
    padding: 0 !important;
    box-shadow: none !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  #resumeModalBody {
    max-height: none !important;
    overflow: visible !important;
  }
  .print-hide {
    display: none !important;
  }
}

/* ==========================================================================
   Obsidian High-Contrast Terminal & Synapse Shell Console
   Guarantees maximum visibility & contrast in BOTH Dark & Light modes
   ========================================================================== */
#floatingTerminalPill {
  background: #090e1a !important;
  color: #f8fafc !important;
  border: 1px solid rgba(56, 189, 248, 0.45) !important;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.6), 0 0 15px rgba(2, 132, 199, 0.25) !important;
}
#floatingTerminalPill:hover {
  border-color: #38bdf8 !important;
  box-shadow: 0 12px 35px -5px rgba(0, 0, 0, 0.8), 0 0 20px rgba(56, 189, 248, 0.4) !important;
  transform: translateY(-2px);
}

#floatingTerminalWidget {
  background: #070b14 !important;
  color: #f1f5f9 !important;
  border: 1px solid rgba(56, 189, 248, 0.3) !important;
  box-shadow: 0 25px 70px -10px rgba(0, 0, 0, 0.85), 0 0 30px rgba(2, 132, 199, 0.2) !important;
}

#floatingTerminalWidget .bg-surface-container-low\/80,
#floatingTerminalWidget .bg-surface-container-low {
  background: #0d1527 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

#ragChatLogs {
  background: #060912 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #e2e8f0 !important;
}

.terminal-prompt-box,
#floatingTerminalWidget .focus-within\:border-primary\/60 {
  background: #0d1527 !important;
  border: 1px solid rgba(56, 189, 248, 0.35) !important;
}

.terminal-prompt-box:focus-within,
#floatingTerminalWidget .focus-within\:border-primary\/60:focus-within {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25) !important;
}

#ragQueryInput {
  color: #ffffff !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 13px !important;
  font-weight: 500 !important;
}

#ragQueryInput::placeholder {
  color: #64748b !important;
}

.rag-chip {
  background: #0e172a !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #94a3b8 !important;
  transition: all 0.15s ease !important;
}

.rag-chip:hover {
  background: #1e293b !important;
  color: #38bdf8 !important;
  border-color: #38bdf8 !important;
  transform: translateY(-1px);
}

.rag-chip[data-cmd="github repos"],
.rag-chip[data-cmd="repos"] {
  color: #34d399 !important;
  border-color: rgba(52, 211, 153, 0.35) !important;
}

.rag-chip[data-cmd="cat resume"] {
  color: #38bdf8 !important;
  border-color: rgba(56, 189, 248, 0.35) !important;
}

.rag-chip[data-cmd="sysadmin"] {
  color: #fbbf24 !important;
  border-color: rgba(251, 191, 36, 0.35) !important;
}

#modeVisualView .bg-surface-container-low\/60 {
  background: #0d1527 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}


