/* tele.click. Плоский дизайн без размытий и фоновых анимаций: анимируются
   только transform и opacity, чтобы вкладка не грела слабые телефоны.
   Страница всегда в один экран: высоты завязаны на vh/dvh. */

:root {
  --bg: #0c0c14; --surface: #15151f; --surface-2: #1d1d2a; --edge: #26263a; --edge-2: #34344c;
  --ink: #f2f2f7; --muted: #9a9ab0; --faint: #6c6c84;
  --accent: #7c6cff; --accent-ink: #ffffff; --accent-soft: rgba(124, 108, 255, .14);
  --cyan: #3cc8e8; --ok: #34d399; --bad: #fb7185;
  --dots: rgba(255, 255, 255, .05);
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f5fa; --surface: #ffffff; --surface-2: #f0f0f7; --edge: #e4e4ee; --edge-2: #d3d3e2;
    --ink: #15152a; --muted: #5f5f78; --faint: #8f8fa6;
    --accent: #5b4cf0; --accent-soft: rgba(91, 76, 240, .1);
    --cyan: #0e9fc0; --ok: #16a34a; --bad: #e11d48;
    --dots: rgba(21, 21, 42, .06);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body {
  margin: 0; height: 100vh; height: 100dvh; overflow: hidden;
  display: flex; flex-direction: column;
  font: 16px/1.5 "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg) radial-gradient(var(--dots) 1px, transparent 1.2px) 0 0 / 24px 24px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 20px; }

header { flex: none; }
header .wrap { display: flex; align-items: center; justify-content: space-between; height: clamp(56px, 9vh, 76px); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 700 18px/1 "Unbounded", sans-serif; letter-spacing: -.02em; }
.mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); }
.mark svg { width: 19px; height: 19px; margin-left: -2px; fill: #fff; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 13px; border-radius: 999px;
  font-size: 13.5px; font-weight: 500; color: var(--muted); background: var(--surface); border: 1px solid var(--edge);
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }

/* Главная */
.hero {
  flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding-bottom: 2vh;
}
.hero h1 {
  margin: clamp(12px, 2.4vh, 22px) 0 clamp(10px, 2vh, 18px); max-width: 820px;
  font: 700 clamp(28px, min(6vw, 7.4vh), 64px)/1.08 "Unbounded", sans-serif; letter-spacing: -.035em;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.sub { margin: 0 0 clamp(18px, 4vh, 36px); max-width: 540px; color: var(--muted); font-size: clamp(15px, 2.1vh, 18px); }
.alert {
  margin: 0 0 16px; padding: 9px 14px; border-radius: 12px; font-size: 14.5px;
  color: var(--bad); background: var(--surface); border: 1px solid var(--edge);
}
.alert code { font-family: ui-monospace, Menlo, monospace; }

.gen {
  display: flex; align-items: center; gap: 8px; width: 100%; max-width: 620px; padding: 7px;
  border-radius: 18px; background: var(--surface); border: 1px solid var(--edge);
  box-shadow: 0 18px 40px -24px rgba(0, 0, 0, .55);
  transition: border-color .2s, box-shadow .2s;
}
.gen:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.gen.bad { border-color: var(--bad); animation: shake .35s; }
.gen .at { flex: none; width: 34px; color: var(--faint); font-weight: 600; font-size: 18px; }
.gen input {
  flex: 1; min-width: 0; height: 50px; border: 0; outline: none; background: transparent;
  font: 500 17px/1 "Manrope", sans-serif; color: var(--ink);
}
.gen input::placeholder { color: var(--faint); }

.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 50px; padding: 0 22px; border: 0; border-radius: 13px; cursor: pointer; white-space: nowrap;
  font: 600 16px/1 "Manrope", sans-serif; color: var(--accent-ink); text-decoration: none;
  background: var(--accent); transition: transform .12s, opacity .2s;
}
.btn:hover { opacity: .92; }
.btn:active { transform: scale(.97); }
.btn svg { width: 18px; height: 18px; }
.btn.soft { color: var(--ink); background: var(--surface-2); border: 1px solid var(--edge); }
.btn .lbl, .btn .arr { transition: transform .25s, opacity .2s; }
.btn .arr { transition: transform .25s, opacity .2s; }
.btn:hover .arr { transform: translateX(3px); }
.btn .spin {
  position: absolute; width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff; opacity: 0;
}
.btn.busy .lbl, .btn.busy .arr { opacity: 0; transform: translateY(-6px); }
.btn.busy .spin { opacity: 1; animation: spin .6s linear infinite; }

/* Подсказка и результат делят один слот: появление ссылки не меняет высоту страницы */
.slot { display: grid; grid-template-columns: minmax(0, 1fr); width: 100%; max-width: 620px; height: 84px; margin-top: 12px; }
.slot > * { grid-area: 1 / 1; }
.hint { margin: 4px 0 0; font-size: 13.5px; color: var(--faint); transition: opacity .2s, transform .2s; }
.hint button {
  border: 0; padding: 0; background: none; font: inherit; color: var(--muted); cursor: pointer;
  text-decoration: underline dotted; text-underline-offset: 3px;
}
.hint button:hover { color: var(--ink); }
.hint.warn { color: var(--bad); }
.btn.wait { opacity: .55; cursor: not-allowed; }
.btn.wait .arr { display: none; }
.slot.done .hint { opacity: 0; transform: translateY(-6px); pointer-events: none; }

.result {
  display: flex; align-items: center; gap: 12px; height: 72px; padding: 0 10px 0 12px; text-align: left;
  border-radius: 18px; background: var(--surface); border: 1px solid var(--edge);
  opacity: 0; transform: translateY(14px) scale(.96); pointer-events: none;
}
.slot.done .result { opacity: 1; transform: none; pointer-events: auto; transition: transform .5s cubic-bezier(.2, 1.35, .4, 1), opacity .25s; }
.ava-wrap { position: relative; flex: none; width: 46px; height: 46px; }
.ava {
  width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center;
  color: #fff; font: 700 18px/1 "Unbounded", sans-serif;
}
.slot.done .ava { animation: pop .55s cubic-bezier(.2, 1.6, .4, 1) .08s both; }
.burst { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.burst i {
  position: absolute; left: -3px; top: -3px; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); opacity: 0;
}
.burst i:nth-child(3n) { background: var(--cyan); }
.burst i:nth-child(4n) { background: var(--ok); }
.burst.go i { animation: fly .7s cubic-bezier(.15, .7, .3, 1) .12s; }
.burst i:nth-child(1) { --x: 0px; --y: -38px; }
.burst i:nth-child(2) { --x: 27px; --y: -27px; }
.burst i:nth-child(3) { --x: 38px; --y: 0px; }
.burst i:nth-child(4) { --x: 27px; --y: 27px; }
.burst i:nth-child(5) { --x: 0px; --y: 38px; }
.burst i:nth-child(6) { --x: -27px; --y: 27px; }
.burst i:nth-child(7) { --x: -38px; --y: 0px; }
.burst i:nth-child(8) { --x: -27px; --y: -27px; }
.txt { flex: 1; min-width: 0; }
.txt small { display: block; font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ok); }
.out {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-weight: 700; font-size: 17.5px; color: var(--accent); text-decoration: none;
}
.out.typing::after { content: ""; display: inline-block; width: 2px; height: 1em; margin-left: 2px; vertical-align: -2px; background: currentColor; animation: caret .5s steps(1) infinite; }
.ib {
  position: relative; flex: none; width: 46px; height: 46px; border: 0; border-radius: 13px; cursor: pointer;
  display: grid; place-items: center; color: var(--ink); background: var(--surface-2); text-decoration: none;
  transition: transform .12s;
}
.ib:active { transform: scale(.92); }
.ib.main { color: #fff; background: var(--accent); }
.ib svg { width: 21px; height: 21px; grid-area: 1 / 1; transition: transform .3s cubic-bezier(.2, 1.6, .4, 1), opacity .2s; }
.ib .i-ok { opacity: 0; transform: scale(.4); }
.ib.ok { background: var(--ok); }
.ib.ok .i-copy { opacity: 0; transform: scale(.4); }
.ib.ok .i-ok { opacity: 1; transform: none; }

.perks {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; margin: clamp(14px, 4vh, 40px) 0 0; padding: 0;
  list-style: none; color: var(--muted); font-size: 14px;
}
.perks li { display: inline-flex; align-items: center; gap: 7px; }
.perks svg { width: 17px; height: 17px; color: var(--accent); }
footer { flex: none; padding: 0 16px calc(14px + env(safe-area-inset-bottom)); text-align: center; color: var(--faint); font-size: 12.5px; }

/* Страница перехода */
.go { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding-bottom: 3vh; }
.card {
  width: 100%; max-width: 420px; padding: clamp(24px, 5vh, 40px) 24px 24px; text-align: center;
  border-radius: 26px; background: var(--surface); border: 1px solid var(--edge);
  box-shadow: 0 30px 60px -36px rgba(0, 0, 0, .6);
}
.ring { position: relative; width: clamp(96px, 16vh, 124px); height: clamp(96px, 16vh, 124px); margin: 0 auto clamp(14px, 2.6vh, 22px); }
.ring::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 3px solid var(--edge-2); border-top-color: var(--accent);
  animation: spin 1s linear infinite;
}
.ring.done::before { animation: none; border-color: var(--ok); }
.ring .ava { position: absolute; inset: 9px; width: auto; height: auto; font-size: clamp(34px, 6vh, 44px); }
.card h1 { margin: 0 0 4px; font: 700 clamp(21px, 3.4vh, 26px)/1.2 "Unbounded", sans-serif; letter-spacing: -.02em; word-break: break-word; }
.card .kind { margin: 0 0 clamp(16px, 3.4vh, 26px); color: var(--muted); }
.card .btn { width: 100%; height: 54px; font-size: 16.5px; border-radius: 15px; }
.card .btn.web { height: 46px; margin-top: 10px; font-size: 15px; border-radius: 13px; }
.state { margin: 16px 0 0; font-size: 14px; color: var(--faint); }
.back { margin-top: clamp(14px, 3vh, 24px); color: var(--muted); font-size: 14.5px; text-decoration: none; }
.back b { color: var(--accent); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { from { transform: scale(0); } }
@keyframes fly {
  0% { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--x), var(--y)) scale(.3); }
}
@keyframes caret { 50% { opacity: 0; } }
@keyframes shake { 25% { transform: translateX(-6px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }

@media (max-width: 760px) { header .pill .long { display: none; } }
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .gen { flex-wrap: wrap; }
  .gen .at { width: 26px; }
  .gen .btn { width: 100%; }
  .slot { height: 76px; }
  .result { height: 68px; gap: 10px; padding: 0 8px 0 10px; }
  .ava-wrap { width: 42px; height: 42px; }
  .ib { width: 42px; height: 42px; }
  .out { font-size: 16px; }
  .perks { gap: 6px 16px; font-size: 13px; }
  .tag { display: none; }
}
/* Невысокие экраны и открытая клавиатура: убираем второстепенное, а не вводим прокрутку */
@media (max-height: 700px) { .perks { display: none; } }
@media (max-height: 600px) { .sub, .tag { display: none; } .hero h1 { font-size: clamp(24px, 6.4vh, 40px); } }
@media (max-height: 460px) {
  footer { display: none; }
  .hero h1 { display: none; }
  .card .btn.web, .back, .state { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* О сервисе: ссылки-вопросы и окно со спойлерами */
.faq-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: clamp(12px, 3vh, 28px); }
.faq-links button {
  padding: 7px 13px; border-radius: 999px; cursor: pointer;
  font: 500 13.5px/1.2 "Manrope", sans-serif; color: var(--muted);
  background: var(--surface); border: 1px solid var(--edge); transition: color .15s, border-color .15s;
}
.faq-links button:hover { color: var(--ink); border-color: var(--edge-2); }
.faq {
  width: min(560px, calc(100vw - 24px)); max-height: min(78dvh, 640px); padding: 0; overflow: hidden;
  color: var(--ink); background: var(--surface); border: 1px solid var(--edge); border-radius: 22px;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .7);
}
.faq[open] { display: flex; flex-direction: column; animation: sheet .3s cubic-bezier(.2, 1.1, .4, 1); }
.faq::backdrop { background: rgba(5, 5, 12, .6); animation: fade .25s; }
.faq-head { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 16px 14px 10px 22px; }
.faq-head b { font: 700 16px/1.2 "Unbounded", sans-serif; letter-spacing: -.01em; }
.faq-x {
  width: 38px; height: 38px; border: 0; border-radius: 50%; cursor: pointer; display: grid; place-items: center;
  color: var(--muted); background: var(--surface-2);
}
.faq-x svg { width: 18px; height: 18px; }
.faq-body { overflow-y: auto; padding: 4px 14px 16px; overscroll-behavior: contain; }
.faq details { border-radius: 14px; transition: background .2s; }
.faq details[open] { background: var(--surface-2); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 10px 14px 12px; cursor: pointer; list-style: none; font-weight: 600; font-size: 15.5px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 9px; height: 9px; margin-right: 6px;
  border-right: 2px solid var(--faint); border-bottom: 2px solid var(--faint);
  transform: rotate(45deg) translateY(-3px); transition: transform .25s;
}
.faq details[open] summary::after { transform: rotate(225deg) translateY(-2px); }
.faq .ans { padding: 0 12px 14px; color: var(--muted); font-size: 15px; animation: rise .25s ease-out; }
.faq .ans p { margin: 0; }
.faq .ans p + p { margin-top: 8px; }
.faq .ans ul { margin: 0; padding-left: 18px; }
.faq .ans li + li { margin-top: 4px; }
.faq .ans b { color: var(--ink); font-weight: 600; }
@keyframes sheet { from { opacity: 0; transform: translateY(24px) scale(.97); } }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(-4px); } }
@media (max-width: 560px) {
  .faq { width: 100vw; max-width: none; margin: auto 0 0; border-radius: 22px 22px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .faq[open] { animation-name: sheet-up; }
  .faq-links button { font-size: 12.5px; padding: 6px 11px; }
}
@keyframes sheet-up { from { transform: translateY(100%); } }
@media (max-height: 460px) { .faq-links { display: none; } }
