/* ============ Tokens ============ */
:root {
  --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);

  --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-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-full: 9999px;

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

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

  --font-display: 'Cabinet Grotesk', 'Helvetica Neue', sans-serif;
  --font-body: 'Satoshi', 'Helvetica Neue', sans-serif;
}

/* ---- Light: Gulf Coast concrete + safety amber ---- */
:root,
[data-theme='light'] {
  --color-bg: #f2f1ee;
  --color-surface: #f9f8f6;
  --color-surface-2: #fdfdfc;
  --color-surface-offset: #e8e6e2;
  --color-surface-offset-2: #dcd9d4;
  --color-divider: #d7d4cf;
  --color-border: #c9c5bf;

  --color-text: #15181b;
  --color-text-muted: #63676c;
  --color-text-faint: #9ea2a7;
  --color-text-inverse: #f7f7f5;

  --color-primary: #a94d08;
  --color-primary-hover: #8a3f06;
  --color-primary-active: #6d3205;
  --color-primary-soft: #efe3d7;

  --color-ink: #101316;
  --color-ink-2: #191d21;
  --color-ink-border: #2c3237;
  --color-ink-text: #e4e6e8;
  --color-ink-muted: #969ba0;
  --color-ink-accent: #f0a04b;

  --shadow-sm: 0 1px 2px rgb(21 24 27 / 0.07);
  --shadow-md: 0 4px 14px rgb(21 24 27 / 0.09);
  --shadow-lg: 0 16px 40px rgb(21 24 27 / 0.14);
}

/* ---- Dark ---- */
[data-theme='dark'] {
  --color-bg: #101316;
  --color-surface: #15191c;
  --color-surface-2: #1a1f23;
  --color-surface-offset: #191d21;
  --color-surface-offset-2: #21262b;
  --color-divider: #22272b;
  --color-border: #333a40;

  --color-text: #d7dadc;
  --color-text-muted: #8b9095;
  --color-text-faint: #5f6469;
  --color-text-inverse: #101316;

  --color-primary: #f0a04b;
  --color-primary-hover: #f7b46c;
  --color-primary-active: #fac789;
  --color-primary-soft: #2c2418;

  --color-ink: #0b0e10;
  --color-ink-2: #14181b;
  --color-ink-border: #2a3035;
  --color-ink-text: #d7dadc;
  --color-ink-muted: #8b9095;
  --color-ink-accent: #f0a04b;

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

/* ============ 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,
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;
}

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

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

::selection {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}

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

a,
button,
input,
textarea,
select,
[role='button'] {
  transition:
    color var(--transition-interactive),
    background var(--transition-interactive),
    border-color var(--transition-interactive),
    box-shadow var(--transition-interactive),
    transform 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-width: 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;
  }
}
