/* Сайт Magavis — тот же дизайн, что в приложении (ui/Theme.kt, ui/Kit.kt): тёмный фон «тушь», карточки
   Surface со скруглением 18–20, четыре цвета режимов, заголовки Unbounded, текст Manrope. Только тёмная тема,
   как в приложении. Отступы — логические свойства, чтобы арабский, фарси, иврит и урду (dir=rtl) раскладывались сами. */

@font-face { font-family: "Unbounded"; font-weight: 700; font-display: swap; src: url("/fonts/unbounded_700.ttf") format("truetype");
  unicode-range: U+0000-024F, U+0300-036F, U+0400-04FF, U+1E00-1EFF, U+2000-206F, U+20A0-20CF, U+2100-214F; }
@font-face { font-family: "Manrope"; font-weight: 400; font-display: swap; src: url("/fonts/manrope_400.ttf") format("truetype");
  unicode-range: U+0000-024F, U+0300-036F, U+0370-03FF, U+0400-04FF, U+1E00-1EFF, U+2000-206F, U+20A0-20CF, U+2100-214F; }
@font-face { font-family: "Manrope"; font-weight: 800; font-display: swap; src: url("/fonts/manrope_800.ttf") format("truetype");
  unicode-range: U+0000-024F, U+0300-036F, U+0370-03FF, U+0400-04FF, U+1E00-1EFF, U+2000-206F, U+20A0-20CF, U+2100-214F; }
@font-face { font-family: "Comic Relief"; font-weight: 700; font-display: swap; src: url("/fonts/comicrelief_700.ttf") format("truetype");
  unicode-range: U+0000-024F, U+0300-036F, U+0370-03FF, U+0400-04FF, U+1E00-1EFF, U+2000-206F; }

:root {
  --ink: #0F1115;
  --surface: #191C23;
  --line: #2A2E38;
  --divider: #23262E;
  --paper: #F4F1EA;
  --soft: #B8BCC6;
  --muted: #9AA0AE;
  --faint: #6F7584;
  --coral: #FF6B4A;
  --violet: #8B7CFF;
  --cyan: #2EC5FF;
  --lime: #D4F04A;
  --display: "Unbounded", "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --body: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --comic: "Comic Relief", "Comic Sans MS", "Chalkboard SE", var(--body);
  --wrap: 1120px;
  --gutter: 20px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0; background: var(--ink); color: var(--paper);
  font: 400 17px/1.55 var(--body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--lime); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; border-radius: 8px; }
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 700; letter-spacing: -0.01em; text-wrap: balance; }
p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 50; padding: 10px 16px; border-radius: 12px; background: var(--lime); color: var(--ink); font-weight: 800; text-decoration: none; }
.skip:focus { top: 12px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- шапка ---------- */
.top { position: sticky; top: 0; z-index: 20; background: rgba(15, 17, 21, 0.86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--divider); }
.top .wrap { display: flex; align-items: center; gap: 18px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--paper); text-decoration: none; margin-inline-end: auto; }
.brand svg { width: 34px; height: 34px; }
.brand span { font: 700 22px/1 var(--display); letter-spacing: -0.02em; }
.nav { display: flex; gap: 4px; }
.nav a { color: var(--soft); text-decoration: none; font-weight: 800; font-size: 15px; padding: 10px 12px; border-radius: 12px; }
.nav a:hover { color: var(--paper); background: var(--surface); }
.lang-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border-radius: 14px; background: var(--surface); color: var(--paper); text-decoration: none; font-weight: 800; font-size: 14px; }
.lang-btn svg { width: 18px; height: 18px; }

/* ---------- кнопки (BigButton / MgButton) ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 58px; padding: 14px 26px; border-radius: 20px;
  background: var(--lime); color: var(--ink); font: 700 17px/1.2 var(--display); text-decoration: none; text-align: center; transition: transform .15s ease, filter .15s ease; }
.btn:hover { transform: translateY(-1px); filter: brightness(1.06); }
.btn svg { width: 22px; height: 22px; flex: none; }
.btn-small { min-height: 44px; padding: 10px 18px; border-radius: 14px; font-size: 15px; }
.btn-ghost { background: var(--surface); color: var(--paper); border: 1px solid var(--line); }

/* ---------- подсказка о языке ---------- */
.suggest { display: none; background: var(--surface); border-bottom: 1px solid var(--line); }
.suggest.on { display: block; }
.suggest .wrap { display: flex; align-items: center; gap: 12px; min-height: 52px; }
.suggest a { font-weight: 800; color: var(--lime); }
.suggest button { margin-inline-start: auto; min-width: 44px; min-height: 44px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font-size: 22px; cursor: pointer; }
.suggest button:hover { background: var(--line); color: var(--paper); }

/* ---------- первый экран ---------- */
.hero { position: relative; padding: 72px 0 88px; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: -20% -10% auto auto; width: 720px; height: 720px; pointer-events: none; opacity: .22; filter: blur(90px);
  background: conic-gradient(from 45deg, var(--coral), var(--violet), var(--cyan), var(--lime), var(--coral)); border-radius: 50%; }
[dir="rtl"] .hero::before { inset: -20% auto auto -10%; }
.hero .wrap { position: relative; display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; }
.label { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 800; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; }
.label::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--dot, var(--coral)); }
.hero h1 { margin-top: 18px; font-size: clamp(30px, 4.3vw, 52px); line-height: 1.08; }
.hero .lead { margin-top: 22px; max-width: 34em; color: var(--soft); font-size: clamp(17px, 1.6vw, 20px); }
.hero .cta { margin-top: 32px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; }
.hero .note { color: var(--muted); font-size: 15px; font-weight: 800; }

/* ---------- демо: телефон со страницей комикса ---------- */
.demo { margin: 0; display: grid; justify-items: center; gap: 18px; }
.phone { width: min(330px, 82vw); aspect-ratio: 9 / 18.5; padding: 12px; border-radius: 44px; background: #05060a; border: 1px solid var(--line);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55), 0 0 0 6px #14161c; }
.screen { position: relative; height: 100%; border-radius: 34px; overflow: hidden; background: var(--paper); }
.page { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1.05fr 1fr 1fr; gap: 7px; padding: 30px 10px 12px; background: #ECE8DE; }
.panel { position: relative; overflow: hidden; background: var(--paper); border: 2.5px solid #16181d; border-radius: 3px; }
.panel svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.p1 { grid-column: 1 / 3; }
.p4 { grid-column: 1 / 3; }
.bubble { position: absolute; z-index: 2; display: grid; place-items: center; padding: 8px 12px; min-width: 64px; max-width: 70%;
  background: #fff; color: #111; border: 2px solid #16181d; border-radius: 50%; font: 700 16px/1.12 var(--comic); text-align: center; }
.bubble::after { content: ""; position: absolute; width: 12px; height: 12px; background: #fff; border: 2px solid #16181d; border-top: 0; border-left: 0; transform: rotate(45deg); }
.b1 { top: 12%; right: 7%; } .b1::after { bottom: -7px; left: 30%; }
.b2 { top: 8%; left: 6%; max-width: 82%; } .b2::after { bottom: -7px; right: 26%; }
.b3 { top: 10%; right: 6%; } .b3::after { bottom: -7px; left: 26%; }
.bubble .orig { display: none; font: 700 15px/1.2 "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif; }
.bubble .orig[lang="ja"] { writing-mode: vertical-rl; font: 700 15px/1.15 "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif CJK JP", "Noto Sans JP", serif; letter-spacing: .04em; }
.demo[data-show="original"] .bubble .orig { display: block; }
.demo[data-show="original"] .bubble .tr { display: none; }
.demo[data-show="original"] .bubble:has(.orig[lang="ja"]) { padding: 10px 8px; min-width: 0; }
.bubble .tr { animation: pop .35s ease; }
@keyframes pop { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
.fab { position: absolute; z-index: 3; right: 12px; bottom: 26%; width: 46px; height: 46px; border-radius: 50%; background: var(--ink); display: grid; place-items: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }
.fab svg { width: 30px; height: 30px; }
.demo[data-show="translated"] .fab { animation: tap .6s ease; }
@keyframes tap { 0% { transform: scale(1); } 40% { transform: scale(.86); box-shadow: 0 0 0 10px rgba(212, 240, 74, .35); } 100% { transform: scale(1); } }
.notch { position: absolute; top: 10px; left: 50%; width: 76px; height: 18px; margin-left: -38px; border-radius: 10px; background: #05060a; z-index: 4; }

/* Segmented из приложения */
.seg { display: inline-flex; padding: 4px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.seg button { min-height: 44px; padding: 0 18px; border: 0; border-radius: 11px; background: transparent; color: var(--soft); font: 800 15px/1 var(--body); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--lime); color: var(--ink); }

/* ---------- разделы ---------- */
section { padding: 88px 0; }
section + section { border-top: 1px solid var(--divider); }
.head { max-width: 760px; margin-bottom: 40px; }
.head h2 { margin-top: 14px; font-size: clamp(27px, 3.6vw, 40px); line-height: 1.15; }
.head p { margin-top: 14px; color: var(--soft); font-size: 18px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 24px; }
.card h3 { font: 800 19px/1.3 var(--body); }
.card p { margin-top: 8px; color: var(--soft); font-size: 16px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; list-style: none; margin: 0; padding: 0; }
.steps .num { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 18px; border-radius: 14px; background: var(--c); color: var(--ink); font: 700 18px/1 var(--display); }

/* плитки как ModeTile */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.tile { display: flex; flex-direction: column; justify-content: space-between; min-height: 200px; padding: 20px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); }
.tile svg { width: 34px; height: 34px; color: var(--c); }
.tile h3 { margin-top: 26px; font: 800 19px/1.25 var(--body); }
.tile p { margin-top: 6px; color: var(--muted); font-size: 15px; line-height: 1.45; }
.tile.on { background: var(--c); border-color: var(--c); }
.tile.on svg, .tile.on h3 { color: var(--ink); }
.tile.on p { color: #2A2D33; }

.langs { margin-top: 56px; }
.langs h3 { font: 700 22px/1.3 var(--display); }
.langs > p { margin-top: 8px; color: var(--soft); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.chips a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--paper); text-decoration: none; font-weight: 800; font-size: 15px; }
.chips a:hover { border-color: var(--muted); }
.chips a[aria-current="page"] { background: var(--lime); border-color: var(--lime); color: var(--ink); }

.features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.features .card h3 { display: flex; align-items: center; gap: 10px; }
.features .card h3::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--c); }

/* сравнение: таблица, на телефоне — карточки */
.compare { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.compare th, .compare td { padding: 18px 22px; text-align: start; vertical-align: top; border-bottom: 1px solid var(--divider); }
.compare tr:last-child th, .compare tr:last-child td { border-bottom: 0; }
.compare thead th { font: 700 17px/1.3 var(--display); color: var(--paper); }
.compare thead th:nth-child(2) { color: var(--lime); }
.compare thead th:nth-child(3) { color: var(--cyan); }
.compare tbody th { width: 24%; color: var(--muted); font-weight: 800; font-size: 15px; }
.compare td { color: var(--soft); }

.price { display: grid; grid-template-columns: .8fr 1.2fr; gap: 16px; align-items: stretch; }
.price .amount { display: flex; flex-direction: column; justify-content: center; background: var(--lime); color: var(--ink); border-color: var(--lime); }
.price .amount strong { font: 700 clamp(56px, 8vw, 88px)/1 var(--display); letter-spacing: -0.03em; }
.price .amount span { margin-top: 8px; font-weight: 800; font-size: 20px; }
.price .amount p { margin-top: 18px; color: #2A2D33; font-size: 15px; }
.checks { margin: 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.checks li { position: relative; padding-inline-start: 34px; color: var(--paper); }
.checks li::before { content: "✓"; position: absolute; inset-inline-start: 0; top: 0; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 8px; background: var(--ink); color: var(--lime); font-weight: 800; font-size: 14px; }
.price .how { margin-top: 18px; color: var(--muted); font-size: 15px; }

/* вопросы — Group со строками */
.faq { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.faq details + details { border-top: 1px solid var(--divider); }
.faq summary { display: flex; align-items: center; gap: 16px; padding: 20px 22px; cursor: pointer; list-style: none; font: 800 17px/1.4 var(--body); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; margin-inline-start: auto; flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: var(--ink); color: var(--lime); font: 700 20px/1 var(--display); transition: transform .2s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 22px 22px; color: var(--soft); max-width: 60em; }

.dl { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dl-card { display: flex; flex-direction: column; gap: 6px; }
.dl-card .btn { margin-top: 14px; align-self: flex-start; }
.dl-card .size { color: var(--muted); font-weight: 800; font-size: 15px; }
.dl-meta { margin-top: 18px; color: var(--muted); font-size: 15px; }
.install { margin-top: 32px; }
.install ol { margin: 14px 0 0; padding-inline-start: 22px; color: var(--soft); display: grid; gap: 8px; }
.install li::marker { color: var(--lime); font-weight: 800; }
.gh { display: inline-flex; align-items: center; gap: 8px; margin-top: 22px; font-weight: 800; }
.gh svg { width: 20px; height: 20px; }

/* ---------- подвал ---------- */
footer { padding: 56px 0 64px; border-top: 1px solid var(--divider); color: var(--muted); font-size: 15px; }
footer .wrap { display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; }
footer .brand { margin: 0; }
footer p { margin-top: 12px; }
footer h2 { font: 800 13px/1 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
footer .chips a { min-height: 34px; font-size: 13px; padding: 0 11px; }
.small { margin-top: 18px; color: var(--faint); font-size: 13px; }

/* ---------- узкие экраны ---------- */
@media (max-width: 980px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 48px; }
  .hero { padding-top: 48px; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .nav { display: none; }
}
@media (max-width: 720px) {
  :root { --gutter: 16px; }
  body { font-size: 16px; }
  section { padding: 64px 0; }
  .steps, .features, .price, .dl, footer .wrap { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tile { min-height: 172px; padding: 16px; }
  .tile h3 { font-size: 17px; }
  .hero .cta .btn { width: 100%; }
  .brand span { font-size: 20px; }
  .compare, .compare thead, .compare tbody, .compare tr, .compare th, .compare td { display: block; }
  .compare thead { display: none; }
  .compare tbody tr { padding: 16px 18px; border-bottom: 1px solid var(--divider); }
  .compare tbody tr:last-child { border-bottom: 0; }
  .compare tbody th { width: auto; padding: 0 0 8px; border: 0; }
  .compare td { padding: 4px 0; border: 0; }
  .compare td::before { content: attr(data-label) " — "; color: var(--paper); font-weight: 800; }
}
@media (max-width: 380px) {
  .tiles { grid-template-columns: 1fr; }
  .lang-btn span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Вязь, деванагари, тайская, иероглифы: без разрядки и капители, мелкие подписи чуть крупнее. */
.ns .label, .ns footer h2 { letter-spacing: 0; text-transform: none; font-size: 15px; }
.ns .hero .note, .ns .dl-card .size { font-size: 16px; }
.ns h1, .ns h2, .ns h3 { letter-spacing: 0; }

/* цвета режимов вместо style="" — чтобы работала строгая Content-Security-Policy */
[data-c="coral"] { --c: var(--coral); --dot: var(--coral); }
[data-c="violet"] { --c: var(--violet); --dot: var(--violet); }
[data-c="cyan"] { --c: var(--cyan); --dot: var(--cyan); }
[data-c="lime"] { --c: var(--lime); --dot: var(--lime); }
