:root {
  --primary: #4f46e5;
  --secondary: #ec4899;
  --dark-bg: #1f2937;
  --light-bg: #f9fafb;
  --text-dark: #111827;
  --text-light: #f3f4f6;
  --accent: #10b981;
  --gradient: linear-gradient(to right, #4f46e5, #ec4899);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  --transition: 0.3s ease;
}

body {
  font-family: 'Roboto', sans-serif;
  background: var(--light-bg);
  color: var(--text-dark);
  margin: 0;
  padding: 0;
  transition: background var(--transition), color var(--transition);
}

/* Dark mode */
body.dark {
  background: var(--dark-bg);
  color: var(--text-light);
}

a {
  color: var(--primary);
  text-decoration: none;
}

h1, h2, h3 {
  margin-bottom: 1rem;
}

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section {
  padding: 4rem 1rem;
  max-width: 1000px;
  margin: auto;
}

.section.colored {
  background: #f3f4f6;
}

.section-tagline {
  font-size: 1rem;
  color: #6b7280;
  margin-bottom: 2rem;
}

/* Preloader */
#preloader {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}
.spinner {
  border: 6px solid #f3f3f3;
  border-top: 6px solid var(--secondary);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Navbar */
.navbar {
  background: #111;
  padding: 1rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow);
}
.nav-container {
  max-width: 1000px;
  margin: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo {
  font-size: 1.5rem;
  color: white;
  font-weight: bold;
}
.nav-menu {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}
.nav-menu a {
  color: white;
  font-weight: 500;
  position: relative;
}
.nav-menu a:hover,
.nav-menu a.active {
  color: var(--secondary);
}
.hamburger {
  display: none;
  color: white;
  font-size: 1.8rem;
  cursor: pointer;
}

/* Hero */
.hero {
  text-align: center;
  background: var(--dark-bg);
  color: white;
  padding: 4rem 1rem;
  position: relative;
}
.profile-img {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  border: 4px solid var(--accent);
  margin-bottom: 1rem;
}
.hero-tagline {
  font-size: 1.2rem;
  color: #d1d5db;
  margin-top: 0.5rem;
}
.hero-btn {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--gradient);
  color: white;
  border: none;
  border-radius: 999px;
  font-weight: bold;
  transition: transform var(--transition);
}
.hero-btn:hover {
  transform: translateY(-2px);
}
.hero-image-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1rem;
  background: conic-gradient(var(--primary), var(--secondary), var(--primary));
  padding: 6px;
  border-radius: 50%;
  animation: rotateBorder 5s linear infinite;
  width: 150px;
  height: 150px;
}

@keyframes rotateBorder {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.advanced-img {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid white;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.toggle-mode {
  position: absolute;
  top: 20px;
  right: 20px;
  background: var(--accent);
  color: white;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 999px;
  cursor: pointer;
}

/* Skills */
.skill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}
.skill-card {
  background: white;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  box-shadow: var(--shadow);
  font-weight: bold;
  color: var(--text-dark);
}
body.dark .skill-card {
  background: #2d3748;
  color: var(--text-light);
}

/* Projects */
.project-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.project-card {
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform var(--transition);
}
.project-card:hover {
  transform: translateY(-5px);
}
.project-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}
.project-info {
  padding: 1rem;
}
.project-info h3 {
  margin: 0.5rem 0;
}
.project-info a {
  display: inline-block;
  margin-top: 0.5rem;
  color: var(--primary);
  font-weight: bold;
}

/* Contact */
form input, form textarea {
  width: 100%;
  padding: 12px;
  margin-bottom: 1rem;
  border: 1px solid #ddd;
  border-radius: 6px;
}
form button {
  padding: 0.75rem 1.5rem;
  background: var(--gradient);
  color: white;
  border: none;
  border-radius: 999px;
  font-weight: bold;
}
.contact-info {
  margin-top: 1.5rem;
  line-height: 1.8;
}

/* Footer */
.footer {
  text-align: center;
  background: #111;
  color: #aaa;
  padding: 1rem;
}

/* Scroll to Top */
#scrollToTopBtn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--accent);
  color: white;
  border: none;
  padding: 12px;
  border-radius: 50%;
  font-size: 18px;
  display: none;
  cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
  .hamburger {
    display: block;
  }
  .nav-menu {
    display: none;
    flex-direction: column;
    background: #111;
    position: absolute;
    top: 60px;
    right: 0;
    width: 100%;
    padding: 1rem;
  }
  .nav-menu.active {
    display: flex;
  }
  .nav-menu li {
    margin-bottom: 1rem;
  }
}
/* Responsive Fixes */
@media (max-width: 768px) {
  .nav-menu {
    flex-direction: column;
    gap: 1rem;
    background: #111;
    position: absolute;
    top: 60px;
    right: 0;
    width: 100%;
    padding: 1rem;
  }

  .nav-menu li {
    margin: 0;
    text-align: center;
  }

  .hero {
    padding: 3rem 1rem;
  }

  .profile-img {
    width: 100px;
    height: 100px;
  }

  .hero h1 {
    font-size: 1.6rem;
  }

  .hero-tagline {
    font-size: 1rem;
    padding: 0 1rem;
  }

  .hero-btn {
    width: 90%;
    padding: 0.8rem;
    font-size: 1rem;
  }

  .section {
    padding: 3rem 1rem;
  }

  .skill-grid {
    gap: 0.5rem;
  }

  .project-info {
    padding: 0.8rem;
  }

  form input, form textarea {
    font-size: 1rem;
    padding: 10px;
  }

  form button {
    width: 100%;
    padding: 0.9rem;
    font-size: 1rem;
  }

  .contact-info {
    font-size: 0.95rem;
  }
}
.social-icons {
  margin-top: 1rem;
}

.social-icons a {
  color: #ccc;
  font-size: 1.5rem;
  margin: 0 0.5rem;
  transition: color 0.3s;
}

.social-icons a:hover {
  color: var(--accent);
}

