* {
  box-sizing: border-box;
}

body {
  font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
  background-color: #00142e;
  background-size: 200% 200%;
  text-align: center;
  margin: 0;
  padding-top: 80px;
  /* space for fixed navbar */
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

/* Navbar */
.navbar {
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #0047b1;
  padding: 15px 30px;
  color: white;
  z-index: 1000;
}

/* Logo */
.logo {
  font-size: 1.5rem;
  font-weight: bold;
}

/* Nav Links (desktop default) */
.nav-links {
  list-style: none;
  display: flex;
  gap: 20px;
  margin: 0;
  padding: 0;
}

.nav-links li a {
  color: white;
  text-decoration: none;
  font-size: 1rem;
  transition: color 0.3s ease;
}

.nav-links li a:hover {
  color: #ffda79;
}

/* --- Hamburger Menu --- */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 25px;
  height: 18px;
  cursor: pointer;
  user-select: none;
}

.menu-toggle span {
  display: block;
  height: 3px;
  background-color: white;
  border-radius: 2px;
  transition: all 0.4s ease;
}

/* Transform hamburger into “X” when active */
.menu-toggle.active span:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
    /* show hamburger */
  }

  .nav-links {
    display: flex;
    flex-direction: column;
    background-color: #5f9fff;
    position: absolute;
    top: 55px;
    right: 0;
    width: 100%;
    text-align: center;
    padding: 10px;
    border-radius: 0 0 10px 10px;
    font-size: 60px;

    /* Animation setup */
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.4s ease;
  }

  .nav-links.active {
    max-height: 500px;
    opacity: 0.9;
  }
}

/* Slideshow section */
#home {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: transparent;
  position: relative;
  overflow: hidden;
}

/* Container */
.slideshow {
  position: relative;
  width: 100%;
  max-width: 1200px;
  height: 60vh;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
  margin-top: 40px;
}

/* Slides */
.slide {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1s ease-in-out;
  flex-direction: column;
  align-items: center;
}

.slide.active {
  opacity: 1;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Caption container outside slideshow */
.caption-container {
  margin-top: 20px;
  text-align: center;
  color: #fff;
  font-size: 1.3rem;
  font-weight: 500;
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

/* Show caption when active */
.caption-container.show {
  opacity: 1;
  transform: translateY(0);
}

/* Wrapper to stack slideshow and caption vertically */
.slideshow-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  /* center both horizontally */
  justify-content: center;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

/* Arrows */
.prev,
.next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2.5rem;
  color: white;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
  cursor: pointer;
  user-select: none;
  padding: 0 15px;
  z-index: 10;
  transition: opacity 0.3s;
}

.prev:hover,
.next:hover {
  opacity: 0.7;
}

.prev {
  left: 10px;
}

.next {
  right: 10px;
}

/* Dots */
.dots {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
}

.dot {
  height: 12px;
  width: 12px;
  background-color: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.3s;
}

.dot.active,
.dot:hover {
  background-color: white;
}

/* Scroll smoothly on navbar selection */
html {
  scroll-behavior: smooth;
}

/* About Section */
#about-me {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 30px 10%;
  background: transparent;
  /* your gradient background shows through */
  color: white;
}

/* Container */
.about-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  /*max-width: 1000px;*/
  width: 100%;
}

/* Text on left */
.about-text {
  flex: 1;
  text-align: left;
  color: azure;
  padding-left: 20px;
  font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
}

.about-text h2 {
  font-size: 3.2rem;
  margin-bottom: 20px;
}

.about-text p {
  font-size: 1.6rem;
  line-height: 1.6;
}

/* Divider line */
.divider {
  width: 5px;
  height: 400px;
  background-color: rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

/* Photo on right */
.about-photo {
  flex: 1;
  display: flex;
  justify-content: center;
}

.about-photo img {
  width: 100%;
  max-width: 600px;
  border-radius: 15px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Responsive (stack vertically on mobile) */
@media (max-width: 1152px) {
  .about-container {
    flex-direction: column;
    text-align: center;
  }

  .divider {
    display: none;
    /* hide the line on small screens */
  }

  .about-text p {
    font-size: 1 rem;
    line-height: 1.2;
  }

  .about-photo img {
    width: 100%;
  }
}

/* Fade/slide animation setup */
.about-text,
.about-photo {
  opacity: 1;
  transform: translateY(40px);
  transition: opacity 1s ease, transform 1s ease;
}

/* When visible */
.about-text.visible,
.about-photo.visible {
  opacity: 1;
  transform: translateY(0);
}

#contact {
  text-align: center;
  padding: 60px 0px;
  color: #fff;
}

#contact h1 {
  font-size: 2.5rem;
  margin-bottom: 40px;
}

.contact-wrapper {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 80px;
  flex-wrap: wrap;
}

/* Each contact icon group */
.contact-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.3s ease;
}

/* Use relative sizing so icons scale with viewport width */
.contact-icon img {
  width: clamp(50px, 10vw, 90px);
  /* min 50px, preferred 10% of viewport width, max 90px */
  height: clamp(50px, 10vw, 90px);
  border-radius: 50%;
  margin-bottom: 10px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.contact-icon:hover img {
  transform: scale(1.1);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.contact-icon p {
  margin: 0;
  font-size: 1.1rem;
  color: #ddd;
}

/* 📱 Responsive behavior for mobile */
@media (max-width: 768px) {
  #contact h1 {
    font-size: 2rem;
    margin-bottom: 30px;
  }

  .contact-wrapper {
    gap: 40px;
    /* reduce spacing */
  }

  .contact-icon p {
    font-size: 0.5rem;
  }

  .contact-icon img {
    width: clamp(20px, 10vw, 50px);
    /* min 50px, preferred 10% of viewport width, max 90px */
    height: clamp(20px, 10vw, 50px);
  }
}

#projects-and-skills {
  padding: 50px 10%;
  margin-top: 50px;
  color: #fff;
  text-align: center;
}

#projects-and-skills h1 {
  font-size: 3rem;
  margin-bottom: 40px;
  color: #ddd;
}

/* Resume Button */
.resume-download {
  margin-bottom: 60px;
  margin-top: 30px;
}

.resume-btn {
  background: linear-gradient(90deg, #383838, #4b4b4b);
  color: #ddd;
  padding: 14px 30px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 1.1rem;
  transition: background 0.3s ease, transform 0.2s ease;
}

.resume-btn:hover {
  transform: scale(1.05);
  background: linear-gradient(90deg, #878787, #9b9b9b);
}

/* Project layout */
.project {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 80px;
  gap: 50px;
  flex-wrap: wrap;
  text-align: left;
}

.project.reverse {
  flex-direction: row-reverse;
}

.project-text {
  flex: 1;
  min-width: 300px;
}

.project-text h2 {
  font-size: 1.8rem;
  margin-bottom: 15px;
  color: #ddd;
}

.project-text p {
  font-size: 1.1rem;
  line-height: 1.6;
  color: #ddd;
}

.project-media {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.project-media img,
.project-media video,
.project-media canvas {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}

/* Mobile view */
@media (max-width: 768px) {
  .project {
    flex-direction: column;
    text-align: center;
  }

  .project.reverse {
    flex-direction: column;
  }

  .project-text {
    margin-bottom: 20px;
  }
}

/* 3D container */
.three-container {
  flex: 1;
  width: 100%;
  height: 325px;
  aspect-ratio: 16 / 9;
  max-height: 450px;
  min-height: 100px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  position: relative;
}

.three-container canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.three-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 14px;
  letter-spacing: 0.2px;
  color: rgba(255,255,255,0.85);
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(2px);
  z-index: 2;
  pointer-events: none; /* clicks pass through to canvas */
}

.three-loading.hidden {
  opacity: 0;
  transition: opacity 250ms ease;
}

/* Mobile layout */
@media (max-width: 768px) {
  .project {
    flex-direction: column;
    text-align: center;
  }

  .three-container {
    height: 220px;
    width: 320px;
    padding: 0;
    margin-left: 0;
    margin-right: 0;
  }
}

.explode-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(139, 139, 139, 0.55);
  color: white;
  cursor: pointer;
  backdrop-filter: blur(6px);
  padding: 0;

  /* smooth feel */
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.explode-btn:hover {
  background: rgba(160, 160, 160, 0.75);
  transform: translateY(-1px);
}

/* The SVG itself */
.explode-btn svg {
  width: 16px;
  height: 16px;
  display: block;
  stroke: currentColor;
  transition: transform 240ms cubic-bezier(.2, .8, .2, 1), opacity 160ms ease;
}

/* When exploded, rotate + slightly scale icon */
.explode-btn.is-exploded svg {
  transform: rotate(180deg) scale(1.1);
}

/* Click “pop” animation */
.explode-btn.pulse {
  transform: scale(1.12);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.35);
}