/* ===== Portfolio Mugi — custom layer di atas Tailwind ===== */

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: #dbeafe;
  color: #1d4ed8;
}

/* ---- Brand Ruangajar ---- */
.brand-text {
  font-family: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ---- Navbar underline (hover & section aktif) ---- */
.nav-link {
  position: relative;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb, #7c3aed);
  opacity: 0;
  transition: width 0.3s ease, opacity 0.3s ease;
}
.nav-link:hover::after,
.nav-link.active::after {
  width: 28px;
  opacity: 1;
}

/* ---- Navbar: transparan -> solid saat scroll ---- */
#navbar {
  background: transparent;
  transition: background 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease;
}
#navbar.nav-solid {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.06), 0 8px 24px -14px rgba(37, 99, 235, 0.2);
}

/* ---- Pola grid lembut di hero ---- */
.bg-grid {
  background-image:
    linear-gradient(rgba(37, 99, 235, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
}

/* ---- Blob mengambang lambat ---- */
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(12px, -18px) scale(1.06); }
}
.animate-float {
  animation: float 9s ease-in-out infinite;
}

/* ---- Fade-in lambat kartu Keahlian ---- */
.fade-card {
  opacity: 0;
}
.fade-card.play {
  animation-name: fade-card-in;
  animation-duration: 1.1s;
  animation-timing-function: ease-out;
  animation-fill-mode: forwards;
}
@keyframes fade-card-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ---- Tombol kembali ke atas ---- */
#backToTop {
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}
#backToTop.show {
  opacity: 1;
  visibility: visible;
  transform: none;
}

/* ---- Scrollbar halus ---- */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

@media (prefers-reduced-motion: reduce) {
  .animate-float { animation: none; }
  .fade-card { opacity: 1; animation: none; }
  html { scroll-behavior: auto; }
}