/* AgentLex landing. The idea: every answer is sewn to its page with thread, and AgentLex sews every
   answer to its page. One signature, used sparingly: a vermilion thread that runs from a citation
   to the passage it came from. Everything else stays quiet: warm white, ink, a serif for display,
   Inter for reading, JetBrains Mono for anything a machine would print. */
:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --sunk: #f3f1ec;
  --ink: #15130f;
  --ink-2: #57524a;
  --ink-3: #8d877d;
  --line: #e6e2d9;
  --line-2: #d6d1c5;
  --thread: #d4442a;
  --thread-soft: #fbe7e1;
  --ok: #1f7a4a;
  --ok-soft: #e3f2e8;
  --warn: #a15c07;
  --warn-soft: #fbefd9;
  --serif: "Helvetica Neue", Helvetica, Arimo, Arial, sans-serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --arabic: "Amiri", serif;
  --measure: 1160px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
code { font-family: var(--mono); font-size: .88em; }
:focus-visible { outline: 2px solid var(--thread); outline-offset: 3px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }

.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 32px; }
@media (max-width: 640px) { .wrap { padding: 0 20px; } }

.serif { font-family: var(--serif); font-weight: 700; }
.display { font-family: var(--serif); font-weight: 700; letter-spacing: -.03em; line-height: 1.04; text-wrap: balance; }
.display em { font-style: normal; color: var(--thread); }
.lede { color: var(--ink-2); font-size: 18px; line-height: 1.6; text-wrap: pretty; }
.mono { font-family: var(--mono); }

/* Buttons: rectangles with a little radius; the primary one is ink. */
.btn { display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 20px; border-radius: 10px; font: 500 15px/1 var(--sans); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); transition: background .15s, border-color .15s, transform .15s; white-space: nowrap; }
.btn:hover { border-color: var(--ink-3); }
.btn-ink { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-ink:hover { background: #2b2822; border-color: #2b2822; }
.btn svg { width: 16px; height: 16px; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; border-radius: 8px; }

/* Header */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.top.scrolled { border-bottom-color: var(--line); }
.top .wrap { height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 700 26px/1 var(--serif); letter-spacing: -.01em; }
.brand svg { width: 26px; height: 26px; }
.nav { display: flex; align-items: center; gap: 28px; font-size: 14px; color: var(--ink-2); }
.nav a:hover { color: var(--ink); }
.nav-cta { display: flex; gap: 10px; }
@media (max-width: 860px) { .nav { display: none; } }
@media (max-width: 480px) { .nav-cta .btn:not(.btn-ink) { display: none; } }

/* Hero: words on the left, the trace on the right. */
.hero { padding: 72px 0 96px; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); gap: 64px; align-items: center; }
.hero h1 { font-size: clamp(48px, 6.4vw, 88px); }
.hero .lede { margin-top: 24px; max-width: 30em; }
.hero .cta { margin-top: 36px; display: flex; gap: 12px; flex-wrap: wrap; }
.hero .proof { margin-top: 40px; display: grid; grid-template-columns: repeat(3, max-content); gap: 32px; font-size: 13px; color: var(--ink-3); }
.hero .proof b { display: block; font: 700 30px/1 var(--serif); color: var(--ink); margin-bottom: 6px; }
@media (max-width: 1000px) { .hero .wrap { grid-template-columns: 1fr; gap: 48px; } .hero { padding: 48px 0 72px; } }

/* The trace: an answer above, its source page below, threads between them. */
.trace { position: relative; min-width: 0; }
.hero .wrap > * { min-width: 0; }
.trace-tabs { display: flex; gap: 4px; padding: 4px; background: var(--sunk); border-radius: 10px; width: max-content; max-width: 100%; overflow-x: auto; margin-bottom: 16px; }
.trace-tabs button { appearance: none; border: 0; background: transparent; font: 500 13px/1 var(--sans); color: var(--ink-2); padding: 9px 14px; border-radius: 7px; cursor: pointer; white-space: nowrap; }
.trace-tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(20, 16, 10, .08), 0 0 0 1px var(--line); }
.trace-stage { position: relative; }
.trace-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; z-index: 3; }
.trace-svg path { fill: none; stroke: var(--thread); stroke-width: 1.5; stroke-dasharray: 5 4; opacity: 0; transition: opacity .3s; }
.trace-svg path.on { opacity: 1; animation: sew 1.2s linear infinite; }
.trace-svg circle { fill: var(--thread); opacity: 0; transition: opacity .3s; }
.trace-svg circle.on { opacity: 1; }
@keyframes sew { to { stroke-dashoffset: -18; } }

.ans-card { position: relative; z-index: 2; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; box-shadow: 0 1px 2px rgba(20, 16, 10, .04), 0 18px 40px -20px rgba(20, 16, 10, .18); }
.ans-q { font: 700 20px/1.3 var(--serif); color: var(--ink); }
.ans-meta { margin-top: 6px; font: 400 12px/1.4 var(--mono); color: var(--ink-3); }
.ans-body { margin-top: 14px; font-size: 15px; line-height: 1.65; color: var(--ink); }
.cite { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 18px; padding: 0 5px; margin: 0 1px; border-radius: 5px; background: var(--thread-soft); color: var(--thread); font: 600 11px/1 var(--mono); vertical-align: 1px; cursor: default; transition: background .15s, color .15s; }
.cite.on { background: var(--thread); color: #fff; }
.ans-checks { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line-2); display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 6px; font: 500 12px/1 var(--sans); background: var(--sunk); color: var(--ink-2); }
.chip svg { width: 12px; height: 12px; }
.chip-ok { background: var(--ok-soft); color: var(--ok); }
.chip-warn { background: var(--warn-soft); color: var(--warn); }
.chip-thread { background: var(--thread-soft); color: var(--thread); }

.src-page { position: relative; z-index: 1; margin: 44px 0 0 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 4px 14px 14px 14px; padding: 22px 24px 20px; font-size: 13.5px; line-height: 1.7; color: var(--ink-2); box-shadow: 0 1px 2px rgba(20, 16, 10, .04); }
.src-page::before { content: ""; position: absolute; left: -1px; top: -1px; bottom: -1px; width: 5px; border-radius: 4px 0 0 14px; background: repeating-linear-gradient(to bottom, var(--line-2) 0 6px, transparent 6px 12px); }
.src-head { display: flex; justify-content: space-between; gap: 12px; font: 400 11.5px/1.4 var(--mono); color: var(--ink-3); margin-bottom: 12px; }
.src-page h4 { margin: 12px 0 4px; font: 600 10.5px/1.3 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.src-page p { margin: 0; }
.src-page .span { background: transparent; border-radius: 3px; padding: 1px 2px; margin: 0 -2px; transition: background .2s, box-shadow .2s; color: var(--ink); }
.src-page .span.on { background: var(--thread-soft); box-shadow: inset 0 -1.5px 0 var(--thread); }
.src-page.rtl { direction: rtl; font: 400 17px/1.95 var(--arabic); }
.src-page.rtl .src-head { direction: ltr; }
.src-page .rule { width: 34%; height: 1px; background: var(--line-2); margin: 10px 0 6px auto; }
.src-page .foot { font-size: 14px; color: var(--ink-3); }
.trace-panel[hidden] { display: none; }
@media (max-width: 560px) { .src-page { margin-left: 12px; } .ans-card { padding: 18px; } }

/* Sections */
.section { padding: 120px 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: end; margin-bottom: 64px; }
.section-head h2 { font-size: clamp(38px, 4.6vw, 60px); }
.section-head .lede { max-width: 32em; }
@media (max-width: 900px) { .section { padding: 80px 0; } .section-head { grid-template-columns: 1fr; gap: 20px; margin-bottom: 44px; } }

/* The six steps, sewn down a spine. */
.spine { position: relative; display: grid; gap: 0; }
.spine::before { content: ""; position: absolute; left: 23px; top: 24px; bottom: 24px; border-left: 1.5px dashed var(--line-2); }
.step { position: relative; display: grid; grid-template-columns: 48px minmax(0, 1fr) minmax(0, 1.05fr); gap: 32px; padding: 32px 0; align-items: start; }
.step + .step { border-top: 1px solid var(--line); }
.step .knot { position: relative; z-index: 1; width: 48px; height: 48px; border-radius: 50%; background: var(--bg); border: 1.5px solid var(--line-2); display: grid; place-items: center; font: 700 22px/1 var(--serif); color: var(--ink-2); transition: border-color .2s, color .2s; }
.step:hover .knot { border-color: var(--thread); color: var(--thread); }
.step h3 { font: 700 30px/1.15 var(--serif); letter-spacing: -.005em; }
.step p { margin-top: 10px; color: var(--ink-2); font-size: 15.5px; text-wrap: pretty; }
.step .api { margin-top: 14px; font: 400 12.5px/1 var(--mono); color: var(--ink-3); }
.step .api b { color: var(--thread); font-weight: 500; }
.specimen { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; font-size: 13px; line-height: 1.55; color: var(--ink-2); }
.specimen .row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; }
.specimen .row + .row { border-top: 1px solid var(--line); }
.specimen .row span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.specimen .mono-line { font: 400 12px/1.7 var(--mono); color: var(--ink-2); white-space: pre-wrap; word-break: break-word; }
.specimen .mono-line .k { color: var(--thread); }
.specimen .mask { display: inline-block; padding: 0 5px; border-radius: 4px; background: var(--ink); color: #fff; font: 500 11px/1.6 var(--mono); }
.bar { height: 6px; border-radius: 3px; background: var(--sunk); overflow: hidden; flex: 0 0 96px; }
.bar i { display: block; height: 100%; background: var(--ink); border-radius: 3px; }
@media (max-width: 900px) { .step { grid-template-columns: 48px minmax(0, 1fr); } .step .specimen { grid-column: 2; } }

/* Domains: one tab per kind of library; each shows how its pages are cut. */
.domains { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--surface); }
.domain { padding: 28px 26px 30px; display: flex; flex-direction: column; gap: 14px; }
.domain + .domain { border-left: 1px solid var(--line); }
.domain .glyph { font: 700 40px/1 var(--serif); color: var(--thread); }
.domain h3 { font: 600 17px/1.3 var(--sans); letter-spacing: -.01em; }
.domain p { color: var(--ink-2); font-size: 14.5px; text-wrap: pretty; }
.domain .cuts { margin-top: auto; display: flex; flex-wrap: wrap; gap: 6px; padding-top: 6px; }
@media (max-width: 1000px) { .domains { grid-template-columns: repeat(2, minmax(0, 1fr)); } .domain:nth-child(3) { border-left: 0; } .domain:nth-child(n + 3) { border-top: 1px solid var(--line); } }
@media (max-width: 560px) { .domains { grid-template-columns: 1fr; } .domain + .domain { border-left: 0; border-top: 1px solid var(--line); } }

/* Measured */
.figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-top: 1.5px solid var(--ink); }
.figure { padding: 28px 24px 8px 0; }
.figure + .figure { padding-left: 24px; border-left: 1px solid var(--line); }
.figure b { display: block; font: 700 64px/1 var(--serif); letter-spacing: -.02em; }
.figure b small { font-size: 28px; color: var(--ink-3); }
.figure span { display: block; margin-top: 14px; color: var(--ink-2); font-size: 14px; text-wrap: pretty; }
.figure sup, .notes sup, .bench sup { font: 500 10px/0 var(--mono); color: var(--thread); margin-left: 2px; }
@media (max-width: 900px) { .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); } .figure:nth-child(3) { padding-left: 0; border-left: 0; } .figure:nth-child(n + 3) { border-top: 1px solid var(--line); margin-top: 8px; } }
@media (max-width: 480px) { .figures { grid-template-columns: 1fr; } .figure + .figure { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); } }

.bench { margin-top: 56px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px; }
.bench-head { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: baseline; }
.bench-head h3 { font: 700 28px/1.2 var(--serif); }
.bench-head p { color: var(--ink-2); font-size: 14.5px; max-width: 46em; }
.table-wrap { margin-top: 20px; overflow-x: auto; }
.bench-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.bench-table th, .bench-table td { padding: 13px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.bench-table th { font: 500 12px/1.2 var(--sans); color: var(--ink-3); }
.bench-table tbody tr:last-child td { border-bottom: 0; }
.bench-table .n { text-align: right; font-variant-numeric: tabular-nums; }
.bench-table .best { color: var(--thread); font-weight: 600; }
.notes { margin-top: 28px; display: grid; gap: 6px; font-size: 12.5px; color: var(--ink-3); max-width: 900px; }
.notes code { font-size: 11.5px; background: var(--sunk); padding: 1px 5px; border-radius: 4px; }

/* Developers: a light terminal, not a dark band. */
.dev { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; }
.term { background: #1a1814; color: #ece7dd; border-radius: 16px; overflow: hidden; min-width: 0; }
.term-bar { display: flex; align-items: center; gap: 4px; padding: 10px 12px; border-bottom: 1px solid #2c2922; }
.term-bar button { appearance: none; border: 0; background: transparent; color: #9a9385; font: 500 12.5px/1 var(--mono); padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.term-bar button[aria-selected="true"] { background: #2c2922; color: #f4efe5; }
.term pre { margin: 0; padding: 20px 22px 24px; font: 400 13px/1.75 var(--mono); overflow-x: auto; min-height: 300px; }
.term .c { color: #7d766a; } .term .s { color: #e8b48a; } .term .k { color: #f08a72; } .term .f { color: #b7d3a8; }
.term pre[hidden] { display: none; }
.events { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; display: flex; flex-direction: column; min-width: 0; }
.events h3 { font: 600 14px/1.3 var(--sans); }
.events p { color: var(--ink-3); font-size: 13px; margin-top: 4px; }
.events ol { margin-top: 14px; display: grid; gap: 6px; font: 400 12px/1.5 var(--mono); }
.events li { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; padding: 7px 10px; border-radius: 8px; background: var(--sunk); color: var(--ink-2); opacity: .35; transition: opacity .35s, background .35s; }
.events li.lit { opacity: 1; }
.events li b { font-weight: 500; color: var(--ink); }
.events li.claims.lit { background: var(--ok-soft); }
.events li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dev-notes { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 4px; }
.dev-note { padding-top: 16px; border-top: 1px solid var(--line); }
.dev-note h3 { font: 600 15px/1.3 var(--sans); }
.dev-note p { margin-top: 6px; color: var(--ink-2); font-size: 14px; }
@media (max-width: 900px) { .dev { grid-template-columns: 1fr; } .dev-notes { grid-template-columns: 1fr; } }

/* FAQ */
.faq { max-width: 860px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 22px 0; font: 700 24px/1.25 var(--serif); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 300 26px/1 var(--sans); color: var(--ink-3); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); color: var(--thread); }
.faq .ans { padding: 0 0 24px; color: var(--ink-2); max-width: 44em; }

/* Closing */
.close { padding: 140px 0 120px; text-align: center; border-top: 1px solid var(--line); position: relative; overflow: hidden; }
.close::before { content: ""; position: absolute; left: 50%; top: 0; height: 88px; border-left: 1.5px dashed var(--thread); }
.close h2 { font-size: clamp(44px, 6vw, 80px); }
.close .lede { margin: 20px auto 0; max-width: 32em; }
.close .cta { margin-top: 36px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.close .mail { margin-top: 20px; font: 400 13px/1 var(--mono); color: var(--ink-3); }

.footer { border-top: 1px solid var(--line); padding: 40px 0 56px; font-size: 14px; color: var(--ink-3); }
.footer .wrap { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: center; }
.footer nav { display: flex; gap: 24px; flex-wrap: wrap; }
.footer a:hover { color: var(--ink); }
@media (max-width: 680px) { .hero .proof { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 24px; } }

/* Security: six safeguards in a ruled grid, no badges. */
.guards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1.5px solid var(--ink); }
.guard { padding: 24px 24px 28px 0; border-bottom: 1px solid var(--line); }
.guard:not(:nth-child(3n + 1)) { padding-left: 24px; border-left: 1px solid var(--line); }
.guard b { display: block; font: 700 18px/1.25 var(--serif); letter-spacing: -.01em; }
.guard b::before { content: ""; display: inline-block; width: 14px; margin-right: 10px; vertical-align: middle; border-top: 1.5px dashed var(--thread); }
.guard span { display: block; margin-top: 8px; color: var(--ink-2); font-size: 14.5px; text-wrap: pretty; }
@media (max-width: 900px) { .guards { grid-template-columns: 1fr; } .guard, .guard:not(:nth-child(3n + 1)) { padding: 20px 0; border-left: 0; } }

/* In use: a band between the sections where the products already running on AgentLex scroll past.
   The list is drawn twice so the loop has no seam; the copy is hidden from screen readers, and with
   reduced motion the band stands still and shows the list once. */
.inuse { display: flex; align-items: center; gap: 28px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); padding: 22px 0 22px 32px; overflow: hidden; }
.inuse-label { flex: none; font: 600 14px/1.3 var(--sans); color: var(--ink-2); padding-right: 28px; border-right: 1px solid var(--line); }
.inuse-window { flex: 1; min-width: 0; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 48px, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(90deg, transparent, #000 48px, #000 calc(100% - 48px), transparent); }
.inuse-track { display: flex; width: max-content; animation: inuse 32s linear infinite; }
.inuse:hover .inuse-track, .inuse:focus-within .inuse-track { animation-play-state: paused; }
.inuse-list { display: flex; flex: none; }
.inuse-list li { display: flex; align-items: baseline; gap: 10px; padding: 0 28px; white-space: nowrap; }
.inuse-list li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--thread); align-self: center; margin-right: 18px; }
.inuse-list strong { font: 700 20px/1.2 var(--serif); color: var(--ink); }
.inuse-list span { font: 400 14px/1.3 var(--mono); color: var(--ink-3); }
@keyframes inuse { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (max-width: 640px) {
  .inuse-window { width: 100%; }
  .inuse { flex-direction: column; align-items: flex-start; gap: 12px; padding: 18px 0 18px 20px; }
  .inuse-label { border-right: 0; padding-right: 0; }
  .inuse-list strong { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  .inuse-window { -webkit-mask-image: none; mask-image: none; }
  .inuse-track { width: auto; }
  .inuse-list { flex-wrap: wrap; row-gap: 10px; }
  .inuse-list[aria-hidden="true"] { display: none; }
}
