/* AviFlow site styles — every color below is a literal from the canonical
   Avieros brand tokens (packages/core/design/tokens.ts): slate-steel surfaces,
   Avieros Orange #E9662B as brand + primary action, doctrine state colors. */

:root {
  --bg: #161A20;
  --surface: #1F242C;
  --surface-raised: #2A313B;
  --border: #39424E;
  --brand: #E9662B;
  --brand-hover: #D0561F;
  --accent: #2FA96B;
  --warning: #E0A32B;
  --danger: #DB4A45;
  --action: #3E7BD6;
  --text: #EEF1F4;
  --text-secondary: #9AA4B0;
  --ink-900: #0D0F13;
  --ink-800: #14171C;
  --ink-300: #AEB4BD;
  --orange-200: #F3B393;
  --orange-50: #FCEEE7;
  --font-sans: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-display: 'Poppins', 'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

a { color: var(--orange-200); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--action);
  outline-offset: 2px;
}

/* ---------- header ---------- */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 64px; gap: 16px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px;
}
.wordmark {
  font-family: var(--font-display);
  font-weight: 700; font-size: 22px; letter-spacing: -0.02em;
  color: var(--text);
}
.wordmark:hover { text-decoration: none; }
.wordmark .flow { color: var(--brand); }
.wordmark .by {
  display: block; font-family: var(--font-sans); font-weight: 400;
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-secondary);
}
.site-nav { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.site-nav a { color: var(--text-secondary); font-size: 15px; }
.site-nav a:hover { color: var(--text); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--text); }
/* .site-nav a (0,1,1) outranks .btn-primary (0,1,0) and painted the nav CTA
   textSecondary-on-orange (1.3:1, AA fail — caught by scripts/contrast-check.mjs
   on the live deploy). Restate brandForeground with winning specificity. */
.site-nav a.btn-primary { color: var(--ink-900); }
.site-nav a.btn-primary:hover { color: var(--ink-900); }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; font-family: var(--font-display); font-weight: 600;
  font-size: 16px; line-height: 1; padding: 14px 24px; border-radius: 8px;
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
}
.btn:hover { text-decoration: none; }
/* ink-900 on brand-orange = tokens.ts `brandForeground` (AA 5.8:1; hover 4.6:1).
   Never white text on orange-500 — BRAND_SPEC.md "Text ON brand-orange fills". */
.btn-primary { background: var(--brand); color: var(--ink-900); }
.btn-primary:hover { background: var(--brand-hover); color: var(--ink-900); }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--text-secondary); }
.btn-small { font-size: 14px; padding: 10px 16px; }

/* ---------- hero ---------- */
.hero { padding: 96px 0 64px; border-bottom: 1px solid var(--border); }
.kicker {
  font-family: var(--font-sans); font-size: 13px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--brand);
  margin-bottom: 24px;
}
.hero h1 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(36px, 6vw, 60px); line-height: 1.08; letter-spacing: -0.025em;
  max-width: 720px;
}
.hero h1 .em { color: var(--brand); }
.hero .sub {
  margin-top: 24px; max-width: 640px;
  font-size: 19px; color: var(--text-secondary);
}
.hero .cta-row { margin-top: 40px; display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }

/* ---------- fact strip ---------- */
.fact-strip { padding: 24px 0; border-bottom: 1px solid var(--border); background: var(--surface); }
.fact-strip ul {
  list-style: none; display: flex; flex-wrap: wrap; gap: 8px 32px;
  justify-content: space-between;
}
.fact-strip li {
  font-size: 14px; color: var(--text-secondary); display: flex; align-items: center; gap: 8px;
}
.fact-strip .dot { color: var(--brand); font-weight: 700; }

/* ---------- sections ---------- */
.section { padding: 88px 0; border-bottom: 1px solid var(--border); }
.section h2 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(28px, 4vw, 38px); line-height: 1.15; letter-spacing: -0.02em;
  max-width: 640px;
}
.section .lede { margin-top: 16px; max-width: 640px; font-size: 17px; color: var(--text-secondary); }

.card-grid { margin-top: 48px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 28px;
}
.card .step-no {
  font-family: var(--font-mono); font-size: 13px; color: var(--brand);
  display: block; margin-bottom: 12px;
}
.card h3 { font-family: var(--font-display); font-weight: 600; font-size: 19px; margin-bottom: 10px; }
.card p { font-size: 15px; color: var(--text-secondary); }
.card p code, .lede code {
  font-family: var(--font-mono); font-size: 0.9em; color: var(--orange-200);
  background: var(--surface-raised); padding: 1px 5px; border-radius: 4px;
}

/* ---------- landing job cards ---------- */
.job-grid { margin-top: 40px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.job-card {
  display: grid; grid-template-columns: 48px 1fr; grid-template-areas: "icon title" "icon outcome";
  column-gap: 16px; row-gap: 4px; align-items: start;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 22px 20px; color: var(--text); text-decoration: none;
}
.job-card:hover { border-color: var(--brand); text-decoration: none; }
.job-icon { grid-area: icon; font-size: 30px; line-height: 1.2; }
.job-title {
  grid-area: title; font-family: var(--font-display); font-weight: 600;
  font-size: 18px; line-height: 1.3;
}
.job-outcome { grid-area: outcome; color: var(--text-secondary); font-size: 14.5px; line-height: 1.5; }
@media (max-width: 720px) { .job-grid { grid-template-columns: 1fr; } }

/* ---------- comparison table ---------- */
.compare-scroll { margin-top: 48px; overflow-x: auto; }
table.compare {
  width: 100%; min-width: 640px; border-collapse: collapse;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
}
table.compare th, table.compare td {
  text-align: left; padding: 16px 20px; border-bottom: 1px solid var(--border);
  font-size: 15px; vertical-align: top;
}
table.compare th {
  font-family: var(--font-display); font-weight: 600; font-size: 15px;
  background: var(--surface-raised);
}
table.compare tr:last-child td { border-bottom: none; }
table.compare td.dim { color: var(--text-secondary); }
table.compare td .yes { color: var(--accent); font-weight: 600; }
table.compare th.avi { color: var(--brand); }

/* ---------- technical details disclosure (off by default) ---------- */
.tech-details {
  margin-top: 40px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
}
.tech-details > summary {
  list-style: none; cursor: pointer; padding: 18px 24px;
  font-family: var(--font-display); font-weight: 600; font-size: 16px; color: var(--text);
  display: flex; align-items: center; gap: 10px;
}
.tech-details > summary::-webkit-details-marker { display: none; }
.tech-details > summary::before {
  content: "\25B8"; color: var(--brand); font-size: 14px; transition: transform 0.15s ease; display: inline-block;
}
.tech-details[open] > summary::before { transform: rotate(90deg); }
.tech-details > summary:hover { background: var(--surface-raised); }
.tech-details .tech-hint { font-family: var(--font-sans); font-weight: 400; font-size: 13.5px; color: var(--text-secondary); }
.tech-details .tech-body { padding: 4px 24px 24px; border-top: 1px solid var(--border); }
.tech-details .tech-body p { color: var(--text-secondary); font-size: 15px; margin-top: 16px; max-width: 720px; }
.tech-details .tech-body ul { list-style: none; margin: 16px 0 0; display: grid; gap: 10px; }
.tech-details .tech-body li { font-size: 15px; color: var(--text-secondary); padding-left: 20px; position: relative; max-width: 760px; }
.tech-details .tech-body li::before { content: "\2014"; position: absolute; left: 0; color: var(--brand); }
.tech-details .tech-body strong { color: var(--text); }
.tech-details .tech-body code {
  font-family: var(--font-mono); font-size: 0.88em; color: var(--orange-200);
  background: var(--surface-raised); padding: 1px 5px; border-radius: 4px;
}

/* ---------- honest status ---------- */
.status-list { margin-top: 48px; display: grid; gap: 12px; }
.status-row {
  display: flex; gap: 16px; align-items: baseline; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 16px 20px;
}
.badge {
  font-family: var(--font-mono); font-size: 12px; font-weight: 700;
  letter-spacing: 0.05em; padding: 3px 10px; border-radius: 999px; white-space: nowrap;
}
.badge-live { background: var(--accent); color: var(--ink-900); }
.badge-not { background: var(--surface-raised); color: var(--warning); border: 1px solid var(--warning); }
.status-row .what { font-weight: 600; }
.status-row .how { color: var(--text-secondary); font-size: 14px; flex-basis: 100%; }

/* ---------- funnel ---------- */
.two-col { margin-top: 48px; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.two-col .card ul { list-style: none; margin-top: 12px; display: grid; gap: 8px; }
.two-col .card li { font-size: 15px; color: var(--text-secondary); padding-left: 20px; position: relative; }
.two-col .card li::before { content: "—"; position: absolute; left: 0; color: var(--brand); }

/* ---------- final cta ---------- */
.final-cta { padding: 96px 0; text-align: center; }
.final-cta h2 { max-width: none; }
.final-cta .cta-row { margin-top: 32px; display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.final-cta .quiet { margin-top: 24px; font-size: 14px; color: var(--text-secondary); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 40px 0 56px; background: var(--surface); }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.site-footer p, .site-footer a { font-size: 14px; color: var(--text-secondary); }
.site-footer nav { display: flex; gap: 20px; flex-wrap: wrap; }

/* ---------- docs page ---------- */
.doc-main { padding: 64px 0 96px; }
.doc-main h1 {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(30px, 5vw, 44px);
  letter-spacing: -0.02em; margin-bottom: 8px;
}
.doc-main .doc-sub { color: var(--text-secondary); font-size: 17px; max-width: 640px; }
.doc-main h2 {
  font-family: var(--font-display); font-weight: 600; font-size: 26px;
  margin: 56px 0 12px; letter-spacing: -0.01em;
}
.doc-main h3 { font-family: var(--font-display); font-weight: 600; font-size: 19px; margin: 32px 0 8px; }
.doc-main p, .doc-main li { color: var(--text-secondary); font-size: 16px; max-width: 720px; }
.doc-main ul, .doc-main ol { padding-left: 24px; margin: 12px 0; display: grid; gap: 6px; }
.doc-main strong { color: var(--text); }
.doc-main code {
  font-family: var(--font-mono); font-size: 0.88em; color: var(--orange-200);
  background: var(--surface-raised); padding: 1px 5px; border-radius: 4px;
}
.doc-main pre {
  background: var(--ink-800); border: 1px solid var(--border); border-radius: 10px;
  padding: 20px; overflow-x: auto; margin: 16px 0; max-width: 820px;
}
.doc-main pre code { background: transparent; padding: 0; color: var(--text); font-size: 13.5px; line-height: 1.6; }
.doc-main table { border-collapse: collapse; margin: 16px 0; }
.doc-main table th, .doc-main table td {
  border: 1px solid var(--border); padding: 10px 14px; font-size: 14.5px; text-align: left;
  color: var(--text-secondary);
}
.doc-main table th { color: var(--text); background: var(--surface); font-family: var(--font-display); font-weight: 600; }
.doc-toc { margin: 24px 0 0; display: flex; gap: 16px; flex-wrap: wrap; }
.doc-toc a { font-size: 14px; color: var(--text-secondary); border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px; }
.doc-toc a:hover { color: var(--text); text-decoration: none; border-color: var(--text-secondary); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .card-grid { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .hero { padding: 64px 0 48px; }
  .section { padding: 64px 0; }
}
