/* ==========================================================================
   base.css
   Berisi: CSS Variables, Reset, Elemen Dasar
   Urutan load: 1 (harus pertama)
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Variables
   -------------------------------------------------------------------------- */
:root {
  /* Brand colors */
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-light: #eff6ff;
  --blue-mid: #60a5fa;

  /* Neutrals — light mode */
  --text: #334155;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --surface: #ffffff;
  --bg: #f8fafc;
  --bg-page: #f1f5f9;

  /* Radius */
  --r: 10px;
  --r-sm: 8px;
  --r-xs: 4px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md:
    0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);

  /* Transition */
  --ease: 0.3s ease;
}

/* Dark mode overrides */
body.dark-mode {
  --blue: #3b82f6;
  --blue-dark: #60a5fa;
  --blue-light: rgba(59, 130, 246, 0.15);
  --blue-mid: #93c5fd;

  --text: #cbd5e1;
  --text-muted: #94a3b8;
  --border: #334155;
  --surface: #1e293b;
  --bg: #0b1120;
  --bg-page: #020617;
}

/* --------------------------------------------------------------------------
   Reset & Base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  margin: 0;
  color: var(--text);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
}

html {
  width: 100%;
  scroll-behavior: smooth; /* Memberikan efek gulir (scroll) yang halus */
  scroll-padding-top: 80px; /* Memberikan jarak aman agar judul tidak tertutup header */
}

body {
  overflow-x: hidden;
  width: 100%;
}

body.dark-mode {
  color: #e0e0e0;
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* --------------------------------------------------------------------------
   Container
   -------------------------------------------------------------------------- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* --------------------------------------------------------------------------
   Back to Top
   -------------------------------------------------------------------------- */
#back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 42px;
  height: 42px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  box-shadow: 0 4px 14px rgba(0, 86, 179, 0.4);
  transition:
    opacity var(--ease),
    visibility var(--ease),
    background var(--ease),
    transform var(--ease),
    box-shadow var(--ease);
  z-index: 999;
}

#back-to-top.show {
  opacity: 1;
  visibility: visible;
}

#back-to-top:hover {
  background: var(--blue-dark);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 86, 179, 0.5);
}

/* ============================================================
   STICKY HEADER
   ============================================================ */
html,
body {
  overflow-x: clip !important;
  overflow-y: visible !important;
  position: static !important;
}

h1[id], 
h2[id], 
h3[id], 
h4[id], 
h5[id], 
h6[id] {
  scroll-margin-top: 90px !important;
}