/**
 * newcomerkit.ca Design Tokens
 * Theme: Crisp Canadian Red & White
 * Standards: WCAG 2.1 AA Compliant (All text contrast >= 4.5:1)
 */

:root {
  /* Brand Palette */
  --color-red-50: #fff1f2;
  --color-red-100: #ffe4e6;
  --color-red-200: #fecdd3;
  --color-red-500: #f83b3d;
  --color-red-600: #e51d1f; /* Canadian Maple Red - locked in intent.md */
  --color-red-700: #c41416;
  --color-red-800: #9e0e10;
  
  --color-brand: var(--color-red-600);
  --color-brand-hover: var(--color-red-700);
  --color-brand-active: var(--color-red-800);
  --color-brand-subtle: var(--color-red-50);
  --color-brand-border: var(--color-red-200);

  /* Neutrals (High Contrast) */
  --color-white: #ffffff;
  --color-gray-50: #f8fafc;
  --color-gray-100: #f1f5f9;
  --color-gray-200: #e2e8f0;
  --color-gray-300: #cbd5e1;
  --color-gray-400: #94a3b8;
  --color-gray-500: #64748b;
  --color-gray-600: #475569;
  --color-gray-700: #334155;
  --color-gray-800: #1e293b;
  --color-gray-900: #0f172a;

  /* Semantic UI Colors */
  --color-bg: var(--color-white);
  --color-bg-subtle: var(--color-gray-50);
  --color-bg-card: var(--color-white);
  --color-text-main: var(--color-gray-900);      /* 14.5:1 ratio on white */
  --color-text-muted: var(--color-gray-600);     /* 5.8:1 ratio on white */
  --color-border: var(--color-gray-200);
  --color-border-strong: var(--color-gray-300);

  /* Status Accents */
  --color-success: #15803d;
  --color-success-bg: #f0fdf4;
  --color-success-border: #bbf7d0;
  --color-warning: #b45309;
  --color-warning-bg: #fffbeb;
  --color-warning-border: #fef08a;

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.8125rem);
  --text-sm: clamp(0.875rem, 0.825rem + 0.25vw, 0.9375rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.0625rem);
  --text-lg: clamp(1.125rem, 1.05rem + 0.35vw, 1.25rem);
  --text-xl: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
  --text-2xl: clamp(1.5rem, 1.35rem + 0.75vw, 1.875rem);
  --text-3xl: clamp(1.875rem, 1.65rem + 1vw, 2.35rem);
  --text-4xl: clamp(2.25rem, 1.95rem + 1.5vw, 3rem);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;

  /* Layout & Elevations */
  --max-width: 1160px;
  --max-width-narrow: 840px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 9999px;

  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);

  /* Accessible Focus Ring */
  --focus-ring: 0 0 0 3px rgba(229, 29, 31, 0.35);
  --focus-ring-offset: 2px;
}

/* Base Accessibility Reset */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-family: var(--font-sans);
  color: var(--color-text-main);
  background-color: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

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

a {
  color: var(--color-brand);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--color-brand-hover);
}

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: var(--focus-ring-offset);
  box-shadow: var(--focus-ring);
}

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

/* Skip Link for Keyboard Navigation */
.skip-to-content {
  position: absolute;
  top: var(--space-3);
  left: var(--space-4);
  background: var(--color-brand);
  color: var(--color-white);
  padding: var(--space-2) var(--space-4);
  font-weight: 600;
  border-radius: var(--radius-sm);
  z-index: 1000;
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform 0.2s ease;
}

.skip-to-content:focus {
  transform: translateY(0);
}
