/* =========================================
🎨 LIGHT THEME — Ahmad Latif Portfolio
========================================= */

:root {
  /* 🎨 Color Palette */
  --color-primary: #111111;
  --color-secondary: #555555;
  --color-accent: #007bff;
  --color-bg: #ffffff;
  --color-bg-alt: #f8f8f8;
  --color-border: #e0e0e0;
  --color-muted: #888888;

  /* 🔤 Typography */
  --font-heading: 'Besley', serif;
  --font-body: 'Work Sans', sans-serif;

  /* 📏 Font Sizes */
  --fs-xs: 0.75rem;
  --fs-sm: 0.9rem;
  --fs-base: 1rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.5rem;
  --fs-2xl: 2rem;
  --fs-3xl: 2.5rem;

  /* 📐 Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 4rem;

  /* 🧱 Border Radius & Shadows */
  --radius-sm: 6px;
  --radius-md: 10px;
  --shadow-card: 0 4px 10px rgba(0, 0, 0, 0.05);
}

/* ===============================
📄 BASE STYLES
=============================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-primary);
  line-height: 1.7;
}

/* HEADINGS */
h1, h2, h3 {
  font-family: var(--font-heading);
  color: var(--color-primary);
}

/* LINKS */
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.25s ease;
}

a:hover {
  color: var(--color-accent);
}

/* HEADER & NAV */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-lg) var(--space-xl);
}

header h1 {
  font-size: var(--fs-2xl);
  font-weight: 700;
}

nav ul {
  display: none;
  list-style: none;
  gap: var(--space-lg);
}

nav a {
  font-size: var(--fs-base);
  font-weight: 500;
}

nav a.active {
  border-bottom: 2px solid var(--color-primary);
}

/* MAIN SECTIONS */
main {
  padding: var(--space-xl);
  max-width: 900px;
  margin: 0 auto;
}

/* PROJECT */ 
.project { min-height: 50vh; } 

/* CONTACT */ 
.contact .intro { 
  font-size: var(--fs-lg); 
  margin-bottom: var(--space-lg); 
  color: var(--color-secondary); 
} 

.contact form { 
  display: flex; 
  flex-direction: column; 
  gap: var(--space-md); 
} 

.contact label { 
  font-weight: 600; 
  font-size: var(--fs-base); 
} 

.contact label span { 
  color: var(--color-muted); 
  font-weight: 400; 
} 

.input-row { 
  display: flex; 
  gap: var(--space-md); 
} 

.contact input, .contact textarea { 
  width: 100%; 
  padding: var(--space-sm); 
  border: 1px solid var(--color-border); 
  border-radius: var(--radius-sm); 
  font-family: var(--font-body); 
  background-color: var(--color-bg); 
}

/* HERO */
.hero h1 {
  font-size: var(--fs-3xl);
  margin-bottom: var(--space-md);
}

.hero p {
  color: var(--color-secondary);
}

/* FOOTER */
footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-lg) var(--space-xl);
  font-size: var(--fs-sm);
  color: var(--color-secondary);
}

/* TOGGLE BUTTON */
#theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  transition: transform 0.2s ease;
  color: var(--color-primary);
}

#theme-toggle:hover {
  transform: rotate(20deg);
  color: var(--color-accent);
}

/* HAMBURGER MENU */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 18px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: transform 0.3s ease;
}

.menu-toggle .bar {
  height: 3px;
  width: 100%;
  background-color: var(--color-primary);
  border-radius: 10px;
  transition: all 0.3s ease;
}

/* Animasi silang (X) saat aktif */
.menu-toggle.active .bar:nth-child(1) {
  transform: rotate(45deg) translateY(7px);
}

.menu-toggle.active .bar:nth-child(2) {
  transform: rotate(-45deg) translateY(-7px);
}

/* Dropdown menu untuk mobile */
@media (max-width: 768px) {
  #nav-list {
    display: none; 
    width: 100%;
  }
  nav ul {
    display: none; /* 🔹 disembunyikan default */
    flex-direction: column;
    background-color: var(--color-bg-alt);
    width: 100%;
    padding: var(--space-md); 
    position: absolute;
    top: 12.5%;
    left: 0;
    z-index: 1000;
  } 

    /* Animasi lembut muncul */
  @keyframes dropdownFade {
    from {
      opacity: 0;
      transform: translateY(-5px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .menu-toggle {
    display: flex;
  }

  header {
    position: relative; /* supaya dropdown bisa absolute */
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .header-right {
    display: flex;
    align-items: center;
    gap: var(--space-md);
  } 
}

/* Hilangkan tombol hamburger di layar besar */
@media (min-width: 769px) {
  .menu-toggle {
    display: none;
  }

  nav ul {
    display: flex !important;
    flex-direction: row;
    background: none;
    border: none;
    padding: 0;
  }
}

/* RESPONSIVE */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    align-items: flex-start;
  }
  nav ul {
    gap: var(--space-md);
  }
  main {
    padding: var(--space-lg);
  }
}
