/* ===== VARIABEL WARNA (ubah tema di sini) ===== */
:root {
  --navy: #0F172A;
  --slate: #1E293B;
  --ink: #F8FAFC;
  --sky: #38BDF8;
  --line: rgba(255,255,255,.1);
}
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--navy); color: var(--ink); font-family: 'Plus Jakarta Sans', system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
:focus-visible { outline: 2px solid var(--sky); outline-offset: 3px; }

/* Canvas animasi jaringan di belakang semua konten */
#bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
main, footer { position: relative; z-index: 1; }

/* Bar progres scroll di paling atas */
#progress { position: fixed; top: 0; left: 0; height: 3px; width: 100%; background: var(--sky); transform: scaleX(0); transform-origin: left; z-index: 60; box-shadow: 0 0 10px var(--sky); }

/* ===== KOMPONEN ===== */
.card { position: relative; overflow: hidden; background: rgba(30,41,59,.85); border: 1px solid var(--line); border-radius: 1rem; transition: border-color .3s, box-shadow .3s; }
/* Cahaya biru yang mengikuti kursor di dalam kartu (--mx / --my diisi JS) */
.card::before { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(260px circle at var(--mx,50%) var(--my,50%), rgba(56,189,248,.18), transparent 70%); }
.card:hover { border-color: rgba(56,189,248,.5); box-shadow: 0 0 24px rgba(56,189,248,.25); }
.card:hover::before { opacity: 1; }

.btn { display: inline-block; padding: .75rem 1.5rem; border-radius: .75rem; font-weight: 600; transition: transform .3s, box-shadow .3s, background .3s; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--sky); color: var(--navy); }
.btn-primary:hover { box-shadow: 0 0 24px rgba(56,189,248,.55); }
.btn-outline { border: 1px solid var(--sky); color: var(--sky); }
.btn-outline:hover { background: rgba(56,189,248,.1); box-shadow: 0 0 18px rgba(56,189,248,.3); }

.chip { display: inline-block; font-size: .75rem; font-weight: 600; color: var(--sky); background: rgba(56,189,248,.15); border-radius: .5rem; padding: .25rem .75rem; }
.tool { font-size: .75rem; padding: .25rem .75rem; border-radius: .5rem; background: var(--navy); border: 1px solid var(--line); color: #cbd5e1; }

.nav-link { color: #cbd5e1; transition: color .3s; }
.nav-link::after { content: ''; display: block; height: 2px; width: 0; background: var(--sky); transition: width .3s; margin-top: 2px; }
.nav-link:hover, .nav-link.active { color: var(--sky); }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

.filter-btn { padding: .5rem 1.25rem; border-radius: .75rem; font-size: .875rem; font-weight: 600; border: 1px solid rgba(255,255,255,.15); color: #cbd5e1; transition: all .3s; }
.filter-btn:hover { border-color: var(--sky); color: var(--sky); }
.filter-btn.active { background: var(--sky); border-color: var(--sky); color: var(--navy); }

/* ===== ANIMASI MUNCUL SAAT SCROLL ===== */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.show { opacity: 1; transform: none; }

/* ===== FOTO PROFIL: BERGELANTUNG DI JARING (bisa ditarik) ===== */
/* Panjang tali: ubah --thread jika ingin lebih panjang/pendek */
#swing { --thread: 150px; will-change: transform; }
.thread { position: absolute; left: -1px; top: 0; width: 2px; height: var(--thread); background: linear-gradient(#e2e8f0, rgba(148,163,184,.6)); border-radius: 2px; }
.hang { position: absolute; top: calc(var(--thread) - 1px); left: 0; transform: translateX(-50%); }
/* Laba-laba merayap naik-turun di tali */
.spider { position: absolute; left: -11px; top: 30px; animation: crawl 5s ease-in-out infinite alternate; }
@keyframes crawl { to { transform: translateY(80px); } }

#photo { position: relative; width: 14rem; aspect-ratio: 4 / 5; transform-origin: 50% 0; cursor: grab; touch-action: none; will-change: transform; }
@media (min-width: 640px) { #photo { width: 16rem; } }
#photo.grabbing { cursor: grabbing; }
#photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 1.5rem; border: 1px solid var(--line); pointer-events: none; }
/* Simpul tempat tali menempel di foto */
#photo::before { content: ''; position: absolute; top: -5px; left: 50%; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--sky); box-shadow: 0 0 10px var(--sky); z-index: 2; }
.photo-ring { position: absolute; inset: -3px; border-radius: 1.6rem; z-index: -1; filter: blur(14px); opacity: .7;
  background: conic-gradient(from 0deg, var(--sky), #2563eb, var(--sky)); animation: spin 8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.badge { background: rgba(30,41,59,.92); border: 1px solid var(--line); border-radius: .75rem; padding: .5rem .9rem; font-size: .8rem; font-weight: 600; backdrop-filter: blur(6px); z-index: 3; }

/* Kursor berkedip untuk efek mengetik */
.caret { display: inline-block; width: 2px; height: 1.1em; background: var(--sky); margin-left: 2px; vertical-align: -.15em; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ===== KARTU PROYEK ===== */
.project-card { transition: opacity .3s ease, transform .3s ease, border-color .3s, box-shadow .3s; cursor: pointer; }
.project-card.hiding { opacity: 0; transform: scale(.95); }
.project-card img { transition: transform .5s ease; }
.project-card:hover img { transform: scale(1.07); }

/* ===== MODAL ===== */
#modal { transition: opacity .3s; }
#modal-box { transition: transform .3s; }

/* Hormati pengguna yang mematikan animasi */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* Tombol back-to-top: transisi muncul/hilang */
#to-top { transition: opacity .3s, transform .3s, box-shadow .3s; }

/* ===== TOMBOL PAUSE LAGU ===== */

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px; /* Jarak antara tombol musik dengan menu/hamburger */
}

.music-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0; /* Mencegah tombol gepeng di layar HP kecil */
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f8fafc;
  cursor: pointer;
  transition: all 0.25s ease;
  -webkit-tap-highlight-color: transparent; /* Menghilangkan kotak biru saat diketuk di HP */
}

.music-btn:hover {
  border-color: #29b6f6;
  color: #29b6f6;
  background-color: rgba(41, 182, 246, 0.12);
}

.music-btn.playing {
  border-color: #29b6f6;
  color: #29b6f6;
  background-color: rgba(41, 182, 246, 0.15);
  box-shadow: 0 0 12px rgba(41, 182, 246, 0.35);
}

/* Penyesuaian khusus layar HP */
@media (max-width: 768px) {
  .nav-right {
    gap: 12px; /* Jarak lebih rapat dengan ikon hamburger */
  }

  .music-btn {
    width: 32px;
    height: 32px;
  }
}
