/* ========== RESET ========== */
* {margin:0; padding:0; box-sizing:border-box; font-family:'Poppins',sans-serif;}
body {background:#111; color:#fff; overflow-x:hidden;}

/* Fade-in Animation (Global) */
/* Animasi masuk hanya untuk elemen tertentu, bukan seluruh section */
.timeline-item, .portfolio-item, .cert-item {
  opacity: 0;
  transform: translateY(40px);
  animation: fadeUp 1s forwards;
}

@keyframes fadeUp {
  to {opacity:1; transform:translateY(0);}
}

/* ========== NAVBAR ========== */
.navbar {
  position:fixed; 
  top:20px; 
  left:50%; 
  transform:translateX(-50%);
  width:90%; 
  max-width:1100px;
  background:rgba(255,255,255,0.08); 
  backdrop-filter:blur(15px);
  border-radius:50px; 
  padding:15px 25px;
  display:flex; 
  justify-content:space-between; 
  align-items:center;
  box-shadow:0 8px 32px rgba(0,0,0,0.4); 
  z-index:1000;
  transition: background 0.3s, border-radius 0.3s;
}
.navbar.open {
  background:rgba(0,0,0,0.9);
  border-radius:20px;
}

.logo {
  font-size:1.4rem; font-weight:600; color:#ffdd00; animation: pulse 2s infinite;
}
@keyframes pulse {
  0%,100% {text-shadow:0 0 5px #ffdd00;}
  50% {text-shadow:0 0 20px #ffdd00;}
}

.nav-links {
  list-style:none; 
  display:flex; 
  gap:25px;
}

.nav-links a {
  color:#fff; text-decoration:none; font-weight:500; position:relative;
}
.nav-links a::after {
  content:""; position:absolute; bottom:-5px; left:0; width:100%; height:2px; background:#d6001c;
  transform:scaleX(0); transition:transform 0.3s;
}
.nav-links a:hover::after {transform:scaleX(1);}

/* Toggle button */
.menu-toggle {
  display:none;
  font-size:1.6rem;
  color:#fff;
  cursor:pointer;
  user-select:none;
}

/* ========== HERO ========== */
.hero {
  height:100vh; display:flex; justify-content:center; align-items:center; text-align:center; padding:0 10%;
  background:linear-gradient(-45deg,#1a1a1a,#3a0d11,#5c0010,#111);
  background-size:400% 400%; animation:gradientMove 12s ease infinite;
}
@keyframes gradientMove {
  0%{background-position:0% 50%}
  50%{background-position:100% 50%}
  100%{background-position:0% 50%}
}
.hero h1 {font-size:3rem; margin-bottom:15px; animation:fadeUp 1s 0.3s forwards;}
.hero h1 span {color:#ffdd00;}
.hero p {font-size:1.2rem; margin-bottom:20px; animation:fadeUp 1s 0.6s forwards;}
.btn {
  padding:12px 28px; border-radius:30px; background:#d6001c; color:#fff; text-decoration:none; font-weight:600;
  transition:0.3s; display:inline-block; animation:bounce 2s infinite;
}
.btn:hover {background:#ffdd00; color:#000;}
@keyframes bounce {
  0%,100% {transform:translateY(0);}
  50% {transform:translateY(-6px);}
}

/* ========== ABOUT ========== */
.about {padding:80px 10%; background:#181818;}
.about-container {display:flex; flex-wrap:wrap; gap:40px; align-items:center;}
.about-img img {width:200px; border-radius:20px; box-shadow:0 10px 25px rgba(0,0,0,0.5); transition:transform 0.4s;}
.about-img img:hover {transform:scale(1.08);}
.about-text {flex:1;}
.about-text h2 {color:#ffdd00; margin-bottom:15px;}

/* ========== SKILLS ========== */
.skills {padding:80px 10%; background:#111; text-align:center;}
.skills h2 {color:#ffdd00; margin-bottom:30px;}
.skill-bars {max-width:600px; margin:0 auto;}
.bar {margin-bottom:20px; animation:fadeUp 1s ease forwards;}
.bar span {display:block; text-align:left; margin-bottom:6px;}
.progress {height:10px; background:#333; border-radius:10px; overflow:hidden;}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg,#d6001c,#ffdd00);
  border-radius: 10px;
  width: 0; /* mulai dari 0 */
  transition: width 1.5s ease; /* animasi smooth */
}

@keyframes fill {from{width:0} to{width:100%}}

/* ========== TIMELINE (Education & Experience) ========== */
.edu-exp {
  padding: 80px 10%;
  background: #111;
  color: #fff;
}

.edu-exp h2 {
  text-align: center;
  color: #ffdd00;
  margin-bottom: 40px;
  font-size: 2rem;
}

.edu-exp .sub-section {
  margin-bottom: 50px;
}

.edu-exp .sub-section h3 {
  color: #ffdd00;
  margin-bottom: 20px;
  font-size: 1.5rem;
  border-bottom: 2px solid rgba(255,255,255,0.1);
  padding-bottom: 8px;
  text-align: left;
  text-align: center;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 700px;
  margin: 0 auto;
  text-align: left;
}

.timeline-item {
  background: rgba(255,255,255,0.05);
  padding: 20px;
  border-radius: 12px;
  transition: 0.3s;
  position: relative;
}

.timeline-item:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 6px 15px rgba(0,0,0,0.4);
}

.timeline-item .year {
  font-weight: bold;
  color: #ffdd00;
  display: block;
  margin-bottom: 5px;
}

/* Read more */
.read-more {
  color: #ddd;
  text-decoration: none;
  position: relative;
  transition: color 0.3s;
  font-weight: 500;
  display: inline-block;
  margin-top: 8px;
}

.read-more::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 0%;
  height: 2px;
  background: #ffdd00;
  transition: width 0.3s ease;
}

.read-more:hover {
  color: #ffdd00;
}

.read-more:hover::after {
  width: 100%;
}

/* ========== PORTFOLIO ========== */
.portfolio {
  padding: 80px 10%;
  background: #181818;
  text-align: center;
}

.portfolio h2 {
  color: #ffdd00;
  margin-bottom: 30px;
}

/* Grid layout */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

/* Item */
.portfolio-item {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
}

.portfolio-item img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  display: block;
  transition: transform 0.5s;
}

/* Overlay default (PC: hidden dulu) */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  background: linear-gradient(to top, rgba(0,0,0,0.7), rgba(0,0,0,0));
  opacity: 0;
  transition: opacity 0.4s;
  padding: 15px;
}

.overlay-content {
  text-align: center;
}

.overlay h3 {
  color: #ffdd00;
  font-size: 18px;
  margin-bottom: 12px;
}

/* Tombol Lihat Hasil */
.lihat-hasil {
  display: inline-block;
  padding: 6px 15px;
  border: 1px solid #ffdd00;
  border-radius: 20px;
  color: #ffdd00;
  font-size: 14px;
  transition: 0.3s;
  text-decoration: none;
}

.lihat-hasil:hover {
  background: #ffdd00;
  color: #000;
}

/* Hover effect untuk PC */
.portfolio-item:hover img {
  transform: scale(1.1);
}

.portfolio-item:hover .overlay {
  opacity: 1;
}

/* ========== CERTIFICATES ========== */
.certificates {padding:80px 10%; background:#181818; text-align:center;}
.certificates h2 {color:#ffdd00; margin-bottom:30px;}
.cert-grid {display:grid; grid-template-columns:repeat(auto-fit,minmax(120px,1fr)); gap:15px;}
.cert-item {
  background:rgba(255,255,255,0.05); border-radius:15px; padding:15px; transition:0.3s; cursor:pointer;
}
.cert-item:hover {transform:rotate(-1deg) scale(1.05); box-shadow:0 10px 20px rgba(0,0,0,0.5);}
.cert-item img {width:100%; border-radius:10px; margin-bottom:10px;}
.cert-item p {font-size:0.9rem; color:#ddd;}

/* Modal */
.modal {display:none; position:fixed; z-index:9999; padding-top:80px; left:0; top:0; width:100%; height:100%; background:rgba(0,0,0,0.8);}
.modal-content {
  display:block; margin:auto; max-width:90%; max-height:80vh; border-radius:10px; object-fit:contain;
}
.close {position:absolute; top:30px; right:50px; color:#fff; font-size:40px; font-weight:bold; cursor:pointer;}

/* ========== CONTACT ========== */
.contact {padding:80px 10%; background:#111; text-align:center;}
.contact h2 {color:#ffdd00; margin-bottom:20px;}
.contact-form {
  max-width:500px; margin:0 auto; display:flex; flex-direction:column; gap:15px;
  background:rgba(255,255,255,0.05); padding:20px; border-radius:15px; backdrop-filter:blur(10px);
  animation:fadeUp 1s ease forwards;
}
.contact-form input,.contact-form textarea {
  padding:12px; border:none; border-radius:10px; background:rgba(255,255,255,0.1); color:#fff;
}
.contact-form button {
  padding:12px; border:none; border-radius:25px; background:#d6001c; color:#fff; font-weight:600;
  cursor:pointer; transition:0.3s;
}
.contact-form button:hover {background:#ffdd00; color:#000;}
.contact-links {
  display:flex; gap:20px; justify-content:center; margin-top:20px; flex-wrap:wrap;
}
.contact-links a {
  color:#ddd; text-decoration:none; font-size:1rem; display:flex; align-items:center; gap:8px; transition:0.3s;
}
.contact-links a i {font-size:1.2rem; color:#ffdd00;}
.contact-links a:hover {color:#ffdd00; transform:translateY(-3px);}


/* ========== FOOTER ========== */
footer {text-align:center; padding:20px; background:#000; color:#888;}

/* ========== RESPONSIVE MOBILE (≤768px) ========== */
@media (max-width: 768px) {
  .navbar {
    display: flex;
    flex-direction: column; /* tetap kolom supaya link muncul di bawah */
    align-items: stretch;
    padding: 12px 18px;
    border-radius: 20px;
    top: 10px;
  }

  /* Wrapper atas untuk logo + toggle */
  .navbar-top {
    display: flex;
    justify-content: space-between; /* logo kiri, toggle kanan */
    align-items: center;
    width: 100%;
  }

  /* Logo */
  .logo {
    font-size: 1.1rem;
  }

  /* Toggle icon */
  .menu-toggle {
    font-size: 1.6rem;
    color: #ffffff; /* pastikan kontras dengan background */
    cursor: pointer;
    user-select: none;
    display:block;
  }

  /* Link navbar */
  .nav-links {
    display:none;
    top:70px; right:20px;
    flex-direction:column;
    gap:15px;
    padding:20px;
    border-radius:15px;
  }

  .nav-links {
    display:none;
    flex-direction:column;
    gap:15px;
    margin-top:15px;
    width:100%;
  }

  .nav-links.show {
    display: flex;
  }

  
  /* Hero */
  .hero {
    padding: 0 5%;
  }
  .hero h1 {
    font-size: 1.8rem;
    line-height: 1.3;
  }
  .hero p {
    font-size: 1rem;
    margin-bottom: 15px;
  }
  .btn {
    padding: 10px 22px;
    font-size: 0.9rem;
  }

  /* About */
  .about {
    padding: 50px 6%;
    text-align: center;
  }
  .about-container {
    flex-direction: column;
    gap: 20px;
  }
  .about-img img {
    width: 150px;
  }
  .about-text h2 {
    font-size: 1.4rem;
  }
  .about-text p {
    font-size: 0.9rem;
    line-height: 1.5;
  }

  /* Skills */
  .skills {
    padding: 50px 6%;
  }
  .skills h2 {
    font-size: 1.4rem;
  }
  .bar span {font-size: 0.85rem;}
  .progress {height: 8px;}

  /* Timeline */
  .edu-exp {
    padding: 50px 6%;
  }
  .edu-exp h2 {
    font-size: 1.5rem;
  }
  .edu-exp .sub-section h3 {
    font-size: 1.2rem;
  }
  .timeline-item {
    padding: 15px;
    font-size: 0.9rem;
  }

  /* Portfolio */
  .portfolio {
    padding: 50px 6%;
  }
  .portfolio h2 {
    font-size: 1.5rem;
  }
  .portfolio-item img {
    transform: none !important; /* hilangkan zoom biar rapi */
    height: auto;
  }
  .overlay {
    opacity: 1 !important;   /* overlay langsung muncul */
    position: relative;
    padding: 10px;
    background: rgba(0,0,0,0.7);
  }
  .overlay h3 {
    font-size: 1rem;
  }
  .lihat-hasil {
    font-size: 0.8rem;
    padding: 5px 12px;
  }

  /* Certificates */
  .certificates {
    padding: 50px 6%;
  }
  .certificates h2 {
    font-size: 1.5rem;
  }
  .cert-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .cert-item p {
    font-size: 0.75rem;
  }

  /* Contact */
  .contact {
    padding: 50px 6%;
  }
  .contact h2 {
    font-size: 1.5rem;
  }
  .contact-form {
    padding: 15px;
  }
  .contact-form input,
  .contact-form textarea {
    font-size: 0.9rem;
    padding: 10px;
  }
  .contact-form button {
    font-size: 0.9rem;
    padding: 10px 20px;
  }
  /* Contact */
  .contact-links {
    flex-direction: row;   /* sejajar */
    flex-wrap: wrap;       /* kalau kepanjangan otomatis turun baris */
    justify-content: center;
    gap: 15px;
  }
  .contact-links a {
    font-size: 0.9rem;
  }
  /* Footer */
  footer {
    font-size: 0.8rem;
    padding: 15px;
  }
}

