/* Import Font */
@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;600;700;800&display=swap");

/* CSS Variables for easy theming */
:root {
  --bg-color: #0d1117;
  --bg-secondary: #161b22;
  --border-color: #30363d;
  --text-primary: #c9d1d9;
  --text-secondary: #8b949e;
  --accent-color: #58a6ff;
  --accent-hover: #79c0ff;
  --card-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* Global Styles (Mostly Unchanged) */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  overflow-x: hidden;
}

html {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: "Plus Jakarta Sans", sans-serif;
  line-height: 1.7;
  font-size: 16px;
}

body::-webkit-scrollbar {
  display: none;
}

.container {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

a {
  color: var(--accent-color);
  text-decoration: none;
  transition: color 0.3s ease;
}
a:hover {
  color: var(--accent-hover);
}

section {
  padding-top: 4rem; /* Slightly reduced padding for mobile */
  padding-bottom: 4rem;
}

section h2 {
  font-size: 2rem; /* Mobile-first font size */
  font-weight: 800;
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
}

section h2::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background-color: var(--accent-color);
  border-radius: 2px;
}

/* Header (Mobile First) */
header {
  background-color: rgba(13, 17, 23, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 1000;
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.logo-icon {
  width: 40px;
  height: 40px;
}
.name-tag h3 {
  font-size: 1.2rem;
  color: #fff;
}
.name-tag p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.name-tag {
  display: none; /* Hide name tag on mobile by default */
}

/* Mobile Navigation is now the default */
nav {
  position: fixed;
  top: 80px;
  left: 0;
  width: 100%;
  height: calc(100vh - 80px);
  background: var(--bg-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  transform: translateX(100%);
  transition: transform 0.3s ease-in-out;
}
nav.active {
  transform: translateX(0);
}
.nav-link {
  font-size: 1.5rem; /* Larger font for mobile overlay menu */
  color: var(--text-secondary);
  font-weight: 600;
  padding: 0.5rem 0;
  position: relative;
  transition: color 0.3s ease;
}
.nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-color);
  transition: width 0.3s ease;
}
.nav-link:hover,
.nav-link.active {
  color: #fff;
}
.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}
#menu-toggle {
  display: block; /* Hamburger menu is visible by default */
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 1001; /* Ensure it's above other elements */
}

/* Hero Section (Mobile First) */
#hero {
  position: relative; /* Penting agar elemen child dengan position:absolute bisa diatur relatif terhadap hero */
  overflow: hidden; /* Mencegah partikel "bocor" keluar dari section hero */
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: calc(100vh - 80px);
  padding: 2rem;
  /* Background gradient bisa Anda simpan atau hapus, efek partikel akan menimpanya */
  background: linear-gradient(-45deg, #0d1117, #1f283a, #0d1117, #182640);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
}

@keyframes gradientBG {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

#hero-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1; /* Posisikan kanvas di lapisan bawah */
}

/* --- Modifikasi .hero-content --- */
.hero-content {
  position: relative; /* Agar tidak tertimpa kanvas */
  z-index: 2; /* Posisikan konten di lapisan atas, DI ATAS KANVAS */
  /* Properti lainnya tetap sama */
}

.hero-content h1 {
  font-size: 2.5rem; /* Mobile-first font size */
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.5rem;
}
.hero-content .subtitle {
  font-size: 1.2rem; /* Mobile-first font size */
  color: var(--accent-color);
  font-weight: 600;
  margin-bottom: 1.5rem;
}
.hero-content .hero-description {
  max-width: 600px;
  margin: 0 auto 2rem;
  font-size: 1.1rem;
  color: var(--text-secondary);
}
.cta-button {
  background-color: var(--accent-color);
  color: #fff;
  padding: 1rem 2.5rem;
  border-radius: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: inline-block;
  transition: transform 0.3s ease, background-color 0.3s ease,
    box-shadow 0.3s ease;
}
.cta-button:hover {
  background-color: var(--accent-hover);
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(88, 166, 255, 0.2);
}

/* About Section (No major changes needed, it's already responsive) */
.about-container {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}
.about-text p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}
.cv-button {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  color: var(--text-primary);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
}
.cv-button:hover {
  background-color: var(--border-color);
  transform: translateY(-3px);
}

/* Skills Section (This pattern is inherently responsive, no changes needed) */
.skills-scroller {
  width: 100%;
  overflow: hidden;
  padding: 2rem 0;
  -webkit-mask: linear-gradient(
    90deg,
    transparent,
    white 20%,
    white 80%,
    transparent
  );
  mask: linear-gradient(90deg, transparent, white 20%, white 80%, transparent);
}
.skills-track {
  display: flex;
  gap: 1.5rem;
  width: max-content;
  animation: scroll 40s linear infinite;
}
.skills-scroller:hover .skills-track {
  animation-play-state: paused;
}
@keyframes scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}
.skill-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  width: 150px;
  flex-shrink: 0;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.skill-card:hover {
  transform: translateY(-10px);
  border-color: var(--accent-color);
  box-shadow: 0 0 20px rgba(88, 166, 255, 0.15);
}
.skill-card img {
  width: 50px;
  height: 50px;
  margin-bottom: 1rem;
  filter: grayscale(1) brightness(1.5);
  transition: filter 0.3s ease;
}
.skill-card:hover img {
  filter: none;
}
.skill-card p {
  font-weight: 600;
  color: var(--text-primary);
}

/* Portfolio Section (The auto-fit grid is already mobile-first!) */
#project-container {
  display: grid;
  /* This single line is responsive by nature. It will be 1 column on small screens
     and multiple columns on larger screens. No media query needed for layout. */
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}
.card-item {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card-item:hover {
  transform: translateY(-10px);
  box-shadow: var(--card-shadow);
}
.project-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-bottom: 1px solid var(--border-color);
}
.card-content {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}
.card-content h4 {
  font-size: 1.3rem;
  color: #fff;
  margin-bottom: 0.5rem;
}
.card-content p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}
.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.tech-tag {
  background-color: rgba(88, 166, 255, 0.1);
  color: var(--accent-color);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}
.project-links {
  display: flex;
  gap: 1rem;
  margin-top: auto;
}
.project-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background-color: transparent;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  font-weight: 600;
  transition: all 0.3s ease;
}
.project-links a:hover {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
  color: #fff;
}
.project-links i {
  font-size: 1.1rem;
}

/* Contact Section (Already responsive) */
.contact-content {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}
.contact-info {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 2rem;
}
.contact-email {
  display: block;
  font-size: clamp(1.1rem, 5vw, 1.5rem);
  font-weight: 600;
  margin-bottom: 2.5rem;
  position: relative;
}

.contact-email::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background-color: var(--accent-hover);
  transition: width 0.4s ease;
}
.contact-email:hover::after {
  width: 100%;
}
.social-links {
  display: flex;
  flex-direction: column; /* Stack links on mobile */
  align-items: center; /* Center them */
  gap: 1rem;
}
.social-link {
  display: flex;
  justify-content: center; /* Center content inside link */
  width: 100%; /* Make links full-width */
  max-width: 250px; /* But not too wide */
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}
.social-link:hover {
  transform: translateY(-5px);
  background-color: #fff;
  color: #000;
}

/* Footer (Already responsive) */
footer {
  background-color: var(--bg-secondary);
  text-align: center;
  padding: 2rem 1.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-color);
}

/* ==========================================================================
   Responsive Design - Tablet & Desktop Styles (min-width: 769px)
   ========================================================================== */

@media (min-width: 769px) {
  section {
    padding-top: 5rem;
    padding-bottom: 5rem;
  }

  section h2 {
    font-size: 2.5rem; /* Larger font for desktop section titles */
  }

  /* --- Header & Nav for Desktop --- */
  .name-tag {
    display: block; /* Show name tag on desktop */
  }

  #menu-toggle {
    display: none; /* Hide hamburger on desktop */
  }

  nav {
    position: static;
    transform: translateX(0);
    flex-direction: row;
    width: auto;
    height: auto;
    background: transparent;
    gap: 2rem;
  }

  .nav-link {
    font-size: 1rem; /* Regular font size for desktop nav */
    padding: 0.5rem 0;
  }

  /* --- Hero for Desktop --- */
  .hero-content h1 {
    font-size: 4rem; /* Larger font for desktop hero title */
  }

  .hero-content .subtitle {
    font-size: 1.5rem; /* Larger font for desktop subtitle */
  }

  /* --- Contact for Desktop --- */
  .social-links {
    flex-direction: row; /* Layout links side-by-side */
    justify-content: center;
    gap: 1.5rem;
  }
  .social-link {
    width: auto; /* Let content define width */
  }
}
