/* Crewline black and yellow brand system. */
:root, :root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0e11; --bg-2: #14171c; --surface: #1e2329;
  --border: #30363e; --text: #eaecef; --muted: #a7b0bc;
  --accent: #f0b90b; --accent-2: #f8d33a; --on-accent: #181a20;
  --accent-soft: rgba(240,185,11,.10); --warn: #ff9c52;
  --code-bg: #15191f; --chat-bg: #11151a; --bubble: #20262e; --bubble-me: #302a16;
  --shadow: 0 2px 4px rgba(0,0,0,.18), 0 20px 60px rgba(0,0,0,.3);
  --radius: 12px; --maxw: 1120px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #fafafa; --bg-2: #f2f3f5; --surface: #ffffff;
  --border: #dddfe3; --text: #181a20; --muted: #59616e;
  --accent: #946b00; --accent-2: #946b00; --on-accent: #181a20;
  --accent-soft: rgba(240,185,11,.14); --code-bg: #f2f3f5;
  --chat-bg: #f2f3f5; --bubble: #ffffff; --bubble-me: #fff3c6;
  --shadow: 0 2px 4px rgba(24,26,32,.04), 0 16px 40px rgba(24,26,32,.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; display: block; }
code, pre, .mono { font-family: var(--mono); font-size: 0.88em; }
code { background: var(--code-bg); border: 1px solid var(--border); border-radius: 6px; padding: 0.1em 0.4em; }
pre {
  background: var(--code-bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 16px; overflow-x: auto; line-height: 1.5;
}
pre code { background: none; border: 0; padding: 0; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.3rem, 5.4vw, 4rem); font-weight: 800; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); font-weight: 750; }
h3 { font-size: 1.12rem; font-weight: 650; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: saturate(160%) blur(12px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
}
.nav .wrap { display: flex; align-items: center; gap: 20px; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 750; color: var(--text); letter-spacing: -0.02em; font-size: 1.08rem; }
.brand:hover { text-decoration: none; }
.brand svg { width: 28px; height: 28px; }
.nav-links { display: none; gap: 22px; margin-left: 12px; }
.nav-links a { color: var(--muted); font-size: 0.94rem; font-weight: 500; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); text-decoration: none; }
.nav-cta { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.theme-toggle {
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  width: 36px; height: 36px; border-radius: 10px; cursor: pointer; display: grid; place-items: center;
}
.theme-toggle:hover { color: var(--text); }
@media (min-width: 1040px) { .nav-links { display: flex; } }
@media (max-width: 520px) { .nav-cta .btn-ghost { display: none; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  height: 44px; padding: 0 18px; border-radius: 11px; font-weight: 600; font-size: 0.95rem;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: #f0b90b; color: var(--on-accent); }
.btn-primary:hover { background: #f8d33a; }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 0.9rem; border-radius: 10px; }
.btn svg { width: 18px; height: 18px; }

/* ---------- hero ---------- */
.hero { position: relative; padding: 64px 0 72px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -40% -10% auto -10%; height: 760px; z-index: -1;
  background:
    radial-gradient(600px 300px at 18% 30%, var(--accent-soft), transparent 70%),
    radial-gradient(500px 260px at 85% 20%, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent 70%);
}
.hero-grid { display: grid; gap: 48px; align-items: center; }
@media (min-width: 980px) { .hero-grid { grid-template-columns: 1.05fr 0.95fr; gap: 56px; } .hero { padding: 88px 0 96px; } }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: 0.82rem; font-weight: 600;
  color: var(--accent); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  padding: 5px 12px; border-radius: 999px; margin-bottom: 20px;
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-2) 25%, transparent); }
.lede { font-size: clamp(1.06rem, 1.6vw, 1.22rem); color: var(--muted); max-width: 560px; margin-bottom: 28px; }
.hero h1 .grad {
  background: linear-gradient(92deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 26px; }
.trust-row { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-size: 0.9rem; }
.trust-row span { display: inline-flex; align-items: center; gap: 6px; }
.trust-row svg { width: 16px; height: 16px; color: var(--accent-2); }

/* ---------- chat mock ---------- */
.chat {
  background: var(--chat-bg); border: 1px solid var(--border); border-radius: 20px;
  box-shadow: var(--shadow); overflow: hidden; max-width: 520px; width: 100%; justify-self: center;
}
.chat-head {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.chat-avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 700; font-size: 0.85rem; }
.chat-title { font-weight: 650; font-size: 0.95rem; line-height: 1.2; }
.chat-sub { color: var(--muted); font-size: 0.78rem; }
.chat-body { padding: 16px 14px 18px; display: flex; flex-direction: column; gap: 10px; min-height: 430px; }
.msg {
  max-width: 88%; padding: 9px 12px 8px; border-radius: 14px; font-size: 0.88rem; line-height: 1.45;
  background: var(--bubble); border: 1px solid var(--border);
  opacity: 0; transform: translateY(6px); animation: pop 0.45s ease forwards;
}
.msg.me { align-self: flex-end; background: var(--bubble-me); border-color: transparent; border-bottom-right-radius: 4px; }
.msg.bot { border-bottom-left-radius: 4px; }
.msg .who { font-size: 0.74rem; font-weight: 650; color: var(--accent); margin-bottom: 2px; }
.msg.me .who { color: var(--accent-2); }
.msg code { font-size: 0.82em; }
.msg .btns { display: flex; gap: 6px; margin-top: 8px; }
.msg .btns span {
  flex: 1; text-align: center; font-size: 0.78rem; font-weight: 600; padding: 6px 4px; border-radius: 8px;
  background: var(--accent-soft); color: var(--accent);
}
.msg .btns span.on { background: var(--accent); color: var(--on-accent); }
.msg .files { color: var(--muted); font-size: 0.78rem; margin-top: 4px; }
@keyframes pop { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .msg { animation: none; opacity: 1; transform: none; } }

/* ---------- sections ---------- */
section { padding: 84px 0; }
section.alt { background: var(--bg-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 680px; margin-bottom: 44px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.kicker { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }
.section-head p { color: var(--muted); font-size: 1.08rem; }

.grid { display: grid; gap: 18px; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 980px) { .grid-4 { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 720px) and (max-width: 979px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
}
.card p { color: var(--muted); margin: 0; font-size: 0.95rem; }
.card .ico {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 14px;
  background: var(--accent-soft); color: var(--accent);
}
.card .ico svg { width: 21px; height: 21px; }
.card.quote { font-size: 1.02rem; }
.card.quote p { color: var(--text); }

/* steps */
.steps { counter-reset: s; display: grid; gap: 14px; }
@media (min-width: 900px) { .steps { grid-template-columns: repeat(5, 1fr); } }
.step { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 18px; }
.step::before {
  counter-increment: s; content: counter(s);
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; margin-bottom: 12px;
  background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 0.9rem;
}
.step p { color: var(--muted); font-size: 0.92rem; margin: 0; }
.step h3 { font-size: 1rem; }

/* architecture */
.arch { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 18px; overflow-x: auto; }
.arch svg { min-width: 760px; width: 100%; height: auto; }
.arch text { font-family: var(--font); }

/* security layers */
.layers { display: grid; gap: 12px; }
.layer { display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.layer .n { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-weight: 750; background: color-mix(in srgb, var(--accent-2) 16%, transparent); color: var(--accent-2); }
.layer p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.layer h3 { margin-bottom: 4px; }

/* table */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 0.94rem; min-width: 560px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 650; background: var(--bg-2); }
tr:last-child td { border-bottom: 0; }
.yes { color: var(--warn); font-weight: 600; }
.no { color: var(--accent-2); font-weight: 650; }

/* agents */
.agents { display: flex; flex-wrap: wrap; gap: 12px; }
.agent-pill {
  display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); font-weight: 600;
}
.agent-pill .sw { width: 10px; height: 10px; border-radius: 3px; }

/* bounty flow */
.flow { display: grid; gap: 10px; }
@media (min-width: 900px) { .flow { grid-template-columns: repeat(4, 1fr); } }
.flow .card { position: relative; }
.flow .tag { display: inline-block; font-size: 0.74rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; margin-bottom: 10px; background: var(--accent-soft); color: var(--accent); }

.callout {
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); background: var(--accent-soft);
  border-radius: var(--radius); padding: 16px 18px; color: var(--text); font-size: 0.95rem;
}
.callout.muted { background: var(--surface); border-color: var(--border); color: var(--muted); }

/* faq */
details { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 0 18px; }
details + details { margin-top: 10px; }
summary { cursor: pointer; padding: 16px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--muted); font-weight: 500; font-size: 1.2rem; line-height: 1; }
details[open] summary::after { content: "–"; }
details p { color: var(--muted); margin: 0 0 16px; }

/* final cta */
.final { text-align: center; padding: 96px 0; }
.final .cta-row { justify-content: center; }
.final p { color: var(--muted); font-size: 1.1rem; max-width: 560px; margin: 0 auto 28px; }

/* footer */
footer { border-top: 1px solid var(--border); padding: 36px 0 44px; color: var(--muted); font-size: 0.9rem; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; justify-content: space-between; }
footer nav { display: flex; flex-wrap: wrap; gap: 18px; }
footer a { color: var(--muted); }

/* docs pages */
.page { padding: 56px 0 80px; }
.page-head { max-width: 760px; margin-bottom: 36px; }
.page-head p { color: var(--muted); font-size: 1.1rem; }
.doc { display: grid; gap: 40px; }
@media (min-width: 980px) { .doc { grid-template-columns: 220px 1fr; } }
.toc { position: sticky; top: 86px; align-self: start; display: none; }
@media (min-width: 980px) { .toc { display: block; } }
.toc a { display: block; color: var(--muted); padding: 5px 0; font-size: 0.92rem; }
.toc a:hover { color: var(--text); text-decoration: none; }
.prose { max-width: 760px; min-width: 0; }
.prose h2 { font-size: 1.6rem; margin-top: 8px; padding-top: 12px; scroll-margin-top: 80px; }
.prose h3 { margin-top: 26px; }
.prose p, .prose li { color: var(--muted); }
.prose strong { color: var(--text); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: 6px 0; }
.prose section { padding: 0 0 36px; }

.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.brand-ai {
  font-size: 0.72em; font-weight: 750; padding: 2px 6px; border-radius: 6px; margin-left: -4px;
  background: linear-gradient(92deg, var(--accent), var(--accent-2)); color: #fff; letter-spacing: 0;
}

/* ---------- a11y ---------- */
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 50; padding: 10px 14px; border-radius: 10px;
  background: var(--accent); color: var(--on-accent); font-weight: 600; transition: top 0.15s ease;
}
.skip:focus { top: 12px; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
main:focus { outline: none; }

/* ---------- status badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em;
  padding: 3px 9px; border-radius: 999px; white-space: nowrap; vertical-align: middle;
  background: var(--accent-soft); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.dev { background: color-mix(in srgb, var(--accent-2) 14%, transparent); color: color-mix(in srgb, var(--accent-2) 55%, var(--text)); border-color: color-mix(in srgb, var(--accent-2) 35%, transparent); }
.badge.new { background: color-mix(in srgb, var(--accent) 14%, transparent); color: color-mix(in srgb, var(--accent) 60%, var(--text)); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.badge.soon { background: color-mix(in srgb, var(--warn) 12%, transparent); color: color-mix(in srgb, var(--warn) 60%, var(--text)); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.card h3 .badge { margin-left: 6px; }

/* ---------- x402 flow ---------- */
.payflow { display: grid; gap: 10px; counter-reset: pf; }
@media (min-width: 900px) { .payflow { grid-template-columns: repeat(4, 1fr); gap: 14px; } }
.payflow .pf {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 16px 16px 58px; min-height: 84px;
}
.payflow .pf::before {
  counter-increment: pf; content: counter(pf); position: absolute; left: 16px; top: 16px;
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 0.88rem;
}
.payflow .pf.ok::before { background: var(--accent-2); color: #0b0f1e; }
.payflow .pf b { display: block; color: var(--text); font-size: 0.98rem; margin-bottom: 2px; }
.payflow .pf span { color: var(--muted); font-size: 0.9rem; }
@media (min-width: 900px) {
  .payflow .pf:not(:last-child)::after {
    content: "→"; position: absolute; right: -13px; top: 50%; transform: translateY(-50%); z-index: 1;
    width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 0.8rem;
    background: var(--bg-2); border: 1px solid var(--border); color: var(--muted);
  }
}

/* ---------- get started page ---------- */
.need { display: grid; gap: 12px; }
@media (min-width: 720px) { .need { grid-template-columns: repeat(3, 1fr); } }
.need .card { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: start; padding: 18px; }
.need .card .ico { margin: 0; }
.need h3 { margin-bottom: 2px; font-size: 1rem; }
.onboard { display: grid; gap: 18px; counter-reset: ob; }
.ob {
  display: grid; gap: 18px; align-items: center; background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; padding: 22px 18px;
}
@media (min-width: 820px) { .ob { grid-template-columns: 1fr 340px; padding: 28px; gap: 32px; } }
.ob-num {
  counter-increment: ob; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: var(--accent); color: var(--on-accent); font-weight: 750; margin-bottom: 12px;
}
.ob-num::before { content: counter(ob); }
.ob h2 { font-size: clamp(1.3rem, 2.4vw, 1.6rem); margin-bottom: 0.4em; }
.ob p { color: var(--muted); margin-bottom: 0.6em; }
.ob p:last-child { margin-bottom: 0; }
.tg { background: var(--chat-bg); border: 1px solid var(--border); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tg .msg { animation: none; opacity: 1; transform: none; max-width: 100%; }
.tg .msg.me { max-width: 80%; }
.tg .btns { flex-wrap: wrap; }
.tg .btns span { flex: 1 1 auto; }
.tg .btns.col { flex-direction: column; }
.tg .note { font-size: 0.74rem; color: var(--muted); text-align: center; }
.big-cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn-lg { height: 52px; padding: 0 24px; font-size: 1.02rem; border-radius: 13px; }
.prose .sub { scroll-margin-top: 80px; padding-top: 4px; }
.prose .sub h3 { font-size: 1.2rem; }
.prose h2 .badge { font-size: 0.7rem; letter-spacing: 0; }
.prose h2 code { font-size: 0.8em; }
.ob code, .tg code, details code { overflow-wrap: anywhere; }
.need .card .ico svg { width: 20px; height: 20px; }

/* Consistent brand details and comfortable mobile controls. */
.brand-ai, .chat-avatar { color: #181a20; }
.nav-links a[aria-current="page"] { color: var(--accent); }
.card { transition: border-color .18s ease, transform .18s ease; }
.card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.hero h1 { letter-spacing: -.045em; }
.hero { isolation: isolate; }
@media (max-width: 520px) { .nav .wrap { gap: 10px; } .nav-cta { gap: 6px; } .brand { gap: 6px; font-size: 1rem; } }

/* Fixed artwork stays visible throughout every page, including mobile. */
body { position: relative; isolation: isolate; }
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: linear-gradient(180deg, rgba(11,14,17,.25), rgba(11,14,17,.55)), url("crewline-background.webp");
  background-size: cover;
  background-position: center right;
  background-repeat: no-repeat;
}
.brand .brand-mark { width: 36px; height: 36px; object-fit: contain; flex-shrink: 0; }
section.alt { background: rgba(20,23,28,.62); }
.hero::before { opacity: .3; }
:root[data-theme="light"] body::before {
  background-image: linear-gradient(180deg, rgba(250,250,250,.86), rgba(250,250,250,.92)), url("crewline-background.webp");
}
:root[data-theme="light"] section.alt { background: rgba(242,243,245,.65); }
@media (max-width: 720px) {
  body::before { background-position: center; }
}
