/* Design Tokens — single source of truth for colors, type, spacing, shadow */
:root {
  /* Brand */
  --color-primary: #0B2545;        /* Deep navy */
  --color-primary-dark: #061a33;
  --color-circuit: #1E5BC6;        /* PCB blue */
  --color-circuit-light: #4A82E8;
  --color-accent: #F2A93B;         /* CTA amber */
  --color-accent-dark: #D88B16;

  /* Neutrals */
  --color-bg: #FFFFFF;
  --color-bg-soft: #F6F8FB;
  --color-bg-dark: #0F1B2D;
  --color-bg-darker: #08111F;
  --color-border: #E5EAF0;
  --color-border-dark: #1F2C40;

  /* Text */
  --color-text: #1A1A1A;
  --color-text-muted: #5B6675;
  --color-text-light: #8C95A3;
  --color-text-on-dark: #F5F7FA;
  --color-text-on-dark-muted: #A8B3C2;

  /* Status */
  --color-success: #16A34A;
  --color-error: #DC2626;

  /* Typography — Latin first, then CJK fallbacks. Browsers pick the first
     available font for each character, so English uses Inter while
     Chinese falls through to PingFang SC / Microsoft YaHei / Noto Sans SC. */
  --font-sans: "Inter", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB",
    "Noto Sans SC", "Source Han Sans SC", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", "Cascadia Mono", Consolas,
    "PingFang SC", "Microsoft YaHei", monospace;

  /* CJK typography tuning — applied when html[lang="zh"] */
  --cjk-letter-spacing: 0.02em;
  --cjk-word-spacing: 0.05em;
  --cjk-line-height: 1.85;
  --cjk-heading-tracking: -0.005em;

  --fs-xs: 0.75rem;     /* 12 */
  --fs-sm: 0.875rem;    /* 14 */
  --fs-base: 1rem;      /* 16 */
  --fs-md: 1.125rem;    /* 18 */
  --fs-lg: 1.25rem;     /* 20 */
  --fs-xl: 1.5rem;      /* 24 */
  --fs-2xl: 2rem;       /* 32 */
  --fs-3xl: 2.5rem;     /* 40 */
  --fs-4xl: 3.5rem;     /* 56 */

  --lh-tight: 1.15;
  --lh-snug: 1.3;
  --lh-normal: 1.6;

  /* Spacing scale (8px base) */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4rem;
  --sp-9: 6rem;
  --sp-10: 8rem;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 12px;
  --radius-pill: 999px;

  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(11, 37, 69, 0.06);
  --shadow-md: 0 2px 8px rgba(11, 37, 69, 0.08);
  --shadow-lg: 0 8px 24px rgba(11, 37, 69, 0.12);
  --shadow-xl: 0 16px 48px rgba(11, 37, 69, 0.16);

  /* Layout */
  --container-max: 1200px;
  --container-pad: clamp(1rem, 4vw, 2rem);
  --header-height: 72px;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 150ms;
  --dur-base: 250ms;
  --dur-slow: 400ms;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
