/* paperpipe brand. Knobs first (kit.css derives every colour from --hue/--chroma), then everything this app adds.
   Fonts come from /fonts/fonts.css (regenerate with: just fonts "<Google Fonts css2 URL>"). Shared by the app, docs, auth and legal pages. */
:root {
  --hue: 215;      /* cool signal teal-blue; neutrals are tinted with it */
  --chroma: 0.105;
  --radius: 6px;   /* small and crisp: --r-sm 3px, --r-lg 9.6px */
  --font-display: "Familjen Grotesk", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --wrap: 1180px;

  /* code blocks are terminals in both themes */
  --code-bg: oklch(0.205 0.022 var(--hue));
  --code-bar: oklch(0.245 0.024 var(--hue));
  --code-line: oklch(0.32 0.025 var(--hue));
  --code-ink: oklch(0.93 0.01 var(--hue));
  --code-dim: oklch(0.73 0.025 var(--hue));
  --code-acc: oklch(0.82 0.11 var(--hue));
  --code-str: oklch(0.84 0.09 150);
}
@media (prefers-color-scheme: dark) {
  :root { --code-bg: oklch(0.135 0.014 var(--hue)); --code-bar: oklch(0.17 0.016 var(--hue)); --code-line: oklch(0.29 0.02 var(--hue)); }
}

/* ---------- base ---------- */
body { font-feature-settings: normal; }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.03em; }
:focus-visible { outline-offset: 2px; }
.mark { text-transform: lowercase; font-weight: 600; font-size: 1.2rem; }
.mark::before { width: 11px; height: 16px; border-radius: 2px; background: linear-gradient(var(--accent), var(--accent)) 0 62% / 100% 3px no-repeat; border: 1.5px solid var(--ink); box-shadow: none; }
.btn { border-radius: var(--r-sm); font-weight: 550; padding: 12px 18px; }
.btn:hover:not(:disabled) { box-shadow: none; }
.btn.sm { padding: 8px 13px; }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn.ghost:hover:not(:disabled) { background: var(--surface); border-color: var(--muted); }
.panel { border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-lg); }
.panel .btn.quiet, .btn.quiet { background: var(--sunken); border-color: var(--line); }
.plan, .showcase, .auth form { border-radius: var(--r-lg); }
.auth form { border: 1px solid var(--line); }
.banner { border: 1px solid var(--line); background: var(--surface); }
/* kit's upgrade banner names a single "Pro" tier; show it only while a payment is being confirmed (upgrade-go is hidden then) */
#upgrade:not(:has(#upgrade-go[hidden])) { display: none !important; }
#acc-upgrade { display: none !important; } /* kit checks out one price; paperpipe picks a tier on the dashboard */
.site-header .wrap { height: 60px; }
.site-header nav a[aria-current=page] { color: var(--ink); }
.eyebrow::before { border-radius: 1px; }

/* ---------- code ---------- */
.code { margin: 0; background: var(--code-bg); border: 1px solid var(--code-line); border-radius: var(--r-lg); color: var(--code-ink); min-width: 0; overflow: hidden; }
.code figcaption { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 36px; padding: 0 6px 0 14px; background: var(--code-bar); border-bottom: 1px solid var(--code-line); font: 500 .75rem/1 var(--font-mono); color: var(--code-dim); }
.code .cp { appearance: none; border: 0; background: transparent; color: var(--code-dim); font: inherit; padding: 8px 9px; border-radius: var(--r-sm); cursor: pointer; }
.code .cp:hover { color: var(--code-ink); background: var(--code-line); }
.code .cp:focus-visible { outline-color: var(--code-acc); }
.code pre { margin: 0; padding: 14px 16px 16px; overflow-x: auto; font: 400 .8125rem/1.7 var(--font-mono); tab-size: 2; scrollbar-width: thin; scrollbar-color: var(--code-line) transparent; }
.code pre code { font: inherit; white-space: pre; }
.code pre:focus-visible { outline: 2px solid var(--code-acc); outline-offset: -2px; }
.code .p { color: var(--code-dim); user-select: none; }
.code .c { color: var(--code-dim); }
.code .f { color: var(--code-acc); }
.code .s { color: var(--code-str); }
.code .k { color: var(--code-acc); }
.code .o { color: var(--code-dim); }
.code.tight pre { padding-block: 10px 12px; }
p code, li code, td code, dd code, .inline-code { background: var(--sunken); border: 1px solid var(--line); border-radius: 3px; padding: .08em .35em; font-size: .86em; overflow-wrap: anywhere; }

/* ---------- landing: hero ---------- */
.hero { padding-block: clamp(40px, 6vw, 76px) clamp(56px, 8vw, 104px); gap: clamp(32px, 5vw, 56px); align-items: start; }
@media (min-width: 960px) { .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); } .hero-copy { padding-top: 28px; } }
.hero h1 { font-size: clamp(2.35rem, 5.2vw, 3.7rem); line-height: 1; letter-spacing: -0.04em; margin: 0 0 22px; max-width: 14ch; }
.hero .lede { max-width: 40ch; }
.hero .cta { margin-top: 28px; }
.cta a:not(.btn) { color: var(--ink); }
.hero-stack { display: grid; gap: 14px; min-width: 0; }
.hero-stack .code pre { font-size: .78rem; }
@media (max-width: 420px) { .hero-stack .code pre { font-size: .72rem; padding-inline: 12px; } }

/* ---------- landing: sections ---------- */
.section { padding-block: clamp(56px, 8vw, 96px); }
.sec-head { max-width: 62ch; margin-bottom: clamp(28px, 4vw, 44px); }
.sec-head h2 { font-size: clamp(1.8rem, 3.4vw, 2.5rem); }
.sec-head p { color: var(--muted); margin-top: 12px; max-width: 54ch; }

.ops { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.ops li { display: grid; gap: 4px 24px; padding-block: 16px; border-bottom: 1px solid var(--line); align-items: baseline; }
@media (min-width: 760px) { .ops li { grid-template-columns: 190px minmax(0, 1fr) 150px 70px; } }
.ops .name { font: 500 .95rem var(--font-mono); }
.ops .what { color: var(--ink); }
.ops .opts { color: var(--muted); font: .8rem var(--font-mono); overflow-wrap: anywhere; }
.ops .cost { font: 500 .82rem var(--font-mono); color: var(--muted); }
@media (min-width: 760px) { .ops .cost { text-align: right; } }
.ops .cost b { color: var(--ink); font-weight: 500; }
.ops-foot { margin-top: 16px; font-size: .9rem; color: var(--muted); }

.ways { display: grid; gap: 28px; }
@media (min-width: 900px) { .ways { grid-template-columns: 300px minmax(0, 1fr); gap: 40px; } }
.tabs { display: grid; align-content: start; gap: 0; border-left: 1px solid var(--line); }
@media (max-width: 899px) { .tabs { grid-auto-flow: column; border-left: 0; border-bottom: 1px solid var(--line); overflow-x: auto; } }
.tab { appearance: none; text-align: left; background: none; border: 0; color: var(--muted); font: 550 1rem/1.3 var(--font-body); padding: 14px 18px; cursor: pointer; margin-left: -1px; border-left: 2px solid transparent; white-space: nowrap; }
@media (max-width: 899px) { .tab { margin: 0 0 -1px; border-left: 0; border-bottom: 2px solid transparent; } }
.tab small { display: block; font-weight: 400; font-size: .85rem; margin-top: 4px; white-space: normal; max-width: 26ch; }
@media (max-width: 899px) { .tab small { display: none; } }
.tab:hover { color: var(--ink); }
.tab[aria-selected=true] { color: var(--ink); border-color: var(--accent); }
.tabpanel { display: grid; gap: 16px; min-width: 0; align-content: start; }
.tabpanel > p { max-width: 58ch; color: var(--muted); }
.tabpanel > p strong { color: var(--ink); font-weight: 550; }
.steps-inline { margin: 0; padding-left: 1.2em; display: grid; gap: 8px; color: var(--muted); max-width: 58ch; }
.steps-inline strong { color: var(--ink); font-weight: 550; }

.ledger { width: 100%; border-collapse: collapse; }
.ledger caption { text-align: left; }
.ledger th, .ledger td { text-align: left; padding: 15px 16px 15px 0; border-bottom: 1px solid var(--line); font-weight: 400; vertical-align: baseline; }
.ledger thead th { font: 500 .78rem var(--font-mono); color: var(--muted); border-bottom: 1px solid var(--ink); padding-block: 0 10px; }
.ledger tbody th { font: 600 1.25rem var(--font-display); letter-spacing: -0.02em; }
.ledger .num { font-variant-numeric: tabular-nums; font-family: var(--font-mono); font-size: .95rem; }
.ledger .amt { font: 600 1.5rem var(--font-display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.ledger .amt small { font: 400 .85rem var(--font-body); color: var(--muted); letter-spacing: 0; margin-left: 2px; }
.ledger td:last-child, .ledger th:last-child { text-align: right; padding-right: 0; }
.ledger .hl th, .ledger .hl td { background: linear-gradient(90deg, var(--accent-soft), transparent 70%); }
@media (max-width: 620px) {
  .ledger .per, .ledger thead .per { display: none; }
  .ledger th, .ledger td { padding-right: 10px; }
}
.price-notes { display: grid; gap: 8px 40px; margin-top: 22px; color: var(--muted); font-size: .92rem; }
@media (min-width: 800px) { .price-notes { grid-template-columns: 1fr 1fr; } }
.price-notes strong { color: var(--ink); font-weight: 550; }
.price-cta { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; }

.faq { margin: 0; border-top: 1px solid var(--ink); }
.faq > div { display: grid; gap: 8px 48px; padding-block: 22px; border-bottom: 1px solid var(--line); }
@media (min-width: 860px) { .faq > div { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } }
.faq dt { font: 600 1.1rem/1.3 var(--font-display); letter-spacing: -0.015em; }
.faq dd { margin: 0; color: var(--muted); max-width: 62ch; }
.faq dd + dd { margin-top: 10px; }
.faq dd strong { color: var(--ink); font-weight: 550; }

#start { border-top: 1px solid var(--line); background: var(--surface); }
.auth .section-head h2 { font-size: clamp(1.8rem, 3.4vw, 2.5rem); }
.auth .section-head p { color: var(--muted); margin-top: 12px; }
.auth form { background: var(--paper); }
.site-footer .wrap { align-items: center; }
.site-footer nav { flex-wrap: wrap; }

/* ---------- dashboard ---------- */
.app-grid { grid-template-areas: "usage" "try" "keys"; gap: 20px; }
@media (min-width: 1000px) { .app-grid { grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr); grid-template-areas: "try usage" "try keys"; } .app-grid > * { position: static !important; } }
.g-usage { grid-area: usage; } .g-try { grid-area: try; } .g-keys { grid-area: keys; }
.app-head h1 { font-size: clamp(1.7rem, 3vw, 2.1rem); }
.panel > h2 { font: 600 1.05rem/1.3 var(--font-display); letter-spacing: -0.01em; }
.panel > h2 + p { color: var(--muted); font-size: .92rem; margin-bottom: 16px; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head h2 { font: 600 1.05rem/1.3 var(--font-display); }

.meter-num { font: 600 2.1rem/1 var(--font-display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.meter-num span { font-size: 1.1rem; color: var(--muted); font-weight: 500; }
.meter { height: 6px; border-radius: 3px; background: var(--sunken); margin: 14px 0 10px; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 3px; transition: width .5s cubic-bezier(.2,.7,.2,1); }
.meter.hot i { background: var(--warn); }
.meter.full i { background: var(--bad); }
.meter-meta { color: var(--muted); font-size: .88rem; }
.tiers { list-style: none; margin: 18px 0 0; padding: 0; border-top: 1px solid var(--line); }
.tiers li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; padding-block: 11px; border-bottom: 1px solid var(--line); }
.tiers b { font-weight: 600; }
.tiers span { color: var(--muted); font-size: .86rem; grid-column: 1; }
.tiers .btn { grid-row: 1 / span 2; grid-column: 2; }
.tiers li.current b::after { content: "current"; margin-left: 8px; font: 500 .7rem var(--font-mono); color: var(--accent); }

.key-new { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 14px; }
.key-new .field { flex: 1 1 160px; margin: 0; }
.key-block { border: 1px solid var(--accent); background: var(--accent-soft); border-radius: var(--r-sm); padding: 14px; margin-bottom: 14px; display: grid; gap: 10px; }
.key-block p { font-size: .88rem; }
.key-block .copy input { background: var(--paper); border: 1px solid var(--line); font-size: .8rem; }
.keys { list-style: none; margin: 0; padding: 0; }
.keys li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding-block: 12px; border-top: 1px solid var(--line); align-items: center; }
.keys .kn { font-weight: 550; overflow-wrap: anywhere; }
.keys .km { grid-column: 1; color: var(--muted); font-size: .82rem; overflow-wrap: anywhere; }
.keys .km code { background: none; border: 0; padding: 0; color: var(--ink); }
.keys .btn { grid-row: 1 / span 2; grid-column: 2; }
.skel { margin-block: 8px; height: 44px; }
.hint { font-size: .86rem; color: var(--muted); }
.notice-inline { border-left: 2px solid var(--warn); padding: 8px 12px; background: var(--sunken); font-size: .9rem; margin-bottom: 14px; border-radius: 0 var(--r-sm) var(--r-sm) 0; }

dialog { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--paper); color: var(--ink); padding: 24px; max-width: min(420px, calc(100vw - 32px)); box-shadow: var(--shadow); }
dialog::backdrop { background: oklch(0.15 0.02 var(--hue) / .55); }
dialog h2 { font-size: 1.25rem; margin-bottom: 8px; }
dialog p { color: var(--muted); font-size: .94rem; }
dialog .actions { margin-top: 20px; justify-content: flex-end; }
.btn.warn { --b: var(--bad); color: oklch(0.99 0 0); }
.btn.warn:hover:not(:disabled) { --b: color-mix(in oklch, var(--bad) 85%, black); }

/* Try it */
.try-grid { display: grid; gap: 18px; }
.drop { display: grid; justify-items: start; gap: 6px; padding: 22px; border: 1.5px dashed color-mix(in oklch, var(--muted) 55%, var(--line)); border-radius: var(--r-lg); background: var(--paper); cursor: pointer; transition: border-color .15s, background-color .15s; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop strong { font: 600 1.05rem var(--font-display); }
.drop span { color: var(--muted); font-size: .88rem; }
.drop u { text-decoration-color: var(--accent); text-underline-offset: 3px; }
.flist { list-style: none; margin: 0; padding: 0; display: grid; }
.flist li { display: grid; grid-template-columns: 1.6em minmax(0, 1fr) auto; gap: 8px; align-items: center; padding-block: 8px; border-top: 1px solid var(--line); font-size: .92rem; }
.flist li:first-child { border-top: 0; }
.flist .idx { font: .78rem var(--font-mono); color: var(--muted); }
.flist .fn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flist .fn small { color: var(--muted); margin-left: 6px; font-family: var(--font-mono); font-size: .76rem; }
.flist .acts { display: flex; gap: 2px; }
.ib { appearance: none; background: none; border: 0; color: var(--muted); font: 500 .85rem var(--font-mono); padding: 6px 8px; border-radius: var(--r-sm); cursor: pointer; min-width: 32px; min-height: 32px; }
.ib:hover:not(:disabled) { background: var(--sunken); color: var(--ink); }
.ib:disabled { opacity: .3; cursor: default; }
.opts-grid { display: grid; gap: 4px 16px; }
@media (min-width: 560px) { .opts-grid { grid-template-columns: 1fr 1fr; } }
.opts-grid .field { margin-bottom: 8px; }
.opts-grid .wide { grid-column: 1 / -1; }
.op-help { font-size: .88rem; color: var(--muted); margin-top: 6px; }
.run-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.progress { height: 4px; border-radius: 2px; background: var(--sunken); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s linear; }
.progress.busy i { width: 35% !important; animation: slide 1.1s ease-in-out infinite alternate; }
@keyframes slide { from { margin-left: 0; } to { margin-left: 65%; } }
.status { font-size: .92rem; color: var(--muted); min-height: 1.4em; }
.result { border: 1px solid var(--accent); background: var(--accent-soft); border-radius: var(--r-sm); padding: 12px 14px; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; }
.result b { font-weight: 550; overflow-wrap: anywhere; }
.result small { color: var(--muted); display: block; }
.fail { border: 1px solid color-mix(in oklch, var(--bad) 50%, var(--line)); border-left-width: 3px; background: var(--paper); border-radius: var(--r-sm); padding: 12px 14px; font-size: .94rem; }
.fail code { margin-left: 6px; font-size: .78rem; }
.try-curl { margin-top: 4px; }

/* ---------- docs ---------- */
.docs { display: grid; gap: 0 56px; padding-block: clamp(28px, 5vw, 56px) 96px; }
@media (min-width: 980px) { .docs { grid-template-columns: 220px minmax(0, 1fr); } .toc { position: sticky; top: 84px; align-self: start; max-height: calc(100dvh - 100px); overflow-y: auto; } }
.toc { font-size: .9rem; margin-bottom: 28px; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc li ul { border: 0; margin-left: 12px; }
.toc a { display: block; padding: 5px 0 5px 14px; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--ink); }
.toc a.on { color: var(--ink); border-left-color: var(--accent); }
.toc li ul a { padding-left: 14px; font-size: .86rem; }
@media (max-width: 979px) { .toc ul { columns: 2 180px; border: 0; } .toc a { border: 0; padding-left: 0; } }
.doc { min-width: 0; max-width: 780px; }
.doc h1 { font-size: clamp(2.1rem, 4.6vw, 3rem); margin-bottom: 14px; }
.doc > .lede { max-width: 56ch; margin-bottom: 8px; }
.doc section { padding-top: 48px; scroll-margin-top: 76px; }
.doc h2 { font-size: 1.7rem; margin-bottom: 14px; padding-top: 28px; border-top: 1px solid var(--line); }
.doc h3 { font-size: 1.25rem; margin: 36px 0 10px; scroll-margin-top: 76px; }
.doc h4 { font: 600 .95rem var(--font-body); margin: 22px 0 8px; }
.doc p, .doc ul, .doc ol { margin: 0 0 14px; max-width: 66ch; }
.doc li { margin-bottom: 4px; }
.doc .code { margin: 14px 0 18px; }
.doc a { text-decoration-color: var(--accent); }
.endpoint { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font: 500 .9rem var(--font-mono); margin-bottom: 12px; }
.endpoint .verb { background: var(--ink); color: var(--paper); border-radius: 3px; padding: 3px 7px; font-size: .75rem; }
.endpoint .cost { color: var(--muted); font-size: .8rem; margin-left: auto; }
.tbl-wrap { overflow-x: auto; margin: 10px 0 18px; border-top: 1px solid var(--ink); }
.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 480px; }
.tbl th, .tbl td { text-align: left; padding: 10px 14px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { font: 500 .78rem var(--font-mono); color: var(--muted); }
.tbl td:first-child { white-space: nowrap; }
.tbl code { white-space: nowrap; }
.callout { border-left: 2px solid var(--accent); padding: 4px 0 4px 16px; margin: 16px 0; color: var(--muted); max-width: 66ch; }
.callout strong { color: var(--ink); font-weight: 550; }

/* ---------- motion ---------- */
@media (prefers-reduced-motion: reduce) { .meter i, .progress i { transition: none; } .progress.busy i { animation: none; margin: 0; width: 100% !important; opacity: .5; } }
.faq dd + dd { margin-top: 0; }
@media (min-width: 860px) { .faq dd + dd { grid-column: 2; } }
#auth-eyebrow { display: none; } /* kit.js writes "Start free" here; the page's one signup label is "Get an API key" */
.keys li.empty { grid-template-columns: 1fr; }
.try-grid > :empty { display: none; }
.try-curl { margin-top: 16px; }
.meter { box-shadow: inset 0 0 0 1px var(--line); }
@media (max-width: 899px) { .tabs { grid-auto-columns: 1fr; overflow: visible; } .tab { white-space: normal; padding: 12px 8px; font-size: .9rem; text-align: center; } }
@media (max-width: 560px) { .acct a.hide-sm { display: none; } .acct { gap: 10px; } }
