/* ==== Reset & Base ==== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  background-color: #f4f7fc;
  color: #222;
  margin: 0;
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
  border-radius: 12px;
}

/* ==== Container ==== */
.container {
  width: min(90%, 1100px);
  margin-inline: auto;
  padding-block: 2rem;
}

/* ==== Navbar ==== */
.header {
  position: sticky;
  top: 0;
  background: rgba(255 255 255 / 0.9);
  backdrop-filter: saturate(180%) blur(8px);
  z-index: 1000;
  box-shadow: 0 1px 8px rgb(0 0 0 / 0.1);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1rem;
}

.logo {
  font-weight: 700;
  font-size: 1.4rem;
  cursor: pointer;
}

.nav-list {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.nav-link {
  font-weight: 600;
  font-size: 1rem;
  padding: 0.5rem 0;
  position: relative;
  cursor: pointer;
  transition: color 0.3s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0%;
  height: 2px;
  background-color: #6a5acd;
  transition: width 0.3s ease;
  border-radius: 2px;
}

.nav-link:hover,
.nav-link:focus {
  color: #6a5acd;
}

.nav-link:hover::after,
.nav-link:focus::after {
  width: 100%;
}

.dark-toggle {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: #6a5acd;
  cursor: pointer;
  padding: 0.5rem;
  transition: color 0.3s ease;
}

.dark-toggle:hover {
  color: #4c3fbf;
}

/* ==== Hero ==== */
.hero {
  gap: 4rem;
  align-items: center;
  padding-block: 8rem 8rem;
}

.hero {
  max-width: 1000px;
  text-align: center;
}

.hero-title {
  font-weight: 700;
  font-size: 3rem;
  line-height: 1.1;
  margin-bottom: 1rem;
  color: #3e3e60;
}

.hero-subtitle {
  font-weight: 500;
  font-size: 1.25rem;
  margin-bottom: 2rem;
  color: #5c5c7a;
}

/* ==== Section Titles ==== */
.section-title {
  font-weight: 700;
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  color: #3e3e60;
  text-align: center;
}

/* ==== About ==== */
.about {
  max-width: 1000px;
  margin-inline: auto;
}

.about-text {
  font-weight: 400;
  font-size: 1.15rem;
  line-height: 1.6;
  color: #555666;
  margin-bottom: 1.75rem;
}

/* ==== Projects ==== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(280px,1fr));
  gap: 2rem;
  margin-top: 1rem;
}

.project-card {
  background: white;
  padding: 2rem 1.5rem;
  border-radius: 16px;
  box-shadow: 0 16px 40px rgb(0 0 0 / 0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: default;
}

.project-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 24px 48px rgb(0 0 0 / 0.12);
}

.project-card h3 {
  margin-bottom: 1rem;
  color: #3e3e60;
  font-weight: 600;
  font-size: 1.3rem;
  position: relative;
  cursor: pointer;
  transition: color 0.3s ease;
}

.project-card p {
  color: #555666;
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.4;
}

.project-card h3 {
  position: relative;
  font-size: 1.3rem;
  font-weight: 600;
  color: #3e3e60;
  cursor: pointer;
  transition: color 0.3s ease;
}

.project-card h3::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0%;
  height: 2px;
  background-color: #6a5acd;
  transition: width 0.3s ease;
  border-radius: 2px;
}

.project-card h3:hover,
.project-card h3:focus {
  color: #6a5acd;
}

.project-card h3:hover::after,
.project-card h3:focus::after {
  width: 100%;
}

/* ==== Education ==== */
/* ==== Timeline Split Layout ==== */
.timeline {
  position: relative;
  margin-top: 3rem;
  padding-left: 1rem;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 100%;
  background-color: #6a5acd;
}

.timeline-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3rem;
  position: relative;
}

.timeline-left,
.timeline-right {
  width: 45%;
  text-align: right;
  color: #3e3e60;
}

.timeline-right {
  text-align: left;
}

.timeline-left h3,
.timeline-right h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
}

.timeline-left span {
  font-size: 1rem;
  color: #777;
}

/* Dark mode styling */
.dark-mode .timeline::before {
  background-color: #a29bff;
}


.dark-mode .timeline-left,
.dark-mode .timeline-right {
  color: #d3d3f2;
}

.dark-mode .timeline-left span {
  color: #aaa;
}

/* Mobile fix */
@media (max-width: 768px) {
  .timeline-row {
    flex-direction: column;
    align-items: flex-start;
    padding-left: 2rem;
  }

  .timeline-left,
  .timeline-right {
    width: 100%;
    text-align: left;
    margin-bottom: 0.5rem;
  }

  .timeline::before {
    left: 1rem;
  }
}

/* ==== Contact ==== */
.contact {
  text-align: center;
}

.contact-icons {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  font-size: 2rem;
  margin-top: 1rem;
  color: #6a5acd;
}

.contact-link:hover {
  color: #4c3fbf;
  transform: scale(1.1);
  transition: transform 0.3s ease;
}

/* ==== Footer ==== */
.footer {
  text-align: center;
  padding: 3rem 0;
  font-weight: 500;
  font-size: 1rem;
  color: #9999aa;
}

/* ==== Dark Mode ==== */
.dark-mode {
  background-color: #121212;
  color: #d3d3f2;
}

.dark-mode .header {
  background: rgba(40, 40, 40, 0.9);
  box-shadow: 0 1px 8px rgba(255 255 255 / 0.05);
}

.dark-mode .nav-link,
.dark-mode .logo,
.dark-mode .dark-toggle,
.dark-mode .hero-title,
.dark-mode .section-title,
.dark-mode .project-card h3 {
  color: #d3d3f2;
}

.dark-mode .nav-link:hover::after {
  background-color: #a29bff;
}

.dark-mode .hero-subtitle,
.dark-mode .about-text,
.dark-mode .project-card p {
  color: #aaa;
}

.dark-mode .project-card{
  background-color: #222233;
  box-shadow: 0 16px 40px rgb(0 0 0 / 0.2);
  color: #d3d3f2;
}

.dark-mode .contact-icons {
  color: #a29bff;
}

/* ==== Responsive ==== */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }

  .hero-right {
    max-width: 250px;
    margin: 0 auto;
  }

  .hero-title {
    font-size: 2.5rem;
  }
}

@media (max-width: 480px) {
  .nav-list {
    display: none;
  }
}
