/* ==========================================================================
   TCP123 UK — Core Design System Tokens & Base Styles
   Spelling Standard: Strict British English
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@500;600;700;800&display=swap');

:root {
  /* Primary & Brand Palette — RNIB AAA Compliant */
  --color-primary: #090d16;
  --color-primary-light: #151e32;
  --color-brand-blue: #0044b3;
  --color-brand-blue-hover: #003380;
  --color-accent-cyan: #0284c7;
  --color-accent-glow: rgba(0, 68, 179, 0.15);

  /* Neutral Shades (RNIB AAA Contrast) */
  --color-text-main: #0f172a;
  --color-text-muted: #334155;
  --color-bg-light: #f8fafc;
  --color-bg-surface: #ffffff;
  --color-border: #cbd5e1;
  --color-border-hover: #94a3b8;

  /* Status Colours */
  --color-success: #059669;
  --color-success-bg: #d1fae5;
  --color-emergency: #dc2626;
  --color-emergency-bg: #fee2e2;

  /* Typography Tokens */
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Spacing Tokens */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2.5rem;
  --spacing-xl: 4rem;
  --container-max-width: 1240px;

  /* Elevation Shadows & Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 12px 32px rgba(9, 13, 22, 0.18);
  --shadow-glow: 0 0 25px rgba(0, 68, 179, 0.3);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
  /* Low Glare Dark Mode — RNIB AAA Contrast */
  --color-primary: #ffffff;
  --color-primary-light: #151e32;
  --color-brand-blue: #0256d0;
  --color-brand-blue-hover: #1d4ed8;
  --color-accent-cyan: #38bdf8;
  --color-text-main: #ffffff;
  --color-text-muted: #cbd5e1;
  --color-bg-light: #090d16;
  --color-bg-surface: #151e32;
  --color-border: #334155;
  --color-border-hover: #475569;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.7);
}


/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--color-text-main);
  background-color: var(--color-bg-light);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Typography Base */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--color-primary);
  font-weight: 700;
  line-height: 1.25;
}

h1 { font-size: clamp(2.25rem, 4vw + 1rem, 3.5rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.75rem, 3vw + 0.5rem, 2.5rem); letter-spacing: -0.01em; }
h3 { font-size: clamp(1.25rem, 2vw + 0.25rem, 1.5rem); }
h4 { font-size: 1.125rem; }

p {
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--color-brand-blue);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Container Utility */
.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--spacing-sm);
  padding-right: var(--spacing-sm);
}

@media (min-width: 768px) {
  .container {
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
  }
}
