/* site.css -- the marketing surface: the landing page and the API reference.
 *
 * Loads after base.css and nav.css. It takes every colour, radius and shadow from
 * the tokens declared there, so this sheet contains no hex values at all and the
 * theme switch reaches it for free. What it does NOT take is app.css: that is the
 * planner's three-column layout, and none of it applies to a page someone reads.
 *
 * The one thing here that undoes an earlier rule is `min-width`, and it is called
 * out where it happens. Everything else is additive.
 */

/* ── Page ground ────────────────────────────────────────────────────────────────
 * base.css pins the body to 1200px because the planner genuinely needs that much
 * room -- a container viewport beside a sixteen-column item grid does not fold.
 * A marketing page has the opposite requirement: most of the people who read it
 * are holding a phone. This is scoped to the marketing body so the planner keeps
 * the floor it depends on.
 */
body.site {
  min-width: 0;
  font-size: 16px;
  line-height: 1.6;
}

/* The header is sticky, so an in-page anchor would otherwise land with its heading
   underneath it. */
html:has(body.site) {
  scroll-padding-top: calc(var(--header-h) + 16px);
}

/* Wrapped in :where() so every one of these carries zero specificity.
 *
 * Written as `body.site h2` first, and that was wrong: at (0,1,2) it outranked
 * `.footer-col h2` at (0,1,1), so the footer's 12px section labels rendered at the
 * page's 35px heading size and every nav and footer link came out accent blue.
 * Defaults should lose to anything that has an opinion, which is exactly what
 * :where() means -- so a component states its own size or colour and simply wins,
 * with no !important and no specificity arms race.
 */
:where(body.site) :is(h1, h2, h3, h4) {
  margin: 0;
  line-height: 1.15;
  letter-spacing: -.02em;
  font-weight: 720;
  text-wrap: balance;
}
:where(body.site) h1 {
  font-size: clamp(2.1rem, 1.3rem + 3.2vw, 3.4rem);
  letter-spacing: -.035em;
}
:where(body.site) h2 {
  font-size: clamp(1.55rem, 1.15rem + 1.5vw, 2.2rem);
}
:where(body.site) h3 {
  font-size: 1.125rem;
}
:where(body.site) h4 {
  font-size: 1rem;
}
:where(body.site) p {
  margin: 0 0 1em;
}
:where(body.site) p:last-child {
  margin-bottom: 0;
}
/* Links inherit rather than defaulting to the accent. Almost every anchor on these
   two pages is navigation or a button -- a nav bar in link blue reads as a page of
   links rather than a place. The ones that really are links in running prose are
   named below, and they get the colour *and* the underline, because inside a
   paragraph colour alone is not enough to find them. */
:where(body.site) a {
  color: inherit;
  text-decoration: none;
}
:where(body.site) :is(ul, ol) {
  margin: 0;
  padding: 0;
  list-style: none;
}

.doc-body p a,
.faq-answer a,
.footer-about p a,
.lede a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: .18em;
}

/* The one place a longer measure is wrong: body copy past ~70 characters a line
   costs the reader the return sweep. */
.lede {
  color: var(--muted);
  font-size: 1.0625rem;
  max-width: 62ch;
  text-wrap: pretty;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--primary);
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* Visible to a screen reader, absent to the eye. Used for the legends that name
   the two radio groups -- a role switch and a language switch both need a name,
   and neither wants a heading drawn above it. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 650;
  text-decoration: none;
  transition: top .12s ease;
}
.skip-link:focus-visible {
  top: 12px;
}

/* ── Layout ─────────────────────────────────────────────────────────────────── */
.wrap {
  width: min(1180px, 100% - 48px);
  margin-inline: auto;
}
.wrap.narrow {
  width: min(820px, 100% - 48px);
}

/* Vertical rhythm is the main tool this page has. Sections are far apart on
   purpose: the space is what tells a reader one idea has ended. */
.section {
  padding: clamp(64px, 8vw, 120px) 0;
}
.section.alt {
  background: var(--surface);
  border-block: 1px solid var(--line);
}
.section-head {
  max-width: 62ch;
  margin-bottom: clamp(36px, 4vw, 56px);
}
.section-head h2 {
  margin-bottom: 12px;
}

/* ── Buttons ────────────────────────────────────────────────────────────────────
 * base.css owns .btn and its variants. Only the large size is new, and it has to
 * out-specify .btn.ghost's own height -- same specificity, later sheet.
 */
.btn.lg {
  height: 52px;
  padding: 0 24px;
  font-size: 1rem;
  border-radius: 10px;
}
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 28px 0 14px;
}

/* ── Header ─────────────────────────────────────────────────────────────────────
 * The brand mark, the icon button and the theme toggle come from nav.css. What is
 * here is the bar itself, which is a different shape from the app's: a flex row
 * that collapses to a logo, a toggle and a menu button, rather than a fixed
 * three-column grid.
 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--float-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header-inner {
  width: min(1180px, 100% - 48px);
  margin-inline: auto;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 24px;
}
.site-header .brand {
  font-size: 20px;
  flex: none;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-inline-start: auto;
}
.site-nav-item {
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text-2);
  font-weight: 590;
  text-decoration: none;
}
.site-nav-item:hover {
  color: var(--primary);
  background: var(--primary-soft);
}
.site-nav-item.active {
  color: var(--primary);
}
.site-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.site-menu-toggle {
  display: none;
}

/* The narrow-viewport sheet. A real <dialog>, so Escape, the focus trap and the
   inert background are the browser's, not ours. */
.site-menu {
  width: min(420px, calc(100% - 24px));
  margin: 12px 12px 12px auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}
.site-menu::backdrop {
  background: var(--overlay-bg);
  backdrop-filter: blur(2px);
}
.site-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.site-menu-title {
  font-weight: 700;
}
.site-menu-nav {
  display: grid;
}
.site-menu-item {
  padding: 13px 8px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}
.site-menu-item:hover,
.site-menu-item.active {
  color: var(--primary);
}

/* ── Hero ───────────────────────────────────────────────────────────────────── */
.hero {
  padding: clamp(48px, 6vw, 96px) 0 clamp(56px, 7vw, 104px);
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.hero-copy h1 {
  margin-bottom: 20px;
}
.hero-copy .hint {
  margin: 0;
}
.hero-visual {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.hero-visual video {
  display: block;
  width: 100%;
  height: auto;
}

/* ── Single-column grids ────────────────────────────────────────────────────────
 * A `display: grid` with no template gets one implicit column sized `auto`, and a
 * grid item's `min-width` is `auto` -- which together mean the column grows to fit
 * its widest unbreakable content instead of to its container. A <pre> full of curl
 * flags is exactly that, so at 360px the API reference laid out to 668px and the
 * whole page scrolled sideways. `minmax(0, 1fr)` is the fix, and every stacking
 * grid on these two pages needs it, not just the one that showed the symptom.
 */
.checks,
.steps,
.faq-panel,
.way,
.way-flow,
.doc-steps,
.prompt-list,
.footer-col ul,
.doc-toc ul,
.site-menu-nav,
.quote-who {
  grid-template-columns: minmax(0, 1fr);
}

/* ── Shared pieces ──────────────────────────────────────────────────────────────
 * A sample of what someone would actually type or say. It is set apart from the
 * copy around it because it is a quotation from the product, not a claim about it.
 */
.quote-sample {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-inline-start: 2px solid var(--primary);
  background: var(--surface-3);
  border-radius: 0 8px 8px 0;
  color: var(--text-2);
  font-size: .9375rem;
}

.checks {
  display: grid;
  gap: 10px;
}
.checks li {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 10px;
  font-size: .9375rem;
  color: var(--text-2);
}
.checks .icon {
  margin-top: 3px;
  color: var(--green);
}

.note {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-inline-start: 2px solid var(--green);
  border-radius: 0 8px 8px 0;
  background: var(--green-soft);
  color: var(--green-ink);
  font-size: .9375rem;
}

/* Code is set on the sunken surface rather than a dark slab, so it belongs to the
   page in both themes instead of being a hole punched in it. */
.code {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: .8125rem;
  line-height: 1.6;
  tab-size: 2;
}
.code code {
  font: inherit;
  white-space: pre;
}

/* ── Features ───────────────────────────────────────────────────────────────── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}
.feature {
  padding: 24px;
}
.feature h3 {
  margin-bottom: 12px;
}
.feature p:last-child {
  color: var(--text-2);
  font-size: .9375rem;
  margin: 0;
}
.feature-icon {
  width: 42px;
  height: 42px;
  margin-bottom: 18px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--primary-soft);
  color: var(--primary);
}

/* ── Steps ──────────────────────────────────────────────────────────────────── */
.steps {
  display: grid;
  gap: clamp(48px, 6vw, 88px);
  counter-reset: step;
}
.step {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
}
/* Alternating sides, without a modifier class on every other item: which side the
   image sits on is a property of its position in the list, and the list already
   knows. */
.step:nth-child(even) .step-visual {
  order: 2;
}
.step-visual {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.step-visual img {
  display: block;
  width: 100%;
  height: auto;
}
.step-number {
  width: 34px;
  height: 34px;
  margin: 0 0 16px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  color: var(--primary);
  font-weight: 750;
  font-size: .9375rem;
}
.step-copy h3 {
  margin-bottom: 14px;
}
.step-copy p {
  color: var(--text-2);
}
.step-copy .checks {
  margin-top: 18px;
}

/* ── Video facade ───────────────────────────────────────────────────────────── */
.video-facade {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-3);
  aspect-ratio: 16 / 10;
}
.video-facade img,
.video-facade iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
}
.video-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 74px;
  height: 74px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-fill-1);
  color: var(--on-accent);
  box-shadow: 0 10px 30px var(--accent-glow-strong);
  transition: transform .12s ease, background-color .12s ease;
}
.video-play .icon {
  width: 30px;
  height: 30px;
  margin-inline-start: 4px;
  fill: currentColor;
  stroke: none;
}
.video-play:hover {
  background: var(--accent-fill-1h);
  transform: scale(1.06);
}

/* ── Three ways in ──────────────────────────────────────────────────────────── */
.ways {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 20px;
}
/* Equal heights, contents pinned to the top. Three cards of three different
   heights read as three unrelated things; three cards on one baseline read as
   three answers to the same question, which is what they are. */
.way {
  padding: 24px;
  display: grid;
  gap: 16px;
  align-content: start;
}
.way h3,
.way p {
  margin: 0;
}
.way-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--primary-soft);
  color: var(--primary);
}
.way-tagline {
  color: var(--muted);
  font-size: .9375rem;
  margin-top: -10px;
}
.way .quote-sample {
  margin: 0;
}
.way-flow {
  display: grid;
  gap: 8px;
  counter-reset: flow;
}
.way-flow li {
  counter-increment: flow;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: .9375rem;
}
.way-flow li::before {
  content: counter(flow);
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: .6875rem;
  font-weight: 750;
}
.way-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ── Pricing ────────────────────────────────────────────────────────────────── */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  align-items: stretch;
}
.plan {
  position: relative;
  padding: 26px 22px;
  display: flex;
  flex-direction: column;
}
/* The recommendation is made with a hairline and a badge, not with a scale
   transform: a card that grows shoves its neighbours' baselines out of alignment,
   and the row stops reading as a row of comparable things. */
.plan.popular {
  border-color: var(--primary);
}
.plan-badge {
  position: absolute;
  top: -11px;
  left: 22px;
  margin: 0;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--on-accent);
  font-size: .6875rem;
  font-weight: 750;
  letter-spacing: .02em;
}
.plan h3 {
  margin-bottom: 10px;
}
.plan-price {
  margin: 0 0 4px;
  font-size: 2.125rem;
  font-weight: 760;
  letter-spacing: -.03em;
}
.plan-price span {
  font-size: .875rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0;
}
.plan-trial {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: .8125rem;
}
/* No rule under the feature list. The button is pinned to the bottom of the
   tallest card, so on a short plan a divider drawn at the end of the list floats
   in the middle of the card separating nothing from nothing. Space does the job. */
.plan .checks {
  padding-bottom: 24px;
}
/* Pushes the button to the bottom of whichever card is tallest, so four buttons
   sit on one line however uneven the feature lists are. */
.plan .btn {
  margin-top: auto;
}

/* ── Testimonials ───────────────────────────────────────────────────────────── */
.quote-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}
.quote {
  margin: 0;
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.quote blockquote {
  margin: 0;
  flex: 1;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.62;
}
.quote blockquote::before {
  content: "";
  display: block;
  width: 26px;
  height: 2px;
  margin-bottom: 16px;
  background: var(--primary);
}
.quote figcaption {
  display: flex;
  align-items: center;
  gap: 12px;
}
/* Initials, not a photograph. The surface this replaces pointed three <img> tags
   at via.placeholder.com, a service that stopped resolving -- so every testimonial
   carried a broken image icon next to a real person's name. */
.monogram {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: .8125rem;
  font-weight: 750;
  letter-spacing: .04em;
}
.quote-who {
  display: grid;
  line-height: 1.35;
}
.quote-who strong {
  font-size: .9375rem;
}
.quote-who span {
  color: var(--muted);
  font-size: .8125rem;
}

/* ── FAQ ────────────────────────────────────────────────────────────────────────
 * A radio group and five rules, with no script anywhere near it. `:has()` reads
 * the checked radio from an ancestor, which is the whole mechanism.
 */
.faq-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 28px;
  padding: 0;
  border: 0;
}
.role-tab {
  display: inline-block;
  padding: 9px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font-size: .875rem;
  font-weight: 620;
  cursor: pointer;
  user-select: none;
}
.role-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
}
/* The radio is off-screen, so the ring has to be drawn on the label it controls or
   a keyboard user cannot see where they are. */
.role-radio:focus-visible + .role-tab {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
.role-radio:checked + .role-tab {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.faq-panel {
  display: none;
  gap: 10px;
}
.faq:has(#role-ecommerce:checked) .faq-panel[data-role='ecommerce'],
.faq:has(#role-warehouse:checked) .faq-panel[data-role='warehouse'],
.faq:has(#role-logistics:checked) .faq-panel[data-role='logistics'],
.faq:has(#role-integration:checked) .faq-panel[data-role='integration'],
.faq:has(#role-threepl:checked) .faq-panel[data-role='threepl'] {
  display: grid;
}
/* Nothing is checked on a cold load, because `checked` is a bare attribute and the
   template parser only fills attribute *values*. So the first panel is shown by
   styling the state where no choice has been made yet -- which is also the correct
   description of that state. */
.faq:not(:has(.role-radio:checked)) .faq-panel[data-role='ecommerce'] {
  display: grid;
}
.faq:not(:has(.role-radio:checked)) .role-tab[for='role-ecommerce'] {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}
/* Without :has() there is no switch, so showing everything is the honest fallback:
   fifteen questions in a column beats five and no way to reach the rest. */
@supports not selector(:has(*)) {
  .faq-panel {
    display: grid;
  }
  .faq-roles {
    display: none;
  }
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
}
.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  cursor: pointer;
  font-weight: 620;
  list-style: none;
}
.faq-item summary::-webkit-details-marker {
  display: none;
}
.faq-item summary:hover {
  color: var(--primary);
}
.faq-item summary .icon {
  flex: none;
  color: var(--muted);
  transition: transform .15s ease;
}
.faq-item[open] summary .icon {
  transform: rotate(180deg);
}
.faq-item[open] summary {
  border-bottom: 1px solid var(--line);
}
.faq-answer {
  padding: 16px 18px;
  color: var(--text-2);
  font-size: .9375rem;
}
.faq-answer p {
  margin: 0;
  max-width: 76ch;
}

/* ── Closing ────────────────────────────────────────────────────────────────── */
.closing {
  padding: clamp(64px, 8vw, 112px) 0;
  border-top: 1px solid var(--line);
  background: var(--surface);
  text-align: center;
}
.closing .lede {
  margin-inline: auto;
}
.closing h2 {
  margin-bottom: 14px;
}
.closing-checks {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 28px;
  margin: 28px 0 30px;
}
.closing-checks li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
  font-size: .9375rem;
}
.closing-checks .icon {
  color: var(--green);
}

/* ── Footer ─────────────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg);
  padding: clamp(48px, 5vw, 72px) 0 28px;
}
.site-footer-inner,
.site-footer-bottom {
  width: min(1180px, 100% - 48px);
  margin-inline: auto;
}
.site-footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px;
  padding-bottom: 32px;
}
.footer-about p {
  margin: 16px 0 0;
  max-width: 40ch;
  color: var(--muted);
  font-size: .9375rem;
}
.footer-col h2 {
  margin: 0 0 14px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.footer-col ul {
  display: grid;
  gap: 10px;
}
.footer-col a {
  color: var(--text-2);
  font-size: .9375rem;
  text-decoration: none;
}
.footer-col a:hover {
  color: var(--primary);
}
.footer-contact a {
  display: flex;
  align-items: center;
  gap: 9px;
}
.site-footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .8125rem;
}
.site-footer-bottom p {
  margin: 0;
}
.site-footer-bottom nav {
  display: flex;
  gap: 18px;
}
.site-footer-bottom a {
  color: var(--muted);
  text-decoration: none;
}
.site-footer-bottom a:hover {
  color: var(--primary);
}

/* ── The API reference ──────────────────────────────────────────────────────── */
.doc-head {
  padding: clamp(48px, 6vw, 84px) 0 clamp(28px, 3vw, 40px);
  border-bottom: 1px solid var(--line);
}
.doc-head h1 {
  margin-bottom: 16px;
}
.doc-grid {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: clamp(32px, 5vw, 64px);
  padding: clamp(40px, 5vw, 64px) 0 clamp(56px, 7vw, 96px);
  align-items: start;
}
.doc-toc {
  position: sticky;
  top: calc(var(--header-h) + 24px);
}
.doc-toc ul {
  display: grid;
  gap: 2px;
  border-inline-start: 1px solid var(--line);
}
.doc-toc a {
  display: block;
  padding: 7px 0 7px 14px;
  margin-inline-start: -1px;
  border-inline-start: 1px solid transparent;
  color: var(--text-2);
  font-size: .875rem;
  text-decoration: none;
}
.doc-toc a:hover {
  color: var(--primary);
  border-inline-start-color: var(--primary);
}
.doc-body > section {
  padding-bottom: clamp(40px, 5vw, 64px);
}
.doc-body > section + section {
  padding-top: clamp(40px, 5vw, 64px);
  border-top: 1px solid var(--line);
}
.doc-body h2 {
  margin-bottom: 20px;
}
.doc-body h3 {
  margin: 32px 0 14px;
}
.doc-body h4 {
  margin: 22px 0 10px;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.doc-body p {
  color: var(--text-2);
  max-width: 72ch;
}
.doc-body :is(h2, h3) + p {
  margin-top: -4px;
}

.doc-steps {
  display: grid;
  gap: 32px;
  counter-reset: doc-step;
}
.doc-steps > li {
  counter-increment: doc-step;
  padding-inline-start: 46px;
  position: relative;
}
.doc-steps > li::before {
  content: counter(doc-step);
  position: absolute;
  left: 0;
  top: -2px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  color: var(--primary);
  font-size: .8125rem;
  font-weight: 750;
}
.doc-steps h3 {
  margin: 0 0 10px;
}

.endpoint-line {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.method {
  padding: 5px 10px;
  border-radius: 6px;
  background: var(--green-soft);
  color: var(--green-ink);
  font-size: .75rem;
  font-weight: 750;
  letter-spacing: .06em;
}
.endpoint-line code {
  padding: 5px 10px;
  border-radius: 6px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: .875rem;
}

/* A table is the right shape for a field reference and the wrong shape for a
   360px viewport, so it scrolls inside its own box rather than widening the page. */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.doc-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: .875rem;
}
.doc-table th,
.doc-table td {
  padding: 11px 14px;
  text-align: start;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.doc-table thead th {
  background: var(--surface-2);
  color: var(--muted);
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.doc-table tbody tr:last-child :is(th, td) {
  border-bottom: 0;
}
.doc-table td {
  color: var(--text-2);
}
.doc-table code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: .8125rem;
  color: var(--text);
}
.doc-table code.status {
  color: var(--primary);
  font-weight: 700;
}

.prompt-list {
  display: grid;
  gap: 8px;
}
.prompt-list li {
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}
.prompt-list code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: .8125rem;
  color: var(--text-2);
}

.code-block {
  position: relative;
  margin: 14px 0;
}
/* Added by script, so a page whose bundle never arrived does not show a button
   that cannot do anything. */
.code-copy {
  position: absolute;
  top: 8px;
  right: 8px;
  height: 28px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text-2);
  font-size: .6875rem;
  font-weight: 650;
  opacity: 0;
  transition: opacity .12s ease, color .12s ease, border-color .12s ease;
}
.code-block:hover .code-copy,
.code-copy:focus-visible {
  opacity: 1;
}
.code-copy:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.code-copy.done {
  opacity: 1;
  border-color: var(--green);
  color: var(--green-ink);
}
@media (hover: none) {
  .code-copy {
    opacity: 1;
  }
}

.lang-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
  padding: 0;
  border: 0;
}
.lang-tab {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-2);
  font-size: .875rem;
  font-weight: 620;
  cursor: pointer;
  user-select: none;
}
.lang-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.lang-radio:focus-visible + .lang-tab {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
.lang-radio:checked + .lang-tab {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}
.lang-panel {
  display: none;
}
.langs:has(#lang-js:checked) .lang-panel[data-lang='js'],
.langs:has(#lang-py:checked) .lang-panel[data-lang='py'],
.langs:has(#lang-cs:checked) .lang-panel[data-lang='cs'],
.langs:has(#lang-java:checked) .lang-panel[data-lang='java'] {
  display: block;
}
.langs:not(:has(.lang-radio:checked)) .lang-panel[data-lang='js'] {
  display: block;
}
.langs:not(:has(.lang-radio:checked)) .lang-tab[for='lang-js'] {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}
@supports not selector(:has(*)) {
  .lang-panel {
    display: block;
  }
  .lang-tabs {
    display: none;
  }
}

.doc-cta {
  text-align: center;
}
.doc-cta h2 {
  margin-bottom: 12px;
}
.doc-cta p {
  margin-inline: auto;
  margin-bottom: 24px;
}

/* ── Narrow ─────────────────────────────────────────────────────────────────────
 * Wide first, then narrow, matching the order the rest of the project uses.
 */
@media (max-width: 1000px) {
  .doc-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .doc-toc {
    position: static;
  }
  .doc-toc ul {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border-inline-start: 0;
  }
  .doc-toc a {
    padding: 7px 12px;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 999px;
  }
  .site-footer-inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .footer-about {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .wrap,
  .wrap.narrow,
  .site-header-inner,
  .site-footer-inner,
  .site-footer-bottom {
    width: min(100% - 32px, 720px);
  }
  /* The nav bar and the standalone Get-started button both fold into the sheet;
     keeping either would leave the header with three competing controls on a
     viewport that has room for one. */
  .site-nav,
  .site-cta {
    display: none;
  }
  .site-menu-toggle {
    display: grid;
  }
  .site-header-actions {
    margin-inline-start: auto;
  }
  .hero-grid,
  .step {
    grid-template-columns: minmax(0, 1fr);
  }
  /* Every step reads image-then-copy once they stack, whatever side it took when
     they sat beside each other. */
  .step:nth-child(even) .step-visual {
    order: 0;
  }
  .hero-copy {
    text-align: start;
  }
}

@media (max-width: 560px) {
  body.site {
    font-size: 15px;
  }
  .cta-row .btn {
    width: 100%;
  }
  .site-footer-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }
  .video-play {
    width: 58px;
    height: 58px;
  }
  .video-play .icon {
    width: 24px;
    height: 24px;
  }
  .doc-steps > li {
    padding-inline-start: 0;
  }
  .doc-steps > li::before {
    position: static;
    margin-bottom: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html:has(body.site) {
    scroll-behavior: auto;
  }
  .video-play,
  .faq-item summary .icon,
  .skip-link,
  .code-copy {
    transition: none;
  }
  .video-play:hover {
    transform: none;
  }
}
/* The hero loop is the one piece of motion CSS cannot stop -- `animation` rules do
   not reach video playback -- so site.js pauses it and gives the controls back. */
