html {
  scroll-behavior: smooth;
}

:root {
  --bg: #f4f6ff;
  --primary: #6368fc;
  --secondary:  #5686f7d0;
  --darkBg: #0d0d1a;
}

body {
  padding-top: 100px;
  background-color: var(--bg);
  color: black;
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  transition: background-color 0.4s, color 0.4s;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: var(--primary);
  padding: 0.8rem 2rem;
  z-index: 1000;
}

header h2 {
  color: #ffffff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.container {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.container nav {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.nav-group {
  display: flex;
  align-items: center;
  gap: 15px;
}

.theme-toggle {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--bg);
  cursor: pointer;
  display: flex;
  align-items: center;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 20px;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--bg);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease, transform 0.3s ease;
}

.nav-links a:hover {
  color: white;
  transform: scale(1.3);
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 2rem;
  text-align: center;
}

.hero img {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid var(--secondary);
  margin-bottom: 1rem;
}

.hero h2 {
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
}
.hero h3{
  color: var(--secondary);
}

.hero p {
  max-width: 600px;
  color: var(--darkBg);
}

.hero .icon {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin-top: 1rem;
}

.hero .icon a {
  color: var(--darkBg);
  text-decoration: none;
  font-size: 1.8rem;
  transition: transform 0.3s ease;
}

.hero .icon a:hover {
  transform: scale(1.2);
  color: #797878;
}

.section {
  scroll-margin-top: 100px;
  padding: 3rem 2rem;
}

.section p {
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.8;
  font-size: 1rem;
}


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

.card {
  background: #ffffff;
  padding: 1.5rem;
  border: 2px solid var(--primary);
  border-radius: 10px;
  transform: translateY(50px);
  transition: transform 0.5s ease, opacity 0.5s ease, border-color 0.3s;
  opacity: 0;
}

.card.visible {
  transform: translateX(0);
  opacity: 1;
}

.card:hover {
  transform: translateY(-8px);
  border-color: var(--secondary);
}

.card img {
  width: 100%;
  max-width: 80px;
  max-height: 80px;
  display: block;
  margin: 0 auto 1rem auto;
  object-fit: contain;
}

.card h4 {
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.card p {
  color: #000;
}

.card a {
  color: var(--primary);
  text-decoration: underline;
}

footer {
  background: var(--primary);
  text-align: center;
  padding: 1.5rem;
  color: #fff;
}

.skill-box {
  background: #ffffff;
  border: 2px solid var(--primary);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.skill-box:hover {
  transform: translateY(-8px);
  border-color: var(--secondary);
}

.skill-box span {
  font-weight: 600;
  font-size: 1rem;
  color: var(--darkBg);
}

.iconify {
  width: 32px;
  height: 32px;
}


#contact .hero {
  padding: 2rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.contact-info {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 40px;
  width: 100%;
  max-width: 900px;
  margin: 1.5rem auto;
}

.contact-info.horizontal {
  flex-direction: row;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1 1 30%;
}

.info-item iconify-icon {
  font-size: 1.8rem;
  color: var(--primary);
  flex-shrink: 0;
}
.info-item a{
  color: var(--darkBg);
}

.info-content {
  display: flex;
  flex-direction: column;
}

.info-label {
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--darkBg);
}

.social-icons {
  display: flex;
  gap: 1.5rem;
  margin-top: 1rem;
}

.social-icons a {
  color: var(--darkBg);
  font-size: 2rem;
  transition: transform 0.3s ease;
}

.social-icons a:hover {
  color: #797878;
  transform: scale(1.1);
}


/* Dark Mode */
body.dark-theme header {
  background-color: var(--primary);
}
body.dark-theme header h2{
  color: #fff;
}

body.dark-theme {
  background-color: #1a1a1a;
  color: #FFDEDE;
}

body.dark-theme h2,
body.dark-theme h3,
body.dark-theme h4 {
  color: var(--primary);
}

body.dark-theme .hero h3{
  color: var(--secondary);
}
body.dark-theme .hero a {
  color: var(--bg);
  text-decoration: underline;
}

body.dark-theme .hero .icon a {
  text-decoration: none;
  font-size: 1.8rem;
  transition: transform 0.3s ease;
}

body.dark-theme .hero .icon a:hover {
  transform: scale(1.2);
  color: #797878;
}

body.dark-theme .card:hover {
  transform: translateY(-8px);
  border-color: var(--secondary);
}

body.dark-theme .skill-box {
  background-color: #121111;
  border-color: var(--primary);
}

body.dark-theme .skill-box span {
  color:var(--bg);
}

body.dark-theme .skill-box:hover {
  transform: translateY(-8px);
  border-color: var(--secondary);
}

body.dark-theme p,
body.dark-theme a,
body.dark-theme .card p,
body.dark-theme .hero p {
  color: var(--bg);
}

body.dark-theme .card {
  background-color: #121111;
  border-color: var(--primary);
}

body.dark-theme .card a {
  color: var(--bg);
  text-decoration: underline;
}

body.dark-theme .nav-links a {
  color: var(--bg);
}

body.dark-theme .nav-links a:hover {
  color: #fff;
  transform: scale(1.3);
}

body.dark-theme footer {
  background: var(--primary);
  color: var(--bg);
}

body.dark-theme .info-label {
  color: var(--secondary);
}
body.dark-theme .info-item span,
body.dark-theme .info-item a{
  color: var(--bg);
}


body.dark-theme .info-item iconify-icon {
  color: var(--primary);
}

body.dark-theme .social-icons a {
  color: white;
}

body.dark-theme .social-icons a:hover {
  color: #797878;
}

@media (max-width: 768px) {
   .container {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
    align-items: center;
  }

  nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
  }

   .nav-group {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
  }
  .nav-links {
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
  }

  .brand {
    flex-direction: row;
    justify-content: center;
  }

  .theme-toggle {
    margin-left: 10px;
  }
  
   #projects .grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    padding: 0 1rem;
  }

  #projects .card {
    padding: 1rem;
    text-align: center;
  }

  #projects .card img {
    max-width: 70px;
    max-height: 70px;
  }

  #projects .card h4 {
    font-size: 1rem;
    margin-top: 0.5rem;
  }

  #projects .card p {
    font-size: 0.9rem;
  }

  #projects .card a {
    font-size: 0.9rem;
  }

   .contact-info.horizontal {
    flex-direction: column;
    align-items: center;
  }

  .info-item {
    display: flex;
    flex-direction: row; 
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    width: 100%;
    max-width: 400px;
  }

  .info-item iconify-icon {
    font-size: 1.8rem;
    color: var(--primary);
    flex-shrink: 0;
  }

  .info-content {
    display: flex;
    flex-direction: row; 
    align-items: center;
    gap: 8px;
    text-align: left;
  }

  .info-label {
    font-weight: 600;
    color: var(--darkBg);
  }
}