/* Design tokens */
:root, [data-theme="light"] {
  --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);

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

  /* DX Today palette — editorial dark with electric cyan accent */
  --color-bg: #f7f7f5;
  --color-surface: #ffffff;
  --color-surface-2: #fafaf8;
  --color-surface-offset: #f1f0ec;
  --color-border: #e3e1da;
  --color-divider: #ececea;

  --color-text: #14150f;
  --color-text-muted: #5d5d57;
  --color-text-faint: #a3a39d;
  --color-text-inverse: #fafaf8;

  --color-primary: #0c8a7a;        /* deep cyan-teal */
  --color-primary-hover: #086b5f;
  --color-primary-active: #054f47;
  --color-primary-highlight: #d4ebe6;

  --color-accent: #1e3a8a;          /* DX Navy — deep navy blue */
  --color-accent-deep: #0f1e4d;
  --color-warning: #1e3a8a;
  --color-warning-bg: #eef2fb;
  --color-error: #b91c4c;
  --color-success: #2e7d32;

  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;

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

  --shadow-sm: 0 1px 2px rgba(20, 21, 15, 0.05);
  --shadow-md: 0 6px 18px rgba(20, 21, 15, 0.07);
  --shadow-lg: 0 18px 40px rgba(20, 21, 15, 0.10);

  --content-default: 1180px;
  --content-narrow: 760px;

  --font-display: 'Clash Display', 'Satoshi', system-ui, sans-serif;
  --font-body: 'Satoshi', system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

[data-theme="dark"] {
  --color-bg: #0c0d0a;
  --color-surface: #131410;
  --color-surface-2: #1a1b16;
  --color-surface-offset: #20211b;
  --color-border: #2c2d26;
  --color-divider: #1f201a;

  --color-text: #ececea;
  --color-text-muted: #8f8f88;
  --color-text-faint: #5a5a54;
  --color-text-inverse: #14150f;

  --color-primary: #2dd4bf;
  --color-primary-hover: #5ee2d2;
  --color-primary-active: #14b8a6;
  --color-primary-highlight: #1d3a36;

  --color-accent: #6184f0;          /* DX Navy — lifted for dark mode contrast */
  --color-accent-deep: #3b5fd9;
  --color-warning: #6184f0;
  --color-warning-bg: #14182a;
  --color-error: #f87171;
  --color-success: #4ade80;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 6px 18px rgba(0,0,0,0.5);
  --shadow-lg: 0 18px 40px rgba(0,0,0,0.6);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #0c0d0a;
    --color-surface: #131410;
    --color-surface-2: #1a1b16;
    --color-surface-offset: #20211b;
    --color-border: #2c2d26;
    --color-divider: #1f201a;
    --color-text: #ececea;
    --color-text-muted: #8f8f88;
    --color-text-faint: #5a5a54;
    --color-text-inverse: #14150f;
    --color-primary: #2dd4bf;
    --color-primary-hover: #5ee2d2;
    --color-primary-active: #14b8a6;
    --color-primary-highlight: #1d3a36;
  }
}

/* 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: 100px;
}
body {
  min-height: 100dvh;
  line-height: 1.6;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-bg);
}
img, picture, svg { display: block; max-width: 100%; height: auto; }
button { cursor: pointer; background: none; border: none; color: inherit; font: inherit; }
a { color: var(--color-primary); text-decoration: none; transition: color var(--transition-interactive); }
a:hover { color: var(--color-primary-hover); }
h1, h2, h3, h4 { font-family: var(--font-display); text-wrap: balance; line-height: 1.15; letter-spacing: -0.005em; word-spacing: 0.06em; }
p { text-wrap: pretty; }
:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 3px; border-radius: var(--radius-sm); }
.sr-only { position: absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip: rect(0,0,0,0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
