/* Antidha landing page. System fonts only and no third-party requests: the server's
   Content-Security-Policy allows nothing else. Palette follows the reference pipeline's dashboard
   (amber = speed layer, sage = batch layer, teal = merged / serving). */

:root {
  color-scheme: dark light;
  --page: #1c1915;
  --surface: #25221d;
  --surface-2: #2d2923;
  --border: #38322a;
  --border-strong: #5c5448;
  --text: #ede4d8;
  --text-2: #cdc4b6;
  --muted: #a0998a;
  --speed: #d4782f;
  --batch: #6b8c5c;
  --merged: #4a9c8c;
  --ok: #7d9b76;
  --warn: #d4a853;
  --bad: #d9806f;
  --focus: #e8b56b;
  --btn-bg: #4a9c8c;
  --btn-fg: #14110e;
  --shadow: 0 1px 0 rgb(255 255 255 / 4%) inset, 0 14px 36px rgb(0 0 0 / 30%);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    --page: #faf6f0;
    --surface: #ffffff;
    --surface-2: #f4eee5;
    --border: #e5dccd;
    --border-strong: #c9bba6;
    --text: #2a251e;
    --text-2: #4a4337;
    --muted: #6f6556;
    --speed: #b85f1a;
    --batch: #55743f;
    --merged: #2a7466;
    --ok: #44703a;
    --warn: #8a600c;
    --bad: #b0443a;
    --focus: #b4570f;
    --btn-bg: #2a7466;
    --btn-fg: #ffffff;
    --shadow: 0 1px 2px rgb(60 40 10 / 6%), 0 12px 30px rgb(60 40 10 / 8%);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 1rem/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
svg { max-width: 100%; }
a { color: inherit; }
p { margin: 0 0 1rem; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.02em; text-wrap: balance; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 12px; top: -48px; z-index: 50; padding: 8px 14px;
  border-radius: 8px; background: var(--btn-bg); color: var(--btn-fg);
  font-weight: 600; text-decoration: none;
}
.skip:focus { top: 12px; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
@media (min-width: 720px) { .wrap { width: min(1120px, 100% - 48px); } }

/* ---- navigation ---- */
.nav { position: sticky; top: 0; z-index: 20; background: var(--page); border-bottom: 1px solid var(--border); }
@supports (background: color-mix(in srgb, red, blue)) {
  .nav { background: color-mix(in srgb, var(--page) 86%, transparent); backdrop-filter: blur(10px); }
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.01em; text-decoration: none; white-space: nowrap; }
.mark {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--speed), var(--batch) 55%, var(--merged));
  color: #14110e; font-size: 18px; font-weight: 800; line-height: 1;
}
.mark.small { width: 24px; height: 24px; border-radius: 6px; font-size: 15px; }
.nav-links { display: flex; align-items: center; gap: 4px; font-size: 0.9375rem; }
.nav-links a { padding: 8px 12px; border-radius: 8px; color: var(--text-2); text-decoration: none; white-space: nowrap; }
.nav-links a:hover { background: var(--surface-2); color: var(--text); }
@media (max-width: 640px) { .nav-links a:not(.ext):not(.keep) { display: none; } }
@media (max-width: 480px) { .nav-links a.keep { display: none; } }  /* the hero has the same call to action */

/* ---- hero ---- */
.hero {
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(60% 80% at 12% 0%, rgb(212 120 47 / 16%), transparent 60%),
    radial-gradient(60% 80% at 88% 0%, rgb(74 156 140 / 14%), transparent 60%);
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; align-items: center; padding-block: clamp(40px, 7vw, 88px); }
@media (min-width: 900px) { .hero-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 56px; } }
h1 { margin-block: 20px; font-size: clamp(2.25rem, 1.1rem + 4.6vw, 3.75rem); line-height: 1.05; letter-spacing: -0.03em; }
.lede { max-width: 60ch; color: var(--text-2); font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-block: 28px 18px; }
.note { margin: 0; color: var(--muted); font-size: 0.9375rem; }

.live {
  display: inline-flex; align-items: center; gap: 10px; padding: 7px 14px 7px 12px;
  border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface);
  color: var(--text-2); font-size: 0.875rem; text-decoration: none;
}
.live:hover { border-color: var(--muted); }
.dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
[data-state="healthy"] > .dot { background: var(--ok); box-shadow: 0 0 0 4px rgb(125 155 118 / 22%); }
[data-state="degraded"] > .dot { background: var(--warn); box-shadow: 0 0 0 4px rgb(212 168 83 / 22%); }
[data-state="down"] > .dot, [data-state="unreachable"] > .dot { background: var(--bad); box-shadow: 0 0 0 4px rgb(217 128 111 / 22%); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px;
  padding: 0 20px; border: 1px solid transparent; border-radius: 999px;
  background: var(--btn-bg); color: var(--btn-fg); font: inherit; font-weight: 650;
  text-decoration: none; cursor: pointer; transition: filter 0.15s, background 0.15s;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; filter: none; }
.btn.ghost { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn.ghost:hover { background: var(--surface-2); filter: none; }

/* ---- architecture diagram ---- */
.diagram { width: 100%; max-width: 520px; height: auto; justify-self: center; }
.lane { fill: none; stroke-width: 2; opacity: 0.45; }
.lane-speed, .flow-speed { stroke: var(--speed); }
.lane-batch, .flow-batch { stroke: var(--batch); }
.flow { fill: none; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 0.1 16; }
.node { stroke-width: 1.5; }
.node-src { fill: var(--muted); stroke: none; }
.node-speed { fill: var(--surface); stroke: var(--speed); }
.node-batch { fill: var(--surface); stroke: var(--batch); }
.node-merged { fill: var(--merged); stroke: none; }
.node-copilot { fill: var(--surface-2); stroke: var(--border-strong); stroke-dasharray: 4 4; }
.link { fill: none; stroke: var(--border-strong); stroke-width: 1.5; stroke-dasharray: 4 5; }
.t-title { font: 600 16px var(--font); fill: var(--text); }
.t-sub { font: 400 13px var(--font); fill: var(--muted); }
.cap { font: 500 14px var(--font); fill: var(--text-2); }
.t-mark { font: 800 26px var(--font); fill: var(--btn-fg); }
.t-copilot { font: 600 14px var(--font); fill: var(--text-2); }
@media (prefers-reduced-motion: no-preference) {
  .flow-speed { animation: travel 1.1s linear infinite; }
  .flow-batch { animation: travel 3.2s linear infinite; }
}
@keyframes travel { to { stroke-dashoffset: -16.1; } }

/* ---- sections ---- */
.section { padding-block: clamp(56px, 8vw, 104px); border-bottom: 1px solid var(--border); }
.section.alt { background: var(--surface); }
.eyebrow { margin: 0 0 12px; color: var(--merged); font: 600 0.8125rem/1 var(--font); letter-spacing: 0.12em; text-transform: uppercase; }
h2 { margin-bottom: 16px; font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.5rem); line-height: 1.1; }
h3 { font-size: 1.125rem; letter-spacing: -0.01em; }
.lead { max-width: 66ch; color: var(--text-2); }
.lead a, .cta a { color: var(--merged); font-weight: 600; }

.card {
  padding: clamp(18px, 3vw, 28px); border: 1px solid var(--border); border-radius: 18px;
  background: var(--surface); box-shadow: var(--shadow);
}
.section.alt .card { background: var(--surface-2); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card > h3 { margin-bottom: 14px; }

.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border: 1px solid var(--border-strong);
  border-radius: 999px; color: var(--text-2); font-size: 0.8125rem; font-weight: 650;
}
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.pill[data-state="healthy"] { border-color: var(--ok); color: var(--ok); }
.pill[data-state="healthy"]::before { background: var(--ok); }
.pill[data-state="degraded"] { border-color: var(--warn); color: var(--warn); }
.pill[data-state="degraded"]::before { background: var(--warn); }
.pill[data-state="down"], .pill[data-state="unreachable"] { border-color: var(--bad); color: var(--bad); }
.pill[data-state="down"]::before, .pill[data-state="unreachable"]::before { background: var(--bad); }

/* ---- live demo ---- */
/* minmax(0, ...) and min-width: 0 stop wide content (the evidence table) from stretching a grid column
   past the viewport. */
.demo-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; margin-top: 32px; }
.demo-grid > * { min-width: 0; }
@media (min-width: 900px) { .demo-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.headline { margin: 0 0 12px; font-size: 1.25rem; font-weight: 650; letter-spacing: -0.01em; }
.facts { display: grid; gap: 8px; margin: 0 0 16px; padding: 0; list-style: none; }
.facts li { position: relative; padding-left: 20px; color: var(--text-2); }
.facts li::before { content: ""; position: absolute; left: 2px; top: 0.62em; width: 7px; height: 7px; border-radius: 2px; background: var(--merged); }
.meta { margin: 12px 0 0; color: var(--muted); font-size: 0.8125rem; }
.narrative { margin-top: 18px; padding: 14px 16px; border-left: 3px solid var(--merged); border-radius: 12px; background: var(--surface); }
.tag { margin: 0 0 6px; font-size: 0.8125rem; font-weight: 650; }
.tag span { color: var(--muted); font-weight: 400; }
.narrative[data-pending="true"] .rich { color: var(--muted); font-style: italic; }
.rich p { margin: 0 0 0.6rem; }
.rich ul { margin: 0 0 0.6rem; padding-left: 1.2rem; }
.rich li { margin-bottom: 0.25rem; }
.rich > :last-child { margin-bottom: 0; }

.notice { margin: 0 0 14px; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); color: var(--text-2); font-size: 0.9375rem; }
textarea {
  display: block; width: 100%; min-height: 104px; padding: 12px 14px; resize: vertical;
  border: 1px solid var(--border-strong); border-radius: 12px; background: var(--page);
  color: var(--text); font: inherit; line-height: 1.5;
}
textarea::placeholder { color: var(--muted); }
textarea:focus { outline: 2px solid var(--focus); outline-offset: 1px; border-color: transparent; }
.form-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.count { color: var(--muted); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip {
  padding: 7px 12px; border: 1px solid var(--border-strong); border-radius: 999px; background: transparent;
  color: var(--text-2); font: inherit; font-size: 0.875rem; text-align: left; cursor: pointer;
}
.chip:hover { background: var(--surface); color: var(--text); }

.answer { margin-top: 18px; padding: 16px; border-left: 3px solid var(--merged); border-radius: 12px; background: var(--surface); }
.answer[data-kind="error"] { border-left-color: var(--bad); }
.answer[data-kind="refused"] { border-left-color: var(--warn); }
.answer-meta { margin: 8px 0 0; color: var(--muted); font-size: 0.8125rem; }
.evidence { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.evidence summary { cursor: pointer; font-size: 0.9375rem; font-weight: 600; }
.table-wrap { margin-top: 10px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; font-variant-numeric: tabular-nums; }
th, td { padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; }
thead th { color: var(--muted); font-weight: 600; }
th:first-child, td:first-child { text-align: left; }
tbody th { font-weight: 600; }
@media (max-width: 520px) {
  .px { display: none; }  /* on phones keep the gap and the verdict in view */
  table { font-size: 0.8125rem; }
  th, td { padding: 6px 3px; }
  .card { padding: 16px; }
  .answer { padding: 12px; }
}
.nobr { white-space: nowrap; }
.sev { padding: 2px 8px; border: 1px solid currentcolor; border-radius: 999px; font-size: 0.75rem; font-weight: 650; }
.sev-ok { color: var(--ok); }
.sev-round { color: var(--muted); }
.sev-watch { color: var(--warn); }
.sev-alert { color: var(--bad); }
.fineprint { max-width: 80ch; margin: 20px 0 0; color: var(--muted); font-size: 0.875rem; }

/* ---- how it works ---- */
.steps { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin: 32px 0 0; padding: 0; list-style: none; }
@media (min-width: 860px) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.steps li { padding: 22px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.num { display: inline-grid; place-items: center; width: 32px; height: 32px; margin-bottom: 14px; border-radius: 50%; background: var(--btn-bg); color: var(--btn-fg); font-weight: 700; }
.steps p { margin: 8px 0 0; color: var(--text-2); }
.guards { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 0; padding: 0; list-style: none; }
.guards li { padding: 6px 12px; border: 1px solid var(--border-strong); border-radius: 999px; color: var(--text-2); font-size: 0.875rem; }

/* ---- status ---- */
.status-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; margin-top: 28px; }
@media (min-width: 760px) { .status-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.checks, .todo { display: grid; gap: 12px; margin: 12px 0 0; padding: 0; list-style: none; }
.checks li, .todo li { position: relative; padding-left: 28px; color: var(--text-2); }
.checks li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 800; }
.todo li::before { content: "○"; position: absolute; left: 0; color: var(--muted); font-weight: 700; }
.cta { margin: 28px 0 0; font-size: 1.0625rem; }

/* ---- footer ---- */
.footer { padding-block: 36px 48px; color: var(--muted); font-size: 0.875rem; }
.footer-inner { display: grid; gap: 20px; }
@media (min-width: 760px) { .footer-inner { grid-template-columns: 1fr auto; align-items: start; } }
.footer strong { margin-left: 8px; color: var(--text); }
.footer p { max-width: 62ch; margin: 10px 0 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; }
.footer-links a { color: var(--text-2); text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
