/* base.css — design tokens (light and dark), reset, element defaults, accessibility helpers
   and small utility classes. Loaded first on every page; no inline styles anywhere (CSP). */

:root {
  --bg: #f7f7fb;
  --bg-alt: #eff0f8;
  --surface: #ffffff;
  --surface-2: #f4f4fa;
  --text: #14142b;
  --muted: #55556d;
  --line: #e2e2ee;
  --primary: #4f46e5;
  --primary-2: #7c3aed;
  --primary-soft: #eceafe;
  --primary-text: #fff;
  --link: #4338ca;
  --grad: linear-gradient(120deg, #4f46e5 0%, #7c3aed 55%, #c026d3 100%);
  --btn-grad: linear-gradient(120deg, #4f46e5 0%, #7c3aed 55%, #c026d3 100%);
  --err: #c62828;
  --ok: #15803d;
  --label: #ffd84d;
  --shadow-sm: 0 1px 2px rgba(20, 20, 43, .06), 0 2px 8px rgba(20, 20, 43, .04);
  --shadow: 0 2px 4px rgba(20, 20, 43, .04), 0 12px 32px rgba(20, 20, 43, .08);
  --shadow-lg: 0 24px 60px rgba(79, 70, 229, .18);
  --radius: 18px;
  --radius-sm: 12px;
  --focus: 0 0 0 3px var(--bg), 0 0 0 5px var(--primary);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0c14;
    --bg-alt: #11111c;
    --surface: #171724;
    --surface-2: #1e1e2e;
    --text: #ececf6;
    --muted: #a6a6bf;
    --line: #2a2a3d;
    --primary: #6d63ff;
    --primary-2: #9d5cf6;
    --primary-soft: #23214a;
    --link: #a5a0ff;
    --grad: linear-gradient(120deg, #7c74ff 0%, #a970ff 55%, #e070f0 100%);
    --err: #ff7a7a;
    --ok: #4ade80;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow: 0 2px 4px rgba(0, 0, 0, .2), 0 12px 32px rgba(0, 0, 0, .35);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-x: hidden;
}
img, svg { max-width: 100%; }
a { color: var(--link); }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: clamp(34px, 5.6vw, 60px); font-weight: 800; }
h2 { font-size: clamp(26px, 3.6vw, 40px); font-weight: 800; }
h3 { font-size: 18px; font-weight: 700; }
p { margin: 0; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 8px; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.container.narrow { max-width: 820px; }
.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; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--primary); color: #fff; padding: 10px 14px; border-radius: 10px; font-weight: 700; text-decoration: none; }
.skip:focus { top: 12px; }

/* ---- Utilities ---- */
/* The hidden attribute must win over display: grid/flex set by component rules */
[hidden] { display: none !important; }
/* Small variants instead of style= attributes (the CSP forbids inline styles) */
.m0 { margin: 0; }
.right { text-align: right; }
.mb6 { margin: 0 0 6px; }
