/* =====================================================================
   GT Dynamics — Design tokens
   Single source of truth for colors, type, spacing, radii, motion.
   Owner: web-lead. Other agents READ these, never redefine raw values.
   Spec: docs/DESIGN.md
   ===================================================================== */

:root {
  color-scheme: dark;

  /* ---------- Surfaces (Discord-style layered greys) ---------- */
  --bg-0: #0E0F11;   /* page base, under the dot grid            */
  --bg-1: #16171A;   /* alt sections, footer, app rails          */
  --bg-2: #1E1F22;   /* sidebars, header, inset wells            */
  --bg-3: #2B2D31;   /* cards, panels                            */
  --bg-4: #313338;   /* raised / hover on cards                  */
  --bg-5: #383A40;   /* inputs, active rows, pressed             */
  --bg-6: #404249;   /* selected rows, scrollbar thumb           */

  --line-1: rgba(255, 255, 255, 0.06);  /* hairlines inside panels  */
  --line-2: rgba(255, 255, 255, 0.10);  /* card borders              */
  --line-3: rgba(255, 255, 255, 0.18);  /* hover borders, dividers   */

  /* ---------- Text ---------- */
  --text-1: #F2F3F5;  /* headings, primary            */
  --text-2: #B5BAC1;  /* body copy                    */
  --text-3: #949BA4;  /* meta, captions, eyebrows (AA on --bg-3) */
  --text-4: #5C6069;  /* disabled, placeholder        */

  /* ---------- Brand: GT yellow (logo color) ---------- */
  --brand:       #FFD43B;
  --brand-hi:    #FFE07A;  /* hover            */
  --brand-lo:    #E6B800;  /* pressed / active */
  --brand-ink:   #16171A;  /* text on yellow   */
  --brand-soft:  rgba(255, 212, 59, 0.10);
  --brand-soft-2:rgba(255, 212, 59, 0.18);
  --brand-line:  rgba(255, 212, 59, 0.38);
  --brand-glow:  0 0 0 1px rgba(255, 212, 59, 0.35), 0 10px 40px -10px rgba(255, 212, 59, 0.45);

  /* ---------- Semantic (pastel, used ONLY for status / tags) ---------- */
  --ok:        #6BD08F;  --ok-soft:     rgba(107, 208, 143, 0.12);
  --info:      #8B97F7;  --info-soft:   rgba(139, 151, 247, 0.14);  /* Discord blurple, softened */
  --warn:      #E8925B;  --warn-soft:   rgba(232, 146, 91, 0.14);   /* Claude terracotta, lighter */
  --danger:    #F2716B;  --danger-soft: rgba(242, 113, 107, 0.14);
  --cyan:      #5FD3E8;  --cyan-soft:   rgba(95, 211, 232, 0.12);

  /* ---------- Device theme colors (ROUND_AMOLED theme_palette) ---------- */
  --dev-cyber-yellow:  #FFE000;
  --dev-racing-red:    #FF1E1E;
  --dev-track-green:   #00FF66;
  --dev-ice-blue:      #00C8FF;
  --dev-neon-orange:   #FF6B00;
  --dev-pure-white:    #FFFFFF;
  --dev-violet-purple: #B833FF;
  --dev-hot-cyan:      #00FFF0;

  /* ---------- Typography ---------- */
  --font-display: "Chakra Petch", "Noto Sans JP", system-ui, sans-serif;
  --font-body:    "Inter", "Noto Sans JP", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, "Noto Sans JP", monospace;

  --fs-2xs: 0.6875rem;                          /* 11 */
  --fs-xs:  0.75rem;                            /* 12 */
  --fs-sm:  0.875rem;                           /* 14 */
  --fs-base:1rem;                               /* 16 */
  --fs-md:  1.125rem;                           /* 18 */
  --fs-lg:  1.375rem;                           /* 22 */
  --fs-xl:  clamp(1.5rem, 1.2rem + 1vw, 1.75rem);   /* 24–28 */
  --fs-2xl: clamp(1.875rem, 1.4rem + 2vw, 2.75rem); /* 30–44 */
  --fs-3xl: clamp(2.25rem, 1.5rem + 3.4vw, 4rem);   /* 36–64 */
  --fs-hero:clamp(2.75rem, 1.6rem + 5.2vw, 5.5rem); /* 44–88 */

  --lh-tight: 1.05;
  --lh-snug:  1.25;
  --lh-body:  1.6;
  --tracking-display: 0.01em;
  --tracking-caps:    0.14em;   /* mono eyebrows, small caps labels */

  /* ---------- Spacing (4px grid) ---------- */
  --sp-1: 4px;   --sp-2: 8px;   --sp-3: 12px;  --sp-4: 16px;
  --sp-5: 20px;  --sp-6: 24px;  --sp-8: 32px;  --sp-10: 40px;
  --sp-12: 48px; --sp-16: 64px; --sp-20: 80px; --sp-24: 96px;
  --section-y: clamp(64px, 6vw + 32px, 128px);

  /* ---------- Layout ---------- */
  --container: 1200px;
  --container-wide: 1400px;
  --gutter: clamp(16px, 3vw, 32px);
  --header-h: 64px;

  /* ---------- Radii ---------- */
  --r-xs: 4px;  --r-sm: 6px;  --r-md: 8px;  --r-lg: 12px;  --r-xl: 16px;  --r-2xl: 24px;
  --r-pill: 999px;

  /* ---------- Elevation ---------- */
  --shadow-1: 0 1px 0 rgba(0, 0, 0, 0.25), 0 1px 3px rgba(0, 0, 0, 0.30);
  --shadow-2: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-3: 0 18px 56px rgba(0, 0, 0, 0.55);
  --ring:     0 0 0 2px var(--bg-0), 0 0 0 4px var(--brand);   /* focus-visible */

  /* ---------- Motion ---------- */
  --ease:     cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-1: 120ms;  --dur-2: 200ms;  --dur-3: 320ms;  --dur-4: 600ms;

  /* ---------- Engineering motifs ---------- */
  --grid-dot:  rgba(255, 255, 255, 0.075);
  --grid-size: 28px;
  --dot-grid: radial-gradient(circle at 1px 1px, var(--grid-dot) 1px, transparent 1.6px);
  --hazard: repeating-linear-gradient(-45deg, var(--brand) 0 8px, #16171A 8px 16px);

  /* ---------- Z-index ---------- */
  --z-header: 100;  --z-drawer: 200;  --z-modal: 300;  --z-toast: 400;
}

/* Japanese: Chakra Petch / Inter have no JP glyphs — lean on Noto Sans JP,
   slightly looser line-height, no wide tracking on headings. */
html[lang="ja"] {
  --font-display: "Chakra Petch", "Noto Sans JP", system-ui, sans-serif;
  --lh-body: 1.8;
  --lh-snug: 1.4;
  --tracking-display: 0;
}

@media (prefers-reduced-motion: reduce) {
  :root { --dur-1: 0ms; --dur-2: 0ms; --dur-3: 0ms; --dur-4: 0ms; }
}
