/* AI Chat Downloader - product site. One stylesheet, no external requests. */
:root {
  color-scheme: light dark;
  --indigo: #4f3df0;
  --amber: #ffae1f;
  --amber-hover: #ffc04d;
  --on-amber: #1b1446;
  --bg: #ffffff;
  --bg-soft: #f5f4ff;
  --card: #ffffff;
  --ink: #14132b;
  --muted: #55547a;
  --line: #e1def5;
  --link: #4f3df0;
  --shadow: 0 12px 32px rgba(36, 28, 120, 0.14);
  --radius: 16px;
  --max: 1080px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0d1e;
    --bg-soft: #15142b;
    --card: #1a1836;
    --ink: #ecebff;
    --muted: #adabd0;
    --line: #2c2a52;
    --link: #aaa0ff;
    --shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}
img { max-width: 100%; height: auto; display: block; }
video { max-width: 100%; height: auto; display: block; }
.demo video { pointer-events: none; } /* behaves like the GIF it replaced: no controls, and no right-click "show controls" */
a { color: var(--link); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.6em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.3em; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.container { width: min(100% - 2rem, var(--max)); margin-inline: auto; }
.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  background: var(--amber); color: var(--on-amber); padding: 0.6rem 1rem; border-radius: 8px; font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 1rem; }

/* header / footer */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 5; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.6rem 1rem; padding-block: 0.7rem; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 800; color: var(--ink); text-decoration: none; }
.brand img { border-radius: 8px; }
.nav { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 600; }
.nav a:hover { color: var(--link); }
.site-footer { border-top: 1px solid var(--line); background: var(--bg-soft); padding-block: 2rem; margin-top: 3rem; color: var(--muted); font-size: 0.92rem; }
.footer-links { display: flex; gap: 1.2rem; flex-wrap: wrap; margin-bottom: 1rem; }
.footer-links a { color: var(--ink); font-weight: 600; }
.disclaimer { max-width: 62ch; margin: 0 0 0.6em; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.8rem 1.5rem; border-radius: 999px; border: 2px solid transparent;
  font-weight: 800; font-size: 1rem; text-decoration: none; line-height: 1.2;
}
.btn-amber { background: var(--amber); color: var(--on-amber); }
.btn-amber:hover { background: var(--amber-hover); }
.btn-ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--link); }
.nav .btn { padding: 0.5rem 1.1rem; color: var(--on-amber); }

/* sections */
.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section-soft { background: var(--bg-soft); }
.section-title { text-align: center; }
.section-intro { text-align: center; color: var(--muted); max-width: 60ch; margin: 0 auto 2rem; }

.hero { background: linear-gradient(180deg, var(--bg-soft), var(--bg)); padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.hero-grid { display: grid; gap: 2.5rem; align-items: center; }
.eyebrow { color: var(--link); font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.8rem; margin-bottom: 0.8rem; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 52ch; }
.trust { color: var(--muted); font-size: 0.92rem; margin-top: 1rem; }
.hero .btn-row { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 1.4rem; }

/* chips, tiles, cards */
.chips { display: flex; flex-wrap: wrap; gap: 0.7rem; justify-content: center; list-style: none; padding: 0; margin: 0; }
.chip { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 0.5rem 1.1rem; font-weight: 700; }
.chip-beta { color: var(--muted); font-weight: 600; font-size: 0.85em; margin-left: 0.35em; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1rem; list-style: none; padding: 0; margin: 0 0 1rem; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem 1rem; text-align: center; font-weight: 800; font-size: 1.25rem; box-shadow: var(--shadow); }
.tile small { display: block; color: var(--muted); font-weight: 500; font-size: 0.85rem; margin-top: 0.3rem; }
.tile-note { text-align: center; color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.2rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.card h3 { margin-bottom: 0.4em; }
.card p:last-child { margin-bottom: 0; }
.two-col { display: grid; gap: 1.2rem; }
.steps { display: grid; gap: 1.2rem; counter-reset: step; list-style: none; padding: 0; margin: 0; }
.step { counter-increment: step; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.step::before {
  content: counter(step); display: inline-grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%;
  background: var(--indigo); color: #fff; font-weight: 800; margin-bottom: 0.7rem;
}
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 0.9rem 1.2rem; margin-bottom: 0.8rem; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq details[open] summary { margin-bottom: 0.6rem; }
.faq p { margin: 0; color: var(--muted); }

/* long-form pages */
.prose { max-width: 70ch; margin-inline: auto; padding-block: clamp(2rem, 5vw, 3.5rem); }
.prose h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); }
.prose h2 { font-size: 1.4rem; margin-top: 2rem; }
.updated { color: var(--muted); font-size: 0.92rem; }
.callout { background: var(--bg-soft); border: 1px solid var(--line); border-left: 4px solid var(--indigo); border-radius: 10px; padding: 1rem 1.2rem; margin-block: 1.2rem; }

/* hero composition: PDF page + side-panel mock-up + floating button */
.stage { position: relative; display: grid; gap: 1.2rem; justify-items: center; }
.pdf-figure { margin: 0; width: min(100%, 460px); background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.mock-panel {
  width: min(100%, 320px); background: #1e1e21; color: #ececf1; border-radius: 12px; overflow: hidden;
  box-shadow: var(--shadow); font-size: 13px; line-height: 1.4; border: 1px solid #38383d;
}
.mock-head { display: flex; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid #38383d; font-weight: 700; }
.mock-filters { display: flex; gap: 6px; padding: 8px 14px; border-bottom: 1px solid #38383d; }
.mock-filter { flex: 1; text-align: center; padding: 5px 2px; border: 1px solid #4a4a52; border-radius: 6px; background: #2b2b30; font-size: 11px; }
.mock-list { list-style: none; margin: 0; padding: 0; }
.mock-row { display: flex; gap: 8px; align-items: flex-start; padding: 8px 14px; border-bottom: 1px solid #2c2c31; }
.mock-check { flex: 0 0 14px; width: 14px; height: 14px; margin-top: 2px; border-radius: 3px; background: var(--indigo); position: relative; }
.mock-check::after { content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.mock-check-off { background: transparent; border: 1px solid #77777f; }
.mock-check-off::after { display: none; }
.mock-avatar { flex: 0 0 20px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 700; color: #fff; }
.mock-avatar-user { background: #5c5cf0; }
.mock-avatar-ai { background: #10a37f; }
.mock-text { flex: 1; min-width: 0; color: #d4d4dc; }
.mock-foot { display: flex; align-items: center; gap: 8px; padding: 10px 14px; }
.mock-count { color: #a0a0ad; }
.mock-select { padding: 4px 8px; border: 1px solid #4a4a52; border-radius: 6px; background: #2b2b30; }
.mock-btn { flex: 1; text-align: center; padding: 6px 4px; border-radius: 6px; font-weight: 700; }
.mock-btn-primary { background: var(--indigo); color: #fff; }
.mock-btn-muted { background: #38383e; }
.mock-fab { display: inline-block; background: var(--indigo); color: #fff; font-weight: 700; font-size: 14px; padding: 10px 20px; border-radius: 999px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3); }

@media (min-width: 860px) {
  .hero-grid { grid-template-columns: 1.05fr 1fr; }
  .stage { display: block; min-height: 480px; }
  .stage .pdf-figure { position: absolute; left: 0; top: 0; width: 70%; }
  .stage .mock-panel { position: absolute; right: 0; top: 150px; }
  .stage .mock-fab { position: absolute; right: 24px; bottom: 6px; }
  .two-col { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* language dropdown: a <details> menu, so it works without JavaScript */
.lang { position: relative; }
.lang summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.4rem 0.75rem; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--ink); font-weight: 600;
}
.lang summary::-webkit-details-marker { display: none; }
.lang summary:hover { border-color: var(--link); }
.lang summary::after {
  content: ""; width: 0.4em; height: 0.4em; border: solid currentColor; border-width: 0 2px 2px 0;
  transform: rotate(45deg) translateY(-2px);
}
.lang[open] summary::after { transform: rotate(-135deg) translate(-2px, -1px); }
.lang-menu {
  position: absolute; inset-inline-end: 0; top: calc(100% + 0.4rem); z-index: 20;
  list-style: none; margin: 0; padding: 0.4rem; min-width: 11rem; max-width: calc(100vw - 2rem);
  max-height: 70vh; overflow-y: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
}
.nav .lang-menu a { display: block; padding: 0.5rem 0.8rem; border-radius: 8px; font-weight: 500; }
.nav .lang-menu a:hover { background: var(--bg-soft); color: var(--ink); }
.nav .lang-menu a[aria-current="page"] { background: var(--bg-soft); color: var(--link); font-weight: 700; }
.faq-more { text-align: center; margin: 1.2rem 0 0; }
.prose.faq details { margin-bottom: 0.8rem; }

/* welcome page (shown once, after install) */
.welcome .hero { padding-block: 1rem; }
.welcome-hero { display: grid; gap: 1.5rem; align-items: center; text-align: center; }
.welcome-hero h1 { font-size: clamp(1.8rem, 3.4vw, 2.7rem); }
.welcome-hero .lead { margin-inline: auto; }
.demo { margin: 0 auto; width: fit-content; max-width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
/* Wide screens: text beside the demo, and the demo never taller than what fits under the header, so it is fully visible without scrolling. */
@media (min-width: 900px) {
  .welcome-hero { width: min(100% - 2rem, 1320px); grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr); gap: 3rem; text-align: start; }
  .welcome-hero .lead { margin-inline: 0; }
  .demo video { width: auto; max-height: calc(100vh - 8rem); max-height: calc(100svh - 8rem); }
}
.welcome-sites { margin-top: 2rem; }

/* Click-away for the language menu without JavaScript: while it is open, an invisible layer covers the page.
   It is part of <summary>, so clicking it toggles the <details> shut. Header links stay above the layer. */
.lang[open] > summary::before { content: ""; position: fixed; inset: 0; z-index: 0; cursor: default; }
.site-header .nav > a { position: relative; z-index: 1; }
