:root {
  color-scheme: light dark;
  --bg: #f5f8f6;
  --card: #ffffff;
  --card-subtle: #eff5f2;
  --border: #c5d6cc;
  --text: #14241d;
  --muted: #46584f;
  --accent: #145e3d;
  --accent-hover: #0e472d;
  --accent-contrast: #ffffff;
  --shadow: 0 2px 10px rgba(20, 36, 29, 0.05);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
}
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  padding: 28px 16px 36px;
}
.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--accent-contrast);
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus {
  left: 16px;
}
.site-shell {
  max-width: 780px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px 30px;
  box-shadow: var(--shadow);
}
/* The server renders <html lang> for the language it shows; the other language is hidden. */
html[lang="en"] [data-lang="uk"],
html[lang="uk"] [data-lang="en"] {
  display: none !important;
}
.site-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "brand nav lang";
  align-items: center;
  gap: 8px 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
  margin-bottom: 24px;
}
.site-header .brand {
  grid-area: brand;
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
}
.site-header .brand img {
  display: block;
  width: 28px;
  height: 28px;
  border-radius: 8px;
}
.site-header nav {
  grid-area: nav;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 4px 14px;
  min-width: 0;
}
.site-header nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 4px 6px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
  overflow-wrap: normal;
}
.site-header nav a[aria-current="page"] {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 5px;
}
.lang-switch {
  grid-area: lang;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--card-subtle);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
}
.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 36px;
  padding: 4px 10px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}
.lang-btn:hover {
  color: var(--text);
}
html[lang="en"] .lang-btn[hreflang="en"],
html[lang="uk"] .lang-btn[hreflang="uk"] {
  background: var(--accent);
  color: var(--accent-contrast);
}
.toc {
  background: var(--card-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  margin: 20px 0;
}
.toc-title {
  margin: 0 0 4px;
  font-weight: 700;
}
.toc ol {
  margin: 0;
  padding-left: 22px;
  columns: 2 220px;
  column-gap: 24px;
  font-size: 15px;
  line-height: 1.5;
}
.toc li {
  margin: 2px 0;
  break-inside: avoid;
}
h2[id] {
  scroll-margin-top: 16px;
}
.faq {
  padding-left: 20px;
}
.retention {
  margin: 6px 0 0;
  padding-left: 18px;
}
.retention li {
  margin: 6px 0;
}
main {
  display: block;
}
h1 {
  font-size: clamp(25px, 4.5vw, 34px);
  line-height: 1.22;
  margin: 0 0 12px;
}
h2 {
  font-size: 20px;
  line-height: 1.3;
  margin: 28px 0 10px;
}
p, li {
  max-width: 70ch;
}
a {
  color: var(--accent);
  overflow-wrap: anywhere;
}
a:hover {
  color: var(--accent-hover);
}
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.muted {
  color: var(--muted);
}
.action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  background: var(--accent);
  color: var(--accent-contrast);
  padding: 10px 20px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
}
.action:hover {
  background: var(--accent-hover);
  color: var(--accent-contrast);
}
.action-secondary {
  background: var(--card-subtle);
  color: var(--accent);
  border: 1px solid var(--border);
}
.action-secondary:hover {
  background: var(--border);
  color: var(--accent-hover);
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin: 20px 0;
}
.info-card {
  background: var(--card-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}
.info-card h2 {
  margin: 0 0 6px;
  font-size: 16.5px;
}
.info-card p {
  margin: 0;
  font-size: 14.5px;
}
.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 20px 0;
}
li {
  margin: 10px 0;
}
footer {
  border-top: 1px solid var(--border);
  margin-top: 30px;
  padding-top: 16px;
  font-size: 14px;
  color: var(--muted);
}
@media (max-width: 640px) {
  body { padding: 12px 8px 24px; }
  .site-shell { padding: 16px 14px; border-radius: 14px; }
  .site-header {
    grid-template-columns: 1fr auto;
    grid-template-areas: "brand lang" "nav nav";
    gap: 2px 8px;
    padding-bottom: 6px;
    margin-bottom: 18px;
  }
  .site-header .brand { min-height: 40px; }
  .site-header nav { justify-content: flex-start; gap: 0 2px; margin-left: -5px; font-size: 14px; }
  .site-header nav a { min-height: 40px; padding: 4px 5px; }
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101513;
    --card: #19211d;
    --card-subtle: #212c26;
    --border: #3a4f43;
    --text: #e9f1ec;
    --muted: #b9cabf;
    --accent: #7ad8a9;
    --accent-hover: #9be4bf;
    --accent-contrast: #0d2318;
    --shadow: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Home page (landing). Only index.html uses these classes; the other pages keep the styles above. */
.home-shell {
  max-width: 1040px;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.home-hero {
  display: grid;
  gap: 28px;
  align-items: center;
  margin: 4px 0 8px;
}
.home-title {
  font-size: clamp(28px, 5.2vw, 46px);
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
}
.home-lead {
  font-size: 17.5px;
  line-height: 1.55;
  margin: 0 0 22px;
  color: var(--muted);
}
.home-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}
.home-play {
  gap: 10px;
  min-height: 50px;
  padding: 12px 22px;
  font-size: 16.5px;
}
.home-play::before {
  content: "";
  border-style: solid;
  border-width: 7px 0 7px 11px;
  border-color: transparent transparent transparent currentColor;
}
.home-early {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 10px;
}
.home-test-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin-top: 8px;
  font-weight: 600;
  text-underline-offset: 4px;
}
.home-visual {
  display: flex;
  justify-content: center;
}
.home-section {
  margin-top: 40px;
}
.home-h2 {
  font-size: clamp(21px, 3vw, 26px);
  margin: 0 0 14px;
}
.examples {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}
.example {
  background: var(--card-subtle);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
}
.example-mode {
  margin: 0 0 10px;
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
}
.example-label {
  margin: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}
.example-text {
  margin: 2px 0 12px;
  font-size: 15px;
  line-height: 1.5;
}
.example-mode + .example-label + .example-text {
  color: var(--muted);
}
.example-after + .example-text {
  margin-bottom: 0;
  padding-left: 10px;
  border-left: 3px solid #D98E00;
  font-weight: 600;
}
.home .card-grid {
  margin: 0;
}
.home .info-card h3 {
  margin: 0 0 6px;
  font-size: 16.5px;
}
.home-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 18px;
}
.home-footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
}
.home-contact {
  margin: 4px 0 0;
}

/* Product visual: a fixed dark island in the app's look, the same in light and dark page themes. */
.demo {
  --demo-frame: #060607;
  --demo-bg: #121316;
  --demo-surface: #1d1e23;
  --demo-bubble: #2a2b31;
  --demo-line: #34353c;
  --demo-text: #eeebe4;
  --demo-gold: #F7B500;
  --demo-gold-deep: #D98E00;
  width: min(100%, 300px);
  color: var(--demo-text);
  line-height: 1.4;
}
.demo-phone {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 360px;
  padding: 16px 12px 12px;
  background: radial-gradient(120% 55% at 50% 0%, rgba(247, 181, 0, 0.08), transparent 62%), var(--demo-bg);
  border: 9px solid var(--demo-frame);
  border-radius: 36px;
  box-shadow: 0 0 0 1px #3a3b42, 0 18px 40px rgba(0, 0, 0, 0.28);
}
.demo-phone::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 50%;
  width: 64px;
  height: 6px;
  margin-left: -32px;
  border-radius: 6px;
  background: var(--demo-frame);
}
.demo-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 4px 12px;
  border-bottom: 1px solid var(--demo-line);
}
.demo-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #3d3f48;
  font-size: 14px;
  font-weight: 700;
}
.demo-name {
  font-size: 14.5px;
  font-weight: 600;
}
.demo-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 110px;
  padding: 14px 2px 12px;
}
.demo-bubble {
  align-self: flex-start;
  max-width: 82%;
  margin: 0;
  padding: 8px 12px;
  border-radius: 16px 16px 16px 4px;
  background: var(--demo-bubble);
  font-size: 14px;
}
.demo-capsule {
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  margin: 0 2px 8px;
  padding: 5px;
  border: 1px solid #4a3f1c;
  border-radius: 999px;
  background: var(--demo-surface);
  color: var(--demo-gold);
  font-size: 12.5px;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}
.demo-mark {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 7px;
}
.demo-states {
  display: grid;
  overflow: hidden;
  padding: 0 7px 0 8px;
}
.demo-states > span {
  grid-area: 1 / 1;
  white-space: nowrap;
}
.demo-busy {
  visibility: hidden;
}
.demo-input {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
/* Without motion both versions are shown: the draft struck through above the corrected text. */
.demo-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: none;
  min-height: 40px;
  margin: 0;
  padding: 9px 13px;
  border: 1px solid var(--demo-line);
  border-radius: 18px;
  background: var(--demo-surface);
  font-size: 14px;
}
.demo-draft {
  opacity: 0.6;
  text-decoration: line-through;
}
.demo-send {
  position: relative;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--demo-gold-deep);
}
.demo-send::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 15px;
  border-style: solid;
  border-width: 7px 0 7px 11px;
  border-color: transparent transparent transparent #1a1200;
}
/* With motion: the capsule works and the corrected text replaces the draft in one seamless 9 s loop. */
@media (prefers-reduced-motion: no-preference) {
  .demo-text {
    display: grid;
  }
  .demo-text > span {
    grid-area: 1 / 1;
  }
  .demo-draft {
    opacity: 1;
    text-decoration: none;
    animation: demo-draft 9s ease-in-out infinite;
  }
  .demo-draft::after {
    content: "";
    display: inline-block;
    width: 2px;
    height: 1.05em;
    margin-left: 1px;
    vertical-align: text-bottom;
    background: var(--demo-gold);
    animation: demo-caret 1s steps(1, end) infinite;
  }
  .demo-fixed {
    animation: demo-fixed 9s ease-in-out infinite;
  }
  .demo-busy {
    visibility: visible;
    animation: demo-busy 9s ease-in-out infinite;
  }
  .demo-done {
    animation: demo-done 9s ease-in-out infinite;
  }
  .demo-states {
    animation: demo-label 9s ease-in-out infinite;
  }
  .demo-capsule {
    animation: demo-glow 9s ease-in-out infinite;
  }
}
@keyframes demo-draft {
  0%, 40% { opacity: 1; }
  46%, 92% { opacity: 0; }
  98%, 100% { opacity: 1; }
}
@keyframes demo-fixed {
  0%, 44% { opacity: 0; }
  50%, 90% { opacity: 1; }
  96%, 100% { opacity: 0; }
}
@keyframes demo-busy {
  0%, 34% { opacity: 0; }
  37%, 46% { opacity: 1; }
  49%, 100% { opacity: 0; }
}
@keyframes demo-done {
  0%, 47% { opacity: 0; }
  50%, 88% { opacity: 1; }
  92%, 100% { opacity: 0; }
}
@keyframes demo-label {
  0%, 32% { max-width: 0; padding: 0; }
  37%, 90% { max-width: 120px; padding: 0 7px 0 8px; }
  95%, 100% { max-width: 0; padding: 0; }
}
@keyframes demo-glow {
  0%, 33%, 54%, 100% { box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35), 0 0 0 0 rgba(247, 181, 0, 0); }
  40%, 47% { box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35), 0 0 0 4px rgba(247, 181, 0, 0.28); }
}
@keyframes demo-caret {
  0% { opacity: 1; }
  50% { opacity: 0; }
}
@media (min-width: 800px) {
  .home-hero {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 40px;
    margin-top: 16px;
  }
}
@media (max-width: 640px) {
  .home-lead { font-size: 16.5px; margin-bottom: 18px; }
  .home-section { margin-top: 32px; }
}
