html {
  scroll-behavior: smooth;
}


:root {
  --bg-color: rgb(0, 0, 33);
  --nav-color: rgb(18, 18, 62);
  --text-color: white;
  --accent-color: rgb(170, 103, 226);
  --card-color: rgb(18, 18, 62);
  --footer-color: rgb(18, 18, 62);
}

body.light-mode {
  --bg-color: #f4f4f4;
  --nav-color: white;
  --text-color: #111;
  --accent-color: #6a0dad;
  --card-color: #eaeaea;
  --footer-color: #ddd;
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: 'Poppins', sans-serif;
  scroll-behavior: smooth;
  transition: background-color 0.3s, color 0.3s;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 5%;
  height: 80px;
  background-color: var(--nav-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-left-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

nav .left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;   
  font-weight: 600;
  white-space: nowrap;
}

.menu-icon {
  display: none;
  font-size: 1.8rem;
  cursor: pointer;
  margin-right: 12px;
  -webkit-user-select: none; 
  user-select: none;         
}

.sidebar {
  height: 100%;
  width: 0;
  position: fixed;
  top: 0;
  left: 0;
  background-color: var(--nav-color);
  overflow-x: hidden;
  transition: 0.4s;
  padding-top: 60px;
  z-index: 200;
}

.sidebar a {
  padding: 12px 25px;
  text-decoration: none;
  font-size: 1.2rem;
  display: block;
  color: var(--text-color);
}

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

.sidebar .close-btn {
  position: absolute;
  top: 20px;
  right: 25px;
  font-size: 2.2rem;
  cursor: pointer;
}

.brand {
  display: inline;
}

.brand-name,
.brand-role {
  font-size: 1.2rem;
  font-weight: 600;
}

.brand-role::before {
  content: " | ";
}

.logo img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.logo {
  order: 0;     
}

.left {
  order: 1;    
}

.right {
  order: 2;    
}

nav ul {
  display: flex;
  gap: 20px;
  align-items: center;
}

nav ul li {
  list-style: none;
}

nav ul li a {
  text-decoration: none;
  color: var(--text-color);
}

nav ul li a:hover {
  color: var(--accent-color);
}

.theme-toggle {
  background-color: var(--accent-color);
  border: none;
  padding: 6px 15px;
  border-radius: 20px;
  color: white;
  cursor: pointer;
}

.section {
  padding: 60px 5%;
 }

.firstSection {
  display: flex;
  justify-content: space-around;
  align-items: center;
  flex-wrap: wrap;
  padding-top: 100px;
}

.leftSection {
  flex: 1;
  font-size: 2.5rem;
  min-width: 300px;
}

.subtitle {
  font-size: 1.4rem;
  margin-top: 10px;
  opacity: 0.9;
}

.tagline {
  font-size: 1.05rem;
  margin-top: 15px;
  max-width: 500px;
  line-height: 1.6;
  opacity: 0.85;
}


.leftSection h1 {
  font-size: 3rem;
  line-height: 1.2;
  margin-bottom: 10px;
}

.purple {
  color: var(--accent-color);
}

.name {
  white-space: nowrap;
}

.leftSection span#element {
  color: var(--accent-color);
}

.rightSection {
  flex: 1;
  text-align: center;
   min-width: 300px;
}

.rightSection img {
  width: 80%;
  max-width: 400px;
}

.cta {
  margin-top: 20px;
  padding: 10px 25px;
  background-color: var(--accent-color);
  border: none;
  border-radius: 6px;
  color: white;
  cursor: pointer;
  font-size: 1rem;
}

.about, .projects, .contact {
  text-align: center;
}

.about h2, .projects h2, .contact h2, .skills h2 {
  font-size: 2.2rem;
  margin-bottom: 20px;
  color: var(--accent-color);
}

.about p {
  font-size: 1.1rem;
  line-height: 1.6;
  max-width: 700px;
  margin: auto;
}

.project-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  margin-top: 30px;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

.project-card {
  background-color: var(--card-color);
  border-radius: 14px;
  padding: 20px;
  width: 280px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 28px rgba(170, 103, 226, 0.35);
}

.project-card img {
  width: 100%;
  border-radius: 12px;
  margin-bottom: 12px;
  transition: transform 0.3s ease;
}

.project-card:hover img {
  transform: scale(1.04);
}

.project-card h3 {
  color: var(--accent-color);
  margin-bottom: 10px;
  font-size: 1.2rem;
}

.project-card p {
  font-size: 0.95rem;
  color: var(--text-color, #ddd);

  margin-bottom: 15px;
  line-height: 1.4;
}

.project-links {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  margin: 0 8px;
}

.project-links a {
  padding: 8px 18px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  color: #fff;
  background-color: var(--accent-color);
  transition: background-color 0.25s ease, transform 0.25s ease;
}

.project-links a:hover {
  background-color: #8a6fe2;
  transform: translateY(-2px);
  filter: brightness(0.98);
}

.project-card a:hover {
  background-color: var(--accent-hover, #8a6fe2);
}

.project-type {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--accent-color);
  margin-bottom: 8px;
  font-weight: 500;
}

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.tech-badge {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 20px;
  background-color: rgba(170, 103, 226, 0.15);
  color: var(--accent-color);
  font-weight: 500;
}

.contact form {
  max-width: 500px;
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.contact input, .contact textarea {
  padding: 10px;
  border-radius: 5px;
  border: none;
  font-family: 'Poppins', sans-serif;
}

.contact button {
  background-color: var(--accent-color);
  color: white;
  padding: 10px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

footer {
  text-align: center;
  padding: 20px;
  background-color: var(--footer-color);
  color: var(--text-color);
}

.footer a {
  color: var(--text-color);
  margin: 0 10px;
  transition: color 0.3s ease;
}
.footer a:hover {
  color: var(--accent-color);
}


.skills {
  text-align: center;
}

.skills-container {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
  margin-top: 20px;
}

.skill-card:hover {
  transform: scale(1.1);
  background-color: var(--accent-color);
  color: white;
}

.skill-card {
  padding: 15px 20px;
  background-color: var(--card-color);
  color: var(--text-color);
  border-radius: 12px;
  width: 130px;
  text-align: center;
  box-shadow: 0px 4px 10px rgba(0,0,0,0.3);
  transition: 0.3s;
}

.skill-card img {
  width: 80px;
  height: 60px;
  margin-bottom: 8px;
}

.skill-card:hover {
  transform: scale(1.12);
  background-color: var(--accent-color);
  color: white;
}

.skill-card span {
  font-size: 1rem;
  font-weight: 600;
}

.loading-text {
  color: var(--accent-color);
  font-size: 1.1rem;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { opacity: 0.4; }
  50% { opacity: 1; }
  100% { opacity: 0.4; }
}


/* =========================
   Mobile Styles (≤ 768px)
   ========================= */
   
@media (max-width: 768px) {

  /* Navbar */
  nav {
    flex-direction: row;
    gap: 10px;
    height: 60px;
    padding: 8px 5%;
    align-items: center;
  }

  .menu-icon {
    display: inline-block;
  }

  nav .left {
    align-items: center;
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .brand {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
  }

  .brand-role::before {
    content: "";
  }

  .brand-name {
    font-size: 1.05rem;
    font-weight: 600;
  }

  .brand-role {
    font-size: 0.85rem;
    font-weight: 400;
    opacity: 0.85;
  }

  nav .right {
    display: none;
  }

  .cta {
    width: auto;
    max-width: 220px;
    padding: 10px 14px;
    font-size: 1rem;
  }

  .right.active {
    display: flex;
    flex-direction: column;
    background: var(--nav-color);
    position: fixed;
    top: 60px;
    right: 10px;
    width: 90vw;
    max-width: 320px;
    padding: 12px;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.35);
    z-index: 300;
    overflow-y: auto;
    max-height: calc(100vh - 80px);
  }

  /* Hero Section */
  .firstSection {
    flex-direction: column;
    text-align: center;
    padding-top: 40px;
    gap: 20px;
  }

  .leftSection {
    font-size: 1.6rem;
  }

  .leftSection h1 {
    font-size: 2rem;
  }

  .subtitle {
    font-size: 1.05rem;
  }

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

  .rightSection img {
    width: 90%;
    max-width: 320px;
  }

  .project-container {
    gap: 18px;
    flex-direction: column;
    align-items: center;
  }

  .project-card {
    width: 100%;
    max-width: 420px;
  }

  .contact form {
    padding: 0 12px;
  }

  .contact input, .contact textarea {
    font-size: 1rem;
  }

  footer {
    padding: 16px 8px;
  }
}

/* Extra small phones (≤480px) */
@media (max-width: 480px) {

  nav {
    padding: 8px 4%;
    height: 56px;
    position: relative;
  }

  .menu-icon {
    font-size: 1.6rem;
    margin-right: 6px;
  }

  nav .left {
    align-items: center;
    font-size: 0.95rem;
  }

  .brand {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
  }

  .brand-role::before {
    content: "";           
  }

  .brand-name {
    font-size: 1.05rem;
    font-weight: 600;
  }

  .brand-role {
    font-size: 0.85rem;
    font-weight: 400;
    opacity: 0.85;
  }

  .logo {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
  }

  .logo img {
    width: 36px;
    height: 36px;
  }

  .logo {
    order: 3;   
  }

  .left {
    order: 1;
  }

  .right {
    display: none; 
  }

  .leftSection {
    font-size: 1.4rem;
  }

  .leftSection h1 {
    font-size: 1.8rem;
  }

  .rightSection img {
    width: 95%;
    max-width: 280px;
  }

  .cta {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
  }

  .right.active {
    right: 5vw;
    left: 5vw;
    width: 90vw;
    max-width: none;
    border-radius: 12px;
  }

  .project-card {
    width: 100%;
    padding: 18px;
  }

  .project-links {
    justify-content: center;
    gap: 12px;
    margin-top: 8px;
  }
  .project-links a {
    flex: 1 1 auto;
    text-align: center;
    padding: 10px;
  }

}
