/* ==========================================================================
   DESIGN TOKENS — Gojek-inspired design system
   ========================================================================== */

:root {
  /* ---------- Green ---------- */
  --green-50: #e8f8ea;
  --green-100: #c6efcb;
  --green-200: #98e0a1;
  --green-300: #63ce70;
  --green-400: #2fbb41;
  --green-500: #00aa13;
  --green-600: #009a11;
  --green-700: #00880f;
  --green-800: #00690c;
  --green-900: #004a08;

  /* ---------- Neutrals ---------- */
  --ink-0: #ffffff;
  --ink-25: #fafafa;
  --ink-50: #f4f5f4;
  --ink-100: #ebedeb;
  --ink-200: #dfe2df;
  --ink-300: #c9cdc9;
  --ink-400: #9aa09a;
  --ink-500: #6f756f;
  --ink-600: #565c56;
  --ink-700: #3f443f;
  --ink-800: #2a2d2a;
  --ink-850: #1f221f;
  --ink-900: #151715;
  --ink-950: #0b0c0b;

  /* ---------- Primitive ---------- */
  --red-50: #fdecec;
  --red-500: #e5262f;
  --red-600: #c91f27;
  --red-700: #a3161d;
  --yellow-50: #fff6dd;
  --yellow-400: #ffc12e;
  --yellow-700: #8a5a00;
  --blue-50: #e8f1fd;
  --blue-500: #1a73e8;
  --blue-700: #0f4fa8;

  /* ---------- Typography ---------- */
  --font-sans: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: 1.375rem;
  --fs-xl: clamp(1.625rem, 1.2rem + 1.6vw, 2.25rem);
  --fs-2xl: clamp(2rem, 1.4rem + 2.6vw, 3.25rem);
  --fs-hero: clamp(2.5rem, 1.5rem + 4.4vw, 4.5rem);
  --lh-tight: 1.1;
  --lh-snug: 1.3;
  --lh-body: 1.6;

  /* ---------- Spacing (4px base) ---------- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;

  /* ---------- Radius ---------- */
  --radius-xs: 0.375rem;
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-2xl: 2rem;
  --radius-pill: 999px;

  /* ---------- Motion ---------- */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 120ms;
  --dur: 220ms;
  --dur-slow: 380ms;

  /* ---------- Layout ---------- */
  --container: 72rem;
  --nav-height: 4.25rem;

  /* ---------- Z-index scale ---------- */
  --z-dropdown: 30;
  --z-nav: 100;
  --z-top: 200;
}

/* ==========================================================================
   Semantic tokens — LIGHT (default)
   ========================================================================== */
:root {
  color-scheme: light;

  --bg: var(--ink-50);
  --surface: var(--ink-0);
  --surface-2: var(--ink-25);
  --surface-sunken: var(--ink-100);
  --surface-glass: rgb(255 255 255 / 0.82);
  --border: var(--ink-200);
  --border-strong: var(--ink-300);

  --text: var(--ink-900);
  --text-muted: var(--ink-600);
  --text-subtle: var(--ink-500);
  --text-on-action: #ffffff;

  --brand: var(--green-500);
  --action: var(--green-700);
  --action-hover: var(--green-800);
  --action-press: var(--green-900);
  --action-soft: var(--green-50);
  --action-soft-hover: var(--green-100);
  --action-text: var(--green-700);

  --danger: var(--red-500);
  --danger-hover: var(--red-600);
  --danger-soft: var(--red-50);
  --danger-text: var(--red-700);
  --warning-soft: var(--yellow-50);
  --warning-text: var(--yellow-700);
  --info-soft: var(--blue-50);
  --info-text: var(--blue-700);

  --ring: rgb(0 170 19 / 0.45);
  --overlay: rgb(11 12 11 / 0.55);

  --shadow-xs: 0 1px 2px rgb(21 23 21 / 0.06);
  --shadow-sm: 0 1px 3px rgb(21 23 21 / 0.08), 0 1px 2px rgb(21 23 21 / 0.06);
  --shadow-md: 0 6px 16px -4px rgb(21 23 21 / 0.12), 0 2px 6px -2px rgb(21 23 21 / 0.06);
  --shadow-lg: 0 18px 40px -12px rgb(21 23 21 / 0.2), 0 6px 14px -6px rgb(21 23 21 / 0.08);
  --shadow-brand: 0 10px 24px -8px rgb(0 136 15 / 0.55);
}

/* ==========================================================================
   Semantic tokens — DARK
   ========================================================================== */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --bg: var(--ink-950);
    --surface: var(--ink-900);
    --surface-2: var(--ink-850);
    --surface-sunken: var(--ink-800);
    --surface-glass: rgb(21 23 21 / 0.82);
    --border: var(--ink-800);
    --border-strong: var(--ink-700);

    --text: #f2f4f2;
    --text-muted: var(--ink-300);
    --text-subtle: var(--ink-400);

    --action-soft: rgb(0 170 19 / 0.16);
    --action-soft-hover: rgb(0 170 19 / 0.26);
    --action-text: var(--green-300);

    --danger-soft: rgb(229 38 47 / 0.16);
    --danger-text: #ff8a90;
    --warning-soft: rgb(255 193 46 / 0.16);
    --warning-text: var(--yellow-400);
    --info-soft: rgb(26 115 232 / 0.18);
    --info-text: #8ab8f5;

    --ring: rgb(99 206 112 / 0.5);
    --overlay: rgb(0 0 0 / 0.65);

    --shadow-xs: 0 1px 2px rgb(0 0 0 / 0.4);
    --shadow-sm: 0 1px 3px rgb(0 0 0 / 0.5);
    --shadow-md: 0 8px 20px -6px rgb(0 0 0 / 0.6);
    --shadow-lg: 0 20px 44px -14px rgb(0 0 0 / 0.75);
    --shadow-brand: 0 10px 24px -8px rgb(0 170 19 / 0.4);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: var(--ink-950);
  --surface: var(--ink-900);
  --surface-2: var(--ink-850);
  --surface-sunken: var(--ink-800);
  --surface-glass: rgb(21 23 21 / 0.82);
  --border: var(--ink-800);
  --border-strong: var(--ink-700);

  --text: #f2f4f2;
  --text-muted: var(--ink-300);
  --text-subtle: var(--ink-400);

  --action-soft: rgb(0 170 19 / 0.16);
  --action-soft-hover: rgb(0 170 19 / 0.26);
  --action-text: var(--green-300);

  --danger-soft: rgb(229 38 47 / 0.16);
  --danger-text: #ff8a90;
  --warning-soft: rgb(255 193 46 / 0.16);
  --warning-text: var(--yellow-400);
  --info-soft: rgb(26 115 232 / 0.18);
  --info-text: #8ab8f5;

  --ring: rgb(99 206 112 / 0.5);
  --overlay: rgb(0 0 0 / 0.65);

  --shadow-xs: 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow-sm: 0 1px 3px rgb(0 0 0 / 0.5);
  --shadow-md: 0 8px 20px -6px rgb(0 0 0 / 0.6);
  --shadow-lg: 0 20px 44px -14px rgb(0 0 0 / 0.75);
  --shadow-brand: 0 10px 24px -8px rgb(0 170 19 / 0.4);
}
