/* Shared styles for the homepage and the Pricing page.
   Colours come from theme.css, which each page loads after this file. */

:root {
  --radius: 12px;
  --maxw: 1120px;
  --gutter: 24px;
  --font: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Space Grotesk', 'IBM Plex Sans', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }
img, svg { display: block; max-width: 100%; }
code, pre { font-family: var(--mono); }

:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  background: var(--action); color: var(--on-action); padding: 12px 16px; border-radius: 8px;
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.site-nav-link[aria-current="page"] { color: var(--text); }

.wrap { width: min(var(--maxw), calc(100% - 2 * var(--gutter))); margin: 0 auto; }

/* ---------- buttons and links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 8px;
  border: 1px solid transparent;
  font-family: var(--font); font-size: 16px; font-weight: 600; line-height: 1.2;
  text-decoration: none; cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .12s ease;
}
.btn-primary { background: var(--action); color: var(--on-action); font-weight: 700; }
.btn-primary:hover { background: var(--action-hover); transform: translateY(-1px); }
.btn-primary:active { background: var(--action-active); transform: none; }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-secondary:hover { border-color: var(--muted); }
.btn-arrow { transition: transform .15s ease; }
.btn:hover .btn-arrow { transform: translateX(2px); }

.text-link {
  color: var(--cyan); font-weight: 600; text-decoration: none;
  display: inline-block; padding: 6px 0; line-height: 1.5;
}
.text-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.inline-links a,
.prose a { color: var(--cyan); font-weight: 600; text-underline-offset: 3px; }
.inline-links a:hover,
.prose a:hover { color: var(--cyan-hover); }

/* ---------- section scaffolding ---------- */
.section { padding: 96px 0; scroll-margin-top: 72px; }
.section--tint { background: var(--tint-bg); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section--tint + .site-footer { border-top: 0; }
.sec-head { max-width: 680px; margin-bottom: 44px; }
.kicker {
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase; color: var(--cyan); margin-bottom: 14px;
}
h1, h2, h3 { font-family: var(--display); color: var(--text); }
h2 { font-size: clamp(30px, 3.4vw, 40px); line-height: 1.12; letter-spacing: -.025em; font-weight: 700; margin-bottom: 16px; }
h3 { font-size: 19px; line-height: 1.3; letter-spacing: -.01em; font-weight: 700; }
.sec-sub { color: var(--muted); font-size: 18px; line-height: 1.65; }
.section-note { margin-top: 32px; color: var(--muted); font-size: 16px; scroll-margin-top: 96px; }

.tag {
  align-self: flex-start; font-family: var(--mono); font-size: 11.5px; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; background: var(--violet-soft); color: var(--violet-text);
}

/* ---------- homepage hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: 96px 0 104px;
  border-bottom: 1px solid var(--line);
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(560px 380px at 80% 36%, rgba(var(--violet-rgb), calc(.16 * var(--glow))), transparent 70%),
    radial-gradient(420px 300px at 66% 82%, rgba(var(--cyan-rgb), calc(.07 * var(--glow))), transparent 70%),
    radial-gradient(520px 360px at 8% 10%, rgba(var(--violet-rgb), calc(.08 * var(--glow))), transparent 70%);
}
.hero-grid {
  position: relative;
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: 48px;
  align-items: center;
}
.hero-copy { grid-column: 1 / span 7; max-width: 620px; }
.hero-visual { grid-column: 8 / span 5; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--cyan); background: var(--cyan-soft); border: 1px solid var(--cyan-line);
  padding: 6px 12px; border-radius: 999px; margin-bottom: 24px;
}
.eyebrow-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); }
.hero h1 {
  font-size: clamp(40px, 5.4vw, 62px);
  line-height: 1.04; letter-spacing: -.04em; font-weight: 700;
  margin-bottom: 24px; max-width: 13ch;
}
.lede { font-size: 19px; line-height: 1.6; color: var(--muted); max-width: 34em; margin-bottom: 36px; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.hero-note { color: var(--muted); font-size: 15px; }

/* Hero diagram: one key, one base URL, three documented routes. No prices. */
.route-map {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 30px 70px -30px var(--shadow-strong), 0 0 0 1px rgba(var(--violet-rgb), .06);
  padding: 24px; display: grid; gap: 0; font-size: 14px;
}
.rm-node {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  border: 1px solid var(--line-strong); border-radius: 10px; padding: 12px 14px; background: var(--surface-2);
}
.rm-node code { font-size: 13px; color: var(--text); overflow-wrap: anywhere; }
.rm-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.rm-node--hub { border-color: var(--violet-line); background: var(--violet-soft); }
.rm-node--hub .rm-label { color: var(--violet-text); }
.rm-link { width: 2px; height: 22px; margin-left: 26px; background: linear-gradient(var(--line-strong), var(--violet-line)); }
.rm-routes { list-style: none; display: grid; gap: 8px; padding-left: 26px; border-left: 2px solid var(--violet-line); margin-left: 26px; }
.rm-routes li {
  position: relative; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--code-bg);
}
.rm-routes li::before {
  content: ""; position: absolute; left: -27px; top: 50%; width: 26px; height: 2px; background: var(--violet-line);
}
.rm-routes code { font-size: 12.5px; color: var(--code-text); overflow-wrap: anywhere; }
.rm-routes .tag { min-width: 62px; text-align: center; }

/* ---------- cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.card-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  padding: 28px; display: flex; flex-direction: column; gap: 10px;
}
.card p { color: var(--muted); font-size: 16px; }
.card .text-link { margin-top: auto; padding-top: 8px; }
.card-icon {
  width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center;
  background: var(--cyan-soft); border: 1px solid rgba(var(--cyan-rgb), .2); color: var(--cyan); margin-bottom: 6px;
}
.card-icon svg { width: 18px; height: 18px; }
.card--plain { background: transparent; border: 0; border-top: 1px solid var(--line-strong); border-radius: 0; padding: 24px 0 0; }

/* ---------- latest articles ---------- */
.list-head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px;
  margin-bottom: 28px;
}
.list-head h2 { margin-bottom: 0; font-size: clamp(26px, 2.6vw, 32px); }
.post-list { list-style: none; display: grid; gap: 0; max-width: 880px; }
.post {
  display: grid; grid-template-columns: 184px minmax(0, 1fr); gap: 24px; align-items: start;
  padding: 28px 0; border-top: 1px solid var(--line);
}
.post:first-child { border-top: 0; padding-top: 4px; }
.post-thumb {
  display: block; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line); background: var(--surface-2); aspect-ratio: 40 / 21;
}
.post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-title { font-size: 20px; line-height: 1.35; margin-bottom: 8px; }
.post-title a { text-decoration: none; }
.post-title a:hover { color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; }
.post-excerpt { color: var(--muted); font-size: 16px; line-height: 1.6; }
.post-meta { margin-top: 10px; color: var(--muted); font-size: 14px; }
.post--text { grid-template-columns: minmax(0, 1fr); }

/* ---------- pricing page ---------- */
.page-hero { position: relative; overflow: hidden; padding: 80px 0 72px; border-bottom: 1px solid var(--line); }
.page-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(520px 320px at 85% 20%, rgba(var(--violet-rgb), calc(.14 * var(--glow))), transparent 70%),
    radial-gradient(420px 300px at 6% 0%, rgba(var(--cyan-rgb), calc(.06 * var(--glow))), transparent 70%);
}
.page-hero .wrap { position: relative; }
.page-hero h1 {
  font-size: clamp(38px, 5vw, 56px); line-height: 1.05; letter-spacing: -.035em; font-weight: 700;
  margin-bottom: 20px; max-width: 16ch;
}
.page-hero .lede { margin-bottom: 28px; }
.jump-links { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin-top: 28px; }
.jump-links a {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface);
  color: var(--text); font-size: 14.5px; font-weight: 600; text-decoration: none;
}
.jump-links a:hover { border-color: var(--muted); }

.basics { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.basics li { border-top: 1px solid var(--line-strong); padding-top: 20px; }
.basics h3 { margin-bottom: 8px; }
.basics p { color: var(--muted); font-size: 16px; }

.billing-grid {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: 40px; align-items: start;
}
.billing-copy { grid-column: 1 / span 6; }
.billing-side { grid-column: 8 / span 5; display: grid; gap: 16px; min-width: 0; }
.prose p:not(.kicker):not(.formula), .prose li { color: var(--muted); font-size: 16.5px; }
.prose p + p, .prose p + ul, .prose ul + p { margin-top: 14px; }
.prose ul { padding-left: 20px; display: grid; gap: 8px; }
.prose strong { color: var(--text); font-weight: 600; }
.prose code { font-size: 14px; color: var(--text); }

.formula {
  margin-top: 22px;
  font-family: var(--mono); font-size: 13.5px; line-height: 1.7; color: var(--text); overflow-wrap: anywhere;
  background: var(--code-bg); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px;
}
.formula-label { display: block; font-family: var(--font); font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }

.example {
  margin-top: 16px; border: 1px dashed var(--line-strong); border-radius: 8px; padding: 14px 16px;
  font-size: 15px; color: var(--muted);
}
.example strong { color: var(--text); font-weight: 600; }
.example p + p { margin-top: 6px; }

.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.panel-title {
  font-family: var(--font); font-size: 13px; font-weight: 600; letter-spacing: 0; color: var(--muted);
  padding: 14px 20px; border-bottom: 1px solid var(--line); background: var(--surface-2);
}
.model-list { list-style: none; }
.model-row { padding: 16px 20px; border-top: 1px solid var(--line); display: grid; gap: 4px; }
.model-row:first-child { border-top: 0; }
.model-row code { font-size: 14px; font-weight: 500; color: var(--text); overflow-wrap: anywhere; }
.model-row p { font-size: 14.5px; color: var(--muted); line-height: 1.5; }
.model-row .text-link { font-size: 14px; padding: 2px 0 0; justify-self: start; }
.panel-links { display: grid; gap: 2px; padding: 12px 20px 14px; border-top: 1px solid var(--line); }

/* ---------- faq ---------- */
.faq-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: 32px; }
.faq-grid .sec-head { grid-column: 1 / span 4; margin-bottom: 0; }
.faq-list { grid-column: 6 / span 7; border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 64px; padding: 16px 0; font-size: 18px; font-weight: 600;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: ""; flex: none; width: 10px; height: 10px; margin-right: 4px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg); transition: transform .15s ease;
}
.faq-item[open] summary::after { transform: rotate(-135deg); }
.faq-item summary:focus-visible { outline-offset: 2px; }
.faq-body { padding: 0 0 20px; color: var(--muted); font-size: 16px; max-width: 620px; }
.faq-body p + p { margin-top: 10px; }
.faq-body a { color: var(--cyan); font-weight: 600; }
.faq-body code { font-size: 14px; color: var(--text); }

/* ---------- tablet ---------- */
@media (max-width: 1080px) {
  .hero { padding: 80px 0 88px; }
  .hero-copy { grid-column: 1 / span 6; }
  .hero-visual { grid-column: 7 / span 6; }
  .hero h1 { font-size: clamp(40px, 5.6vw, 54px); }
  .lede { font-size: 18px; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .billing-copy { grid-column: 1 / span 7; }
  .billing-side { grid-column: 8 / span 5; }
}

@media (max-width: 840px) {
  .hero-copy, .hero-visual,
  .billing-copy, .billing-side,
  .faq-grid .sec-head, .faq-list { grid-column: 1 / -1; }
  .hero-copy { max-width: 640px; }
  .hero h1 { max-width: none; font-size: clamp(40px, 6.4vw, 52px); }
  .card-grid--3, .basics { grid-template-columns: 1fr; }
  .billing-copy { max-width: 680px; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  .section { padding: 64px 0; }
  .hero { padding: 56px 0 64px; }
  .page-hero { padding: 56px 0 52px; }
  .hero-grid { row-gap: 40px; }
  .hero h1 { font-size: 40px; }
  .page-hero h1 { font-size: 38px; }
  .lede { font-size: 17px; margin-bottom: 28px; }
  .sec-head { margin-bottom: 32px; }
  .sec-sub { font-size: 16.5px; }
  .hero-actions .btn { width: 100%; }
  .card-grid { grid-template-columns: 1fr; }
  .card { padding: 24px; }
  .card--plain { padding: 20px 0 0; }
  .post { grid-template-columns: 120px minmax(0, 1fr); gap: 16px; padding: 22px 0; }
  .post-title { font-size: 18px; }
  .post-excerpt { font-size: 15px; }
  .route-map { padding: 18px; }
}

@media (max-width: 520px) {
  :root { --gutter: 18px; }
}

@media (max-width: 480px) {
  .post { grid-template-columns: minmax(0, 1fr); }
  .post-thumb { max-width: 320px; }
  .rm-routes { margin-left: 14px; padding-left: 18px; }
  .rm-routes li::before { left: -19px; width: 18px; }
  .rm-link { margin-left: 14px; }
  .route-map { padding: 14px; }
  .rm-routes li { gap: 8px; padding: 9px 10px; }
  .rm-routes code { font-size: 11px; }
  .rm-routes .tag { min-width: 0; padding: 3px 7px; font-size: 10.5px; }
  .formula { font-size: 12.5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
