/* ThankeeBook — сайт. Ни скриптов, ни чужих шрифтов: всё лежит здесь же.
   Цвета взяты из приложения (lib/theme/app_theme.dart). */

:root {
  color-scheme: dark;
  --bg: #1f1c21;
  --bg-top: #30272b;
  --bg-bottom: #2b1f2a;
  --surface: #26262c;
  --surface-high: #303037;
  --outline: #3a3a42;
  --text: #f2f0ee;
  --muted: #a9a4ab;
  --pink: #e83e7c;
  --coral: #ff8f70;
  --sky: #5ea8e8;
  --teal: #4db6a0;
  --gold: #e5b567;
  --lavender: #9c8ce0;
  --radius: 24px;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--sky); text-underline-offset: 3px; }
a:hover { color: #9ccaf3; }
a:focus-visible { outline: 2px solid var(--sky); outline-offset: 3px; border-radius: 6px; }

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

/* ── Первый экран: название во всю ширину, поверх него телефон ────────── */
.stage {
  /* Ширина телефона. Нужна и названию, и подписи: подпись обязана
     кончаться раньше, чем начинается телефон. */
  --pw: clamp(230px, 23vw, 340px);
  position: relative;
  overflow: hidden;
  height: min(100svh, 940px);
  min-height: 640px;
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 560px at 50% 30%, rgba(232, 62, 124, 0.16), transparent 70%),
    radial-gradient(700px 480px at 85% 0%, rgba(255, 143, 112, 0.14), transparent 70%),
    linear-gradient(var(--bg-top), var(--bg) 55%, var(--bg-bottom));
}
/* Низ сцены уходит в темноту: подпись читается, а телефон не обрывается ножом */
.stage::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 38%; z-index: 3; pointer-events: none; background: linear-gradient(transparent, rgba(31, 28, 33, 0.92) 78%); }

/* Шапка в два этажа: название по центру, служебное по краям, ниже — строка разделов */
.top { position: relative; z-index: 5; background: #1a171b; border-bottom: 1px solid var(--outline); }
.bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; max-width: 1080px; margin: 0 auto; padding: 18px 22px 8px; }
.brand { justify-self: center; display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 800; font-size: 1.5rem; letter-spacing: 0.01em; }
.brand img { width: 30px; height: 30px; object-fit: contain; }
.util { justify-self: end; color: var(--text); text-decoration: none; font-size: 0.86rem; }
.util:hover { text-decoration: underline; color: var(--text); }
.menu { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 36px; padding: 8px 22px 16px; font-size: 0.74rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }
.menu a { color: var(--text); text-decoration: none; padding: 4px 0; border-bottom: 1px solid transparent; }
.menu a:hover { color: var(--text); border-bottom-color: currentColor; }
/* Выбор языка: раскрывается без скриптов, обычным <details> */
.langs { position: relative; justify-self: start; font-size: 0.86rem; }
.langs summary { display: flex; align-items: center; gap: 8px; color: var(--text); cursor: pointer; list-style: none; user-select: none; }
.langs summary::-webkit-details-marker { display: none; }
.langs summary svg { width: 17px; height: 17px; fill: currentColor; }
.langs summary::after { content: ""; width: 5px; height: 5px; margin: -3px 0 0 1px; border-right: 1.5px solid; border-bottom: 1.5px solid; rotate: 45deg; }
.langs[open] summary::after { rotate: 225deg; margin-top: 3px; }
.langs ul { position: absolute; left: 0; top: calc(100% + 12px); z-index: 10; min-width: 190px; max-height: 62vh; overflow: auto; margin: 0; padding: 8px; list-style: none; background: #2a252b; border: 1px solid var(--outline); border-radius: 14px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55); }
.langs li a { display: block; padding: 9px 12px; border-radius: 8px; color: var(--text); text-decoration: none; }
.langs li a:hover { background: rgba(255, 255, 255, 0.08); }
.langs li a[aria-current] { color: var(--coral); font-weight: 700; }

/* Название расступается, и телефон встаёт между «Thankee» и «Book»:
   оба слова видны целиком, ничего не перекрыто. */
.title {
  position: absolute; z-index: 2; left: 0; right: 0; top: 46%; translate: 0 -50%;
  display: flex; align-items: center; justify-content: center; gap: 1.6vw;
  font-size: calc((100vw - var(--pw) - 9vw) / 6.75); font-weight: 800; letter-spacing: -0.045em; line-height: 1; white-space: nowrap;
}
.title .w { opacity: 0; animation: rise 1.3s cubic-bezier(0.2, 0.7, 0.2, 1) 0.15s forwards; }
.slot { position: relative; flex: none; width: var(--pw); height: 0; }
.phone {
  position: absolute; left: 0; top: 0; translate: 0 -34%; width: 100%;
  border-radius: 38px; border: 8px solid #121014; outline: 1px solid var(--outline);
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.6), 0 0 120px rgba(232, 62, 124, 0.22);
  opacity: 0; animation: lift 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) 0.55s forwards;
}
.cap { position: absolute; z-index: 4; left: max(22px, calc((100% - 1080px) / 2 + 22px)); bottom: 44px; max-width: calc(50vw - var(--pw) / 2 - max(22px, calc((100vw - 1080px) / 2 + 22px)) - 20px); }
/* Подпись держится в две строки и не заходит на телефон. Места слева от
   телефона немного, около 330 точек при любой ширине окна, поэтому буквы
   мелкие: крупнее - и фраза ломается на три строки. */
.cap h1 { margin: 0 0 18px; font-size: 0.875rem; line-height: 1.35; letter-spacing: 0; font-weight: 600; text-wrap: balance; }
/* Плашка в виде магазинной: чёрная, цветной знак, две строки. После публикации
   заменить на официальную «Доступно в Google Play» со ссылкой на приложение. */
.store { display: inline-flex; align-items: center; gap: 12px; background: #000; color: #fff; border: 1px solid #a6a6a6; border-radius: 10px; padding: 8px 20px 8px 14px; }
.store .gp { flex: none; width: 30px; height: 30px; }
.store small { display: block; font-size: 0.64rem; line-height: 1.2; letter-spacing: 0.09em; text-transform: uppercase; color: #e3e3e3; }
.store b { display: block; font-size: 1.28rem; line-height: 1.15; font-weight: 600; letter-spacing: -0.01em; }

/* Значки из приложения: проявляются по одному и чуть покачиваются */
.decor { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.fl { position: absolute; opacity: 0; --o: 0.3; animation: appear 1s ease-out forwards, bob 8s ease-in-out infinite; }
.fl.pink { fill: var(--pink); } .fl.coral { fill: var(--coral); } .fl.sky { fill: var(--sky); }
.fl.teal { fill: var(--teal); } .fl.gold { fill: var(--gold); } .fl.lav { fill: var(--lavender); }
.fl.i1  { left: 5%;  top: 15%; width: 70px; rotate: -14deg; animation-delay: 0.9s, 0s; }
.fl.i2  { left: 22%; top: 9%;  width: 44px; rotate: 10deg;  --o: 0.26; animation-delay: 1.15s, 1.2s; }
.fl.i3  { left: 13%; top: 62%; width: 84px; rotate: -8deg;  --o: 0.22; animation-delay: 1.4s, 2.1s; }
.fl.i4  { left: 30%; top: 70%; width: 52px; rotate: 16deg;  animation-delay: 1.65s, 0.6s; }
.fl.i5  { left: 90%; top: 18%; width: 66px; rotate: -12deg; animation-delay: 1.9s, 3s; }
.fl.i6  { left: 72%; top: 9%;  width: 48px; rotate: 12deg;  --o: 0.26; animation-delay: 2.15s, 1.8s; }
.fl.i7  { left: 80%; top: 60%; width: 78px; rotate: 18deg;  --o: 0.22; animation-delay: 2.4s, 2.6s; }
.fl.i8  { left: 66%; top: 72%; width: 50px; rotate: -18deg; animation-delay: 2.65s, 0.9s; }
.fl.i9  { left: 1%;  top: 42%; width: 46px; rotate: 8deg;   --o: 0.24; animation-delay: 2.9s, 3.4s; }
.fl.i10 { left: 94%; top: 44%; width: 42px; rotate: -6deg;  animation-delay: 3.15s, 1.5s; }
.fl.i11 { left: 38%; top: 14%; width: 36px; rotate: 22deg;  --o: 0.22; animation-delay: 3.4s, 2.3s; }
.fl.i12 { left: 58%; top: 16%; width: 38px; rotate: -20deg; --o: 0.22; animation-delay: 3.65s, 0.3s; }

@keyframes appear { from { opacity: 0; scale: 0.5; } to { opacity: var(--o); scale: 1; } }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -14px; } }
@keyframes rise { from { opacity: 0; translate: 0 0.12em; } to { opacity: 1; translate: 0 0; } }
@keyframes lift { from { opacity: 0; translate: 0 calc(-34% + 60px); } to { opacity: 1; translate: 0 -34%; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fl { animation: none; opacity: var(--o); }
  .title .w, .phone { animation: none; opacity: 1; }
}

/* ── Разделы: крупный текст и тонкие линии, без коробок ───────────────── */
section { padding: 110px 0; }
.eyebrow { margin: 0 0 14px; color: var(--coral); font-size: 0.82rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
h2 { margin: 0 0 22px; font-size: clamp(2rem, 5.4vw, 3.6rem); line-height: 1.06; letter-spacing: -0.03em; font-weight: 800; max-width: 16em; text-wrap: balance; }
.sub { margin: 0 0 64px; color: var(--muted); font-size: clamp(1.05rem, 1.9vw, 1.25rem); max-width: 36em; }

/* Три шага — в том же виде, что и строка значков ниже: значок, название, подпись */
.flow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px 36px; margin: 0; padding: 56px 0 0; list-style: none; border-top: 1px solid var(--outline); }
.flow svg { width: 34px; height: 34px; margin-bottom: 16px; fill: var(--coral); }
.flow li:nth-child(2) svg { fill: var(--sky); }
.flow li:nth-child(3) svg { fill: var(--lavender); }
.flow strong { display: block; font-size: 1.12rem; line-height: 1.25; margin-bottom: 6px; }
.flow span { color: var(--muted); font-size: 0.95rem; }

/* Возможности: слово и экран рядом, стороны чередуются */
.feats { padding-bottom: 30px; overflow: hidden; }
.feat { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 40px; padding: 56px 0; }
.feat:nth-of-type(even) .say { order: 2; }
.feat h3 { margin: 0 0 16px; font-size: clamp(1.8rem, 4.2vw, 3rem); line-height: 1.08; letter-spacing: -0.025em; font-weight: 800; text-wrap: balance; }
.feat p { margin: 0; color: var(--muted); font-size: clamp(1.05rem, 1.9vw, 1.22rem); max-width: 26em; }
.ph { position: relative; isolation: isolate; justify-self: center; }
.ph::before { content: ""; position: absolute; z-index: -1; inset: -16% -34%; border-radius: 50%; background: radial-gradient(closest-side, var(--glow), transparent); }
.ph img { width: min(290px, 68vw); height: 500px; object-fit: cover; object-position: top; border-radius: 36px 36px 0 0; border: 8px solid #121014; border-bottom: 0; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.g-coral { --glow: rgba(255, 143, 112, 0.34); } .g-sky { --glow: rgba(94, 168, 232, 0.34); }
.g-lav { --glow: rgba(156, 140, 224, 0.38); } .g-teal { --glow: rgba(77, 182, 160, 0.34); }

/* «И ещё» — значок и подпись, без рамок */
.extras { display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px 36px; margin: 40px 0 0; padding: 56px 0 0; list-style: none; border-top: 1px solid var(--outline); }
.extras svg { width: 34px; height: 34px; margin-bottom: 16px; fill: var(--sky); }
.extras li:nth-child(2) svg { fill: var(--gold); } .extras li:nth-child(3) svg { fill: var(--teal); } .extras li:nth-child(4) svg { fill: var(--lavender); }
.extras strong { display: block; font-size: 1.12rem; line-height: 1.25; margin-bottom: 6px; }
.extras span { color: var(--muted); font-size: 0.95rem; }

/* Подписка — без рамки: розово-коралловое свечение на всю ширину страницы.
   Свечение лежит отдельным слоем и тает к верху и низу: иначе край раздела
   режет его ровной чертой, и получается та самая коробка. */
.thankee { position: relative; isolation: isolate; }
.thankee::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(60% 70% at 18% 42%, rgba(232, 62, 124, 0.26), transparent 70%), radial-gradient(55% 65% at 88% 66%, rgba(255, 143, 112, 0.16), transparent 70%);
  -webkit-mask-image: linear-gradient(transparent, #000 32%, #000 68%, transparent); mask-image: linear-gradient(transparent, #000 32%, #000 68%, transparent); }
/* Запас снизу и высокая строка: иначе градиент срезает хвост у буквы «y» */
.panel h2 { font-size: clamp(2.6rem, 7.4vw, 5.2rem); line-height: 1.2; margin: 0 0 10px; padding-bottom: 0.08em; background: linear-gradient(90deg, var(--pink), var(--coral)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.claim { margin: 0 0 60px; font-size: clamp(1.25rem, 2.7vw, 1.8rem); line-height: 1.32; font-weight: 600; letter-spacing: -0.01em; max-width: 25em; text-wrap: balance; }
.claim em { font-style: normal; color: var(--coral); }

.big3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 52px 40px; margin: 0 0 56px; padding: 0; list-style: none; }
.big3 svg { width: 46px; height: 46px; fill: #f2679a; }
.big3 li:nth-child(3n+2) svg { fill: var(--coral); }
.big3 li:nth-child(3n) svg { fill: var(--gold); }
.also { margin: 0; font-size: 1.12rem; font-weight: 600; }
.big3 strong { display: block; margin: 18px 0 8px; font-size: 1.5rem; line-height: 1.15; letter-spacing: -0.015em; font-weight: 800; }
.big3 span { color: #d8cfd3; }

.panel .small { margin: 28px 0 0; color: #b9aeb3; font-size: 0.92rem; }

/* ── Подвал ───────────────────────────────────────────────────────────── */
footer { border-top: 1px solid var(--outline); padding: 34px 0 44px; color: var(--muted); font-size: 0.93rem; }
footer p { margin: 0 0 8px; }
footer nav { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-bottom: 16px; }

/* ── Страница документа (политика) ────────────────────────────────────── */
.doc { max-width: 780px; padding: 16px 0 40px; }
.doc h1 { font-size: clamp(1.8rem, 4.5vw, 2.6rem); line-height: 1.15; letter-spacing: -0.02em; margin: 36px 0 14px; }
.doc h2 { margin: 40px 0 12px; font-size: 1.45rem; }
.doc h3 { margin: 26px 0 8px; font-size: 1.14rem; }
.doc p, .doc li { color: #e2dcdf; }
.doc ul, .doc ol { padding-left: 1.3em; }
.doc li { margin: 6px 0; }
.doc hr { border: 0; border-top: 1px solid var(--outline); margin: 36px 0; }
.doc code { font-family: "JetBrains Mono", Consolas, monospace; font-size: 0.9em; background: var(--surface-high); padding: 2px 6px; border-radius: 6px; }
.doc table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 0.95rem; display: block; overflow-x: auto; }
.doc th, .doc td { border: 1px solid var(--outline); padding: 9px 12px; text-align: left; vertical-align: top; }
.doc th { background: var(--surface); }

@media (max-width: 760px) {
  body { font-size: 16px; }
  .wrap { padding: 0 18px; }
  /* Боковые колонки обязаны уметь сжиматься. Без minmax(0, …) длинное
     слово («Datenschutzerklärung») не давало колонке стать уже себя и
     наезжало на название посередине. */
  .bar { padding: 14px 16px 6px; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; }
  .brand { font-size: 1.2rem; }
  .brand img { width: 24px; height: 24px; }
  .util, .langs { font-size: 0.78rem; }
  .util { min-width: 0; max-width: 100%; text-align: right; line-height: 1.2; hyphens: auto; overflow-wrap: anywhere; }
  .menu { gap: 4px 20px; padding: 8px 16px 14px; font-size: 0.66rem; }
  .stage { height: auto; min-height: 0; padding-bottom: 34px; }
  /* На телефоне в ряд не уместить: название одной строкой сверху, телефон под ним */
  .title { position: relative; top: auto; translate: none; flex-wrap: wrap; gap: 0; margin-top: 12vw; font-size: 13.9vw; }
  .slot { order: 3; flex-basis: 100%; width: auto; height: auto; display: flex; justify-content: center; margin-top: 7vw; }
  .phone { position: static; translate: none; width: min(66vw, 300px); border-radius: 32px; border-width: 7px; animation-name: lift-m; }
  .stage::after { height: 30%; }
  .cap { position: relative; left: auto; bottom: auto; margin: -70px 18px 0; max-width: none; }
  .cap h1 { max-width: none; font-size: clamp(0.82rem, 3.7vw, 1.05rem); }
  .flow, .feat, .big3 { grid-template-columns: 1fr; }
  .big3 { gap: 34px; margin-bottom: 48px; }
  .claim { margin-bottom: 44px; }
  .flow { gap: 34px 0; padding-top: 40px; }
  .feat { gap: 34px; padding: 40px 0; }
  .feat:nth-of-type(even) .say { order: 0; }
  .extras { grid-template-columns: 1fr 1fr; }
  section { padding: 70px 0; }
  .sub { margin-bottom: 44px; }
  .fl.i3, .fl.i7 { width: 56px; }
}
@keyframes lift-m { from { opacity: 0; translate: 0 50px; } to { opacity: 1; translate: 0 0; } }

.g-gold { --glow: rgba(229, 181, 103, 0.36); }
.extras li:nth-child(5) svg { fill: var(--gold); } .extras li:nth-child(6) svg { fill: var(--sky); }
.extras li:nth-child(7) svg { fill: var(--coral); } .extras li:nth-child(8) svg { fill: var(--teal); }

/* ── Языки с другим письмом ───────────────────────────────────────────── */
/* Арабский пишется справа налево. Название и телефон при этом остаются как
   есть: «Thankee … Book» читается слева направо на любом языке. */
[dir="rtl"] .title { direction: ltr; }
[dir="rtl"] .cap { left: auto; right: max(22px, calc((100% - 1080px) / 2 + 22px)); }
[dir="rtl"] .langs ul { left: auto; right: 0; }
/* Арабские буквы соединяются между собой: разрядка рвёт слово на куски,
   а сжатие слепляет соседние слова. */
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] strong, [dir="rtl"] .eyebrow,
[dir="rtl"] .menu, [dir="rtl"] .claim, [dir="rtl"] .store small { letter-spacing: 0; }
/* У хинди, тайского и арабского знаки стоят над и под строкой: при плотной
   строке крупного заголовка их срезает соседняя. */
:lang(hi) h2, :lang(th) h2, :lang(ar) h2, :lang(hi) h3, :lang(th) h3, :lang(ar) h3,
:lang(hi) .claim, :lang(th) .claim, :lang(ar) .claim { line-height: 1.4; }
/* В корейском строку переносят по словам, а не посреди слова. */
:lang(ko) { word-break: keep-all; }

/* ── Мелочи служебных страниц ─────────────────────────────────────────── */
.util.start { justify-self: start; }
.feats .note { margin: 22px 0 0; }
.doc .facts { color: var(--muted); }
.doc h1 + .facts { margin-top: 0; }
.lost { padding: 120px 22px 160px; }
