@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;600&family=Noto+Serif+SC:wght@400;500&display=swap');

/* Developer platform docs. Palette and type follow the homepage build (app/src/styles.css). */
:root {
  --bg: #f8f6f1;
  --ink: #202924;
  --muted: #60665f;
  --accent: #3e5944;
  --line: #d8dad2;
  --panel: #fffefb;
  --panel-alt: #eeeae1;
  --code-bg: #1b2320;
  --code-ink: #e7ece6;
  --ok: #3e5944;
  --wip: #8a6a24;
  --plan: #6d7570;
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
  --header-h: 68px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 20px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

/* ---------- header ---------- */
.doc-header {
  position: sticky; top: 0; z-index: 20;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 0 clamp(16px, 4vw, 44px);
  background: #f8f6f1f2;
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.doc-header .brand { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.wordmark { font-size: 17px; font-weight: 600; letter-spacing: 0.22em; }
.brand .sub { font-size: 11px; letter-spacing: 0.18em; color: var(--muted); white-space: nowrap; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.header-actions a.plain { font-size: 12px; color: var(--muted); }
.header-actions a.plain:hover { color: var(--ink); }
.lang-toggle {
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  border-radius: 30px; padding: 7px 15px; font-size: 12px;
}
.lang-toggle:hover { border-color: var(--accent); }
.nav-toggle { display: none; }

/* ---------- shell ---------- */
.shell {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: clamp(28px, 5vw, 72px);
  max-width: 1240px;
  margin: 0 auto;
  padding: 44px clamp(16px, 4vw, 44px) 110px;
}
.side { position: sticky; top: calc(var(--header-h) + 36px); align-self: start; }
.side nav { display: block; }
.side .group { margin-bottom: 26px; }
.side .group > p {
  margin: 0 0 10px; font-size: 10px; letter-spacing: 0.19em; font-weight: 500;
  color: var(--muted); text-transform: uppercase;
}
.side a {
  display: block; font-size: 13.5px; line-height: 1.5;
  padding: 7px 12px; margin-left: -12px; border-radius: 6px; color: var(--muted);
}
.side a:hover { color: var(--ink); background: #ecebe4; }
.side a[aria-current='page'] { color: var(--ink); background: #e7e9e0; font-weight: 500; }

/* ---------- content ---------- */
main { min-width: 0; max-width: 820px; }
.eyebrow {
  font-size: 10px; letter-spacing: 0.19em; font-weight: 500; color: var(--muted);
  margin: 0 0 14px;
}
h1 {
  font-family: 'Noto Serif SC', serif;
  font-size: clamp(30px, 3.6vw, 44px); font-weight: 500; line-height: 1.3;
  letter-spacing: -0.03em; margin: 0 0 18px;
}
.lede { font-size: 17px; line-height: 1.8; color: var(--muted); margin: 0 0 40px; max-width: 64ch; }
h2 {
  font-size: clamp(21px, 2.1vw, 26px); font-weight: 500; line-height: 1.4;
  letter-spacing: -0.02em; margin: 56px 0 16px; padding-top: 4px;
}
h3 { font-size: 16px; font-weight: 600; margin: 32px 0 10px; }
h4 { font-size: 14px; font-weight: 600; margin: 24px 0 8px; }
p, li { font-size: 15px; line-height: 1.85; }
p { margin: 0 0 16px; }
ul, ol { padding-left: 22px; margin: 0 0 18px; }
li { margin-bottom: 7px; }
strong { font-weight: 600; }
main a:not(.button):not(.card) { color: var(--accent); border-bottom: 1px solid #b9c5b9; }
main a:not(.button):not(.card):hover { border-bottom-color: var(--accent); }
code {
  font-family: var(--mono); font-size: 0.875em;
  background: #e9ebe3; border-radius: 4px; padding: 2px 5px; word-break: break-word;
}
hr { border: 0; border-top: 1px solid var(--line); margin: 56px 0; }

/* ---------- code blocks ---------- */
.code {
  position: relative; margin: 0 0 22px;
  background: var(--code-bg); border-radius: 10px; overflow: hidden;
}
.code > .code-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 14px; border-bottom: 1px solid #ffffff14;
  font-family: var(--mono); font-size: 11px; color: #9fada4; letter-spacing: 0.04em;
}
.code pre {
  margin: 0; padding: 16px 18px; overflow-x: auto;
  font-family: var(--mono); font-size: 13px; line-height: 1.72; color: var(--code-ink);
}
.code pre code { background: none; padding: 0; font-size: inherit; color: inherit; }
.copy {
  border: 1px solid #ffffff2b; background: #ffffff14; color: #cfd8d1;
  border-radius: 20px; padding: 3px 11px; font-size: 11px; font-family: var(--mono);
}
.copy:hover { background: #ffffff26; color: #fff; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 0 24px; }
table { border-collapse: collapse; width: 100%; min-width: 520px; }
th, td {
  text-align: left; vertical-align: top; padding: 11px 14px;
  border-bottom: 1px solid var(--line); font-size: 13.5px; line-height: 1.65;
}
th { font-weight: 600; font-size: 12px; letter-spacing: 0.04em; color: var(--muted); }
tbody tr:last-child td { border-bottom: 0; }
td code, th code { font-size: 12.5px; }

/* ---------- status badges ---------- */
.badge {
  display: inline-block; font-size: 10.5px; letter-spacing: 0.1em; font-weight: 500;
  padding: 3px 9px; border-radius: 20px; white-space: nowrap;
  border: 1px solid currentColor;
}
.badge.ok { color: var(--ok); background: #e5ebe3; }
.badge.wip { color: var(--wip); background: #f3ece0; }
.badge.plan { color: var(--plan); background: #eaebe8; }

/* ---------- callouts ---------- */
.note {
  border-left: 2px solid var(--accent); background: var(--panel);
  padding: 16px 20px; border-radius: 0 8px 8px 0; margin: 0 0 24px;
}
.note.warn { border-left-color: #a8761f; }
.note > :last-child { margin-bottom: 0; }
.note p { font-size: 14px; }
.note .label {
  display: block; font-size: 10px; letter-spacing: 0.16em; font-weight: 500;
  color: var(--muted); margin-bottom: 7px;
}

/* ---------- cards ---------- */
.cards { display: grid; gap: 14px; margin: 0 0 28px; }
.cards.two { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.cards.three { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
a.card, .card {
  display: block; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 20px;
}
a.card:hover { border-color: var(--accent); transform: translateY(-2px); }
a.card { transition: transform 0.18s, border-color 0.18s; }
.card h3 { margin: 0 0 7px; font-size: 15px; }
.card p { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.7; }
.card .step { font-family: var(--mono); font-size: 11px; color: var(--muted); display: block; margin-bottom: 9px; }

/* ---------- endpoint rows ---------- */
.ep {
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel);
  padding: 18px 20px; margin: 0 0 14px;
}
.ep > .sig {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 13px; margin-bottom: 10px;
}
.ep .verb {
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
  padding: 3px 8px; border-radius: 5px; background: #e5ebe3; color: var(--accent);
}
.ep .verb.post { background: #e8e4d9; color: #7a6322; }
.ep .path { word-break: break-all; }
.ep p { font-size: 13.5px; margin: 0 0 8px; color: var(--muted); }
.ep p:last-child { margin-bottom: 0; }
.ep dl { margin: 10px 0 0; font-size: 13px; }
.ep dt { font-family: var(--mono); font-size: 12.5px; margin-top: 8px; }
.ep dd { margin: 2px 0 0 0; color: var(--muted); line-height: 1.7; }

/* ---------- buttons ---------- */
.button {
  display: inline-flex; align-items: center; gap: 12px;
  background: var(--accent); color: #fff; border: 0; border-radius: 30px;
  padding: 13px 25px; font-size: 13px; line-height: 1.5;
}
.button:hover { background: #33493a; }
.button.ghost { background: none; color: var(--ink); border: 1px solid var(--line); }
.button.ghost:hover { border-color: var(--accent); background: none; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 8px; }

/* ---------- page nav ---------- */
.page-nav {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-top: 64px; padding-top: 26px; border-top: 1px solid var(--line);
  font-size: 13.5px;
}
.page-nav a { color: var(--accent); }
.page-nav span { color: var(--muted); display: block; font-size: 11px; letter-spacing: 0.1em; margin-bottom: 4px; }

/* ---------- footer ---------- */
.doc-footer {
  border-top: 1px solid var(--line);
  padding: 30px clamp(16px, 4vw, 44px);
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  flex-wrap: wrap; font-size: 11.5px; color: var(--muted);
}
.doc-footer a { color: var(--muted); }
.doc-footer a:hover { color: var(--ink); }
.doc-footer .links { display: flex; gap: 18px; flex-wrap: wrap; }

/* ---------- i18n ---------- */
[data-lang] { display: none; }
[data-lang].is-active { display: block; }
li[data-lang].is-active, td[data-lang].is-active, span[data-lang].is-active { display: revert; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; padding-top: 26px; gap: 0; }
  .nav-toggle {
    display: inline-flex; align-items: center; gap: 8px;
    border: 1px solid var(--line); background: var(--panel); color: var(--ink);
    border-radius: 30px; padding: 7px 14px; font-size: 12px;
  }
  .brand .sub { display: none; }
  .side {
    position: static; margin: 0 0 30px; border: 1px solid var(--line);
    border-radius: 10px; background: var(--panel); padding: 18px 20px; display: none;
  }
  .side.open { display: block; }
  .side .group:last-child { margin-bottom: 0; }
  h2 { margin-top: 44px; }
}
@media (max-width: 560px) {
  .header-actions a.plain { display: none; }
  .lede { font-size: 15.5px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ---------- pitch page (the developer platform's front door) ---------- */
.pitch main { max-width: 900px; }
.pitch-hero { margin: 8px 0 72px; }
.pitch-hero h1 {
  font-size: clamp(36px, 5.2vw, 68px);
  line-height: 1.22;
  letter-spacing: -0.035em;
  margin: 0 0 26px;
  max-width: 16ch;
}
.pitch-hero .lede { font-size: clamp(17px, 1.7vw, 20px); color: var(--muted); max-width: 54ch; margin-bottom: 34px; }
.pitch-hero .button { padding: 15px 28px; font-size: 14px; }

.claim {
  font-family: 'Noto Serif SC', serif;
  font-size: clamp(22px, 2.5vw, 32px);
  line-height: 1.5;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
  max-width: 24ch;
}
.standfirst { background: var(--panel-alt); border-radius: 12px; padding: clamp(26px, 3.5vw, 44px); margin: 0 0 56px; }
.standfirst > :last-child { margin-bottom: 0; }
.standfirst p { max-width: 58ch; }

.pillars { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin: 0 0 56px; }
@media (min-width: 720px) { .pillars { grid-template-columns: 1fr 1fr; } }
.pillar { background: var(--panel); padding: 28px clamp(22px, 2.6vw, 32px); }
.pillar .num { font-family: var(--mono); font-size: 11px; color: var(--muted); display: block; margin-bottom: 12px; }
.pillar h3 { margin: 0 0 9px; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.pillar p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.78; }

.build-list { display: grid; gap: 14px; margin: 0 0 56px; }
.build-item { display: grid; gap: 4px 22px; padding: 22px 0; border-top: 1px solid var(--line); }
@media (min-width: 720px) { .build-item { grid-template-columns: 200px 1fr; } }
.build-item h3 { margin: 0; font-size: 16px; font-weight: 600; }
.build-item p { margin: 0; font-size: 14.5px; color: var(--muted); max-width: 52ch; }

.lineup { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: clamp(24px, 3vw, 36px); margin: 0 0 24px; }
.lineup ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 11px; }
@media (min-width: 720px) { .lineup ul { grid-template-columns: 1fr 1fr; gap: 11px 32px; } }
.lineup li { font-size: 14.5px; line-height: 1.6; padding-left: 24px; position: relative; margin: 0; }
.lineup li::before { content: ''; position: absolute; left: 2px; top: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.fineprint { font-size: 12.5px; color: var(--muted); line-height: 1.75; margin: 0 0 56px; max-width: 62ch; }

.closing-cta { background: var(--panel-alt); border-radius: 12px; padding: clamp(30px, 4vw, 52px); text-align: center; }
.closing-cta h2 { margin: 0 0 14px; }
.closing-cta p { color: var(--muted); max-width: 46ch; margin: 0 auto 26px; }
.closing-cta .cta-row { justify-content: center; }
