* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
a {
  color: inherit;
  text-decoration: none;
  display: block;
  width: 100%;
  height: 100%;
}
body {
  font-family: "Open Sans", sans-serif;
  overflow-x: hidden;
  min-height: 100vh;
}
::selection {
  background-color: #f7ca18;
  color: #1b1b1b;
}

nav {
  width: 100%;
  background: linear-gradient(45deg, #64ff6b6b, #644ecdc4, #6445b7d1, #6496c93d);
  background-size: 400%;
  position: fixed;
  bottom: 0;
  height: 60px;
  overflow: hidden;
  z-index: 1000;
  animation: gradient 15s ease infinite;
}
nav ul {
  position: absolute;
  top: 0;
  left: 0;
  list-style: none;
  width: 125vw;
}
nav li {
  float: left;
  height: 58px;
  line-height: 60px;
  width: 25vw;
  text-align: center;
  color: #fff;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 4px;
  font-weight: 800;
  transform: translateY(100%);
  transition: 0.3s;
}
nav li.active {
  background: rgba(0, 0, 0, 0.5);
  color: #f7ca18;
}
nav li.active::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: #f7ca18;
}
nav li:nth-child(1) {
  animation: pop 0.5s 0.15s forwards;
}
nav li:nth-child(2) {
  animation: pop 0.5s 0.3s forwards;
}
nav li:nth-child(3) {
  animation: pop 0.5s 0.45s forwards;
}
nav li:nth-child(4) {
  animation: pop 0.5s 0.6s forwards;
}
nav li:nth-child(5) {
  animation: pop 0.5s 0.75s forwards;
}
nav li:hover {
  color: #f7ca18;
  background: rgba(0, 0, 0, 0.3);
}
nav li.slide {
  position: absolute;
  left: 0;
  top: 0;
  background: #f7ca18;
  z-index: -1;
  height: 2px;
  margin-top: 98px;
  width: 25vw;
  transition: left 0.3s;
}

.burger-icon {
  display: none;
  position: absolute;
  left: 20px;
  bottom: 20px;
  width: 30px;
  height: 20px;
  cursor: pointer;
  z-index: 1001;
}
.burger-icon span {
  display: block;
  width: 100%;
  height: 4px;
  background: #fff;
  margin-bottom: 5px;
  transition: 0.3s;
}
.burger-icon.active span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}
.burger-icon.active span:nth-child(2) {
  opacity: 0;
}
.burger-icon.active span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

.page-container {
  position: relative;
  width: 100%;
  min-height: 100vh;
}
.page {
  position: fixed;
  top: 0;
  left: 100%;
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: left 0.5s ease;
  padding: 20px;
  background-size: cover;
  background-position: center;
}
.page.active {
  left: 0;
}
#home {
  background-image: url("https://i.redd.it/rrzqvoesvhd91.jpg");
}
#about {
  background-image: url("https://i.redd.it/z14h3a6lx8741.png");
}
#portfolio {
  background-image: url("https://images.pexels.com/photos/1323550/pexels-photo-1323550.jpeg");
}
#contact {
  background-image: url("https://images.pexels.com/photos/21787/pexels-photo.jpg");
}
#home #tsparticles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.page .content {
  max-width: 800px;
  width: 90%;
  text-align: center;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  max-height: 80vh;
  overflow-y: auto;
}
.page .content h2 {
  font-size: 2.5rem;
  margin-bottom: 20px;
  animation: fadeIn 1s ease;
}
.page .content p {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 20px;
  animation: fadeIn 1s ease 0.2s both;
}

form {
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-width: 400px;
  margin: 0 auto;
}
form input,
form textarea {
  padding: 10px;
  border: none;
  border-radius: 5px;
  font-size: 1rem;
}
form button {
  padding: 10px;
  background: #f7ca18;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  color: #1b1b1b;
}
form button:hover {
  background: #e0b015;
}

/* === PORTFOLIO CAROUSEL === */
.portfolio-carousel {
  overflow: hidden;
  width: 100%;
  max-width: 95%;
  margin: 30px auto;
  height: 220px;
  position: relative;
  padding: 0 50px;
  box-sizing: border-box;
}
.carousel-track {
  display: flex;
  width: max-content;
  height: 100%;
  align-items: center;
  gap: 16px;
  transition: transform 0.5s ease;
}
.portfolio-item {
  flex: 0 0 auto;
  width: 210px;
  text-align: center;
  transition: transform 0.3s ease;
}
.portfolio-item img {
  width: 200px;
  height: 150px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
  transition: 0.3s;
}
.portfolio-item:hover {
  transform: translateY(-6px);
}
.portfolio-item:hover img {
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.25);
  transform: scale(1.03);
}
.portfolio-item p {
  margin-top: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #222;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Tombol Glass */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: white;
  font-size: 1.4rem;
  font-weight: bold;
  cursor: pointer;
  z-index: 10;
  transition: 0.3s;
}
.carousel-btn:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: translateY(-50%) scale(1.15);
}
.carousel-btn.prev {
  left: 5px;
}
.carousel-btn.next {
  right: 5px;
}

/* Responsif Mobile */
@media (max-width: 768px) {
  nav ul {
    display: none;
    position: fixed;
    bottom: 60px;
    left: 0;
    width: 100%;
    background: inherit;
    flex-direction: column;
    padding: 20px 0;
    transform: translateY(100%);
    transition: 0.3s;
    z-index: 1000;
  }
  nav ul.active {
    display: flex;
    transform: translateY(0);
  }
  nav li {
    width: 100%;
    height: 50px;
    line-height: 50px;
    font-size: 14px;
    transform: none;
  }
  nav li.slide {
    display: none;
  }
  .burger-icon {
    display: block;
  }
  .page .content {
    width: 95%;
    padding: 15px;
    max-height: 70vh;
  }
  .page .content h2 {
    font-size: 1.8rem;
  }
  .portfolio-carousel {
    height: 180px;
    padding: 0 40px;
  }
  .carousel-track {
    gap: 10px;
  }
  .portfolio-item {
    width: 170px;
  }
  .portfolio-item img {
    width: 160px;
    height: 120px;
  }
  .carousel-btn {
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
  }
}

/* Animasi */
@keyframes pop {
  0% {
    transform: translateY(100%);
  }
  100% {
    transform: translateY(0);
  }
}
@keyframes fadeIn {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes gradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}
