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

:root {
  /* Type scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.8125rem);
  --text-sm: clamp(0.875rem, 0.82rem + 0.3vw, 1rem);
  --text-base: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.6vw, 1.4rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem);
  --text-2xl: clamp(2.1rem, 1.4rem + 2.6vw, 3.5rem);
  --text-3xl: clamp(2.6rem, 1rem + 5vw, 5rem);
  --text-hero: clamp(3rem, 1rem + 6vw, 7rem);

  /* 4px 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; --space-40: 10rem;

  /* Structure tokens */
  --font-display: 'Switzer', 'Inter', system-ui, sans-serif;
  --font-body: 'Satoshi', 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --radius-sm: 0.375rem; --radius-md: 0.625rem; --radius-lg: 1rem;
  --radius-xl: 1.5rem; --radius-full: 9999px;
  --transition: 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

:root, [data-theme='light'] {
  --color-bg: #ffffff;
  --color-surface: #ffffff;
  --color-surface-2: #f7f7f7;
  --color-surface-offset: #f4f4f4;
  --color-divider: #ececec;
  --color-border: #e2e2e2;
  --color-text: #111111;
  --color-text-muted: #6b6b6b;
  --color-text-faint: #9a9a9a;
  --color-accent: #2f5cff;
  --color-accent-hover: #1f3fd6;
  --color-accent-soft: #eef2ff;
  --shadow-sm: 0 1px 2px oklch(0.2 0.01 250 / 0.06);
  --shadow-md: 0 4px 16px oklch(0.2 0.01 250 / 0.08);
  --shadow-lg: 0 12px 40px oklch(0.2 0.01 250 / 0.14);
}

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

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);
  -webkit-tap-highlight-color: transparent;
}

img, picture, video, svg, canvas { display: block; max-width: 100%; height: auto; }
ul, ol { list-style: none; }
input, button, textarea, select { font: inherit; color: inherit; }

h1, h2, h3, h4 { text-wrap: balance; line-height: 1.1; font-family: var(--font-display); letter-spacing: -0.01em; }
p, li, figcaption { text-wrap: pretty; }

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

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

button { cursor: pointer; background: none; border: none; }
a { color: inherit; text-decoration: none; transition: color var(--transition); }

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

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