/* recallsapi.com: one shared stylesheet. System fonts, light and dark, mobile first, no external requests. */

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --bg-code: #f3f4f6;
  --fg: #16181d;
  --fg-muted: #555b66;
  --border: #dde1e7;
  --link: #1d4ed8;
  --link-visited: #5b3cc4;
  --accent: #b42318;
  --accent-soft: #fdecea;
  --ok: #067647;
  --ok-soft: #e7f6ee;
  --warn: #93370d;
  --warn-soft: #fef3e2;
  --radius: 8px;
  --wide: 68rem;
  --prose: 72ch;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111317;
    --bg-soft: #181b21;
    --bg-code: #1c2027;
    --fg: #e8eaee;
    --fg-muted: #a3aab6;
    --border: #2c313a;
    --link: #8ab4ff;
    --link-visited: #c3a6ff;
    --accent: #ff7a6b;
    --accent-soft: #2a1714;
    --ok: #6ce9a6;
    --ok-soft: #0f2a1d;
    --warn: #fdb022;
    --warn-soft: #2b2010;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

a { color: var(--link); text-underline-offset: 0.15em; }
a:visited { color: var(--link-visited); }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, summary:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; border-radius: 3px; }

.skip { position: absolute; left: -999px; top: 0; padding: 0.5rem 0.75rem; background: var(--bg); z-index: 10; }
.skip:focus { left: 0.5rem; top: 0.5rem; }

/* Header and footer */
.site-header { border-bottom: 1px solid var(--border); background: var(--bg); }
.site-header .bar {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.25rem;
}
.brand { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 700; color: var(--fg); text-decoration: none; font-size: 1.1rem; }
.brand:visited { color: var(--fg); }
.brand svg { width: 26px; height: 26px; flex: none; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.1rem; }
.site-nav li + li, .site-footer li + li { margin-top: 0; }
.site-nav a { color: var(--fg); text-decoration: none; font-size: 0.98rem; }
.site-nav a:visited { color: var(--fg); }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--link); text-decoration: underline; }

.site-footer { border-top: 1px solid var(--border); margin-top: 4rem; background: var(--bg-soft); color: var(--fg-muted); font-size: 0.93rem; }
.site-footer .bar { max-width: var(--wide); margin: 0 auto; padding: 1.5rem 1rem 2rem; display: flex; flex-wrap: wrap; gap: 0.75rem 2rem; justify-content: space-between; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.1rem; }
.site-footer a, .site-footer a:visited { color: var(--fg-muted); }
.site-footer p { margin: 0; }

/* Page containers */
main { display: block; }
.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 1rem; }
.prose { max-width: var(--prose); }
.prose-wrap { max-width: var(--wide); margin: 0 auto; padding: 0 1rem; }
.prose-wrap > * { max-width: var(--prose); }
.prose-wrap > pre, .prose-wrap > .table-scroll, .prose-wrap > .wide { max-width: 100%; }

h1, h2, h3, h4 { line-height: 1.25; margin: 2rem 0 0.75rem; }
h1 { font-size: clamp(1.8rem, 1.3rem + 2.2vw, 2.6rem); letter-spacing: -0.01em; margin-top: 2.25rem; }
h2 { font-size: 1.5rem; padding-top: 0.5rem; }
h3 { font-size: 1.17rem; }
h2[id], h3[id] { scroll-margin-top: 1rem; }
p, ul, ol, dl { margin: 0 0 1rem; }
li + li { margin-top: 0.3rem; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }
small, .muted { color: var(--fg-muted); }
.lede { font-size: 1.2rem; color: var(--fg-muted); max-width: 60ch; }
.kicker { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; font-weight: 700; color: var(--accent); margin: 2rem 0 0.25rem; }

/* Code */
code, kbd, pre, samp { font-family: var(--mono); font-size: 0.9em; }
:not(pre) > code { background: var(--bg-code); border: 1px solid var(--border); border-radius: 4px; padding: 0.05em 0.3em; }
pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  overflow-x: auto;
  line-height: 1.45;
  margin: 0 0 1.25rem;
  tab-size: 2;
}
pre code { font-size: 0.86rem; }
.code-label { display: block; font-family: var(--font); font-size: 0.8rem; font-weight: 600; color: var(--fg-muted); margin: 0 0 0.35rem; }

/* Tables */
.table-scroll { overflow-x: auto; margin: 0 0 1.25rem; border: 1px solid var(--border); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; vertical-align: top; padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--border); }
thead th { background: var(--bg-soft); font-weight: 600; white-space: nowrap; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
td code { white-space: nowrap; }

/* Callouts */
.note, .warn, .draft {
  border-left: 4px solid var(--link);
  background: var(--bg-soft);
  padding: 0.75rem 1rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 0 0 1.25rem;
}
.note > :last-child, .warn > :last-child, .draft > :last-child { margin-bottom: 0; }
.warn { border-left-color: var(--warn); background: var(--warn-soft); }
.draft { border-left-color: var(--accent); background: var(--accent-soft); font-weight: 600; }

/* Landing */
.hero { padding: 1.5rem 0 1rem; }
.hero h1 { max-width: 22ch; }
.cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.5rem 0 0.5rem; }
.button {
  display: inline-block;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--fg);
  background: var(--fg);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
}
.button:visited { color: var(--bg); }
.button:hover { opacity: 0.88; }
.button.secondary { background: transparent; color: var(--fg); border-color: var(--border); }
.button.secondary:visited { color: var(--fg); }

.grid { display: grid; gap: 1rem; grid-template-columns: 1fr; margin: 1rem 0 1.5rem; }
@media (min-width: 46rem) { .grid.two { grid-template-columns: 1fr 1fr; } .grid.three { grid-template-columns: repeat(3, 1fr); } }
.card { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; background: var(--bg); }
.card h3 { margin-top: 0.1rem; }
.card > :last-child { margin-bottom: 0; }
.band { background: var(--bg-soft); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 0.5rem 0 1.5rem; margin: 2rem 0; }

.steps { counter-reset: step; list-style: none; padding: 0; }
.steps > li { counter-increment: step; position: relative; padding-left: 2.4rem; margin-bottom: 0.9rem; }
.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0.05rem;
  width: 1.7rem; height: 1.7rem; line-height: 1.7rem;
  text-align: center; border-radius: 50%;
  background: var(--fg); color: var(--bg); font-weight: 700; font-size: 0.9rem;
}

.pill { display: inline-block; font-size: 0.78rem; font-weight: 700; padding: 0.05rem 0.5rem; border-radius: 999px; border: 1px solid currentColor; vertical-align: 0.1em; }
.pill.exact { color: var(--ok); }
.pill.strong { color: var(--link); }
.pill.possible { color: var(--warn); }

/* Docs layout: side nav on wide screens, stacked on phones */
.docs { max-width: var(--wide); margin: 0 auto; padding: 0 1rem; display: grid; grid-template-columns: 1fr; gap: 0 2.5rem; }
.docs-nav { border-bottom: 1px solid var(--border); padding: 1rem 0 0.75rem; font-size: 0.95rem; }
.docs-nav h2 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--fg-muted); margin: 0 0 0.5rem; padding: 0; }
.docs-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }
.docs-nav li + li { margin-top: 0; }
.docs-nav a { text-decoration: none; }
.docs-nav a[aria-current="page"] { font-weight: 700; color: var(--fg); }
.docs-body { min-width: 0; }
.docs-body > * { max-width: var(--prose); }
.docs-body > pre, .docs-body > .table-scroll { max-width: 100%; }
@media (min-width: 60rem) {
  .docs { grid-template-columns: 12rem minmax(0, 1fr); }
  .docs-nav { border-bottom: 0; padding-top: 2.4rem; }
  .docs-nav ul { display: block; position: sticky; top: 1rem; }
  .docs-nav li + li { margin-top: 0.4rem; }
}

/* Pricing */
.plans { display: grid; gap: 1rem; grid-template-columns: 1fr; margin: 1.5rem 0; }
@media (min-width: 40rem) { .plans { grid-template-columns: 1fr 1fr; } }
@media (min-width: 64rem) { .plans { grid-template-columns: repeat(4, 1fr); } }
.plan { border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem; display: flex; flex-direction: column; }
.plan h2 { margin: 0 0 0.25rem; font-size: 1.3rem; padding: 0; }
.plan .price { margin: 0.25rem 0 0; color: var(--fg-muted); }
.plan .price strong { font-size: 1.9rem; line-height: 1.1; color: var(--fg); font-variant-numeric: tabular-nums; }
.plan .price-note { margin: 0.1rem 0 0.75rem; color: var(--fg-muted); font-size: 0.9rem; }
.plan ul { padding-left: 1.1rem; margin-bottom: 0; }

dl.defs dt { font-weight: 600; margin-top: 0.75rem; }
dl.defs dd { margin: 0.15rem 0 0 0; }

@media print {
  .site-header, .site-footer, .docs-nav, .skip { display: none; }
  body { font-size: 11pt; }
  pre { white-space: pre-wrap; }
}
.prose-wrap > .draft:first-child { margin-top: 1.5rem; }
