/**
 * ============================================================================
 * MODERN CSS RESET & OVERFLOW PREVENTION
 * ============================================================================
 * Mengeliminasi inkonsistensi rendering lintas browser dan mencegah layout shift
 * serta horizontal overflow di semua ukuran viewport.
 */

/* 1. Box-sizing universal untuk kalkulasi ukuran geometris presisi */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* 2. Pencegahan horizontal overflow pada root dan body */
html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  background-color: var(--bg-primary, #0a0b0e);
  color: var(--text-primary, #f5f6f8);
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  line-height: var(--leading-normal, 1.6);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  background-color: var(--bg-primary, #0a0b0e);
  color: var(--text-primary, #f5f6f8);
  font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
}

/* 3. Penghormatan terhadap preferensi gerak pengguna (Accessibility) */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* 4. Reset media dan grafis */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* 5. Pewarisan tipografi pada elemen interaktif formulir */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
  border: none;
  background: none;
}

/* 6. Hapus list style default */
ul,
ol {
  list-style: none;
}

/* 7. Reset tautan */
a {
  color: inherit;
  text-decoration: none;
}

/* 8. Aksesibilitas navigasi keyboard (Focus Indicators) */
:focus-visible {
  outline: 2px solid var(--red-hover, #ff3b4b);
  outline-offset: 3px;
  border-radius: var(--radius-sm, 4px);
}

/* 9. Target anchor offset kompensasi fixed header */
[id] {
  scroll-margin-top: calc(var(--navbar-height, 72px) + 16px);
}
