/* Thân DNA — design tokens.
   Source of truth: design/than-dna/tokens.json
   (Design System: https://claude.ai/artifact/6e76JpAAAQM1P4kzwuDFQP).
   Change a value there first, then mirror it here. */

:root {
  /* Base palette — sampled from the Thân logo */
  --terracotta-50: #fbefe6; --terracotta-100: #f3d9c8; --terracotta-300: #c98761;
  --terracotta-500: #b0643f; --terracotta-600: #975032; --terracotta-700: #7e4128;
  --terracotta-800: #62311e; --terracotta-900: #422013;
  --peach-100: #fceadb; --peach-200: #f9d5b6; --peach-300: #f5b786; --peach-400: #e6a681;
  --amber-500: #d48946; --amber-600: #b87232;
  --cream-0: #fffcf8; --cream-50: #fbf6ef; --cream-100: #f5ede1;
  --sand-200: #eaddcb; --sand-300: #d9c7b0;
  --ink-400: #9c8676; --ink-500: #7c6656; --ink-700: #55402f; --ink-900: #2b1d15;
  --success-600: #5b7445; --success-50: #eef2e6;
  --warning-600: #a8661c; --warning-50: #fbf0dc;
  --danger-600: #b23a2a; --danger-50: #f9e3de;
  --info-600: #4d6274; --info-50: #e8edf1;

  /* Semantic — light theme */
  --bg-page: var(--cream-50);
  --bg-subtle: var(--cream-100);
  --bg-raised: var(--cream-0);
  --bg-brand: var(--terracotta-600);
  --bg-brand-deep: var(--terracotta-800);
  --bg-header: rgba(251, 246, 239, 0.92);
  --text-primary: var(--ink-900);
  --text-secondary: var(--ink-700);
  --text-muted: var(--ink-500);
  --text-brand: var(--terracotta-600);
  --text-on-brand: #fff7ef;
  --border-subtle: var(--sand-200);
  --border-default: var(--sand-300);
  --border-strong: var(--ink-700);
  --focus-ring: var(--amber-500);
  --action-primary: var(--terracotta-600);
  --action-primary-hover: var(--terracotta-700);
  --action-primary-press: var(--terracotta-800);
  --chip-selected-bg: var(--ink-900);
  --chip-selected-fg: var(--cream-50);

  /* Type */
  --font-display: "Patrick Hand", "Be Vietnam Pro", system-ui, sans-serif;
  --font-text: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, monospace;

  /* Space */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px;
  --space-6: 32px; --space-7: 48px; --space-8: 64px; --space-9: 96px; --space-10: 128px;
  --container-max: 1200px; --gutter: 24px;

  /* Shape */
  --radius-xs: 3px; --radius-sm: 6px; --radius-md: 10px; --radius-lg: 16px; --radius-pill: 999px;
  --radius-tile: 4px 4px 14px 14px;
  --radius-arch: 220px 220px 16px 16px;

  /* Elevation */
  --shadow-1: 0 1px 2px rgba(66, 32, 19, 0.06), 0 1px 1px rgba(66, 32, 19, 0.04);
  --shadow-2: 0 6px 20px rgba(66, 32, 19, 0.08), 0 2px 4px rgba(66, 32, 19, 0.05);
  --shadow-3: 0 22px 48px rgba(66, 32, 19, 0.16), 0 6px 12px rgba(66, 32, 19, 0.06);

  /* Motion */
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur-fast: 140ms; --dur-base: 220ms; --dur-slow: 420ms;

  color-scheme: light;
}

/* Dark theme — follows the visitor's system setting */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-page: #1d1410;
    --bg-subtle: #2e2119;
    --bg-raised: #271b15;
    --bg-brand: var(--terracotta-800);
    --bg-brand-deep: #160f0b;
    --bg-header: rgba(29, 20, 16, 0.92);
    --text-primary: #f5ede1;
    --text-secondary: #d9c7b0;
    --text-muted: #b49e8b;
    --text-brand: var(--peach-300);
    --border-subtle: #3a2b21;
    --border-default: #4f3c2f;
    --border-strong: #d9c7b0;
    --chip-selected-bg: var(--cream-100);
    --chip-selected-fg: var(--ink-900);
    color-scheme: dark;
  }
}
