/* /m landing. One screen on a phone (install steps below it), mobile-first.
   Theme tokens are copied verbatim from public/styles.css (html[data-theme]); a test keeps them in sync.
   The landing defaults to "pastel" (утро). */
:root {
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;
  --gutter: 16px;
  --max: 1160px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

:root,
html[data-theme="pastel"] {
  color-scheme: light;
  --bg: #f3eee6;
  --bg-2: #fffaf4;
  --ink: #3f372f;
  --muted: #7a7066;
  --line: rgba(63, 55, 47, 0.12);
  --lime: #8fa86e;
  --coral: #d4897a;
  --card: #fffaf4;
  --shadow: 0 16px 40px rgba(90, 72, 52, 0.08);
  --on-accent: #243018;
  --on-danger: #fff8f5;
  --glow-1: rgba(175, 190, 140, 0.32);
  --glow-2: rgba(220, 168, 154, 0.2);
  --accent-soft: rgba(143, 168, 110, 0.16);
  --accent-line: rgba(143, 168, 110, 0.38);
  --btn: #4f6b38;
  --on-btn: #ffffff;
}

html[data-theme="mist"] {
  color-scheme: light;
  --bg: #e9ebf3;
  --bg-2: #f6f7fb;
  --ink: #32344a;
  --muted: #6d7084;
  --line: rgba(50, 52, 74, 0.12);
  --lime: #7d82c4;
  --coral: #c9899a;
  --card: #f6f7fb;
  --shadow: 0 16px 40px rgba(50, 52, 80, 0.08);
  --on-accent: #ffffff;
  --on-danger: #fff8f5;
  --glow-1: rgba(125, 130, 196, 0.22);
  --glow-2: rgba(201, 137, 154, 0.16);
  --accent-soft: rgba(125, 130, 196, 0.16);
  --accent-line: rgba(125, 130, 196, 0.38);
  --btn: #3e457e;
  --on-btn: #ffffff;
}

html[data-theme="dusk"] {
  color-scheme: dark;
  --bg: #3c365c;
  --bg-2: #4a4370;
  --ink: #f4f0fa;
  --muted: #c9c0dc;
  --line: rgba(244, 240, 250, 0.16);
  --lime: #d7c4ff;
  --coral: #f0a8bc;
  --card: #524a78;
  --shadow: 0 18px 48px rgba(28, 20, 52, 0.28);
  --on-accent: #2a2340;
  --on-danger: #fff8f5;
  --glow-1: rgba(215, 196, 255, 0.22);
  --glow-2: rgba(240, 168, 188, 0.16);
  --accent-soft: rgba(215, 196, 255, 0.2);
  --accent-line: rgba(215, 196, 255, 0.45);
  --btn: #efe8ff;
  --on-btn: #241c3a;
}

html[data-theme="night"] {
  color-scheme: dark;
  --bg: #110e0c;
  --bg-2: #1b1612;
  --ink: #f4ead8;
  --muted: #b4a894;
  --line: rgba(244, 234, 216, 0.12);
  --lime: #d8ff3c;
  --coral: #ff4d2e;
  --card: #241e18;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --on-accent: #111111;
  --on-danger: #ffffff;
  --glow-1: rgba(216, 255, 60, 0.12);
  --glow-2: rgba(255, 77, 46, 0.16);
  --accent-soft: rgba(216, 255, 60, 0.1);
  --accent-line: rgba(216, 255, 60, 0.28);
  --btn: #d8ff3c;
  --on-btn: #111111;
}

html[data-theme="slate"] {
  color-scheme: dark;
  --bg: #0b0f14;
  --bg-2: #141a22;
  --ink: #d7e0ea;
  --muted: #8b98a8;
  --line: rgba(167, 184, 204, 0.14);
  --lime: #7f9bb8;
  --coral: #b8899a;
  --card: #121820;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  --on-accent: #ffffff;
  --on-danger: #ffffff;
  --glow-1: rgba(127, 155, 184, 0.16);
  --glow-2: rgba(184, 137, 154, 0.12);
  --accent-soft: rgba(127, 155, 184, 0.14);
  --accent-line: rgba(127, 155, 184, 0.36);
  --btn: #a9bfd4;
  --on-btn: #0c1218;
}

/* Landing roles mapped onto the site tokens. */
html {
  --accent-text: var(--btn);
  --soft: color-mix(in srgb, var(--ink) 7%, transparent);
}
:root[data-theme="dusk"] { --accent-text: var(--lime); }

* { box-sizing: border-box; }
html {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100svh;
  overflow-x: clip;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(70vmax 50vmax at 0% 0%, var(--glow-1), transparent 60%),
    radial-gradient(60vmax 50vmax at 100% 30%, var(--glow-2), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
main { display: block; overflow-x: clip; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; border-radius: 6px; }

/* Header */
.top {
  height: calc(56px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) var(--gutter) 0;
  max-width: var(--max); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { font-weight: 600; letter-spacing: 0.16em; font-size: 15px; text-decoration: none; }
.brand span { color: var(--accent-text); }
.prefs { display: flex; align-items: center; gap: 6px; }
.lang {
  display: flex; padding: 3px;
  border-radius: 999px;
  background: var(--soft);
  border: 1px solid var(--line);
}
.lang a {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  min-width: 30px; height: 28px; padding: 0 6px;
  display: grid; place-items: center;
  border-radius: 999px;
  text-decoration: none; color: var(--muted);
}
.lang a[aria-current] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px var(--line); }
.theme-pick { position: relative; }
html:not(.js) .theme-pick { display: none; }
.theme-btn {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  background: var(--soft); color: var(--ink);
  cursor: pointer; padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.theme-btn__icon { display: none; }
html[data-theme="pastel"] .theme-btn__icon[data-for="pastel"],
html[data-theme="mist"] .theme-btn__icon[data-for="mist"],
html[data-theme="dusk"] .theme-btn__icon[data-for="dusk"],
html[data-theme="night"] .theme-btn__icon[data-for="night"],
html[data-theme="slate"] .theme-btn__icon[data-for="slate"] { display: grid; }
.theme-menu {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 60;
  width: 196px; padding: 6px;
  display: grid; gap: 2px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow), 0 2px 10px var(--line);
}
.theme-menu[hidden] { display: none; }
.theme-opt {
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 44px; padding: 4px 10px 4px 4px;
  border: 0; border-radius: 13px;
  background: transparent; color: var(--ink);
  font: inherit; font-size: 15px; text-align: left; cursor: pointer;
}
.theme-opt:hover { background: var(--soft); }
.theme-opt[aria-pressed="true"] { background: var(--accent-soft); font-weight: 600; }
.theme-opt[aria-pressed="true"]::after { content: "✓"; margin-left: auto; color: var(--accent-text); }
.theme-opt__swatch {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  border: 1px solid rgba(128, 128, 128, 0.25);
}
/* Swatch colors are each theme's --bg and --btn (dusk: --lime). */
[data-swatch="pastel"] { background: #f3eee6; color: #4f6b38; }
[data-swatch="mist"] { background: #e9ebf3; color: #3e457e; }
[data-swatch="dusk"] { background: #3c365c; color: #d7c4ff; }
[data-swatch="night"] { background: #110e0c; color: #d8ff3c; }
[data-swatch="slate"] { background: #0b0f14; color: #a9bfd4; }

/* Hero: fills the first screen on a phone. */
.hero {
  max-width: var(--max);
  margin: 0 auto;
  /* A definite height lets the card shrink to whatever space the copy and buttons leave. */
  height: max(560px, calc(100svh - 56px - env(safe-area-inset-top)));
  padding: 4px var(--gutter) calc(14px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-rows: auto minmax(150px, 1fr) auto;
  gap: 16px;
}
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--muted);
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
}
.pill__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-text); animation: ping 2.2s infinite; }
@keyframes ping {
  0% { box-shadow: 0 0 0 0 var(--accent-line); }
  80%, 100% { box-shadow: 0 0 0 9px transparent; }
}
.hero__title {
  margin-top: 14px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(34px, min(10.2vw, 7.4svh), 88px);
  line-height: 1;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.hero__title em {
  display: block;
  font-style: italic;
  font-weight: 700;
  color: var(--accent-text);
  background: linear-gradient(100deg, var(--accent-text) 20%, var(--coral) 50%, var(--accent-text) 80%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: sheen 6s ease-in-out infinite;
}
@keyframes sheen { 0%, 100% { background-position: 100% 0; } 50% { background-position: 0 0; } }
.hero__lead { margin-top: 10px; color: var(--muted); font-size: 16px; }

/* Profile card */
.hero__stage { position: relative; min-height: 0; display: grid; place-items: center; }
.card-wrap {
  position: relative; z-index: 2;
  height: 100%; max-height: 420px; max-width: 78%;
  aspect-ratio: 3 / 4;
  transform: rotate(-3deg);
  animation: bob 7s ease-in-out infinite;
}
@keyframes bob { 0%, 100% { transform: rotate(-3deg) translateY(0); } 50% { transform: rotate(-2deg) translateY(-6px); } }
.card {
  position: relative;
  width: 100%; height: 100%;
  border-radius: 26px;
  overflow: hidden;
  background: var(--card);
  box-shadow: var(--shadow), 0 0 0 1px var(--line);
}
.card img { width: 100%; height: 100%; object-fit: cover; }
.card-wrap .card { container-type: inline-size; }
@container (max-width: 220px) {
  .card__info { left: 10px; right: 46px; bottom: 10px; }
  .card__name { font-size: 17px; white-space: nowrap; }
  .card__tags span { font-size: 10px; padding: 2px 6px; }
  .card__tags span + span { display: none; }
  .card__like { width: 32px; height: 32px; right: 9px; bottom: 9px; font-size: 13px; }
}
.card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(10, 8, 6, 0.82)); }
.card__info { position: absolute; left: 14px; right: 60px; bottom: 14px; z-index: 1; color: #f7f3ec; }
.card__name { font-family: var(--serif); font-size: 22px; font-weight: 700; line-height: 1.1; }
.card__tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.card__tags span {
  font-size: 11px; padding: 3px 8px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.3);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.card__like {
  position: absolute; right: 12px; bottom: 12px; z-index: 1;
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--coral); color: var(--on-danger);
  animation: beat 2.4s ease-in-out infinite;
}
@keyframes beat { 0%, 70%, 100% { transform: scale(1); } 78% { transform: scale(1.14); } 86% { transform: scale(0.98); } }
.card--ghost {
  position: absolute; z-index: 1;
  width: auto; height: 86%; max-height: 360px;
  aspect-ratio: 3 / 4;
  transform: translateX(34%) rotate(9deg);
  opacity: 0.55;
}
.card--ghost::after { display: none; }
.float {
  position: absolute; z-index: 3; top: 10%; left: -18px;
  font-size: 13px; font-weight: 600;
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--coral); color: var(--on-danger);
  box-shadow: var(--shadow);
  animation: float 6s ease-in-out infinite;
}
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-8px) rotate(2deg); } }

/* Store buttons */
.hero__cta { display: grid; gap: 6px; }
.stores { display: grid; gap: 10px; }
.store {
  --btn-bg: var(--ink);
  position: relative;
  display: flex; align-items: center; gap: 14px;
  min-height: 58px;
  padding: 8px 18px;
  border-radius: 18px;
  text-decoration: none;
  background: var(--btn-bg);
  color: var(--bg);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.store--android { --btn-bg: var(--btn); color: var(--on-btn); }
.store:active { transform: scale(0.98); }
.store__icon { width: 24px; height: 24px; flex: none; }
.store__text { display: grid; line-height: 1.15; }
.store__text small { font-size: 12px; opacity: 0.7; }
.store__text b { font-size: 17px; font-weight: 600; }
.store[data-placeholder]::after {
  content: "soon";
  position: absolute; top: -8px; right: 14px;
  font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em;
  padding: 2px 8px; border-radius: 999px;
  background: var(--coral); color: var(--on-danger);
}
html[lang="ru"] .store[data-placeholder]::after { content: "скоро"; }
/* The visitor's own platform goes first. */
html[data-platform="android"] .stores .store--android,
html[data-platform="android"] .platform--android { order: -1; }
.web-link { justify-self: center; font-size: 14px; color: var(--muted); text-decoration: none; padding: 6px; }

/* Product overview */
.product { max-width: var(--max); margin: 0 auto; padding: 32px var(--gutter) 8px; }
.product__title { max-width: 640px; font-family: var(--serif); font-weight: 500; font-size: 32px; line-height: 1.15; letter-spacing: -0.02em; }
.product__subtitle { max-width: 640px; margin-top: 28px; font-family: var(--serif); font-weight: 500; font-size: 24px; line-height: 1.2; }
.product__lead { max-width: 640px; margin-top: 14px; color: var(--ink); font-size: 18px; line-height: 1.45; }

/* Install steps */
.install { max-width: var(--max); margin: 0 auto; padding: 40px var(--gutter) 24px; }
.install__title { font-family: var(--serif); font-weight: 500; font-size: 32px; letter-spacing: -0.02em; }
.platforms { margin-top: 18px; display: grid; gap: 12px; }
.platform {
  padding: 20px;
  border-radius: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  display: flex; flex-direction: column;
}
html[data-platform="ios"] .platform--ios,
html[data-platform="android"] .platform--android { border-color: var(--accent-line); box-shadow: 0 0 0 4px var(--accent-soft); }
.platform h3 { font-family: var(--serif); font-size: 24px; font-weight: 500; }
.platform ol { margin: 10px 0 16px; padding-left: 20px; color: var(--muted); font-size: 15px; display: grid; gap: 4px; flex: 1; }
.platform li a { color: var(--ink); text-underline-offset: 3px; }

/* Footer */
.foot {
  max-width: var(--max); margin: 0 auto;
  padding: 16px var(--gutter) calc(24px + env(safe-area-inset-bottom));
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px;
  font-size: 14px; color: var(--muted);
}
.foot a { text-decoration: none; padding: 6px 0; }
.foot a:hover { color: var(--ink); }
.badge-18 { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 6px; border: 1px solid var(--line); color: var(--ink); }

/* Toast */
.toast {
  position: fixed; z-index: 50;
  left: 50%; top: calc(64px + env(safe-area-inset-top));
  transform: translate(-50%, -12px);
  width: max-content; max-width: calc(100vw - 32px);
  padding: 12px 18px;
  border-radius: 16px;
  background: var(--ink); color: var(--bg);
  font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow);
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s, transform 0.25s var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* Larger phones and tablets */
@media (min-width: 560px) {
  :root { --gutter: 24px; }
  .stores { grid-template-columns: 1fr 1fr; }
  html[data-platform="android"] .stores .store--android,
  html[data-platform="android"] .platform--android { order: 0; }
  .platforms { grid-template-columns: 1fr 1fr; }
}

/* Desktop: copy and buttons on the left, card on the right. */
@media (min-width: 960px) {
  :root { --gutter: 40px; }
  .hero {
    grid-template-columns: 1.1fr 0.9fr;
    grid-template-rows: auto auto;
    column-gap: 56px;
    height: auto;
    min-height: 0;
    padding-top: 32px;
    padding-bottom: 40px;
  }
  .hero__copy { grid-column: 1; grid-row: 1; align-self: end; }
  .hero__cta { grid-column: 1; grid-row: 2; align-self: start; max-width: 520px; }
  .web-link { justify-self: start; }
  .hero__stage { grid-column: 2; grid-row: 1 / 3; }
  .hero__title { font-size: clamp(48px, min(5.6vw, 9svh), 84px); }
  .hero__lead { font-size: 18px; }
  .card-wrap { height: min(520px, 70svh); max-height: none; max-width: none; }
  .card--ghost { height: min(450px, 60svh); max-height: none; }
  .store:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
  .product { padding-top: 8px; padding-bottom: 24px; }
  .install { padding-top: 32px; }
  .install__title { font-size: 28px; }
}

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

/* analytics.js consent banner (styles.css is not loaded on this page) */
.analytics-consent {
  position: fixed; z-index: 90;
  left: 12px; right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  max-width: 520px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr auto; gap: 12px;
  padding: 16px 16px 14px 18px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--card) 95%, transparent);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: 1px solid var(--accent-line);
  box-shadow: var(--shadow);
}
.analytics-consent.closing { opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.analytics-consent p { font-size: 13px; line-height: 1.42; }
.analytics-consent a { font-weight: 500; text-underline-offset: 2px; }
.analytics-consent-actions { grid-column: 1 / -1; grid-row: 2; display: flex; gap: 8px; }
.analytics-consent-actions button {
  flex: 1; min-height: 42px; border-radius: 12px; border: 1px solid var(--line);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  background: transparent; color: var(--ink);
}
.analytics-consent-actions .solid { background: var(--btn); color: var(--on-btn); border-color: transparent; }
.analytics-consent-close {
  grid-column: 2; grid-row: 1; align-self: start;
  width: 32px; height: 32px; border: 0; border-radius: 50%;
  background: var(--soft); color: var(--muted); cursor: pointer;
}
@media (min-width: 960px) {
  .analytics-consent { grid-template-columns: 1fr auto auto; align-items: center; }
  .analytics-consent-actions { grid-column: 2; grid-row: 1; }
  .analytics-consent-actions button { flex: none; padding: 0 16px; }
  .analytics-consent-close { grid-column: 3; align-self: center; }
}
