html {
  color-scheme: dark;
  scroll-behavior: smooth;
}
:root {
  --bg-base: #0b0f19;
  --bg-elevated: #111827;
  --bg-card: #151d2e;
  --bg-card-hover: #1a2438;
  --bg-section-alt: #0f1524;
  --border: #1e293b;
  --border-light: #334155;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #818cf8;
  --accent-strong: #6366f1;
  --accent-glow: rgba(99, 102, 241, 0.25);
}

/* ===== Base ===== */
body {
  background-color: var(--bg-base);
  color: var(--text-primary);
}

.section {
  padding: 5rem 0;
}

.section-alt {
  background-color: var(--bg-section-alt);
}

.section-header {
  margin-bottom: 2.5rem;
}

.section-label {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: 1.875rem;
  font-weight: 800;
  color: var(--text-primary);
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  display: block;
  width: 3rem;
  height: 0.25rem;
  background: linear-gradient(90deg, #6366f1, #a855f7);
  margin-top: 0.5rem;
  border-radius: 9999px;
}

.text-heading {
  color: var(--text-primary);
}

.text-body {
  color: var(--text-secondary);
}

.text-muted-custom {
  color: var(--text-muted);
}

/* ===== Buttons ===== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  background: #6366f1;
  color: #fff;
  font-weight: 600;
  border-radius: 0.625rem;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
  background: #4f46e5;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.55);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border: 2px solid #6366f1;
  color: #a5b4fc;
  font-weight: 600;
  border-radius: 0.625rem;
  transition: background 0.2s, color 0.2s, transform 0.2s, border-color 0.2s;
}

.btn-outline:hover {
  background: #6366f1;
  color: #fff;
  border-color: #6366f1;
  transform: translateY(-1px);
}

/* ===== Navigation ===== */
#navbar {
  background: rgba(11, 15, 25, 0.85);
  border-color: var(--border);
}

.nav-link {
  color: var(--text-secondary);
  transition: color 0.2s;
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -0.25rem;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-strong);
  border-radius: 9999px;
}

.mobile-nav-link {
  color: var(--text-secondary);
  transition: background 0.2s, color 0.2s;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent);
}

#mobile-menu {
  background: var(--bg-elevated);
  border-color: var(--border);
}

#menu-btn:hover {
  background: var(--bg-card);
}

#navbar.scrolled {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  background: rgba(11, 15, 25, 0.95);
}

/* ===== Hero ===== */
.hero-gradient {
  background: linear-gradient(135deg, #0b0f19 0%, #111827 40%, #1a1040 100%);
}

.hero-pattern {
  background-image: radial-gradient(circle at 1px 1px, rgba(99, 102, 241, 0.15) 1px, transparent 0);
  background-size: 32px 32px;
}

.typed-cursor {
  color: var(--accent);
  font-weight: 300;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.fade-in {
  animation: fadeInUp 0.8s ease-out both;
}

.fade-in-delay {
  animation-delay: 0.2s;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== Cards ===== */
.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.experience-badge {
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.profile-inner {
  background: var(--bg-elevated);
}

/* ===== Skills ===== */
.skill-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.5rem;
  transition: box-shadow 0.3s, transform 0.3s, border-color 0.3s;
}

.skill-card:hover {
  box-shadow: 0 8px 30px var(--accent-glow);
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-2px);
}

.skill-icon-wrap {
  background: rgba(99, 102, 241, 0.15);
}

.skill-badge {
  display: inline-block;
  padding: 0.4rem 0.875rem;
  background: rgba(99, 102, 241, 0.1);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 500;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.skill-badge:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.45);
  transform: translateY(-1px);
}

/* ===== Timeline ===== */
.timeline {
  position: relative;
  padding-left: 2rem;
  border-left: 2px solid rgba(99, 102, 241, 0.3);
}

.timeline-item {
  position: relative;
  padding-bottom: 0.5rem;
}

.timeline-marker {
  position: absolute;
  left: -2.5625rem;
  top: 0.375rem;
  width: 1.125rem;
  height: 1.125rem;
  background: #6366f1;
  border: 3px solid var(--bg-base);
  border-radius: 9999px;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

.timeline-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.5rem 1.75rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}

/* ===== Project ===== */
.project-card {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(30, 27, 75, 0.4) 100%);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 1.25rem;
  padding: 2rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

.project-tag {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
}

.project-date {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.project-bullet {
  background: rgba(255, 255, 255, 0.03);
  padding: 0.75rem 1rem;
  border-radius: 0.625rem;
  border: 1px solid var(--border);
}

/* ===== Education ===== */
.education-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}

/* ===== Contact ===== */
.contact-section {
  background: linear-gradient(135deg, #0b0f19 0%, #1e1b4b 50%, #1a1040 100%);
  border-top: 1px solid var(--border);
}

.contact-card {
  display: block;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  padding: 1.5rem;
  transition: background 0.3s, border-color 0.3s, transform 0.3s;
}

a.contact-card:hover {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(129, 140, 248, 0.35);
  transform: translateY(-2px);
}

.contact-icon {
  width: 2.75rem;
  height: 2.75rem;
  background: rgba(99, 102, 241, 0.2);
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  color: #a5b4fc;
}

/* ===== Footer ===== */
.site-footer {
  background: #060a12;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

/* ===== Back to top ===== */
.back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 2.75rem;
  height: 2.75rem;
  background: #6366f1;
  color: #fff;
  border: none;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(1rem);
  transition: opacity 0.3s, visibility 0.3s, transform 0.3s, background 0.2s;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.5);
  z-index: 40;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: #4f46e5;
}

/* ===== Scroll reveal ===== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .section {
    padding: 3.5rem 0;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .timeline-content {
    padding: 1.25rem;
  }

  .project-card {
    padding: 1.25rem;
  }
}
