/* ==========================================================================
   VREB — Design tokens v1.0 (28/11/2026)
   Sinh tự động từ _build/brand_data.py — đừng sửa tay, sửa nguồn rồi chạy lại.
   Tên biến theo chuẩn shadcn/ui. Hai chế độ: :root (sáng) và .dark / [data-theme="dark"] (tối).
   Không đặt data-theme/class gì -> theo prefers-color-scheme của hệ điều hành.
   Font: nạp Lora + Be Vietnam Pro (next/font hoặc Google Fonts) — xem README.md.
   ========================================================================== */

:root {
  /* --- thang màu thương hiệu (không đổi theo chế độ) --- */
  --vreb-gold-50: #FBF6E6;
  --vreb-gold-100: #F4E8C6;
  --vreb-gold-200: #EAD596;
  --vreb-gold-300: #E0C06A;
  --vreb-gold-400: #D6AE4E;
  --vreb-gold-500: #CFA23A;
  --vreb-gold-600: #B48726;
  --vreb-gold-700: #9A7420;
  --vreb-gold-800: #78571A;
  --vreb-gold-900: #574012;
  --vreb-ink-50: #F4F4F5;
  --vreb-ink-100: #E7E7EA;
  --vreb-ink-200: #CFCFD4;
  --vreb-ink-300: #A6A6AE;
  --vreb-ink-400: #7E7E87;
  --vreb-ink-500: #585860;
  --vreb-ink-600: #2F2F34;
  --vreb-ink-700: #1F1F23;
  --vreb-ink-800: #141416;
  --vreb-ink-900: #0B0B0D;
  --vreb-ink-950: #050506;
  --vreb-ivory-50: #FFFFFF;
  --vreb-ivory-100: #F8F5EE;
  --vreb-ivory-200: #F0EBDF;
  --vreb-ivory-300: #E3DCCB;
  --vreb-ivory-400: #CFC6B0;
  --vreb-black: #000000;
  --vreb-gold-foil: linear-gradient(150deg, #EAD596 0%, #CFA23A 42%, #B48726 78%, #9A7420 100%);
  --vreb-gold-foil-light: linear-gradient(150deg, #A77E23 0%, #9A7420 50%, #78571A 100%);
  --vreb-gold-foil-text: linear-gradient(160deg, #EAD596 0%, #CFA23A 50%, #B48726 100%);

  /* --- chữ --- */
  --vreb-font-serif: "Lora", "Iowan Old Style", "Palatino Linotype", Georgia, "Times New Roman", serif;
  --vreb-font-sans: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --vreb-font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* thang cỡ chữ (tỉ lệ ~1.25, co giãn theo khung nhìn). Tiếng Việt: dòng cao >= 1.2 cho tiêu đề, 1.55+ cho nội dung */
  --text-display: clamp(2.5rem, 1.6rem + 3.6vw, 4rem);   --lh-display: 1.08;
  --text-h1: clamp(2.125rem, 1.5rem + 2.4vw, 3rem);       --lh-h1: 1.12;
  --text-h2: clamp(1.75rem, 1.4rem + 1.4vw, 2.25rem);     --lh-h2: 1.2;
  --text-h3: clamp(1.375rem, 1.2rem + 0.7vw, 1.75rem);    --lh-h3: 1.28;
  --text-h4: 1.25rem;                                    --lh-h4: 1.35;
  --text-lg: 1.125rem;                                   --lh-lg: 1.6;
  --text-base: 1rem;                                     --lh-base: 1.6;
  --text-sm: 0.875rem;                                   --lh-sm: 1.55;
  --text-xs: 0.75rem;                                    --lh-xs: 1.45;
  --tracking-overline: 0.14em;

  /* --- hình khối --- */
  --radius: 0.5rem;
  --container: 75rem;
  --focus-width: 2px;
  --focus-offset: 2px;

  /* --- ngữ nghĩa: chế độ sáng --- */
  --background: #F8F5EE;
  --foreground: #0B0B0D;
  --card: #FFFFFF;
  --card-foreground: #0B0B0D;
  --popover: #FFFFFF;
  --popover-foreground: #0B0B0D;
  --primary: #0B0B0D;
  --primary-foreground: #FFFFFF;
  --secondary: #E7E7EA;
  --secondary-foreground: #0B0B0D;
  --muted: #F0EBDF;
  --muted-foreground: #585860;
  --accent: #F4E8C6;
  --accent-foreground: #0B0B0D;
  --brand: #CFA23A;
  --brand-foreground: #0B0B0D;
  --destructive: #A93A35;
  --destructive-foreground: #FFFFFF;
  --success: #2E7D5B;
  --success-foreground: #FFFFFF;
  --warning: #A8590F;
  --warning-foreground: #FFFFFF;
  --info: #2F5F9E;
  --info-foreground: #FFFFFF;
  --link: #78571A;
  --border: #E3DCCB;
  --input: #CFC6B0;
  --ring: #9A7420;
  --chart-1: #B48726;
  --chart-2: #0B0B0D;
  --chart-3: #2F5F9E;
  --chart-4: #2E7D5B;
  --chart-5: #A93A35;
  --success-soft: #E4F1EA;
  --success-soft-foreground: #1C5239;
  --warning-soft: #F6E9D8;
  --warning-soft-foreground: #6B3A0B;
  --danger-soft: #F5E3E1;
  --danger-soft-foreground: #7A2622;
  --info-soft: #E1EAF5;
  --info-soft-foreground: #1E4170;
  --sidebar: #FFFFFF;
  --sidebar-foreground: #0B0B0D;
  --sidebar-primary: #0B0B0D;
  --sidebar-primary-foreground: #FFFFFF;
  --sidebar-accent: #F4E8C6;
  --sidebar-accent-foreground: #0B0B0D;
  --sidebar-border: #E3DCCB;
  --sidebar-ring: #9A7420;
  --shadow-1: 0 1px 2px rgb(11 11 13 / .06), 0 1px 1px rgb(11 11 13 / .04);
  --shadow-2: 0 4px 12px rgb(11 11 13 / .08), 0 1px 3px rgb(11 11 13 / .06);
  --shadow-3: 0 16px 40px rgb(11 11 13 / .14), 0 4px 10px rgb(11 11 13 / .08);
  color-scheme: light;
}

.dark,
[data-theme="dark"] {
  --background: #0B0B0D;
  --foreground: #F8F5EE;
  --card: #141416;
  --card-foreground: #F8F5EE;
  --popover: #141416;
  --popover-foreground: #F8F5EE;
  --primary: #CFA23A;
  --primary-foreground: #0B0B0D;
  --secondary: #1F1F23;
  --secondary-foreground: #F4F4F5;
  --muted: #1F1F23;
  --muted-foreground: #A6A6AE;
  --accent: #1F1F23;
  --accent-foreground: #E0C06A;
  --brand: #CFA23A;
  --brand-foreground: #0B0B0D;
  --destructive: #F2938D;
  --destructive-foreground: #0B0B0D;
  --success: #5FCBA0;
  --success-foreground: #0B0B0D;
  --warning: #F0A94A;
  --warning-foreground: #0B0B0D;
  --info: #8FB4E8;
  --info-foreground: #0B0B0D;
  --link: #E0C06A;
  --border: #2F2F34;
  --input: #2F2F34;
  --ring: #CFA23A;
  --chart-1: #CFA23A;
  --chart-2: #8FB4E8;
  --chart-3: #5FCBA0;
  --chart-4: #E0C06A;
  --chart-5: #F2938D;
  --success-soft: #102A21;
  --success-soft-foreground: #A5E6C9;
  --warning-soft: #33260F;
  --warning-soft-foreground: #F7D49D;
  --danger-soft: #361A1C;
  --danger-soft-foreground: #F7C0BB;
  --info-soft: #142540;
  --info-soft-foreground: #BDD3F2;
  --sidebar: #141416;
  --sidebar-foreground: #F8F5EE;
  --sidebar-primary: #CFA23A;
  --sidebar-primary-foreground: #0B0B0D;
  --sidebar-accent: #1F1F23;
  --sidebar-accent-foreground: #E0C06A;
  --sidebar-border: #2F2F34;
  --sidebar-ring: #CFA23A;
  --shadow-1: 0 1px 2px rgb(0 0 0 / .4);
  --shadow-2: 0 4px 14px rgb(0 0 0 / .45), 0 0 0 1px rgb(207 162 58 / .06);
  --shadow-3: 0 18px 48px rgb(0 0 0 / .55), 0 0 0 1px rgb(207 162 58 / .1);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not(.light):not([data-theme="light"]) {
    --background: #0B0B0D;
    --foreground: #F8F5EE;
    --card: #141416;
    --card-foreground: #F8F5EE;
    --popover: #141416;
    --popover-foreground: #F8F5EE;
    --primary: #CFA23A;
    --primary-foreground: #0B0B0D;
    --secondary: #1F1F23;
    --secondary-foreground: #F4F4F5;
    --muted: #1F1F23;
    --muted-foreground: #A6A6AE;
    --accent: #1F1F23;
    --accent-foreground: #E0C06A;
    --brand: #CFA23A;
    --brand-foreground: #0B0B0D;
    --destructive: #F2938D;
    --destructive-foreground: #0B0B0D;
    --success: #5FCBA0;
    --success-foreground: #0B0B0D;
    --warning: #F0A94A;
    --warning-foreground: #0B0B0D;
    --info: #8FB4E8;
    --info-foreground: #0B0B0D;
    --link: #E0C06A;
    --border: #2F2F34;
    --input: #2F2F34;
    --ring: #CFA23A;
    --chart-1: #CFA23A;
    --chart-2: #8FB4E8;
    --chart-3: #5FCBA0;
    --chart-4: #E0C06A;
    --chart-5: #F2938D;
    --success-soft: #102A21;
    --success-soft-foreground: #A5E6C9;
    --warning-soft: #33260F;
    --warning-soft-foreground: #F7D49D;
    --danger-soft: #361A1C;
    --danger-soft-foreground: #F7C0BB;
    --info-soft: #142540;
    --info-soft-foreground: #BDD3F2;
    --sidebar: #141416;
    --sidebar-foreground: #F8F5EE;
    --sidebar-primary: #CFA23A;
    --sidebar-primary-foreground: #0B0B0D;
    --sidebar-accent: #1F1F23;
    --sidebar-accent-foreground: #E0C06A;
    --sidebar-border: #2F2F34;
    --sidebar-ring: #CFA23A;
    --shadow-1: 0 1px 2px rgb(0 0 0 / .4);
    --shadow-2: 0 4px 14px rgb(0 0 0 / .45), 0 0 0 1px rgb(207 162 58 / .06);
    --shadow-3: 0 18px 48px rgb(0 0 0 / .55), 0 0 0 1px rgb(207 162 58 / .1);
    color-scheme: dark;
  }
}

/* --- lớp tiện ích nhỏ, dùng được không cần Tailwind --- */
.vreb-serif { font-family: var(--vreb-font-serif); }
.vreb-sans { font-family: var(--vreb-font-sans); }
.vreb-overline { font: 600 var(--text-xs)/var(--lh-xs) var(--vreb-font-sans); letter-spacing: var(--tracking-overline); text-transform: uppercase; }
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: var(--focus-width) solid var(--ring); outline-offset: var(--focus-offset);
}
