/* Onenilla. Цвета взяты из приложения (mobile/src/theme/palette.js), шрифт Onest лежит рядом с сайтом. */

@font-face {
  font-family: "Onest";
  src: url("fonts/onest-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212;
}
@font-face {
  font-family: "Onest";
  src: url("fonts/onest-latin-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F;
}
@font-face {
  font-family: "Onest";
  src: url("fonts/onest-cyrillic.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* ---------- Цвета: тёмная тема основная, светлая включается по настройке системы ---------- */

:root {
  color-scheme: dark;
  --bg: #0D0914;
  --panel: #17111F;
  --text: #FBF7FF;
  --muted: #C8BFD3;
  --quiet: #9A8CA8;
  --dim: #6E5F7D;          /* только для очень крупных слов */
  --line: #44374F;
  --line-strong: #80718D;
  --rose: #E8175D;
  --rose-fill: #CE1454;
  --rose-text: #FF9BBB;
  --gold: #FF9500;

  /* Сторис в приложении всегда на сливовом холсте, в любой теме. */
  --story: #24132F;
  --story-raised: #3B2749;
  --on-story: #FBF7FF;
  --on-story-muted: #CFC2DB;
  --story-line: #8E7C9C;

  --font: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --edge: clamp(20px, 5.2vw, 80px);
  --gutter: max(var(--edge), calc((100vw - 1360px) / 2));
  --inset: clamp(8px, 1vw, 12px);
  --section: clamp(72px, 10vw, 144px);
  --round: clamp(28px, 3.4vw, 44px);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --spring-soft: var(--ease-out);
  --spring-soft-t: 500ms;
  --spring-lively: cubic-bezier(0.3, 1.4, 0.5, 1);
  --spring-lively-t: 500ms;
}
/* Пружины посчитаны из модели «груз на пружине». Старые браузеры берут обычную кривую выше. */
@supports (animation-timing-function: linear(0, 1)) {
  :root {
    --spring-soft: linear(0, 0.022, 0.078, 0.155, 0.243, 0.335, 0.426, 0.512, 0.591, 0.663, 0.726, 0.78, 0.827, 0.866, 0.898, 0.925, 0.946, 0.963, 0.976, 0.986, 0.993, 0.998, 1.002, 1.005, 1.006, 1.007, 1.007, 1.007, 1.007, 1.006, 1.005, 1.005, 1.004, 1.004, 1.003, 1.002, 1);
    --spring-soft-t: 620ms;
    --spring-lively: linear(0, 0.049, 0.172, 0.336, 0.512, 0.681, 0.83, 0.95, 1.038, 1.097, 1.129, 1.14, 1.134, 1.118, 1.095, 1.071, 1.047, 1.026, 1.009, 0.996, 0.987, 0.982, 0.98, 0.981, 0.983, 0.986, 0.99, 0.993, 0.996, 0.999, 1, 1.002, 1.002, 1.003, 1.003, 1.002, 1);
    --spring-lively-t: 850ms;
  }
}
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #FCF8FC;
    --panel: #F3ECF6;
    --text: #241B2B;
    --muted: #615369;
    --quiet: #71627A;
    --dim: #958699;
    --line: #DFD3E4;
    --line-strong: #8D7B96;
    --rose-text: #A7144B;
  }
}

/* ---------- Основа ---------- */

*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  scrollbar-color: var(--line-strong) var(--bg);
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
svg { display: block; }
[hidden] { display: none !important; }
.defs { position: absolute; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
::selection { background: var(--rose-fill); color: #fff; }
:focus-visible { outline: 3px solid var(--rose-text); outline-offset: 3px; border-radius: 8px; }
main:focus { outline: none; }
[id] { scroll-margin-top: 24px; }

.skip {
  position: absolute; left: var(--edge); top: 12px; z-index: 10;
  padding: 12px 18px; border-radius: 999px; background: var(--text); color: var(--bg); font-weight: 700; text-decoration: none;
  translate: 0 -200%;
}
.skip:focus { translate: 0 0; }

main h2 {
  font-size: clamp(1.875rem, 3.6vw, 3rem);
  line-height: 1.04; letter-spacing: -0.04em; font-weight: 700; text-wrap: balance;
}

/* Смена языка: текст коротко гаснет и появляется уже на другом языке. */
.swapping [data-swap] { opacity: 0; }

/* ---------- Верхняя строка ---------- */

.top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 24px;
  padding: 20px var(--gutter);
}
.wordmark { font-weight: 700; font-size: 1.375rem; letter-spacing: -0.035em; text-decoration: none; padding: 8px 0; }
.top-nav { display: flex; flex-wrap: wrap; gap: 0 clamp(18px, 2.4vw, 32px); font-size: 0.9375rem; font-weight: 500; }
.top-nav a {
  display: inline-flex; align-items: center; min-height: 44px;
  color: var(--muted); text-decoration: none; transition: color 160ms;
}
.top-nav a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1.5px; }

/* ---------- Главный экран: шесть «привет», они же переключатель языка ---------- */

.hero {
  /* Чуть ниже экрана: внизу выглядывает край следующего раздела, и видно, что страница продолжается. */
  min-height: calc(100svh - 84px - 80px);
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 88px); align-items: end;
  padding: 8px var(--gutter) clamp(40px, 7svh, 72px);
}

.hello {
  --size: clamp(3rem, min(10.6svh, 7.4vw), 6rem);
  --row: calc(var(--size) * 1.08);
  --i: 0;
  position: relative; font-size: var(--size); padding-left: 0.92em;
}
.hello[data-i="1"] { --i: 1; }
.hello[data-i="2"] { --i: 2; }
.hello[data-i="3"] { --i: 3; }
.hello[data-i="4"] { --i: 4; }
.hello[data-i="5"] { --i: 5; }

.hello a {
  position: relative;
  display: flex; align-items: baseline; gap: 0.2em; width: fit-content; height: var(--row);
  line-height: var(--row); font-weight: 700; letter-spacing: -0.04em;
  color: var(--dim); text-decoration: none; transition: color 200ms;
}
.hello a:hover { color: var(--muted); }
.hello a[aria-current] { color: var(--text); }
.hello a:focus-visible { outline-offset: 6px; border-radius: 14px; }
.lname { font-size: 0.9375rem; line-height: 1; font-weight: 500; letter-spacing: 0; color: var(--quiet); }
.hello a[aria-current] .lname { color: var(--muted); }

/* Жёлтая точка подсказывает, куда прыгнет значок. */
.hello a::before {
  content: ""; position: absolute; left: -0.665em; top: 50%;
  width: 0.15em; height: 0.15em; margin-top: -0.075em; border-radius: 50%;
  background: var(--gold); scale: 0;
}
.hello a[aria-current]::before { display: none; }
@media (hover: hover) { .hello a:hover::before { scale: 1; } }
.hello a:focus-visible::before { scale: 1; }

.mark {
  position: absolute; left: 0; top: calc(var(--row) * 0.2);
  width: 0.66em; height: 0.66em;
  translate: 0 calc(var(--i) * var(--row));
  pointer-events: none;
}

.hero-copy { max-width: 32rem; padding-bottom: 0.6rem; }
h1 {
  font-size: clamp(2rem, 3.6vw, 3.25rem);
  line-height: 1.04; letter-spacing: -0.04em; font-weight: 700; text-wrap: balance;
}
.lede { max-width: 30rem; margin-top: 20px; font-size: clamp(1.0625rem, 1.3vw, 1.1875rem); color: var(--muted); }

/* Места под магазины: пунктир, как у пустого кружка «Добавить» в приложении. */
.stores { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.store {
  display: inline-flex; align-items: baseline; gap: 8px; min-height: 48px; padding: 12px 20px;
  border: 1.5px dashed var(--line-strong); border-radius: 999px;
  font-size: 1rem; font-weight: 600; line-height: 1.3;
}
.store span { font-weight: 400; font-size: 0.9375rem; color: var(--muted); }
.store-live {
  display: inline-flex; align-items: center; min-height: 48px; padding: 12px 22px; border-radius: 999px;
  background: var(--rose-fill); color: #fff; font-weight: 700; text-decoration: none;
}

/* ---------- Как это работает ---------- */

.how {
  margin: 24px var(--inset) 0;
  padding: clamp(40px, 6.5vw, 96px) calc(var(--gutter) - var(--inset));
  background: var(--panel); border-radius: var(--round);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
  gap: clamp(40px, 6vw, 96px); align-items: center;
}
.intro { margin-top: 16px; max-width: 30rem; font-size: clamp(1.125rem, 1.5vw, 1.3125rem); line-height: 1.45; color: var(--muted); }
.steps { counter-reset: step; display: grid; gap: 28px; max-width: 34rem; margin-top: clamp(32px, 4vw, 56px); }
.steps li { counter-increment: step; display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); column-gap: 8px; }
.steps li::before {
  content: counter(step); grid-row: span 2;
  font-size: 1.375rem; line-height: 1.3; font-weight: 700; color: var(--rose-text);
}
.steps h3 { font-size: 1.375rem; line-height: 1.3; letter-spacing: -0.025em; font-weight: 700; }
.steps p { margin-top: 4px; color: var(--muted); }

/* Пример сторис, нарисованный теми же приёмами, что и в приложении. */
.story {
  display: grid; padding: 18px 20px 20px;
  background: var(--story); color: var(--on-story); border-radius: 32px;
}
.story :focus-visible { outline-color: #FFB0C9; }
/* Оба вида (сторис и чат) лежат в одной ячейке, поэтому карточка не прыгает по высоте. */
.story-view, .chat-view { grid-area: 1 / 1; display: flex; flex-direction: column; min-width: 0; }
.is-off { visibility: hidden; }
.story-progress { position: relative; height: 3px; border-radius: 3px; background: rgb(251 247 255 / 0.28); }
.story-progress::after { content: ""; position: absolute; inset: 0 38% 0 0; border-radius: 3px; background: #FBF7FF; }
.story-author { display: flex; align-items: center; gap: 14px; margin-top: 18px; padding-left: 4px; }
.avatar { width: 42px; height: 42px; flex: none; border-radius: 50%; outline: 2px solid var(--rose); outline-offset: 2px; }
.story-pic { width: 100%; height: auto; aspect-ratio: 16 / 10; margin-top: 18px; border-radius: 18px; }
.story-author b { display: block; font-size: 1rem; line-height: 1.25; font-weight: 700; }
.story-author small { display: block; font-size: 0.8125rem; line-height: 1.35; color: var(--on-story-muted); }
.story-text {
  margin-top: 20px;
  font-size: clamp(1.5rem, 2.2vw, 1.875rem); line-height: 1.15; letter-spacing: -0.03em; font-weight: 700; text-wrap: balance;
}
.story-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.story-tags span { padding: 6px 12px; border-radius: 999px; background: var(--story-raised); font-size: 0.875rem; font-weight: 600; }
.reply { margin-top: 24px; padding-top: 16px; border-top: 1px solid rgb(251 247 255 / 0.14); }
.reply-hint { font-size: 0.875rem; color: var(--on-story-muted); }
.reply-options { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; margin-top: 10px; }
.reply-options button {
  min-height: 48px; padding: 11px 18px; border-radius: 22px 22px 8px 22px;
  border: 1.5px dashed var(--story-line); font-weight: 600; line-height: 1.35; text-align: left;
  transition: background-color 160ms, border-color 160ms, scale 160ms;
}
.reply-options button:hover { background: rgb(251 247 255 / 0.08); border-color: #FBF7FF; border-style: solid; }
.reply-options button:active { scale: 0.97; transition-duration: 110ms; }

.chat-view:focus { outline: none; }
.chat-title { padding: 6px 4px 14px; border-bottom: 1px solid rgb(251 247 255 / 0.14); font-size: 1.125rem; letter-spacing: -0.02em; font-weight: 700; }
.chat-quote {
  align-self: flex-end; width: 78%; margin-top: auto; padding: 8px 8px 12px;
  border-radius: 20px 20px 6px 20px; background: var(--story-raised);
  font-size: 0.875rem; line-height: 1.4; color: var(--on-story-muted);
}
.chat-pic { width: 100%; height: auto; aspect-ratio: 16 / 9; margin-bottom: 10px; border-radius: 14px; }
.chat-quote small, .chat-quote span { padding: 0 6px; }
.chat-quote span { display: block; }
.chat-quote small { display: block; margin-bottom: 2px; font-size: 0.75rem; font-weight: 600; color: var(--on-story); }
.chat-sent {
  align-self: flex-end; max-width: 86%; margin-top: 8px; padding: 12px 18px;
  border-radius: 22px 22px 8px 22px; background: var(--rose-fill); color: #fff; font-weight: 600; line-height: 1.35;
}
.chat-note { margin-top: 22px; font-size: 0.9375rem; color: var(--on-story-muted); }
.chat-again {
  align-self: flex-start; min-height: 44px; margin-top: 4px;
  font-weight: 600; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1.5px;
}
.chat-again:hover { text-decoration-thickness: 2.5px; }
.demo figcaption { margin-top: 14px; padding: 0 4px; font-size: 0.8125rem; line-height: 1.45; color: var(--quiet); }

/* ---------- Безопасность ---------- */

.safety, .about { padding: var(--section) var(--gutter) 0; }
.facts { margin-top: clamp(32px, 4.5vw, 64px); border-bottom: 1px solid var(--line); }
.facts > div {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: baseline;
  gap: 6px clamp(24px, 4vw, 64px); padding: clamp(18px, 2vw, 26px) 0; border-top: 1px solid var(--line);
}
.facts dt { font-size: clamp(1.25rem, 2vw, 1.625rem); line-height: 1.2; letter-spacing: -0.03em; font-weight: 700; text-wrap: balance; }
.facts dd { max-width: 36rem; color: var(--muted); }

/* ---------- Языки ---------- */

.about {
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 40px clamp(40px, 6vw, 96px); align-items: end;
}
.about-text {
  max-width: 38rem; margin-top: clamp(20px, 2.4vw, 32px);
  font-size: clamp(1.25rem, 1.9vw, 1.625rem); line-height: 1.35; letter-spacing: -0.015em;
}
.about-langs h3 { font-size: 1.125rem; font-weight: 600; letter-spacing: -0.01em; }
/* Здесь названия языков не ссылки, поэтому они выглядят иначе, чем «приветы» наверху: мельче и основным цветом. */
.langs-names {
  margin-top: 10px; text-wrap: balance;
  font-size: clamp(1.25rem, 1.7vw, 1.5rem); line-height: 1.3; letter-spacing: -0.02em; font-weight: 600;
}
.langs-names li { display: inline; white-space: nowrap; }
.langs-names li:not(:last-child)::after { content: ","; }
.langs-text { max-width: 30rem; margin-top: 12px; color: var(--muted); }

/* ---------- Поддержка: единственное розовое поле на странице ---------- */

.support {
  margin: var(--section) var(--inset) 0;
  padding: clamp(40px, 6.5vw, 96px) calc(var(--gutter) - var(--inset));
  background: var(--rose-fill); color: #fff; border-radius: var(--round);
  display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 96px); align-items: end;
}
.support ::selection { background: #fff; color: #8B1242; }
.support :focus-visible { outline-color: #fff; }
.support-text { max-width: 32rem; margin-top: 16px; font-size: 1.125rem; }
.support-mail { margin-top: clamp(28px, 4vw, 48px); }
.support-mail a {
  font-size: clamp(1.5rem, 5vw, 4.25rem); line-height: 1.08; letter-spacing: -0.04em; font-weight: 700;
  text-decoration: underline; text-decoration-thickness: 0.06em; text-underline-offset: 0.16em; text-decoration-skip-ink: none;
}
.support-mail a:hover { text-decoration-thickness: 0.1em; }
.copy {
  min-height: 48px; margin-top: 28px; padding: 0 22px; border-radius: 999px;
  background: #fff; color: #8B1242; font-weight: 700;
  transition: background-color 160ms, scale 160ms;
}
.copy:hover { background: #FFE8F0; }
.copy:active { scale: 0.97; transition-duration: 110ms; }
.copy-status { min-height: 1.5em; margin-top: 10px; font-size: 0.9375rem; }
.support-aside h3 { font-size: 1.25rem; line-height: 1.25; letter-spacing: -0.025em; font-weight: 700; }
.support-aside p { margin-top: 8px; color: #FFE8F0; }

/* ---------- Низ страницы ---------- */

.foot {
  display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px clamp(32px, 5vw, 80px);
  padding: clamp(56px, 8vw, 112px) var(--gutter) 36px;
  font-size: 0.9375rem; color: var(--muted);
}
.foot-mark { display: flex; align-items: center; gap: 10px; font-size: 1.375rem; letter-spacing: -0.035em; font-weight: 700; color: var(--text); }
.foot-mark svg { width: 30px; height: 30px; }
.foot-brand > p + p { max-width: 26rem; margin-top: 12px; }
.foot .foot-adults { margin-top: 20px; font-weight: 600; color: var(--text); }
.foot h2 { margin: 0 0 2px; font-size: 0.9375rem; font-weight: 700; color: var(--text); }
.foot-col h2:not(:first-child) { margin-top: 20px; }
.foot-col h2 + p:not(:has(a)) { margin-top: 6px; }
.foot-col p, .foot-col li { max-width: 24rem; }
.foot a { text-underline-offset: 4px; text-decoration-thickness: 1px; }
.foot a:hover { color: var(--text); text-decoration-thickness: 2px; }
.foot-col a { display: inline-flex; align-items: center; min-height: 44px; }
.foot-langs { display: flex; flex-wrap: wrap; gap: 0 18px; }
.foot-langs a[aria-current] { color: var(--text); font-weight: 700; text-decoration: none; }
.foot-legal { grid-column: 1 / -1; padding-top: 20px; border-top: 1px solid var(--line); font-size: 0.875rem; color: var(--quiet); }

/* ---------- Движение ---------- */

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  [data-swap] { transition: opacity 140ms ease-out; }
  .mark { transition: translate var(--spring-lively-t) var(--spring-lively); animation: mark-in var(--spring-lively-t) var(--spring-lively) 380ms backwards; }
  .hello a::before { transition: scale 380ms var(--spring-lively); }
  .hello li { animation: hello-in 700ms var(--ease-out) backwards; }
  .hello li:nth-child(2) { animation-delay: 50ms; }
  .hello li:nth-child(3) { animation-delay: 100ms; }
  .hello li:nth-child(4) { animation-delay: 150ms; }
  .hello li:nth-child(5) { animation-delay: 200ms; }
  .hello li:nth-child(6) { animation-delay: 250ms; }
  @keyframes hello-in { from { opacity: 0; translate: 0 0.3em; } }
  @keyframes mark-in { from { scale: 0; } }
}

/* ---------- Узкие экраны ---------- */

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; align-items: start; gap: 32px; min-height: 0; padding-top: 12px; }
  .hello { --size: clamp(2.5rem, 12.6vw, 5rem); }
  .how { grid-template-columns: 1fr; }
  .about { grid-template-columns: 1fr; }
  .demo { max-width: 440px; }
  .support-mail a { font-size: clamp(1.5rem, 8vw, 4.25rem); }
  .support { grid-template-columns: 1fr; align-items: start; }
  .foot { grid-template-columns: 1fr 1fr; }
  .foot-brand { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .top { padding-top: 14px; padding-bottom: 6px; }
  .store { padding: 12px 15px; }
  .facts > div { grid-template-columns: 1fr; }
  .top-nav { gap: 0 14px; font-size: 0.875rem; }
  .hello a { width: 100%; }
  .lname { margin-left: auto; font-size: 0.875rem; }
  .steps li { grid-template-columns: 1.75rem minmax(0, 1fr); }
  .foot { grid-template-columns: 1fr; }
}

/* ---------- Страница «не найдено» ---------- */

.lost { min-height: 100svh; display: grid; align-content: center; gap: 28px; padding: 48px var(--gutter); }
.lost h1 { font-size: clamp(2rem, 4.3vw, 3.5rem); line-height: 1.04; letter-spacing: -0.04em; }
.lost p { max-width: 34rem; color: var(--muted); }
.lost .hello { --size: clamp(2.25rem, 7svh, 4rem); padding-left: 0; }
.lost .hello a { color: var(--text); }
.lost .hello a:hover { color: var(--rose-text); }
.lost .hello a::before { display: none; }
@media (max-width: 380px) {
  .top-nav { gap: 0 12px; font-size: 0.8125rem; }
}
