/* ==========================================================================
   base.css — token desain, reset, tipografi, layout dasar
   Semua warna dan ukuran diambil dari token di :root.
   Ubah token di sini untuk mengganti identitas visual seluruh aplikasi.
   ========================================================================== */

:root {
  /* Warna — tema terang (institusional: navy + emas) */
  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #eaeef5;
  --fg: #111c2e;
  --muted: #56627a;
  --line: #d6dde9;

  --primary: #163e72;        /* navy: aksi utama, header */
  --primary-strong: #0e2c55;
  --primary-soft: #e3ebf7;
  --on-primary: #ffffff;

  --accent: #c8891a;         /* emas: sorotan, level */
  --accent-soft: #fbf0d9;

  --ok: #1f8a4c;   --ok-soft: #dff3e6;
  --warn: #b26b00; --warn-soft: #fdf0d4;
  --bad: #c0392b;  --bad-soft: #fbe3e0;
  --info: #2a63b8; --info-soft: #e4ecfa;

  --header-bg: #0f2d55;
  --header-fg: #ffffff;
  --header-muted: #b9c8e0;

  /* Tipografi */
  --font-body: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --fs-xs: 0.78rem;
  --fs-sm: 0.9rem;
  --fs-md: 1rem;
  --fs-lg: 1.15rem;
  --fs-xl: 1.45rem;
  --fs-2xl: clamp(1.7rem, 4.2vw, 2.2rem);
  --fs-3xl: clamp(2rem, 6vw, 3rem);

  /* Jarak, radius, bayangan */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px;
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 2px rgba(16, 32, 26, .06), 0 6px 20px rgba(16, 32, 26, .06);

  --container: 1080px;
  --reading: 68ch;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1220;
    --surface: #131c2e;
    --surface-2: #1b2639;
    --fg: #e5eaf3;
    --muted: #9aa7bf;
    --line: #283550;

    --primary: #7fadeb;
    --primary-strong: #a5c5f2;
    --primary-soft: #1a2a46;
    --on-primary: #0a1424;

    --accent: #e9b04a;
    --accent-soft: #352810;

    --ok: #4cc47f;   --ok-soft: #15301f;
    --warn: #e7a33d; --warn-soft: #33250d;
    --bad: #ef7a6d;  --bad-soft: #3a1a17;
    --info: #86a8ee; --info-soft: #1b2540;

    --header-bg: #0a1a33;
    --header-fg: #ffffff;
    --header-muted: #9fb2d3;

    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

/* Reset ringan */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--fs-md);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); text-underline-offset: 3px; }
a:hover { color: var(--primary-strong); }
[hidden] { display: none !important; }

h1, h2, h3, h4 { line-height: 1.2; margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
h1 { font-size: var(--fs-3xl); font-weight: 800; }
h2 { font-size: var(--fs-2xl); font-weight: 750; }
h3 { font-size: var(--fs-lg); font-weight: 700; }
p { margin: 0; }
ul, ol { margin: 0; padding-left: 1.2em; }

:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Layout */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.stack { display: flex; flex-direction: column; gap: var(--sp-4); }
.stack-lg { display: flex; flex-direction: column; gap: var(--sp-6); }
.row { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; }
.grid-auto { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-auto > * { min-width: 0; }
.section { padding-block: var(--sp-7); }
.reading { max-width: var(--reading); }

/* Teks utilitas */
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.xsmall { font-size: var(--fs-xs); }
.eyebrow {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--primary);
}
.num { font-variant-numeric: tabular-nums; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
