/* Copied from tacenza/site src/styles (tokens.css, base.css, the buttons and fields of components.css). Keep in sync. Store styles follow in store.css. */
/* Copied verbatim from tacenza/TACENZA apps/web/src/styles/tokens.css — keep the two in sync. Site additions follow below. */
/* Brand tokens (spec Appendix B, DESIGN.md). Light by default; dark via prefers-color-scheme or the user's choice.
   Base colours are set per theme; everything derived (soft accent, status backgrounds, surfaces) is mixed from
   them once below, so it follows the theme, the chosen app accent and high contrast automatically. */
:root {
  --bg: #eeeaf4;
  --surface: #ffffff;
  --ink: #221b2e;
  --muted: #6a6280;
  --line: #ddd6e8;
  --accent: #5b2f96;
  --accent-ink: #ffffff;
  --mine: #2e2440;
  --mine-ink: #f3eefa;
  --theirs: #ffffff;
  --warn-bg: #fff1d6;
  --warn-ink: #6b4300;
  --danger: #a3223a;
  --ok: #2f7a4f;
  --info: #2f5d96;
  --code-bg: #f6f3fa;
  --scrim: rgba(20, 14, 30, 0.5);
  --shadow-color: 262deg 30% 20%;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #16121d;
    --surface: #211b2a;
    --ink: #ede8f5;
    --muted: #aaa1bc;
    --line: #372d44;
    --accent: #b592e6;
    --accent-ink: #1a1224;
    --mine: #b592e6;
    --mine-ink: #1a1224;
    --theirs: #2a2235;
    --warn-bg: #3a2a0c;
    --warn-ink: #f5d79a;
    --danger: #f08a9c;
    --ok: #7fd1a1;
    --info: #9cc0f0;
    --code-bg: #1b1623;
    --scrim: rgba(6, 3, 10, 0.66);
    --shadow-color: 265deg 40% 3%;
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #16121d;
  --surface: #211b2a;
  --ink: #ede8f5;
  --muted: #aaa1bc;
  --line: #372d44;
  --accent: #b592e6;
  --accent-ink: #1a1224;
  --mine: #b592e6;
  --mine-ink: #1a1224;
  --theirs: #2a2235;
  --warn-bg: #3a2a0c;
  --warn-ink: #f5d79a;
  --danger: #f08a9c;
  --ok: #7fd1a1;
  --info: #9cc0f0;
  --code-bg: #1b1623;
  --scrim: rgba(6, 3, 10, 0.66);
  --shadow-color: 265deg 40% 3%;
  color-scheme: dark;
}

:root {
  /* Type: the Didone is for the wordmark, page titles and names; everything else is Atkinson Hyperlegible. */
  --didone: 'Bodoni Moda', 'Didot', 'Bodoni 72', 'Bodoni MT', Georgia, serif;
  --body: 'Atkinson Hyperlegible', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* A fixed product scale (~1.15): captions, meta, small, body, lead, section, page title, display. */
  --fs-xs: 0.75rem;
  --fs-sm: 0.8125rem;
  --fs-md: 0.9375rem;
  --fs-base: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.375rem;
  --fs-2xl: 1.75rem;
  --fs-3xl: 2.25rem;
  /* Spacing on a 4px grid. */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-7: 32px;
  --s-8: 40px;
  --s-9: 56px;
  /* Radii: controls, cards and panels, sheets; pills only for small chips. */
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-pill: 999px;
  /* Control heights. 44px is the touch minimum (mobile uses it everywhere). */
  --h-sm: 32px;
  --h-md: 40px;
  --h-lg: 44px;
  /* Derived surfaces and states. */
  --surface-2: color-mix(in srgb, var(--bg) 55%, var(--surface));
  --hover: color-mix(in srgb, var(--ink) 6%, transparent);
  --press: color-mix(in srgb, var(--ink) 10%, transparent);
  --accent-soft: color-mix(in srgb, var(--accent) 13%, var(--surface));
  --accent-line: color-mix(in srgb, var(--accent) 38%, var(--line));
  --danger-soft: color-mix(in srgb, var(--danger) 11%, var(--surface));
  --ok-soft: color-mix(in srgb, var(--ok) 12%, var(--surface));
  --info-soft: color-mix(in srgb, var(--info) 12%, var(--surface));
  --line-soft: color-mix(in srgb, var(--line) 60%, transparent);
  --focus: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent);
  /* Elevation: one soft offset shadow per level; surfaces never also get a border for depth. */
  --e-1: 0 1px 2px hsl(var(--shadow-color) / 0.08), 0 2px 6px hsl(var(--shadow-color) / 0.06);
  --e-2: 0 2px 4px hsl(var(--shadow-color) / 0.08), 0 8px 24px hsl(var(--shadow-color) / 0.12);
  --e-3: 0 4px 8px hsl(var(--shadow-color) / 0.1), 0 20px 48px hsl(var(--shadow-color) / 0.2);
  /* Motion: short, ease-out; reduced motion switches it off (settings.css). */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 120ms;
  --t: 180ms;
  --t-slow: 260ms;
  /* Layout. */
  --rail: 76px;
  --list-w: 340px;
  --page-w: 760px;
  --tabbar: 60px;
}

/* ---- Site additions (public websites only) ---- */
:root {
  /* Display sizes for marketing headlines; fluid between phone and desktop. Bodoni only. */
  --fs-4xl: clamp(1.875rem, 1.2rem + 3vw, 3.25rem);
  --fs-5xl: clamp(2.125rem, 1.2rem + 4.3vw, 4.25rem);
  --lh-tight: 1.08;
  --lh-snug: 1.3;
  --lh-body: 1.6;
  /* Layout widths. */
  --w-prose: 720px;
  --w-page: 1180px;
  --w-wide: 1320px;
  --gutter: clamp(16px, 4vw, 32px);
  --header-h: 64px;
  --section-y: clamp(56px, 8vw, 112px);
  /* Status colours (status page and badges); each has text and an icon, never colour alone. */
  --st-ok: var(--ok);
  --st-degraded: #8a5a00;
  --st-partial: #b45309;
  --st-major: var(--danger);
  --st-maint: var(--info);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) { --st-degraded: #f5c86b; --st-partial: #fdba74; }
}
:root[data-theme='dark'] { --st-degraded: #f5c86b; --st-partial: #fdba74; }

/* Base: fonts, reset, typography and page structure shared by every TACENZA site. */
@font-face { font-family: 'Bodoni Moda'; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/bodoni-moda-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Bodoni Moda'; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/bodoni-moda-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Atkinson Hyperlegible'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/atkinson-hyperlegible-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Atkinson Hyperlegible'; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/atkinson-hyperlegible-latin-700-normal.woff2) format('woff2'); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + var(--s-4)); }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
main { flex: 1; display: block; }
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:where(ul, ol):where([role='list']) { list-style: none; margin: 0; padding: 0; }
hr { border: 0; border-top: 1px solid var(--line-soft); margin: var(--s-7) 0; }
::selection { background: color-mix(in srgb, var(--accent) 26%, transparent); color: var(--ink); }
html { scrollbar-color: color-mix(in srgb, var(--ink) 22%, transparent) transparent; }

/* Headings: Bodoni carries the brand; only headings and names use it. */
h1, h2, h3, .display { font-family: var(--didone); font-weight: 500; line-height: var(--lh-tight); letter-spacing: -0.005em; margin: 0; text-wrap: balance; font-optical-sizing: auto; }
h4, h5, h6 { font-family: var(--body); font-weight: 700; margin: 0; line-height: var(--lh-snug); }
p { margin: 0; text-wrap: pretty; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
strong, b { font-weight: 700; }
code, kbd, pre, samp { font-family: var(--mono); font-size: 0.92em; }
kbd {
  display: inline-block; min-width: 1.6em; padding: 0 0.4em; border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 6px; background: var(--surface); font-size: var(--fs-xs); line-height: 1.6; text-align: center; color: var(--muted);
}

/* Focus: always visible, never removed. */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
:focus:not(:focus-visible) { outline: none; }

.skip {
  position: absolute; left: var(--s-4); top: -100px; z-index: 100;
  background: var(--ink); color: var(--surface); padding: var(--s-2) var(--s-4); border-radius: var(--r-md); font-weight: 700; text-decoration: none;
}
.skip:focus { top: var(--s-3); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

/* Layout primitives. */
.wrap { width: 100%; max-width: calc(var(--w-page) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.wrap.wide { max-width: calc(var(--w-wide) + 2 * var(--gutter)); }
.wrap.narrow { max-width: calc(var(--w-prose) + 2 * var(--gutter)); }
/* :not(:first-child) outranks single-class resets on children (e.g. .limits { margin: 0 }), so stack spacing always holds. */
.stack > :not(:first-child) { margin-top: var(--flow, var(--s-4)); }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.eyebrow { font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
/* A comfortable line length for paragraphs in wide containers. */
.measure { max-width: 68ch; }
/* Text in layouts that collapse to one full-width column on tablets keeps the same line length. */
.faq .answer p, .showcase-points li, .verify p, .split-copy p, .split > .stack > p, .limits li, .states li p, .subscribe .panel p { max-width: 68ch; }
.lede { font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem); line-height: 1.55; color: var(--muted); max-width: 62ch; }
.nowrap { white-space: nowrap; }

/* Motion: pages arrive already visible; everything turns off with reduced motion. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
@media (forced-colors: active) { .btn, .card, .t { border: 1px solid CanvasText; } }
@media print {
  .site-header, .site-footer, .no-print, .toc, .docs-nav { display: none !important; }
  body { background: #fff; color: #000; }
}

/* Utilities (the CSP forbids style attributes, so spacing tweaks are classes). */
.stack.gap-6 { --flow: var(--s-6); }
.center { text-align: center; }
.btnrow.center { justify-content: center; }
.m-0 { margin: 0 !important; }
.mt-3 { margin-top: var(--s-3); } .mt-5 { margin-top: var(--s-5); } .mt-6 { margin-top: var(--s-6); } .mt-8 { margin-top: var(--s-8); }

/* Shared components. Buttons, fields, empty and loading states match apps/web/src/styles/system.css in TACENZA Chat. */

/* ---------- buttons: primary, secondary, quiet, danger; sm / md / lg ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: var(--h-md); padding: 0 var(--s-4);
  border-radius: var(--r-md); border: 1px solid transparent;
  font-weight: 700; font-size: var(--fs-md); line-height: 1.2; text-decoration: none; white-space: nowrap;
  background: transparent; color: var(--ink);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:hover { text-decoration: none; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled='true'] { opacity: 0.55; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 86%, var(--ink)); }
.btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.secondary:hover:not(:disabled) { background: color-mix(in srgb, var(--ink) 4%, var(--surface)); border-color: color-mix(in srgb, var(--line) 60%, var(--ink)); }
.btn.quiet { color: var(--muted); }
.btn.quiet:hover:not(:disabled) { background: var(--hover); color: var(--ink); }
.btn.danger { background: var(--danger); color: var(--surface); border-color: var(--danger); }
.btn.danger:hover:not(:disabled) { background: color-mix(in srgb, var(--danger) 86%, var(--ink)); }
.btn.danger-outline { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 55%, var(--line)); }
.btn.danger-outline:hover:not(:disabled) { background: var(--danger-soft); }
.btn.sm { min-height: var(--h-sm); padding: 0 var(--s-3); font-size: var(--fs-sm); border-radius: var(--r-sm); }
.btn.sm svg { width: 16px; height: 16px; }
.btn.lg { min-height: 48px; padding: 0 var(--s-5); font-size: var(--fs-base); }
.btn.block { width: 100%; }
.iconbtn {
  display: inline-grid; place-items: center; flex: none;
  width: var(--h-md); height: var(--h-md); padding: 0;
  border-radius: var(--r-md); border: 1px solid transparent; background: transparent; color: var(--muted);
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.iconbtn svg { width: 20px; height: 20px; }
.iconbtn:hover:not(:disabled), .iconbtn[aria-expanded='true'] { background: var(--hover); color: var(--ink); }
.btnrow { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }
@media (pointer: coarse) {
  .btn { min-height: var(--h-lg); }
  .btn.sm { min-height: 40px; }
  .iconbtn { width: var(--h-lg); height: var(--h-lg); }
}
/* A text link with an arrow, for "Read the docs →" style CTAs. */
.arrowlink { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; text-decoration: none; }
.arrowlink svg { width: 16px; height: 16px; transition: transform var(--t-fast) var(--ease); }
.arrowlink:hover svg { transform: translateX(3px); }
.arrowlink:hover { text-decoration: underline; }

/* ---------- fields ---------- */
.field { display: grid; gap: 6px; }
.field > label, .field > .label { font-size: var(--fs-sm); font-weight: 700; }
.field .hint { font-size: var(--fs-sm); line-height: 1.45; color: var(--muted); }
.field .err { font-size: var(--fs-sm); color: var(--danger); display: flex; gap: 6px; align-items: flex-start; }
.t {
  width: 100%; min-height: var(--h-md); padding: 8px 12px;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); color: var(--ink);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.t::placeholder { color: color-mix(in srgb, var(--muted) 80%, transparent); }
.t:hover:not(:disabled):not(:focus) { border-color: color-mix(in srgb, var(--line) 55%, var(--ink)); }
.t:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.t[aria-invalid='true'] { border-color: var(--danger); }
textarea.t { min-height: 140px; line-height: 1.45; resize: vertical; }
select.t { appearance: none; padding-right: 36px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.searchbox {
  display: flex; align-items: center; gap: var(--s-2);
  min-height: var(--h-md); padding: 0 var(--s-2) 0 var(--s-3);
  border-radius: var(--r-md); background: var(--surface-2); border: 1px solid transparent; color: var(--muted);
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.searchbox svg { width: 18px; height: 18px; flex: none; }
