/* ==========================================================================
   1. VARIABEL WARNA GLOBAL (Default: Tema Terang / Light Mode)
   ========================================================================== */
:root {
  --bg-main: #ffffff;
  --bg-header: #f8f9fa;
  --bg-sidebar: #ffffff;
  --text-main: #212529;
  --text-muted: #6c757d;
  --accent: #0d6efd;
  --overlay: rgba(0, 0, 0, 0.5);
  --border-color: #dee2e6;
  --g-color: gold;

  --text-fix1: white;
}

/* OTOMATIS TEMA GELAP (Dark Theme via Media Query) */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-main: #121212;
    --bg-header: #1e1e1e;
    --bg-sidebar: #1e1e1e;
    --text-main: #f8f9fa;
    --text-muted: #a0a0a0;
    --accent: #0d6efd;
    --overlay: rgba(0, 0, 0, 0.7);
    --border-color: #333333;
    --g-color: gold;

    --text-fix1: white;
  }
}

/* ==========================================================================
   2. BASE STYLES & RESET GLOBAL
   ========================================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}


html, body {
  overflow-x: hidden; 
  width: 100%;
  scroll-behavior: smooth;

}

p, h3 {
  text-align: justify;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.6;
  transition: background-color 0.3s, color 0.3s;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

/* ==========================================================================
   3. HEADER & NAVIGASI UTAMA
   ========================================================================== */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 5%;
  height: 60px;
  background-color: var(--bg-header);
  border-bottom: 1px solid var(--border-color);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 999; /* Berada di bawah overlay dan sidebar */
  box-shadow: 0 1px 10px black;
}

.logo-text {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.icon-logo {
  height: 32px;
  width: auto;
  display: block;
}

/* Tombol 3 Baris Mobile */
.menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 19px;
  cursor: pointer;
  margin: 0;
}

.menu-toggle span {
  display: block;
  height: 3px;
  width: 100%;
  background-color: var(--text-main);
  border-radius: 3px;
  transition: 0.3s;
}

/* ==========================================================================
   4. SIDEBAR & OVERLAY (STRUKTUR LAYER DIPERBAIKI)
   ========================================================================== */
.sidebar {
  position: fixed;
  top: 0;
  right: -300px; /* Sembunyi di luar layar kanan */
  width: 300px;
  height: 100%;
  background-color: var(--bg-sidebar);
  box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
  z-index: 10000; /* Layer paling tinggi agar tombol close muncul di atas apa pun */
  padding: 40px 30px;
  transition: right 0.4s cubic-bezier(0.05, 0.74, 0.2, 0.99);
}

.sidebar.active {
  right: 0;
}

.close-btn {
  font-size: 2rem;
  position: absolute;
  top: 20px;
  right: 25px;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.2s;
}

.close-btn:hover {
  color: var(--text-main);
}

.sidebar-menu {
  margin-top: 50px;
}

.sidebar-menu li {
  margin-bottom: 20px;
}

.sidebar-menu a {
  font-size: 1.2rem;
  font-weight: 500;
  display: block;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
  position: relative;
  z-index: 10001;
  cursor: pointer;
  transition: padding-left 0.3s, color 0.2s;
}

.sidebar-menu a:hover {
  color: var(--accent);
  padding-left: 10px;
}

/* Latar Belakang Gelap (Overlay) saat Sidebar Aktif */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--overlay);
  z-index: 9999; /* Di bawah sidebar (10000) tapi di atas header (999) */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s;
}

.sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* ==========================================================================
   5. MAIN CONTENT AREA
   ========================================================================== */
.content {
  margin-top: 100px;
  padding: 0 5%;
  text-align: center;
}

/* ==========================================================================
   6. RESPONSIVE QUERY (DESKTOP vs MOBILE)
   ========================================================================== */

/* 💻 MODE DESKTOP (Layar 768px ke atas) */
@media screen and (min-width: 768px) {
  .header-nav {
    display: block;
  }

  .header-menu {
    display: flex;
    gap: 25px;
  }

  .header-menu a {
    font-weight: 500;
    font-size: 1rem;
    transition: color 0.2s;
  }

  .header-menu a:hover {
    color: var(--accent);
  }

  .menu-toggle {
    display: none;
  }

  .sidebar, 
  .sidebar-overlay {
    display: none !important;
  }
}

/* 📱 MODE MOBILE (Layar di bawah 768px) */
@media screen and (max-width: 767px) {
  .header-nav {
    display: none;
  }

  .menu-toggle {
    display: flex;
  }
}

/* ==========================================================================
   7. EFEK ANIMASI SCROLL
   ========================================================================== */
.scroll-animate {
  opacity: 0;
  transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1), 
              transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: transform, opacity;
}

.scroll-animate.from-left {
  transform: translateX(-30px); 
}

.scroll-animate.from-right {
  transform: translateX(30px);  
}

.scroll-animate.show {
  opacity: 1;
  transform: translateX(0);
}
