/* ==========================================================================
   base.css
   Fondasi seluruh situs: variabel desain (warna, ukuran, bayangan),
   reset ringan, tipografi dasar, dan class utilitas kecil.
   File ini dipakai oleh index.html, privacy.html, dan terms.html.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens (ubah warna/ukuran brand cukup di sini)
   -------------------------------------------------------------------------- */
:root {
  /* Warna brand — oranye energi + arang industri (dari halaman Canva lama) */
  --color-brand: #e8590c;
  --color-brand-dark: #c2410c;
  --color-brand-soft: #fff1e8;

  /* Warna WhatsApp untuk CTA utama */
  --color-whatsapp: #1fa855;
  --color-whatsapp-dark: #168a45;

  /* Netral */
  --color-ink: #16191d;          /* teks utama & latar gelap */
  --color-ink-soft: #2a2f36;
  --color-text: #3d444d;         /* teks paragraf */
  --color-muted: #6b7380;
  --color-line: #e4e1dc;
  --color-surface: #ffffff;
  --color-background: #faf8f5;   /* putih hangat, tidak silau */
  --color-tint: #f3efe9;

  /* Status form */
  --color-error: #d92d20;
  --color-success: #1fa855;

  /* Tipografi */
  --font-family-base: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-size-small: 0.875rem;
  --font-size-base: 1rem;
  --font-size-large: 1.125rem;

  /* Jarak & bentuk */
  --space-section: clamp(4rem, 8vw, 6.5rem);
  --radius-small: 10px;
  --radius-medium: 16px;
  --radius-large: 24px;
  --radius-pill: 999px;

  /* Bayangan */
  --shadow-soft: 0 4px 16px rgba(22, 25, 29, 0.06);
  --shadow-card: 0 10px 30px rgba(22, 25, 29, 0.08);
  --shadow-raised: 0 18px 40px rgba(22, 25, 29, 0.14);

  /* Durasi animasi (dipakai di animations.css & components.css) */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --duration-fast: 0.2s;
  --duration-base: 0.35s;
  --duration-slow: 0.7s;

  /* Tinggi header (dipakai untuk offset scroll anchor) */
  --header-height: 72px;
}

/* --------------------------------------------------------------------------
   2. Reset ringan
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 12px); /* anchor tidak tertutup header */
  -webkit-text-size-adjust: 100%;
}

/* Cegah scroll horizontal akibat animasi/elemen dekoratif.
   "clip" tidak merusak position: sticky; "hidden" sebagai cadangan browser lama. */
html,
body {
  overflow-x: hidden;
}
@supports (overflow: clip) {
  html,
  body {
    overflow-x: clip;
  }
}

body {
  margin: 0;
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  line-height: 1.65;
  color: var(--color-text);
  background-color: var(--color-background);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--color-ink);
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.02em;
}

p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

/* Fokus yang jelas untuk pengguna keyboard */
:focus-visible {
  outline: 3px solid var(--color-brand);
  outline-offset: 3px;
  border-radius: 4px;
}

/* --------------------------------------------------------------------------
   3. Ikon SVG (dari sprite di index.html)
   -------------------------------------------------------------------------- */
.icon {
  width: 1.25em;
  height: 1.25em;
  flex-shrink: 0;
}

/* Sprite disembunyikan, hanya jadi "gudang" ikon */
.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   4. Utilitas
   -------------------------------------------------------------------------- */

/* Sembunyikan secara visual tapi tetap dibaca screen reader */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Link "lewati ke konten", muncul saat difokus dengan Tab */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--color-ink);
  color: #fff;
  border-radius: var(--radius-small);
  font-weight: 600;
  transition: top var(--duration-fast);
}
.skip-link:focus {
  top: 12px;
}

/* Link di dalam teks paragraf */
.text-link {
  color: var(--color-brand-dark);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  transition: color var(--duration-fast);
}
.text-link:hover {
  color: var(--color-brand);
}

/* Label nomor suku cadang (420-002 dll.) */
.part-number {
  display: inline-block;
  padding: 0.05em 0.5em;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--color-ink);
  background: var(--color-brand-soft);
  border: 1px solid rgba(232, 89, 12, 0.25);
  border-radius: 6px;
  white-space: nowrap;
}
