:root {
    --text-colour: #ffffff;
    --link-colour: MediumOrchid;
    --background-colour: #090909;
}

*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body{
    background-color: var(--background-colour);
    color: #ffffff;
    font-family: Arial, Helvetica, sans-serif;
}
html {
    scroll-behavior: smooth;
}
a {
    color: var(--link-colour);
    text-decoration: none;
}

/* Navigation Bar */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0; /* keep at top */
  background-color: var(--background-colour); /* solid background */
  z-index: 1000; /* stays above content */
  padding: 0 50px;
  height: 80px;
}


nav .left a {
    font-size: 22px;
    font-weight: 600;
}

nav .right a {
    color: var(--text-colour);
    margin: 0 15px;
}

nav .right a:last-child {
    color: var(--background-colour);
    background-color: var(--text-colour);
    padding: 5px 10px;
    border-radius: 5px;
}

nav .right a span {
    margin-left: 5px;
}

/* --- Top Section --- */
#top {
  padding: 100px 20px;
}

#top .intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
}

#top .intro-text {
  flex: 1;
}

#top h1 {
  font-size: 3rem;
  margin-bottom: 20px;
}

#top h1 span {
  color: var(--link-colour);
}

#top img {
  width: 330px;
  height: auto;
  border-radius: 20px; /* rounded square */
  border: 4px solid var(--link-colour);
  object-fit: cover;
}

/* Nav buttons */
#top .section-nav {
  margin-top: 20px;
}

#top .section-nav a {
  margin-right: 15px;
  padding: 10px 20px;
  background: var(--link-colour);
  color: var(--background-colour);
  border-radius: 6px;
  font-weight: bold;
  transition: 0.3s;
}

#top .section-nav a:hover {
  opacity: 0.8;
}

#about {
  max-width: 1100px;
  margin: 100px auto 50px; /* space for fixed nav */
  padding: 0 20px;
  line-height: 1.6;
  text-align: center;
}

#about h2 {
  font-size: 2rem;
  margin-bottom: 40px;
}

/* Carousel container */
.carousel {
  max-width: 800px;
  padding: 10px 0;
  margin: 0 auto;
  position: relative;
}

/* Cards */
.about-card {
  background: #111;
  padding: 30px;
  border-radius: 10px;
  text-align: left;
  display: none; /* hide by default */
  transition: transform 0.3s, opacity 0.3s;
}

.about-card.active {
  display: block; /* show selected card */
}

/* Card headings */
.about-card h3 {
  margin-bottom: 15px;
  font-size: 1.5rem;
  color: var(--link-colour);
}

/* Nav dots */
.carousel-nav {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.carousel-nav span {
  width: 12px;
  height: 12px;
  background: #555;
  border-radius: 50%;
  display: inline-block;
  cursor: pointer;
  transition: background 0.3s;
}

.carousel-nav span.active,
.carousel-nav span:hover {
  background: var(--link-colour);
}

/* Carousel arrows */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--link-colour);
  color: var(--background-colour);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
}

.carousel-btn:hover {
  background: #00d1a0; /* slightly brighter aquamarine */
}

.carousel-btn.prev {
  left: -50px;
}

.carousel-btn.next {
  right: -50px;
}

.resume-btn {
  display: inline-block;
  margin-top: 20px;
  padding: 10px 20px;
  color: var(--text-colour);
  text-decoration: none;
  border-radius: 5px;
  transition: color 0.3s ease;
}

.resume-btn i {
  margin-right: 8px;
}

.resume-btn:hover {
  color: var(--link-colour);
}


/* --- Projects Section --- */
#projects {
  padding: 80px 20px;
  text-align: center;
}

#projects h2 {
  font-size: 2rem;
  margin-bottom: 40px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.project-grid img {
  width: 100%;
  border-radius: 10px;
  transition: transform 0.3s, filter 0.3s;
  filter: brightness(60%) saturate(120%);
}

.project-grid img:hover {
  transform: scale(1.05);
  filter: brightness(100%) saturate(100%); 
}

.project-grid a {
  display: block;
  text-align: center;
  color: var(--text-colour);
}

.project-grid h3 {
  margin-top: 10px;
  font-size: 1.1rem;
}

/* --- Project Detail Pages --- */
.project-page {
  max-width: 900px;
  margin: 100px auto 50px; /* space for fixed nav */
  padding: 0 20px;
  line-height: 1.6;
}

.project-header {
  text-align: center;
  margin-bottom: 30px;
}

.project-header h1 {
  font-size: 2.2rem;
  margin-bottom: 10px;
}

.project-date {
  font-size: 0.9rem;
  color: var(--secondary-text, #aaa);
}

.project-content img {
  display: block;
  max-width: 100%;
  margin: 20px auto;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.project-content h2 {
  margin-top: 30px;
  font-size: 1.5rem;
}

.project-footer {
  margin-top: 40px;
  text-align: center;
}

.back-link {
  text-decoration: none;
  color: var(--link-colour);
  font-weight: bold;
}

.back-link:hover {
  text-decoration: underline;
}

/* Image grid for project pages */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin: 20px 0;
}

.image-grid img {
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  transition: transform 0.3s, filter 0.3s;
}

.image-grid img:hover {
  transform: scale(1.03);
  filter: brightness(110%);
}

.video-container {
        position: relative;
        width: 100%; /* Or any desired variable width */
        padding-bottom: 56.25%; /* 16:9 aspect ratio (9 / 16 * 100%) */
        height: 0;
        overflow: hidden;
    }

.video-container iframe {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
}

@media (max-width: 800px) {
  nav {
    padding: 0 20px;
  }

  nav .right a {
    font-size: 22px;
  }

  nav .right a:last-child {
    color: var(--text-colour);
    background-color: transparent;
    padding: 0;
  }

  nav .right a span {
    display: none;
  }

  .project-grid {
    grid-template-columns: repeat(2, 1fr); /* 2x2 on smaller screens */
  }

  #top .intro {
    flex-direction: column;
    text-align: center;
  }

  #top img {
    margin-top: 20px;
    width: 180px;
  }

  #top .section-nav a {
    margin: 10px;
  }

  .about-intro {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .about-nav {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  .about-nav li {
    margin: 5px;
  }

  .about-card {
    padding: 20px;
  }

  .carousel-nav {
    margin-top: 15px;
  }

  /* --- Carousel Fixes --- */
  .carousel {
    position: relative;
    overflow: hidden;
    padding: 0 40px; /* space for arrows */
  }

  .carousel-card {
    max-width: calc(100% - 60px); /* leave space for arrows */
    margin: 0 auto;
  }

  .carousel-btn {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

  .carousel-btn.prev {
    left: 0; /* sit at container edge */
    transform: translateY(-50%);
  }

  .carousel-btn.next {
    right: 0; /* sit at container edge */
    transform: translateY(-50%);
  }
}
