:root {
  --bg-primary: #0b0f17;
  --bg-secondary: #121824;
  --bg-tertiary: #182234;
  --bg-card: rgba(18, 24, 36, 0.85);
  --bg-card-hover: rgba(24, 34, 52, 0.95);
  --border-color: #212d45;
  --border-focus: #58a6ff;
  
  --text-primary: #f0f6fc;
  --text-secondary: #9aa5b5;
  --text-muted: #6e7681;
  
  --accent-blue: #58a6ff;
  --accent-purple: #bc8cff;
  --accent-cyan: #39c5bb;
  --accent-orange: #ff7043;
  --accent-amber: #d29922;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;

  --max-width: 1040px;
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 50% 0%, #161f30 0%, #0b0f17 50%, #070a0f 100%);
  background-attachment: fixed;
}

a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: #79c0ff;
  text-decoration: underline;
}

/* ==========================================================================
   Navigation Bar
   ========================================================================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 15, 23, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.brand-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  background: linear-gradient(135deg, rgba(88, 166, 255, 0.2), rgba(188, 140, 255, 0.2));
  border: 1px solid rgba(188, 140, 255, 0.4);
  color: var(--accent-purple);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Language Switcher Toggle */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  background: rgba(18, 24, 36, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 0.15rem 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  gap: 0.15rem;
}

.lang-opt {
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  color: var(--text-muted) !important;
  text-decoration: none !important;
  transition: all 0.2s ease;
}

.lang-opt:hover {
  color: #fff !important;
  text-decoration: none !important;
}

.lang-opt.active {
  background: linear-gradient(135deg, rgba(88, 166, 255, 0.25), rgba(57, 197, 187, 0.25));
  color: var(--accent-cyan) !important;
  font-weight: 800;
  cursor: default;
}

.lang-divider {
  color: rgba(255, 255, 255, 0.2);
  font-weight: 400;
  font-size: 0.65rem;
  user-select: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--text-primary);
  text-decoration: none;
}

.btn-cv {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.95rem;
  border-radius: 6px;
  background: rgba(88, 166, 255, 0.12);
  border: 1px solid rgba(88, 166, 255, 0.35);
  color: var(--accent-blue) !important;
  font-weight: 600;
  font-size: 0.85rem;
  transition: var(--transition);
}

.btn-cv:hover {
  background: var(--accent-blue);
  color: #0b0f17 !important;
  border-color: var(--accent-blue);
  box-shadow: 0 0 16px rgba(88, 166, 255, 0.4);
  text-decoration: none !important;
}

/* ==========================================================================
   Container & Layout
   ========================================================================== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
  width: 100%;
}

section {
  margin-bottom: 4.5rem;
}

.section-header {
  margin-bottom: 2rem;
  position: relative;
}

.section-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  display: block;
  margin-bottom: 0.3rem;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-color);
  margin-left: 0.5rem;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
  padding: 2.5rem 0 3.5rem;
}

.hero-header {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-orange);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-orange);
  box-shadow: 0 0 8px var(--accent-orange);
  display: inline-block;
}

.hero-title {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.04em;
  color: #ffffff;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  font-weight: 400;
  max-width: 780px;
  line-height: 1.5;
}

.hero-subtitle strong {
  color: var(--text-primary);
  font-weight: 600;
}

.hero-social-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.pill-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: var(--transition);
}

.pill-link:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-focus);
  color: var(--text-primary);
  text-decoration: none;
  transform: translateY(-1px);
}

.pill-link svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* ==========================================================================
   Haunted Labs Banner
   ========================================================================== */
.haunted-labs-card {
  position: relative;
  background: linear-gradient(135deg, rgba(24, 34, 52, 0.9) 0%, rgba(28, 20, 48, 0.8) 100%);
  border: 1px solid rgba(188, 140, 255, 0.35);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 24px rgba(188, 140, 255, 0.1);
  overflow: hidden;
  margin-bottom: 2rem;
}

.haunted-labs-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple), var(--accent-blue));
}

.hl-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.hl-brand-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-purple);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.haunted-labs-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.haunted-labs-desc {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.6;
  max-width: 820px;
  margin-bottom: 1.5rem;
}

.hl-pillars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.hl-pillar-item {
  background: rgba(11, 15, 23, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 1rem 1.15rem;
}

.hl-pillar-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-cyan);
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.hl-pillar-text {
  font-size: 0.825rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* ==========================================================================
   Project Showcase Cards
   ========================================================================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(440px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
  position: relative;
}

.project-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-blue);
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4), 0 0 16px rgba(88, 166, 255, 0.15);
}

.project-meta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.project-category {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-purple);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.project-status-pill {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  background: rgba(255, 112, 67, 0.15);
  border: 1px solid rgba(255, 112, 67, 0.4);
  color: var(--accent-orange);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-weight: 600;
}

.project-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.project-description {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 1.25rem;
}

.project-metrics {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.metric-pill {
  background: rgba(11, 15, 23, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.35rem 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.775rem;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.5rem;
}

.tech-tag {
  background: rgba(88, 166, 255, 0.08);
  border: 1px solid rgba(88, 166, 255, 0.2);
  color: #a5d6ff;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.project-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  background: var(--accent-blue);
  color: #0b0f17 !important;
  font-weight: 600;
  font-size: 0.85rem;
  transition: var(--transition);
}

.btn-primary:hover {
  background: #79c0ff;
  text-decoration: none !important;
  box-shadow: 0 0 12px rgba(88, 166, 255, 0.35);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary) !important;
  font-weight: 500;
  font-size: 0.85rem;
  transition: var(--transition);
}

.btn-secondary:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary) !important;
  text-decoration: none !important;
}

/* ==========================================================================
   Experience Timeline
   ========================================================================== */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 7px;
  width: 2px;
  background: var(--border-color);
}

.timeline-item {
  position: relative;
  margin-bottom: 2.75rem;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-marker {
  position: absolute;
  left: -2rem;
  top: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 3px solid var(--accent-blue);
  box-shadow: 0 0 0 4px rgba(88, 166, 255, 0.15);
}

.timeline-header {
  margin-bottom: 0.75rem;
}

.timeline-role {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}

.timeline-company {
  font-size: 1rem;
  color: var(--accent-blue);
  font-weight: 500;
}

.timeline-date {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: 0.5rem;
}

.timeline-location {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.timeline-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
}

.experience-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.experience-list li {
  position: relative;
  padding-left: 1.25rem;
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.55;
}

.experience-list li::before {
  content: "▹";
  position: absolute;
  left: 0;
  color: var(--accent-blue);
  font-size: 0.95rem;
}

.experience-list strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* ==========================================================================
   Technical Skills Grid
   ========================================================================== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.skill-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.25rem;
}

.skill-category-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent-cyan);
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.skills-pill-box {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.skill-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
}

/* ==========================================================================
   Education & Academic Publications
   ========================================================================== */
.education-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
}

.edu-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.25rem;
}

.edu-institution {
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.2rem;
}

.edu-degree {
  font-size: 0.9rem;
  color: var(--accent-blue);
  margin-bottom: 0.35rem;
}

.edu-date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.presentation-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.presentation-card h4 {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.25rem;
}

.presentation-venue {
  font-size: 0.85rem;
  color: var(--accent-purple);
  margin-bottom: 0.2rem;
}

.presentation-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Footer
   ========================================================================== */
footer {
  border-top: 1px solid var(--border-color);
  background: var(--bg-primary);
  padding: 2.5rem 1.5rem;
  margin-top: auto;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-content {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.footer-links a {
  color: var(--text-secondary);
}

.footer-links a:hover {
  color: var(--text-primary);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 768px) {
  html {
    font-size: 15px;
  }

  .nav-links {
    display: none; /* simple mobile hide for now, or compact */
  }

  .hero-title {
    font-size: 2.1rem;
  }

  .hero-subtitle {
    font-size: 1.05rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .timeline {
    padding-left: 1.5rem;
  }

  .timeline-marker {
    left: -1.5rem;
  }

  .haunted-labs-card {
    padding: 1.5rem;
  }
}

/* ==========================================================================
   Print Style Sheet (Clean Resume view)
   ========================================================================== */
@media print {
  body {
    background: #ffffff !important;
    color: #111111 !important;
  }

  .navbar, .hero-social-links, .btn-primary, .btn-secondary, .btn-cv, footer {
    display: none !important;
  }

  .container {
    max-width: 100% !important;
    padding: 0 !important;
  }

  .timeline-content, .project-card, .skill-card, .edu-card {
    border: 1px solid #ccc !important;
    background: #fff !important;
    color: #111 !important;
    box-shadow: none !important;
  }

  .hero-title, .section-title, .timeline-role, .project-title {
    color: #000 !important;
  }
}
