/* TextLens website — shared styles for index.html and docs.html */

:root {
  color-scheme: dark;
  --bg: #0a0d0b;
  --bg-2: #0d110e;
  --surface: #111713;
  --surface-2: #151d18;
  --border: #1f2b23;
  --border-2: #2a3a2f;
  --text: #e7eee8;
  --text-2: #b4c1b7;
  --muted: #7f8f83;
  --accent: #70df7f;
  --accent-2: #4ccb5f;
  --accent-soft: rgba(112, 223, 127, 0.1);
  --accent-line: rgba(112, 223, 127, 0.28);
  --warn: #f5c451;
  --code-bg: #0b0f0c;
  --kw: #c8a8ff;
  --str: #a6e3ad;
  --fn: #7fc8ff;
  --num: #ffcb6b;
  --com: #5e7163;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --header-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
h1, h2, h3 { text-wrap: balance; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
code, pre, kbd { font-family: var(--mono); }
:not(pre) > code {
  font-size: 0.86em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 6px;
  color: var(--text);
  white-space: nowrap;
}
::selection { background: rgba(112, 223, 127, 0.3); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.container { width: min(1160px, 100% - 32px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Header ─────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: rgba(10, 13, 11, 0.82);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-inner { height: 100%; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 17px; letter-spacing: -0.3px; }
.brand:hover { text-decoration: none; }
.brand img { height: 22px; width: auto; }
.version-pill {
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-line);
  padding: 2px 7px; border-radius: 999px;
}
.nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.nav a { color: var(--text-2); font-size: 14px; font-weight: 500; padding: 6px 10px; border-radius: 8px; }
.nav a:hover, .nav a.active { color: var(--text); background: var(--surface-2); text-decoration: none; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.gh-button {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--text); font-size: 13px; font-weight: 600;
  border: 1px solid var(--border-2); border-radius: 9px; padding: 7px 12px;
  background: var(--surface);
}
.gh-button:hover { border-color: var(--accent-line); text-decoration: none; }
.gh-button svg { width: 16px; height: 16px; }
.gh-stars { color: var(--muted); font-weight: 500; padding-left: 8px; border-left: 1px solid var(--border-2); }
.gh-stars:empty { display: none; }
.menu-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--border-2); border-radius: 8px; padding: 7px; color: var(--text); cursor: pointer; }
.menu-toggle svg { width: 20px; height: 20px; display: block; }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 15px; font-weight: 600; border-radius: 10px; padding: 11px 18px;
  border: 1px solid transparent; transition: background .15s, border-color .15s, transform .15s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #07210c; }
.btn-primary:hover { background: #86e893; }
.btn-ghost { color: var(--text); border-color: var(--border-2); background: var(--surface); }
.btn-ghost:hover { border-color: var(--accent-line); }

/* ── Hero ───────────────────────────────────────────────── */
.hero { position: relative; padding: 88px 0 72px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -40% -10% auto; height: 720px; pointer-events: none;
  background: radial-gradient(ellipse 50% 50% at 50% 40%, rgba(112, 223, 127, 0.13), transparent 70%);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .35;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 20%, transparent 75%);
}
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.announce {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--text-2);
  border: 1px solid var(--border-2); background: var(--surface); border-radius: 999px; padding: 5px 14px 5px 6px;
  margin-bottom: 22px;
}
.announce:hover { text-decoration: none; border-color: var(--accent-line); }
.announce b { background: var(--accent); color: #07210c; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.hero h1 { font-size: clamp(38px, 5.4vw, 62px); line-height: 1.04; letter-spacing: -0.035em; font-weight: 800; }
.hero h1 .accent { color: var(--accent); }
.hero .lead { margin-top: 20px; font-size: 18px; color: var(--text-2); max-width: 540px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 28px; color: var(--muted); font-size: 13.5px; }
.hero-meta span { display: inline-flex; align-items: center; gap: 7px; }
.hero-meta svg { width: 15px; height: 15px; color: var(--accent); }

/* ── Install box ────────────────────────────────────────── */
.install {
  display: flex; align-items: center; gap: 12px; margin-top: 30px; max-width: 460px;
  background: var(--code-bg); border: 1px solid var(--border-2); border-radius: 11px; padding: 6px 6px 6px 16px;
  font-family: var(--mono); font-size: 14.5px;
}
.install .prompt { color: var(--muted); user-select: none; }
.install code { flex: 1; color: var(--text); white-space: nowrap; overflow-x: auto; background: none; border: 0; padding: 0; font-size: inherit; }

/* ── Copy button ────────────────────────────────────────── */
.copy-btn {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border-2); border-radius: 7px;
  font: 500 12px var(--sans); padding: 6px 9px; cursor: pointer;
}
.copy-btn:hover { color: var(--text); border-color: var(--accent-line); }
.copy-btn svg { width: 14px; height: 14px; }
.copy-btn.copied { color: var(--accent); border-color: var(--accent-line); }

/* ── Code windows ───────────────────────────────────────── */
.window {
  background: var(--code-bg); border: 1px solid var(--border-2); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; min-width: 0;
}
.window-bar {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px 10px 14px;
  border-bottom: 1px solid var(--border); background: var(--surface);
}
.dots { display: flex; gap: 6px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: #2c3a30; display: block; }
.window-title { font: 500 12.5px var(--mono); color: var(--muted); margin-left: 6px; }
.window-bar .copy-btn { margin-left: auto; }
.window pre, .code pre {
  margin: 0; padding: 18px 20px; overflow-x: auto;
  font-size: 13.5px; line-height: 1.7; color: var(--text); tab-size: 4;
}
.window .output { border-top: 1px dashed var(--border-2); color: var(--text-2); }
.k { color: var(--kw); } .s { color: var(--str); } .f { color: var(--fn); } .n { color: var(--num); } .c { color: var(--com); } .p { color: var(--muted); user-select: none; } .ok { color: var(--accent); } .dim { color: var(--muted); } .w { color: var(--warn); }

/* Tabs */
.tabs { display: flex; gap: 2px; padding: 6px 8px 0; background: var(--surface); border-bottom: 1px solid var(--border); overflow-x: auto; }
.tabs button {
  font: 500 13px var(--sans); color: var(--muted); background: none; border: 0; cursor: pointer;
  padding: 8px 12px 10px; border-bottom: 2px solid transparent; white-space: nowrap;
}
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.tabs .copy-btn { margin: 0 0 6px auto; align-self: center; }
[data-panel][hidden] { display: none; }

/* ── Sections ───────────────────────────────────────────── */
.section { padding: 96px 0; border-top: 1px solid var(--border); }
.section.alt { background: var(--bg-2); }
.section-head { max-width: 680px; margin-bottom: 48px; }
.section-head.center { margin-inline: auto; text-align: center; }
.eyebrow { font: 600 12.5px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }
.section h2 { font-size: clamp(28px, 3.6vw, 40px); line-height: 1.15; letter-spacing: -0.025em; font-weight: 750; }
.section-head p { margin-top: 14px; color: var(--text-2); font-size: 17px; }
.section-head p.eyebrow { margin-top: 0; color: var(--accent); font-size: 12.5px; }

/* Strip */
.strip { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--bg-2); }
.strip-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.strip-grid > div { padding: 22px 20px; border-left: 1px solid var(--border); }
.strip-grid > div:first-child { border-left: 0; }
.strip-grid strong { display: block; font-size: 15px; font-weight: 650; }
.strip-grid span { color: var(--muted); font-size: 13.5px; }

/* Feature cards */
.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; transition: border-color .2s, transform .2s;
}
.card:hover { border-color: var(--border-2); }
.card .icon {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); margin-bottom: 16px; border: 1px solid var(--accent-line);
}
.card .icon svg { width: 19px; height: 19px; }
.card h3 { font-size: 16.5px; font-weight: 650; letter-spacing: -0.01em; margin-bottom: 6px; }
.card p { color: var(--text-2); font-size: 14.5px; }
.card code { font-size: 12.5px; }
.card .tag { display: inline-block; margin-top: 12px; font: 500 12px var(--mono); color: var(--muted); }

/* Split (text + code) */
.split { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 56px; align-items: center; }
.split.reverse { grid-template-columns: 1.1fr 0.9fr; }
.split.reverse > :first-child { order: 2; }
.checklist { list-style: none; margin-top: 22px; display: grid; gap: 12px; }
.checklist li { position: relative; padding-left: 30px; color: var(--text-2); }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: 4px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2370df7f' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 11px no-repeat;
  border: 1px solid var(--accent-line);
}
.checklist b { color: var(--text); font-weight: 600; }

/* Pipeline diagram */
.pipeline { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; margin-top: 8px; }
.step { position: relative; padding: 20px 18px; background: var(--surface); border: 1px solid var(--border); }
.step:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.step:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.step + .step { border-left: 0; }
.step .num { font: 600 12px var(--mono); color: var(--accent); }
.step h4 { font-size: 15px; font-weight: 650; margin: 6px 0 4px; }
.step p { font-size: 13.5px; color: var(--text-2); }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; background: var(--surface-2); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td { color: var(--text-2); }
td:first-child { color: var(--text); font-weight: 550; white-space: nowrap; }
.badge { display: inline-block; font: 600 11px var(--mono); padding: 2px 7px; border-radius: 999px; border: 1px solid var(--border-2); color: var(--text-2); white-space: nowrap; }
.badge.green { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.badge.amber { color: var(--warn); border-color: rgba(245, 196, 81, .3); background: rgba(245, 196, 81, .08); }
.note { font-size: 13.5px; color: var(--muted); margin-top: 14px; }

/* Deploy cards */
.deploy .card pre { margin-top: 14px; background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 12.5px; overflow-x: auto; line-height: 1.65; }

/* Screenshot */
.shot { border: 1px solid var(--border-2); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.video { aspect-ratio: 16 / 9; width: 100%; border: 0; border-radius: var(--radius); background: var(--surface); }

/* CTA */
.cta { text-align: center; padding: 88px 0; border-top: 1px solid var(--border); position: relative; overflow: hidden; }
.cta::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse 45% 70% at 50% 100%, rgba(112, 223, 127, 0.12), transparent 70%); pointer-events: none; }
.cta h2 { font-size: clamp(28px, 3.6vw, 40px); letter-spacing: -0.025em; font-weight: 750; position: relative; }
.cta p { color: var(--text-2); margin: 14px auto 0; max-width: 560px; position: relative; }
.cta .hero-actions { justify-content: center; position: relative; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 48px 0 36px; background: var(--bg-2); font-size: 14px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; }
.footer-grid h5 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 12px; font-weight: 600; }
.footer-grid ul { list-style: none; display: grid; gap: 8px; }
.footer-grid a { color: var(--text-2); }
.footer-grid a:hover { color: var(--text); }
.footer-grid p { color: var(--muted); margin-top: 12px; max-width: 300px; }
.footer-bottom { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 13px; }

/* Reveal on scroll (only when JS is running) */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .btn:hover { transform: none; }
}

/* ── Docs page ──────────────────────────────────────────── */
.docs-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr) 200px; gap: 48px; padding: 40px 0 96px; }
.sidebar { position: sticky; top: calc(var(--header-h) + 24px); align-self: start; max-height: calc(100vh - var(--header-h) - 48px); overflow-y: auto; padding-right: 8px; }
.sidebar h6 { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 22px 0 8px; font-weight: 600; }
.sidebar h6:first-child { margin-top: 0; }
.sidebar a { display: block; color: var(--text-2); font-size: 14px; padding: 5px 10px; border-radius: 7px; border-left: 2px solid transparent; }
.sidebar a:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.sidebar a.active { color: var(--accent); background: var(--accent-soft); }
.toc { position: sticky; top: calc(var(--header-h) + 24px); align-self: start; font-size: 13px; }
.toc h6 { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 10px; font-weight: 600; }
.toc a { display: block; color: var(--muted); padding: 3px 0; }
.toc a:hover { color: var(--text); text-decoration: none; }
.search {
  width: 100%; background: var(--surface); border: 1px solid var(--border-2); border-radius: 9px; color: var(--text);
  font: 14px var(--sans); padding: 9px 12px; margin-bottom: 18px;
}
.search::placeholder { color: var(--muted); }
.search:focus { outline: none; border-color: var(--accent-line); }

.doc { min-width: 0; }
.doc > header { padding-bottom: 28px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.doc > header h1 { font-size: clamp(32px, 4vw, 44px); letter-spacing: -0.03em; line-height: 1.1; font-weight: 800; }
.doc > header p { color: var(--text-2); font-size: 17px; margin-top: 12px; max-width: 680px; }
.doc section { padding-top: 40px; }
.doc section[hidden] { display: none; }
.doc h2 { font-size: 26px; letter-spacing: -0.02em; font-weight: 750; margin-bottom: 12px; }
.doc h2 a.anchor { color: var(--border-2); margin-left: 8px; font-weight: 500; opacity: 0; }
.doc h2:hover a.anchor { opacity: 1; }
.doc h3 { font-size: 17px; font-weight: 650; margin: 26px 0 8px; }
.doc p, .doc li { color: var(--text-2); font-size: 15.5px; }
.doc p + p { margin-top: 12px; }
.doc ul, .doc ol { padding-left: 22px; margin: 10px 0; display: grid; gap: 6px; }
.doc .code { margin: 16px 0; border: 1px solid var(--border-2); border-radius: var(--radius-sm); background: var(--code-bg); overflow: hidden; }
.doc .code .code-bar { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 6px 14px; border-bottom: 1px solid var(--border); background: var(--surface); font: 500 12px var(--mono); color: var(--muted); }
.doc .code pre { padding: 14px 16px; font-size: 13px; }
.doc .table-wrap { margin: 16px 0; }
.doc .more { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; font-size: 14px; font-weight: 550; }
.callout { margin: 18px 0; padding: 14px 16px; border-radius: var(--radius-sm); border: 1px solid var(--accent-line); background: var(--accent-soft); color: var(--text-2); font-size: 14.5px; }
.callout.warn { border-color: rgba(245, 196, 81, .3); background: rgba(245, 196, 81, .06); }
.callout strong { color: var(--text); }
.no-results { color: var(--muted); padding: 40px 0; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 1080px) {
  .docs-layout { grid-template-columns: 220px minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 960px) {
  .hero-grid, .split, .split.reverse { grid-template-columns: 1fr; gap: 40px; }
  .split.reverse > :first-child { order: 0; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .pipeline { grid-template-columns: 1fr; }
  .step, .step:first-child, .step:last-child { border-radius: 0; }
  .step:first-child { border-radius: var(--radius) var(--radius) 0 0; }
  .step:last-child { border-radius: 0 0 var(--radius) var(--radius); }
  .step + .step { border-left: 1px solid var(--border); border-top: 0; }
  .strip-grid { grid-template-columns: repeat(2, 1fr); }
  .strip-grid > div:nth-child(3) { border-left: 0; }
  .strip-grid > div:nth-child(n+3) { border-top: 1px solid var(--border); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .nav, .header-actions .gh-button { display: none; }
  .menu-toggle { display: block; margin-left: 0; }
  .nav.open {
    display: flex; flex-direction: column; align-items: stretch; gap: 2px;
    position: absolute; top: var(--header-h); left: 0; right: 0; margin: 0;
    background: var(--bg); border-bottom: 1px solid var(--border); padding: 10px 16px 16px;
  }
  .nav.open a { padding: 10px 12px; }
  .header-actions { margin-left: auto; }
  .docs-layout { grid-template-columns: 1fr; padding-top: 24px; }
  .sidebar { position: static; max-height: none; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; background: var(--surface); }
}
@media (max-width: 620px) {
  .hero { padding: 56px 0 48px; }
  .section { padding: 68px 0; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .strip-grid { grid-template-columns: 1fr; }
  .strip-grid > div { border-left: 0; border-top: 1px solid var(--border); }
  .strip-grid > div:first-child { border-top: 0; }
  .footer-grid { grid-template-columns: 1fr; }
  .install { font-size: 13.5px; }
  .window pre { font-size: 12.5px; padding: 14px; }
}

/* Grid children must be allowed to shrink below their content width */
.hero-grid > *, .split > *, .docs-layout > * { min-width: 0; }
.announce { max-width: 100%; }
.doc td:first-child { white-space: normal; overflow-wrap: anywhere; min-width: 130px; }
.doc td:last-child { min-width: 220px; }
@media (max-width: 620px) {
  .announce { font-size: 12px; }
}
