/* TTech API site. Brand: indigo #4f46e5 + cyan #06b6d4. Light and dark themes via [data-theme]. */
:root {
  --bg: #ffffff;
  --bg-alt: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f1f3f9;
  --border: #e3e6ef;
  --border-strong: #cfd4e2;
  --text: #0f172a;
  --muted: #5b6478;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: #eef0ff;
  --on-primary: #ffffff;
  --accent: #0891b2;
  --accent-soft: #e6f8fc;
  --code-bg: #0d1324;
  --code-head: #151c31;
  --code-text: #dbe2f0;
  --code-border: #1f2842;
  --t-k: #a5b4fc;
  --t-s: #67e8f9;
  --t-n: #fcd34d;
  --t-b: #f9a8d4;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
  --shadow-hover: 0 2px 4px rgba(15, 23, 42, .06), 0 16px 40px rgba(79, 70, 229, .12);
  --grad: linear-gradient(120deg, #4f46e5 0%, #06b6d4 100%);
  --radius: 14px;
  --radius-sm: 10px;
  --wrap: 1140px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0a0e1a;
  --bg-alt: #0e1322;
  --surface: #121829;
  --surface-2: #182036;
  --border: #222b42;
  --border-strong: #2e3855;
  --text: #e7eaf3;
  --muted: #9ba4ba;
  --primary: #818cf8;
  --primary-hover: #a5b4fc;
  --primary-soft: #1c2147;
  --on-primary: #0a0e1a;
  --accent: #22d3ee;
  --accent-soft: #0f2a33;
  --code-bg: #070b15;
  --code-head: #0f1526;
  --code-border: #1d2640;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  --shadow-hover: 0 2px 4px rgba(0, 0, 0, .3), 0 16px 40px rgba(129, 140, 248, .14);
  --grad: linear-gradient(120deg, #818cf8 0%, #22d3ee 100%);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0a0e1a; --bg-alt: #0e1322; --surface: #121829; --surface-2: #182036; --border: #222b42;
    --border-strong: #2e3855; --text: #e7eaf3; --muted: #9ba4ba; --primary: #818cf8; --primary-hover: #a5b4fc;
    --primary-soft: #1c2147; --on-primary: #0a0e1a; --accent: #22d3ee; --accent-soft: #0f2a33;
    --code-bg: #070b15; --code-head: #0f1526; --code-border: #1d2640;
    --grad: linear-gradient(120deg, #818cf8 0%, #22d3ee 100%); color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body { margin: 0; font: 16px/1.65 var(--font); color: var(--text); background: var(--bg); text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .6em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.6vw, 3.25rem); letter-spacing: -.025em; }
h2 { font-size: clamp(1.5rem, 2.8vw, 2.1rem); letter-spacing: -.02em; }
h3 { font-size: 1.08rem; }
h4 { font-size: .95rem; margin-top: 1.4em; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
p { margin: 0 0 1em; }
code { font-family: var(--mono); font-size: .86em; background: var(--surface-2); border: 1px solid var(--border); padding: .08em .38em; border-radius: 6px; overflow-wrap: anywhere; }
hr { border: 0; border-top: 1px solid var(--border); margin: .5rem 0; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }
.center { text-align: center; justify-content: center; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--primary); color: var(--on-primary); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
.icon { width: 20px; height: 20px; flex: none; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* header */
.top { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px); border-bottom: 1px solid var(--border); }
.top-in { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 1.08rem; letter-spacing: -.01em; }
.brand:hover { color: var(--text); text-decoration: none; }
.brand img { border-radius: 8px; }
.brand b { font-weight: 700; color: var(--primary); margin-left: 3px; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { color: var(--muted); font-weight: 500; font-size: .95rem; padding: 8px 12px; border-radius: 8px; }
.nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.top-actions { display: flex; align-items: center; gap: 6px; }
.theme-toggle, .menu summary { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.theme-toggle:hover, .menu summary:hover { border-color: var(--border-strong); }
.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }
.menu { position: relative; display: none; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; right: 0; top: 48px; width: min(300px, 86vw); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px; display: grid; }
.menu-panel a { color: var(--text); padding: 10px 12px; border-radius: 8px; }
.menu-panel a:hover { background: var(--surface-2); text-decoration: none; }
@media (max-width: 820px) { .nav { display: none; } .menu { display: block; } .top-actions { margin-left: auto; } }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 11px; font: inherit; font-weight: 600; font-size: .96rem; border: 1px solid transparent; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, transform .15s, box-shadow .15s; }
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn .icon { width: 18px; height: 18px; }
.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 28%, transparent); }
.btn-primary:hover { background: var(--primary-hover); color: var(--on-primary); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { color: var(--text); border-color: var(--primary); }
.btn.copied { border-color: var(--accent); color: var(--accent); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 0; }

/* hero */
.hero { padding: 72px 0 56px; background:
  radial-gradient(900px 400px at 85% -10%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%),
  radial-gradient(800px 420px at 0% 0%, color-mix(in srgb, var(--primary) 14%, transparent), transparent 70%); border-bottom: 1px solid var(--border); }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.eyebrow { display: inline-block; font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); background: var(--primary-soft); padding: 5px 12px; border-radius: 999px; margin-bottom: 18px; }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--muted); max-width: 680px; }
.hero-points { list-style: none; padding: 0; margin: 26px 0 0; display: flex; flex-wrap: wrap; gap: 10px 22px; color: var(--muted); font-size: .95rem; }
.hero-points li { display: inline-flex; align-items: center; gap: 8px; }
.hero-points .icon { color: var(--accent); width: 18px; height: 18px; }
.hero-visual { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.prompt { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; font-size: .95rem; }
.prompt-who { display: block; font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px; }
.tool-calls { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.tool-calls span { display: inline-flex; align-items: center; gap: 6px; font: 500 .8rem var(--mono); color: var(--primary); background: var(--primary-soft); border-radius: 8px; padding: 5px 9px; }
.tool-calls .icon { width: 14px; height: 14px; }
.hero-visual .code { margin: 0; }
.hero-sub { padding: 40px 0 36px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: .88rem; color: var(--muted); margin-bottom: 22px; }
.crumbs a { color: var(--muted); }
.sub-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.toc { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--border); }
.toc a { font-size: .9rem; color: var(--muted); padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.toc a:hover { color: var(--text); border-color: var(--primary); text-decoration: none; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; gap: 32px; } .hero { padding: 48px 0 40px; } }

/* sections */
.section { padding: 64px 0; }
.section.alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section.tight { padding: 44px 0; }
.section-lead { color: var(--muted); max-width: 720px; margin-top: -4px; margin-bottom: 28px; }
.section h2 + .features, .section h2 + .cards, .section h2 + .tabs, .section h2 + .faq, .section h2 + .chips, .section h2 + .ticks, .section h2 + .table-wrap, .section h2 + .split, .section h2 + .code { margin-top: 24px; }
@media (max-width: 640px) { .section { padding: 44px 0; } }

/* features */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.feature { display: flex; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.feature > .icon { color: var(--primary); background: var(--primary-soft); border-radius: 10px; padding: 8px; width: 38px; height: 38px; }
.feature h3 { margin-bottom: .3em; font-size: 1rem; }
.feature p { margin: 0; color: var(--muted); font-size: .94rem; }

/* product cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; color: var(--text); box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s, border-color .18s; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); color: var(--text); text-decoration: none; }
.card h3 { margin: 14px 0 6px; font-size: 1.1rem; }
.card p { color: var(--muted); font-size: .94rem; flex: 1; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.more { display: inline-flex; align-items: center; gap: 6px; color: var(--primary); font-weight: 600; font-size: .92rem; }
.more .icon { width: 16px; height: 16px; transition: transform .18s; }
.card:hover .more .icon { transform: translateX(3px); }
.p-icon { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: var(--grad); color: #fff; }
.p-icon .icon { width: 24px; height: 24px; }
.p-icon.lg { width: 56px; height: 56px; border-radius: 14px; }
.p-icon.lg .icon { width: 28px; height: 28px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { font-size: .76rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); }
.badge-apify { color: var(--primary); background: var(--primary-soft); border-color: transparent; }
.badge-rapidapi { color: var(--accent); background: var(--accent-soft); border-color: transparent; }

/* code */
.code { background: var(--code-bg); border: 1px solid var(--code-border); border-radius: 12px; margin: 16px 0; overflow: hidden; min-width: 0; }
.code-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 8px 6px 14px; background: var(--code-head); border-bottom: 1px solid var(--code-border); font: 500 .78rem var(--mono); color: #8d97b3; }
.code pre { margin: 0; padding: 14px 16px; overflow: auto; max-height: 460px; font: .84rem/1.6 var(--mono); color: var(--code-text); tab-size: 2; white-space: pre-wrap; overflow-wrap: anywhere; }
.code pre code { background: none; border: 0; padding: 0; font-size: inherit; color: inherit; overflow-wrap: normal; }
.t-k { color: var(--t-k); } .t-s { color: var(--t-s); } .t-n { color: var(--t-n); } .t-b { color: var(--t-b); }
.copy { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.code .copy { font: 600 .78rem var(--font); color: #c7cfe2; background: transparent; border: 1px solid #2a3452; border-radius: 8px; padding: 5px 10px; }
.code .copy:hover { border-color: #4b5785; color: #fff; }
.code .copy .icon { width: 14px; height: 14px; }
.code .copy.copied { color: #67e8f9; border-color: #67e8f9; }

/* tabs */
.tabs { margin-top: 8px; min-width: 0; }
.tablist { display: flex; gap: 4px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tablist button { font: 600 .93rem var(--font); color: var(--muted); background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 14px; cursor: pointer; white-space: nowrap; margin-bottom: -1px; }
.tablist button:hover { color: var(--text); }
.tablist button[aria-selected="true"] { color: var(--primary); border-bottom-color: var(--primary); }
.market-tabs > .tablist button { font-size: .98rem; }
.tabs .tabs .tablist { border-bottom: 0; background: var(--surface-2); border-radius: 10px; padding: 4px; display: inline-flex; max-width: 100%; margin-bottom: 0; }
.tabs .tabs .tablist button { border: 0; border-radius: 8px; padding: 6px 12px; font-size: .86rem; margin: 0; }
.tabs .tabs .tablist button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); margin: 14px 0; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 11px 14px; vertical-align: top; border-bottom: 1px solid var(--border); }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--surface-2); font-weight: 600; }
tbody tr:last-child td { border-bottom: 0; }
td code { white-space: nowrap; }
.params td:first-child { min-width: 150px; }
.params td:nth-child(3) { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.compare td:first-child { font-weight: 600; white-space: nowrap; }
.mcp-table td code { white-space: normal; word-break: break-all; }
.method { display: inline-block; font: 700 .7rem var(--mono); padding: 2px 7px; border-radius: 6px; vertical-align: 1px; }
.m-get { color: #059669; background: color-mix(in srgb, #10b981 14%, transparent); }
.m-post { color: #d97706; background: color-mix(in srgb, #f59e0b 16%, transparent); }

/* layout helpers */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; align-items: start; }
.split > * { min-width: 0; }
.split-out { grid-template-columns: 1fr 1fr; }
@media (max-width: 900px) { .split, .split-out { grid-template-columns: 1fr; gap: 20px; } }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 0 0 24px; display: grid; gap: 14px; }
.steps li { counter-increment: s; position: relative; padding: 14px 16px 14px 60px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.steps li::before { content: counter(s); position: absolute; left: 16px; top: 14px; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 700; color: #fff; background: var(--grad); }
.steps strong { display: block; }
.steps span { color: var(--muted); font-size: .93rem; }
.steps-row { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
ol.numbered { padding-left: 1.3em; margin: 0 0 1.2em; }
ol.numbered li { margin: .35em 0; padding-left: .2em; }
.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.ticks li { display: flex; gap: 12px; align-items: flex-start; }
.ticks .icon { color: var(--accent); margin-top: 3px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chips span { padding: 8px 16px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-weight: 500; font-size: .94rem; }

/* faq */
.faq { display: grid; gap: 10px; max-width: 860px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 0 18px; }
.faq summary { cursor: pointer; list-style: none; font-weight: 600; padding: 16px 28px 16px 0; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 2px; top: 50%; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-70%) rotate(45deg); transition: transform .2s; }
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq details p { color: var(--muted); margin: 0 0 16px; }

/* brief + cta */
.brief-box { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-top: 28px; padding: 22px; border-radius: var(--radius); border: 1px dashed var(--border-strong); background: var(--surface); }
.brief-box h3 { display: flex; align-items: center; gap: 8px; }
.brief-box p { color: var(--muted); margin: 0; max-width: 640px; font-size: .94rem; }
.cta-band { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: 36px; border-radius: 20px; background: var(--grad); color: #fff; }
.cta-band h2 { color: #fff; margin-bottom: .3em; }
.cta-band p { margin: 0; opacity: .9; }
.cta-band .cta-row { margin: 0; }
.cta-band .btn-primary { background: #fff; color: #312e81; box-shadow: none; }
.cta-band .btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
.cta-band .btn-ghost:hover { border-color: #fff; }
.prose h2 { font-size: 1.35rem; margin-top: 1.6em; }
.prose ul { padding-left: 1.2em; }

/* footer */
.foot { border-top: 1px solid var(--border); background: var(--bg-alt); padding: 48px 0 24px; margin-top: 0; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; }
.foot h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.foot ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: .93rem; }
.foot ul a { color: var(--text); }
.foot-bottom { border-top: 1px solid var(--border); margin-top: 32px; padding-top: 18px; }
@media (max-width: 820px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .foot-grid { grid-template-columns: 1fr; } .btn { width: 100%; } .cta-band { padding: 26px; } .code pre { font-size: .8rem; } }
