/* Sift — SYNRGII marketplace app.
   This is SYNRGII's OWN product, so the SYNRGII theme applies (Ember/Onyx/Satoshi).
   That is the exception, not the default: a CLIENT site never inherits these tokens.
   See design-library/brands/synrgii.md and brand/README.md. */

:root {
  /* Onyx scale. Every grey is tinted cool-neutral. Pure #000 is the floor we never touch. */
  --bg:        oklch(0.150 0.002 200);
  --raised:    oklch(0.245 0.002 200);   /* wider step from --bg so dark-mode elevation actually reads */
  --inset:     oklch(0.125 0.002 200);
  --hairline:  oklch(0.90 0.004 200 / 0.10);
  --hairline-strong: oklch(0.90 0.004 200 / 0.22);
  /* 3:1 non-text boundary, so an outlined control is actually visible (WCAG 1.4.11) */
  --border-control: oklch(0.480 0.004 200);

  /* Off-white, never #FFF. */
  --text:      oklch(0.940 0.002 106);
  --text-mute: oklch(0.700 0.004 200);
  --text-dim:  oklch(0.660 0.004 200);   /* was 0.560 = 4.23:1 on --bg, below AA 4.5 and used for every footer link */

  /* Ember is the 10%. On this site it marks exactly one thing: what Sift removes. */
  --ember:     oklch(0.635 0.213 22);
  --ember-text: oklch(0.700 0.213 22);   /* 5.23:1 on --raised — the text-safe step of the accent */

  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --measure: 68ch;
  --pad: clamp(1.25rem, 5vw, 3rem);

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Satoshi', ui-sans-serif, system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Display face. Large text gets negative tracking and tight leading. */
h1, h2, h3 {
  font-family: 'Cabinet Grotesk', 'Satoshi', ui-sans-serif, system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.025em;
  margin: 0;
  text-wrap: balance;
}

h1 { font-size: clamp(2.25rem, 6vw, 3.75rem); }
h2 { font-size: clamp(1.5rem, 3.2vw, 2rem); letter-spacing: -0.02em; }
h3 { font-size: 1.1875rem; letter-spacing: -0.012em; }

p, li { text-wrap: pretty; }

a { color: inherit; text-decoration-color: var(--hairline-strong); text-underline-offset: 0.22em; }
a:hover { text-decoration-color: currentColor; }

/* Body links were `color: inherit` with a 1.39:1 underline — inside .prose they inherited
   --text-mute and were visually identical to the sentence around them. On the legal pages the
   only actions on the page are links (the deletion-request address on /privacy, the docs link on
   /terms), so "invisible link" meant "no action". Underline + brighter color, never color alone. */
main a:not(.btn) { color: var(--text); text-decoration-color: var(--text-dim); }
main a:not(.btn):hover { text-decoration-color: currentColor; }

/* The sticky header is 4rem, so every in-page anchor (e.g. /docs/#install, the landing's second
   CTA) landed underneath it. */
:target, [id] { scroll-margin-top: 5rem; }

:focus-visible {
  outline: 2px solid var(--text-mute);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ── shell ─────────────────────────────────────────────────────────────── */

.wrap { max-width: 76rem; margin-inline: auto; padding-inline: var(--pad); }
.prose { max-width: var(--measure); }
/* .wrap.prose sits on ONE element, and .prose wins on max-width while keeping margin-inline:auto —
   so the doc column centred while the header and footer stayed at 76rem, and content jumped ~296px
   sideways between Home and Docs while the chrome did not move. */
.wrap.prose { margin-inline: 0; }

header.site {
  border-bottom: 1px solid var(--hairline);
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
}
header.site .wrap {
  display: flex; align-items: center; gap: 1.5rem;
  min-height: 4rem;
}
.brand { display: flex; align-items: center; gap: 0.625rem; font-weight: 700; letter-spacing: -0.02em; text-decoration: none; }
.brand img { width: 26px; height: 26px; display: block; }
nav.site { margin-left: auto; display: flex; gap: 1.5rem; font-size: 0.9375rem; }
/* 44px minimum touch target. These links carry all site navigation and were ~25px boxes.
   Negative block margin keeps the header's 4rem rhythm intact. */
nav.site a {
  color: var(--text-mute); text-decoration: none; transition: color 0.2s var(--ease);
  display: inline-flex; align-items: center; min-height: 44px; margin-block: -0.6rem;
}
nav.site a:hover, nav.site a[aria-current='page'] { color: var(--text); }
/* the 44px hit area would otherwise draw a 50px focus ring around a 20px word */
nav.site a:focus-visible, footer.site a:focus-visible { outline-offset: -8px; }

main { padding-block: clamp(3rem, 8vw, 6rem); }

footer.site {
  border-top: 1px solid var(--hairline);
  margin-top: clamp(4rem, 10vw, 8rem);
  padding-block: 2.5rem;
  color: var(--text-dim);
  font-size: 0.875rem;
}
footer.site .wrap { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; align-items: center; }
footer.site nav { margin-left: auto; display: flex; gap: 1.5rem; flex-wrap: wrap; }
footer.site a { color: var(--text-mute); text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
footer.site a:hover { color: var(--text); }

/* ── hero ──────────────────────────────────────────────────────────────── */

.eyebrow {
  font-size: 0.8125rem; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--text-dim); margin: 0 0 1.25rem;
}
.lede { font-size: clamp(1.125rem, 2vw, 1.3125rem); color: var(--text-mute); margin: 1.5rem 0 0; max-width: 54ch; }

.actions { display: flex; flex-wrap: wrap; gap: 0.875rem; margin-top: 2.5rem; }

.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  height: 2.875rem; padding-inline: 1.5rem;   /* ~2x the height, per the button rule */
  border-radius: 7px; border: 1px solid transparent;
  font: inherit; font-size: 0.9375rem; font-weight: 600;
  text-decoration: none; cursor: pointer;
  transition: background-color 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.btn-primary { background: var(--text); color: var(--bg); }
.btn-primary:hover { background: oklch(0.975 0.002 106); }
.btn-primary:active { transform: translateY(1px); }
.btn-ghost { border-color: var(--border-control); color: var(--text); }
.btn-ghost:hover { background: var(--raised); }
.btn-ghost:active { transform: translateY(1px); }

/* ── content blocks ────────────────────────────────────────────────────── */

section + section { margin-top: clamp(3.5rem, 8vw, 6rem); }

.grid {
  display: grid; gap: 1px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  background: var(--hairline-strong);
  border: 1px solid var(--hairline-strong);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 2.5rem;
}
.cell { background: var(--raised); padding: 1.75rem 1.5rem; }
.cell h3 { margin-bottom: 0.625rem; }
.cell p { margin: 0; color: var(--text-mute); font-size: 0.9375rem; }

/* ── the run receipt ─────────────────────────────────────────────────────
   The one place Ember appears, and the only place it may: the rows being removed.
   This block is the product artifact. Before it existed the landing page promised
   "every run returns a receipt" and then showed four paragraphs of prose instead —
   which is both the loudest vibecode tell on the page and a claim with no evidence. */
.receipt {
  border: 1px solid var(--hairline-strong);
  border-radius: 12px;
  background: var(--raised);
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  margin-top: 2.5rem;
  max-width: 34rem;
}
.receipt-head, .receipt-foot { padding: 0.875rem 1.25rem; background: var(--inset); }
.receipt-head { border-bottom: 1px solid var(--hairline); }
.receipt-foot { border-top: 1px solid var(--hairline); }
.receipt-row {
  display: flex; align-items: baseline; gap: 1rem;
  padding: 0.5rem 1.25rem;
  color: var(--text-mute);
}
.receipt-row .n { margin-left: auto; }
.receipt-body { padding-block: 0.5rem; }
/* Removed rows carry BOTH the accent and an explicit minus sign — never colour alone. */
/* --ember-text, not --ember: the brand accent is 4.26:1 on --raised, which fails AA for 14px text.
   A brand colour that fails contrast gets lightened until it passes; it does not ship failing
   because it is the brand colour. --ember stays for borders and marks. */
.receipt-row.is-cut { color: var(--ember-text); }
/* U+2212 MINUS SIGN as a CSS escape so no toolchain can mangle the literal. It was briefly a raw
   U+0091 control byte, which rendered as tofu plus a stray "2" in front of every number in the
   one component the whole section exists to show. */
.receipt-row.is-cut .n::before { content: "\2212\00a0"; }
.receipt-row.is-kept { color: var(--text); font-weight: 600; }
.receipt-label { color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.75rem; }

.note {
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--hairline-strong);
  background: var(--raised);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  color: var(--text-mute);
  font-size: 0.9375rem;
}
.note strong, .prose strong, .cell strong { color: var(--text); }

/* Legal + docs body copy */
.prose h2 { margin-top: 3rem; }
.prose h3 { margin-top: 2rem; }
.prose p, .prose ul, .prose ol { color: var(--text-mute); }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li + li { margin-top: 0.5rem; }
.prose code {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.875em;
  background: var(--raised); border: 1px solid var(--hairline-strong);
  padding: 0.1em 0.4em; border-radius: 4px;
}
.updated { color: var(--text-dim); font-size: 0.875rem; margin-top: 0.75rem; }

table.spec { width: 100%; border-collapse: collapse; margin-top: 1.5rem; font-size: 0.9375rem; }
table.spec th, table.spec td { text-align: left; padding: 0.75rem 1rem; border-bottom: 1px solid var(--hairline); vertical-align: top; }
table.spec th { color: var(--text); font-weight: 600; }
table.spec td { color: var(--text-mute); }
.scroll-x { overflow-x: auto; }

/* ── status page (OAuth callback result) ───────────────────────────────── */

.status { min-height: 56vh; display: grid; place-content: center; justify-items: center; text-align: center; gap: 0.75rem; }
.status h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
.status-line { color: var(--text-mute); margin: 0; max-width: 46ch; }
.status-actions { justify-content: center; }

/* Status is carried by the glyph, the word, AND the tint. Never colour alone. */
.status-glyph {
  width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-content: center;
  font-size: 1.5rem; line-height: 1;
  border: 1px solid var(--border-control);
  background: var(--raised);
}
.status-word {
  margin: 0; font-size: 0.8125rem; font-weight: 600;
  letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--text-dim);
}
.status-glyph.is-ok    { border-color: oklch(0.70 0.14 155); color: oklch(0.80 0.14 155); }
.status-word.is-ok     { color: oklch(0.80 0.14 155); }
.status-glyph.is-warn  { border-color: oklch(0.75 0.13 85);  color: oklch(0.84 0.13 85); }
.status-word.is-warn   { color: oklch(0.84 0.13 85); }
.status-glyph.is-bad   { border-color: var(--ember); color: oklch(0.76 0.15 22); }
.status-word.is-bad    { color: oklch(0.76 0.15 22); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
