/* itrain.ing design tokens: bridge onto the jameslcowan system (/platform.css) */
/* Every legacy semantic var re-points at a --theme-* slot from /platform.css, so the
   site follows system light/dark plus the html[data-theme] override automatically:
   this file defines NO theme blocks of its own. Brand identity is the hi-vis
   chartreuse ramp below, used for marks and secondary buttons with black text only,
   never for body text on white. Fonts are the jameslcowan SF system stacks. */

:root {
  /* Brand accent ramp (hi-vis #ccff00 at the 500 slot) overriding the platform scale */
  --accent-50: #faffe0;
  --accent-100: #f4ffc2;
  --accent-200: #eaff8a;
  --accent-300: #dfff52;
  --accent-400: #d5ff29;
  --accent-500: #ccff00;
  --accent-600: #a3d900;
  --accent-700: #7da800;
  --accent-800: #587800;
  --accent-900: #364a00;
  --accent-950: #1f2b00;

  /* Brand-derived theme slots the platform hard-codes to the jameslcowan blue */
  --theme-focus-ring: color-mix(in srgb, var(--accent-500) 38%, transparent);
  --light-border-accent: var(--accent-600);
  --dark-border-accent: var(--accent-500);

  /* Hi-vis mark (sparingly, not for surfaces; see brand-typography.css) */
  --brand-hi: var(--accent-500);
  --brand-hi-dim: var(--accent-600);
  --pl-plate: var(--brand-hi);
  --pl-plate-dim: var(--brand-hi-dim);

  /* Legacy surface names -> jameslcowan palette */
  --pl-chalk: var(--light-bg);
  --pl-iron: var(--dark-bg);
  --pl-steel: var(--dark-bg-subtle);
  --pl-rack: var(--dark-bg-elevated);
  --pl-rack-up: var(--dark-bg-raised);

  /* Semantic bridge -> --theme-* (theme switching handled by /platform.css) */
  --bg: var(--theme-bg);
  --bg-elevated: var(--theme-bg-elevated);
  --panel: var(--theme-bg-elevated);
  --panel2: var(--theme-bg-subtle);
  --text: var(--theme-color);
  --text-strong: var(--theme-color);
  --muted: var(--theme-color-dim);
  --border: var(--theme-border);
  --border2: var(--theme-border-strong);
  --ghost-border: var(--theme-border-strong);

  /* Shared CSS hooks stay neutral so pages are not washed in neon */
  --accent: var(--muted);
  --accent-muted: color-mix(in srgb, var(--text) 5%, transparent);
  --cta-bg: var(--theme-color);
  --cta-bg-hover: color-mix(in srgb, var(--theme-color) 86%, var(--theme-bg));
  --cta-fg: var(--theme-bg);
  --btn-secondary-bg: var(--pl-plate);
  --btn-secondary-bg-hover: var(--pl-plate-dim);
  --btn-secondary-fg: #000000;
  --btn-secondary-border: var(--pl-plate-dim);
  --danger: #dc2626;
  --success: #16a34a;
  --focus-ring: var(--theme-focus-ring);

  --shadow: 0 4px 24px var(--theme-shadow-md);
  --shadow-lg: 0 12px 40px var(--theme-shadow-lg);

  --sb-track: var(--theme-bg);
  --sb-thumb: var(--theme-bg-soft);
  --sb-thumb-hover: var(--theme-bg-strong);

  /* jameslcowan fonts (SF system stacks from /platform.css); zero webfonts.
     --font-display comes straight from the platform; the old fallback slots
     resolve to the same stacks so the fonts-loaded gate is moot. */
  --font-display: "Outfit", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", system-ui, sans-serif; /* brand display face (headings), body stays SF */
  --sans: var(--font-body);
  --mono: var(--font-mono);
  --font-wordmark: "IBM Plex Mono", var(--font-mono); /* wordmark identity face (logo only) */
  --font-display-fallback: var(--font-display);
  --font-sans-fallback: var(--font-body);

  --topbar-h: 52px;
  --weekbar-h: auto;
}

/* Forced theme keeps native UI (form controls, scrollbars) in step */
html[data-theme="light"] { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }

/* Mobile touch hygiene. Keep pinch zoom, drop the browser double-tap-to-zoom
   gesture and its 300ms click delay, and remove the grey/blue tap-highlight flash.
   A 16px input floor on mobile stops iOS Safari zooming the page on field focus. */
html {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
a, button, input, textarea, select, label, summary,
[role="button"], [tabindex] {
  -webkit-tap-highlight-color: transparent;
}
@media (max-width: 800px) {
  input, textarea, select { font-size: max(16px, 1em); }
}
