/* Amilang — дизайн-система «Орбиты памяти» (docs/10-site-plan.md §1).
   Палитра «Чернила и янтарь»: тёплая бумага + чернильный графит + янтарный CTA
   + петролевый «цвет памяти». accent — только CTA/стрик; memory — единственный
   цвет данных. */

:root {
  --bg: #FAF6EF;
  --surface: #FFFFFF;
  --surface-2: #F2ECE1;
  --text: #1C222E;
  --text-muted: #5B6472;
  --line: #E4DDCF;
  --accent: #E8622C;
  --accent-hover: #C94F20;
  --accent-ink: #FFFFFF;
  --memory: #0E7C7B;
  --memory-soft: #DDEFEA;
  --gold: #C99A2C;
  --danger: #C4453C;
  --tg: #2AABEE;
  --shadow-1: 0 1px 2px rgba(28, 34, 46, .06);
  --shadow-2: 0 8px 24px rgba(28, 34, 46, .10);
  --card-border: 1px solid var(--line);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14181F;
    --surface: #1C232E;
    --surface-2: #242D3B;
    --text: #F3EFE7;
    --text-muted: #9AA3B2;
    --line: #2E3846;
    --accent: #FF7A45;
    --accent-hover: #FF8F60;
    --accent-ink: #1C1207;
    --memory: #3BB1AC;
    --memory-soft: #173735;
    --gold: #E0B54A;
    --danger: #E06258;
    /* в dark — обводка вместо теней */
    --shadow-1: none;
    --shadow-2: none;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Golos Text", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 28px;
  -webkit-font-smoothing: antialiased;
}

/* --- типографика: Piazzolla display, Golos text, JetBrains mono --- */
h1, h2, .display {
  font-family: "Piazzolla", Georgia, serif;
  font-weight: 640;
  letter-spacing: -0.01em;
}
h1 { font-size: 56px; line-height: 64px; }
h2 { font-size: 32px; line-height: 40px; margin-bottom: 16px; }
h3 { font-size: 20px; line-height: 28px; font-weight: 600; }
.lemma { font-family: "Piazzolla", Georgia, serif; font-style: italic; }
.mono, .ipa, .num {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 15px;
}
.muted { color: var(--text-muted); }
.small { font-size: 15px; line-height: 24px; }
a { color: var(--memory); text-decoration: none; }
a:hover { text-decoration: underline; }

@media (max-width: 720px) {
  h1 { font-size: 34px; line-height: 40px; }
  h2 { font-size: 26px; line-height: 34px; }
}

/* --- сетка --- */
.container { max-width: 1152px; margin: 0 auto; padding: 0 24px; }
section { padding: 96px 0; }
@media (max-width: 720px) { section { padding: 56px 0; } }

/* --- кнопки --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 16px;
  padding: 14px 28px;
  font-weight: 600;
  font-size: 17px;
  border: none;
  cursor: pointer;
  text-decoration: none !important;
  transition: background .15s ease, transform .1s ease;
}
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { background: var(--accent-hover); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--line);
}
.btn-ghost:hover { border-color: var(--text-muted); }
.btn .tg-plane { flex: none; }
.btn-note { font-size: 13px; line-height: 20px; color: var(--text-muted); margin-top: 8px; }

/* --- карточки --- */
.card {
  background: var(--surface);
  border-radius: 16px;
  border: var(--card-border);
  box-shadow: var(--shadow-1);
  padding: 28px;
}
.card-inset { background: var(--surface-2); border-radius: 10px; padding: 16px 20px; }

/* --- чипы --- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  padding: 6px 16px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  text-decoration: none !important;
}
.chip:hover, .chip.active { border-color: var(--memory); color: var(--memory); }
.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 12px;
  font-size: 13px;
  font-weight: 600;
}
.badge-memory { background: var(--memory-soft); color: var(--memory); }
.badge-gold { background: color-mix(in srgb, var(--gold) 15%, transparent); color: var(--gold); }

/* --- шапка --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 64px;
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; color: var(--text); text-decoration: none !important; font-family: "Piazzolla", serif; }
.nav { display: flex; align-items: center; gap: 24px; margin-left: auto; }
.nav a { color: var(--text); font-size: 15px; font-weight: 500; }
.nav .btn { padding: 9px 18px; font-size: 15px; border-radius: 12px; }
.nav-langs { position: relative; }
.nav-langs > summary { list-style: none; cursor: pointer; font-size: 15px; font-weight: 500; }
.nav-langs > summary::-webkit-details-marker { display: none; }
.nav-langs[open] > summary::before { content: ""; position: fixed; inset: 0; }
.nav-langs .menu {
  position: absolute;
  top: calc(100% + 12px);
  left: -12px;
  background: var(--surface);
  border: var(--card-border);
  border-radius: 16px;
  box-shadow: var(--shadow-2);
  padding: 8px;
  min-width: 190px;
}
.nav-langs .menu a { display: block; padding: 8px 14px; border-radius: 10px; }
.nav-langs .menu a:hover { background: var(--surface-2); text-decoration: none; }
@media (max-width: 900px) { .nav .hide-m { display: none; } }

/* --- sticky CTA на мобиле --- */
.sticky-cta {
  display: none;
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 60;
}
.sticky-cta .btn { width: 100%; justify-content: center; box-shadow: var(--shadow-2); }
@media (max-width: 720px) {
  .sticky-cta.visible { display: block; }
  body { padding-bottom: 88px; }
}

/* --- hero --- */
.hero { padding: 88px 0 96px; }
.hero .container { display: grid; grid-template-columns: 7fr 5fr; gap: 48px; align-items: center; }
.hero p.sub { font-size: 20px; line-height: 32px; color: var(--text-muted); margin: 20px 0 32px; max-width: 560px; }
.hero .cta-row { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.hero .langs { margin-top: 40px; display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 900px) {
  .hero .container { grid-template-columns: 1fr; }
  .hero .orbit-visual { order: -1; max-width: 320px; margin: 0 auto; }
}

/* --- орбиты (кольцо покрытия) --- */
.orbit-visual svg { width: 100%; height: auto; display: block; }
.orbit-ring { stroke: var(--line); fill: none; }
.orbit-arc { stroke: var(--memory); fill: none; stroke-linecap: round; }
.orbit-dot { fill: var(--memory); }
.orbit-dot-accent { fill: var(--accent); }
.orbit-label { font-family: "JetBrains Mono", monospace; fill: var(--text); }
.orbit-label-sub { font-family: "Golos Text", sans-serif; fill: var(--text-muted); font-size: 13px; }
@keyframes orbit-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.orbit-sat { transform-origin: 210px 210px; animation: orbit-spin 60s linear infinite; }

/* --- лента интервалов --- */
.interval-line { position: relative; border-top: 2px solid var(--line); margin: 48px 12px 0; }
.interval-line .stop { position: absolute; top: -7px; transform: translateX(-50%); text-align: center; }
.interval-line .stop i {
  display: block;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--memory);
  margin: 0 auto;
}
.interval-line .stop span { display: block; margin-top: 12px; font-size: 13px; font-family: "JetBrains Mono", monospace; color: var(--text-muted); white-space: nowrap; }

/* --- плитки фич / сеток --- */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr; } .grid-2 { grid-template-columns: 1fr; } }
.feature h3 { margin-bottom: 8px; }
.feature p { color: var(--text-muted); font-size: 15px; line-height: 24px; }

/* --- цифры контента --- */
.stats-row { display: flex; gap: 48px; flex-wrap: wrap; justify-content: center; text-align: center; }
.stats-row .num { font-size: 44px; line-height: 52px; font-weight: 500; color: var(--memory); }
.stats-row .cap { color: var(--text-muted); font-size: 15px; }

/* --- таблицы --- */
.table-wrap { overflow-x: auto; }
table.compare { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-1); border: var(--card-border); }
table.compare th, table.compare td { padding: 14px 20px; text-align: left; border-bottom: 1px solid var(--line); font-size: 15px; }
table.compare th { background: var(--surface-2); font-weight: 600; }
table.compare tr:last-child td { border-bottom: none; }
table.compare td.yes { color: var(--memory); font-weight: 600; }
table.compare td.no { color: var(--text-muted); }

/* --- аккордеон FAQ --- */
details.faq-item { background: var(--surface); border: var(--card-border); border-radius: 16px; padding: 20px 28px; margin-bottom: 12px; }
details.faq-item summary { font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
details.faq-item summary::-webkit-details-marker { display: none; }
details.faq-item summary::after { content: "+"; color: var(--text-muted); font-size: 22px; flex: none; }
details.faq-item[open] summary::after { content: "–"; }
details.faq-item p { margin-top: 12px; color: var(--text-muted); font-size: 15px; line-height: 26px; }

/* --- pricing --- */
.plan { position: relative; display: flex; flex-direction: column; }
.plan .price { font-family: "JetBrains Mono", monospace; font-size: 44px; line-height: 52px; margin: 12px 0 4px; }
.plan ul { list-style: none; margin: 20px 0 28px; display: grid; gap: 10px; }
.plan li { padding-left: 28px; position: relative; font-size: 15px; }
.plan li::before { content: "✓"; position: absolute; left: 0; color: var(--memory); font-weight: 700; }
.plan li.off { color: var(--text-muted); }
.plan li.off::before { content: "—"; color: var(--text-muted); }
.plan .btn { margin-top: auto; justify-content: center; }

/* --- финальный CTA (чернильный фон) --- */
.final-cta { background: #1C222E; color: #F3EFE7; border-radius: 24px; padding: 72px 48px; text-align: center; }
.final-cta h2 { color: #F3EFE7; }
.final-cta p { color: #9AA3B2; margin: 12px auto 32px; max-width: 520px; }
@media (max-width: 720px) { .final-cta { padding: 48px 24px; } }

/* --- страницы контента (SEO, юридические) --- */
.prose { max-width: 720px; }
.prose h1 { font-size: 44px; line-height: 52px; margin-bottom: 16px; }
.prose h2 { font-size: 24px; line-height: 32px; margin: 40px 0 12px; }
.prose p, .prose li { margin-bottom: 12px; }
.prose ul, .prose ol { padding-left: 24px; margin-bottom: 16px; }
.prose .doc-date { color: var(--text-muted); font-size: 15px; margin-bottom: 32px; }
.toc { background: var(--surface-2); border-radius: 16px; padding: 20px 28px; margin-bottom: 40px; font-size: 15px; }
.toc a { display: block; padding: 3px 0; }
@media (max-width: 720px) { .prose h1 { font-size: 32px; line-height: 40px; } }

.breadcrumbs { font-size: 13px; color: var(--text-muted); margin: 24px 0; }
.breadcrumbs a { color: var(--text-muted); }

/* --- интерактивный клоуз на SEO-страницах --- */
.cloze { margin: 24px 0; }
.cloze .q { font-size: 18px; margin-bottom: 16px; }
.cloze .opts { display: flex; gap: 10px; flex-wrap: wrap; }
.cloze .opts button { font-family: inherit; }
.cloze .explain { display: none; margin-top: 16px; }
.cloze.answered .explain { display: block; }
.cloze .opts button.right { border-color: var(--memory); color: var(--memory); }
.cloze .opts button.wrong { border-color: var(--danger); color: var(--danger); }

/* --- страница /go (QR-интерстишл) --- */
.go-page { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 48px 24px; }
.go-page .qr { width: 240px; height: 240px; margin: 32px auto; background: #fff; border-radius: 16px; padding: 16px; box-shadow: var(--shadow-2); border: var(--card-border); }
.go-page .qr svg { width: 100%; height: 100%; display: block; }
.go-page .alt { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }

/* --- tooltip перевода в текстах --- */
.tip { border-bottom: 1px dashed var(--memory); cursor: pointer; position: relative; }
.tip.open::after {
  content: attr(data-ru);
  position: absolute;
  left: 50%; bottom: calc(100% + 6px);
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  font-size: 13px;
  line-height: 18px;
  padding: 6px 10px;
  border-radius: 10px;
  white-space: nowrap;
  z-index: 10;
}

/* --- подвал --- */
.site-footer { border-top: 1px solid var(--line); padding: 48px 0 64px; margin-top: 48px; font-size: 15px; }
.site-footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.site-footer h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: 12px; }
.site-footer a { display: block; color: var(--text); padding: 3px 0; }
.site-footer .fine { color: var(--text-muted); margin-top: 32px; font-size: 13px; }
@media (max-width: 900px) { .site-footer .cols { grid-template-columns: 1fr 1fr; } }
