/* ============================================================
   IMPACT ATHLETICS FOUNDATION — Design tokens & base reset
   Palette inspired by the brand logo: navy + athletic green
   on warm cream surfaces.
   ============================================================ */

:root,
[data-theme='light'] {
  /* Surfaces — warm cream */
  --color-bg: #faf7f2;
  --color-surface: #ffffff;
  --color-surface-2: #f4efe7;
  --color-surface-offset: #ece5d8;
  --color-divider: #e0d7c5;
  --color-border: #d6cbb5;

  /* Text */
  --color-text: #1a1f2e;
  --color-text-muted: #5a6273;
  --color-text-faint: #98a0b0;
  --color-text-inverse: #faf7f2;

  /* Primary — Athletic navy (from logo) */
  --color-primary: #1b3a6b;
  --color-primary-hover: #142b50;
  --color-primary-active: #0e1f3a;
  --color-primary-highlight: #d8e0ec;

  /* Accent — Forest/athletic green (from logo) */
  --color-accent: #2e7d4f;
  --color-accent-hover: #246339;
  --color-accent-active: #194a2a;
  --color-accent-highlight: #d4e7da;

  /* Warm — energetic accent (used sparingly for problem/CTA emphasis) */
  --color-warm: #d96a2c;
  --color-warm-hover: #b35420;
  --color-warm-highlight: #fbe5d4;

  /* Ice blue — cool secondary surface */
  --color-ice: #e8f0f7;
  --color-ice-2: #d6e5f3;
  --color-ice-text: #2a4a6e;

  /* Deep dark surface (for closing banner + footer) */
  --color-deep: #0e1f3a;
  --color-deep-2: #142b50;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-pill: 9999px;

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

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(20, 25, 40, 0.06);
  --shadow-md: 0 8px 24px rgba(20, 25, 40, 0.08);
  --shadow-lg: 0 24px 60px rgba(20, 25, 40, 0.12);

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

  /* Type scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.8125rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.25vw, 0.9375rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.0625rem);
  --text-lg: clamp(1.125rem, 1rem + 0.5vw, 1.3125rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  --text-2xl: clamp(2rem, 1.4rem + 2.2vw, 3rem);
  --text-3xl: clamp(2.5rem, 1.4rem + 3.8vw, 4.5rem);

  /* Spacing — 4px scale */
  --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;

  /* Fonts */
  --font-body: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  --font-serif: 'Fraunces', Georgia, 'Times New Roman', serif;
}

/* DARK MODE */
[data-theme='dark'] {
  --color-bg: #0c1426;
  --color-surface: #131c33;
  --color-surface-2: #18223d;
  --color-surface-offset: #1d294a;
  --color-divider: #243358;
  --color-border: #2e3f6b;

  --color-text: #e7ebf3;
  --color-text-muted: #9aa3b8;
  --color-text-faint: #6a7390;
  --color-text-inverse: #0c1426;

  --color-primary: #6b95d4;
  --color-primary-hover: #84a8df;
  --color-primary-active: #a1bce8;
  --color-primary-highlight: #1e2c4f;

  --color-accent: #5cb37e;
  --color-accent-hover: #72c293;
  --color-accent-active: #8cd0a9;
  --color-accent-highlight: #1d3a2a;

  --color-deep: #060d1c;
  --color-deep-2: #0c1426;

  --color-warm: #e8895a;
  --color-warm-hover: #ed9d77;
  --color-warm-highlight: #3a2418;

  --color-ice: #1a2540;
  --color-ice-2: #243152;
  --color-ice-text: #a8c0dc;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #0c1426;
    --color-surface: #131c33;
    --color-surface-2: #18223d;
    --color-surface-offset: #1d294a;
    --color-divider: #243358;
    --color-border: #2e3f6b;
    --color-text: #e7ebf3;
    --color-text-muted: #9aa3b8;
    --color-text-faint: #6a7390;
    --color-text-inverse: #0c1426;
    --color-primary: #6b95d4;
    --color-primary-hover: #84a8df;
    --color-primary-active: #a1bce8;
    --color-primary-highlight: #1e2c4f;
    --color-accent: #5cb37e;
    --color-accent-hover: #72c293;
    --color-accent-active: #8cd0a9;
    --color-accent-highlight: #1d3a2a;
    --color-deep: #060d1c;
    --color-deep-2: #0c1426;
    --color-warm: #e8895a;
    --color-warm-hover: #ed9d77;
    --color-warm-highlight: #3a2418;
    --color-ice: #1a2540;
    --color-ice-2: #243152;
    --color-ice-text: #a8c0dc;
  }
}

/* ---- 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: 96px;
}

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'] {
  list-style: none;
}

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

h1,
h2,
h3,
h4 {
  text-wrap: balance;
  line-height: 1.12;
  letter-spacing: -0.018em;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--color-text);
}

p {
  text-wrap: pretty;
  max-width: 65ch;
}

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

::selection {
  background: var(--color-accent-highlight);
  color: var(--color-text);
}

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

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

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

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

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

/* ---- Layout helpers ---- */
.container {
  width: 100%;
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

.section {
  padding-block: clamp(var(--space-16), 9vw, var(--space-24));
}
