* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  font-family: "DM Sans", sans-serif;
  background: #f8f5f0;
  color: #1a1a1a;
  overflow-x: hidden;
}

/* Animations */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes lineGrow {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}
@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-12px);
  }
}
@keyframes grain {
  0%,
  100% {
    transform: translate(0, 0);
  }
  10% {
    transform: translate(-2%, -3%);
  }
  30% {
    transform: translate(3%, -1%);
  }
  50% {
    transform: translate(-1%, 2%);
  }
  70% {
    transform: translate(2%, 1%);
  }
  90% {
    transform: translate(-3%, 2%);
  }
}

.fade-up {
  opacity: 0;
  animation: fadeUp 0.8s ease forwards;
}
.delay-1 {
  animation-delay: 0.1s;
}
.delay-2 {
  animation-delay: 0.25s;
}
.delay-3 {
  animation-delay: 0.4s;
}
.delay-4 {
  animation-delay: 0.55s;
}
.delay-5 {
  animation-delay: 0.7s;
}

.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition:
    opacity 0.7s ease,
    transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Catatan: fallback untuk kondisi JavaScript dinonaktifkan/gagal dimuat
   (agar .reveal/.fade-up tidak permanen opacity:0) ditangani langsung
   lewat <noscript><style> inline di index.html, karena CSS murni tidak
   bisa mendeteksi "JS aktif atau tidak" tanpa bantuan JS itu sendiri
   (yang justru tidak akan jalan kalau JS-nya yang bermasalah). */

/* Skill bar track (dipakai bersama .skill-bar-fill di bawah) */
.skill-bar-track {
  width: 100%;
  height: 3px;
  background: rgba(200, 168, 130, 0.15);
  overflow: hidden;
}

/* Grain overlay */
body::before {
  content: "";
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.4;
  animation: grain 8s steps(10) infinite;
}

/* Nav */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transition: all 0.3s ease;
}
nav.scrolled {
  background: rgba(248, 245, 240, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(200, 168, 130, 0.2);
}

.nav-link {
  position: relative;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
  color: #1a1a1a;
  transition: color 0.3s;
}
.nav-link::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1px;
  background: #c8a882;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}
.nav-link:hover::after {
  transform: scaleX(1);
}

/* Hero */
.hero-line {
  height: 1px;
  background: #c8a882;
  transform-origin: left;
  animation: lineGrow 1.2s ease 0.8s forwards;
  transform: scaleX(0);
}
.avatar-ring {
  animation: float 4s ease-in-out infinite;
}

/* CTA Button */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #1a1a1a;
  color: #f8f5f0;
  padding: 14px 32px;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
  transition: all 0.3s ease;
  border: 1px solid #1a1a1a;
}
.btn-primary:hover {
  background: transparent;
  color: #1a1a1a;
}
.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: #1a1a1a;
  padding: 14px 32px;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
  transition: all 0.3s ease;
  border: 1px solid #1a1a1a;
}
.btn-outline:hover {
  background: #1a1a1a;
  color: #f8f5f0;
}

/* Skills */
.skill-bar-fill {
  height: 2px;
  background: #c8a882;
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 1s ease;
}
.skill-bar-fill.animated {
  transform: scaleX(1);
}

/* Project card */
.project-card {
  background: white;
  border: 1px solid rgba(200, 168, 130, 0.2);
  transition: all 0.4s ease;
  overflow: hidden;
}
.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 60px rgba(26, 26, 26, 0.1);
}
.project-card:hover .project-img {
  transform: scale(1.04);
}
.project-img {
  transition: transform 0.6s ease;
}

/* Section label */
.section-label {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #c8a882;
  font-weight: 600;
}

/* Mobile menu */
.mobile-menu {
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.mobile-menu.open {
  transform: translateX(0);
}

/* Contact input */
.contact-input {
  background: white;
  border: 1px solid rgba(200, 168, 130, 0.3);
  padding: 14px 18px;
  width: 100%;
  font-family: "DM Sans", sans-serif;
  font-size: 0.95rem;
  color: #1a1a1a;
  transition: border-color 0.3s;
  outline: none;
}
.contact-input:focus {
  border-color: #c8a882;
}
.contact-input::placeholder {
  color: #9ca3af;
}

/* Scrollbar (WebKit: Chrome, Safari, Edge Chromium) */
::-webkit-scrollbar {
  width: 4px;
}
::-webkit-scrollbar-track {
  background: #f8f5f0;
}
::-webkit-scrollbar-thumb {
  background: #c8a882;
  border-radius: 2px;
}

/* Scrollbar (Firefox) */
html {
  scrollbar-width: thin;
  scrollbar-color: #c8a882 #f8f5f0;
}

/* Form status messages */
.error {
  color: #dc2626;
  font-size: 12px;
  margin-top: 4px;
}

/* Status pesan form kontak — menggantikan style.color inline di JS,
   supaya warna tetap konsisten & mudah di-maintain lewat CSS. */
#successMsg.is-error {
  color: #dc2626;
  border-color: rgba(220, 38, 38, 0.2);
  background: rgba(220, 38, 38, 0.05);
}
#successMsg.is-info {
  color: #2563eb;
  border-color: rgba(37, 99, 235, 0.2);
  background: rgba(37, 99, 235, 0.05);
}
#successMsg.is-success {
  color: #059669;
  border-color: rgba(5, 150, 105, 0.2);
  background: rgba(5, 150, 105, 0.05);
}

.hidden {
  display: none;
}
