/* EvoSapien — evosapien.app. Без внешних шрифтов и скриптов: ни одного запроса к чужим серверам. */
:root {
  color-scheme: light dark;
  --bg: #f7f8fc;
  --surface: #ffffff;
  --text: #1a1d2e;
  --muted: #5b6178;
  --line: #e2e5f0;
  --link: #5f2fd0;
  --accent-a: #7b3ff2;
  --accent-b: #4a7ae8;
  --button-text: #ffffff;
  --star: rgba(91, 79, 214, 0.28);
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: ui-serif, "New York", "Iowan Old Style", Charter, "Noto Serif", Georgia, serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f1e;
    --surface: #17172b;
    --text: #eceef8;
    --muted: #a3a8c3;
    --line: #2b2c47;
    --link: #b9a0ff;
    --accent-a: #9a6bff;
    --accent-b: #6ea8ff;
    --star: rgba(178, 196, 255, 0.35);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1.5rem; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent-a); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: 46rem; margin: 0 auto; padding: 0 1.25rem; }
.site-header .wrap, .site-footer .wrap { max-width: 60rem; }

/* Шапка */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.75rem 1.5rem; padding-top: 0.9rem; padding-bottom: 0.9rem;
}
.brand { display: inline-flex; align-items: center; gap: 0.55rem; color: var(--text); text-decoration: none; font-weight: 650; letter-spacing: -0.01em; }
.brand img { width: 30px; height: 30px; }
.site-nav { display: flex; flex-wrap: wrap; gap: 0.35rem 1.1rem; font-size: 0.95rem; }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); }
.site-nav a[aria-current="page"] { font-weight: 600; }
.site-nav .lang { color: var(--link); }

/* Документы */
.doc { padding: 2.75rem 0 3.5rem; }
.doc h1 { font-size: clamp(1.65rem, 6.5vw, 2.5rem); overflow-wrap: break-word; hyphens: auto; line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 0.5rem; font-weight: 700; }
.doc .effective { color: var(--muted); margin: 0 0 2rem; font-size: 0.95rem; }
.doc .body { font-family: var(--serif); font-size: 1.125rem; line-height: 1.68; }
.doc .body > p:first-child { font-size: 1.2rem; }
.doc h2 {
  font-family: var(--sans); font-size: 1.3rem; line-height: 1.3; letter-spacing: -0.01em;
  margin: 2.6rem 0 0.8rem; font-weight: 650;
}
.doc p { margin: 0 0 1.05rem; }
.doc ul, .doc ol { margin: 0 0 1.1rem; padding-left: 1.35rem; }
.doc li { margin: 0.3rem 0; }
.doc li::marker { color: var(--muted); }

.toc { font-family: var(--sans); border-left: 2px solid var(--line); padding: 0.1rem 0 0.1rem 1rem; margin: 0 0 2.4rem; }
.toc p { font-weight: 600; margin: 0 0 0.4rem; font-size: 0.95rem; }
.toc ul { list-style: none; margin: 0; padding: 0; font-size: 0.95rem; line-height: 1.45; }
.toc li { margin: 0.25rem 0; }
.toc a { color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--link); text-decoration: underline; }

.table-wrap { overflow-x: auto; margin: 0.4rem 0 1.4rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-family: var(--sans); font-size: 0.93rem; line-height: 1.45; }
th, td { text-align: left; vertical-align: top; padding: 0.7rem 0.85rem; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }
th { font-weight: 600; color: var(--muted); font-size: 0.85rem; background: transparent; }
td:first-child { font-weight: 600; min-width: 8.5rem; }
td { min-width: 11rem; }

.button {
  display: inline-block; margin: 0.2rem 0 1.4rem; padding: 0.8rem 1.15rem; border-radius: 12px;
  background: linear-gradient(100deg, #7b3ff2, #4a7ae8); color: var(--button-text);
  font-family: var(--sans); font-size: 1rem; font-weight: 600; text-decoration: none;
}
.button:hover { filter: brightness(1.06); text-decoration: none; }

/* Главная */
.hero { position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 22%, var(--star) 99%, transparent),
    radial-gradient(1px 1px at 28% 64%, var(--star) 99%, transparent),
    radial-gradient(2px 2px at 44% 14%, var(--star) 99%, transparent),
    radial-gradient(1px 1px at 61% 78%, var(--star) 99%, transparent),
    radial-gradient(1.5px 1.5px at 74% 33%, var(--star) 99%, transparent),
    radial-gradient(1px 1px at 86% 58%, var(--star) 99%, transparent),
    radial-gradient(2px 2px at 92% 12%, var(--star) 99%, transparent),
    radial-gradient(1px 1px at 7% 86%, var(--star) 99%, transparent),
    radial-gradient(1.5px 1.5px at 53% 47%, var(--star) 99%, transparent);
}
.hero .wrap {
  position: relative; display: grid; gap: 2rem; align-items: center;
  padding-top: 3.5rem; padding-bottom: 3.5rem; max-width: 60rem;
}
@media (min-width: 760px) {
  .hero .wrap { grid-template-columns: 300px 1fr; gap: 3.5rem; padding-top: 5.5rem; padding-bottom: 5.5rem; }
}
.hero-logo { width: min(260px, 70vw); }
.hero h1 { font-size: clamp(2.6rem, 8vw, 4.2rem); line-height: 1; letter-spacing: -0.035em; margin: 0 0 0.6rem; font-weight: 750; }
.hero .tagline { font-size: clamp(1.15rem, 3vw, 1.4rem); color: var(--muted); margin: 0 0 1.4rem; }
.hero .lead { font-family: var(--serif); font-size: 1.2rem; line-height: 1.6; margin: 0 0 1.2rem; max-width: 34rem; }
.hero .soon { font-weight: 600; margin: 0 0 1.6rem; }
.hero .links { display: flex; flex-wrap: wrap; gap: 0.6rem 1.4rem; font-size: 0.98rem; }
.hero .note { color: var(--muted); font-size: 0.9rem; margin: 1.8rem 0 0; max-width: 34rem; }

/* Подвал */
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.6rem 1.5rem; padding-top: 1.4rem; padding-bottom: 2rem; }
.site-footer a { color: var(--muted); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; }

/* Таблицы на телефоне — построчно: первая ячейка как заголовок, остальные с подписью столбца */
@media (max-width: 600px) {
  .table-wrap { overflow: visible; }
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; width: 100%; }
  .table-wrap thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table-wrap tr { padding: 0.85rem 1rem; border-bottom: 1px solid var(--line); }
  .table-wrap tr:last-child { border-bottom: 0; }
  .table-wrap td { border: 0; padding: 0.1rem 0; min-width: 0; }
  .table-wrap td:first-child { font-size: 1rem; margin-bottom: 0.3rem; }
  .table-wrap td:not(:first-child)::before {
    content: attr(data-label); display: block; color: var(--muted); font-size: 0.78rem; font-weight: 600; margin-top: 0.35rem;
  }
}
@media (max-width: 520px) {
  .site-nav { font-size: 0.9rem; gap: 0.3rem 0.85rem; }
  .doc .body { font-size: 1.06rem; }
  .doc { padding-top: 2rem; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
