/* ==========================================================================
   sarojparajuli.com.np — Master Stylesheet
   Designed for High Aesthetic Polish, Responsiveness & Universal Accessibility
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS Custom Properties & Theming (Dark / Light / High-Contrast RP)
   -------------------------------------------------------------------------- */
:root {
  --font-serif: 'Instrument Serif', 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Base Typography Scale */
  --base-font-size: 16px;

  /* Theme: Dark (Warm Espresso) */
  --bg-primary: #0e0c0b;
  --bg-secondary: #171412;
  --bg-card: #201b17;
  --bg-elevated: #2c2520;
  --text-primary: #f8f4ed;
  --text-secondary: #d1c7bc;
  --text-muted: #968c82;
  --accent: #d96b43;
  --accent-hover: #e07a5f;
  --accent-light: rgba(217, 107, 67, 0.15);
  --border: rgba(255, 255, 255, 0.1);
  --border-focus: #e07a5f;
  --glass-bg: rgba(14, 12, 11, 0.88);
  --tag-bg: #2a221c;
  --tag-text: #e07a5f;
}

/* Light Mode: Editorial Parchment */
html[data-theme="light"] {
  --bg-primary: #fcf9f4;
  --bg-secondary: #f4eee3;
  --bg-card: #ffffff;
  --bg-elevated: #eadecc;
  --text-primary: #1e1915;
  --text-secondary: #4a4037;
  --text-muted: #7d7063;
  --accent: #c05631;
  --accent-hover: #a64522;
  --accent-light: rgba(192, 86, 49, 0.12);
  --border: rgba(0, 0, 0, 0.08);
  --border-focus: #c05631;
  --glass-bg: rgba(252, 249, 244, 0.92);
  --tag-bg: #faede6;
  --tag-text: #c05631;
}

/* High-Contrast Accessible Mode (Specially tuned for Retinitis Pigmentosa) */
html[data-theme="contrast"] {
  --bg-primary: #000000;
  --bg-secondary: #0a0a0a;
  --bg-card: #121212;
  --bg-elevated: #1e1e1e;
  --text-primary: #ffffff;
  --text-secondary: #ffff55;
  --text-muted: #00ffff;
  --accent: #ffff00;
  --accent-hover: #ffffff;
  --accent-light: rgba(255, 255, 0, 0.25);
  --border: #ffff00;
  --border-focus: #00ffff;
  --glass-bg: #000000;
  --tag-bg: #1e1e00;
  --tag-text: #ffff00;
}

/* Font Size Scales */
html[data-font-size="large"] {
  --base-font-size: 18px;
}
html[data-font-size="xlarge"] {
  --base-font-size: 20px;
}

/* --------------------------------------------------------------------------
   2. Global Reset & Base Setup
   -------------------------------------------------------------------------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: var(--base-font-size);
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.65;
  transition: background-color 0.25s ease, color 0.25s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Typography Helpers */
.font-editorial {
  font-family: var(--font-serif);
}

.font-mono {
  font-family: var(--font-mono);
}

/* Skip link for screen-reader & keyboard users */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--accent);
  color: #fff;
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  border-radius: 0.5rem;
  z-index: 100;
  transition: top 0.2s ease;
  text-decoration: none;
}
.skip-link:focus {
  top: 1rem;
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus outline for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 3px;
}

/* Glassmorphism Surface */
.glass-surface {
  background-color: var(--glass-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-color: var(--border);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-elevated);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* --------------------------------------------------------------------------
   3. Equalizer Audio Visualizer Animation
   -------------------------------------------------------------------------- */
@keyframes eqPulse {
  0%, 100% {
    transform: scaleY(0.2);
  }
  50% {
    transform: scaleY(1);
  }
}

.eq-bar {
  animation: eqPulse 1s ease-in-out infinite;
  transform-origin: bottom;
  display: inline-block;
  width: 3px;
  background-color: var(--accent);
  border-radius: 2px;
}
.eq-bar:nth-child(1) { animation-delay: 0.0s; height: 16px; }
.eq-bar:nth-child(2) { animation-delay: 0.2s; height: 22px; }
.eq-bar:nth-child(3) { animation-delay: 0.4s; height: 14px; }
.eq-bar:nth-child(4) { animation-delay: 0.1s; height: 26px; }
.eq-bar:nth-child(5) { animation-delay: 0.3s; height: 18px; }

/* --------------------------------------------------------------------------
   4. CV Modal Styles
   -------------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-content {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   5. Toast Notification
   -------------------------------------------------------------------------- */
.toast-item {
  background-color: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--accent);
  padding: 0.85rem 1.25rem;
  border-radius: 0.75rem;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: slideInRight 0.25s ease-out;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
