:root {
  --bg: #f8f9fc;
  --surface: #ffffff;
  --surface-2: #eef0f7;
  --text: #161a2b;
  --muted: #555c75;
  --border: #dde1ee;
  --accent: #4f46e5;
  --accent-2: #0d8f8e;
  --accent-soft: #e8e7fd;
  --u: #b4207a;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(22, 26, 43, .08);
  --frame: #9ca3af;
  --max: 1120px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1220;
    --surface: #171b2e;
    --surface-2: #20253c;
    --text: #e9ebf5;
    --muted: #a5abc4;
    --border: #2c3250;
    --accent: #8b85ff;
    --accent-2: #2dd4bf;
    --accent-soft: #262a52;
    --u: #f472b6;
    --shadow: 0 10px 30px rgba(0, 0, 0, .35);
    --frame: #6b7280;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  overflow-wrap: break-word;
  overflow-x: clip; /* запобіжник: сторінка ніколи не прокручується вбік */
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
}

a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 3px; border-radius: 6px; }

.skip {
  position: absolute; inset-inline-start: 8px; top: 8px; transform: translateY(-200%);
  background: var(--surface); padding: 8px 14px; border-radius: 8px; z-index: 10;
}
.skip:focus { transform: none; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap { display: flex; align-items: center; gap: 20px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 18px; }
.brand img { width: 34px; height: 34px; }
.nav { display: flex; gap: 18px; margin-inline-start: auto; align-items: center; flex-wrap: wrap; }
.nav a { color: var(--muted); text-decoration: none; font-size: 15px; }
.nav a:hover { color: var(--text); }
@media (max-width: 820px) {
  .nav a { display: none; }
}

/* Language menu in the header (no JS: <details>) */
.langmenu { position: relative; flex: none; }
.langmenu summary {
  display: flex; align-items: center; gap: 6px; list-style: none; cursor: pointer;
  border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px;
  color: var(--text); font-weight: 600; font-size: 15px; white-space: nowrap; user-select: none;
}
.langmenu summary::-webkit-details-marker { display: none; }
.langmenu summary svg { flex: none; color: var(--muted); }
.langmenu summary:hover, .langmenu[open] summary { background: var(--surface-2); }
.langmenu ul {
  position: absolute; inset-inline-end: 0; top: calc(100% + 8px); z-index: 20;
  margin: 0; padding: 6px; list-style: none; min-width: 190px;
  max-height: calc(100vh - 90px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow);
}
.langmenu li a {
  display: block; padding: 8px 12px; border-radius: 8px; color: var(--text); text-decoration: none; text-align: start;
}
.langmenu li a:hover { background: var(--surface-2); }
.langmenu li a[aria-current] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

/* Hero */
.hero { padding: 72px 0 56px; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 48px; align-items: center; }
@media (max-width: 900px) { .hero .wrap { grid-template-columns: minmax(0, 1fr); } .hero { padding-top: 40px; } }
.eyebrow { color: var(--accent-2); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; font-size: 13px; margin: 0 0 12px; }
h1 { font-size: clamp(26px, 9vw, 54px); line-height: 1.1; margin: 0 0 18px; letter-spacing: -.02em; }
h1 .grad { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 19px; color: var(--muted); margin: 0 0 28px; max-width: min(34em, 100%); }
.cta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; max-width: 100%; }
.cta > * { min-width: 0; max-width: 100%; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border-radius: 12px;
  font-weight: 600; text-decoration: none; border: 1px solid transparent; font-size: 16px;
  max-width: 100%; text-align: center; overflow-wrap: anywhere;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { border-color: var(--border); color: var(--text); background: var(--surface); }
.badge-soon {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 12px; max-width: 100%;
  background: var(--surface-2); color: var(--muted); font-weight: 600; border: 1px dashed var(--border);
}
.facts { display: flex; gap: 22px; flex-wrap: wrap; margin: 30px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 15px; max-width: 100%; }
.facts b { color: var(--text); font-size: 20px; display: block; }

/* App screenshot */
.shot { justify-self: center; width: min(320px, 100%); margin: 0; }
.shot img {
  display: block; width: 100%; height: auto; border-radius: 30px; background: #111319;
  border: 2px solid var(--frame); box-shadow: var(--shadow);
}
.shot figcaption { margin-top: 14px; text-align: center; color: var(--muted); font-size: 14px; }
@media (max-width: 760px) {
  .shot { width: min(230px, 64%); }
  .shot img { border-radius: 22px; }
  .gallery img { border-radius: 20px; }
  .gallery figcaption { font-size: 14px; }
}

/* Sections */
section { padding: 64px 0; }
section.alt { background: var(--surface); border-block: 1px solid var(--border); }
h2 { font-size: clamp(26px, 3.4vw, 36px); line-height: 1.2; margin: 0 0 12px; letter-spacing: -.01em; }
.section-lead { color: var(--muted); max-width: 44em; margin: 0 0 36px; font-size: 18px; }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; counter-reset: step; padding: 0; list-style: none; margin: 0; }
@media (max-width: 860px) { .steps { grid-template-columns: minmax(0, 1fr); } }
.steps li {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px;
  counter-increment: step; position: relative;
}
section:not(.alt) .steps li { background: var(--surface); }
.steps li::before {
  content: counter(step); display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  background: var(--accent); color: #fff; font-weight: 700; margin-bottom: 14px;
}
.steps h3, .grid h3 { margin: 0 0 8px; font-size: 19px; }
.steps p, .grid p { margin: 0; color: var(--muted); }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 980px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid { grid-template-columns: minmax(0, 1fr); } }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px;
}
section.alt .card { background: var(--bg); }
.card .ico {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); margin-bottom: 14px;
}
.card .ico svg { width: 24px; height: 24px; }
.card ul { margin: 10px 0 0; padding-inline-start: 20px; color: var(--muted); }

.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: minmax(0, 1fr); } }

.tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 14px 0 0; }
.tags li { background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; font-size: 14px; }

.check { list-style: none; padding: 0; margin: 0; }
.check li { padding-inline-start: 30px; position: relative; margin-bottom: 12px; color: var(--muted); }
.check li b { color: var(--text); }
.check li::before {
  content: ""; position: absolute; inset-inline-start: 0; top: 4px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent-2);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 100 20 10 10 0 000-20zm-1.2 14.2l-4-4 1.4-1.4 2.6 2.6 5.6-5.6 1.4 1.4z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 100 20 10 10 0 000-20zm-1.2 14.2l-4-4 1.4-1.4 2.6 2.6 5.6-5.6 1.4 1.4z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* FAQ */
.faq details {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 0 20px; margin-bottom: 12px;
}
section.alt .faq details { background: var(--bg); }
.faq summary { cursor: pointer; font-weight: 600; padding: 16px 0; list-style-position: outside; }
.faq details p { margin: 0 0 16px; color: var(--muted); }

/* Contact */
.contact { text-align: center; }
.contact .section-lead { margin-inline: auto; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 28px 0 40px; color: var(--muted); font-size: 15px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; justify-content: center; text-align: center; }
.site-footer nav { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }
.site-footer a { color: var(--muted); }
.site-footer .footer-langs { flex-basis: 100%; gap: 6px 16px; font-size: 14px; }
.footer-langs span { color: var(--text); font-weight: 600; }

/* Arabic script: no letter spacing (it breaks joined letters) */
:lang(ar) h1, :lang(ar) h2, :lang(ar) .eyebrow { letter-spacing: 0; }
:lang(ar) h1, :lang(he) h1 { line-height: 1.3; }

/* Legal pages */
.legal { padding: 48px 0 72px; }
.legal .wrap { max-width: 800px; }
.legal h1 { font-size: clamp(30px, 4vw, 42px); }
.legal h2 { font-size: 24px; margin-top: 40px; }
.legal p, .legal li { color: var(--text); }
.legal .updated { color: var(--muted); }
.legal ul { padding-inline-start: 22px; }
.legal li { margin-bottom: 6px; }

.notfound { min-height: 60vh; display: grid; place-items: center; text-align: center; }
.cta.center { justify-content: center; }

.legal .intro { font-size: 18px; color: var(--muted); }

/* App icon */
.brand img { width: 38px; height: 38px; border-radius: 9px; }
.hero-icon { display: block; width: 112px; height: 112px; margin: 0 0 20px; filter: drop-shadow(0 12px 24px rgba(22, 26, 43, .18)); }
.contact-icon { display: block; width: 96px; height: 96px; margin: 0 auto 18px; }
@media (max-width: 900px) { .hero-icon { width: 88px; height: 88px; } }

/* Screenshot gallery */
.gallery { display: flex; flex-wrap: wrap; justify-content: center; gap: 40px; max-width: 680px; margin: 0 auto; }
.gallery figure { margin: 0; width: calc(50% - 20px); max-width: 300px; }
.gallery img {
  display: block; width: 100%; height: auto; border-radius: 26px; background: #111319;
  border: 2px solid var(--frame); box-shadow: var(--shadow);
}
.gallery figcaption { margin-top: 14px; text-align: center; color: var(--muted); font-size: 15px; }
@media (max-width: 760px) {
  .gallery { flex-direction: column; flex-wrap: nowrap; align-items: center; gap: 36px; }
  .gallery figure { width: min(230px, 64%); max-width: none; }
  .gallery figcaption { font-size: 14px; margin-top: 10px; }
}

/* Images never wider than their container */
img { max-width: 100%; height: auto; }

/* Width limits: no block may become wider than its column (mobile Chrome, large text) */
.hero .wrap > *, .split > *, .steps > *, .grid > *, .gallery > * { min-width: 0; max-width: 100%; }
.hero .wrap > div { width: 100%; }
