html {
  scroll-behavior: smooth;
}

:root {
  --primary-color: #4da3ff;
  --bg-color: #000000;
  --bg-secondary: #121212;
  --text-color: #ffffff;
  --text-secondary: #cccccc;
  --transition-speed: 0.3s;
  --container-width: 1100px;
}

/* Typing Animation - JS Based */
.typing-text {
  color: var(--primary-color);
  font-weight: 700;
}

.cursor {
  display: inline-block;
  background-color: var(--primary-color);
  width: 3px;
  animation: blink 1s infinite;
}

@keyframes blink {
  0% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition-speed) ease;
}

ul {
  list-style: none;
}

/* Utilities */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

.btn {
  display: inline-block;
  padding: 12px 30px;
  background-color: var(--primary-color);
  color: #fff;
  border-radius: 5px;
  font-weight: 600;
  transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
  border: none;
  cursor: pointer;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(77, 163, 255, 0.4);
}

.section-title {
  font-size: 2.5rem;
  margin-bottom: 2rem;
  text-align: center;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background-color: var(--primary-color);
  margin: 10px auto 0;
  border-radius: 2px;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 20px 0;
  z-index: 1000;
  transition: background-color var(--transition-speed) ease, padding var(--transition-speed) ease;
}

.navbar.scrolled {
  background-color: rgba(0, 0, 0, 0.95);
  padding: 15px 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
}

.nav-links {
  display: flex;
  gap: 30px;
}

.nav-links a {
  font-weight: 500;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary-color);
}

.nav-links a i {
  margin-right: 8px;
}

/* Mobile Menu */
.hamburger {
  display: none;
  cursor: pointer;
  font-size: 1.5rem;
}

/* Sections */
section {
  padding: 100px 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Home */
/* Home */
#home {
  background: radial-gradient(circle at center, #1a1a1a 0%, #000000 100%);
  padding-top: 100px;
  /* Account for fixed nav */
  padding-bottom: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.hero-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 50px;
  flex-wrap: wrap-reverse;
  /* Text on top on mobile, side by side on desktop */
  text-align: left;
}

.hero-image-wrapper {
  flex: 0 0 auto;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  padding: 5px;
  background: linear-gradient(45deg, var(--primary-color), transparent);
  box-shadow: 0 0 20px rgba(77, 163, 255, 0.3);
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid var(--bg-color);
  background-color: #222;
}

.hero-content {
  flex: 1;
  min-width: 300px;
}

.hero-content h1 {
  font-size: 3.5rem;
  margin-bottom: 10px;
  line-height: 1.2;
}

.hero-content h2 {
  font-size: 1.8rem;
  color: var(--primary-color);
  margin-bottom: 20px;
  font-weight: 400;
  height: 2rem;
  /* Reserve space for typing */
}

.hero-content p {
  max-width: 600px;
  margin-bottom: 30px;
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* Hero Buttons */
.hero-btns {
  display: flex;
  justify-content: flex-start;
  /* Changed from center */
  gap: 15px;
  flex-wrap: wrap;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 16px;
  font-weight: 500;
  transition: all var(--transition-speed) ease;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  /* Default fallback */
  color: #fff;
  font-size: 0.95rem;
}

.btn-icon:hover {
  transform: translateY(-2px);
  filter: brightness(1.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-icon i {
  font-size: 1.1rem;
}

/* Responsive Home */
@media (max-width: 768px) {
  .hero-container {
    flex-direction: column-reverse;
    text-align: center;
    gap: 30px;
  }

  .hero-content h1 {
    font-size: 2.5rem;
  }

  .hero-content h2 {
    font-size: 1.4rem;
  }

  .hero-btns {
    justify-content: center;
  }

  .hero-image-wrapper {
    width: 200px;
    height: 200px;
  }
}

/* About */
#about {
  background-color: var(--bg-secondary);
}

.about-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  max-width: 800px;
  margin: 0 auto;
}

.bio-text {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 2rem;
}

/* Skills Cards */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  /* Wider for sub-grids */
  gap: 30px;
}

.skill-category {
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 15px;
}

.skill-item {
  background: #252525;
  padding: 20px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: transform 0.3s ease;
  border: 1px solid #333;
}

.skill-item:hover {
  transform: translateY(-5px);
  border-color: var(--primary-color);
}

.skill-item i {
  font-size: 3rem;
}

.skill-item span {
  font-weight: 500;
  color: #ddd;
}

/* Projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  justify-items: start;
}


.project-card {
  background: var(--bg-secondary);
  border-radius: 12px;
  overflow: hidden;
  transition: transform var(--transition-speed) ease;
  border: 1px solid #333;
  width: 100%;
  /* FIX */
}

.project-card:hover {
  transform: translateY(-8px);
  border-color: var(--text-secondary);
}

.project-img {
  width: 100%;
  height: 200px;
  /* Fixed height for consistency */
  background-color: #222;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-right: none;
  border-bottom: 1px solid #333;
}

.project-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.project-card:hover .project-img img {
  transform: scale(1.05);
}

.project-info {
  padding: 25px;
  width: 100%;
  text-align: left;
}

.project-info h3 {
  font-size: 1.5rem;
  margin-bottom: 10px;
}

.project-info p {
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.project-info .meta {
  font-size: 0.9rem;
  color: var(--primary-color);
  font-style: italic;
}

/* Contact */
.contact-container {
  text-align: center;
  max-width: 600px;
  /* Reverted width */
  margin: 0 auto;
}

.contact-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 40px;
  padding: 0;
  align-items: center;
  width: 100%;
}

.contact-item {
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  padding: 15px 25px;
  border-radius: 12px;
  width: 100%;
  max-width: 500px;
  /* Constraint width */
  gap: 20px;
  border: 1px solid #333;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.contact-item:hover {
  transform: translateX(5px);
  border-color: var(--primary-color);
}

.icon-box {
  width: 50px;
  height: 50px;
  background: rgba(77, 163, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-box i {
  font-size: 1.5rem;
  color: var(--primary-color);
}

.contact-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.contact-info .label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.contact-info a {
  font-size: 1rem;
  font-weight: 500;
  word-break: break-all;
}

.contact-info a:hover {
  color: var(--primary-color) !important;
}

/* Footer */
footer {
  padding: 20px 0;
  text-align: center;
  color: #666;
  font-size: 0.9rem;
  background-color: #000;
  border-top: 1px solid #222;
}

/* Animations */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
  .hero-content h1 {
    font-size: 2.5rem;
  }

  .hero-content h2 {
    font-size: 1.3rem;
  }

  .container {
    padding: 0 15px;
  }

  /* Mobile Navbar */
  .hamburger {
    display: block;
    color: #fff;
    font-size: 1.8rem;
    cursor: pointer;
    z-index: 1001;
    /* Above navbar background */
  }

  .nav-links {
    position: fixed;
    top: 0;
    /* Start from top to cover full height if needed or sit below nav */
    left: 0;
    width: 100%;
    height: 100vh;
    /* Full screen menu */
    background-color: #000;
    /* Solid black */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Center items */
    padding: 0;
    gap: 40px;
    transform: translateY(-100%);
    /* Start hidden above */
    transition: transform var(--transition-speed) ease;
    z-index: 1000;
  }

  .nav-links.active {
    transform: translateY(0);
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .about-content {
    grid-template-columns: 1fr;
  }

  .contact-links {
    flex-direction: column;
    gap: 30px;
  }
}