/* HAI Demo — Design Tokens
   Primera Tech Labs · 04/2026
   ---------------------------------
   Hệ màu kế thừa từ bộ nhận diện thương hiệu HAI 2015
   (xanh lá #1A8F3D · xanh dương #0066B3 · đỏ #D7282F · cam #F08C1E)
   với 2 hướng tinh chỉnh: Heritage Premium và Modern Minimalist.
*/

:root {
  /* ====== CORE BRAND — KHÔNG ĐƯỢC THAY ĐỔI ====== */
  --hai-green: #1A8F3D;
  --hai-green-700: #0F6B2A;
  --hai-green-100: #E8F5EC;
  --hai-blue: #0066B3;
  --hai-blue-700: #004C85;
  --hai-blue-100: #E5F0F8;
  --hai-red: #D7282F;
  --hai-red-700: #9F1C22;
  --hai-red-100: #FBE9EA;
  --hai-orange: #F08C1E;
  --hai-orange-700: #A35900;
  --hai-orange-100: #FDF1E0;

  /* ====== HERITAGE PREMIUM ====== */
  --heritage-gold: #C9A961;
  --heritage-gold-light: #E5D5A8;
  --heritage-gold-dark: #8B6F3A;
  --heritage-warm-white: #FAF7F0;
  --heritage-warm-100: #F5EFE0;
  --heritage-ink: #1F1B16;
  --heritage-ink-soft: #4A4339;
  --heritage-stone: #8C8275;
  --heritage-border: #E5DDC8;

  /* ====== MODERN MINIMALIST ====== */
  --modern-emerald: #10B981;
  --modern-emerald-light: #6EE7B7;
  --modern-emerald-dark: #047857;
  --modern-bg: #FFFFFF;
  --modern-bg-alt: #FAFAFA;
  --modern-slate-900: #0F172A;
  --modern-slate-700: #334155;
  --modern-slate-500: #64748B;
  --modern-slate-300: #CBD5E1;
  --modern-slate-200: #E2E8F0;
  --modern-slate-100: #F1F5F9;

  /* ====== TYPOGRAPHY ====== */
  --font-heading: 'Be Vietnam Pro', system-ui, -apple-system, sans-serif;
  --font-body: 'Be Vietnam Pro', system-ui, -apple-system, sans-serif;
  --font-tabular: 'Inter Tight', system-ui, sans-serif;
  --font-serif: 'Lora', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* ====== SPACING (8pt grid) ====== */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;

  /* ====== ELEVATION ====== */
  --shadow-soft: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-medium: 0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-large: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.06);
  --shadow-heritage: 0 8px 30px -12px rgba(201, 169, 97, 0.25);

  /* ====== RADII ====== */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* ====== TIMING ====== */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ====== BASE RESET ====== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Bỏ tap highlight xanh trên iOS — tạo cảm giác native */
body, a, button {
  -webkit-tap-highlight-color: transparent;
}

img, svg, video {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ====== TYPOGRAPHY DEFAULTS ====== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0;
}

p { margin: 0; }

/* ====== HERITAGE VARIANT ====== */
[data-variant="heritage"] {
  background: var(--heritage-warm-white);
  color: var(--heritage-ink);
}

[data-variant="heritage"] .accent-text {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--heritage-gold);
}

[data-variant="heritage"] .underline-flourish {
  position: relative;
  display: inline-block;
}
[data-variant="heritage"] .underline-flourish::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--heritage-gold) 30%, var(--heritage-gold) 70%, transparent);
}

/* ====== MODERN VARIANT ====== */
[data-variant="modern"] {
  background: var(--modern-bg);
  color: var(--modern-slate-900);
}

[data-variant="modern"] .accent-text {
  color: var(--modern-emerald);
  font-weight: 500;
}

/* ====== UTILITIES ====== */
.tabular-nums {
  font-feature-settings: 'tnum' 1, 'lnum' 1;
}

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ====== ACCESSIBILITY ====== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* Focus ring rõ ràng cho keyboard nav */
:focus-visible {
  outline: 2px solid var(--hai-green);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ====== DEMO SHELL — chrome bao quanh demo cho HAI điều hướng ====== */
.demo-shell {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: white;
  border-radius: 999px;
  font-size: 13px;
  font-family: var(--font-body);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
.demo-shell a {
  color: white;
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 999px;
  transition: background 150ms;
}
.demo-shell a:hover {
  background: rgba(255, 255, 255, 0.12);
}
.demo-shell .shell-divider {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.2);
}
.demo-shell .shell-tag {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.6);
}
@media print {
  .demo-shell { display: none; }
}
