/* Chatem website. Mobile-first, light/dark via prefers-color-scheme, no web fonts. */
:root {
  --bg: #fffaf3;
  --bg-alt: #f8f1e9;
  --surface: #ffffff;
  --text: #1f2a33;
  --muted: #52606b;
  --border: #e3e7e4;
  --accent: #c2410c;        /* text/buttons: 5.2:1 on white */
  --accent-strong: #9a3412;
  --accent-soft: #ffedd5;
  --on-accent: #ffffff;
  --grad: linear-gradient(135deg, #e8590c, #c2410c);
  --warm: #92400e;          /* "soon" badge text */
  --warm-soft: #fef3c7;
  --danger-soft: #fff1f2;
  --focus: #1d4ed8;
  --shadow: 0 1px 2px rgba(31, 42, 51, .06), 0 6px 20px rgba(31, 42, 51, .06);
  --radius: 16px;
  --radius-lg: 24px;
  --maxw: 1120px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111b21;
    --bg-alt: #16232b;
    --surface: #1f2a33;
    --text: #e9eef1;
    --muted: #a9b6bf;
    --border: #2e3c46;
    --accent: #fb923c;
    --accent-strong: #fdba74;
    --accent-soft: #431407;
    --on-accent: #1c0a02;
    --grad: linear-gradient(135deg, #fb923c, #f97316);
    --warm: #fcd34d;
    --warm-soft: #3b2a0a;
    --danger-soft: #3a1d24;
    --focus: #93c5fd;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  overflow-x: hidden;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 6vw, 3.2rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); letter-spacing: -.01em; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
code, kbd { font-family: ui-monospace, Consolas, "Cascadia Mono", monospace; font-size: .92em; background: var(--bg-alt); border: 1px solid var(--border); border-radius: 6px; padding: .05em .35em; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 24px; } }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
.visually-hidden { position: absolute !important; 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; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.header-row { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "brand lang" "nav nav"; align-items: center; gap: 4px 12px; padding: 8px 0; }
.brand { grid-area: brand; display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; color: var(--text); text-decoration: none; letter-spacing: .02em; min-height: 44px; }
.brand img { width: 32px; height: 32px; }
.main-nav { grid-area: nav; display: flex; flex-wrap: wrap; gap: 2px; margin: 0; }
.main-nav a { color: var(--text); text-decoration: none; padding: 8px 10px; border-radius: 999px; white-space: nowrap; font-weight: 500; }
.main-nav a:hover { background: var(--bg-alt); }
.main-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-strong); }
.lang { grid-area: lang; justify-self: end; display: flex; align-items: center; gap: 6px; }
.lang svg { width: 20px; height: 20px; color: var(--muted); }
.lang select { font: inherit; font-size: .95rem; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 6px 10px; min-height: 40px; }
@media (min-width: 860px) {
  .header-row { grid-template-columns: auto 1fr auto; grid-template-areas: "brand nav lang"; min-height: 64px; padding: 0; }
  .main-nav { margin: 0 0 0 16px; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 12px 22px; border-radius: 999px; font-weight: 700; font-size: 1.05rem; text-decoration: none; border: 2px solid transparent; cursor: pointer; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-strong); color: var(--on-accent); }
.btn-ghost { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn-ghost:hover { background: var(--accent-soft); }
.btn[aria-disabled="true"] { background: var(--bg-alt); color: var(--muted); border-color: var(--border); cursor: not-allowed; }
.btn svg { width: 22px; height: 22px; flex: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* Sections */
section { padding: 56px 0; }
@media (min-width: 720px) { section { padding: 80px 0; } }
.alt { background: var(--bg-alt); }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 46em; }
.eyebrow { display: inline-block; font-weight: 700; font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-bottom: .6em; }
.badge { display: inline-block; font-size: .8rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--warm-soft); color: var(--warm); vertical-align: middle; }
.badge-ok { background: var(--accent-soft); color: var(--accent-strong); }

/* Hero */
.hero { padding: 40px 0 56px; background: radial-gradient(1200px 500px at 85% -10%, color-mix(in srgb, #e8590c 14%, transparent), transparent), var(--bg); }
.hero-grid { display: grid; gap: 32px; align-items: center; }
.hero-art { position: relative; }
.hero-art .shot { border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); }
.hero-art .mascot { position: absolute; width: 34%; max-width: 170px; left: -6px; bottom: -28px; filter: drop-shadow(0 8px 16px rgba(0,0,0,.15)); }
.hero .note { font-size: .92rem; color: var(--muted); margin-top: 14px; }
@media (min-width: 900px) {
  .hero { padding: 72px 0 88px; }
  .hero-grid { grid-template-columns: 1fr 1.1fr; gap: 48px; }
  .hero-art .mascot { left: -48px; }
}

/* Cards / grids */
.grid { display: grid; gap: 16px; }
@media (min-width: 640px) { .grid-2, .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card p:last-child { margin-bottom: 0; }
.icon { width: 48px; height: 48px; border-radius: 14px; background: var(--accent-soft); color: var(--accent-strong); display: grid; place-items: center; margin-bottom: 14px; }
.icon svg { width: 26px; height: 26px; }
.feature-claude { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.soon-strip { margin-top: 20px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 16px 20px; border-radius: var(--radius); background: var(--warm-soft); color: var(--text); }

/* Split blocks */
.split { display: grid; gap: 28px; align-items: center; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; gap: 56px; } }
.split .art { max-width: 340px; margin: 0 auto; }

/* Steps */
.steps { list-style: none; padding: 0; margin: 28px 0; display: grid; gap: 16px; counter-reset: s; }
@media (min-width: 900px) { .steps-3 { grid-template-columns: repeat(3, 1fr); } }
.steps > li { counter-increment: s; position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 22px 22px 74px; }
.steps > li::before { content: counter(s); position: absolute; left: 20px; top: 20px; width: 38px; height: 38px; border-radius: 50%; background: var(--grad); color: var(--on-accent); font-weight: 800; display: grid; place-items: center; }
.steps h3 { margin-bottom: .3em; }
.steps p { margin: 0; color: var(--muted); }
.callout { border-left: 4px solid var(--accent); background: var(--surface); padding: 14px 18px; border-radius: 0 12px 12px 0; color: var(--muted); }
.callout strong { color: var(--text); }

/* Video slots */
.videos { display: grid; gap: 20px; }
@media (min-width: 900px) { .videos-3 { grid-template-columns: repeat(3, 1fr); } }
.video { margin: 0; }
.video-frame { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--bg-alt); border: 1px solid var(--border); }
.video-frame img, .video-frame video { width: 100%; height: 100%; object-fit: cover; }
.video-frame .play { position: absolute; inset: 0; margin: auto; width: 72px; height: 72px; border-radius: 50%; background: rgba(194, 65, 12, .92); display: grid; place-items: center; }
.video-frame .play svg { width: 30px; height: 30px; fill: #fff; margin-left: 4px; }
.video-frame .soon { position: absolute; left: 12px; top: 12px; }
.video figcaption { margin-top: 10px; font-weight: 600; }
.video figcaption small { display: block; font-weight: 400; color: var(--muted); }

/* Security */
.sec-grid { display: grid; gap: 16px; }
@media (min-width: 800px) { .sec-grid { grid-template-columns: 1fr 1fr; } }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { position: relative; padding: 8px 0 8px 34px; border-top: 1px solid var(--border); }
.checklist li:first-child { border-top: 0; }
.checklist li::before { position: absolute; left: 0; top: 8px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .85rem; font-weight: 800; }
.checklist.no li::before { content: "✕"; background: var(--accent-soft); color: var(--accent-strong); }
.checklist.yes li::before { content: "i"; background: var(--warm-soft); color: var(--warm); font-family: Georgia, serif; }
.checklist small { display: block; color: var(--muted); }

/* FAQ */
.faq { max-width: 820px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; margin-bottom: 10px; }
.faq summary { cursor: pointer; padding: 16px 48px 16px 18px; font-weight: 600; list-style: none; position: relative; min-height: 52px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 18px; top: 12px; font-size: 1.5rem; color: var(--accent); }
.faq details[open] summary::after { content: "−"; }
.faq details > div { padding: 0 18px 16px; color: var(--muted); }

/* Download page */
.platforms { display: grid; gap: 16px; align-items: start; }
@media (min-width: 900px) { .platforms { grid-template-columns: repeat(2, 1fr); } }
.platform { position: relative; }
.platform-head { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.platform-head .icon { margin: 0; }
.platform-head h2 { font-size: 1.4rem; margin: 0; }
.platform.is-current { border: 2px solid var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow); }
.platform .current-badge { display: none; }
.platform.is-current .current-badge { display: inline-block; }
.platform-soon { opacity: .92; }
.small { font-size: .92rem; color: var(--muted); }
.guide { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--border); }
.guide ol { padding-left: 1.3em; margin: 0; }
.guide li { margin-bottom: .6em; }

/* Docs pages */
.doc { max-width: 820px; padding: 40px 0 64px; }
.doc h2 { margin-top: 1.6em; font-size: 1.5rem; }
.doc h3 { margin-top: 1.3em; }
.doc ul, .doc ol { padding-left: 1.3em; }
.doc li { margin-bottom: .4em; }
.draft-banner { background: var(--danger-soft); border: 1px solid color-mix(in srgb, #e11d48 40%, var(--border)); padding: 14px 18px; border-radius: 12px; margin: 16px 0 24px; }
.todo { background: var(--warm-soft); color: var(--warm); padding: 0 .3em; border-radius: 4px; font-weight: 600; }
.help-toc { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; list-style: none; margin: 16px 0 8px; }
.help-toc a { display: inline-block; padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); text-decoration: none; }
table.retention { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.retention th, table.retention td { text-align: left; border-bottom: 1px solid var(--border); padding: 8px 6px; vertical-align: top; }

/* Legal blocks per language; html[lang] picks one, English without JS. */
[data-lang] { display: none; }
html[lang="en"] [data-lang="en"], html[lang="ru"] [data-lang="ru"], html[lang="uk"] [data-lang="uk"] { display: block; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 40px 0 32px; background: var(--bg-alt); font-size: .95rem; }
.footer-grid { display: grid; gap: 24px; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; } }
.site-footer h2 { font-size: 1rem; margin-bottom: .6em; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .4em; }
.site-footer .fine { color: var(--muted); font-size: .85rem; margin-top: 24px; }

/* review additions */
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 18px 0 0; }
.chips li { background: var(--accent-soft); color: var(--accent-strong); border-radius: 999px; padding: 4px 12px; font-size: .9rem; font-weight: 600; }
.card .more { display: inline-block; margin-top: 4px; font-weight: 600; }
.checklist.ok li::before { content: "✓"; background: var(--accent-soft); color: var(--accent-strong); }
.checklist.soon li::before { content: "…"; background: var(--warm-soft); color: var(--warm); }
.checklist.open li::before { content: "?"; background: var(--warm-soft); color: var(--warm); font-family: Georgia, serif; }
