/* ============================================================
   BASE.CSS — Reset, design tokens, and foundational styles
   Moss EHS Consulting
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; }
img, picture, svg, video { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p { margin: 0; }

:root, [data-theme="light"] {
  /* Brand core — sampled from the Moss EHS Consulting logo */
  --brand-navy: #18315c;
  --brand-navy-deep: #0e1e3a;
  --brand-red: #d11623;
  --brand-red-hover: #ad1119;

  /* Surfaces */
  --color-bg: #f9f8f5;
  --color-surface: #ffffff;
  --color-surface-2: #f2f1ec;
  --color-surface-offset: #edece5;
  --color-border: #dedad0;
  --color-divider: #e6e3d9;

  /* Text */
  --color-text: #1c2230;
  --color-text-muted: #565f6f;
  --color-text-faint: #8b93a0;
  --color-text-inverse: #f7f7f5;

  /* Accent roles */
  --color-primary: var(--brand-navy);
  --color-primary-hover: var(--brand-navy-deep);
  --color-primary-highlight: #dce3ee;
  --color-accent: var(--brand-red);
  --color-accent-hover: var(--brand-red-hover);
  --color-accent-highlight: #f6d9da;
  --color-success: #2f6b3a;
  --color-success-highlight: #dbe9dc;

  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px rgba(14, 30, 58, 0.06);
  --shadow-md: 0 6px 20px rgba(14, 30, 58, 0.08);
  --shadow-lg: 0 20px 48px rgba(14, 30, 58, 0.14);

  --transition-interactive: 200ms cubic-bezier(0.16, 1, 0.3, 1);

  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1240px;

  --font-display: 'Cabinet Grotesk', 'General Sans', 'Segoe UI', sans-serif;
  --font-body: 'Satoshi', 'General Sans', 'Segoe UI', sans-serif;
}

[data-theme="dark"] {
  --color-bg: #10141d;
  --color-surface: #161b26;
  --color-surface-2: #1c2230;
  --color-surface-offset: #202737;
  --color-border: #2b3346;
  --color-divider: #242c3d;

  --color-text: #e9ebf0;
  --color-text-muted: #a4acbc;
  --color-text-faint: #6c7488;
  --color-text-inverse: #10141d;

  --color-primary: #6f8dc4;
  --color-primary-hover: #90a9d4;
  --color-primary-highlight: #263251;
  --color-accent: #ef5a63;
  --color-accent-hover: #f37a81;
  --color-accent-highlight: #3a2029;
  --color-success: #6bbf7a;
  --color-success-highlight: #1e3324;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.5);
}

/* Fluid type scale */
:root {
  --text-xs: clamp(0.75rem, 0.72rem + 0.15vw, 0.8125rem);
  --text-sm: clamp(0.875rem, 0.84rem + 0.2vw, 0.9375rem);
  --text-base: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  --text-lg: clamp(1.125rem, 1.05rem + 0.4vw, 1.375rem);
  --text-xl: clamp(1.5rem, 1.3rem + 1vw, 2rem);
  --text-2xl: clamp(1.875rem, 1.5rem + 1.8vw, 2.75rem);
  --text-3xl: clamp(2.25rem, 1.5rem + 3.2vw, 3.75rem);
  --text-hero: clamp(2.75rem, 1.6rem + 4.6vw, 5rem);

  --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;
  --space-24: 6rem;
  --space-32: 8rem;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition-interactive), color var(--transition-interactive);
}

.container {
  width: 100%;
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: clamp(var(--space-4), 4vw, var(--space-10));
}

.container--narrow { max-width: var(--content-narrow); }
.container--default { max-width: var(--content-default); }

section { padding-block: clamp(var(--space-16), 8vw, var(--space-32)); }

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand-navy);
  color: #fff;
  padding: var(--space-3) var(--space-5);
  z-index: 200;
  border-radius: 0 0 var(--radius-md) 0;
}
.skip-link:focus { left: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
