/*
 * Token spine MIDAS — nạp TRƯỚC style.min.css (handle `midas-tokens`).
 *
 * Vì sao có file này: brand guideline của khách chỉ có 3 màu, nhưng trong CSS
 * chúng đang nằm rải rác dưới dạng hex literal ở 19 file + nhiều biến thể rgba().
 * Mọi CSS viết MỚI phải dùng biến ở đây, không hardcode hex.
 *
 * Vai trò màu (theo brand guideline):
 *   - Xanh dương  #3c3bdf : nền section, heading
 *   - Vàng đậm    #ffb214 : nút CTA, highlight text
 *   - Vàng nhạt   #fff1bc : element phụ, nền nhấn nhẹ
 *   - Trắng/đen            : text thường
 *
 * Contrast đã đo (WCAG AA cần >= 4.5):
 *   #ffb214 + trắng = 1.81 ❌  -> chữ trên vàng LUÔN dùng --text-on-yellow
 *   #ffb214 + #101020 = 10.41 ✅
 *   #3c3bdf + trắng = 7.28 ✅ | #3c3bdf + #fff1bc = 6.44 ✅
 *   #212079 + trắng = 13.57 ✅ | #212079 + #ffb214 = 7.52 ✅
 */
:root {
  /* === Typography font family === */
  --font-pri: 'Google Sans', 'Google Sans Fallback', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-sec: 'Google Sans', 'Google Sans Fallback', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Bebas Neue', 'UTM Bebas', 'Bebas Neue Fallback', system-ui, sans-serif;
  --font-body: 'Google Sans', 'Google Sans Fallback', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-thir: var(--font-body);

  /* === Brand: xanh dương === */
  --brand-blue: #3c3bdf;
  --brand-blue-hover: #3231c4;
  --brand-blue-deep: #212079;
  --brand-blue-light: #6766e6;
  --brand-blue-pale: #b1b1f2;
  --brand-blue-soft: #eae9ff;
  /* Chỉ dùng cho trang About (clone 1:1 midas.vn): band xanh đậm + gradient card. */
  --brand-blue-strong: #1c00c2;
  --brand-blue-night: #01199a;

  /* === Brand: vàng === */
  --brand-yellow: #ffb214;
  --brand-yellow-deep: #e59a00;
  --brand-yellow-soft: #fff1bc;
  --brand-yellow-tint: #fffae7;
  --brand-yellow-light: #ffde59;

  /* === Trung tính (trắng/đen linh hoạt cho text thường) === */
  --ink: #101020;
  --ink-strong: #000;
  --muted: #5a5a6a;
  --surface: #fff;
  --surface-alt: #fafafa;
  --line: #e4e4f0;

  /* === Semantic (chỉ dùng cho trạng thái, không phải brand) === */
  --state-danger: #eb2121;
  --state-danger-soft: #fff1f1;
  --state-success: #16a672;
  --state-success-soft: #e7fbf2;

  /* === Vai trò: dùng token này thay vì gọi thẳng --brand-* === */
  --heading-color: var(--brand-blue);
  --heading-on-dark: var(--surface);
  --body-color: var(--ink);
  --section-bg: var(--surface);
  --section-bg-alt: var(--surface-alt);
  --section-bg-dark: var(--brand-blue);
  --section-bg-deep: var(--brand-blue-deep);
  --text-on-blue: var(--surface);
  --text-on-yellow: var(--ink);
  --highlight-color: var(--brand-yellow);

  /* Nút: CTA chính vàng đậm, nút phụ nền sáng dùng xanh,
     nút phụ TRÊN NỀN TỐI dùng vàng nhạt. */
  --cta-bg: var(--brand-yellow);
  --cta-bg-hover: var(--brand-yellow-deep);
  --cta-fg: var(--ink);
  --btn-sec-bg: var(--brand-blue);
  --btn-sec-bg-hover: var(--brand-blue-hover);
  --btn-sec-fg: var(--surface);
  --btn-ondark-bg: var(--brand-yellow-soft);
  --btn-ondark-fg: var(--ink);

  /* Semantic body scale — shared by prose, controls and supporting copy. */
  --text-body: 1.6rem;
  --text-small: 1.4rem;

  /* Semantic heading scale: H1 > H2 > H3 > H4 > H5 > H6. */
  --text-h1: clamp(3.2rem, 4vw, 4.8rem);
  --text-h2: clamp(2.4rem, 2.8vw, 3.4rem);
  --text-h3: clamp(1.9rem, 2vw, 2.4rem);
  --text-h4: clamp(1.7rem, 1.8vw, 2rem);
  --text-h5: 1.6rem;
  --text-h6: 1.5rem;
  --heading-leading-tight: 1.2;
  --heading-leading: 1.25;
  --heading-tracking: 0;
  --text-card: var(--text-h3);

  /* Shared layout/component contracts */
  --container-default: 114.8rem;
  --container-wide: 124.6rem;
  --space-section: 5rem;
  --space-section-mobile: 3rem;
  --control-radius: 0.5rem;

  /* === Motion System: Đồng bộ toàn site === */
  --motion-fast: 0.18s;
  --motion-base: 0.32s;
  --motion-slow: 0.5s;
  --motion-hover: 0.22s;
  --motion-hover-scale: 1.04;
  --motion-lift: -4px;
  --motion-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --motion-ease-in-out: cubic-bezier(0.45, 0, 0.55, 1);
  --motion-ease-spring: cubic-bezier(0.2, 0.8, 0.2, 1);
  --motion-translate-reveal: 16px;
  --motion-ambient-duration: 4s;
  /* Bo góc dùng chung */
  --radius-sm: 0.8rem;
  --radius-md: 1.2rem;
  --radius-lg: 2rem;
  --radius-pill: 999px;
}

@media (max-width: 767px) {
  :root {
    --text-h1: clamp(2.8rem, 7.5vw, 3.2rem);
    --text-h2: clamp(2.2rem, 5.5vw, 2.8rem);
    --text-h3: clamp(1.8rem, 4.5vw, 2.2rem);
    --text-h4: clamp(1.6rem, 4vw, 1.8rem);
    --text-h5: 1.5rem;
    --text-h6: 1.4rem;
  }
}
