/* Public SEO pages (built from site/ by site/build.mjs).
   Mobile first: most visitors come from a phone, so base rules are the
   phone layout and @media (min-width: …) only widens it. Same palette as the
   app in /app/ so the site and the product feel like one thing. */
:root {
  --bg: #0e1621;
  --card: #152130;
  --card-2: #1c2a39;
  --line: #24323f;
  --ink: #f2f5f8;
  --ink-dim: #c9d2db;
  --mut: #8b98a5;
  --acc: #c2467a;
  --acc-soft: rgba(194, 70, 122, 0.14);
  --blue: #4fb3ea;
  --blue-ink: #7cc6f0;
  --bubble-in: #1f2e3c;
  --bubble-out: #2b5278;
  --ok: #4fbf7a;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
}

a { color: var(--blue-ink); }
img { max-width: 100%; display: block; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* --- header --- */

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(14, 22, 33, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.top-inner { display: flex; align-items: center; gap: 8px; height: 56px; }

.brand { color: var(--ink); font-weight: 800; font-size: 19px; text-decoration: none; letter-spacing: 0.02em; margin-right: auto; }
.brand span { color: var(--blue); }

.top-nav { display: none; }
.top-nav a { color: var(--mut); text-decoration: none; font-size: 14.5px; }
.top-nav a:hover { color: var(--ink); }

.cta-long { display: none; }

/* --- buttons --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--acc);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 16.5px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 14.5px; border-radius: 11px; }
.btn-block { width: 100%; }

/* --- bands --- */

.band { padding: 48px 0; }
.band-alt { background: var(--card); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.eyebrow {
  margin: 0 0 8px;
  color: var(--acc);
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

h1 { font-size: 32px; line-height: 1.12; margin: 0 0 14px; letter-spacing: -0.015em; }
h2 { font-size: 26px; line-height: 1.18; margin: 0 0 10px; letter-spacing: -0.01em; }
h3 { font-size: 17.5px; line-height: 1.3; margin: 0 0 6px; }
.sub { color: var(--mut); margin: 0 0 26px; font-size: 16px; max-width: 620px; }

/* --- hero --- */

.hero { padding: 28px 0 44px; }
.hero h1 .accent { color: var(--acc); }
.hero .lead { color: var(--ink-dim); font-size: 17px; margin: 0 0 20px; }

.tool { display: flex; flex-direction: column; gap: 10px; }

.tool textarea {
  width: 100%;
  min-height: 112px;
  resize: vertical;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  font-size: 16px; /* 16px+ keeps iOS from zooming the page on focus */
}

.tool textarea:focus { outline: 2px solid var(--acc); outline-offset: 1px; border-color: transparent; }
.tool-note { margin: 0; color: var(--mut); font-size: 14px; text-align: center; }

.facts { display: flex; gap: 22px; margin: 24px 0 0; padding: 0; list-style: none; }
.facts b { display: block; font-size: 24px; line-height: 1.1; }
.facts span { display: block; margin-top: 4px; color: var(--mut); font-size: 13px; line-height: 1.3; }

.hero-demo { margin-top: 36px; }

/* --- phone frame (demo and screenshots) --- */

.phone {
  position: relative;
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  border-radius: 38px;
  padding: 10px;
  background: #05090e;
  border: 1px solid #2c3a48;
  box-shadow: 0 30px 60px -24px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}

.phone::before {
  content: "";
  position: absolute;
  top: 16px;
  left: 50%;
  width: 70px;
  height: 7px;
  margin-left: -35px;
  border-radius: 7px;
  background: #1a232d;
  z-index: 2;
}

.phone-screen { border-radius: 29px; overflow: hidden; background: var(--card-2); }
.phone-shot { width: 100%; aspect-ratio: 375 / 812; object-fit: cover; object-position: top; }

/* --- demo chat --- */

.demo-screen { display: flex; flex-direction: column; height: 520px; }

.demo-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 30px 14px 10px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.demo-head img { width: 34px; height: 34px; border-radius: 50%; }
.demo-name { font-weight: 700; font-size: 15px; line-height: 1.2; }
.demo-status { color: var(--ok); font-size: 12.5px; }

.demo-body { flex: 1; overflow-y: auto; scrollbar-width: none; padding: 12px; display: flex; flex-direction: column; gap: 7px; }
.demo-body::-webkit-scrollbar { display: none; }

.demo-label {
  align-self: center;
  margin: 4px 0;
  color: var(--mut);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.msg { max-width: 86%; padding: 7px 11px; border-radius: 14px; font-size: 14px; line-height: 1.4; }
.msg-in { background: var(--bubble-in); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg-out { background: var(--bubble-out); align-self: flex-end; border-bottom-right-radius: 4px; }
.msg-ths { background: var(--card); border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg-meta { display: block; margin-top: 2px; color: rgba(255, 255, 255, 0.55); font-size: 11px; text-align: right; }
.msg-gap { align-self: center; color: var(--mut); font-size: 12px; }

.typing { display: inline-flex; gap: 4px; padding: 10px 12px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--mut); animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }

@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

/* Not-yet-shown steps take no space, so "scroll to the newest message"
   lands on what's actually visible. */
.demo-play [data-step]:not(.is-on) { display: none; }
.demo-play [data-step].is-on { animation: pop 0.35s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.demo-caption { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 14px; color: var(--mut); font-size: 13px; }
.demo-replay { border: none; background: none; color: var(--blue-ink); font: inherit; font-size: 13px; cursor: pointer; padding: 6px; }

/* --- how it works: phones, swipe on mobile --- */

.steps {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 78%;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  margin: 0 -16px;
  padding: 4px 16px 12px;
  scrollbar-width: none;
}

.steps::-webkit-scrollbar { display: none; }
.step { scroll-snap-align: start; }
.step .phone { max-width: 250px; border-radius: 32px; padding: 8px; }
.step .phone-screen { border-radius: 25px; }
.step-cap { margin-top: 14px; text-align: center; }
.step-num { display: inline-flex; width: 26px; height: 26px; align-items: center; justify-content: center; border-radius: 50%; background: var(--acc); font-weight: 800; font-size: 13px; margin-bottom: 6px; }
.step-cap p { margin: 0; color: var(--mut); font-size: 14.5px; }
.swipe-hint { color: var(--mut); font-size: 13px; text-align: center; margin: 6px 0 0; }

/* --- example with sticker --- */

.example { display: grid; gap: 16px; }

.chat-card {
  position: relative;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.chat-card-title { margin: 0 0 4px; color: var(--mut); font-size: 12.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }

/* Sits in the flow under the last message and hangs over the card's edge,
   so it never covers the conversation itself. */
.sticker {
  align-self: flex-end;
  margin: 10px -10px -30px 0;
  max-width: 230px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #fff4c7;
  color: #2a2410;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  transform: rotate(3deg);
  box-shadow: 0 14px 28px -12px rgba(0, 0, 0, 0.6);
}

.sticker small { display: block; color: #8a7a3a; font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 3px; }
.example .chat-card:first-child { margin-bottom: 30px; }

/* --- feature cards --- */

.cards { display: grid; gap: 12px; }

.card {
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
}

.band-alt .card { background: var(--bg); }
.card p { margin: 0; color: var(--mut); font-size: 15px; }

.ico {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--acc-soft);
  color: var(--acc);
  margin-bottom: 12px;
}

.ico svg { width: 22px; height: 22px; }

/* --- prices --- */

.prices { display: grid; gap: 12px; }
.price { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.price-amount { font-size: 22px; font-weight: 800; }
.price-rub { font-size: 20px; font-weight: 700; text-align: right; }
.price-per { display: block; color: var(--mut); font-size: 12.5px; font-weight: 400; }
.price-best { border-color: var(--acc); box-shadow: 0 0 0 1px var(--acc) inset; }
.price-tag { position: absolute; top: -10px; left: 14px; padding: 2px 9px; border-radius: 8px; background: var(--acc); font-size: 11.5px; font-weight: 800; }
.price-note { margin: 16px 0 0; color: var(--mut); font-size: 14px; }

/* --- faq --- */

.faq details { background: var(--card-2); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 10px; }
.band-alt .faq details, .band-alt details { background: var(--bg); }
.faq summary { cursor: pointer; font-weight: 700; list-style: none; padding-right: 22px; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: -1px; color: var(--mut); font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 10px 0 0; color: var(--ink-dim); font-size: 15px; }

/* --- final cta --- */

.cta { text-align: center; }
.cta .sub { margin-left: auto; margin-right: auto; }

/* --- footer --- */

.bottom { border-top: 1px solid var(--line); padding: 32px 0 40px; color: var(--mut); font-size: 14px; }
.bottom-inner { display: grid; gap: 18px; }
.bottom-brand p { margin: 6px 0 0; max-width: 360px; }
.bottom-nav { display: flex; flex-direction: column; gap: 8px; }
.bottom-nav a { color: var(--mut); text-decoration: none; }
.bottom-nav a:hover { color: var(--ink); }
.bottom-note { margin: 0; font-size: 13px; }

/* --- reply generator widget (site/partials/generator.html) --- */

.gen {
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  max-width: 680px;
}

.band-alt .gen { background: var(--bg); }

.gen textarea, .gen input {
  width: 100%;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 13px;
  font: inherit;
  font-size: 16px;
}

.band-alt .gen textarea, .band-alt .gen input { background: var(--card-2); }
.gen textarea { resize: vertical; min-height: 84px; }
.gen textarea:focus, .gen input:focus { outline: 2px solid var(--acc); outline-offset: 1px; border-color: transparent; }
.gen-label { display: block; margin: 12px 0 6px; color: var(--mut); font-size: 13px; font-weight: 700; }
.gen form > .gen-label:first-child { margin-top: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }

.chip {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-dim);
  border-radius: 999px;
  padding: 7px 13px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.chip.is-on { background: var(--acc-soft); border-color: var(--acc); color: var(--ink); }
.gen-more { margin: 12px 0 14px; }
.gen-more summary { color: var(--blue-ink); font-size: 14px; cursor: pointer; }
.gen-more input { margin-top: 8px; }
.gen-out { margin-top: 16px; display: grid; gap: 10px; }
.gen-out[hidden] { display: none; }
.gen-msg { margin: 0; color: var(--ink-dim); font-size: 15px; }
.gen-note { margin: 12px 0 0; color: var(--mut); font-size: 13px; }

/* --- ready-made answers (meta.answers) and generator results --- */

.answers-group { margin-bottom: 22px; }
.answers-tone { margin: 0 0 10px; font-size: 15px; color: var(--acc); }
.answers { display: grid; gap: 10px; }

.answer {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  padding: 12px;
  border-radius: 16px;
  background: var(--card-2);
  border: 1px solid var(--line);
}

.band-alt .answer { background: var(--bg); }
.answer .msg { max-width: 100%; font-size: 15px; }
.answer-tone { align-self: flex-start; color: var(--acc); font-size: 12.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
.answer-why { align-self: stretch; margin: 0; color: var(--mut); font-size: 13.5px; }
.answer-copy { border: none; background: none; color: var(--blue-ink); font: inherit; font-size: 13.5px; cursor: pointer; padding: 2px 0; }

/* --- section cards with a mini conversation (build.mjs renderCards) --- */

.topics { display: grid; gap: 12px; }

.topic {
  display: block;
  padding: 14px;
  border-radius: 18px;
  background: var(--card-2);
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}

.band-alt .topic { background: var(--bg); }
.topic:hover { border-color: var(--acc); transform: translateY(-2px); }

.topic-chat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  margin-bottom: 12px;
  border-radius: 12px;
  background: var(--card);
  min-height: 92px;
}

.band-alt .topic-chat { background: var(--card-2); }
.topic-chat .msg { font-size: 13.5px; max-width: 90%; }
.topic h3 { margin: 0 0 4px; font-size: 16.5px; }
.topic p { margin: 0; color: var(--mut); font-size: 14px; }

@media (min-width: 720px) {
  .topics { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 980px) {
  .topics { grid-template-columns: repeat(3, 1fr); }
}

/* --- situation pages: readings and steps --- */

.readings { display: grid; gap: 10px; }
.reading { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.reading-tag {
  flex: none;
  padding: 3px 9px;
  border-radius: 8px;
  background: var(--acc-soft);
  color: var(--acc);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.reading p { margin: 0; color: var(--ink-dim); }

/* --- "напишет ли он" self-check --- */

.check { display: grid; gap: 10px; max-width: 680px; }
.check-q { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.check-q p { margin: 0; font-size: 15.5px; }
.check-btns { display: flex; gap: 6px; flex: none; }
.check-result { margin-top: 16px; }
.check-result[hidden] { display: none; }

/* --- example conversations with a flip (build.mjs renderExample) --- */

.examples { display: grid; gap: 18px; }

.ex {
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  max-width: 680px;
}

.band-alt .ex { background: var(--bg); }

.tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.tag-calm { background: rgba(79, 191, 122, 0.15); color: var(--ok); }
.tag-alarm { background: var(--acc-soft); color: var(--acc); }
.ex-title { margin: 0 0 4px; font-size: 19px; }
.ex-ctx { margin: 0 0 12px; color: var(--mut); font-size: 14px; }

.ex-chat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 10px;
  border-radius: 16px;
  background: var(--card);
}

.band-alt .ex-chat { background: var(--card-2); }
.ex-chat .msg { font-size: 14.5px; }
.ex-chat.is-collapsed .ex-extra { display: none; }
.ex-day { align-self: center; padding: 2px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.06); color: var(--mut); font-size: 12px; margin: 4px 0; }

.ex-more {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: transparent;
  color: var(--blue-ink);
  font: inherit;
  font-size: 14.5px;
  cursor: pointer;
}

.seems {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff4c7;
  color: #2a2410;
  font-size: 15px;
  font-weight: 600;
}

.seems small { display: block; color: #8a7a3a; font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 2px; }
.ex-flip { margin-top: 12px; }
.ex.is-open .ex-flip { background: transparent; border: 1px solid var(--line); color: var(--mut); }
.ex-ths { display: flex; flex-direction: column; gap: 7px; margin-top: 14px; }
.ex-ths[hidden] { display: none; }
.ex-ths-head { display: flex; align-items: center; gap: 8px; color: var(--mut); font-size: 13px; }
.ex-ths .msg-ths { max-width: 94%; color: var(--ink-dim); font-size: 14.5px; }
.ex-note { margin: 6px 0 0; color: var(--mut); font-size: 12.5px; }
.ex-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 4px; }
.ex-link { font-size: 14px; }

@media (min-width: 980px) {
  .examples { grid-template-columns: 1fr 1fr; align-items: start; }
}

/* --- tables (словарик) --- */

.table-wrap { overflow-x: auto; max-width: 680px; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th, .table td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--mut); font-size: 13px; font-weight: 700; }
.table td:first-child { white-space: nowrap; }
.table td { color: var(--ink-dim); }

/* --- inner pages --- */

.crumbs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; color: var(--mut); font-size: 13.5px; }
.crumbs a { color: var(--mut); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.crumbs-sep { opacity: 0.6; }
.lead-strong { color: var(--ink-dim); font-size: 17px; margin: 0 0 22px; }
.lead-strong b { color: var(--ink); }

.prose { max-width: 680px; }
.prose h3 { margin: 22px 0 8px; }
.prose p { margin: 0 0 12px; color: var(--ink-dim); }
.prose ul { margin: 0 0 12px; padding-left: 20px; color: var(--ink-dim); }
.prose li { margin-bottom: 6px; }

.dont { display: grid; gap: 10px; }
.dont .card { border-left: 3px solid var(--acc); }

@media (min-width: 720px) {
  .answers { grid-template-columns: repeat(2, 1fr); }
  .gen-out { grid-template-columns: 1fr; }
}

/* --- 404 --- */

.notfound { text-align: center; padding: 72px 0; }

/* --- wider screens --- */

@media (min-width: 720px) {
  h1 { font-size: 46px; }
  h2 { font-size: 32px; }
  .band { padding: 72px 0; }
  .hero { padding: 56px 0 64px; }
  .top-inner { gap: 12px; }
  .cta-long { display: inline; }
  .cta-short { display: none; }
  .tool { flex-direction: row; flex-wrap: wrap; }
  .tool .btn { flex: 1 1 auto; }
  .tool-note { text-align: left; width: 100%; }
  .reading { flex-direction: row; gap: 12px; }
  .steps { grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); overflow: visible; margin: 0; padding: 0; }
  .swipe-hint { display: none; }
  .example { grid-template-columns: 1fr 1fr; align-items: start; }
  .example .chat-card:first-child { margin-bottom: 0; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .prices { grid-template-columns: repeat(3, 1fr); }
  .price { flex-direction: column; align-items: flex-start; }
  .price-rub { text-align: left; }
  .bottom-inner { grid-template-columns: 1fr auto; }
  .bottom-note { grid-column: 1 / -1; }
}

@media (min-width: 980px) {
  .top-nav { display: flex; gap: 22px; margin-right: 12px; }
  .hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 56px; align-items: center; }
  .hero-demo { margin-top: 0; }
  .cards { grid-template-columns: repeat(4, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .demo-play [data-step].is-on { animation: none; }
  .typing i { animation: none; opacity: 0.6; }
}
