/* ==========================================================================
   1. SETUP & VARIABLES
   ========================================================================== */
:root {
  --background: #ffffff;
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --accent: #007bff;
  --accent-dark: #0056b3;
  --glow-color-1: #38b6ff;
  --glow-color-2: #007bff;
  --border-color: #e5e7eb;
  --card-bg: #ffffff;
  --header-bg: rgba(255, 255, 255, 0.85);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body { 
  background-color: var(--background); 
  color: var(--text-primary); 
  font-family: "Satoshi", sans-serif; 
  -webkit-font-smoothing: antialiased; 
  -moz-osx-font-smoothing: grayscale; 
  overflow-x: hidden; /* Mencegah scroll horizontal di HP */
}

/* ==========================================================================
   2. TYPOGRAPHY & UI COMPONENTS
   ========================================================================== */
h1, h2, h3, h4, h5 { font-weight: 700; color: var(--text-primary); }
p { color: var(--text-secondary); line-height: 1.6; font-weight: 500; }

.section-title { 
  font-size: 2.5rem; 
  text-align: center; 
  margin-bottom: 3rem; 
}

/* Buttons */
.btn { 
  display: inline-flex; 
  align-items: center; 
  padding: 12px 24px; 
  border-radius: 99px; 
  text-decoration: none; 
  font-weight: 600; 
  transition: all 0.3s ease; 
  gap: 8px;
}
.btn-primary { 
  background-color: var(--text-primary); 
  color: #ffffff; 
}
.btn-primary:hover { 
  transform: translateY(-3px); 
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15); 
  background-color: #000;
}
.btn-secondary { 
  background-color: transparent; 
  color: var(--text-primary); 
  border: 1px solid var(--border-color); 
}
.btn-secondary:hover { 
  background-color: #f3f4f6; 
  border-color: #d1d5db;
}

/* Text Gradient Effect */
.gradient-text { 
  background: linear-gradient(90deg, #007bff, #38b6ff, #007bff); 
  background-size: 200% 100%; 
  color: transparent; 
  -webkit-background-clip: text; 
  background-clip: text; 
  animation: gradientAnimation 5s infinite linear; 
}

/* ==========================================================================
   3. NAVIGATION (DESKTOP & MOBILE)
   ========================================================================== */
.floating-nav { 
  position: fixed; 
  top: 20px; 
  left: 50%; 
  transform: translateX(-50%); 
  width: 90%; 
  max-width: 600px; 
  z-index: 1000; 
}

.navbar-wrapper { 
  position: relative; 
  border-radius: 99px; 
  padding: 2px; 
  overflow: hidden;
  transition: box-shadow 0.3s ease, background 0.3s ease;
}

/* JS State: Scrolled */
.navbar-wrapper.scrolled {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.95);
}

/* Animasi Border Berputar */
.navbar-wrapper::before { 
  content: ''; 
  position: absolute; 
  top: 50%; 
  left: 50%; 
  transform: translate(-50%, -50%); 
  width: 200%; 
  height: 200%; 
  background: conic-gradient(var(--glow-color-1), var(--glow-color-2), var(--glow-color-1)); 
  animation: rotateBorder 4s linear infinite; 
  z-index: 0;
}

.navbar { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  padding: 12px 24px; 
  background: var(--header-bg); 
  backdrop-filter: blur(15px); 
  -webkit-backdrop-filter: blur(15px); 
  border-radius: 99px; 
  position: relative; 
  z-index: 1; 
}

.logo { 
  font-weight: 800; 
  font-size: 1.2rem; 
  color: var(--text-primary); 
  text-decoration: none; 
}

.nav-links { 
  display: flex; 
  align-items: center; 
  list-style: none; 
  gap: 1.5rem; 
}

.nav-links a { 
  color: var(--text-secondary); 
  text-decoration: none; 
  font-weight: 500; 
  font-size: 0.95rem; 
  transition: color 0.2s ease; 
  position: relative;
}

.nav-links a:hover, .nav-links a.active { 
  color: var(--accent); 
}

/* JS State: Active Link Indicator */
.nav-links a.active::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: var(--accent);
}

/* Hamburger Menu (Mobile Trigger) */
.hamburger { 
  display: none; 
  cursor: pointer; 
  z-index: 1001; 
}
.hamburger .line { 
  width: 24px; 
  height: 2px; 
  background-color: var(--text-primary); 
  margin: 5px 0; 
  transition: all 0.3s ease;
}

/* Hamburger Active State (X shape) */
.hamburger.toggle .line:nth-child(1) { transform: rotate(-45deg) translate(-5px, 6px); }
.hamburger.toggle .line:nth-child(2) { opacity: 0; }
.hamburger.toggle .line:nth-child(3) { transform: rotate(45deg) translate(-5px, -6px); }


/* ==========================================================================
   4. HERO SECTION & BACKGROUND
   ========================================================================== */
main { padding-top: 100px; }
section { padding: 80px 20px; max-width: 1200px; margin: 0 auto; }

.hero { 
  text-align: center; 
  min-height: 80vh; 
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  justify-content: center; 
}

.hero-content { max-width: 800px; position: relative; z-index: 2; }
.hero-title { font-size: 3.5rem; line-height: 1.1; margin-bottom: 1.5rem; }
.hero-subtitle { font-size: 1.25rem; max-width: 600px; margin: 0 auto 2rem; color: var(--text-secondary); }

.hero-buttons { display: flex; gap: 15px; justify-content: center; flex-wrap: wrap; }

.hero-socials { margin-top: 2.5rem; display: flex; justify-content: center; gap: 24px; }
.hero-socials a { color: var(--text-secondary); font-size: 1.5rem; transition: transform 0.3s ease, color 0.3s ease; }
.hero-socials a:hover { color: var(--accent); transform: translateY(-3px); }

/* Background Blobs */
.background-animation { position: fixed; top: 0; left: 0; width: 100%; height: 100vh; z-index: -1; overflow: hidden; pointer-events: none; }
[class^="blob-"] { position: absolute; filter: blur(80px); opacity: 0.4; animation-direction: alternate; animation-timing-function: ease-in-out; }

.blob-1 { width: 400px; height: 400px; background: rgba(0, 123, 255, 0.4); top: -100px; left: -50px; animation: moveBlob1 15s infinite; }
.blob-2 { width: 350px; height: 350px; background: rgba(56, 182, 255, 0.3); bottom: -100px; right: -100px; animation: moveBlob2 18s infinite; }
.blob-3 { width: 250px; height: 250px; background: rgba(200, 230, 255, 0.5); top: 40%; left: 40%; animation: moveBlob3 12s infinite; }

/* ==========================================================================
   5. ABOUT SECTION (WOW VERSION)
   ========================================================================== */
#about { position: relative; }

.about-container-wow {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 60px;
  align-items: center;
  position: relative;
  z-index: 2;
}

.about-text-wow h4 {
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.9rem;
}

.about-text-wow h2 {
  font-size: 2.5rem;
  line-height: 1.2;
  margin-bottom: 25px;
  background: linear-gradient(90deg, #111827, #007bff); 
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--text-primary); 
}

.about-text-wow p { margin-bottom: 20px; font-size: 1.05rem; }

/* Education Badge */
.education-badge {
  display: inline-flex;
  align-items: center;
  background: #f8fafc;
  border: 1px solid rgba(0, 123, 255, 0.2);
  padding: 16px 24px;
  border-radius: 16px;
  margin-top: 20px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.03);
}

.education-badge i { font-size: 1.8rem; color: var(--accent); margin-right: 16px; }
.education-info h5 { margin: 0; font-size: 1rem; }
.education-info p { margin: 0; font-size: 0.85rem; color: var(--text-secondary); }

/* Profile Image with Blob Shape */
.image-wrapper-wow { position: relative; z-index: 2; display: flex; justify-content: center; }
.image-wrapper-wow img {
  width: 100%;
  max-width: 380px;
  border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  box-shadow: 0 20px 40px rgba(0, 123, 255, 0.15);
  border: 4px solid #ffffff;
  transition: all 0.5s ease;
  object-fit: cover;
}
.image-wrapper-wow:hover img {
  border-radius: 40% 60% 70% 30% / 40% 70% 30% 60%;
  transform: scale(1.02);
  box-shadow: 0 25px 50px rgba(0, 123, 255, 0.25);
}

/* ==========================================================================
   6. SKILLS SECTION
   ========================================================================== */
.skills-grid { 
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); 
  gap: 24px; 
}

.skill-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  padding: 30px 20px;
  border-radius: 20px;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
  
  /* Animasi JS State */
  opacity: 0; 
  transform: translateY(30px);
  transition: all 0.6s ease-out;
}

.skill-card.is-visible { opacity: 1; transform: translateY(0); }
.skill-card:hover { transform: translateY(-5px); border-color: var(--accent); box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08); }

.skill-icon { font-size: 2.5rem; color: var(--accent); margin-bottom: 1rem; transition: transform 0.3s ease; }
.skill-card:hover .skill-icon { transform: scale(1.1); }
.skill-card h4 { margin-bottom: 0.5rem; font-size: 1.1rem; }
.skill-card p { font-size: 0.9rem; }

/* ==========================================================================
   7. PROJECTS SECTION
   ========================================================================== */
.projects-grid { 
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); 
  gap: 30px; 
}

.project-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  
  /* Animasi JS State */
  opacity: 0; 
  transform: translateY(30px); 
}
.project-card.is-visible { opacity: 1; transform: translateY(0); }

.project-card:hover { transform: translateY(-8px); box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08); }

.project-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-bottom: 1px solid var(--border-color); }

.project-info { padding: 24px; }
.project-info h3 { font-size: 1.4rem; margin-bottom: 8px; }

/* Tags & Categories */
.project-category { 
  color: var(--accent); 
  font-size: 0.75rem; 
  text-transform: uppercase; 
  letter-spacing: 1.5px; 
  font-weight: 800; 
  margin-bottom: 8px; 
  display: block; 
}

.tech-stack { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.tech-badge { 
  background: #f3f4f6; 
  border: 1px solid #e5e7eb; 
  padding: 4px 10px; 
  border-radius: 6px; 
  color: var(--text-secondary); 
  font-size: 0.75rem; 
  font-weight: 600; 
}

/* Container untuk menampung banyak tombol (Play Video & Live Link) */
.project-links-container {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    gap: 10px; /* Jarak antar tombol */
    z-index: 10;
}

/* Mengatur ulang posisi tombol jika berada di dalam container */
.project-links-container .project-link {
    position: relative; /* Timpa absolute bawaan dari .project-link biasa */
    top: auto;
    right: auto;
}

.project-link { 
  position: absolute; 
  top: 16px; 
  right: 16px; 
  width: 44px; 
  height: 44px; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  background-color: rgba(255, 255, 255, 0.9); 
  backdrop-filter: blur(4px); 
  border-radius: 50%; 
  color: var(--text-primary); 
  font-size: 1.2rem; 
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: all 0.3s ease; 
}
.project-link:hover { transform: scale(1.1); color: var(--accent); }

/* ==========================================================================
   8. CONTACT & FOOTER
   ========================================================================== */
.contact { text-align: center; padding: 100px 20px; }
.contact-content { max-width: 600px; margin: 0 auto; }
.contact-socials { margin-top: 2rem; display: flex; justify-content: center; gap: 2rem; }
.contact-socials a { font-size: 1.8rem; color: var(--text-secondary); transition: 0.3s; }
.contact-socials a:hover { color: var(--accent); transform: translateY(-3px); }

footer { 
  text-align: center; 
  padding: 40px 20px; 
  border-top: 1px solid var(--border-color); 
  font-size: 0.9rem; 
  color: var(--text-secondary);
}

/* ==========================================================================
   9. ANIMATIONS & KEYFRAMES
   ========================================================================== */
@keyframes gradientAnimation { 0% { background-position: 0% 50%; } 100% { background-position: 200% 50%; } }
@keyframes rotateBorder { from { transform: translate(-50%, -50%) rotate(0deg); } to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes moveBlob1 { from { transform: translate(0, 0) rotate(0deg); } to { transform: translate(100px, 50px) rotate(180deg); } }
@keyframes moveBlob2 { from { transform: translate(0, 0) scale(1); } to { transform: translate(-80px, -40px) scale(1.2); } }
@keyframes moveBlob3 { from { transform: translate(-50%, -50%) scale(1); } to { transform: translate(-40%, -60%) scale(0.9); } }
@keyframes navLinkFade { from { opacity: 0; transform: translateX(50px); } to { opacity: 1; transform: translateX(0); } }

/* ==========================================================================
   10. RESPONSIVE DESIGN (MOBILE)
   ========================================================================== */
@media screen and (max-width: 968px) {
  .hero-title { font-size: 2.5rem; }
  .about-container-wow { grid-template-columns: 1fr; text-align: center; }
  .image-wrapper-wow { order: -1; margin-bottom: 30px; }
  .education-badge { width: 100%; justify-content: flex-start; text-align: left; }
}

@media screen and (max-width: 768px) {
  /* Navbar Mobile Slide-in */
  .nav-links {
    position: absolute;
    right: 0;
    top: 0; /* Full height from top */
    height: 100vh;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 70%;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.77, 0, 0.175, 1);
    box-shadow: -10px 0 30px rgba(0,0,0,0.1);
    z-index: 998; /* Di bawah hamburger */
  }

  /* JS Class to open menu */
  .nav-links.nav-active { transform: translateX(0%); }

  .nav-links li { opacity: 0; margin: 20px 0; }
  .hamburger { display: block; }
  
  .projects-grid { grid-template-columns: 1fr; }
  
  /* Reduce blob size on mobile */
  .blob-1, .blob-2, .blob-3 { width: 200px; height: 200px; filter: blur(60px); }
}

/* ==========================================================================
   11. IMAGE PROTECTION
   ========================================================================== */
img {
    /* Mencegah gambar di-drag di berbagai browser */
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    
    /* Mencegah gambar diseleksi/dihighlight */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Custom Cursor Default */
.custom-cursor {
    position: fixed;
    top: 0; left: 0;
    width: 30px; height: 30px;
    border: 2px solid var(--accent);
    border-radius: 50%;
    pointer-events: none; /* Biar ga nutupin klik */
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s, background-color 0.2s;
    z-index: 9999; /* Selalu di paling atas */
    mix-blend-mode: difference; /* Efek warna keren saat nabrak teks */
}

/* Saat kursor hover ke link/tombol */
.custom-cursor.hover-mode {
    width: 60px; height: 60px;
    background-color: rgba(0, 123, 255, 0.2);
    border-color: transparent;
}

/* Matikan kursor custom di HP (biar ga aneh pas disentuh) */
@media screen and (max-width: 768px) {
    .custom-cursor { display: none; }
}

/* ==========================================================================
   12. VIDEO MODAL POP-UP
   ========================================================================== */
.video-modal {
    display: none; /* Disembunyikan secara default */
    position: fixed;
    z-index: 10000; /* Pastikan paling atas */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85); /* Latar hitam transparan */
    backdrop-filter: blur(8px); /* Efek blur layar belakang */
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Munculkan modal */
.video-modal.show {
    display: flex;
    opacity: 1;
}

.video-modal-content {
    position: relative;
    width: 90%;
    max-width: 800px; /* Maksimal lebar video */
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.video-modal.show .video-modal-content {
    transform: scale(1); /* Efek membesar pas muncul */
}

.video-modal video {
    width: 100%;
    height: auto;
    display: block;
}

/* Tombol Silang (Close) */
.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    color: #fff;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    transition: color 0.2s;
}

.close-modal:hover {
    color: var(--accent);
}