:root {
  /* Dark theme (default) */
  --navy: #0a192f;
  --light-navy: #112240;
  --lightest-navy: #233554;
  --slate: #8892b0;
  --light-slate: #a8b2d1;
  --lightest-slate: #ccd6f6;
  --white: #e6f1ff;
  --green: #64ffda;
  --green-bright: #00ff99;
  --navbar-bg: #0a192f;  
  --subtitle-color: #a8b2d1;
  --heading-color: #e6f1ff;
  --card-title-color: #e6f1ff;
  --card-desc-color: #8892b0;
  --card-hover-bg: #1B3C53;
  --footer-text-color: #a8b2d1;
}

/* Sun theme override */
:root.sun-theme {
  --navy: #f0eadcea;
  --light-navy: #576238;
  --lightest-navy: #F0EADC;
  --slate: #576238;
  --light-slate: #576238;
  --lightest-slate: #F0EADC;
  --white: #F0EADC;
  --green: #e9a419;
  --green-bright: #FFD95D;
  --navbar-bg: #FFF7DD;
  --subtitle-color: #333333;
  --heading-color: #444444;
  --card-title-color: #2a2a2a;
  --card-desc-color: #222220;
  --card-hover-bg: #FFF7DD;
  --footer-text-color: #333333;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Roboto', sans-serif;
  background-color: var(--navy);
  color: var(--lightest-slate);
  line-height: 1.6;
  padding-top: 70px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

a { 
  color: var(--green); 
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--green-bright);
}

section {
  padding: 60px 20px;
  max-width: 1000px;
  margin: 0 auto;
}

h2 {
  color: var(--heading-color);
  font-size: 2em;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--green);
  display: inline-block;
  padding-bottom: 5px;
}

h5 { 
  color: var(--green); 
  margin-top: 10px; 
  margin-bottom: 5px; 
}

p, li { 
  color: var(--light-slate); 
}

ul { 
  list-style: none; 
  margin-left: 0; 
  padding-left: 0; 
}

.skills {
  display: flex; 
  flex-wrap: wrap; 
  gap: 10px;
}

.skills span {
  background-color: var(--light-navy);
  color: var(--green-bright);
  padding: 5px 12px;
  border-radius: 5px;
  font-size: 0.9em;
  transition: background-color 0.3s ease;
}

header { 
  background-color: var(--light-navy); 
  padding: 50px 20px; 
  text-align: center;
  transition: background-color 0.3s ease;
}

header h1 { 
  font-size: 3em; 
  color: var(--white); 
  margin-bottom: 8px; 
}

header p { 
  margin-bottom: 8px; 
  color: var(--subtitle-color); 
}

#treeContainer { 
  margin: 0 auto; 
  width: 100%; 
  max-width: 400px; 
  height: 400px;
  display: flex;
  justify-content: center;
  align-items: center;
}

canvas { 
  display: block; 
  margin: 0 auto; 
  border-radius: 10px; 
  max-width: 100%;
  height: auto;
}

@media(max-width: 700px) { 
  header h1 { font-size: 2em; } 
}

/* ABOUT ME */
.about-me ul { 
  list-style: none; 
  padding-left: 20px; 
  position: relative; 
}

.about-me ul li { 
  position: relative; 
  margin-bottom: 8px; 
  padding-left: 25px; 
  color: var(--light-slate); 
}

.about-me ul li::before { 
  content: "▹"; 
  position: absolute; 
  left: 0; 
  top: 50%; 
  transform: translateY(-50%); 
  color: var(--green); 
  font-weight: bold; 
}

.highlight { 
  color: var(--green); 
  font-weight: 500; 
}

/* EXPERIENCE SECTION */
.experience-item {
  margin-bottom: 2rem;
}

.experience-item h5 {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.experience-item p {
  font-style: italic;
  color: var(--slate);
  margin-bottom: 0.5rem;
}

.experience-item ul {
  padding-left: 20px;
}

.experience-item ul li {
  position: relative;
  margin-bottom: 0.5rem;
  padding-left: 25px;
}

.experience-item ul li::before {
  content: "▹";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  color: var(--green);
  font-weight: bold;
}

/* EDUCATION SECTION */
.education-item {
  margin-bottom: 1.5rem;
}

.education-item h5 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.education-item p {
  color: var(--slate);
  font-size: 0.95rem;
  margin: 0.25rem 0;
}

/* PROJECTS SECTION */
#projects { 
  margin: auto; 
  padding-top: 80px; 
  max-width: 1000px; 
  min-height: 50vh; 
}

.projects-grid { 
  display: grid; 
  grid-template-columns: repeat(3, minmax(250px, 1fr)); 
  grid-gap: 15px; 
}

@media (max-width: 1080px) { 
  .projects-grid { 
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); 
  } 
}

.projects-card {
  position: relative;
  cursor: default;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.25rem 1rem;
  background-color: var(--light-navy);
  border-radius: 16px;
  transition: transform 0.15s ease, background-color 0.3s ease;
}

.projects-card:hover { 
  transform: translateY(-5px); 
  background-color: var(--card-hover-bg); 
}; 


.fade-in-section { 
  opacity: 0; 
  transform: translateY(15px); 
  transition: opacity 0.6s ease-out, transform 0.6s ease-out; 
}

.fade-in-section.is-visible { 
  opacity: 1; 
  transform: translateY(0); 
}

.card-header { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  margin-bottom: 10px; 
  padding-bottom: 3px; 
}

.folder-icon svg { 
  width: 30px; 
  height: 30px; 
  stroke: var(--green-bright); 
}

.external-links a { 
  margin-left: 8px; 
  font-size: 18px; 
  color: var(--lightest-slate); 
  transition: color 0.3s, transform 0.3s; 
}

.external-links a:hover { 
  color: var(--green-bright); 
  transform: scale(1.15); 
  cursor: pointer; 
}

.card-title { 
  font-family: "NTR", sans-serif; 
  color: var(--card-title-color); 
  font-size: 20px; 
  font-weight: bold; 
  margin-bottom: 8px; 
}

.card-desc { 
  font-family: "NTR", sans-serif; 
  color: var(--card-desc-color); 
  font-size: 16px; 
  padding-bottom: 25px; 
  line-height: 1.3; 
}

.card-tech { 
  font-family: "NTR", sans-serif; 
  color: var(--slate); 
  font-size: 14px; 
  font-weight: 500; 
}

.github-icon svg,
.open-icon svg { 
  transition: fill 0.3s ease, transform 0.3s ease; 
  display: inline-block; 
  vertical-align: middle; 
}

.github-icon:hover svg,
.open-icon:hover svg { 
  fill: var(--green-bright); 
  transform: scale(1.15); 
}

@media only screen and (max-width: 600px) {
  #projects { 
    padding-left: 10px; 
    padding-right: 10px; 
    min-height: unset; 
  }
  .projects-grid { 
    grid-template-columns: 1fr; 
    gap: 12px; 
  }
}

/* FOOTER */
footer {
  background-color: var(--light-navy);
  color: var(--lightest-slate);
  padding: 20px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  border-top: 2px solid var(--green);
  transition: background-color 0.3s ease;
}

.footer-content { 
  display: flex; 
  justify-content: space-between; 
  width: 100%; 
  align-items: center; 
}

.footer-text { 
  text-align: center; 
  flex: 1; 
}

.footer-text p { 
  margin: 2px 0; 
  font-size: 0.9em; 
  color: var(--footer-text-color); 
}

/* THEME TOGGLE */
.theme-toggle { 
  cursor: pointer; 
  width: 60px; 
  height: 60px; 
  position: fixed; 
  bottom: 20px; 
  right: 20px; 
  z-index: 999;
  transition: transform 0.3s ease;
}

.theme-toggle:hover {
  transform: scale(1.1);
}

#toggleBg { 
  transition: fill 0.5s ease; 
}

#sunRays, #moon { 
  transition: opacity 0.5s ease, transform 0.5s ease; 
}

/* NAVBAR */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 2rem;
  background-color: var(--navbar-bg);
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  transition: background-color 0.3s ease;
}

.navbar-left {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.navbar-brand {
  font-family: "NTR", sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--green);
}

.nav-links {
  display: flex;
  gap: 1.5rem;
}

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

.nav-links a:hover {
  color: var(--green-bright);
}

/* SOCIAL ICONS */
.social-icons {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.social-icons a {
  display: flex;
  color: var(--slate);
  transition: color 0.3s ease;
}

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

.social-svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* MOBILE NAVBAR */
@media (max-width: 800px) {
  .navbar {
    padding: 0.5rem 1rem;     
    flex-wrap: nowrap;
    justify-content: space-between;         
    gap: 0.25rem;
  }

  .navbar-left {
    width: 100%;
    justify-content: center;
    gap: 1rem;
    order: 1;
    padding: 0.2rem 0;
  }

  .navbar-brand {
    font-size: 0.75rem;
  }

  .nav-links {
    order: 2;
    width: 100%;
    display: flex;
    justify-content: flex-start;
    gap: 12px;
    flex-wrap: nowrap;
    padding: 0.25rem 0;
    margin: 0;
  }

  .social-icons {
    order: 3;
    width: 100%;
    justify-content: flex-end;
    gap: 10px;
    padding: 0;
  }

  .social-icons a { padding: 6px; }
  .social-svg { width: 20px; height: 20px; }
}

@media (max-width: 420px) {
  .nav-links { gap: 8px; font-size: 0.75rem; }
  .navbar-left { gap: 0.6rem; }
}

/* PET PROJECTS CAROUSEL SECTION */
#pet-projects {
  padding: 20px 20px 60px;
  max-width: 1000px;
  margin: 0 auto;
}

.carousel-container {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: 40px auto 0;
  overflow: hidden;
}

.carousel-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 12px;
}

.carousel-track {
  display: flex;
  transition: transform 0.5s ease-in-out;
}

.carousel-slide {
  min-width: 100%;
  flex-shrink: 0;
}

.project-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.project-image-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  overflow: hidden;
  border-radius: 12px;
  background-color: var(--light-navy);
}

.project-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.project-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    rgba(10, 25, 47, 0.3) 0%,
    rgba(10, 25, 47, 0.7) 50%,
    rgba(10, 25, 47, 0.95) 100%
  );
  display: flex;
  align-items: flex-end;
  padding: 30px;
  opacity: 1;
  transition: background 0.3s ease;
}

:root.sun-theme .project-overlay {
  background: linear-gradient(
    to bottom,
    rgba(240, 234, 220, 0.3) 0%,
    rgba(240, 234, 220, 0.7) 50%,
    rgba(240, 234, 220, 0.95) 100%
  );
}

.project-link:hover .project-image {
  transform: scale(1.05);
  filter: brightness(1.1);
}

.project-link:hover .project-overlay {
  background: linear-gradient(
    to bottom,
    rgba(10, 25, 47, 0.5) 0%,
    rgba(10, 25, 47, 0.8) 50%,
    rgba(10, 25, 47, 0.98) 100%
  );
}

:root.sun-theme .project-link:hover .project-overlay {
  background: linear-gradient(
    to bottom,
    rgba(240, 234, 220, 0.5) 0%,
    rgba(240, 234, 220, 0.8) 50%,
    rgba(240, 234, 220, 0.98) 100%
  );
}

.project-content {
  width: 100%;
}

.project-content h3 {
  color: var(--green);
  font-size: 1.8em;
  margin-bottom: 10px;
  font-weight: 600;
}

.project-description {
  color: var(--lightest-slate);
  font-size: 1em;
  line-height: 1.5;
  margin-bottom: 12px;
}

:root.sun-theme .project-description {
  color: #000000;
}

.project-tech {
  color: var(--slate);
  font-size: 0.9em;
  font-style: italic;
  margin-bottom: 15px;
}

.project-links {
  display: flex;
  gap: 15px;
}

.project-icon {
  color: var(--lightest-slate);
  transition: color 0.3s ease, transform 0.3s ease;
  display: inline-flex;
}

.project-icon:hover {
  color: var(--green-bright);
  transform: scale(1.15);
}

/* Carousel Controls */
.carousel-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(10, 25, 47, 0.8);
  border: 2px solid var(--green);
  color: var(--green);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
}

:root.sun-theme .carousel-control {
  background-color: rgba(240, 234, 220, 0.9);
  border-color: var(--green);
}

.carousel-control:hover {
  background-color: var(--green);
  color: var(--navy);
  transform: translateY(-50%) scale(1.1);
}

.carousel-control.prev {
  left: 20px;
}

.carousel-control.next {
  right: 20px;
}

/* Carousel Indicators */
.carousel-indicators {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 25px;
}

.indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--slate);
  border: 2px solid var(--slate);
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}

.indicator:hover {
  background-color: var(--green);
  border-color: var(--green);
  transform: scale(1.2);
}

.indicator.active {
  background-color: var(--green);
  border-color: var(--green);
  width: 30px;
  border-radius: 6px;
}

/* Responsive Design */
@media (max-width: 768px) {
  #pet-projects {
    padding: 60px 15px 40px;
  }

  .carousel-control {
    width: 40px;
    height: 40px;
  }

  .carousel-control.prev {
    left: 10px;
  }

  .carousel-control.next {
    right: 10px;
  }

  .project-overlay {
    padding: 20px;
  }

  .project-content h3 {
    font-size: 1.4em;
  }

  .project-description {
    font-size: 0.9em;
  }

  .project-tech {
    font-size: 0.85em;
  }
}

@media (max-width: 480px) {
  .carousel-control {
    width: 35px;
    height: 35px;
  }

  .project-content h3 {
    font-size: 1.2em;
  }

  .project-description {
    font-size: 0.85em;
    margin-bottom: 8px;
  }

  .project-links {
    gap: 12px;
  }

  .project-icon svg {
    width: 18px;
    height: 18px;
  }
}