/*
 * aisense.css - shared styling for the aisense.no documentation pages.
 *
 * Palette and typography taken from the live site's Astra/Elementor globals so
 * these standalone pages sit alongside the WordPress ones without looking like
 * a different property:
 *
 *   --e-global-color-astglobalcolor0  #046bd2   primary
 *   --e-global-color-astglobalcolor1  #045cb4   primary, darker
 *   --e-global-color-astglobalcolor2  #1e293b   headings
 *   --e-global-color-astglobalcolor3  #334155   body text
 *   --e-global-color-astglobalcolor4  #F0F5FA   tinted background
 *   --e-global-color-astglobalcolor6  #D1D5DB   borders
 *   --e-global-color-astglobalcolor7  #111111   near black
 *
 * Fonts are Roboto and Roboto Slab, matching the site. They are referenced by
 * name only - no webfont is fetched, so these pages carry no third-party
 * requests and work offline. Visitors without Roboto installed fall back to
 * the system sans, which is close enough not to matter.
 */

:root {
  --blue:        #046bd2;
  --blue-dark:   #045cb4;
  --ink:         #1e293b;
  --body:        #334155;
  --tint:        #f0f5fa;
  --border:      #d1d5db;
  --near-black:  #111111;
  --muted:       #64748b;
  --code-bg:     #1e293b;
  --code-fg:     #e2e8f0;
  --warn-bg:     #fffbeb;
  --warn-border: #f59e0b;

  --sans:  Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Oxygen-Sans, Ubuntu, Cantarell, Helvetica, Arial, sans-serif;
  --slab:  "Roboto Slab", Georgia, "Times New Roman", serif;
  --mono:  ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  color: var(--body);
  background: #fff;
}

/* Anchored headings must not hide under the sticky header when linked to. */
:target { scroll-margin-top: 90px; }

a { color: var(--blue); text-decoration: none; }
a:hover, a:focus { color: var(--blue-dark); text-decoration: underline; }
a:focus-visible, button:focus-visible { outline: 3px solid rgba(4, 107, 210, 0.35); outline-offset: 3px; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 4px;
  background: var(--near-black);
  color: #fff;
  transform: translateY(-150%);
}
.skip-link:focus { color: #fff; transform: translateY(0); }

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.site-header .inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}

/*
 * Wordmark as text. Swap in the real logo file when you drop it into
 * web/assets/ - replace the <span> with <img src="assets/logo.svg" alt="AI SENSE">.
 */
.wordmark {
  font-family: var(--sans);
  font-weight: 900;
  font-style: italic;
  font-size: 26px;
  letter-spacing: -0.02em;
  color: #d6202e;
  text-decoration: none;
  white-space: nowrap;
}
.wordmark:hover { color: #d6202e; text-decoration: none; }

.site-nav {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-left: auto;
}
.site-nav a { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--blue); }

/* Layout */

main { max-width: 1180px; margin: 0 auto; padding: 0 24px 80px; }

.hero { padding: 48px 0 8px; border-bottom: 1px solid var(--border); margin-bottom: 40px; }

h1 {
  font-family: var(--slab);
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.2;
  color: var(--ink);
  margin: 0 0 16px;
  font-weight: 700;
}

.lede { font-size: 19px; color: var(--body); max-width: 68ch; margin: 0 0 20px; }

.badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 28px; padding: 0; list-style: none; }
.badges li {
  font-size: 13px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--tint);
  color: var(--blue-dark);
  border: 1px solid var(--border);
}

h2 {
  font-family: var(--slab);
  font-size: 28px;
  color: var(--ink);
  margin: 56px 0 8px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--blue);
  font-weight: 700;
}

h3 {
  font-family: var(--sans);
  font-size: 20px;
  color: var(--ink);
  margin: 36px 0 6px;
  font-weight: 600;
}

h4 { font-family: var(--sans); font-size: 16px; color: var(--ink); margin: 22px 0 6px; font-weight: 600; }

p { margin: 0 0 16px; max-width: 74ch; }

/* Login page */

.login-page {
  background:
    radial-gradient(circle at 18% 18%, rgba(4, 107, 210, 0.11), transparent 28rem),
    linear-gradient(180deg, #f8fbff 0, #fff 38rem);
}

.login-main { padding-bottom: 90px; }

.login-shell {
  min-height: 650px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.78fr);
  align-items: center;
  gap: clamp(52px, 9vw, 120px);
  padding: 78px 0;
}

.login-intro h1 {
  max-width: 620px;
  font-size: clamp(42px, 5.5vw, 68px);
  letter-spacing: -0.04em;
}

.login-intro .lede { max-width: 580px; }

.login-benefits {
  display: grid;
  gap: 10px;
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
}

.login-benefits li {
  position: relative;
  padding-left: 22px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
}

.login-benefits li::before {
  content: "";
  position: absolute;
  top: 0.72em;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
}

.login-card {
  padding: clamp(28px, 4vw, 42px);
  border: 1px solid var(--border);
  border-top: 4px solid var(--blue);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(30, 41, 59, 0.14);
}

.login-card-header { margin-bottom: 28px; }
.login-card-header h2 { margin: 0 0 8px; padding: 0; border: 0; font-size: 30px; }
.login-card-header p:last-child { margin-bottom: 0; color: var(--muted); font-size: 15px; }

.login-form { display: grid; gap: 20px; }
.form-field { display: grid; gap: 8px; }
.form-field label { color: var(--ink); font-size: 14px; font-weight: 700; }
.field-label-row { display: flex; justify-content: space-between; gap: 20px; align-items: baseline; }
.field-label-row span { color: var(--muted); font-size: 12px; }

.form-field input {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f8fafc;
  color: var(--body);
  font: inherit;
  font-size: 15px;
}

.form-field input:disabled { cursor: not-allowed; opacity: 1; }
.login-button { width: 100%; justify-content: center; margin-top: 2px; }
.login-button:disabled { cursor: not-allowed; opacity: 0.55; }

.login-status {
  margin-top: 25px;
  padding: 16px 18px;
  border-left: 4px solid var(--blue);
  border-radius: 0 6px 6px 0;
  background: var(--tint);
  font-size: 14px;
}

.login-status strong { display: block; color: var(--ink); }
.login-status p { margin: 3px 0 0; }

.login-help {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  padding: 34px 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--tint);
}

.login-help h2 { margin: 0 0 8px; padding: 0; border: 0; font-size: 27px; }
.login-help p:last-child { margin-bottom: 0; }
.login-help .button { flex: 0 0 auto; }

/* Home page */

.home-page {
  background:
    radial-gradient(circle at 78% 7%, rgba(4, 107, 210, 0.08), transparent 28rem),
    #fff;
}

.home-page main { overflow: hidden; }

.home-hero {
  min-height: 650px;
  padding: 92px 0 82px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(380px, 0.95fr);
  align-items: center;
  gap: clamp(48px, 8vw, 110px);
}

.eyebrow {
  margin: 0 0 17px;
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.home-hero h1 {
  max-width: 760px;
  margin-bottom: 25px;
  font-size: clamp(48px, 6.8vw, 82px);
  letter-spacing: -0.045em;
}

.home-hero h1 span { color: var(--blue); }

.home-intro {
  max-width: 650px;
  margin-bottom: 31px;
  font-size: clamp(18px, 2vw, 21px);
  line-height: 1.65;
}

.button-row { display: flex; align-items: center; flex-wrap: wrap; gap: 13px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}
.button:hover { text-decoration: none; transform: translateY(-1px); }
.button-primary { background: var(--blue); color: #fff; }
.button-primary:hover, .button-primary:focus { background: var(--blue-dark); color: #fff; }
.button-secondary { border-color: var(--border); background: #fff; color: var(--ink); }
.button-secondary:hover, .button-secondary:focus { border-color: var(--blue); color: var(--blue-dark); }
.button-light { background: #fff; color: var(--blue-dark); }
.button-light:hover, .button-light:focus { background: var(--tint); color: var(--blue-dark); }

.proof-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.proof-list li::before { content: ""; display: inline-block; width: 7px; height: 7px; margin: 0 9px 1px 0; border-radius: 50%; background: #059669; }

.api-window {
  position: relative;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  overflow: hidden;
  background: var(--code-bg);
  color: var(--code-fg);
  box-shadow: 0 26px 70px rgba(30, 41, 59, 0.22);
  transform: rotate(1.25deg);
}
.api-window::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: inherit;
  box-shadow: 24px 24px 0 var(--tint);
}
.api-window-bar {
  min-height: 47px;
  padding: 0 17px;
  display: flex;
  align-items: center;
  gap: 7px;
  border-bottom: 1px solid rgba(255,255,255,0.09);
  background: rgba(255,255,255,0.04);
}
.api-window-bar > span { width: 10px; height: 10px; border-radius: 50%; background: #fb7185; }
.api-window-bar > span:nth-child(2) { background: #fbbf24; }
.api-window-bar > span:nth-child(3) { background: #34d399; }
.api-window-bar p { margin: 0 0 0 auto; color: #94a3b8; font-family: var(--mono); font-size: 11px; }
.api-window-body { padding: clamp(25px, 4vw, 42px); }
.api-window-body > code { display: block; margin-bottom: 34px; color: #fff; font-size: 13px; word-break: break-all; }
.api-label { display: inline-block; margin-bottom: 10px; color: #7dd3fc; font-family: var(--mono); font-size: 11px; font-weight: 800; letter-spacing: 0.09em; }
.api-response { font-family: var(--mono); font-size: 13px; line-height: 1.9; }
.code-key { color: #7dd3fc; }
.code-value { color: #86efac; }
.api-status { margin: 34px 0 0; color: #94a3b8; font-size: 12px; }
.api-status span { display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 4px rgba(52,211,153,0.12); }

.home-section { padding: 93px 0 106px; border-top: 1px solid var(--border); }
.section-heading { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 0.65fr); gap: 18px 80px; align-items: end; margin-bottom: 43px; }
.section-heading .eyebrow { grid-column: 1 / -1; margin-bottom: 0; }
.section-heading h2, .principles h2, .feed-feature h2, .home-cta h2 { border: 0; padding: 0; margin: 0; }
.section-heading h2 { max-width: 720px; font-size: clamp(33px, 4.4vw, 50px); line-height: 1.17; }
.section-heading > p:last-child { margin: 0; color: var(--muted); }

.service-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.service-card {
  min-height: 390px;
  padding: 31px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(255,255,255,0.82);
}
.service-card-featured { border-top: 4px solid var(--blue); padding-top: 28px; }
.card-number { margin: 0 0 48px; color: var(--blue); font-family: var(--mono); font-size: 13px; font-weight: 700; }
.card-kicker { margin: 0 0 10px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; }
.service-card h3 { margin: 0 0 15px; font-family: var(--slab); font-size: 26px; line-height: 1.25; }
.service-card > p:not(.card-number):not(.card-kicker) { color: var(--muted); font-size: 15px; line-height: 1.65; }
.card-link { margin-top: auto; padding-top: 22px; font-size: 14px; font-weight: 700; }
.card-link span, .text-link span { display: inline-block; transition: transform 160ms ease; }
.card-link:hover span, .text-link:hover span { transform: translateX(4px); }

.principles {
  margin: 0 -100vw;
  padding: 92px 100vw;
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(380px, 1.1fr);
  gap: clamp(55px, 9vw, 130px);
  background: var(--tint);
}
.principles h2 { font-size: clamp(32px, 4vw, 47px); line-height: 1.18; }
.principle-list article { padding: 0 0 25px 38px; border-left: 1px solid var(--border); }
.principle-list article + article { padding-top: 25px; border-top: 1px solid var(--border); }
.principle-list h3 { margin: 0 0 7px; font-size: 19px; }
.principle-list p { margin: 0; color: var(--muted); font-size: 15px; }

.feed-feature {
  margin: 100px 0;
  padding: clamp(40px, 6vw, 70px);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.75fr);
  gap: 55px;
  align-items: end;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, #034f9d, #046bd2 58%, #1186dd);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.16);
}
.feed-feature .eyebrow { color: #bae6fd; }
.feed-feature h2 { color: #fff; font-size: clamp(34px, 5vw, 56px); line-height: 1.14; }
.feed-feature > div:last-child p { color: #e0f2fe; }

.home-cta { padding: 39px 0 116px; text-align: center; }
.home-cta .eyebrow, .home-cta > p { margin-left: auto; margin-right: auto; }
.home-cta h2 { margin-bottom: 17px; font-size: clamp(35px, 5vw, 55px); }
.home-cta > p:not(.eyebrow) { max-width: 620px; color: var(--muted); font-size: 18px; }
.button-row-centered { justify-content: center; margin-top: 28px; }
.text-link { padding: 11px 8px; font-size: 15px; font-weight: 700; }

/* Posts and articles */

.posts-hero {
  padding: 82px 0 52px;
  border-bottom: 1px solid var(--border);
}
.posts-hero h1 { font-size: clamp(45px, 6vw, 68px); }
.posts-hero .lede { max-width: 760px; }

/* Grid gap rather than margin-bottom on the cards: no trailing margin after
   the last card, and one number to tune. 32px, not 8 - the card shadow blurs
   45px, so tighter spacing makes neighbouring shadows overlap. */
.post-list { padding: 65px 0 92px; display: grid; gap: 32px; }

/* A text-only card (no image) spans the full card width instead of sitting
   in the image column beside an empty cell, and drops the image-driven
   height. */
.post-card > .post-card-body:only-child { grid-column: 1 / -1; }
.post-card:has(> .post-card-body:only-child) { min-height: 0; }

.post-card {
  display: grid;
  grid-template-columns: minmax(330px, 1.08fr) minmax(320px, 0.92fr);
  min-height: 455px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 16px 45px rgba(30, 41, 59, 0.08);
}
.post-card-image { display: block; min-height: 380px; overflow: hidden; background: var(--tint); }
.post-card-image img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform 300ms ease; }
.post-card-image:hover img { transform: scale(1.02); }
.post-card-body { padding: clamp(32px, 5vw, 62px); display: flex; flex-direction: column; justify-content: center; }
.post-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0 0 18px; color: var(--muted); font-size: 12px; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; }
.post-meta span { color: var(--blue-dark); }
.post-card h2 { margin: 0 0 17px; padding: 0; border: 0; font-size: clamp(29px, 4vw, 39px); line-height: 1.18; }
.post-card h2 a { color: var(--ink); }
.post-card h2 a:hover { color: var(--blue-dark); text-decoration: none; }
.post-card-body > p:not(.post-meta) { color: var(--muted); }
.post-card .card-link { margin-top: 18px; }

.posts-cta { max-width: 760px; margin: 0 auto; padding: 20px 0 110px; text-align: center; }
.posts-cta .eyebrow, .posts-cta > p { margin-left: auto; margin-right: auto; }
.posts-cta h2 { margin: 0 0 15px; padding: 0; border: 0; font-size: clamp(32px, 4.5vw, 48px); }
.posts-cta > p:not(.eyebrow) { margin-bottom: 27px; color: var(--muted); }

.article-main { padding-bottom: 110px; }
.breadcrumbs { padding: 28px 0 0; color: var(--muted); font-size: 13px; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 7px; margin: 0; padding: 0; list-style: none; }
.breadcrumbs li + li::before { content: "/"; margin-right: 7px; color: var(--border); }
.breadcrumbs li[aria-current="page"] { color: var(--body); }

.article-shell { margin-top: 65px; }
.article-header { max-width: 920px; margin: 0 auto 48px; text-align: center; }
.article-header .eyebrow { margin-left: auto; margin-right: auto; }
.article-header h1 { margin-bottom: 24px; font-size: clamp(43px, 6.4vw, 72px); letter-spacing: -0.035em; }
.article-deck { max-width: 790px; margin: 0 auto 24px; color: var(--body); font-size: clamp(18px, 2.2vw, 22px); line-height: 1.6; }
.article-header .post-meta { justify-content: center; }

.article-figure { margin: 0 0 65px; }
.article-figure img { width: 100%; height: auto; display: block; border-radius: 10px; box-shadow: 0 18px 50px rgba(30, 41, 59, 0.12); }
.article-figure figcaption { margin-top: 10px; color: var(--muted); font-size: 12px; }

.article-body { max-width: 800px; margin: 0 auto; }
.article-body > p { max-width: none; }
.article-lead { margin-bottom: 35px !important; color: var(--ink); font-size: 20px; line-height: 1.75; }
.article-body h2 { margin-top: 62px; }

.connection-list { margin: 30px 0 15px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.connection-list article { padding: 23px; border: 1px solid var(--border); border-radius: 7px; background: var(--tint); }
.connection-list article:last-child { grid-column: 1 / -1; }
.connection-list h3 { margin: 0 0 6px; font-size: 18px; }
.connection-list p:last-child { margin: 0; color: var(--muted); font-size: 14px; }
.port-label { margin: 0 0 8px; color: var(--blue-dark); font-family: var(--mono); font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }

.article-cta { margin-top: 70px; padding: clamp(28px, 5vw, 48px); border-radius: 9px; background: var(--tint); border-top: 4px solid var(--blue); }
.article-cta h2 { margin: 0 0 12px; padding: 0; border: 0; font-size: clamp(27px, 4vw, 37px); }
.article-cta .text-link { color: var(--blue-dark); }

/* API detail and topic pages */

.api-detail-main { padding-bottom: 110px; }

.api-guide-index {
  margin: 2rem 0;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
}
.api-guide-index > h2 { margin-top: 0; }
.endpoint h3 a {
  color: inherit;
  text-decoration-color: rgba(4, 107, 210, 0.35);
  text-underline-offset: 0.18em;
}
.api-detail-hero {
  padding: 62px 0 55px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(330px, 0.75fr);
  align-items: center;
  gap: clamp(42px, 8vw, 105px);
  border-bottom: 1px solid var(--border);
}
.api-detail-hero h1 { margin-bottom: 20px; font-size: clamp(40px, 5.5vw, 64px); letter-spacing: -0.035em; }
.api-detail-hero .lede { margin-bottom: 24px; }
.api-detail-hero .badges { margin-bottom: 0; }

.endpoint-banner {
  position: relative;
  padding: 28px;
  overflow: hidden;
  border-radius: 9px;
  background: var(--code-bg);
  color: var(--code-fg);
  box-shadow: 18px 18px 0 var(--tint);
}
.endpoint-banner::after {
  content: "API";
  position: absolute;
  right: -10px;
  bottom: -32px;
  color: rgba(255,255,255,0.035);
  font-family: var(--slab);
  font-size: 110px;
  font-weight: 800;
  line-height: 1;
}
.endpoint-banner-label { margin: 0 0 15px; color: #94a3b8; font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.endpoint-banner .sig { position: relative; z-index: 1; align-items: center; margin-bottom: 19px; }
.endpoint-banner .path { color: #fff; }
.endpoint-banner > code { position: relative; z-index: 1; display: block; color: #7dd3fc; font-size: 12px; line-height: 1.65; word-break: break-all; }

.api-doc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 255px; gap: clamp(48px, 8vw, 105px); padding-top: 62px; align-items: start; }
.api-doc { min-width: 0; }
.api-doc > section:first-child h2 { margin-top: 0; }
.api-doc h2 { scroll-margin-top: 90px; }
.api-doc h3 { scroll-margin-top: 90px; }
.api-doc p { max-width: 76ch; }
.api-doc pre { max-width: 860px; }

.on-this-page { position: sticky; top: 95px; padding-left: 20px; border-left: 1px solid var(--border); }
.on-this-page p { margin: 0 0 10px; color: var(--ink); font-size: 12px; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; }
.on-this-page ul { margin: 0; padding: 0; list-style: none; }
.on-this-page li + li { margin-top: 7px; }
.on-this-page a { color: var(--muted); font-size: 13px; }
.on-this-page a:hover { color: var(--blue-dark); }

.workflow-steps { margin: 25px 0 10px; padding: 0; list-style: none; counter-reset: workflow; }
.workflow-steps li { position: relative; min-height: 58px; padding: 0 0 26px 56px; counter-increment: workflow; }
.workflow-steps li::before {
  content: counter(workflow);
  position: absolute;
  top: 0;
  left: 0;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
}
.workflow-steps li:not(:last-child)::after { content: ""; position: absolute; top: 36px; bottom: 3px; left: 16px; width: 1px; background: var(--border); }
.workflow-steps strong { display: block; margin-bottom: 3px; color: var(--ink); }
.workflow-steps p { margin: 0; color: var(--muted); font-size: 15px; }

.use-case-grid, .related-api-grid, .endpoint-topic-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 24px 0; }
.use-case-grid article, .endpoint-topic-card { padding: 22px; border: 1px solid var(--border); border-radius: 7px; background: #fff; }
.use-case-grid h3, .endpoint-topic-card h3 { margin: 0 0 6px; font-size: 17px; }
.use-case-grid p, .endpoint-topic-card p { margin: 0; color: var(--muted); font-size: 14px; }

.api-note { margin: 24px 0; padding: 19px 22px; border-left: 4px solid var(--blue); border-radius: 0 6px 6px 0; background: var(--tint); }
.api-note.warning-note { border-left-color: var(--warn-border); background: var(--warn-bg); }
.api-note p:last-child { margin-bottom: 0; }

.field-table { margin-top: 22px; }
.field-table td:first-child { font-family: var(--mono); color: var(--ink); white-space: nowrap; }

.related-api-grid { margin-top: 24px; }
.related-api-grid a {
  display: block;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--ink);
  font-weight: 700;
  background: #fff;
}
.related-api-grid a span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; font-weight: 500; }
.related-api-grid a:hover { border-color: var(--blue); color: var(--blue-dark); text-decoration: none; }

.topic-intro { margin-bottom: 40px; }
.endpoint-topic-grid { margin-top: 30px; }
.endpoint-topic-card { display: flex; flex-direction: column; }
.endpoint-topic-card .sig { margin-top: 12px; }
.endpoint-topic-card pre { margin-top: 14px; }
.endpoint-topic-card .card-link { margin-top: auto; }

/* Category navigation */

.categories { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 10px; }
.categories a {
  display: inline-block;
  padding: 9px 18px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--tint);
  font-weight: 500;
  color: var(--blue-dark);
}
.categories a:hover { background: var(--blue); color: #fff; border-color: var(--blue); text-decoration: none; }

/* Callout */

.callout {
  background: var(--tint);
  border-left: 4px solid var(--blue);
  border-radius: 0 6px 6px 0;
  padding: 20px 24px;
  margin: 0 0 32px;
}
.callout h2 { margin-top: 0; border: 0; padding: 0; font-size: 21px; }
.callout p:last-child { margin-bottom: 0; }
.callout dt { font-weight: 600; color: var(--ink); margin-top: 14px; }
.callout dd { margin: 4px 0 0; }
.callout dl { margin: 0; }

.warning {
  background: var(--warn-bg);
  border-left: 4px solid var(--warn-border);
  border-radius: 0 6px 6px 0;
  padding: 16px 22px;
  margin: 0 0 28px;
}
.warning p:last-child { margin-bottom: 0; }

/* Endpoint blocks */

.endpoint { padding: 4px 0 8px; border-bottom: 1px solid #eef2f6; }
.endpoint:last-child { border-bottom: 0; }

.sig {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  font-family: var(--mono);
  font-size: 14.5px;
  margin: 0 0 12px;
}
.method {
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.06em;
  padding: 3px 9px;
  border-radius: 4px;
  color: #fff;
  background: var(--blue);
}
.method.post { background: #059669; }
.path { color: var(--near-black); word-break: break-all; }

pre {
  background: var(--code-bg);
  color: var(--code-fg);
  padding: 16px 18px;
  border-radius: 6px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.6;
  margin: 0 0 18px;
}
pre code { font-family: inherit; }

:not(pre) > code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--tint);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--near-black);
  word-break: break-word;
}

.key { font-weight: 600; color: var(--ink); }

/* Utilities */

/*
 * Available to assistive technology, absent from the visual page. Used on the
 * table <caption>, which a screen reader announces before reading the rows but
 * which would be redundant next to the heading right above it.
 */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Tables */

.table-wrap { overflow-x: auto; margin: 0 0 24px; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; padding: 9px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--tint); color: var(--ink); font-weight: 600; white-space: nowrap; }
td code { white-space: nowrap; }

/* Footer */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--tint);
  padding: 40px 24px;
  font-size: 15px;
  color: var(--muted);
}
.site-footer .inner { max-width: 1180px; margin: 0 auto; }
.site-footer ul { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-wrap: wrap; gap: 20px; }
.site-footer address { font-style: normal; margin: 0 0 12px; line-height: 1.6; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  main { padding: 0 18px 60px; }
  .site-header .inner { padding: 12px 18px; gap: 14px; }
  .site-nav { gap: 14px; font-size: 13px; width: 100%; margin-left: 0; }

  .login-shell { grid-template-columns: 1fr; min-height: 0; gap: 42px; padding: 55px 0; }
  .login-intro h1 { font-size: clamp(38px, 10vw, 56px); }
  .login-help { align-items: flex-start; flex-direction: column; gap: 22px; padding: 28px 24px; }

  .home-page main { padding-bottom: 0; }
  .home-hero { min-height: 0; padding: 60px 0 70px; grid-template-columns: 1fr; gap: 50px; }
  .home-hero h1 { font-size: clamp(43px, 14vw, 62px); }
  .api-window { transform: none; }
  .section-heading, .service-grid, .principles, .feed-feature { grid-template-columns: 1fr; }
  .home-section { padding: 72px 0 78px; }
  .section-heading { gap: 18px; }
  .service-card { min-height: 350px; }
  .principles { margin: 0 -18px; padding: 72px 18px; gap: 45px; }
  .principle-list article { padding-left: 24px; }
  .feed-feature { margin: 70px 0; padding: 34px 25px; gap: 30px; }
  .home-cta { padding-bottom: 85px; }
  .post-card { grid-template-columns: 1fr; }
  .post-card-image { min-height: 240px; aspect-ratio: 16 / 9; }
  .post-card-body { padding: 30px 24px 34px; }
  .posts-hero { padding-top: 55px; }
  .post-list { padding: 45px 0 72px; }
  .article-shell { margin-top: 48px; }
  .article-header { text-align: left; }
  .article-header .post-meta { justify-content: flex-start; }
  .article-header .eyebrow { margin-left: 0; }
  .article-figure { margin-left: -18px; margin-right: -18px; }
  .article-figure img { border-radius: 0; }
  .article-figure figcaption { padding: 0 18px; }
  .connection-list { grid-template-columns: 1fr; }
  .connection-list article:last-child { grid-column: auto; }
  .article-cta .button-row { align-items: flex-start; }
  .api-detail-hero, .api-doc-layout { grid-template-columns: 1fr; }
  .api-detail-hero { padding-top: 48px; gap: 38px; }
  .endpoint-banner { box-shadow: 9px 9px 0 var(--tint); }
  .on-this-page { display: none; }
  .api-doc-layout { padding-top: 42px; }
  .use-case-grid, .related-api-grid, .endpoint-topic-grid { grid-template-columns: 1fr; }
  .field-table td:first-child { white-space: normal; }
}

@media (min-width: 641px) and (max-width: 960px) {
  .login-shell { grid-template-columns: 1fr; min-height: 0; gap: 48px; }
  .login-card { max-width: 620px; }
  .home-hero { grid-template-columns: 1fr; min-height: 0; }
  .api-window { max-width: 620px; }
  .service-grid { grid-template-columns: 1fr 1fr; }
  .service-card:first-child { grid-column: 1 / -1; min-height: 340px; }
  .principles { margin-left: -24px; margin-right: -24px; padding-left: 24px; padding-right: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button, .card-link span, .text-link span { transition: none; }
}
