:root {
  --bg: #e9eeea;
  --paper: #f7f9f7;
  --ink: #13232a;
  --muted: #56676c;
  --line: #c9d3cf;
  --teal: #0d5560;
  --teal-soft: #d4e4e3;
  --marker: #f3cf3e;
  --display: "Bricolage Grotesque", "Avenir Next", system-ui, sans-serif;
  --body: "Source Serif 4", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --measure: 66ch;
  --gutter: clamp(16px, 4vw, 48px);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--body);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--teal); text-underline-offset: 0.18em; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; border-radius: 2px; }
code { font-family: var(--mono); font-size: 0.88em; }

h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.05; margin: 0; }
h2 { font-size: clamp(2rem, 4.6vw, 3.4rem); font-variation-settings: "wdth" 85; letter-spacing: -0.02em; max-width: 18ch; }
h3 { font-size: 1.25rem; letter-spacing: -0.01em; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--gutter); top: 12px; background: var(--paper); padding: 8px 12px; z-index: 10; }

.button {
  display: inline-block;
  font: 600 1rem/1 var(--display);
  background: var(--ink);
  color: var(--paper);
  padding: 0.95em 1.4em;
  border-radius: 999px;
  text-decoration: none;
}
.button:hover { background: var(--teal); }
.button--small { font-size: 0.9rem; padding: 0.7em 1.1em; }

/* ---------- header */
.top {
  display: flex; align-items: center; gap: 24px;
  padding: 20px var(--gutter);
  max-width: 1240px; margin: 0 auto;
}
.wordmark {
  display: inline-flex; align-items: center; gap: 10px;
  font: 800 1.4rem/1 var(--display); color: var(--ink); text-decoration: none; letter-spacing: -0.02em;
}
.wordmark svg { width: 26px; height: 26px; fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.wordmark circle { fill: var(--marker); stroke: none; }
.top nav { display: flex; gap: 22px; margin-left: auto; font: 500 0.95rem/1 var(--display); }
.top nav a { color: var(--ink); text-decoration: none; }
.top nav a:hover { color: var(--teal); text-decoration: underline; }
@media (max-width: 760px) { .top nav { display: none; } .top .button { margin-left: auto; } }

/* ---------- hero: the conversation */
.hero { max-width: 1240px; margin: 0 auto; padding: clamp(32px, 7vw, 96px) var(--gutter) 48px; }
.hero__who, .answer__who {
  font: 600 0.95rem/1 var(--display); color: var(--muted); margin: 0 0 18px;
}
.hero__question {
  font-size: clamp(2.6rem, 7.6vw, 6.4rem);
  font-weight: 750;
  font-variation-settings: "wdth" 78, "opsz" 96;
  letter-spacing: -0.035em;
  line-height: 0.98;
  max-width: 18ch;
  min-height: 2em;
}
.hero__question .caret {
  display: inline-block; width: 0.08em; height: 0.82em; margin-left: 0.04em;
  background: var(--teal); vertical-align: -0.06em; animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.answer {
  margin-top: clamp(32px, 5vw, 56px);
  margin-left: clamp(0px, 14vw, 220px);
  max-width: 760px;
  background: var(--paper);
  border-left: 4px solid var(--teal);
  padding: clamp(20px, 3vw, 32px);
  transition: opacity 0.35s ease;
}
.answer.is-thinking { opacity: 0.35; }

.trace { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 20px; font: 500 0.9rem/1.4 var(--display); color: var(--muted); }
.trace li { position: relative; padding-left: 18px; }
.trace li::before { content: ""; position: absolute; left: 0; top: 0.45em; width: 9px; height: 9px; border-radius: 50%; background: var(--teal); }

.sql summary { cursor: pointer; font: 600 0.9rem/1.4 var(--display); color: var(--teal); width: max-content; }
.sql pre { margin: 10px 0 0; padding: 14px 16px; background: var(--ink); color: #dfe9e6; overflow-x: auto; font-size: 0.85rem; line-height: 1.6; border-radius: 4px; }

.table-wrap { overflow-x: auto; margin: 18px 0; }
table { border-collapse: collapse; width: 100%; font: 400 0.95rem/1.4 var(--display); }
th { text-align: left; font-weight: 600; color: var(--muted); border-bottom: 2px solid var(--ink); padding: 8px 12px 8px 0; }
td { padding: 9px 12px 9px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
tr.hit td { background: linear-gradient(transparent 18%, var(--marker) 18%, var(--marker) 84%, transparent 84%); }
tr.hit td:first-child { padding-left: 6px; }
.answer__text { margin: 0; max-width: var(--measure); font-size: 1.1rem; }

.ask { margin-top: clamp(40px, 6vw, 72px); }
.ask > p { font: 600 0.95rem/1 var(--display); color: var(--muted); margin: 0 0 14px; }
.ask__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.ask__list button {
  font: 500 0.98rem/1.3 var(--display); color: var(--ink); text-align: left;
  background: transparent; border: 1.5px solid var(--ink); border-radius: 999px; padding: 0.6em 1.05em; cursor: pointer;
}
.ask__list button:hover { background: var(--paper); }
.ask__list button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* ---------- sections */
main > section:not(.hero) { max-width: 1240px; margin: 0 auto; padding: clamp(56px, 9vw, 120px) var(--gutter); }
.section-intro { max-width: var(--measure); color: var(--muted); font-size: 1.15rem; margin: 18px 0 0; }

.lead { border-top: 1px solid var(--line); }
.lead p { font-size: clamp(1.35rem, 2.6vw, 2rem); line-height: 1.35; max-width: 34ch; margin: 0; font-weight: 400; }

/* how: a real five-step sequence */
main > section.how {
  background: var(--ink); color: var(--paper); max-width: none;
  padding-inline: max(var(--gutter), calc((100% - 1240px) / 2 + var(--gutter)));
}
.how .section-intro { color: #b9c8c5; }
.how h2 { max-width: none; }
.steps { list-style: none; counter-reset: step; padding: 0; margin-top: 56px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; }
.steps li { counter-increment: step; padding: 0 22px 0 0; border-top: 2px solid #3b4f55; padding-top: 18px; position: relative; }
.steps li::before {
  content: counter(step); display: block;
  font: 800 3.4rem/1 var(--display); font-variation-settings: "wdth" 75; color: #3b4f55; margin-bottom: 14px;
}
.steps h3 { margin: 10px 0 8px; }
.steps p { margin: 0; color: #c4d1ce; font-size: 0.98rem; }
.steps code { color: var(--marker); }
.who { font: 600 0.8rem/1 var(--display); padding: 0.3em 0.6em; border-radius: 3px; }
.who--model { background: var(--marker); color: var(--ink); }
.who--code { background: transparent; color: var(--paper); box-shadow: inset 0 0 0 1.5px #8fb3b0; }
@media (max-width: 980px) {
  .steps { grid-template-columns: 1fr; gap: 28px; }
  .steps li { display: grid; grid-template-columns: 64px 1fr; column-gap: 12px; padding-right: 0; }
  .steps li::before { grid-row: span 3; font-size: 2.6rem; }
  .steps .who { justify-self: start; }
}

/* where: the request path */
.map {
  margin: 48px 0 0; display: grid; grid-template-columns: 0.7fr 1.3fr 2fr; gap: 14px; align-items: stretch;
}
.map__lane { padding: 18px; border-radius: 6px; display: flex; flex-direction: column; gap: 10px; position: relative; }
.map__lane--you { background: var(--paper); }
.map__lane--edge { background: var(--teal-soft); }
.map__lane--account { background: var(--paper); box-shadow: inset 0 0 0 2px var(--teal); display: grid; grid-template-columns: 1fr 1fr; align-content: start; }
.map__lane--account .map__label, .map__lane--account .map__key { grid-column: 1 / -1; }
.map__label { margin: 0 0 4px; font: 700 1rem/1.2 var(--display); }
.map__key { margin: 6px 0 0; font: 500 0.88rem/1.3 var(--display); color: var(--teal); }
.node { background: #fff; border: 1.5px solid var(--ink); border-radius: 4px; padding: 10px 12px; font: 600 1rem/1.2 var(--display); }
.node small { display: block; font-weight: 400; font-size: 0.82rem; color: var(--muted); margin-top: 3px; }
.node--strong { background: var(--ink); color: var(--paper); }
.node--strong small { color: #b9c8c5; }
.map__lane + .map__lane::before {
  content: ""; position: absolute; left: -12px; top: 50%; width: 10px; height: 10px;
  border-top: 2px solid var(--ink); border-right: 2px solid var(--ink); transform: translateY(-50%) rotate(45deg);
}
@media (max-width: 900px) {
  .map { grid-template-columns: 1fr; gap: 22px; }
  .map__lane + .map__lane::before { left: 50%; top: -17px; transform: translateX(-50%) rotate(135deg); }
}

/* trust */
.claims { margin: 48px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 56px; }
.claims > div { border-top: 2px solid var(--ink); padding: 18px 0 30px; }
.claims dt { font: 700 1.35rem/1.15 var(--display); margin-bottom: 8px; }
.claims dd { margin: 0; color: var(--muted); max-width: 52ch; }
@media (max-width: 760px) { .claims { grid-template-columns: 1fr; } }

/* sources */
.sources { border-top: 1px solid var(--line); }
.source-list { list-style: none; padding: 0; margin: 32px 0 0; }
.source-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 24px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.source-list strong { font: 700 clamp(1.4rem, 3vw, 2.2rem)/1.1 var(--display); font-variation-settings: "wdth" 82; min-width: 9ch; }
.source-list span { color: var(--muted); }
.source-list .soon strong { color: var(--muted); }

/* start */
.timeline { list-style: none; counter-reset: t; padding: 0; margin: 40px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.timeline li { counter-increment: t; }
.timeline li::before { content: counter(t); display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--teal); color: var(--paper); font: 700 1rem/1 var(--display); margin-bottom: 14px; }
.timeline p { margin: 6px 0 0; color: var(--muted); }
@media (max-width: 860px) { .timeline { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .timeline { grid-template-columns: 1fr; } }

.cta { margin-top: 72px; display: flex; flex-wrap: wrap; align-items: center; gap: 20px 32px; padding: 32px; background: var(--marker); border-radius: 6px; }
.cta p { margin: 0; font: 700 clamp(1.4rem, 3vw, 2rem)/1.15 var(--display); max-width: 24ch; }
.cta .button { margin-left: auto; }

.foot { max-width: 1240px; margin: 0 auto; padding: 32px var(--gutter) 48px; color: var(--muted); font-size: 0.95rem; border-top: 1px solid var(--line); }
