/*
 * Shared primitives for the marketing site and the app: reset, typography defaults,
 * focus ring, skip link, wordmark, buttons and labels. Values come only from
 * tokens.css, so a rebrand does not touch this file.
 */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--foreground);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-kerning: normal;
}
img, svg { display: block; max-width: 100%; }
code, pre, kbd { font-family: var(--font-mono); }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
::selection { background: var(--brand-soft); color: var(--foreground); }
[hidden] { display: none !important; }

/* One visible focus treatment everywhere (keyboard only). */
:focus { outline: none; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-md); }

.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-link { position: absolute; left: var(--space-4); top: -100px; z-index: 100; padding: var(--space-2) var(--space-4); background: var(--foreground); color: var(--background); font-weight: var(--weight-medium); text-decoration: none; }
.skip-link:focus-visible { top: var(--space-3); }

/* ---- wordmark: the name set in the headline serif; the mark (favicon.svg) is optional ---- */
.wordmark { display: inline-flex; align-items: baseline; gap: var(--space-3); color: var(--foreground); text-decoration: none; flex: none; }
.wordmark img { width: 22px; height: 22px; align-self: center; }
.wordmark-name { font-family: var(--font-display); font-weight: var(--weight-medium); font-size: var(--text-xl); letter-spacing: var(--tracking-tight); line-height: 1; white-space: nowrap; }
.wordmark-tag { font-size: var(--text-2xs); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-wide); text-transform: uppercase; line-height: 1; color: var(--muted-foreground); }

/* ---- small-caps label used for kickers, table heads and status words ---- */
.label-caps { font-size: var(--text-2xs); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--muted-foreground); }

/* ---- buttons: flat, square, ink ---- */
.btn {
  font: inherit; font-weight: var(--weight-medium); font-size: var(--text-sm); line-height: 1;
  height: 36px; padding: 0 var(--space-4); border-radius: var(--radius-md);
  border: 1px solid var(--foreground); background: transparent; color: var(--foreground);
  cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); white-space: nowrap;
  transition: background-color var(--duration), color var(--duration), border-color var(--duration);
}
.btn:hover:not(:disabled) { background: var(--accent); color: var(--accent-foreground); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary, .btn-dark { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); }
.btn-primary:hover:not(:disabled), .btn-dark:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--primary-foreground); }
.btn-small { height: 30px; padding: 0 var(--space-3); font-size: var(--text-xs); }
.btn-large { height: 44px; padding: 0 var(--space-5); font-size: var(--text-base); }
.btn-link { border-color: transparent; background: none; padding: 0 var(--space-2); }
.btn-link:hover:not(:disabled) { background: none; text-decoration: underline; }
/* Busy state: a small spinner drawn with borders, no image. */
.btn[aria-busy="true"]::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- badges: typographic status words, not pills ---- */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-2xs); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-wide); text-transform: uppercase; line-height: 1.4; color: var(--muted-foreground); white-space: nowrap; }
.badge-live { color: var(--success); }
.badge-roadmap { color: var(--warning); }
.badge-brand { color: var(--brand); }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

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