/* Morfiade — оформление сайта.
   Цвета и шрифты взяты из айдентики (docs/logo/README.md), чтобы сайт,
   программа и установщик выглядели одним продуктом, а не тремя. */

:root {
  --bg: #17181c;
  --bg-2: #1c1d22;
  --surface: #202127;
  --surface-2: #26272e;
  --line: #34353f;
  --text: #e8e6e3;
  --dim: #9a99a3;
  --deep: #b45309;
  --accent: #f59e0b;
  --hi: #fbbf24;
  --ok: #4ade80;
  --head: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --body: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --wrap: 1120px;
  --r: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--hi); }

h1, h2, h3, h4 { font-family: var(--head); letter-spacing: -0.02em; line-height: 1.2; margin: 0; }
h1 { font-size: clamp(32px, 5vw, 52px); font-weight: 700; letter-spacing: -0.03em; }
h2 { font-size: clamp(24px, 3.4vw, 34px); font-weight: 700; }
h3 { font-size: 20px; font-weight: 700; }
h4 { font-size: 17px; font-weight: 700; }

p { margin: 0 0 18px; }
.dim { color: var(--dim); }
.tiny { font-size: 13px; }

code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.88em; background: #121316; color: var(--hi);
  padding: 2px 6px; border-radius: 5px;
}

.skip {
  position: absolute; left: -9999px; top: 0; background: var(--accent);
  color: #17181c; padding: 10px 16px; border-radius: 0 0 8px 0; z-index: 100;
}
.skip:focus { left: 0; }

/* ---------- шапка ---------- */

.site-head {
  position: sticky; top: 0; z-index: 50;
  background: rgba(23, 24, 28, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.head-row { display: flex; align-items: center; gap: 28px; height: 66px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-word { font-family: var(--head); font-weight: 700; font-size: 22px; letter-spacing: -0.03em; }
.logo-mark { flex: none; display: block; }

.nav { display: flex; gap: 26px; margin-right: auto; font-size: 15px; }
.nav a { color: var(--dim); }
.nav a:hover, .nav a.on { color: var(--text); }

.head-actions { display: flex; align-items: center; gap: 18px; }
.lang { color: var(--dim); font-size: 14px; }

.burger { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.burger span { display: block; width: 22px; height: 2px; background: var(--text); margin: 4px 0; }

/* ---------- кнопки ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--head); font-weight: 700; font-size: 16px;
  padding: 13px 24px; border-radius: 11px; border: 1px solid transparent;
  transition: transform .12s ease, background .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #17181c; }
.btn-primary:hover { background: var(--hi); color: #17181c; }
.btn-ghost { border-color: var(--line); color: var(--text); background: var(--surface); }
.btn-ghost:hover { border-color: var(--dim); color: var(--text); }
.btn-sm { padding: 9px 16px; font-size: 14px; border-radius: 9px; }

/* ---------- секции и текст ---------- */

section, .section { padding: 76px 0; }
section + section { padding-top: 0; }

main > h1, main > h2, main > h3, main > h4,
main > p, main > ul, main > ol, main > .tbl, main > .note {
  max-width: 760px; margin-left: auto; margin-right: auto;
  padding-left: 24px; padding-right: 24px;
}
main > h1 { margin-top: 64px; }
main > h2 { margin-top: 46px; margin-bottom: 14px; }
main > h3 { margin-top: 30px; margin-bottom: 10px; }
main > ul, main > ol { margin: 0 auto 18px; padding-left: 46px; }
main > ul li, main > ol li { margin-bottom: 8px; }
main > :last-child { margin-bottom: 80px; }

.note {
  background: var(--surface); border: 1px solid var(--line);
  border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0;
  padding: 16px 20px; margin: 24px auto; color: var(--dim); font-size: 16px;
}
main > .note { max-width: 760px; }

.tbl { overflow-x: auto; margin: 24px auto; }
table { border-collapse: collapse; width: 100%; font-size: 15.5px; min-width: 460px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-family: var(--head); font-weight: 700; color: var(--text); background: var(--surface); }
td { color: var(--dim); }
td:first-child { color: var(--text); }

/* ---------- первый экран ---------- */

.hero { padding: 88px 0 64px; }
.hero-grid {
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 56px; align-items: center;
}
.hero h1 { margin-bottom: 20px; }
.hero-lead { font-size: 19px; color: var(--dim); margin-bottom: 30px; max-width: 40em; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.hero-note { margin-top: 16px; font-size: 14px; color: var(--dim); }
.hero-art { display: flex; justify-content: center; }

.badge {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--dim); font-size: 13px; padding: 6px 13px;
  border-radius: 999px; margin-bottom: 22px;
}
.badge b { color: var(--hi); font-weight: 600; }

/* ---------- карточки ---------- */

.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 26px 28px;
}
.card h3 { margin-bottom: 10px; }
.card p { color: var(--dim); font-size: 15.5px; margin: 0; }
.card .ico { margin-bottom: 14px; display: block; }

.section-head { max-width: 720px; margin: 0 0 34px; }
.section-head h2 { margin-bottom: 12px; }
.section-head p { color: var(--dim); margin: 0; }
.section-head.mid { margin-left: auto; margin-right: auto; text-align: center; }

.alt { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* ---------- цены ---------- */

.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 30px; }
.plan.pick { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; position: relative; }
.plan.pick::after {
  content: attr(data-tag); position: absolute; top: -11px; left: 30px;
  background: var(--accent); color: #17181c; font-family: var(--head);
  font-weight: 700; font-size: 12px; padding: 3px 11px; border-radius: 999px;
}
.plan h3 { margin-bottom: 6px; }
.plan .amount { font-family: var(--head); font-size: 44px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.plan .per { color: var(--dim); font-size: 15px; margin-bottom: 20px; }
.plan ul { list-style: none; padding: 0; margin: 0 0 24px; font-size: 15.5px; color: var(--dim); }
.plan li { padding: 7px 0 7px 26px; position: relative; }
.plan li::before { content: "\2014"; position: absolute; left: 0; color: var(--accent); }
.plan .btn { width: 100%; }

/* ---------- сравнение ---------- */

.cmp td.yes { color: var(--ok); }
.cmp td.no { color: #f87171; }

/* ---------- подвал ---------- */

.site-foot { border-top: 1px solid var(--line); background: var(--bg-2); padding: 54px 0 30px; }
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1.2fr 1fr; gap: 32px; }
.foot-grid h3 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--dim); margin-bottom: 14px; }
.foot-brand .brand { margin-bottom: 14px; }
.foot-brand p { max-width: 34em; font-size: 14px; }
ul.plain { list-style: none; padding: 0; margin: 0; font-size: 15px; }
ul.plain li { margin-bottom: 9px; }
ul.plain a { color: var(--dim); }
ul.plain a:hover { color: var(--text); }
.foot-bottom { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line); }

/* ---------- узкий экран ---------- */

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero-art { order: -1; }
  .g3, .g4, .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 680px) {
  body { font-size: 16px; }
  section, .section { padding: 52px 0; }
  .hero { padding: 48px 0 36px; }
  .nav {
    position: fixed; inset: 66px 0 auto; flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 10px 24px 20px; display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 17px; }
  .burger { display: block; margin-left: auto; }
  .head-actions .lang { display: none; }
  .g2, .g3, .g4, .plans { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr; gap: 26px; }
  main > h1 { margin-top: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-art * { animation: none !important; }
}

/* ---------- знак, собирающийся в первом экране ----------
   Перенесено из docs/logo/Animaciya.dc.html с одной правкой: на холсте
   цикл повторяется, чтобы было видно целиком, а на сайте — ОДИН проход
   при загрузке, знак собирается и замирает. Так и записано в артборде. */

.hero-art svg { width: 100%; max-width: 300px; height: auto; }

@keyframes m-fill  { 0%, 26% { opacity: 0; } 32%, 74% { opacity: 1; } 82%, 100% { opacity: 0; } }
@keyframes m-final { 0%, 74% { opacity: 0; } 82%, 100% { opacity: 1; } }
@keyframes m-laser {
  0%, 34%   { opacity: 0; stroke-dashoffset: 132; }
  38%       { opacity: 1; stroke-dashoffset: 132; }
  50%       { opacity: 1; stroke-dashoffset: 0; }
  55%, 100% { opacity: 0; stroke-dashoffset: 0; }
}
@keyframes m-hole  { 0%, 46% { opacity: 0; } 52%, 100% { opacity: 1; } }
@keyframes m-piece {
  0%, 46%  { opacity: 0; transform: translateY(0) rotate(0deg); }
  52%      { opacity: 1; transform: translateY(0) rotate(0deg); }
  66%      { opacity: 1; transform: translateY(30px) rotate(7deg); }
  74%, 100% { opacity: 0; transform: translateY(52px) rotate(12deg); }
}
@keyframes m-planes { 0%, 74% { opacity: 1; } 82%, 100% { opacity: 0; } }

.a-planes { animation: m-planes 7s ease-in-out 1 both; }
.a-fill  { animation: m-fill  7s ease-in-out 1 both; }
.a-final { animation: m-final 7s ease-in-out 1 both; }
.a-laser { animation: m-laser 7s ease-in-out 1 both; stroke-dasharray: 132; }
.a-hole  { animation: m-hole  7s ease-in-out 1 both; }
.a-piece { animation: m-piece 7s cubic-bezier(.34,0,.2,1) 1 both; transform-origin: 32px 30px; }

/* Кому анимация мешает — сразу итоговый знак, без сборки. */
@media (prefers-reduced-motion: reduce) {
  .a-planes, .a-fill, .a-laser, .a-piece { display: none; }
  .a-final, .a-hole { animation: none; opacity: 1; }
}

/* Кнопки тарифов на одной линии, как бы ни отличались списки по длине. */
.plans { align-items: stretch; }
.plan { display: flex; flex-direction: column; }
.plan ul { flex: 1; }

/* ---------- снимки программы ----------
   Конкуренты в первом экране показывают интерфейс, а не рассказывают о нём.
   Довод, который видно, не требуется доказывать словами. */

.shot {
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  background: var(--surface); display: block; line-height: 0;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
}
.shot img { width: 100%; height: auto; display: block; }
.shot-cap { font-size: 14px; color: var(--dim); margin: 12px 2px 0; line-height: 1.5; }

.hero-shot { max-width: none; }
.hero-shot .shot { transform: perspective(1400px) rotateY(-4deg); transform-origin: left center; }

.shots-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; }
.shots-row figure { margin: 0; }

/* Знак-анимация ушла из первого экрана к последнему призыву: там она
   уместна как подпись, а не как то, что человек видит вместо продукта. */
.sign { max-width: 132px; margin: 0 auto 22px; }
.sign svg { width: 100%; height: auto; }

@media (max-width: 900px) {
  .shots-row { grid-template-columns: 1fr; }
  .hero-shot .shot { transform: none; }
}

/* Первый экран, где справа снимок: картинке нужно больше места, чем тексту. */
.hero-grid.wide-art { grid-template-columns: 0.95fr 1.15fr; }
@media (max-width: 900px) { .hero-grid.wide-art { grid-template-columns: 1fr; } }
.foot-grid { grid-template-columns: 1.5fr 1fr 1fr 1.1fr 1fr; }
@media (max-width: 900px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 680px) { .foot-grid { grid-template-columns: 1fr; } }

/* Первый экран в одну колонку: текст сверху, окно программы во всю ширину.
   В узкой колонке снимок нечитаем, а нечитаемый снимок не показывает ничего. */
.hero-stack { max-width: 800px; text-align: center; margin-bottom: 44px; }
.hero-stack .hero-lead { margin-left: auto; margin-right: auto; }
.hero-stack .hero-cta { justify-content: center; }
.hero-stack h1 { margin-bottom: 22px; }
.hero-shot .shot { transform: none; margin: 0 auto; max-width: 980px; }

/* Окно программы высокое: во всю высоту оно съедает первый экран целиком.
   Подрезаем снизу и растворяем край — видно, что окно продолжается. */
.hero-shot .shot { position: relative; max-height: 560px; overflow: hidden; }
.hero-shot .shot::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 130px;
  background: linear-gradient(to bottom, rgba(23,24,28,0), var(--bg));
  pointer-events: none;
}
.hero-stack h1 { max-width: 16em; margin-left: auto; margin-right: auto; }

/* Пока до знака не долистали — он просто стоит собранным. Анимация включается
   классом on-view из nav.js; без JS человек видит итоговый знак, а не обломки. */
.sign .a-planes, .sign .a-fill, .sign .a-laser, .sign .a-piece { opacity: 0; animation: none; }
.sign .a-final, .sign .a-hole { opacity: 1; animation: none; }
.sign.on-view .a-planes { animation: m-planes 7s ease-in-out 1 both; }
.sign.on-view .a-fill   { animation: m-fill   7s ease-in-out 1 both; }
.sign.on-view .a-final  { animation: m-final  7s ease-in-out 1 both; }
.sign.on-view .a-laser  { animation: m-laser  7s ease-in-out 1 both; }
.sign.on-view .a-hole   { animation: m-hole   7s ease-in-out 1 both; }
.sign.on-view .a-piece  { animation: m-piece  7s cubic-bezier(.34,0,.2,1) 1 both; }

/* Старая цена рядом с новой. Стоит ПЕРЕД суммой и мельче: сначала человек
   читает то, что платит, и только потом видит, от чего скидка. */
.plan .was {
  font-family: var(--head); font-size: 22px; font-weight: 500;
  color: var(--dim); text-decoration: line-through;
  text-decoration-thickness: 2px; margin-right: 10px;
}
.plan .amount-row { display: flex; align-items: baseline; flex-wrap: wrap; }

/* ---------- возможности блоками ----------
   Так сделано у всех четверых конкурентов, и это работает: рядом с абзацем
   видно ту самую функцию в окне программы, а не её описание. Через строку
   картинка меняется местами с текстом, иначе страница читается как список. */

.feature-row {
  display: grid; grid-template-columns: 1fr 1.1fr; gap: 56px;
  align-items: center; padding: 54px 0;
}
.feature-row + .feature-row { border-top: 1px solid var(--line); }
.feature-row.flip .f-text { order: 2; }
.feature-row.flip .f-shot { order: 1; }
.feature-row h3 { font-size: clamp(22px, 2.6vw, 30px); margin-bottom: 14px; }
.feature-row p { color: var(--dim); }
.feature-row ul { list-style: none; padding: 0; margin: 18px 0 0; color: var(--dim); font-size: 16px; }
.feature-row li { padding: 6px 0 6px 24px; position: relative; }
.feature-row li::before { content: "—"; position: absolute; left: 0; color: var(--accent); }
.f-shot .shot { max-height: 340px; overflow: hidden; position: relative; }
/* Небольшое окно-диалог показываем целиком: обрезать его нечего. */
.f-shot .shot.whole { max-height: none; }
.f-shot .shot.whole::after { display: none; }
.f-shot .shot::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 90px;
  background: linear-gradient(to bottom, rgba(23,24,28,0), var(--bg));
  pointer-events: none;
}
.alt .f-shot .shot::after { background: linear-gradient(to bottom, rgba(28,29,34,0), var(--bg-2)); }

@media (max-width: 900px) {
  .feature-row { grid-template-columns: 1fr; gap: 28px; padding: 36px 0; }
  .feature-row.flip .f-text { order: 1; }
  .feature-row.flip .f-shot { order: 2; }
}
