/* Design tokens, element reset, typography, buttons and small helpers.
 * Loaded first, before layout.css and prose.css. */

/* ── Tokens ─────────────────────────────────────────────────────────────── */

:root {
  /* Brand: the violet → magenta of the logo */
  --brand-50: #f6f2ff;
  --brand-100: #ede5ff;
  --brand-200: #dccdfe;
  --brand-500: #8b4cf6;
  --brand-600: #7a2ff0;
  --brand-700: #6421d4;
  --brand-800: #4e1aa6;
  --brand-900: #2c0d63;
  --accent: #d63ae0;
  --gradient: linear-gradient(120deg, #6421d4 0%, #a52fe4 55%, #e040d8 100%);

  /* Neutrals */
  --ink: #0d1124;
  --text: #39405a;
  --muted: #6b7290;
  --line: #e6e7ef;
  --line-strong: #d3d5e2;
  --surface: #ffffff;
  --surface-soft: #f7f7fb;
  --surface-tint: #faf8ff;

  /* Platform colors, for badges */
  --postgresql: #336791;
  --mysql: #c2410c;
  --mariadb: #7a2ff0;
  --sql-server: #0e7490;
  --mongodb: #15803d;

  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(13, 17, 36, 0.06);
  --shadow: 0 1px 2px rgba(13, 17, 36, 0.05), 0 8px 24px -12px rgba(13, 17, 36, 0.18);
  --shadow-lg: 0 2px 4px rgba(13, 17, 36, 0.04), 0 24px 48px -20px rgba(44, 13, 99, 0.35);

  --container: 1200px;
  --gutter: clamp(20px, 4vw, 40px);
  --header-height: 68px;
}

/* ── Reset ──────────────────────────────────────────────────────────────── */

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-height) + 16px);
}
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img,
svg,
iframe {
  display: block;
  max-width: 100%;
}
img {
  height: auto;
}
figure {
  margin: 0;
}
a {
  color: var(--brand-700);
  text-decoration: none;
}
a:hover {
  color: var(--brand-800);
}
:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 3px;
  border-radius: 4px;
}
::selection {
  background: var(--brand-200);
  color: var(--ink);
}

/* ── Typography ─────────────────────────────────────────────────────────── */

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--ink);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
h1 {
  font-size: clamp(2.1rem, 1.4rem + 2.6vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
}
h2 {
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
}
h3 {
  font-size: 1.2rem;
}
p {
  margin: 0;
  text-wrap: pretty;
}
code,
kbd {
  font-family: var(--font-mono);
  font-size: 0.875em;
}
strong {
  font-weight: 650;
  color: var(--ink);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-700);
}
.lead {
  font-size: clamp(1.05rem, 1rem + 0.3vw, 1.2rem);
  line-height: 1.6;
  color: var(--muted);
}
.text-gradient {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ── Buttons ────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn-primary {
  color: #fff;
  background: var(--brand-700);
  box-shadow: 0 6px 18px -8px rgba(100, 33, 212, 0.8);
}
.btn-primary:hover {
  color: #fff;
  background: var(--brand-800);
}
.btn-secondary {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line-strong);
}
.btn-secondary:hover {
  color: var(--ink);
  border-color: var(--ink);
}
.btn-sm {
  min-height: 34px;
  padding: 0 14px;
  font-size: 0.85rem;
}
.btn .arrow {
  transition: transform 0.15s;
}
.btn:hover .arrow {
  transform: translateX(3px);
}

/* ── Helpers ────────────────────────────────────────────────────────────── */

.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}
.skip-link:focus {
  position: fixed !important;
  top: 12px;
  left: 12px;
  z-index: 1000;
  width: auto;
  height: auto;
  padding: 10px 16px;
  clip: auto;
  color: #fff;
  background: var(--ink);
  border-radius: var(--radius-sm);
}
