@font-face {
  font-family: Onest;
  src: url(/assets/onest-cyrillic.woff2) format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: Onest;
  src: url(/assets/onest-latin.woff2) format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+20AC, U+20BD, U+2013, U+2014, U+2026;
}

:root {
  /* #191919 — точный цвет фона логотипа: так логотип лежит на диске без видимого квадрата. */
  --bg: #191919;
  --panel: #2a2825;
  --line: #34312d;
  --text: #fff8ea;
  --muted: #a39b8e;
  --gold: #ffd66b;
  --orange: #ff8a1e;
  --ink: #2a1600;
  --gold-fill: linear-gradient(180deg, var(--gold), var(--orange));
  --safe-top: var(--tg-content-safe-area-inset-top, 0px);
  --safe-bottom: max(var(--tg-safe-area-inset-bottom, 0px), env(safe-area-inset-bottom, 0px));
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.4 Onest, system-ui, sans-serif;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

button, a { font: inherit; color: inherit; }

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
}

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

h1, h2, p { margin: 0; }

.sr-only {
  position: absolute;
  top: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

#app {
  display: flex;
  flex-direction: column;
  min-height: var(--tg-viewport-stable-height, 100dvh);
  max-width: 480px;
  margin: 0 auto;
  padding: var(--safe-top) 16px calc(12px + var(--safe-bottom));
}

.grow { flex: 1 1 auto; min-height: 20px; }
.muted { color: var(--muted); }

/* Затмение */

.hero {
  position: relative;
  flex: none;
  height: clamp(210px, 42dvh, 360px);
  margin: calc(-1 * var(--safe-top)) -16px 0;
}

.disc {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: max(150vw, 560px);
  aspect-ratio: 1;
  transform: translateX(-50%);
  border-radius: 50%;
  background: var(--bg);
  box-shadow:
    0 0 0 1.5px var(--gold),
    0 0 34px 6px rgb(255 176 60 / .6),
    0 0 110px 34px rgb(255 120 20 / .28);
}

.logo {
  position: absolute;
  left: 50%;
  bottom: 14%;
  width: auto;
  height: 70%;
  aspect-ratio: 1;
  transform: translateX(-50%);
}

.reveal .disc { animation: eclipse 1.2s cubic-bezier(.2, .7, .2, 1) both; }
.reveal .logo { animation: logo-in .9s .25s ease-out both; }

@keyframes eclipse {
  from {
    box-shadow:
      0 0 0 1.5px rgb(255 214 107 / 0),
      0 0 0 0 rgb(255 176 60 / 0),
      0 0 0 0 rgb(255 120 20 / 0);
  }
}

@keyframes logo-in { from { opacity: 0; } }

.status { margin-top: 36px; }

.days {
  font-size: clamp(52px, 16vw, 68px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.045em;
}

.title {
  font-size: clamp(27px, 8vw, 32px);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -.03em;
}

.status p { margin-top: 8px; color: var(--muted); }

.notice {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--panel);
  font-size: 13px;
  color: var(--muted);
}

/* Кнопки */

.primary, .secondary {
  display: block;
  width: 100%;
  min-height: 50px;
  padding: 12px;
  text-align: center;
  font-weight: 600;
}

.primary {
  border-radius: 15px;
  background: var(--gold-fill);
  color: var(--ink);
}

.primary:active { filter: brightness(.92); }
.primary[aria-busy="true"] { opacity: .6; }

.secondary { font-weight: 500; }

.actions { flex: none; margin-top: 20px; }

/* Нижнее меню */

.nav {
  position: sticky;
  bottom: calc(10px + var(--safe-bottom));
  flex: none;
  display: flex;
  gap: 4px;
  margin-top: 10px;
  padding: 4px;
  border-radius: 999px;
  background: var(--panel);
  z-index: 2;
}

.nav button {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.nav button[aria-current="page"] {
  flex: 2 1 0;
  background: #fff4dc;
  color: var(--ink);
}

.icon { width: 21px; height: 21px; flex: none; }
.icon path, .icon circle { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Подключение */

.heading { margin: 22px 0 16px; flex: none; }

.stack { flex: none; }

.card {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  border-radius: 20px;
  padding: 14px 16px;
  text-align: left;
}

.card-back {
  height: 76px;
  width: calc(100% - 20px);
  margin: 0 10px -26px;
  background: var(--line);
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.card-back small { font-weight: 400; color: var(--muted); font-size: 13px; margin-left: 6px; }

.card-front {
  display: flex;
  flex-direction: column;
  height: 170px;
  background: var(--gold-fill);
  color: var(--ink);
  animation: card-up .28s cubic-bezier(.2, .7, .2, 1);
}

/* Кольцо повторяет обод затмения с главного экрана. */
.card-front::after {
  content: "";
  position: absolute;
  right: -70px;
  top: -80px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 1.5px solid rgb(42 22 0 / .22);
}

@keyframes card-up { from { transform: translateY(18px); } }

.card-name { font-size: 21px; font-weight: 700; letter-spacing: -.02em; }
.card-note { font-size: 13px; margin-top: 2px; }

.card-key {
  margin-top: auto;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rows { margin-top: 8px; flex: none; }

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  text-decoration: none;
}

.rows .row:last-child { border-bottom: 0; }
.row .icon { color: var(--gold); }
.row-text { flex: 1; min-width: 0; }
.row-text small { display: block; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-action { font-weight: 600; color: var(--gold); font-size: 14px; }

.help { display: block; width: 100%; padding: 12px 0 2px; text-align: center; font-size: 13px; color: var(--muted); }
.help u { text-underline-offset: 2px; }

/* Шторка оплаты */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgb(0 0 0 / .62);
  animation: fade-in .2s ease-out;
}

.sheet {
  width: 100%;
  max-width: 480px;
  padding: 10px 16px calc(14px + var(--safe-bottom));
  border-radius: 24px 24px 0 0;
  background: var(--panel);
  animation: sheet-up .28s cubic-bezier(.2, .7, .2, 1);
}

@keyframes fade-in { from { opacity: 0; } }
@keyframes sheet-up { from { transform: translateY(100%); } }

.grab { width: 36px; height: 4px; margin: 0 auto 16px; border-radius: 9px; background: #55504a; }
.price { font-size: 44px; font-weight: 600; line-height: 1; letter-spacing: -.04em; }
.sheet .row { border-bottom: 0; }
.sheet .primary { margin-top: 8px; }

/* Друзья */

.stats { display: flex; gap: 28px; flex: none; margin-top: 4px; }
.stat b { display: block; font-size: 34px; font-weight: 600; line-height: 1.1; letter-spacing: -.03em; }
.stat span { color: var(--muted); font-size: 13px; }

/* Переключатель тестового режима */

.demo-bar {
  position: relative;
  z-index: 3;
  display: flex;
  flex: none;
  gap: 4px;
  height: 0;
  padding-top: 8px;
}

.demo-bar button {
  flex: 1;
  height: 32px;
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.demo-bar button[aria-pressed="true"] { background: var(--line); color: var(--text); }

/* Страница перехода в VPN-приложение */

.connect-page {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  min-height: 100dvh;
  max-width: 420px;
  margin: 0 auto;
  padding: 24px 16px;
}

.connect-page .primary { margin-top: 16px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
