/* ═══════════════════════════════════════════════════════════════════════════
   Skiplink — shared styles for the content pages (docs, pricing, integrations).

   The homepage keeps its own inline styles because it is one long bespoke
   layout. Everything else shares this: same focus-ring structural device, same
   type scale, so a docs page never feels like a different product.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --paper:   #E8ECF1;
  --paper-2: #DFE5EC;
  --panel:   #FFFFFF;
  --ink:     #0D141A;
  --ink-2:   #26313C;
  --muted:   #5A6672;
  --rule:    #C3CCD6;
  --ring:    #2036E8;
  --fail:    #A3211A;
  --pass:    #0B6B45;
  --warn:    #8A6410;

  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(.2, .7, .3, 1);
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
}

a { color: var(--ring); }
a:focus-visible, button:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--ring); outline-offset: 3px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 50;
  font-family: var(--mono); font-size: .85rem;
  background: var(--ink); color: #fff; padding: .7rem 1.1rem;
  text-decoration: none; transition: top .15s var(--ease);
}
.skip-link:focus { top: 1rem; }

/* ── Masthead ─────────────────────────────────────────────────────────────── */

.site-head { border-bottom: 1px solid var(--rule); background: var(--paper); }
.site-head .inner {
  max-width: 1180px; margin: 0 auto; padding: 1.4rem var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.wordmark {
  font-family: var(--mono); font-size: .95rem; font-weight: 600;
  letter-spacing: .07em; text-transform: uppercase;
  text-decoration: none; color: var(--ink);
  display: inline-flex; align-items: center; gap: .6rem;
}
.wordmark .glyph {
  width: 12px; height: 12px; display: inline-block;
  outline: 2.5px solid var(--ring); outline-offset: 2px;
}
.site-head nav { display: flex; gap: 1.5rem; align-items: center; }
.site-head nav a {
  font-family: var(--mono); font-size: .8rem; letter-spacing: .03em;
  color: var(--muted); text-decoration: none;
}
.site-head nav a:hover { color: var(--ink); }
.site-head nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -1.5px 0 var(--ring); }

/* ── Page shell ───────────────────────────────────────────────────────────── */

.page { max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 780px; }

h1 {
  font-family: var(--mono); font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: -.045em; line-height: 1.05; font-weight: 600; margin: 2.5rem 0 .75rem;
}
.lede { font-size: 1.1rem; color: var(--ink-2); max-width: 60ch; margin: 0 0 2.5rem; }

h2 {
  font-family: var(--mono); font-size: 1.3rem; letter-spacing: -.025em;
  margin: 3.5rem 0 1rem; padding-bottom: .6rem; border-bottom: 1.5px solid var(--rule);
  position: relative; scroll-margin-top: 5rem;
}
h2::after { content: ""; position: absolute; left: 0; bottom: -1.5px; width: 30px; height: 3px; background: var(--ring); }
h3 { font-family: var(--mono); font-size: 1rem; margin: 2.2rem 0 .6rem; scroll-margin-top: 5rem; }

p { margin: 0 0 1.1rem; }
ul, ol { margin: 0 0 1.2rem; padding-left: 1.3rem; }
li { margin-bottom: .4rem; }

code {
  font-family: var(--mono); font-size: .88em;
  background: var(--paper-2); padding: .1em .35em;
}
pre {
  background: var(--ink); color: #DCE3EA; font-family: var(--mono);
  font-size: .84rem; line-height: 1.7; padding: 1.2rem 1.4rem;
  overflow-x: auto; margin: 0 0 1.5rem;
}
pre code { background: none; padding: 0; font-size: inherit; color: inherit; }
pre .c { color: #7C8B99; }
pre .k { color: #93B4FF; }
pre .s { color: #9FD8B4; }
pre .n { color: #E0B080; }

table { width: 100%; border-collapse: collapse; font-size: .92rem; margin: 0 0 1.6rem; }
th {
  text-align: left; font-family: var(--mono); font-size: .7rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); font-weight: 600;
  border-bottom: 1.5px solid var(--rule); padding: .55rem .7rem;
}
td { padding: .65rem .7rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
td:first-child { font-family: var(--mono); font-size: .85rem; white-space: nowrap; }
td.wrap-ok:first-child { white-space: normal; }

.panel {
  background: var(--panel); outline: 1.5px solid var(--ink); outline-offset: 5px;
  padding: 1.3rem 1.5rem; margin: 1.8rem 0 2.2rem;
}
.panel p:last-child, .panel ul:last-child { margin-bottom: 0; }
.panel.warn { outline-color: var(--warn); }
.panel h3 { margin-top: 0; }

.pill {
  font-family: var(--mono); font-size: .68rem; text-transform: uppercase;
  letter-spacing: .07em; padding: .16em .5em; color: #fff; background: var(--muted);
}
.pill.post { background: var(--pass); }
.pill.get { background: var(--ring); }

footer.site-foot { margin: 5rem 0 0; border-top: 1.5px solid var(--rule); }
footer.site-foot .inner {
  max-width: 1180px; margin: 0 auto; padding: 1.8rem var(--gutter) 3rem;
  font-family: var(--mono); font-size: .74rem; color: var(--muted);
  display: flex; flex-wrap: wrap; gap: .8rem 2rem; justify-content: space-between;
}
footer.site-foot a { color: var(--muted); }
.disclaimer-foot {
  max-width: 1180px; margin: 0 auto; padding: 2rem var(--gutter) 0;
  font-size: .82rem; line-height: 1.65; color: var(--muted);
}
.disclaimer-foot strong { color: var(--ink); }

@media (max-width: 620px) {
  body { font-size: 16px; }
  .site-head nav a:not([aria-current]) { display: none; }
  table, thead, tbody, th, td, tr { display: block; }
  thead { display: none; }
  td { border: 0; padding: .2rem 0; }
  td:first-child { white-space: normal; font-weight: 600; }
  tbody tr { padding: .8rem 0; border-bottom: 1px solid var(--rule); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* A heading whose level is set by document structure but whose weight in the
   page is small. Level is semantics, size is design; they are allowed to differ,
   and pretending otherwise is how heading-order violations get written. */
h2.as-h3 {
  font-size: 1rem; letter-spacing: -.01em; margin: 0 0 .6rem;
  padding: 0; border-bottom: 0;
}
h2.as-h3::after { display: none; }

/* Scrollable code blocks are keyboard-reachable. A <pre> with overflow that
   cannot be focused is unreachable for anyone not using a mouse — WCAG 2.1.1,
   and axe's scrollable-region-focusable rule catches it. */
pre[tabindex="0"]:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; }

/* ── Auth and dashboard ───────────────────────────────────────────────────── */

.auth-form { max-width: 26rem; }
.field { margin: 0 0 1.2rem; }
.field label { display: block; font-family: var(--mono); font-size: .78rem; letter-spacing: .04em; margin-bottom: .45rem; }
.field input {
  width: 100%; font-family: var(--mono); font-size: .95rem;
  padding: .8rem .95rem; background: var(--panel); border: 1.5px solid var(--ink); color: var(--ink);
}
.field input::placeholder { color: #94A0AC; }
.field .help { font-size: .82rem; color: var(--muted); margin: .45rem 0 0; }
.field input[aria-invalid="true"] { border-color: var(--fail); }
.field .err { font-size: .84rem; color: var(--fail); margin: .45rem 0 0; }

.btn {
  font-family: var(--mono); font-size: .88rem; padding: .85rem 1.4rem; border: 0;
  cursor: pointer; background: var(--ink); color: #fff; text-decoration: none; display: inline-block;
}
.btn:hover:not(:disabled) { background: var(--ring); }
.btn:disabled { background: var(--muted); cursor: progress; }
.btn-wide { width: 100%; }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn-ghost:hover:not(:disabled) { color: var(--ring); box-shadow: inset 0 0 0 1.5px var(--ring); background: transparent; }
.btn-small { font-size: .78rem; padding: .5rem .9rem; }

.linkbtn {
  font: inherit; font-family: var(--mono); font-size: .82rem; background: none; border: 0;
  padding: 0; cursor: pointer; color: var(--ring); text-decoration: underline; text-underline-offset: 3px;
}

.note { padding: .95rem 1.1rem; outline: 1.5px solid var(--rule); outline-offset: 4px;
  background: var(--panel); font-size: .92rem; margin: 1.4rem 0; }
.note.err { outline-color: var(--fail); color: var(--fail); }
.note.ok { outline-color: var(--pass); }
#status:empty, .status:empty { display: none; margin: 0; }

.alt { font-size: .9rem; color: var(--muted); margin-top: 1.6rem; }

/* Six-digit code entry. Wide tracking so the digits read as separate things. */
.code-input {
  font-family: var(--mono); font-size: 1.8rem; letter-spacing: .5em;
  text-align: center; padding: .8rem .5rem .8rem 1.3rem;
  width: 100%; max-width: 14rem; background: var(--panel);
  border: 1.5px solid var(--ink); color: var(--ink);
}

/* ── Welcome flow ─────────────────────────────────────────────────────────── */

.steps { list-style: none; padding: 0; margin: 2rem 0 0; max-width: 46rem; counter-reset: step; }
.step {
  counter-increment: step; position: relative; padding: 0 0 0 3.2rem; margin: 0 0 2.2rem;
}
.step::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  font-family: var(--mono); font-size: .8rem; width: 2rem; height: 2rem;
  display: grid; place-items: center; background: var(--ink); color: #fff;
}
.step[data-done="true"]::before { content: "✓"; background: var(--pass); }
.step h2 { font-size: 1.05rem; margin: .15rem 0 .5rem; padding: 0; border: 0; }
.step h2::after { display: none; }
.step p { font-size: .95rem; margin-bottom: .8rem; }
.step[data-done="true"] > h2 { color: var(--pass); }

.keylist { width: 100%; border-collapse: collapse; font-size: .9rem; margin: 1rem 0; }
.keylist td, .keylist th { padding: .6rem .5rem; border-bottom: 1px solid var(--rule); text-align: left; }
.keylist .mono { font-family: var(--mono); font-size: .84rem; }

.keyreveal { background: var(--ink); color: #9FD8B4; font-family: var(--mono); font-size: .86rem;
  padding: .8rem 1rem; overflow-x: auto; white-space: nowrap; margin: .8rem 0 .5rem; }

.usage-bar { height: 6px; background: var(--rule); margin: .6rem 0; max-width: 22rem; }
.usage-bar i { display: block; height: 100%; background: var(--ring); }

/* ── Legal pages ──────────────────────────────────────────────────────────── */

.updated { font-family: var(--mono); font-size: .78rem; color: var(--muted); margin: 0 0 2rem; }

/* A quoted statement of record — the accuracy disclaimer, the axe-core
   attribution. Same offset outline as every other panel. */
.statement, .attribution {
  background: var(--panel); outline: 1.5px solid var(--ink); outline-offset: 5px;
  padding: 1.4rem 1.5rem; margin: 1.5rem 0 2.5rem;
}
.statement p:last-child, .attribution p:last-child { margin-bottom: 0; }

/* The can/cannot split. Two columns is the point — the gap between them is the
   argument — so it only collapses when there is genuinely no room. */
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.8rem; margin: 1.5rem 0 0; }
.cols h3 {
  font-family: var(--mono); font-size: .8rem; letter-spacing: .08em;
  text-transform: uppercase; margin: 0 0 .7rem;
}
.cols .can h3 { color: var(--pass); }
.cols .cannot h3 { color: var(--fail); }
.cols ul { margin: 0; padding-left: 1.1rem; font-size: .95rem; }
.cols li { margin-bottom: .4rem; color: var(--ink-2); }
@media (max-width: 640px) { .cols { grid-template-columns: 1fr; } }

/* ── Definition list ──────────────────────────────────────────────────────────
   Used on the reference for criteria with no automated rule: the term is the
   criterion, the description is what it actually requires. A real <dl> rather than
   a table, because there are only two columns and one of them is prose. */
.deflist { margin: 1.5rem 0 2.5rem; }
.deflist dt {
  font-weight: 600; margin: 1.4rem 0 .3rem; font-size: .96rem;
  display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap;
}
.deflist dt:first-child { margin-top: 0; }
.deflist dt a { text-decoration: none; }
.deflist dt a:hover { text-decoration: underline; }
.deflist dd { margin: 0; color: var(--ink-2); font-size: .93rem; line-height: 1.6; }

/* Consent and authorisation notes under a form. Small, but not so small that it
   reads as something hidden — the point is that it gets read. */
.legal-consent {
  margin: 1.4rem 0 0;
  font-size: .82rem;
  line-height: 1.6;
  color: var(--ink-2);
}
