/* Ace Timing design tokens — reference for the 2026-09 redesign (Timing01 site, Timing04 results, calendar).
   Source of truth for colours, type, spacing. Copy into each app's shared stylesheet; do not fork values.
   Fonts: self-host Kanit (Thai+Latin) and Rubik (digits) as woff2 under /fonts/ — Google Fonts is a fallback, never a dependency. */

:root {
  /* colour */
  --ink: #15151A;
  --ink-soft: #3B3E47;
  --muted: #5B6170;
  --line: #E6E7EB;
  --surface: #FFFFFF;
  --page: #F5F5F7;
  --dark: #0F1115;        /* hero, footer, nav */
  --dark-2: #1A1D24;
  --brand: #FFE600;       /* accent only: CTAs, active underline, highlights. Never white text on it. */
  --brand-ink: #15151A;   /* text on brand */
  --highlight: #FFF4BA;   /* RR hover row */
  --male: #1E40FF;
  --female: #C40069;      /* r1/#2: #E0007A was 4.48:1 on the #F9F9F9 zebra row (axe serious); 5.62:1 here */
  --success: #14804A;
  --danger: #C8102E;
  --link: #0B5CD6;

  /* RR-parity table tokens (results pages only) */
  --rr-th-bg: #F3F3F3;
  --rr-th-ink: #2C2C2C;
  --rr-td-line: #DDDDDD;
  --rr-group-line: #CCCCCC;
  --rr-tab: #01A3EE;
  --rr-row-h: 33px;

  /* type */
  --font-ui: 'Kanit', 'Noto Sans Thai', 'Segoe UI', system-ui, sans-serif;
  --font-num: 'Rubik', 'Kanit', system-ui, sans-serif;
  --fs-meta: 0.75rem;   /* 12 */
  --fs-table: 0.875rem; /* 14 */
  --fs-body: 1rem;      /* 16 */
  --fs-lead: 1.125rem;  /* 18 */
  --fs-h3: 1.5rem;      /* 24 */
  --fs-h2: 2rem;        /* 32 */
  --fs-h1: 2.75rem;     /* 44 desktop; 2rem mobile */
  --lh-body: 1.5;
  --lh-head: 1.2;

  /* spacing (4px base) */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-6: 24px; --s-8: 32px; --s-12: 48px; --s-16: 64px;

  /* layout */
  --content-max: 1150px;
  --table-max: 1127px;
  --radius: 8px;
  --radius-pill: 999px;
  --shadow-card: 0 1px 2px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.06);

  /* motion */
  --ease: 150ms ease-out;
}

@media (max-width: 600px) {
  :root { --fs-h1: 2rem; --fs-h2: 1.5rem; --fs-h3: 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  :root { --ease: 0ms; }
}

/* base */
html { font-family: var(--font-ui); color: var(--ink); background: var(--page); font-size: 16px; -webkit-text-size-adjust: 100%; }
body { margin: 0; line-height: var(--lh-body); }
h1, h2, h3 { line-height: var(--lh-head); margin: 0 0 var(--s-4); font-weight: 600; }
h1 { font-size: var(--fs-h1); } h2 { font-size: var(--fs-h2); } h3 { font-size: var(--fs-h3); }
.num, .time, .bib, .rank { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: var(--s-2); padding: 12px 22px; border-radius: var(--radius-pill); font-weight: 600; font-size: var(--fs-body); border: 2px solid transparent; cursor: pointer; transition: transform var(--ease), background var(--ease); text-decoration: none; }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { transform: translateY(-1px); }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.btn-ghost:hover { border-color: #fff; }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line); border-radius: 6px; padding: 8px 14px; font-size: var(--fs-table); }

/* chips */
.chip { display: inline-block; padding: 2px 10px; border-radius: var(--radius-pill); font-size: var(--fs-meta); font-weight: 600; background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.chip-brand { background: var(--brand); border-color: var(--brand); }
