/* Общие стили страниц Temfy Nutri: лендинг (RU/EN) и статьи /nutri/guides/.
   Классы те же, что у лендинга-образца (scripts/build-nutri.mjs собирает ту же разметку);
   отличаются только цвета — тёмная палитра по иконке: бирюза #5CC8D6 → фиолетовый #9B97FF.
   На светлом акцентном градиенте текст тёмный (--on-accent), как «ink на mint» в приложении. */
:root {
  --bg: #14161C;
  --card: #1C1F27;
  --card-2: #252935;
  --text: #F5F7FB;
  --muted: #9AA4BD;
  --accent: #5CC8D6;
  --accent-2: #9B97FF;
  --ok: #8EDCE6;
  --on-accent: #0E1016;
  --border: rgba(255, 255, 255, 0.08);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(1100px 700px at 0% -15%, rgba(155,151,255,.26), transparent 60%),
    radial-gradient(900px 600px at 100% 5%, rgba(92,200,214,.20), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }

header {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: saturate(160%) blur(14px);
  background: rgba(20,22,28,.6);
  border-bottom: 1px solid var(--border);
}
.nav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 64px; gap: 12px; }
.nav-back {
  justify-self: start; display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted); font-size: 14px; font-weight: 500; white-space: nowrap;
}
.nav-back:hover { color: var(--text); }
.logo-wrap { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; }
.logo-wrap.center { justify-self: center; }
.logo {
  width: 32px; height: 32px; border-radius: 9px; overflow: hidden; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center; font-weight: 800; color: var(--on-accent);
  box-shadow: 0 8px 24px rgba(123,175,234,.35);
}
.logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nav-right { justify-self: end; display: flex; align-items: center; gap: 18px; }
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a { color: var(--muted); font-size: 15px; white-space: nowrap; }
.nav-links a:hover { color: var(--text); }
.nav-cta {
  padding: 9px 16px; border-radius: 11px; font-weight: 600; font-size: 14px; color: var(--on-accent) !important;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 24px rgba(123,175,234,.4);
}
@media (max-width: 680px) { .nav-links a:not(.nav-cta) { display: none; } }
@media (max-width: 520px) { .nav-back span.full { display: none; } }
.lang-toggle {
  border: 1px solid var(--border); background: rgba(255,255,255,.05); color: var(--text);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  padding: 6px 12px; border-radius: 999px; letter-spacing: .3px;
}
.lang-toggle { white-space: nowrap; flex: none; }
/* Узкие телефоны (≤360px): шапке тесно — ужимаем кнопку языка и «Скачать» */
@media (max-width: 360px) {
  .nav-right { gap: 8px; }
  .lang-toggle { padding: 6px 9px; font-size: 12px; }
  .lang-toggle .globe { display: none; }
  .nav-cta { padding: 8px 12px; }
}
.lang-toggle:hover { border-color: rgba(123,175,234,.5); }
/* Меню языков на лендинге (<details>): кнопка — .lang-toggle, список выпадает под ней */
.lang-menu { position: relative; flex: none; }
.lang-menu > summary { list-style: none; display: block; user-select: none; }
.lang-menu > summary::-webkit-details-marker { display: none; }
.lang-list {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; min-width: 160px;
  display: flex; flex-direction: column; padding: 6px;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 18px 40px rgba(0,0,0,.45);
}
.lang-list a { padding: 8px 12px; border-radius: 9px; font-size: 14px; color: var(--muted); white-space: nowrap; }
.lang-list a:hover { background: var(--card-2); color: var(--text); }
.lang-list a[aria-current] { color: var(--text); font-weight: 600; }

.hero { padding: 70px 0 40px; display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; text-align: center; padding-top: 48px; } }
.hero h1 { font-size: 52px; line-height: 1.05; letter-spacing: -1.5px; margin: 0 0 18px; }
@media (max-width: 640px) { .hero h1 { font-size: 36px; } }
.hero p.lead { font-size: 19px; color: var(--muted); margin: 0 0 28px; }
.cta-row { display: flex; gap: 14px; flex-wrap: wrap; }
@media (max-width: 860px) { .cta-row { justify-content: center; } }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px; border-radius: 13px; font-weight: 600; font-size: 16px; cursor: pointer; border: none;
}
.btn-primary { color: var(--on-accent); background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 14px 34px rgba(123,175,234,.45); }
.btn svg { width: 20px; height: 20px; fill: currentColor; }
/* Лёгкое «мигание» главной кнопки в hero — привлекает внимание к скидке */
@keyframes ctaPulse {
  0%, 100% { box-shadow: 0 14px 34px rgba(123,175,234,.45); filter: brightness(1); }
  50%      { box-shadow: 0 14px 40px rgba(123,175,234,.8), 0 0 0 6px rgba(123,175,234,.18); filter: brightness(1.12); }
}
.btn-pulse { animation: ctaPulse 1.8s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .btn-pulse { animation: none; } }

.phone {
  justify-self: center;
  width: 264px; height: 540px; border-radius: 44px;
  background: linear-gradient(180deg, #171a22, #1f232d);
  border: 1px solid var(--border);
  box-shadow: 0 40px 90px rgba(0,0,0,.55), inset 0 0 0 6px rgba(255,255,255,.03);
  position: relative; overflow: hidden;
}
.phone::before {
  content: ""; position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  width: 120px; height: 26px; border-radius: 14px; background: #0b0d12; z-index: 2;
}
.phone .screen {
  position: absolute; inset: 14px; border-radius: 34px; overflow: hidden;
  background: radial-gradient(400px 200px at 50% 0, rgba(155,151,255,.28), transparent 70%), #12141a;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 20px; text-align: center;
}
.phone .screen img { width: 100%; height: 100%; object-fit: cover; border-radius: 34px; }
.phone .screen .big { font-size: 40px; }
.phone .screen .cap { color: var(--muted); font-size: 13px; }
/* Скриншот из App Store уже нарисован внутри телефона — показываем его карточкой */
.shot {
  justify-self: center; width: 300px; max-width: 100%; border-radius: 28px; overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 40px 90px rgba(0,0,0,.55), 0 0 0 1px rgba(123,175,234,.15);
  background: var(--bg);
}
.shot img { display: block; width: 100%; height: auto; }
/* Скриншот уже со статус-баром и «островком» — рисуем только корпус */
.shot-phone { width: 270px; border-radius: 40px; border: 6px solid #1a1d25; box-shadow: 0 40px 90px rgba(0,0,0,.6), 0 0 0 1px rgba(123,175,234,.25); background: #1a1d25; }
.screens { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; max-width: 760px; margin: 0 auto; }
@media (max-width: 640px) { .screens { grid-template-columns: 1fr; max-width: 300px; } }
.screens figure { margin: 0; text-align: center; }
.screens img { width: 100%; max-width: 240px; height: auto; display: block; margin: 0 auto 12px; border-radius: 30px; border: 1px solid var(--border); box-shadow: 0 24px 50px rgba(0,0,0,.45); }
.screens figcaption { color: var(--muted); font-size: 14px; }

section { padding: 56px 0; }
.section-title { font-size: 32px; letter-spacing: -.6px; text-align: center; margin: 0 0 10px; }
.section-sub { text-align: center; color: var(--muted); max-width: 560px; margin: 0 auto 40px; }

.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 860px) { .features-grid { grid-template-columns: 1fr; } }
/* Возможностей четыре — на широком экране кладём их 2×2, иначе в нижнем ряду
   остаётся одна карточка в пустой строке. «Как это работает» — по-прежнему 3. */
@media (min-width: 861px) { #featuresGrid { grid-template-columns: repeat(2, 1fr); } }
.feature {
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid var(--border); border-radius: 18px; padding: 24px;
}
.feature .ic {
  width: 46px; height: 46px; border-radius: 12px; margin-bottom: 14px;
  background: rgba(123,175,234,.14);
  display: grid; place-items: center; font-size: 22px;
}
.feature h3 { margin: 0 0 6px; font-size: 18px; }
.feature p { margin: 0; color: var(--muted); font-size: 14.5px; }

.flow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: step; }
@media (max-width: 860px) { .flow { grid-template-columns: 1fr; } }
.flow .step {
  background: linear-gradient(180deg, var(--card), var(--card-2)); border: 1px solid var(--border); border-radius: 18px; padding: 22px 22px 22px 64px; position: relative;
}
.flow .step::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 20px; top: 20px; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: 15px; color: var(--on-accent);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.flow h3 { margin: 0 0 6px; font-size: 17px; }
.flow p { margin: 0; color: var(--muted); font-size: 14.5px; }
.premium-band {
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid rgba(123,175,234,.35); border-radius: 22px;
  padding: 34px 28px; text-align: center;
}
.premium-band h2 { font-size: 26px; letter-spacing: -.5px; margin: 0 0 10px; }
.premium-band p { color: var(--muted); margin: 0 auto 22px; max-width: 520px; font-size: 15.5px; }
.premium-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn-ghost { background: rgba(255,255,255,.06); border: 1px solid var(--border); color: var(--text); }
footer { border-top: 1px solid var(--border); padding: 40px 0; color: var(--muted); font-size: 14px; }
.foot-grid { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px; }
.foot-brand-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.foot-links { display: flex; gap: 20px; flex-wrap: wrap; }
.foot-links a:hover { color: var(--text); }

/* ---------- Статьи (/nutri/guides/) ---------- */
.article { max-width: 720px; margin: 0 auto; padding: 40px 0 64px; }
.crumbs { font-size: 13.5px; color: var(--muted); margin-bottom: 18px; }
.crumbs a:hover { color: var(--text); }
.article h1 { font-size: 40px; line-height: 1.12; letter-spacing: -1px; margin: 0 0 14px; }
@media (max-width: 640px) { .article h1 { font-size: 30px; } }
.article .lead { color: var(--muted); font-size: 18px; margin: 0 0 30px; }
.article h2 { font-size: 25px; letter-spacing: -.4px; margin: 40px 0 12px; }
.article h3 { font-size: 19px; margin: 28px 0 8px; }
.article p, .article li { font-size: 16.5px; color: #dfe3ee; }
.article ul, .article ol { padding-left: 22px; }
.article li { margin: 6px 0; }
.article a:not(.btn) { color: var(--ok); text-decoration: underline; text-underline-offset: 3px; }
.article .path { font-weight: 600; color: var(--text); white-space: normal; }
.article .note {
  background: rgba(123,175,234,.10); border: 1px solid rgba(123,175,234,.30);
  border-radius: 14px; padding: 14px 18px; margin: 20px 0;
}
.article .note p { margin: 0; }
.article .cta-box {
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid rgba(123,175,234,.35); border-radius: 20px; padding: 26px; margin: 40px 0 0; text-align: center;
}
.article .cta-box h2 { margin-top: 0; }
.article .cta-box p { color: var(--muted); margin: 0 auto 18px; max-width: 520px; }
.article .cta-box .premium-actions { margin-top: 4px; }
.article .shot-inline { float: right; width: 200px; margin: 6px 0 16px 24px; border-radius: 26px; border: 1px solid var(--border); }
@media (max-width: 640px) { .article .shot-inline { float: none; display: block; margin: 16px auto; } }
.related { margin-top: 48px; border-top: 1px solid var(--border); padding-top: 24px; }
.related h2 { font-size: 20px; margin: 0 0 12px; }
.guide-list { list-style: none; padding: 0; display: grid; gap: 14px; }
.guide-list a { display: block; background: linear-gradient(180deg, var(--card), var(--card-2)); border: 1px solid var(--border); border-radius: 16px; padding: 18px 20px; text-decoration: none !important; }
.guide-list a:hover { border-color: rgba(123,175,234,.45); }
.guide-list b { display: block; color: var(--text); font-size: 17px; margin-bottom: 4px; }
.guide-list span { color: var(--muted); font-size: 14.5px; }

/* ---------- Лендинг: строка бренда над H1 и FAQ ---------- */
.eyebrow { margin: 0 0 12px; color: var(--ok); font-size: 14px; font-weight: 600; letter-spacing: .2px; }
.faq { max-width: 760px; margin: 0 auto; display: grid; gap: 10px; }
.faq details {
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid var(--border); border-radius: 16px; padding: 0 20px;
}
.faq summary {
  cursor: pointer; list-style: none; padding: 17px 28px 17px 0; position: relative;
  font-weight: 600; font-size: 16.5px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 13px; font-size: 22px; color: var(--muted); }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0 0 18px; color: var(--muted); font-size: 15px; }
.faq details a { color: var(--ok); text-decoration: underline; text-underline-offset: 3px; }

/* Арабский (dir="rtl"): зеркалим то, что позиционировано по левому/правому краю */
[dir="rtl"] .nav-back svg { transform: scaleX(-1); }
[dir="rtl"] .lang-list { right: auto; left: 0; }
[dir="rtl"] .flow .step { padding: 22px 64px 22px 22px; }
[dir="rtl"] .flow .step::before { left: auto; right: 20px; }
[dir="rtl"] .faq summary { padding: 17px 0 17px 28px; }
[dir="rtl"] .faq summary::after { right: auto; left: 0; }
