:root {
  /* Tokenized palette */
  --primary-500: #6366f1; /* indigo-500 */
  --primary-600: #4f46e5; /* indigo-600 */
  --primary-700: #4338ca; /* indigo-700 */
  --neutral-900: #0f172a; /* slate-900 */
  --neutral-800: #1e293b; /* slate-800 */
  --neutral-700: #334155; /* slate-700 */
  --neutral-100: #f1f5f9; /* slate-100 */
  --accent-500: #f59e0b; /* amber-500 */

  /* Legacy vars mapped to tokens for compatibility */
  --primary-color: var(--primary-600);
  --secondary-color: #64748b;
  --accent-color: var(--accent-500);
  --success-color: #10b981;
  --info-color: #06b6d4;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --light-color: #f8fafc;
  --dark-color: var(--neutral-800);
  --gradient-primary: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-500) 100%);
  --gradient-secondary: linear-gradient(135deg, #64748b 0%, #475569 100%);
  --gradient-accent: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --gradient-hero: linear-gradient(135deg, var(--neutral-800) 0%, var(--neutral-700) 100%);
  --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  --shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
  --border-radius: 0.75rem;
  --transition: all 0.3s ease;
}

[data-bs-theme="light"] {
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --border-color: #e2e8f0;
  --card-bg: #ffffff;
  --navbar-bg: rgba(255, 255, 255, 0.9);
}

[data-bs-theme="dark"] {
  --bg-primary: var(--neutral-900);
  --bg-secondary: var(--neutral-800);
  --text-primary: #f1f5f9;
  /* slightly lighter for better readability on dark */
  --text-secondary: #a8b3c7;
  --border-color: #334155;
  --card-bg: var(--neutral-800);
  --navbar-bg: rgba(15, 23, 42, 0.9);
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: var(--transition);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.navbar {
  backdrop-filter: blur(10px);
  background-color: var(--navbar-bg) !important;
  border-bottom: 1px solid var(--border-color);
}

.hero-section {
  min-height: 100vh;
  background: var(--gradient-hero);
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('hero.png') center/cover;
  opacity: 0.2;
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(10px);
  border-radius: var(--border-radius);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-title {
  color: #ffffff;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* Hero pills: high-contrast on dark hero (theme-independent, always readable) */
.hero-pill {
  display: inline-block;
  background: var(--primary-600);
  color: #ffffff;
  padding: 0.35rem 0.85rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: var(--transition);
}

.hero-pill:hover {
  background: var(--primary-500);
  border-color: rgba(255, 255, 255, 0.3);
}

.section-title {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 3rem;
  position: relative;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--gradient-primary);
  border-radius: 2px;
}

.skill-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 2rem 1rem;
  text-align: center;
  transition: var(--transition);
  height: 100%;
  box-shadow: var(--shadow-sm);
}

.skill-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-color);
}

.skill-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--text-secondary);
  transition: var(--transition);
}

.skill-card:hover .skill-icon {
  color: var(--primary-color);
}

.project-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  overflow: hidden;
  transition: var(--transition);
  height: 100%;
  box-shadow: var(--shadow-sm);
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-color);
}

.project-image {
  height: 200px;
  background: var(--gradient-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 3rem;
}

.project-content {
  padding: 1.5rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.project-tag {
  background: var(--text-secondary);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
}

.project-tag:hover {
  background: var(--primary-color);
}

.btn-primary {
  background: var(--gradient-primary);
  border: none;
  border-radius: var(--border-radius);
  padding: 0.75rem 2rem;
  font-weight: 600;
  transition: var(--transition);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  background: var(--primary-color);
}

.btn-outline-primary {
  border: 2px solid var(--text-secondary);
  color: var(--text-secondary);
  border-radius: var(--border-radius);
  padding: 0.75rem 2rem;
  font-weight: 600;
  transition: var(--transition);
  background: transparent;
}

.btn-outline-primary:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.btn-outline-primary.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

.theme-toggle {
  background: var(--gradient-primary);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: var(--transition);
}

.theme-toggle:hover {
  transform: rotate(180deg);
  background: var(--primary-color);
}

.section {
  padding: 5rem 0;
}

.section:nth-child(even) {
  background: var(--bg-secondary);
}

.contact-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 2rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.social-links a {
  display: inline-block;
  width: 50px;
  height: 50px;
  background: var(--text-secondary);
  color: white;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 0.5rem;
  transition: var(--transition);
  text-decoration: none;
}

.social-links a:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  color: white;
  background: var(--primary-color);
}

.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.project-item {
  transition: all 0.3s ease;
}

.project-item.is-filtered-out {
  display: none;
}

.navbar .nav-link {
  font-weight: 500;
  transition: var(--transition);
}

.navbar-dark .nav-link {
  color: var(--text-primary) !important;
}

.navbar-dark .nav-link:hover {
  color: var(--primary-color) !important;
}

.navbar-brand {
  color: var(--primary-color) !important;
  font-weight: 700;
}

/* Ensure navbar is always visible with glass effect */
.navbar.scrolled {
  background-color: var(--bg-primary) !important;
  box-shadow: var(--shadow);
}

/* Accessible focus styles */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.theme-toggle:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
  box-shadow: 0 0 0 0.15rem rgba(99, 102, 241, 0.4);
}

@media (max-width: 768px) {
  .hero-section {
    min-height: 80vh;
  }

  .section {
    padding: 3rem 0;
  }
}

/* NDA badge on project cards */
.nda-note {
  font-size: 0.8rem;
  color: var(--text-secondary);
  opacity: 0.75;
  margin-top: 0.75rem;
  margin-bottom: 0;
}

/* Contact form styling */
#contact-form .form-control,
#contact-form .form-select {
  background-color: var(--bg-secondary);
  border-color: var(--border-color);
  color: var(--text-primary);
  border-radius: var(--border-radius);
  padding: 0.75rem 1rem;
  transition: var(--transition);
}

#contact-form .form-control:focus,
#contact-form .form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.15rem rgba(99, 102, 241, 0.25);
}

#contact-form .form-label {
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

