/* pyocr-toolkit project site. Colours mirror the app's own design tokens
   (src/pyocr_toolkit/static/styles.css) so the site and the app feel like one product. */
:root {
  color-scheme: light;
  --bg: #f7f7f9; --bg-alt: #eff0f3; --surface: #fff; --surface-2: #f4f5f7;
  --border: #e8e9ee; --border-strong: #d7d9e0;
  --text: #17181c; --muted: #646b78; --subtle: #9aa0ab;
  --accent: #4f46e5; --accent-hover: #4338ca; --accent-soft: #eef0ff; --accent-text: #fff;
  --good: #15803d; --bad: #dc2626; --del-bg: #fde2e2; --ins-bg: #d9f3e1;
  --src-native: #64748b; --src-ocr: #b45309; --src-llm: #4f46e5;
  --native-soft: #eef1f5; --ocr-soft: #fdf3e3; --llm-soft: #eef0ff;
  --code-bg: #15171c; --code-text: #e7e9ed;
  --shadow: 0 12px 32px rgba(16,18,27,.10), 0 2px 6px rgba(16,18,27,.06);
  --shadow-sm: 0 1px 2px rgba(16,18,27,.04), 0 1px 3px rgba(16,18,27,.05);
  --topbar-bg: rgba(255,255,255,.82);
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "JetBrains Mono", SFMono-Regular, Menlo, Consolas, monospace;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1014; --bg-alt: #121419; --surface: #16191f; --surface-2: #1d2128;
  --border: #252a32; --border-strong: #323843;
  --text: #e7e9ed; --muted: #99a1ad; --subtle: #6c7480;
  --accent: #8b8ff8; --accent-hover: #a3a6fa; --accent-soft: rgba(139,143,248,.14); --accent-text: #0e1014;
  --good: #4ade80; --bad: #f87171; --del-bg: rgba(248,113,113,.22); --ins-bg: rgba(74,222,128,.2);
  --src-native: #94a3b8; --src-ocr: #fbbf24; --src-llm: #a3a6fa;
  --native-soft: rgba(148,163,184,.13); --ocr-soft: rgba(251,191,36,.12); --llm-soft: rgba(139,143,248,.14);
  --code-bg: #0a0b0e;
  --shadow: 0 14px 36px rgba(0,0,0,.5); --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --topbar-bg: rgba(14,16,20,.8);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; height: auto; display: block; }
code, pre, kbd { font-family: var(--mono); }
:not(pre) > code { font-size: .88em; background: var(--surface-2); border: 1px solid var(--border); padding: .08em .38em; border-radius: 5px; }
kbd { font-size: .8em; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px; padding: 0 .4em; background: var(--surface); }
h1, h2, h3 { letter-spacing: -.02em; line-height: 1.15; margin: 0; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.wrap.narrow { max-width: 820px; }

/* ---------- top bar */
.topbar { position: sticky; top: 0; z-index: 10; background: var(--topbar-bg); backdrop-filter: saturate(1.6) blur(12px); border-bottom: 1px solid var(--border); }
.topbar-inner { display: flex; align-items: center; gap: 28px; height: 60px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; color: var(--text); font-size: 17px; }
.brand:hover { color: var(--text); }
.brand span { color: var(--subtle); font-weight: 500; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { color: var(--muted); font-size: 14px; font-weight: 500; padding: 6px 11px; border-radius: 7px; }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.top-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { color: var(--text); }
.icon-btn svg, .ficon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
:root[data-theme="dark"] .sun, :root:not([data-theme="dark"]) .moon { display: none; }

/* ---------- buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; padding: 11px 20px; border-radius: 10px; border: 1px solid transparent; transition: background .15s, transform .15s; }
.btn:hover { transform: translateY(-1px); }
.btn.small { font-size: 14px; padding: 7px 14px; }
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: var(--accent-hover); color: var(--accent-text); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }
.gh { width: 16px; height: 16px; }

/* ---------- hero */
.hero { padding: 84px 0 40px; text-align: center; position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: -200px 0 auto; height: 620px; z-index: -1;
  background: radial-gradient(600px 300px at 30% 30%, rgba(79,70,229,.16), transparent 70%),
              radial-gradient(500px 280px at 72% 20%, rgba(139,92,246,.14), transparent 70%); }
.eyebrow { display: inline-block; font-size: 13px; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 5px 12px; border-radius: 999px; margin: 0 0 22px; }
.hero h1 { font-size: clamp(36px, 6vw, 64px); font-weight: 800; letter-spacing: -.035em; }
.grad { background: linear-gradient(120deg, #4f46e5, #8b5cf6 60%, #ec4899); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { max-width: 720px; margin: 22px auto 0; font-size: 18.5px; color: var(--muted); }
.lede b { color: var(--text); font-weight: 600; }
.cta { display: flex; gap: 12px; justify-content: center; margin-top: 32px; flex-wrap: wrap; }
.cmd { display: inline-flex; align-items: center; gap: 12px; margin-top: 22px; background: var(--code-bg); color: var(--code-text); border-radius: 10px; padding: 8px 8px 8px 18px; max-width: 100%; }
.cmd code { background: none; border: 0; padding: 0; color: inherit; font-size: 14px; white-space: nowrap; overflow-x: auto; }
.cmd .prompt { color: #8b8ff8; margin-right: 8px; user-select: none; }
.copy { font: 600 12.5px var(--sans); color: #c9cbd3; background: #262a33; border: 0; border-radius: 7px; padding: 7px 12px; cursor: pointer; flex: none; }
.copy:hover { background: #323743; color: #fff; }

/* ---------- window frame for recordings and stills */
.window { margin: 0; border-radius: 14px; overflow: hidden; border: 1px solid var(--border-strong); background: var(--surface); box-shadow: var(--shadow); }
.window-bar { display: flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.window-bar i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.window-bar i:nth-child(2) { background: #febc2e; } .window-bar i:nth-child(3) { background: #28c840; }
.window-bar span { flex: 1; text-align: center; font-size: 12.5px; color: var(--subtle); margin-right: 48px; }
.hero-shot { margin-top: 56px; }
.window img, .window video { display: block; width: 100%; height: auto; }
/* The hero's video where it can be read and may move; the inspector's still in its place otherwise */
.hero-video { background: #0b0c10; cursor: pointer; aspect-ratio: 1280 / 800; }
.hero-still { display: none !important; }
@media (max-width: 600px), (prefers-reduced-motion: reduce) {
  .hero-video { display: none !important; }
  .hero-still { display: block !important; }
}

/* ---------- sections */
.section { padding: 88px 0; }
.section.alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-title { font-size: clamp(28px, 4vw, 38px); font-weight: 800; text-align: center; }
.section-sub { text-align: center; color: var(--muted); margin: 12px auto 0; max-width: 640px; font-size: 17px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 44px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 26px; box-shadow: var(--shadow-sm); }
.card h3 { font-size: 19px; margin: 14px 0 8px; }
.card p { color: var(--muted); margin: 0; font-size: 15px; }

.pill { display: inline-block; font-size: 12.5px; font-weight: 700; padding: 4px 11px; border-radius: 999px; }
.pill.native { color: var(--src-native); background: var(--native-soft); }
.pill.ocr { color: var(--src-ocr); background: var(--ocr-soft); }
.pill.llm { color: var(--src-llm); background: var(--llm-soft); }
.pros-cons { list-style: none; padding: 16px 0 0; margin: 16px 0 0; border-top: 1px solid var(--border); font-size: 14.5px; }
.pros-cons li { padding-left: 24px; position: relative; margin: 6px 0; }
.pros-cons li::before { position: absolute; left: 0; font-weight: 700; }
.pro::before { content: "✓"; color: var(--good); }
.con::before { content: "✕"; color: var(--bad); }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px 32px; margin-top: 52px; }
.feature h3 { font-size: 17px; margin: 14px 0 6px; }
.feature p { color: var(--muted); margin: 0; font-size: 15px; }
.ficon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); }
.ficon svg { width: 20px; height: 20px; }

/* ---------- tour */
.tabs { display: flex; justify-content: center; gap: 6px; margin: 36px 0 28px; flex-wrap: wrap; }
.tab { font: 600 14px var(--sans); color: var(--muted); background: var(--surface); border: 1px solid var(--border); padding: 8px 16px; border-radius: 999px; cursor: pointer; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent-text); background: var(--accent); border-color: var(--accent); }
.tour { display: grid; grid-template-columns: 300px 1fr; gap: 36px; align-items: start; }
.tour-item h3 { font-size: 24px; margin-bottom: 12px; }
.tour-item p { color: var(--muted); font-size: 15.5px; }
.tour-item p b { color: var(--text); }
.note { font-size: 14px !important; border-left: 3px solid var(--accent); padding-left: 12px; }

/* ---------- install */
.install pre { margin: 14px 0 0; }
.install h3 { margin-top: 0; display: flex; align-items: center; gap: 10px; }
.install h3 small { font-size: 11.5px; font-weight: 600; color: var(--good); background: color-mix(in srgb, var(--good) 12%, transparent); padding: 2px 8px; border-radius: 999px; }
.num { width: 26px; height: 26px; border-radius: 7px; background: var(--accent-soft); color: var(--accent); font-size: 13px; display: grid; place-items: center; }
pre { background: var(--code-bg); color: var(--code-text); border-radius: 10px; padding: 16px 18px; overflow-x: auto; font-size: 13.5px; line-height: 1.65; margin: 0; }
.run { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
.terminal { border-radius: 14px; overflow: hidden; background: var(--code-bg); border: 1px solid var(--border-strong); box-shadow: var(--shadow-sm); }
.terminal .window-bar { background: #1b1e25; border-color: #262a33; }
.terminal .window-bar span { color: #7a818d; }
.terminal pre { border-radius: 0; padding: 18px 20px; }
.terminal .c { color: #6c7480; } .terminal .p { color: #8b8ff8; user-select: none; }
.tess { margin-top: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; }
.tess summary { cursor: pointer; font-weight: 600; }
.tess pre { margin-top: 14px; }

/* ---------- providers */
.providers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 44px; }
.prov { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; display: flex; flex-direction: column; gap: 3px; }
.prov b { font-size: 16.5px; }
.prov span { color: var(--muted); font-size: 14px; }
.prov code { align-self: flex-start; margin-top: 8px; font-size: 12px !important; }
.formats { text-align: center; color: var(--muted); margin-top: 30px; font-size: 15px; }

/* ---------- how */
.how { list-style: none; padding: 0; margin: 44px 0 0; counter-reset: s; }
.how li { counter-increment: s; position: relative; padding: 0 0 30px 60px; }
.how li::before { content: counter(s); position: absolute; left: 0; top: -4px; width: 38px; height: 38px; border-radius: 10px; background: var(--accent); color: var(--accent-text); font-weight: 700; display: grid; place-items: center; }
.how li:not(:last-child)::after { content: ""; position: absolute; left: 18px; top: 40px; bottom: 4px; width: 2px; background: var(--border-strong); }
.how h3 { font-size: 19px; margin-bottom: 6px; }
.how p { margin: 0 0 10px; color: var(--muted); }
.how b { color: var(--text); }
.example { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; margin: 14px 0; display: grid; gap: 6px; font-size: 15px; }
.example .lbl { display: inline-block; width: 96px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--subtle); }
.example code { background: none !important; border: 0 !important; font-size: 15px !important; }
.del { background: var(--del-bg); border-radius: 3px; padding: 0 2px; }
.ins { background: var(--ins-bg); border-radius: 3px; padding: 0 2px; }
.calc { color: var(--muted); border-top: 1px solid var(--border); padding-top: 8px; margin-top: 4px; }

/* ---------- final + footer */
.final { text-align: center; }
.final h2 { font-size: clamp(28px, 4.5vw, 44px); font-weight: 800; margin-bottom: 8px; }
.center { justify-content: center; }
.footer { border-top: 1px solid var(--border); padding: 28px 0; color: var(--subtle); font-size: 14px; }
.footer .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.footer a { color: var(--muted); }

/* ---------- responsive */
@media (max-width: 960px) {
  .nav { display: none; }
  .topbar-inner { justify-content: space-between; }
  .grid3, .features, .providers { grid-template-columns: 1fr 1fr; }
  .tour { grid-template-columns: 1fr; }
  .run { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .grid3, .features, .providers { grid-template-columns: 1fr; }
  .hero { padding-top: 56px; }
  .section { padding: 64px 0; }
  .cmd code { font-size: 12.5px; }
}

/* grid children default to min-width:auto, so a long code line would widen the column;
   let them shrink and scroll the <pre> instead */
.grid3 > *, .run > *, .tour > *, .providers > *, .features > * { min-width: 0; }
.cmd { max-width: calc(100vw - 48px); }
.cmd code { min-width: 0; }
