/* ============ TOKENS ============ */
:root {
  /* 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(1.875rem, 1.2rem + 2vw, 3rem);
  --text-3xl: clamp(2.25rem, 1.1rem + 3.2vw, 4.25rem);

  /* 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;

  /* Radius / motion / shadow */
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.625rem;
  --radius-full: 9999px;
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Content widths */
  --content-narrow: 660px;
  --content-default: 980px;
  --content-wide: 1240px;

  /* Fonts */
  --font-display: 'Clash Display', 'Impact', sans-serif;
  --font-body: 'Satoshi', 'Helvetica Neue', sans-serif;
}

/* ============ LIGHT (default) ============ */
:root,
[data-theme='light'] {
  --color-bg: #f4f4f3;
  --color-surface: #ffffff;
  --color-surface-2: #fafafa;
  --color-surface-offset: #eae9e6;
  --color-surface-offset-2: #e0dfdb;
  --color-divider: #dcdbd7;
  --color-border: #cbcac5;

  --color-text: #14171a;
  --color-text-muted: #5a6067;
  --color-text-faint: #90959b;
  --color-text-inverse: #f7f7f6;

  --color-primary: #b7132c;
  --color-primary-hover: #950f24;
  --color-primary-active: #720b1b;
  --color-primary-highlight: #f4dcdf;

  --color-steel: #1b2429;
  --color-steel-2: #2a363d;

  --color-success: #2f6f2c;
  --color-success-highlight: #dbe7d9;

  --shadow-sm: 0 1px 2px rgb(20 23 26 / 0.07);
  --shadow-md: 0 4px 14px rgb(20 23 26 / 0.09);
  --shadow-lg: 0 16px 40px rgb(20 23 26 / 0.14);

  --color-primary-bright: #ef4a5e;
  --hero-scrim: linear-gradient(
      96deg,
      rgb(9 11 13 / 0.9) 0%,
      rgb(9 11 13 / 0.7) 40%,
      rgb(9 11 13 / 0.28) 72%,
      rgb(9 11 13 / 0.08) 100%
    ),
    linear-gradient(to top, rgb(9 11 13 / 0.55) 0%, rgb(9 11 13 / 0) 55%);
}

/* ============ DARK ============ */
[data-theme='dark'] {
  --color-bg: #0f1214;
  --color-surface: #171b1e;
  --color-surface-2: #1c2124;
  --color-surface-offset: #1a1f22;
  --color-surface-offset-2: #22282c;
  --color-divider: #23292d;
  --color-border: #363d42;

  --color-text: #dfe3e5;
  --color-text-muted: #929aa1;
  --color-text-faint: #676e74;
  --color-text-inverse: #14171a;

  --color-primary: #f0455f;
  --color-primary-hover: #ff6377;
  --color-primary-active: #ff8391;
  --color-primary-highlight: #3a2126;

  --color-steel: #0a0d0f;
  --color-steel-2: #171b1e;
  --color-primary-bright: #ff6377;

  --color-success: #6faa5e;
  --color-success-highlight: #23301f;

  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.35);
  --shadow-md: 0 4px 14px rgb(0 0 0 / 0.45);
  --shadow-lg: 0 16px 40px rgb(0 0 0 / 0.55);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #0f1214;
    --color-surface: #171b1e;
    --color-surface-2: #1c2124;
    --color-surface-offset: #1a1f22;
    --color-surface-offset-2: #22282c;
    --color-divider: #23292d;
    --color-border: #363d42;
    --color-text: #dfe3e5;
    --color-text-muted: #929aa1;
    --color-text-faint: #676e74;
    --color-text-inverse: #14171a;
    --color-primary: #f0455f;
    --color-primary-hover: #ff6377;
    --color-primary-highlight: #3a2126;
    --color-steel: #0a0d0f;
    --color-steel-2: #171b1e;
  }
}

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

html {
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: var(--space-20);
}

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 {
  text-wrap: balance;
  line-height: 1.1;
}
p,
li,
figcaption {
  text-wrap: pretty;
  max-width: 68ch;
}

a {
  color: inherit;
}

::selection {
  background: var(--color-primary-highlight);
  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;
}

table {
  border-collapse: collapse;
  width: 100%;
}

a,
button,
[role='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;
    animation-iteration-count: 1 !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;
}
