/* Цифровая семейная память — базовые стили.
   Одна таблица стилей на весь сайт, без внешних ресурсов и без шрифтов с CDN. */

:root {
  color-scheme: light dark;

  --bg: #fbf9f5;
  --bg-soft: #f2ede3;
  --bg-card: #ffffff;
  --text: #1d1a14;
  --text-muted: #57503f;
  --accent: #7a3f18;
  --accent-strong: #5d2f10;
  --accent-contrast: #ffffff;
  --border: #ddd4c2;
  --border-strong: #b9ac93;
  --mark: #f6e6c8;
  --shadow: 0 1px 2px rgba(29, 26, 20, .06), 0 8px 24px rgba(29, 26, 20, .06);

  --radius: 10px;
  --measure: 38rem;
  --wide: 62rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14120e;
    --bg-soft: #1d1a15;
    --bg-card: #1b1813;
    --text: #ece6da;
    --text-muted: #b3aa98;
    --accent: #e0ab6d;
    --accent-strong: #f0c48f;
    --accent-contrast: #17140f;
    --border: #332e25;
    --border-strong: #4c4437;
    --mark: #3a2f1c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 8px 24px rgba(0, 0, 0, .35);
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #fbf9f5;
  --bg-soft: #f2ede3;
  --bg-card: #ffffff;
  --text: #1d1a14;
  --text-muted: #57503f;
  --accent: #7a3f18;
  --accent-strong: #5d2f10;
  --accent-contrast: #ffffff;
  --border: #ddd4c2;
  --border-strong: #b9ac93;
  --mark: #f6e6c8;
  --shadow: 0 1px 2px rgba(29, 26, 20, .06), 0 8px 24px rgba(29, 26, 20, .06);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #14120e;
  --bg-soft: #1d1a15;
  --bg-card: #1b1813;
  --text: #ece6da;
  --text-muted: #b3aa98;
  --accent: #e0ab6d;
  --accent-strong: #f0c48f;
  --accent-contrast: #17140f;
  --border: #332e25;
  --border-strong: #4c4437;
  --mark: #3a2f1c;
  --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 8px 24px rgba(0, 0, 0, .35);
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.65 "Georgia", "Times New Roman", "PT Serif", serif;
  font-feature-settings: "liga" 1, "kern" 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1, h2, h3, h4,
.nav, .btn, .tag, .card__meta, table, .form, .footer {
  font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans", Arial, sans-serif;
}

h1, h2, h3, h4 { line-height: 1.22; text-wrap: balance; margin: 0 0 .6em; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.6rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.35rem, 1.1rem + 1.1vw, 1.75rem); margin-top: 2.2rem; }
h3 { font-size: 1.15rem; margin-top: 1.8rem; }
p, ul, ol, dl { margin: 0 0 1.1em; }
li { margin-bottom: .35em; }
li > ul, li > ol { margin-top: .35em; }

a {
  color: var(--accent);
  text-underline-offset: .18em;
  text-decoration-thickness: from-font;
}
a:hover { color: var(--accent-strong); }
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

strong { font-weight: 700; }
mark { background: var(--mark); color: var(--text); padding: 0 .18em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }
img, svg { max-width: 100%; height: auto; }

code, pre, samp, kbd {
  font-family: ui-monospace, "Cascadia Mono", "Consolas", "Liberation Mono", monospace;
  font-size: .92em;
}
code { background: var(--bg-soft); padding: .1em .35em; border-radius: 4px; }
pre {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  overflow-x: auto;
}
pre code { background: none; padding: 0; }

/* ---------- служебное ---------- */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-contrast);
  padding: .6rem 1rem;
  z-index: 20;
}
.skip-link:focus { left: 0; }

.wrap {
  width: 100%;
  max-width: var(--wide);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

.prose { max-width: var(--measure); }
.prose--wide { max-width: 52rem; }

/* ---------- шапка ---------- */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 1.25rem;
  padding-block: .7rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
  color: var(--text);
  text-decoration: none;
  margin-inline-end: auto;
}
.brand:hover { color: var(--text); }
.brand__mark { flex: none; width: 30px; height: 30px; }
.brand__name small {
  display: block;
  font-weight: 400;
  font-size: .78rem;
  color: var(--text-muted);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: .15rem .5rem;
  font-size: .92rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav a {
  display: inline-block;
  padding: .3rem .5rem;
  border-radius: 6px;
  color: var(--text-muted);
  text-decoration: none;
}
.nav a:hover { color: var(--text); background: var(--bg-card); }
.nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--accent);
}

.theme-toggle {
  flex: none;
  font: inherit;
  font-size: .85rem;
  padding: .3rem .6rem;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
}
.theme-toggle:hover { color: var(--text); }

/* ---------- контент ---------- */

main { flex: 1 0 auto; padding-block: 2.5rem 3.5rem; }

.lede {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: var(--measure);
}

.eyebrow {
  font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: .8rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 .6rem;
}

.hero { padding-block: 1rem 2rem; }
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 1.6rem;
}

.btn {
  display: inline-block;
  padding: .7rem 1.3rem;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 600;
  font-size: .98rem;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--accent-contrast); }
.btn--ghost { background: transparent; color: var(--accent); }
.btn--ghost:hover { background: var(--bg-soft); color: var(--accent-strong); }

.grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  margin: 1.5rem 0 2rem;
  padding: 0;
  list-style: none;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow);
  margin: 0;
}
.card h3 { margin-top: 0; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }
.card__meta {
  font-size: .82rem;
  color: var(--text-muted);
  letter-spacing: .02em;
  margin-bottom: .4rem;
}

.callout {
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--accent);
  background: var(--bg-soft);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1.6rem 0;
  max-width: 52rem;
}
.callout > :last-child { margin-bottom: 0; }
.callout__title {
  font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-weight: 700;
  font-size: .95rem;
  margin: 0 0 .4rem;
}

.stat-row {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  margin: 1.5rem 0 2rem;
  padding: 0;
  list-style: none;
}
.stat {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  padding: 1rem 1.1rem;
  margin: 0;
}
.stat__value {
  display: block;
  font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--accent);
}
.stat__label { display: block; font-size: .9rem; color: var(--text-muted); margin-top: .35rem; }
.stat__source { display: block; font-size: .78rem; color: var(--text-muted); margin-top: .5rem; }

.table-scroll { overflow-x: auto; margin: 1.4rem 0 2rem; }
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 30rem;
  font-size: .95rem;
}
caption {
  text-align: left;
  font-size: .88rem;
  color: var(--text-muted);
  padding-bottom: .6rem;
}
th, td {
  border: 1px solid var(--border);
  padding: .55rem .7rem;
  text-align: left;
  vertical-align: top;
}
thead th { background: var(--bg-soft); }

.steps { counter-reset: step; list-style: none; padding: 0; max-width: 52rem; }
.steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 2.6rem;
  margin-bottom: 1.1rem;
}
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: .05em;
  width: 1.9rem;
  height: 1.9rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-contrast);
  font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-weight: 700;
  font-size: .9rem;
}

.tag {
  display: inline-block;
  font-size: .78rem;
  padding: .15rem .55rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  background: var(--bg-soft);
}

details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .8rem 1rem;
  margin-bottom: .8rem;
  background: var(--bg-card);
}
summary { cursor: pointer; font-weight: 600; }
details[open] summary { margin-bottom: .7rem; }

.compare {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  margin: 1.4rem 0 2rem;
}
.compare__col {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  background: var(--bg-card);
}
.compare__col h3 { margin-top: 0; font-size: 1rem; }
.compare__col--before { border-left: 4px solid var(--border-strong); }
.compare__col--after { border-left: 4px solid var(--accent); }

.file-list { list-style: none; padding: 0; margin: 1.4rem 0 2rem; }
.file-list > li {
  border-bottom: 1px solid var(--border);
  padding: .9rem 0;
  margin: 0;
}
.file-list > li:first-child { border-top: 1px solid var(--border); }
.file-list__name { font-weight: 600; }
.file-list__links { font-size: .9rem; margin-top: .3rem; }
.file-list__links a + a { margin-left: .8rem; }
.file-list p { margin: .3rem 0 0; color: var(--text-muted); font-size: .95rem; }

.news { list-style: none; padding: 0; margin: 1.5rem 0 0; }
.news > li {
  border-top: 1px solid var(--border);
  padding: 1.4rem 0;
  margin: 0;
  max-width: 52rem;
}
.news > li:last-child { border-bottom: 1px solid var(--border); }
.news h2 { margin: .2rem 0 .5rem; font-size: 1.2rem; }
.news time {
  font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: .82rem;
  letter-spacing: .04em;
  color: var(--text-muted);
}
.news p:last-child { margin-bottom: 0; }

/* ---------- формы ---------- */

.form {
  max-width: 34rem;
  margin: 1.75rem 0 0;
  display: grid;
  gap: 1.1rem;
}
.field { display: grid; gap: .35rem; }
.field > label { font-weight: 600; font-size: .95rem; }
.field__hint { font-size: .85rem; color: var(--text-muted); }
.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="number"],
.field select,
.field textarea {
  font: inherit;
  font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 1rem;
  padding: .55rem .7rem;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text);
  width: 100%;
}
.field textarea { min-height: 7rem; resize: vertical; }
.field--check {
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: .6rem;
}
.field--check input { margin-top: .3rem; }
.field--check label { font-weight: 400; font-size: .95rem; }
.field--hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.form__note { font-size: .88rem; color: var(--text-muted); margin: 0; }

/* ---------- подвал ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  padding-block: 2rem 2.5rem;
  font-size: .92rem;
  color: var(--text-muted);
  margin-top: 3rem;
}
.site-footer__cols {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
}
.site-footer h2 {
  font-size: .82rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin: 0 0 .6rem;
  color: var(--text-muted);
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .3rem; }
.site-footer__legal {
  margin-top: 1.8rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border);
  font-size: .85rem;
}
.site-footer__legal p { margin: 0 0 .4rem; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media print {
  .site-header, .site-footer, .hero__actions, .theme-toggle, .skip-link { display: none; }
  body { background: #fff; color: #000; }
}
