/* Pagepull. A developer tool: dark, quiet, code is the picture.
   Layout: split hero with a request/response window; a live request builder underneath. */
:root {
  --bg: #0a0d18; --surface: #121728; --surface-2: #1a2036; --tint: #0d1120;
  --text: #dfe5f5; --heading: #ffffff; --muted: #8f9ab8; --border: #212943; --border-strong: #2f3959; --field: #0d1120; --placeholder: #5d6888;
  --brand: #7aa7ff; --brand-hover: #98bbff; --brand-ink: #071127; --brand-soft: rgba(122,167,255,.14); --ring: rgba(122,167,255,.25);
  --ok: #5fdca0; --ok-soft: rgba(95,220,160,.13); --bad: #ff8589; --bad-soft: rgba(255,133,137,.13); --warn: #ffc56b; --warn-soft: rgba(255,197,107,.13);
  --radius: 14px; --radius-sm: 9px;
  --shadow: 0 0 0 1px rgba(255,255,255,.02) inset;
  --shadow-lg: 0 40px 80px -40px rgba(60,110,255,.45), 0 0 0 1px rgba(122,167,255,.25);
  --head-bg: rgba(10,13,24,.8);
  --feature-bg: linear-gradient(180deg, #18244a 0%, #121a36 100%); --feature-border: #7aa7ff; --feature-text: #ffffff; --feature-flag-bg: #7aa7ff; --feature-flag-text: #071127; --feature-btn-bg: #7aa7ff; --feature-btn-text: #071127;
  --closer-bg: linear-gradient(180deg, #16224a 0%, #101832 100%); --closer-text: #ffffff; --closer-btn-bg: #7aa7ff; --closer-btn-text: #071127;
  --code-bg: #0d1120; --code-border: #212943; --code-text: #cfd8ee; --code-dim: #66728f; --code-key: #7aa7ff; --code-str: #9be8bd; --code-num: #ffc56b;
  --toast-bg: #1a2036;
  --font: 'Hanken Grotesk', 'Segoe UI', system-ui, sans-serif; --font-display: 'Hanken Grotesk', 'Segoe UI', system-ui, sans-serif; --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --display-weight: 700; --tracking: -0.03em;
  color-scheme: dark;
}
.btn-secondary, .pack:not(.is-featured) .pack-buy { background: transparent; }
.btn-secondary:hover, .pack:not(.is-featured) .pack-buy:hover { background: var(--surface-2); }
.closer { border: 1px solid var(--border-strong); }
.keybox code { color: var(--ok); }

.hero { padding: 88px 0 104px; background: radial-gradient(760px 420px at 78% 10%, rgba(70,120,255,.2), transparent 70%); }
.hero-grid { display: grid; grid-template-columns: 1fr 1.08fr; gap: 64px; align-items: center; }
.hero-copy { display: grid; gap: 26px; }
.hero h1 { font-size: clamp(38px, 4.4vw, 58px); }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero .window { box-shadow: var(--shadow-lg); }
.split-out { border-top: 1px solid var(--border); }
.split-out .window-bar { border-bottom: 0; padding-bottom: 0; color: var(--ok); }

/* Modes */
.modes { border-top: 1px solid var(--border); }
.mode { display: grid; grid-template-columns: 240px 1fr auto; gap: 32px; align-items: baseline; padding: 26px 0; border-bottom: 1px solid var(--border); }
.mode p { color: var(--muted); max-width: 60ch; }
.mode b { font: 600 15px var(--mono); color: var(--brand); white-space: nowrap; }

/* Code examples: one scrape request as cURL / Node.js / Python tabs.
   Tabs are hidden radios + labels, so they work without JavaScript. */
.code-grid { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 64px; align-items: start; }
.code-copy .section-head { margin-bottom: 32px; }
.facts { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--border); }
.facts li { display: grid; gap: 6px; padding: 18px 0; border-bottom: 1px solid var(--border); }
.facts h3 { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; font-size: 17px; }
.facts h3 code { font: 500 12.5px var(--mono); letter-spacing: 0; color: var(--brand); white-space: nowrap; }
.facts p { color: var(--muted); font-size: 15px; }
.code-tabs { position: relative; min-width: 0; margin: 0; padding: 0; border: 0; }
.visually-hidden, .tab-radio { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.code-tabs .window { box-shadow: 0 0 0 1px rgba(122,167,255,.08); }
.tab-bar { gap: 4px; padding-block: 0; }
.tab-bar i { margin-right: 10px; }
.tab-bar label { padding: 13px 12px 11px; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; color: var(--code-dim); transition: color .15s, border-color .15s; }
.tab-bar label:hover { color: var(--code-text); }
.tab-path { margin-left: auto; }
.code-panel { display: none; }
#lang-curl:checked ~ .window .code-curl, #lang-node:checked ~ .window .code-node, #lang-python:checked ~ .window .code-python { display: block; }
#lang-curl:checked ~ .window [for="lang-curl"], #lang-node:checked ~ .window [for="lang-node"], #lang-python:checked ~ .window [for="lang-python"] { color: var(--heading); border-bottom-color: var(--brand); }
#lang-curl:focus-visible ~ .window [for="lang-curl"], #lang-node:focus-visible ~ .window [for="lang-node"], #lang-python:focus-visible ~ .window [for="lang-python"] { outline: 2px solid var(--brand); outline-offset: -4px; border-radius: 8px; }
.code-tabs pre { min-height: 394px; } /* tallest panel (Python, 16 lines), so switching tabs does not shift the page */
.code-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; padding: 12px 20px; border-top: 1px solid var(--border); font: 500 12.5px var(--mono); color: var(--code-dim); }
.code-foot span:last-child { color: var(--ok); }

/* Pricing as a rate table: one row per pack (client.js renders .packs > article.pack).
   Columns: name & who it's for | credits | per-credit price & bonus | price | buy. Also used on pricing.html and the dashboard. */
.rate-table, .packs { --rate-cols: minmax(150px, 1.5fr) minmax(130px, 1fr) minmax(0, 1.4fr) minmax(96px, .8fr) 148px; }
.rate-table { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.rate-head { display: grid; grid-template-columns: var(--rate-cols); gap: 0 24px; padding: 13px 24px; border-bottom: 1px solid var(--border); font: 500 12px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--code-dim); }
.rate-head span:nth-child(4) { text-align: right; }
.packs { display: flex; flex-direction: column; gap: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.rate-table .packs { background: transparent; border: 0; border-radius: 0; }
.packs .pack { display: grid; grid-template-columns: var(--rate-cols); grid-template-areas: "name credits rate price buy" "for credits rate price buy" "flag credits rate price buy"; gap: 0 24px; align-items: center; padding: 18px 24px; background: transparent; border: 0; border-radius: 0; box-shadow: none; color: var(--text); }
.packs .pack + .pack { border-top: 1px solid var(--border); }
.packs .pack.is-featured { background: linear-gradient(90deg, var(--brand-soft), transparent 75%); box-shadow: inset 3px 0 0 var(--brand); }
.packs .pack-name { grid-area: name; font: 600 16px var(--font); color: var(--heading); opacity: 1; }
.packs .pack-for { grid-area: for; margin: 2px 0 0; font-size: 13.5px; line-height: 1.4; color: var(--muted); }
.packs .pack-flag { grid-area: flag; position: static; justify-self: start; margin-top: 8px; padding: 4px 8px; font-size: 11.5px; }
.packs .pack-credits { grid-area: credits; margin: 0; font: 500 14.5px var(--mono); color: var(--heading); }
.packs .pack-rate { grid-area: rate; margin: 0; font: 400 13px var(--mono); color: var(--muted); opacity: 1; }
.packs .pack .pack-price { grid-area: price; margin: 0; font: 700 22px/1.2 var(--font-display); letter-spacing: -0.02em; text-align: right; color: var(--heading); }
.packs .pack-buy { grid-area: buy; width: 100%; margin: 0; padding: 10px 14px; font-size: 14px; }

/* Closing call to action, split: copy on the left, a one-line request on the right */
.closer-split { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 48px; align-items: center; justify-items: stretch; text-align: left; padding: 56px; }
.closer-copy { display: grid; gap: 20px; justify-items: start; }
.closer-term pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13.5px; }

/* Request builder */
.builder { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.builder form { display: grid; gap: 16px; }
.opts { display: flex; gap: 24px; flex-wrap: wrap; align-items: center; font-size: 14.5px; }
.opts label { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.opts select { width: auto; padding: 6px 10px; }
.meter { display: flex; justify-content: space-between; align-items: center; padding-top: 16px; border-top: 1px solid var(--border); font-size: 14.5px; color: var(--muted); }
.meter b { font: 700 20px var(--font-display); color: var(--heading); }
.response { display: grid; grid-template-rows: auto 1fr; min-height: 420px; }
.response #response, .response #dash-out { padding: 18px; }
.response .result-json { padding: 0; background: transparent; max-height: 460px; }
.placeholder { color: var(--code-dim); }
.assure li::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%237aa7ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 6.5l2.5 2.5 4.5-5.5'/%3E%3C/svg%3E"); }

/* Product page hero: copy beside a "what it costs" panel (list filled from config.js by client.js) */
.page-hero.split .wrap { grid-template-columns: minmax(0, 1fr) minmax(0, .8fr); align-items: center; column-gap: 64px; }
.page-hero.split .hero-copy { display: grid; gap: 22px; justify-items: start; }
.price-panel { width: 100%; padding: 0; overflow: hidden; box-shadow: var(--shadow-lg); }
.price-panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border); font-size: 14.5px; }
.price-panel-head b { font-weight: 600; color: var(--heading, var(--text)); }
.price-panel-head .badge { margin: 0; }
.price-panel .costs { margin: 0; }
.price-panel .costs li { padding: 14px 22px; }
.price-panel .costs li:first-child { border-top: 0; }
.price-panel-foot { margin: 0; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--tint, transparent); font-size: 13.5px; color: var(--muted); }

/* Checkout: status line and the optional extra credits on top of a pack (client.js) */
.co-side [data-state="error"] { color: var(--bad); }
.co-extra { display: grid; gap: 8px; margin-top: 18px; }
.co-extra[hidden] { display: none; }
.co-extra small { font-size: 13.5px; }
.co-extra .option-amount { justify-self: start; margin-left: 0; font-weight: 600; color: var(--text); }
.co-extra .option-amount input { margin-top: 0; width: 120px; }

/* ---------- Pricing page (pricing.html) ----------
   Docs-like: a left-aligned header with an "On this page" list, then short sections
   (packs, worked estimates, pay-as-you-go windows, FAQ) and the homepage's split closer. */
.price-intro { padding: 72px 0 48px; border-bottom: 1px solid var(--border); background: radial-gradient(640px 320px at 12% 0%, rgba(70,120,255,.14), transparent 70%); }
.price-intro .wrap { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 32px 64px; align-items: end; }
.price-intro-copy { display: grid; gap: 18px; justify-items: start; }
.price-intro h1 { font-size: clamp(34px, 4.2vw, 52px); max-width: 20ch; }
.price-intro .lead { max-width: 60ch; }
.eyebrow { font: 500 12.5px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--brand); }
.page-toc { display: grid; gap: 10px; padding-left: 20px; border-left: 1px solid var(--border-strong); font: 400 13.5px var(--mono); }
.page-toc p { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--code-dim); }
.page-toc ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.page-toc a { color: var(--muted); text-decoration: none; }
.page-toc a:hover { color: var(--heading); }
.page-toc a::before { content: '# '; color: var(--code-dim); }

.price-sec { padding: 80px 0; scroll-margin-top: 68px; }
.price-sec-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 24px; margin-bottom: 24px; }
.price-sec-head h2 { font-size: clamp(24px, 2.4vw, 30px); }
.price-sec-head p { font-size: 15px; }
.price-sec .section-head { margin-bottom: 0; }
.price-sec .section-head h2 { font-size: clamp(26px, 2.8vw, 36px); }

/* Estimate a job: worked examples from the per-request costs in config.js */
.estimate-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 56px; align-items: start; }
.estimate { box-shadow: 0 0 0 1px rgba(122,167,255,.08); }
.estimate-scroll { overflow-x: auto; }
.estimate-table { width: 100%; border-collapse: collapse; font: 400 13.5px/1.5 var(--mono); font-variant-numeric: tabular-nums; }
.estimate-table th { padding: 12px 20px; border-bottom: 1px solid var(--code-border); font: 500 11.5px var(--mono); letter-spacing: .06em; text-transform: uppercase; text-align: left; color: var(--code-dim); }
.estimate-table td { padding: 14px 20px; border-bottom: 1px solid var(--code-border); vertical-align: baseline; }
.estimate-table tbody tr:last-child td { border-bottom: 0; }
.est-mix { color: var(--code-text); }
.est-math { color: var(--code-dim); white-space: nowrap; }
.estimate-table .est-credits { text-align: right; white-space: nowrap; }
td.est-credits { color: var(--code-num); font-weight: 500; }
.est-free td.est-credits { color: var(--ok); }

/* Pay as you go + cost list, as two terminal-style windows */
.price-windows { margin-top: 0; }
.price-windows .window { display: flex; flex-direction: column; }
.window-body { padding: 24px; }
.price-windows h3 { color: var(--heading); }
.price-windows [data-payg-preview] { display: block; margin-top: 10px; font: 500 13.5px var(--mono); color: var(--ok); }
.price-windows .inline input { font-family: var(--mono); }
.price-windows .costs li { border-top-color: var(--code-border); font-size: 14px; }
.price-windows .costs b { font: 500 13.5px var(--mono); color: var(--code-num); }

/* FAQ: heading on the left, questions on the right */
.faq-grid { display: grid; grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr); gap: 56px; align-items: start; }
.faq-grid .faq { max-width: none; margin: 0; border-top: 1px solid var(--border); }
.faq-grid .faq summary { padding-top: 18px; padding-bottom: 18px; }
.faq-grid .faq summary::after { top: 14px; }

@media (max-width: 980px) {
  .page-hero.split .wrap { grid-template-columns: 1fr; row-gap: 40px; }
  .hero-grid, .builder { grid-template-columns: 1fr; gap: 40px; }
  .hero { padding: 56px 0 72px; }
  .mode { grid-template-columns: 1fr auto; gap: 8px 24px; }
  .mode p { grid-column: 1 / -1; order: 3; }
  .code-grid, .closer-split { grid-template-columns: 1fr; gap: 40px; }
  .code-tabs pre { min-height: 0; }
  .closer-split { padding: 48px 32px; }
  .rate-head { display: none; }
  .packs .pack { grid-template-columns: auto minmax(0, 1fr) auto 132px; grid-template-areas: "name flag price buy" "for for price buy" "credits rate price buy"; gap: 4px 16px; padding: 16px 20px; }
  .packs .pack-flag { margin: 0; align-self: center; }
  .packs .pack-for { margin: 0 0 4px; }
  .price-intro { padding: 56px 0 40px; }
  .price-intro .wrap, .estimate-grid, .faq-grid { grid-template-columns: 1fr; gap: 32px; }
  .page-toc { padding: 16px 0 0; border-left: 0; border-top: 1px solid var(--border); }
  .page-toc ul { display: flex; flex-wrap: wrap; gap: 6px 20px; }
  .price-sec { padding: 64px 0; }
}
@media (max-width: 560px) {
  .tab-bar i, .tab-path { display: none; }
  .tab-bar { padding-inline: 8px; }
  .closer-split { padding: 40px 20px; }
  .packs .pack { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "flag flag" "name price" "for for" "credits credits" "rate rate" "buy buy"; gap: 2px 12px; padding: 18px; }
  .packs .pack-flag { margin: 0 0 8px; }
  .packs .pack-for { margin: 0 0 6px; }
  .packs .pack-buy { margin-top: 12px; }
  /* Estimate table stacks: request mix on top, math and credits on one line below */
  .estimate-table, .estimate-table tbody { display: block; }
  .estimate-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .estimate-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; padding: 14px 16px; border-bottom: 1px solid var(--code-border); }
  .estimate-table tbody tr:last-child { border-bottom: 0; }
  .estimate-table td { padding: 0; border: 0; }
  .estimate-table .est-mix { grid-column: 1 / -1; }
  .estimate-table .est-math { white-space: normal; }
  .window-body { padding: 20px; }
  .price-windows .costs li { gap: 12px; }
}
