/* ============ HPC Mechanical — Design Tokens & Base ============ */

:root, [data-theme="light"] {
  /* Type scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 5rem);
  --text-hero: clamp(3rem, 0.5rem + 7vw, 7rem);

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

  /* === Light mode: neutral surfaces + brand kelly green accent === */
  --color-bg: #fafafa;
  --color-surface: #ffffff;
  --color-surface-2: #ffffff;
  --color-surface-offset: #f1f1ef;
  --color-surface-offset-2: #e6e6e3;
  --color-divider: #e2e2df;
  --color-border: #cfcfcb;

  --color-text: #131516;
  --color-text-muted: #565a5d;
  --color-text-faint: #8a8f93;
  --color-text-inverse: #fafafa;

  /* Primary: brand kelly green from logo */
  --color-primary: #1f9f2b;
  --color-primary-hover: #178021;
  --color-primary-active: #0f661a;
  --color-primary-highlight: #d6f0d9;
  --color-primary-dark: #0e3f15; /* deep green for dark CTA bands */

  /* Secondary: deep neutral for dark sections */
  --color-accent: #1a1c1d;
  --color-accent-hover: #2a2d2f;

  /* Status */
  --color-warning: #b96f1a;
  --color-success: #1f9f2b;
  --color-error: #c63b3b;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

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

  /* Shadows — tone-matched to cool green-gray */
  --shadow-sm: 0 1px 2px oklch(0.25 0.02 150 / 0.06);
  --shadow-md: 0 4px 14px oklch(0.25 0.02 150 / 0.08);
  --shadow-lg: 0 12px 36px oklch(0.25 0.02 150 / 0.12);

  /* Content widths */
  --content-narrow: 720px;
  --content-default: 1080px;
  --content-wide: 1280px;

  /* Fonts */
  --font-display: 'Cabinet Grotesk', 'Helvetica Neue', sans-serif;
  --font-body: 'Satoshi', 'Inter', system-ui, sans-serif;
}

[data-theme="dark"] {
  --color-bg: #0f1110;
  --color-surface: #15171a;
  --color-surface-2: #1a1d20;
  --color-surface-offset: #1d2024;
  --color-surface-offset-2: #23272b;
  --color-divider: #2a2e33;
  --color-border: #3a3f45;

  --color-text: #e6e6e3;
  --color-text-muted: #a0a4a8;
  --color-text-faint: #6a6e72;
  --color-text-inverse: #131516;

  --color-primary: #36c346;
  --color-primary-hover: #4cd45c;
  --color-primary-active: #66e275;
  --color-primary-highlight: #143620;
  --color-primary-dark: #0a2a10;

  --color-accent: #c9cbcd;
  --color-accent-hover: #e6e7e8;

  --color-warning: #d99654;
  --color-success: #36c346;
  --color-error: #e26666;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.25);
  --shadow-md: 0 4px 14px oklch(0 0 0 / 0.35);
  --shadow-lg: 0 12px 36px oklch(0 0 0 / 0.5);
}

/* ============ Base reset ============ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  min-height: 100dvh;
  line-height: 1.6;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

ul[role="list"], ol[role="list"] {
  list-style: none;
}

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  text-wrap: balance;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

p, li {
  text-wrap: pretty;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

::selection {
  background: oklch(from var(--color-primary) l c h / 0.25);
  color: var(--color-text);
}

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

button {
  cursor: pointer;
  background: none;
  border: none;
  color: inherit;
}

a, button, input, textarea, select {
  transition:
    color var(--transition-interactive),
    background var(--transition-interactive),
    border-color var(--transition-interactive),
    box-shadow var(--transition-interactive),
    transform var(--transition-interactive);
}

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

.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;
}
