/* buinstabot.uz. Главный экран — окно чата: ссылку «отправляют» роботу,
   ответ приходит пузырём бота. Остальное нарочно тихое. */

:root {
  --royal: #1e4bff;
  --royal-deep: #0b2a9e;
  --cyan: #6fe3ff;
  --paper: #f3f6ff;
  --ink: #0e1a3d;
  --ink-soft: #46527a;
  --yellow: #ffe14d;
  --line: #d9e1f7;
  --display: "Unbounded", "Manrope", system-ui, sans-serif;
  --body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 500 16px/1.55 var(--body);
}

a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Шапка лежит поверх синего поля героя */
body { position: relative; }
.top {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 20px;
  color: #fff;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 700 17px/1 var(--display);
  text-decoration: none;
}
.brand img { border-radius: 50%; background: #fff; }
.top-nav { display: flex; align-items: center; gap: 14px; }
.langs { display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: rgb(0 8 60 / .28); }
.langs a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  color: rgb(255 255 255 / .92);
}
.langs a[aria-current="page"] { background: #fff; color: var(--royal); }
.top-bot {
  padding: 9px 16px;
  border-radius: 999px;
  border: 1.5px solid rgb(255 255 255 / .55);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}
.top-bot:hover { background: rgb(255 255 255 / .12); }

/* Синее поле: шапка + герой. Нижний край скруглён, робот выходит за него. */
.sky {
  padding-top: 72px;
  background: linear-gradient(180deg, var(--royal) 0%, var(--royal-deep) 100%);
  border-radius: 0 0 36px 36px;
}

.hero {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: end;
  gap: 24px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 20px 0;
  color: #fff;
}
.hero-text { padding-bottom: 56px; }

h1 {
  margin: 0 0 14px;
  max-width: 16ch;
  font: 700 clamp(30px, 5.2vw, 54px)/1.08 var(--display);
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.lead { margin: 0 0 26px; max-width: 46ch; font-size: 18px; color: rgb(255 255 255 / .94); }

.robot {
  width: 300px;
  height: auto;
  margin-bottom: -70px;
  filter: drop-shadow(0 20px 30px rgb(0 0 0 / .3));
  pointer-events: none;
}

/* Строка ввода — как поле сообщения в Telegram */
.composer {
  display: flex;
  gap: 10px;
  max-width: 680px;
  padding: 8px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 16px 36px rgb(0 0 0 / .22);
}
.composer-field {
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 0;
  border-radius: 16px;
  background: var(--paper);
}
.composer input {
  flex: 1;
  min-width: 0;
  height: 52px;
  padding: 0 14px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: 600 16px var(--body);
}
.composer input::placeholder { color: #5d6a93; font-weight: 500; }
.composer input:focus { outline: none; }
.composer-field:focus-within { box-shadow: inset 0 0 0 2px var(--cyan); }
.paste {
  margin-right: 4px;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background: #e3e9fb;
  color: var(--royal);
  font: 700 13px var(--body);
  cursor: pointer;
}
.send {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 22px;
  min-height: 52px;
  border: 0;
  border-radius: 16px;
  background: var(--yellow);
  color: var(--ink);
  font: 700 16px var(--body);
  cursor: pointer;
}
.send:hover { filter: brightness(.97); }
.send[disabled] { opacity: .6; cursor: progress; }

.works { margin: 14px 0 0; font-size: 14px; color: rgb(255 255 255 / .9); max-width: 680px; }

/* Ответ бота */
.reply {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  max-width: 680px;
  margin-top: 22px;
}
.reply[hidden] { display: none; }
.reply-avatar { flex: none; border-radius: 50%; background: #fff; }
.reply-bubble {
  flex: 1;
  min-width: 0;
  padding: 14px 16px;
  border-radius: 20px 20px 20px 6px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 10px 28px rgb(0 0 0 / .2);
}
.reply.in .reply-bubble { animation: bubble .28s ease-out; }
@keyframes bubble {
  from { transform: translateY(8px) scale(.98); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.reply-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.reply-head img {
  flex: none;
  width: 64px; height: 64px;
  object-fit: cover;
  border-radius: 12px;
  background: var(--paper);
}
.reply-title {
  margin: 0;
  font-weight: 700;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.reply-msg { margin: 0; }
.reply-msg.error { color: #b3261e; font-weight: 600; }
.reply-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.reply-actions a, .reply-actions button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: var(--royal);
  color: #fff;
  font: 700 15px var(--body);
  text-decoration: none;
  cursor: pointer;
}
.reply-actions .ghost { background: #e3e9fb; color: var(--royal); }
.reply-actions a.tg { background: #1679ab; }
.dots { display: inline-flex; gap: 4px; }
.dots i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ink-soft);
  animation: dot 1s infinite ease-in-out;
}
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* Тихая часть страницы */
.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 110px 20px 0;
}
.page > section + section { margin-top: 64px; }
h2 { margin: 0 0 14px; font: 700 26px/1.2 var(--display); }

.bot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.bot > div { max-width: 60ch; }
.bot p { margin: 0; color: var(--ink-soft); }
.bot-cta {
  flex: none;
  padding: 14px 22px;
  border-radius: 16px;
  background: #1679ab;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.how ol {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.how li { counter-increment: step; display: grid; gap: 6px; }
.how li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--royal);
  color: #fff;
  font: 700 16px var(--display);
}
.how strong { font-size: 18px; }
.how span { color: var(--ink-soft); }

.faq { max-width: 760px; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-of-type { border-bottom: 1px solid var(--line); }
.faq summary {
  padding: 16px 0;
  font-weight: 700;
  font-size: 17px;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; color: var(--royal); font-weight: 700; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0 0 16px; color: var(--ink-soft); max-width: 62ch; }

.api {
  padding: 28px 24px;
  border-radius: 24px;
  background: var(--ink);
  color: #fff;
}
.api p { margin: 0 0 18px; color: rgb(255 255 255 / .86); max-width: 60ch; }
.api-cta {
  display: inline-block;
  padding: 12px 18px;
  border-radius: 14px;
  background: var(--cyan);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.foot {
  max-width: 1120px;
  margin: 0 auto;
  padding: 36px 20px 44px;
  color: var(--ink-soft);
  font-size: 14px;
}
.foot p { margin: 0 0 6px; }
.foot-row { display: flex; gap: 16px; flex-wrap: wrap; }

@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); padding-top: 12px; }
  .hero-text { padding-bottom: 36px; }
  .robot { position: absolute; right: 8px; top: -6px; width: 112px; margin: 0; opacity: .95; }
  h1 { padding-right: 96px; }
  .page { padding-top: 56px; }
  .bot { flex-direction: column; align-items: flex-start; }
  .how ol { grid-template-columns: minmax(0, 1fr); gap: 18px; }
}

@media (max-width: 520px) {
  .top-bot { display: none; }
  .composer { flex-direction: column; padding: 8px; }
  .send { justify-content: center; }
  .lead { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .reply.in .reply-bubble, .dots i { animation: none; }
}
