/* SEPXO Design System — tokens V2 (30/11/2026, giờ Việt Nam)
   Shared component + type/space scale. Product color is NOT shared:
   each app sets a personality via [data-theme].
   Fluid type and space follow Utopia (min 320px, max 1240px, body 16–18px,
   major third 1.25). Principles distilled from Chrome Modern Web Guidance
   typography guide (CC BY 4.0) — see RESOURCE_LICENSES.md.
*/

:root {
  /* Families: sans for UI, display only where the product asks for it, mono for numerals */
  --font-sans: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Source Serif 4", "Times New Roman", serif;
  --font-num: "IBM Plex Mono", "Be Vietnam Pro", ui-monospace, monospace;
  --font-mono: var(--font-num);

  /* Two weights only */
  --fw-regular: 400;
  --fw-emphasis: 600;

  /* Utopia type scale */
  --step--2: clamp(0.6400rem, 0.6122rem + 0.1391vw, 0.7200rem);
  --step--1: clamp(0.8000rem, 0.7652rem + 0.1739vw, 0.9000rem);
  --step-0:  clamp(1.0000rem, 0.9565rem + 0.2174vw, 1.1250rem);
  --step-1:  clamp(1.2500rem, 1.1957rem + 0.2717vw, 1.4062rem);
  --step-2:  clamp(1.5625rem, 1.4945rem + 0.3402vw, 1.7581rem);
  --step-3:  clamp(1.9531rem, 1.8681rem + 0.4250vw, 2.1975rem);
  --step-4:  clamp(2.4413rem, 2.3349rem + 0.5315vw, 2.7469rem);
  --step-5:  clamp(3.0519rem, 2.9193rem + 0.6630vw, 3.4331rem);

  /* Backward-compatible aliases (old px tokens) */
  --text-xs: var(--step--2);
  --text-sm: var(--step--1);
  --text-md: var(--step-0);
  --text-lg: var(--step-1);
  --text-xl: var(--step-2);
  --text-2xl: var(--step-3);
  --text-3xl: var(--step-4);
  --text-display: var(--step-4); /* was up to 56px; cap near 44px */

  --leading-tight: 1.2;
  --leading-snug: 1.35;
  --leading-body: 1.5;
  --measure: 65ch;

  /* Utopia space scale */
  --space-3xs: 0.2500rem;
  --space-2xs: 0.5000rem;
  --space-xs:  clamp(0.7500rem, 0.7065rem + 0.2174vw, 0.8750rem);
  --space-s:   clamp(1.0000rem, 0.9130rem + 0.4348vw, 1.2500rem);
  --space-m:   clamp(1.5000rem, 1.4130rem + 0.4348vw, 1.7500rem);
  --space-l:   clamp(2.0000rem, 1.8261rem + 0.8696vw, 2.5000rem);
  --space-xl:  clamp(3.0000rem, 2.6522rem + 1.7391vw, 4.0000rem);
  --space-2xl: clamp(4.0000rem, 3.6522rem + 1.7391vw, 5.0000rem);
  --space-3xl: clamp(5.0000rem, 4.6522rem + 1.7391vw, 6.0000rem);

  --space-half: var(--space-3xs);
  --space-1: var(--space-2xs);
  --space-2: var(--space-s);
  --space-3: var(--space-m);
  --space-4: var(--space-l);
  --space-5: var(--space-l);
  --space-6: var(--space-xl);
  --space-7: var(--space-2xl);
  --space-8: var(--space-3xl);
  --space-9: var(--space-3xl);

  --radius-s: 6px;
  --radius-m: 10px;
  --radius-l: 14px;
  --radius-pill: 999px;

  --shadow-color: 30 20% 12%;
  --shadow-1: 0 1px 2px hsl(var(--shadow-color) / 0.06);
  --shadow-2: 0 1px 2px hsl(var(--shadow-color) / 0.04), 0 8px 24px hsl(var(--shadow-color) / 0.06);
  --shadow-3: 0 12px 32px hsl(var(--shadow-color) / 0.12);

  --touch: 2.75rem; /* 44px at 16px root — minimum, not a default padding target */
  --header-h: 3.25rem;

  /* Default (neutral, unused if the app sets data-theme) */
  color-scheme: light;
  --bg: #F7F7F5;
  --bg-soft: #EEEEEA;
  --surface: #FFFFFF;
  --ink: #16140F;
  --muted: #5C564C;
  --faint: #6F685E;
  --line: rgba(22, 20, 15, 0.10);
  --line-strong: rgba(22, 20, 15, 0.18);
  --accent: #0F766E;
  --accent-hover: #0B5F58;
  --accent-soft: #E7F5F3;
  --accent-ink: #FFFFFF;
  --warn: #9F2D1F;
  --ok: #1F4D3A;
  --theme-color: #F7F7F5;
  --paper: var(--bg);
  --shadow: var(--shadow-2);
  --radius: var(--radius-m);
  --green: var(--accent);
  --green-deep: var(--ink);
  --green-tint: var(--accent-soft);
  --gold: var(--accent);
  --gold-bright: var(--accent);
  --red: var(--warn);
  --rule: var(--line);
  --rule-soft: var(--bg-soft);
  --gold-bar: var(--accent);
}

/* Giá Tiền — Financial Times × Stripe: warm paper, one brick accent, editorial serif on the hero only */
[data-theme="giatien"], [data-product="giatien"] {
  color-scheme: light;
  --bg: #F6F1E8;
  --bg-soft: #EFE8DC;
  --surface: #FFFCF7;
  --ink: #16140F;
  --muted: #5C564C;
  --faint: #6F685E;
  --line: rgba(22, 20, 15, 0.10);
  --line-strong: rgba(22, 20, 15, 0.18);
  --accent: #8E2A1B;
  --accent-hover: #6F2014;
  --accent-soft: #F4E4DC;
  --accent-ink: #FFFCF7;
  --warn: #8E2A1B;
  --ok: #1F4D3A;
  --theme-color: #F6F1E8;
  --font-display: "Source Serif 4", "Times New Roman", serif;
  --gold: #E8D4A8;
}

html[data-product="giatien"][data-theme="dark"] {
  --bg: #0E1420;
  --bg-soft: #161D2C;
  --surface: #171E2C;
  --ink: #F3EFE7;
  --muted: #A8A195;
  --faint: #8E887C;
  --line: rgba(243, 239, 231, 0.12);
  --accent: #E8A090;
  --accent-hover: #F0B8AC;
  --accent-soft: #2A1E1C;
  --accent-ink: #0E1420;
  --theme-color: #0E1420;
}

/* Ngày Sinh — Apple Health × Spotify Wrapped: cool canvas, sans-first, color story cards */
[data-theme="ngaysinh"], [data-product="ngaysinh"] {
  color-scheme: light;
  --bg: #F3F5F7;
  --bg-soft: #E6ECF1;
  --surface: #FFFFFF;
  --ink: #12141A;
  --muted: #5C6570;
  --faint: #6E7882;
  --line: rgba(18, 20, 26, 0.10);
  --line-strong: rgba(18, 20, 26, 0.16);
  --accent: #0F766E;
  --accent-hover: #0B5F58;
  --accent-soft: #D9F3EF;
  --accent-ink: #FFFFFF;
  --card-a: #E7F6F3;
  --card-b: #FFF1E8;
  --card-c: #EEF3FF;
  --card-d: #F4EEFF;
  --warn: #B42318;
  --ok: #067647;
  --theme-color: #F3F5F7;
  --font-display: "Be Vietnam Pro", system-ui, sans-serif; /* sans-first */
  --radius-l: 16px;
}

html[data-product="ngaysinh"][data-theme="dark"] {
  color-scheme: dark;
  --bg: #0E1214;
  --bg-soft: #171C20;
  --surface: #1B2126;
  --ink: #F2F4F6;
  --muted: #A8B0B8;
  --faint: #8B949E;
  --line: rgba(242, 244, 246, 0.12);
  --accent: #2DD4BF;
  --accent-hover: #5EEAD4;
  --accent-soft: #13332F;
  --accent-ink: #05201C;
  --card-a: #10241F;
  --card-b: #2A1D14;
  --card-c: #172033;
  --card-d: #241C33;
  --theme-color: #0E1214;
}

/* Xưa — National Geographic × Google Arts & Culture: dark, image-led, gold caption */
[data-theme="xua"], [data-product="xua"] {
  color-scheme: dark;
  --bg: #0B0B0B;
  --bg-soft: #141414;
  --surface: #161616;
  --ink: #F4F1EA;
  --muted: #B5AFA4;
  --faint: #9A948A;
  --line: rgba(244, 241, 234, 0.12);
  --line-strong: rgba(244, 241, 234, 0.22);
  --accent: #C4A35A;
  --accent-hover: #D4B56A;
  --accent-soft: #2A2416;
  --accent-ink: #14110B;
  --warn: #E8A090;
  --ok: #8FCBB0;
  --theme-color: #0B0B0B;
  --font-display: "Source Serif 4", "Times New Roman", serif;
  --header-h: 3rem;
  --shadow-color: 0 0% 0%;
  --shadow-2: 0 8px 28px hsl(0 0% 0% / 0.45);
}

/* Shared primitive hints (apps may refine) */
