/* Юридические документы BeautyBook.
   Один файл на все страницы: /legal/*.html ссылаются на /legal/legal.css.
   Только системные шрифты, ноль внешних запросов, тема — системная. */

:root {
  --bg: #faf7f3;
  --panel: #ffffff;
  --ink: #241a20;
  --muted: #6f6068;
  --line: #e8dfd8;
  --accent: #8c4a5f;
  --accent-soft: #f3e7ea;
  --serif: Georgia, "Times New Roman", serif;
  --sans: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14100f;
    --panel: #1b1615;
    --ink: #efe6e0;
    --muted: #a4959a;
    --line: #322a28;
    --accent: #d99aac;
    --accent-soft: #2a1e21;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  z-index: 10;
}
.skip:focus { left: 0; }

.top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.top .back {
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
}
.top .back:hover { color: var(--accent); }

.top .brand {
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 48px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px clamp(16px, 4vw, 40px) 80px;
  align-items: start;
}

.toc {
  position: sticky;
  top: 88px;
  font-size: 14px;
  line-height: 1.5;
  border-left: 2px solid var(--line);
  padding-left: 16px;
}

.toc-title {
  margin: 0 0 10px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}

.toc li { margin: 0 0 8px; }

.toc a {
  color: var(--muted);
  text-decoration: none;
  display: block;
}
.toc a:hover,
.toc a:focus { color: var(--accent); }

.doc {
  max-width: 68ch;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: clamp(20px, 4vw, 48px);
}

.kind {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.doc h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(26px, 3.4vw, 34px);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
}

.meta {
  margin: 0 0 32px;
  padding: 10px 0 10px 14px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 8px 8px 0;
  font-size: 13.5px;
  color: var(--muted);
}

.doc h2 {
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.35;
  margin: 2.2em 0 0.7em;
  padding-top: 1.1em;
  border-top: 1px solid var(--line);
  scroll-margin-top: 96px;
}

.doc h2:first-of-type {
  margin-top: 1.2em;
  padding-top: 0;
  border-top: 0;
}

.doc p { margin: 0 0 0.95em; }

.doc ul,
.doc ol {
  margin: 0 0 1em;
  padding-left: 1.3em;
}

.doc li { margin: 0 0 0.4em; }

.doc blockquote {
  margin: 1.2em 0;
  padding: 4px 0 4px 16px;
  border-left: 3px solid var(--line);
  color: var(--muted);
}

.doc a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.doc strong { font-weight: 600; }

.source {
  margin: 40px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

.foot {
  border-top: 1px solid var(--line);
  padding: 24px clamp(16px, 4vw, 40px) 40px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--accent); }

/* Индекс документов */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px clamp(16px, 4vw, 40px) 80px;
}

.card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.card:hover,
.card:focus {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.card .kind { margin-bottom: 10px; }

.card h2 {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.3;
  margin: 0 0 8px;
}

.card p {
  margin: 0;
  font-size: 14.5px;
  color: var(--muted);
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    padding-top: 24px;
  }
  .toc {
    position: static;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 16px 0 0;
    order: -1;
  }
  .doc { border-radius: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
}

@media print {
  .top, .toc, .foot, .skip, .source { display: none; }
  body {
    background: #fff;
    color: #000;
    font-size: 11.5pt;
    line-height: 1.5;
  }
  .layout {
    display: block;
    max-width: none;
    padding: 0;
  }
  .doc {
    border: 0;
    padding: 0;
    max-width: none;
    background: #fff;
  }
  .doc h2 { border-top-color: #bbb; page-break-after: avoid; }
  .doc a { color: #000; text-decoration: none; }
  .meta { background: none; border-left-color: #000; }
}
