:root {
  /* Layout: белый лист и много воздуха. Один шрифт в двух начертаниях:
     жирное — главное, тонкое — всё остальное. Схемы законов нарисованы одной
     тонкой линией; градиент только у одного акцента в каждой схеме. */
  --paper: #fffdfa;
  --tint: #f7f2ea;
  --line: #e9dfd1;
  --sepia: #9c7b58;
  --brown: #5a3923;
  --ink: #16120e;
  --muted: #7b6d60;
  --amber: #ffb04a;
  --orange: #ff7a1f;
  --red: #e8392a;
  --grad: linear-gradient(100deg, var(--amber), var(--orange) 45%, var(--red));

  --f: "Onest", "Golos Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --wrap: 1200px;
  --gut: 40px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 90px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 300 18px/1.6 var(--f); }
b, strong { font-weight: 700; }
a { color: inherit; text-decoration-color: var(--line); text-decoration-thickness: 1px; text-underline-offset: 4px; }
a:hover { text-decoration-color: var(--orange); }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; border-radius: 4px; }
svg { max-width: 100%; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gut); }
@media (max-width: 760px) { :root { --gut: 20px; } body { font-size: 17px; } }

.thin { font-weight: 200; }
.small { font-size: 14px; color: var(--sepia); font-weight: 400; }

/* ───── Шапка ───── */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: rgba(255, 253, 250, 0.92); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.top .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 32px; min-height: 76px; padding-block: 12px; }
.brand { font-size: 20px; letter-spacing: -0.03em; text-decoration: none; }
.brand b { font-weight: 800; }
.brand span { font-weight: 200; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 28px; font-size: 16px; font-weight: 400; }
.nav a { text-decoration: none; color: var(--muted); padding-block: 4px; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); font-weight: 600; border-image: var(--grad) 1; border-bottom-style: solid; }

/* ───── Обложка ───── */
.hero { padding-block: 64px 32px; }
.hero h1 { margin: 0; font-size: min(11vw, 148px); line-height: 0.92; letter-spacing: -0.055em; font-weight: 200; }
.hero h1 b { font-weight: 800; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 40px 72px; margin-top: 56px; align-items: start; }
.lead { margin: 0 0 18px; font-size: clamp(19px, 1.8vw, 23px); line-height: 1.5; max-width: 34ch; }
.lead b { font-weight: 600; }
.for { margin: 28px 0 0; font-size: 16px; color: var(--sepia); font-weight: 400; }
.chart { margin: 0; }
.chart figcaption { margin-top: 14px; font-size: 14px; color: var(--muted); max-width: 52ch; }
.curve { width: 100%; height: auto; display: block; overflow: visible; }
.curve text { font: 300 13px var(--f); fill: var(--muted); }
.curve .cl { font: 600 14px var(--f); fill: var(--ink); }
.curve .cl.thin-l { font-weight: 300; fill: var(--brown); }
.curve-path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.8s 0.2s cubic-bezier(.3, .7, .2, 1) forwards; }
.curve-area { opacity: 0; animation: fade 1.2s 1s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }
@media (max-width: 900px) { .hero-grid { grid-template-columns: minmax(0, 1fr); margin-top: 36px; } .hero { padding-block: 40px 16px; } }

/* ───── Каталог ───── */
.catalog-head { padding-block: 96px 0; display: grid; gap: 28px; }
.catalog-head h2 { margin: 0; font-size: clamp(40px, 6vw, 80px); line-height: 1; letter-spacing: -0.05em; font-weight: 200; }
.catalog-head h2 b { font-weight: 800; }
.search { display: block; max-width: 620px; }
.search input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  background: transparent;
  padding: 10px 0 12px;
  font: 300 22px var(--f);
  color: var(--ink);
}
.search input::placeholder { color: var(--sepia); opacity: 0.8; }
.search input:focus { outline: none; border-bottom: 2px solid var(--orange); padding-bottom: 11px; }
.cats { display: flex; flex-wrap: wrap; gap: 6px 26px; }
.cats button {
  border: 0;
  background: none;
  padding: 4px 0;
  font: 300 17px var(--f);
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.cats button sup { font-size: 11px; color: var(--sepia); margin-left: 2px; }
.cats button:hover { color: var(--ink); }
.cats button[aria-pressed="true"] { color: var(--ink); font-weight: 600; border-image: var(--grad) 1; border-bottom-style: solid; }

.group { padding-block: 80px 0; }
.group h2 { margin: 0 0 36px; font-size: clamp(30px, 3.8vw, 50px); line-height: 1.05; letter-spacing: -0.045em; font-weight: 200; max-width: 20ch; text-wrap: balance; }
.group h2 b { font-weight: 800; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 56px 32px; }
.card { display: grid; gap: 18px; align-content: start; text-decoration: none; min-width: 0; }
.ill { aspect-ratio: 4 / 3; background: var(--tint); border-radius: 20px; display: grid; place-items: center; transition: background 0.3s ease; }
.ill svg { width: 100%; height: 100%; display: block; }
.card:hover .ill { background: #f2eadf; }
.card h3 { margin: 0 0 6px; font-size: 21px; line-height: 1.15; letter-spacing: -0.03em; font-weight: 700; text-wrap: balance; }
.card p { margin: 0; font-size: 15.5px; line-height: 1.5; color: var(--muted); }
.empty { padding-block: 64px; }
.empty p { margin: 0 0 16px; font-size: 20px; }
.link-btn { border: 0; background: none; padding: 0; font: 600 16px var(--f); color: var(--ink); cursor: pointer; border-bottom: 2px solid; border-image: var(--grad) 1; }

/* ───── Схемы ───── */
.illo * { vector-effect: non-scaling-stroke; }
.illo .s, .illo .a, .illo .d, .illo .c, .illo .hl { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.illo .s { stroke: var(--ink); stroke-width: 1.4; }
.illo .c { fill: var(--tint); stroke: var(--ink); stroke-width: 1.4; }
.illo .a { stroke: var(--g); stroke-width: 3.2; }
.illo .d { stroke: var(--sepia); stroke-width: 1.2; stroke-dasharray: 2 4; }
.illo .f { fill: var(--ink); }
.illo .fa { fill: var(--g); }
.illo .hl { stroke: var(--g); stroke-width: 12; opacity: 0.3; vector-effect: none; }
.illo .tl { fill: var(--ink); font: 300 20px var(--f); text-anchor: middle; }
.illo .ta { fill: var(--g); font: 700 30px var(--f); text-anchor: middle; }
.law-hero .illo .s, .law-hero .illo .c { stroke-width: 1.8; }
.law-hero .illo .a { stroke-width: 4.5; }

/* ───── Страница закона ───── */
.back { display: inline-block; margin-top: 28px; font-size: 15px; color: var(--sepia); font-weight: 400; text-decoration: none; }
.back:hover { color: var(--ink); }
.law-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px 72px; align-items: center; padding-block: 28px 72px; }
.law-hero .ill { border-radius: 28px; }
.law-hero h1 { margin: 12px 0 0; font-size: clamp(42px, 6vw, 84px); line-height: 0.95; letter-spacing: -0.055em; font-weight: 800; text-wrap: balance; }
.law-hero .en { margin-top: 10px; font-size: clamp(20px, 2vw, 26px); font-weight: 200; color: var(--sepia); letter-spacing: -0.02em; }
.law-hero .thesis { margin: 30px 0 0; font-size: clamp(21px, 2.1vw, 27px); line-height: 1.4; letter-spacing: -0.02em; font-weight: 300; max-width: 28ch; }
@media (max-width: 900px) { .law-hero { grid-template-columns: minmax(0, 1fr); padding-block: 20px 40px; } }

.law-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); gap: 48px 88px; padding-block: 8px 64px; align-items: start; }
.article { max-width: 680px; min-width: 0; }
.article > p { margin: 0 0 18px; font-size: 19px; line-height: 1.65; }
.article h2 { margin: 56px 0 20px; font-size: 26px; letter-spacing: -0.035em; font-weight: 700; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.steps li { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 12px; font-size: 18px; }
.steps li::before { content: attr(data-n); font-weight: 200; font-size: 26px; line-height: 1.05; color: var(--sepia); letter-spacing: -0.03em; }
.trouble { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.trouble li { position: relative; padding-left: 28px; font-size: 18px; }
.trouble li::before { content: ""; position: absolute; left: 2px; top: 0.62em; width: 12px; height: 2px; background: var(--grad); }
.ba { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
.ba > div { border-top: 1px solid var(--line); padding-top: 14px; min-width: 0; }
.ba .now { border-top: 2px solid; border-image: var(--grad) 1; }
.ba .tag { display: block; margin-bottom: 6px; font-size: 15px; }
.ba .was .tag { font-weight: 300; color: var(--sepia); }
.ba .now .tag { font-weight: 700; }
.ba .was p { color: var(--muted); }
.ba p, .single p { margin: 0; }
.ba-context { margin: 0 0 18px; color: var(--muted); }
.single { border-top: 1px solid var(--line); padding-top: 14px; }
@media (max-width: 640px) { .ba { grid-template-columns: minmax(0, 1fr); gap: 24px; } }
.refs { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 14.5px; color: var(--muted); }

.side { display: grid; gap: 36px; position: sticky; top: 100px; }
.facts { margin: 0; display: grid; gap: 18px; }
.facts dt { font-size: 14px; color: var(--sepia); font-weight: 400; }
.facts dd { margin: 2px 0 0; font-size: 17px; font-weight: 400; }
.ask { display: grid; gap: 14px; padding: 24px; background: var(--tint); border-radius: 20px; cursor: pointer; }
.ask .k { font-size: 14px; color: var(--sepia); font-weight: 400; }
.ask .q { font-size: 21px; line-height: 1.3; font-weight: 600; letter-spacing: -0.02em; }
.ask .row { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--muted); font-weight: 400; }
input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  margin: 0;
  flex: none;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  cursor: pointer;
  display: grid;
  place-content: center;
}
input[type="checkbox"]:checked { background: var(--grad); border-color: transparent; }
input[type="checkbox"]:checked::after { content: ""; width: 8px; height: 4px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translate(1px, -1px); }
@media (max-width: 900px) { .law-body { grid-template-columns: minmax(0, 1fr); } .side { position: static; } }

.pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; padding-block: 32px 96px; border-top: 1px solid var(--line); }
.pager a { display: grid; gap: 4px; text-decoration: none; min-width: 0; }
.pager span { font-size: 14px; color: var(--sepia); font-weight: 400; }
.pager b { font-size: clamp(20px, 2.2vw, 28px); line-height: 1.15; letter-spacing: -0.035em; }
.pager a:hover b { text-decoration: underline; text-decoration-color: var(--orange); text-decoration-thickness: 2px; }
.pager .next { text-align: right; }
@media (max-width: 560px) { .pager { grid-template-columns: minmax(0, 1fr); } .pager .next { text-align: left; } }

/* ───── Проверка курса и о проекте ───── */
.page-head { padding-block: 64px 24px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 64px; align-items: end; }
.page-head h1 { margin: 0; font-size: clamp(48px, 8vw, 120px); line-height: 0.92; letter-spacing: -0.06em; font-weight: 200; }
.page-head h1 b { font-weight: 800; }
.page-head p { margin: 24px 0 0; max-width: 46ch; font-size: 20px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 24px; }
.score { text-align: right; font-size: 20px; color: var(--muted); }
.score b { display: block; font-size: clamp(72px, 10vw, 140px); line-height: 0.9; letter-spacing: -0.06em; color: var(--ink); font-weight: 800; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .page-head { grid-template-columns: minmax(0, 1fr); } .score { text-align: left; } }
.cl { padding-block: 24px 96px; }
.cl-group { padding-top: 56px; }
.cl-group h2 { margin: 0 0 18px; font-size: clamp(26px, 3vw, 38px); line-height: 1.1; letter-spacing: -0.045em; font-weight: 200; }
.cl-group h2 b { font-weight: 800; }
.cl-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: start; padding: 16px 0; border-top: 1px solid var(--line); cursor: pointer; }
.cl-item span { font-size: 18px; font-weight: 400; }
.cl-item a { font-size: 14px; color: var(--sepia); font-weight: 400; text-decoration: none; white-space: nowrap; margin-top: 3px; }
.cl-item a:hover { color: var(--ink); }
.cl-item input:checked ~ span { color: var(--sepia); text-decoration: line-through; text-decoration-color: var(--orange); }
@media (max-width: 600px) { .cl-item { grid-template-columns: auto minmax(0, 1fr); } .cl-item a { grid-column: 2; white-space: normal; margin-top: -8px; } }

.about { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); gap: 48px 88px; padding-block: 24px 96px; align-items: start; }
.about .article h2:first-child { margin-top: 16px; }
.about ul { margin: 0; padding-left: 20px; display: grid; gap: 10px; font-size: 18px; }
.about li::marker { color: var(--orange); }
.author { position: sticky; top: 100px; display: grid; gap: 6px; padding: 28px; background: var(--tint); border-radius: 20px; }
.author .k { font-size: 14px; color: var(--sepia); font-weight: 400; }
.author b { font-size: 32px; line-height: 1; letter-spacing: -0.04em; font-weight: 800; }
.author a { margin-top: 10px; font-weight: 400; }
@media (max-width: 900px) { .about { grid-template-columns: minmax(0, 1fr); } .author { position: static; max-width: 360px; } }

/* ───── Подвал ───── */
.foot .wrap { border-top: 1px solid var(--line); padding-block: 32px 48px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 40px; font-size: 15px; color: var(--muted); }
.foot p { margin: 0; }
.foot b { font-weight: 800; color: var(--ink); }
.foot .thin { color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .curve-path { stroke-dashoffset: 0; }
  .curve-area { opacity: 1; }
}
