@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Sora:wght@600;700;800&display=swap');

:root {
  --bg: #fafafc;
  --bg-tint: #edebff;
  --surface: #ffffff;
  --surface-2: #fafafe;
  --text: #101019;
  --muted: #5d667a;
  --border: #e8e8f0;
  --border-strong: #d8d8e4;
  --accent: #635bff;
  --accent-2: #8b5cf6;
  --accent-dark: #4f46e5;
  --accent-soft: #f0efff;
  --accent-soft-border: #ddd9ff;
  --accent-grad: linear-gradient(135deg, #635bff 0%, #8b5cf6 60%, #a855f7 100%);
  --code-bg: #f1f1f6;
  --green: #16a34a;
  --radius: 18px;
  --radius-sm: 12px;
  --font-display: "Sora", "Inter", -apple-system, sans-serif;
  --shadow: 0 1px 2px rgba(20,18,50,.04), 0 6px 20px -6px rgba(20,18,50,.10);
  --shadow-lg: 0 2px 4px rgba(20,18,50,.05), 0 18px 40px -12px rgba(20,18,50,.18);
  --ring: 0 0 0 3px rgba(99,91,255,.16);
}
html[data-theme="dark"] {
  --bg: #0a0a10;
  --bg-tint: #17142e;
  --surface: #13131c;
  --surface-2: #181824;
  --text: #f0f0f6;
  --muted: #98a0b6;
  --border: #26263a;
  --border-strong: #383852;
  --accent: #7b74ff;
  --accent-2: #a78bfa;
  --accent-dark: #938dff;
  --accent-soft: #1c1936;
  --accent-soft-border: #322c5e;
  --accent-grad: linear-gradient(135deg, #7b74ff 0%, #a78bfa 60%, #c084fc 100%);
  --code-bg: #20202f;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -8px rgba(0,0,0,.5);
  --shadow-lg: 0 2px 4px rgba(0,0,0,.5), 0 22px 48px -12px rgba(0,0,0,.65);
  --ring: 0 0 0 3px rgba(123,116,255,.25);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  overflow-x: clip; /* decorative hero glows must never create horizontal scroll */
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { letter-spacing: -0.02em; font-family: var(--font-display); }

/* nav */
nav {
  display: flex; align-items: center; gap: 22px;
  padding: 13px 26px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
nav .brand { font-weight: 800; font-size: 19px; color: var(--text); display: flex; align-items: center; gap: 9px; letter-spacing: -0.03em; }
nav .brand:hover { text-decoration: none; }
nav .brand .logo { width: 28px; height: 28px; background: var(--accent-grad); border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px -2px var(--accent); }
nav .brand .logo::after { content: ""; border-style: solid; border-width: 5px 0 5px 9px; border-color: transparent transparent transparent #fff; margin-left: 2px; }
nav .links { display: flex; gap: 6px; flex: 1; }
nav .links a { color: var(--muted); font-weight: 500; font-size: 14.5px; padding: 6px 11px; border-radius: 8px; transition: all .15s; }
nav .links a:hover { color: var(--text); text-decoration: none; background: var(--code-bg); }
nav .links a.active { color: var(--accent); background: var(--accent-soft); }
nav .auth { display: flex; gap: 10px; align-items: center; font-size: 14.5px; }
.credit-pill { background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; font-size: 13px; padding: 4px 12px; border-radius: 99px; border: 1px solid var(--accent-soft-border); }

/* layout */
.container { max-width: 1000px; margin: 0 auto; padding: 32px 20px 80px; }
.container.narrow { max-width: 520px; }
.hero { text-align: center; padding: 64px 0 34px; position: relative; }
.hero::before {
  content: ""; position: absolute; inset: -60px 0 auto; height: 440px; z-index: -1;
  background:
    radial-gradient(ellipse 42% 90% at 50% 0%, var(--bg-tint), transparent 70%),
    radial-gradient(ellipse 30% 60% at 72% 10%, color-mix(in srgb, var(--accent-2) 12%, transparent), transparent 70%);
  pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; inset: -20px 0 auto 0; height: 320px; z-index: -2;
  background-image: radial-gradient(color-mix(in srgb, var(--text) 9%, transparent) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse 55% 85% at 50% 0%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 55% 85% at 50% 0%, #000 30%, transparent 75%);
  pointer-events: none;
}
.hero h1 { font-size: 50px; margin: 0 0 14px; letter-spacing: -0.04em; line-height: 1.06; font-weight: 800; }
.hero h1 em { font-style: normal; background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { color: var(--muted); font-size: 17.5px; max-width: 600px; margin: 0 auto; }

/* cards & inputs */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.features .card:hover, .plan:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.input-row { display: flex; gap: 10px; }
input[type=text], input[type=email], input[type=password], textarea, select {
  width: 100%; padding: 13px 15px; font-size: 15px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); outline: none;
  font-family: inherit; transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: var(--ring); }
textarea { resize: vertical; min-height: 120px; }
/* The hero search input is the star — make it bigger */
#video-input { padding: 15px 17px; font-size: 16px; }
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 13px 22px; font-size: 15px; font-weight: 600;
  background: var(--accent-grad); color: #fff; border: 0; border-radius: var(--radius-sm);
  cursor: pointer; white-space: nowrap; font-family: inherit;
  box-shadow: 0 2px 10px -3px var(--accent);
  transition: transform .14s ease, box-shadow .14s ease, filter .14s ease;
}
button:hover, .btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 6px 18px -4px var(--accent); filter: saturate(1.08); }
button:active, .btn:active { transform: translateY(0); }
button:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; filter: grayscale(.2); }
.btn.secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); box-shadow: none; }
.btn.secondary:hover { background: var(--surface-2); border-color: var(--muted); box-shadow: var(--shadow); }
.btn.small { padding: 8px 14px; font-size: 13.5px; }
#go-btn { padding: 15px 26px; font-size: 16px; }

/* transcript viewer */
.video-head { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; }
.video-head img { width: 128px; border-radius: 8px; }
.video-head h2 { margin: 0 0 4px; font-size: 19px; }
.video-head .by { color: var(--muted); font-size: 14px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; align-items: center; }
.toolbar .spacer { flex: 1; }
.transcript-box {
  max-height: 480px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: 10px;
  padding: 6px 0; background: var(--surface);
}
.seg { display: flex; gap: 14px; padding: 7px 16px; font-size: 15px; }
.seg:hover { background: var(--accent-soft); }
.seg .ts { color: var(--accent); font-variant-numeric: tabular-nums; font-size: 13.5px; font-weight: 600; min-width: 64px; cursor: pointer; }
.seg.plain { display: block; padding: 14px 16px; white-space: pre-wrap; }

.summary-box { background: var(--accent-soft); border: 1px solid var(--accent-soft-border); border-radius: 10px; padding: 16px 18px; margin-top: 14px; white-space: pre-wrap; font-size: 15px; }

/* transcript chat */
.chat-panel { border: 1px solid var(--border); border-radius: 10px; margin-top: 14px; }
.chat-log { max-height: 320px; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.chat-msg { padding: 9px 13px; border-radius: 10px; font-size: 14.5px; max-width: 85%; white-space: pre-wrap; }
.chat-msg.user { background: var(--accent); color: #fff; align-self: flex-end; }
.chat-msg.assistant { background: var(--code-bg); align-self: flex-start; }
.chat-input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); }
.theme-toggle { background: none; border: 0; cursor: pointer; font-size: 17px; padding: 4px 6px; color: var(--muted); }
.theme-toggle:hover { background: none; color: var(--text); }

/* notices */
.notice { padding: 12px 16px; border-radius: 10px; font-size: 14.5px; margin: 12px 0; }
.notice.error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.notice.ok { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.notice.info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
html[data-theme="dark"] .notice.error { background: #2c1212; border-color: #7f1d1d; color: #fca5a5; }
html[data-theme="dark"] .notice.ok { background: #0c2a17; border-color: #14532d; color: #86efac; }
html[data-theme="dark"] .notice.info { background: #11203c; border-color: #1e3a8a; color: #93c5fd; }

/* example chips */
.examples { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; font-size: 13.5px; }
.chip { background: var(--code-bg); color: var(--text); border: 1px solid var(--border); border-radius: 99px; padding: 5px 13px; font-size: 13px; font-weight: 500; cursor: pointer; }
.chip:hover { background: var(--accent-soft); color: var(--accent-dark); border-color: var(--accent-soft-border); }

/* loading skeleton */
.skel { background: linear-gradient(90deg, var(--code-bg) 25%, var(--border) 37%, var(--code-bg) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: 8px; margin: 10px 0; }
.skel-head { height: 64px; }
.skel-line { height: 14px; }
.skel-line.short { width: 60%; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* transcript stats */
.stats { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 4px 0 10px; font-size: 13px; color: var(--muted); }
.stats span { display: inline-flex; align-items: center; gap: 14px; }
.stats span:not(:last-child)::after { content: "·"; color: var(--border); }
.badge-cached { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; border-radius: 99px; padding: 1px 9px; font-weight: 600; font-size: 11.5px; }
html[data-theme="dark"] .badge-cached { background: #0c2a20; color: #34d399; border-color: #145239; }

/* in-transcript search */
.search-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.search-row input { flex: 1; }
.transcript-box mark { background: #fde68a; color: inherit; border-radius: 3px; padding: 0 1px; }
html[data-theme="dark"] .transcript-box mark { background: #ca9a06; color: #0a0a10; }

/* trust strip */
.trust { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 30px; margin: 30px 0 8px; padding: 20px 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.trust > div { display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 110px; }
.trust strong { font-size: 18px; color: var(--text); font-weight: 700; }
.trust span { font-size: 12.5px; color: var(--muted); }

/* about */
.about { text-align: center; max-width: 680px; margin: 64px auto 0; }
.about h2 { margin-bottom: 8px; font-size: 27px; }
.about p { color: var(--muted); font-size: 16px; }

/* use cases */
.usecases { margin-top: 64px; }
.usecases h2 { text-align: center; margin-bottom: 6px; font-size: 27px; }
.uc-list { list-style: none; padding: 0; margin: 12px 0 0; }
.uc-list li { position: relative; padding: 4px 0 4px 22px; font-size: 13.5px; color: var(--muted); }
.uc-list li::before { content: "→"; position: absolute; left: 0; color: var(--accent); font-weight: 600; }

/* features grid */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; margin-top: 44px; }
.features .card h3 { margin: 10px 0 6px; font-size: 16.5px; }
.features .card p { color: var(--muted); font-size: 14.5px; margin: 0; }
.features .ic { font-size: 22px; width: 46px; height: 46px; display: inline-flex; align-items: center; justify-content: center; background: var(--accent-soft); border: 1px solid var(--accent-soft-border); border-radius: 12px; }

/* tabs */
.tabs { display: flex; gap: 6px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.tabs button { background: none; color: var(--muted); border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 10px 16px; font-size: 14.5px; }
.tabs button:hover { background: none; color: var(--text); }
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }

/* tables */
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .4px; }

/* pricing */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin-top: 30px; }
.plan { position: relative; display: flex; flex-direction: column; }
.plan.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-lg); }
.plan .badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--accent-grad); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 13px; border-radius: 99px; box-shadow: 0 3px 10px -2px var(--accent); letter-spacing: .01em; }
.plan h3 { margin: 4px 0 2px; }
.plan .price { font-size: 32px; font-weight: 800; margin: 6px 0; letter-spacing: -0.03em; }
.plan .price span { font-size: 14px; color: var(--muted); font-weight: 500; }
.plan ul { list-style: none; padding: 0; margin: 10px 0 18px; color: var(--muted); font-size: 14.5px; flex: 1; }
.plan ul li { padding: 5px 0 5px 24px; position: relative; }
.plan ul li::before { content: "✓"; position: absolute; left: 2px; color: var(--green); font-weight: 700; }

/* docs */
.docs h2 { margin-top: 38px; }
.docs pre { background: #18181b; color: #e4e4e7; padding: 16px 18px; border-radius: 10px; overflow-x: auto; font-size: 13.5px; line-height: 1.5; }
.docs code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.docs p code, .docs li code, .docs td code { background: var(--code-bg); color: var(--accent); padding: 1px 6px; border-radius: 5px; font-size: 13px; }
.method { display: inline-block; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 6px; margin-right: 8px; vertical-align: 2px; }
.plan-tag { display: inline-block; background: var(--accent-soft); color: var(--accent-dark); border: 1px solid var(--accent-soft-border); font-size: 12px; font-weight: 600; padding: 1px 9px; border-radius: 99px; vertical-align: 3px; margin-left: 6px; }

/* code tabs */
.codetabs { border: 1px solid #2a2a32; border-radius: 10px; overflow: hidden; margin: 14px 0; }
.codetabs-bar { display: flex; align-items: center; gap: 2px; background: #0f0f13; padding: 6px 6px 0; }
.codetab { background: none; color: #9ca3af; border: 0; border-radius: 7px 7px 0 0; padding: 7px 14px; font-size: 13px; font-weight: 600; cursor: pointer; }
.codetab:hover { background: #1b1b21; color: #e4e4e7; }
.codetab.active { background: #18181b; color: #fff; }
.copy-code { margin-left: auto; background: #26262c; color: #cbd5e1; border: 0; border-radius: 7px; padding: 5px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer; align-self: center; margin-bottom: 6px; }
.copy-code:hover { background: #34343c; }
.codetabs pre { display: none; margin: 0; border-radius: 0; }
.codetabs pre.active { display: block; }

/* misc */
.faq details { border-bottom: 1px solid var(--border); padding: 14px 4px; }
.faq summary { font-weight: 600; cursor: pointer; }
.faq p { color: var(--muted); }
footer { color: var(--muted); font-size: 13.5px; border-top: 1px solid var(--border); margin-top: 64px; background: var(--surface-2); }
.footer-grid { max-width: 1000px; margin: 0 auto; padding: 40px 20px 8px; display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 26px; }
.footer-grid .f-brand { font-family: var(--font-display); font-weight: 800; font-size: 17px; color: var(--text); display: flex; align-items: center; gap: 8px; }
.footer-grid .f-brand .logo { width: 24px; height: 24px; background: var(--accent-grad); border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; }
.footer-grid .f-brand .logo::after { content: ""; border-style: solid; border-width: 4px 0 4px 7px; border-color: transparent transparent transparent #fff; margin-left: 2px; }
.footer-grid p { margin: 8px 0 0; font-size: 13px; line-height: 1.55; }
.footer-grid h4 { margin: 2px 0 10px; font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text); font-family: var(--font-display); }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { padding: 3.5px 0; }
.footer-grid a { color: var(--muted); }
.footer-grid a:hover { color: var(--accent); text-decoration: none; }
.footer-bottom { max-width: 1000px; margin: 0 auto; padding: 18px 20px 34px; border-top: 1px solid var(--border); margin-top: 26px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 12.5px; }
@media (max-width: 820px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } .footer-grid > div:first-child { grid-column: 1 / -1; } }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.progress-wrap { background: var(--border); border-radius: 99px; height: 8px; overflow: hidden; margin: 12px 0; }
.progress-bar { background: var(--accent-grad); height: 100%; width: 0; transition: width .3s; }

/* transcript viewer refinements */
.transcript-box { max-height: 480px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 0; background: var(--surface-2); }
.seg .ts { transition: color .1s; }
.seg .ts:hover { text-decoration: underline; }
.video-head img { box-shadow: var(--shadow); }
.examples .chip { transition: all .14s; }
.examples .chip:hover { transform: translateY(-1px); }

@media (max-width: 720px) {
  .hero h1 { font-size: 34px; }
}
@media (max-width: 640px) {
  nav { gap: 10px; padding: 12px 14px; }
  nav .links { display: none; }
  nav .auth { gap: 7px; font-size: 13.5px; flex: 1; justify-content: flex-end; min-width: 0; }
  nav .auth .credit-pill { display: none; }
  nav .auth .btn.small { padding: 7px 11px; font-size: 12.5px; }
  .hero { padding: 36px 0 22px; }
  .hero h1 { font-size: 30px; }
  .hero p { font-size: 15.5px; }
  .input-row { flex-direction: column; }
  .container { padding: 24px 16px 60px; }
}

/* Paragraph view + chapters + toolbar checkbox */
.seg.para { padding: 10px 16px; line-height: 1.65; }
.seg.para .ts { padding-top: 2px; }
.chapter-head { display: flex; gap: 14px; padding: 16px 16px 4px; font-weight: 700; font-size: 16px; align-items: baseline; }
.chapter-head .ts { color: var(--accent); font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 600; min-width: 64px; cursor: pointer; }
.chapter-head .ts:hover { text-decoration: underline; }
.check-label { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); cursor: pointer; user-select: none; }
.check-label input { accent-color: var(--accent); cursor: pointer; }

/* hero illustration */
.hero-art { display: block; width: 100%; max-width: 860px; margin: 38px auto 6px; }
html[data-theme="dark"] .hero-art { opacity: .92; filter: saturate(1.05); }

