/* Design Token System v2 — CNC Mạnh Hưng
 * Typography: Pure Be Vietnam Pro (300–800, natively engineered for crisp Vietnamese diacritics)
 *             + JetBrains Mono exclusively for engineering numbers, dimensions, and specs.
 * Themes: Dark Machined Obsidian (Default, SpaceX/BMW-M inspired) + Light Corporate Precision (BMW inspired).
 */

:root,
[data-theme="dark"] {
  --bg-canvas: #090a0d;
  --bg-soft: #101218;
  --bg-elevated: #151821;
  --bg-hover: #1c202c;
  --bg-input: #0c0e13;
  --bg-nav: rgba(9, 10, 13, 0.88);
  --bg-pedestal: linear-gradient(180deg, #f6f8fb 0%, #eaedf3 100%);

  --ink-primary: #f8fafc;
  --ink-body: #b6bfce;
  --ink-muted: #7f8a9d;
  --ink-inverse: #090a0d;

  --hairline: rgba(255, 255, 255, 0.09);
  --hairline-strong: rgba(255, 255, 255, 0.18);

  --accent: #f97316;
  --accent-hover: #ea580c;
  --accent-soft: rgba(249, 115, 22, 0.14);
  --accent-ink: #ffffff;

  --tech-blue: #3b82f6;
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;

  --shadow-soft: 0 12px 32px rgba(0, 0, 0, 0.34);
  --shadow-modal: 0 28px 72px rgba(0, 0, 0, 0.78);
  --hero-scrim: linear-gradient(100deg, rgba(7, 9, 13, 0.94) 0%, rgba(7, 9, 13, 0.80) 45%, rgba(7, 9, 13, 0.34) 80%, rgba(7, 9, 13, 0.56) 100%);
  --hero-scrim-bottom: linear-gradient(180deg, rgba(7, 9, 13, 0.45) 0%, rgba(7, 9, 13, 0) 28%, rgba(7, 9, 13, 0.94) 100%);

  --font-display: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Consolas, monospace;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --container-max: 1320px;
  --gutter: clamp(20px, 4vw, 48px);
}

[data-theme="light"] {
  --bg-canvas: #ffffff;
  --bg-soft: #f4f6f9;
  --bg-elevated: #ffffff;
  --bg-hover: #edf0f5;
  --bg-input: #ffffff;
  --bg-nav: rgba(255, 255, 255, 0.94);
  --bg-pedestal: linear-gradient(180deg, #f8f9fb 0%, #eef1f6 100%);

  --ink-primary: #11141a;
  --ink-body: #3e4654;
  --ink-muted: #687385;
  --ink-inverse: #ffffff;

  --hairline: #e2e6ee;
  --hairline-strong: #c8cfd9;

  --accent: #1c69d4;
  --accent-hover: #0653b6;
  --accent-soft: rgba(28, 105, 212, 0.10);
  --accent-ink: #ffffff;

  --tech-blue: #ea580c;
  --success: #15803d;
  --danger: #b91c1c;
  --warning: #b45309;

  --shadow-soft: 0 10px 28px rgba(15, 23, 42, 0.07);
  --shadow-modal: 0 28px 72px rgba(15, 23, 42, 0.24);
  --hero-scrim: linear-gradient(100deg, rgba(10, 14, 22, 0.92) 0%, rgba(10, 14, 22, 0.78) 46%, rgba(10, 14, 22, 0.32) 82%, rgba(10, 14, 22, 0.5) 100%);
  --hero-scrim-bottom: linear-gradient(180deg, rgba(10, 14, 22, 0.42) 0%, rgba(10, 14, 22, 0) 30%, rgba(10, 14, 22, 0.90) 100%);
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
  background: var(--bg-canvas);
  color: var(--ink-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

html[data-theme="light"] {
  color-scheme: light;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg-canvas);
  color: var(--ink-primary);
  overflow-x: hidden;
}

input, textarea, select {
  caret-color: var(--accent);
  font-family: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-soft);
}

::-webkit-scrollbar-thumb {
  background: var(--hairline-strong);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
