/* Fit Dungeon landing — палитра приложения (тёмно-синий + изумруд).
   Смена палитры = правка custom properties ниже. */

/* Manrope — вариативный шрифт (200–800), self-hosted, сабсеты latin + cyrillic */
@font-face {
  font-family: "Manrope";
  src: url("/fonts/manrope-var-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  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, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Manrope";
  src: url("/fonts/manrope-var-latin-ext.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  /* содержит знак рубля U+20BD */
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+1E00-1E9F, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113;
}
@font-face {
  font-family: "Manrope";
  src: url("/fonts/manrope-var-cyrillic.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

:root {
  --bg: #0a141d;
  --bg-elev: #101d28;
  --bg-card: #16242f;
  --text: #eef4f8;
  --muted: #91a5b3;
  --accent: #35e0a1;
  --accent-strong: #14b981;
  --accent-dim: rgba(53, 224, 161, 0.12);
  --border: rgba(255, 255, 255, 0.08);
  --radius: 20px;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
}

h1, h2, h3, h4 {
  margin: 0 0 0.5em;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h3 { font-size: clamp(1.3rem, 2.5vw, 1.7rem); }

p { margin: 0 0 1em; }

.container {
  width: min(1160px, 100% - 40px);
  margin-inline: auto;
}

/* ---------- Header ---------- */

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 20, 29, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header__inner {
  display: flex;
  align-items: center;
  gap: 32px;
  min-height: 68px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

.nav {
  display: flex;
  gap: 28px;
  margin-inline: auto;
}

.nav a {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.nav a:hover { color: var(--text); }

.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  padding: 8px;
  cursor: pointer;
}

.burger span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
  white-space: nowrap;
}

.btn--lg { padding: 16px 32px; font-size: 1.05rem; }

.btn--primary {
  background: var(--accent);
  color: #06231a;
  box-shadow: 0 6px 24px rgba(53, 224, 161, 0.35);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(53, 224, 161, 0.45);
}

.btn--ghost {
  border: 1px solid var(--border);
  color: var(--text);
  background: transparent;
}

.btn--ghost:hover { background: var(--bg-card); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 72px 0 40px;
}

.hero__glow {
  position: absolute;
  inset: auto -20% -60% -20%;
  height: 70%;
  background: radial-gradient(ellipse at 30% 100%, rgba(53, 224, 161, 0.18), transparent 60%);
  pointer-events: none;
}

.hero__inner {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: center;
  gap: 48px;
}

.hero__sub {
  color: var(--muted);
  font-size: 1.15rem;
  max-width: 32em;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 28px 0;
}

.hero__social p {
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 26em;
}

.hero__social strong { color: var(--accent); }

.hero__mockups {
  position: relative;
  display: flex;
  justify-content: center;
  min-height: 560px;
}

.hero__mockups .phone--front {
  position: relative;
  z-index: 2;
  transform: rotate(-4deg);
}

.hero__mockups .phone--back {
  position: absolute;
  right: 4%;
  top: 60px;
  z-index: 1;
  transform: rotate(7deg) scale(0.88);
  opacity: 0.9;
}

/* ---------- Phone mockup ---------- */

.phone {
  width: 260px;
  aspect-ratio: 9 / 19.5;
  border-radius: 44px;
  background: #05090d;
  border: 10px solid #1b2734;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.06),
    0 40px 80px rgba(0, 0, 0, 0.55);
  position: relative;
  flex-shrink: 0;
}

.phone::before {
  /* Dynamic Island */
  content: "";
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 32%;
  height: 22px;
  background: #05090d;
  border-radius: 999px;
  z-index: 3;
}

.phone__screen {
  position: absolute;
  inset: 0;
  border-radius: 34px;
  overflow: hidden;
  background: linear-gradient(160deg, #101d28, #0a141d);
}

.phone__screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* пока скриншот не подложен — не показывать alt-текст поверх «экрана» */
  color: transparent;
}

.phone--sm { width: 220px; }

/* ---------- Stats ---------- */

.stats { padding: 88px 0; }

.stats__inner {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 48px;
  align-items: start;
}

.stats__title p { color: var(--muted); }

.stats__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
}

.stat__num {
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.03em;
}

.stat__label {
  font-weight: 700;
  margin: 4px 0 10px;
}

.stat p {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
}

/* ---------- Sections / features ---------- */

.section { padding: 88px 0; }

.section--alt { background: var(--bg-elev); }

.section__head {
  max-width: 640px;
  margin-bottom: 64px;
}

.section__head p { color: var(--muted); font-size: 1.1rem; }

.feature {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 48px;
  align-items: center;
  padding: 40px 0;
}

.feature--reverse .feature__text { order: 2; }
.feature--reverse .feature__media { order: 1; }

.feature__media {
  display: flex;
  justify-content: center;
}

.feature__tag {
  display: inline-block;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.feature__text p { color: var(--muted); }

.feature__list {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
}

.feature__list li {
  position: relative;
  padding-left: 30px;
  margin-bottom: 12px;
  color: var(--text);
}

.feature__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-dim);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2335e0a1' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 13l4 4L19 7'/%3E%3C/svg%3E");
  background-size: 11px;
  background-position: center;
  background-repeat: no-repeat;
}

/* ---------- Pricing ---------- */

.pricing {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.price-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  position: relative;
  display: flex;
  flex-direction: column;
}

.price-card--hot {
  border-color: var(--accent);
  box-shadow: 0 0 40px rgba(53, 224, 161, 0.15);
}

.price-card__badge {
  position: absolute;
  top: -12px;
  right: 20px;
  background: var(--accent);
  color: #06231a;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 999px;
}

.price-card h3 { font-size: 1.1rem; min-height: 2.6em; }

.price-card__price {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.price-card__price span {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}

.price-card p {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
}

.pricing__note {
  margin-top: 28px;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- Download ---------- */

.download__inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: center;
  background: linear-gradient(140deg, var(--bg-card), var(--bg-elev));
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 56px;
  overflow: hidden;
}

.download__text p { color: var(--muted); font-size: 1.1rem; }

.download__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 24px;
}

.download .phone--sm {
  margin-bottom: -140px;
  transform: rotate(4deg);
  justify-self: center;
}

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--border);
  padding: 56px 0 24px;
  background: var(--bg-elev);
}

.footer__inner {
  display: grid;
  grid-template-columns: 1.2fr 2fr;
  gap: 48px;
}

.footer__brand p {
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 22em;
  margin-top: 16px;
}

.footer__nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.footer__nav h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 16px;
}

.footer__nav a {
  display: block;
  color: var(--text);
  font-size: 0.95rem;
  margin-bottom: 10px;
  transition: color 0.2s;
}

.footer__nav a:hover { color: var(--accent); }

.footer__bottom {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.footer__bottom p {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0;
}

/* ---------- Reveal on scroll ---------- */

/* Скрытие до появления действует только при работающем JS (класс .js вешает
   инлайн-скрипт в <head>) — без JS контент виден сразу. */
html.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

html.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Legal / simple pages ---------- */

.page {
  padding: 64px 0 88px;
  max-width: 760px;
  margin-inline: auto;
}

.page h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 24px; }
.page h2 { font-size: 1.3rem; margin-top: 40px; }
.page p, .page li { color: var(--muted); }
.page .todo {
  background: var(--accent-dim);
  border: 1px dashed var(--accent);
  border-radius: 12px;
  padding: 16px 20px;
  color: var(--text);
  font-size: 0.95rem;
}

/* ---------- Payment return ---------- */

.return-card {
  min-height: calc(100vh - 68px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.return-card__inner {
  max-width: 440px;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 48px 36px;
}

.return-card__icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background: var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
}

.return-card p { color: var(--muted); }

.return-card .btn { margin-top: 20px; }

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .hero__inner,
  .stats__inner,
  .feature,
  .download__inner,
  .footer__inner {
    grid-template-columns: 1fr;
  }

  .hero { padding-top: 48px; }
  .hero__mockups { min-height: 480px; margin-top: 16px; }

  .feature--reverse .feature__text { order: 1; }
  .feature--reverse .feature__media { order: 2; }

  .stats__grid { grid-template-columns: 1fr 1fr; }
  .pricing { grid-template-columns: 1fr 1fr; }

  .download .phone--sm { margin-bottom: -120px; }
}

@media (max-width: 640px) {
  .nav {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--border);
    display: none;
    padding: 12px 20px 20px;
  }

  .nav.is-open { display: flex; }

  .nav a { padding: 12px 0; }

  .burger { display: flex; margin-left: auto; }

  .header__cta { display: none; }

  .stats__grid,
  .pricing { grid-template-columns: 1fr; }

  .footer__nav { grid-template-columns: 1fr; }

  .download__inner { padding: 36px 24px; }

  .phone { width: 230px; }

  .hero__mockups .phone--back { display: none; }
}

/* ---------- Страница покупки (/pay/) ---------- */

.pay-card { max-width: 460px; }

.pay-kicker {
  margin: 0 0 6px;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.pay-title { margin: 0 0 12px; font-size: 1.6rem; }

.pay-price {
  margin: 0;
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--accent);
}

.pay-note {
  margin: 14px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.pay-hint {
  margin: 20px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.pay-error {
  margin: 0 0 24px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 138, 128, 0.35);
  background: rgba(255, 138, 128, 0.1);
  color: #ffb4ab;
  font-size: 0.92rem;
  text-align: left;
}

.pay-form { margin-top: 28px; }

.pay-offer {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 20px;
  text-align: left;
  font-size: 0.9rem;
  color: var(--muted);
  cursor: pointer;
}

.pay-offer input {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  accent-color: var(--accent-strong);
  cursor: pointer;
}

.pay-form .btn { width: 100%; }

.pay-form .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}
