body {
  height: 100%;
  margin: 0;
  padding: 0;
  background: radial-gradient(ellipse at top, #1f1b2e, #0a0a0a);
  color: #f9fafb;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  overflow-x: hidden;
}

html {
  font-size: 120%;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999;
  background: rgba(17, 24, 39, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-container {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem;
  position: relative;
}

.nav-container .emoji {
  font-size: 1.5rem;
  margin-right: 1rem;
}

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

.nav-container a {
  color: #a78bfa;
  text-decoration: none;
  transition: color 0.3s ease, text-shadow 0.3s ease;
  white-space: nowrap;
}

.nav-container a:hover {
  color: #c084fc;
  text-shadow: 0 0 5px #c084fc;
}

/* Mobile menu button */
.menu-btn {
  display: none;
  background: none;
  border: none;
  color: #a78bfa;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1000;
}

/* Responsive styles */
@media screen and (max-width: 768px) {
  .menu-btn {
    display: block;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 70%;
    max-width: 300px;
    background: rgba(17, 24, 39, 0.98);
    backdrop-filter: blur(10px);
    flex-direction: column;
    justify-content: flex-start;
    padding: 5rem 2rem 2rem;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    will-change: transform;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2);
  }

  .nav-links.active {
    transform: translateX(0);
  }

  .nav-container {
    justify-content: space-between;
    padding: 0.8rem 1rem;
  }

  .nav-container .emoji {
    position: static;
    transform: none;
  }
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 6rem 1rem 7rem;
  min-height: 65vh;
  justify-content: center;
  position: relative;
}

.hero-content {
  max-width: 800px;
}

.hero-greeting {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: #a78bfa;
  height: 2rem;
}

#typewriter {
  display: inline-block;
}

.cursor {
  display: inline-block;
  animation: blink 1s infinite;
  color: #c084fc;
  font-weight: bold;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.hero-title {
  font-size: 3.7rem;
  font-weight: bold;
  margin-bottom: 1.5rem;
  color: #f9fafb;
  line-height: 1.1;
}

.name-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(30px) rotateX(90deg);
  animation: revealName 0.8s ease-out forwards;
  margin-right: 0.3em;
  text-shadow: 0 0 20px rgba(167, 139, 250, 0.3);
}

@keyframes revealName {
  0% {
    opacity: 0;
    transform: translateY(30px) rotateX(90deg) scale(0.8);
  }
  50% {
    opacity: 0.7;
    transform: translateY(-10px) rotateX(45deg) scale(1.1);
  }
  100% {
    opacity: 1;
    transform: translateY(0) rotateX(0deg) scale(1);
  }
}

.tagline {
  color: #a78bfa;
  font-size: 1.1rem;
  opacity: 0;
  animation: fadeInUp 0.8s ease-out 3s forwards;
}

.tagline-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(20px);
  animation: slideInWord 0.6s ease-out forwards;
}

.tagline-separator {
  margin: 0 0.5em;
  color: #6366f1;
  opacity: 0;
  animation: fadeIn 0.4s ease-out forwards;
}

@keyframes slideInWord {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Hover effects for the hero title */
.hero-title:hover .name-word {
  animation: nameHover 0.6s ease-in-out;
}

@keyframes nameHover {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-10px) scale(1.05); }
}

/* Responsive design for hero section */
@media screen and (max-width: 768px) {
  .hero {
    padding: 4rem 1rem 5rem;
    min-height: 60vh;
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-greeting {
    font-size: 1.2rem;
  }
}

#home {
  margin-top: 1rem;
}

#about {
  scroll-margin-top: 100px; /* makes scrolling to #about offset nicely */
  margin-top: -2rem;
}

.about-layout {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  flex-wrap: nowrap;
}

.about-side-img {
  width: 160px;
  height: 160px;
  border-radius: 9999px;
  border: 4px solid #4c1d95;
  animation: pulse 2s infinite;
  flex-shrink: 0;
}

/* Responsive fallback for mobile screens */
@media (max-width: 640px) {
  .about-layout {
    flex-direction: column;
    align-items: center;
  }
}

.about-grid {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.about-img {
  width: 150px;
  height: 150px;
  border-radius: 9999px;
  border: 4px solid #4c1d95;
  animation: pulse 2s infinite;
  flex-shrink: 0;
}

.profile-img {
  width: 160px;
  height: 160px;
  border-radius: 9999px;
  border: 4px solid #4c1d95;
  margin-bottom: 1rem;
  animation: pulse 2s infinite;
}

.container {
  max-width: 768px;
  margin: 0 auto;
  padding: 5rem 1.5rem;
}

.glass {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.5rem;
  border-radius: 1rem;
}

a {
  text-decoration: none;
  color: #c084fc;
}

a:hover {
  text-shadow: 0 0 8px #c084fc;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.skill-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid #4c1d95;
  border-radius: 1rem;
  padding: 1.5rem;
  text-align: center;
  transition: 0.3s ease;
}

.skill-card img {
  width: 40px;
  height: 40px;
  margin: 0 auto;
  display: block;
  filter: brightness(1.2); /* Optional: match the glow aesthetic */
}

.skill-card:hover {
  transform: scale(1.05);
  box-shadow: 0 0 12px #9333ea;
}

.skill-card i {
  font-size: 2.5rem;
}

.connect a {
  display: block;
  margin: 0.5rem 0;
  font-size: 1.1rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.project-card {
  padding: 1.5rem;
}

.social-icons {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1rem;
  padding: 1.5rem 0;
}

.social-icons a {
  font-size: 1.8rem;
  color: #c084fc;
  transition: transform 0.3s ease, text-shadow 0.3s ease;
}

.social-icons a:hover {
  transform: scale(1.2);
  text-shadow: 0 0 8px #c084fc;
}

.social-inline {
  display: flex;
  gap: 1.2rem;
  margin-top: 0.75rem;
}

.social-inline a {
  font-size: 1.6rem;
  color: #c084fc;
  transition: transform 0.3s ease, text-shadow 0.3s ease;
}

.social-inline a:hover {
  transform: scale(1.15);
  text-shadow: 0 0 6px #c084fc;
}

/* Theme toggle button */
.theme-toggle {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f9fafb;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.45rem 0.6rem;
  border-radius: 999px;
  margin-left: 0.25rem;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.theme-toggle--floating {
  position: absolute;
  top: 4.25rem; /* sit below fixed navbar */
  right: 1rem;
  z-index: 1000;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
}

@media screen and (max-width: 768px) {
  /* Avoid overlap with hamburger button on mobile */
  .theme-toggle--floating {
    left: 1rem;
    right: auto;
    top: 4.25rem;
  }
  .hero {
    padding: 4rem 1rem 5rem;
    min-height: 60vh;
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-greeting {
    font-size: 1.2rem;
  }
}

/* Light theme overrides */
:root[data-theme="light"] body {
  background: radial-gradient(ellipse at top, #f3f4f6, #ffffff);
  color: #111827;
}

:root[data-theme="light"] .navbar {
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(10px);
}

:root[data-theme="light"] .nav-container a {
  color: #6b21a8; /* deep purple */
}

:root[data-theme="light"] .nav-container a:hover {
  color: #7c3aed;
  text-shadow: 0 0 5px rgba(124, 58, 237, 0.45);
}

:root[data-theme="light"] .menu-btn {
  color: #6b21a8;
}

:root[data-theme="light"] .theme-toggle {
  color: #111827;
  border-color: rgba(0, 0, 0, 0.12);
}

:root[data-theme="light"] .theme-toggle:hover {
  background: rgba(0,0,0,0.06);
  border-color: rgba(0, 0, 0, 0.2);
}

:root[data-theme="light"] .glass {
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

:root[data-theme="light"] a {
  color: #7c3aed; /* accent */
}

:root[data-theme="light"] a:hover {
  text-shadow: 0 0 8px rgba(124, 58, 237, 0.35);
}

:root[data-theme="light"] .cursor {
  color: #7c3aed;
}

:root[data-theme="light"] .hero-title {
  color: #1f2937; /* slate-800 */
  text-shadow: 0 6px 18px rgba(124, 58, 237, 0.18);
}

:root[data-theme="light"] .name-word {
  text-shadow: 0 6px 18px rgba(124, 58, 237, 0.18);
}

:root[data-theme="light"] .hero-greeting {
  color: #6b21a8; /* deep purple accent */
}

:root[data-theme="light"] .skill-card {
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

:root[data-theme="light"] .skill-card:hover {
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.15);
}

:root[data-theme="light"] .social-icons a,
:root[data-theme="light"] .social-inline a {
  color: #7c3aed;
}

/* Mobile off-canvas stays readable on light */
@media screen and (max-width: 768px) {
  :root[data-theme="light"] .nav-links {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: -5px 0 15px rgba(0,0,0,0.15);
  }
}
