:root {
  --legal-black: #070705;
  --legal-ink: #15130d;
  --legal-paper: #f4e6bd;
  --legal-paper-soft: #fbf5e4;
  --legal-mustard: #d8a500;
  --legal-yellow: #ffc400;
  --legal-red: #c52318;
  --legal-muted: #746c58;
  --legal-line: rgba(21, 19, 13, .2);
  --legal-wrap: 1280px;
}

@font-face {
  font-family: "Bebas Neue Cyrillic";
  src: url("neuro-assets/fonts/bebas-neue-regular-cyrillic.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 76% -8%, rgba(216, 165, 0, .17), transparent 34rem),
    var(--legal-black);
  color: var(--legal-paper);
  font-family: "Golos Text", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

.legal-site-header {
  position: relative;
  z-index: 10;
  width: min(calc(100% - 48px), var(--legal-wrap));
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 auto;
  border-bottom: 1px solid rgba(244, 230, 189, .2);
}

.legal-brand {
  position: relative;
  flex: 0 0 auto;
  width: clamp(150px, 16vw, 205px);
  aspect-ratio: 1375 / 597;
  overflow: hidden;
  text-decoration: none;
}

.legal-brand img {
  position: absolute;
  top: -36.01%;
  left: -6.55%;
  width: 111.71%;
  max-width: none;
  height: auto;
  display: block;
}

.back-link {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 17px;
  border: 1px solid rgba(244, 230, 189, .34);
  border-radius: 999px;
  color: var(--legal-paper);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: border-color .2s ease, background .2s ease, color .2s ease;
}

.back-link:hover,
.back-link:focus-visible {
  border-color: var(--legal-yellow);
  background: var(--legal-yellow);
  color: var(--legal-black);
}

.legal-layout {
  width: min(calc(100% - 48px), var(--legal-wrap));
  display: grid;
  grid-template-columns: minmax(210px, 260px) minmax(0, 900px);
  justify-content: space-between;
  gap: clamp(32px, 5vw, 72px);
  margin: 0 auto;
  padding: 56px 0 96px;
}

.legal-sidebar {
  min-width: 0;
}

.legal-toc {
  position: sticky;
  top: 28px;
  display: grid;
  gap: 0;
  padding: 20px;
  border: 1px solid rgba(244, 230, 189, .2);
  border-radius: 14px;
  background: rgba(255, 255, 255, .035);
}

@media (min-width: 921px) {
  .legal-toc {
    max-height: calc(100vh - 56px);
    max-height: calc(100dvh - 56px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

.toc-title {
  margin: 0 0 12px;
  color: var(--legal-yellow);
  font-family: "Bebas Neue Cyrillic", "Arial Narrow", sans-serif;
  font-size: 18px;
  font-weight: 400;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.legal-toc a {
  padding: 10px 0;
  border-top: 1px solid rgba(244, 230, 189, .13);
  color: rgba(244, 230, 189, .78);
  font-size: 13px;
  line-height: 1.35;
  text-decoration: none;
  text-wrap: pretty;
  transition:
    padding .2s ease,
    background-color .2s ease,
    color .2s ease,
    box-shadow .2s ease;
}

.legal-toc a:hover,
.legal-toc a:focus-visible {
  color: var(--legal-yellow);
}

.legal-toc a.is-active,
.legal-toc a[aria-current="location"] {
  padding-right: 10px;
  padding-left: 12px;
  border-radius: 7px;
  background: rgba(255, 196, 0, .1);
  color: var(--legal-yellow);
  box-shadow: inset 3px 0 0 var(--legal-yellow);
  font-weight: 700;
}

.sibling-document {
  display: block;
  margin-top: 18px;
  color: var(--legal-yellow);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
}

.legal-main {
  min-width: 0;
}

.legal-document,
.collection-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(21, 19, 13, .18);
  border-radius: 18px;
  background:
    linear-gradient(rgba(21, 19, 13, .025) 1px, transparent 1px) 0 0 / 100% 32px,
    var(--legal-paper-soft);
  color: var(--legal-ink);
  box-shadow: 16px 18px 0 rgba(216, 165, 0, .18);
}

.legal-document::before,
.collection-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 8px;
  background: var(--legal-mustard);
}

.document-header {
  padding: clamp(36px, 6vw, 72px) clamp(24px, 6.5vw, 72px) clamp(32px, 5vw, 54px);
  border-bottom: 2px solid var(--legal-ink);
  background:
    radial-gradient(circle at 94% 14%, rgba(216, 165, 0, .24), transparent 15rem),
    var(--legal-paper);
}

.document-kicker,
.collection-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 20px;
  color: #861a13;
  font-family: "Golos Text", Arial, sans-serif;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: .16em;
  line-height: 1.35;
  text-transform: uppercase;
}

.document-kicker::before,
.collection-kicker::before {
  content: "";
  width: 20px;
  height: 2px;
  flex: 0 0 auto;
  background: currentColor;
}

.document-header h1,
.document-header h2,
.collection-hero h1 {
  max-width: 760px;
  margin: 0;
  font-family: "Bebas Neue Cyrillic", "Arial Narrow", sans-serif;
  font-size: clamp(38px, 6.5vw, 74px);
  font-weight: 400;
  letter-spacing: .01em;
  line-height: .88;
  text-transform: uppercase;
  text-wrap: balance;
}

.document-meta {
  display: grid;
  gap: 5px;
  margin-top: 30px;
  padding: 18px 20px;
  border-left: 5px solid var(--legal-red);
  background: rgba(255, 255, 255, .42);
}

.document-meta p {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
}

.document-content {
  padding: clamp(30px, 5vw, 64px) clamp(24px, 6.5vw, 72px) clamp(48px, 7vw, 82px);
  font-size: clamp(15px, 1.55vw, 17px);
  line-height: 1.68;
  overflow-wrap: break-word;
}

.document-content h2,
.document-content h3,
.document-content h4 {
  scroll-margin-top: 28px;
  text-wrap: balance;
}

.document-content h2,
.legal-layout--collection .document-content h3[id] {
  margin: 36px 0 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(21, 19, 13, .55);
  font-family: "Bebas Neue Cyrillic", "Arial Narrow", sans-serif;
  font-size: clamp(25px, 3.7vw, 38px);
  font-weight: 400;
  letter-spacing: .01em;
  line-height: .96;
  text-transform: uppercase;
}

.document-content h3[id] {
  margin: 30px 0 12px;
  padding-top: 0;
  border-top: 0;
  font-family: "Bebas Neue Cyrillic", "Arial Narrow", sans-serif;
  font-size: clamp(21px, 2.7vw, 28px);
  font-weight: 400;
  letter-spacing: .01em;
  line-height: 1.05;
}

.document-content > h2:first-child,
.legal-layout--collection .document-content > h3[id]:first-child {
  margin-top: 0;
}

/* Первый подраздел продолжает заголовок главы, а не открывает новый блок. */
.document-content h2 + h3[id],
.document-content h3[id] + h4[id] {
  margin-top: 14px;
  padding-top: 0;
  border-top: 0;
}

/* В согласиях h3 — основной раздел документа, поэтому разделитель остаётся. */
.legal-layout--collection .document-content h3[id] {
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid rgba(21, 19, 13, .55);
  font-size: clamp(25px, 3.7vw, 38px);
  line-height: .96;
  text-transform: uppercase;
}

.document-content h3:not([id]),
.document-content h4 {
  margin: 26px 0 10px;
  font-family: "Bebas Neue Cyrillic", "Arial Narrow", sans-serif;
  font-size: clamp(18px, 2.2vw, 23px);
  font-weight: 400;
  letter-spacing: .01em;
  line-height: 1;
}

.document-content p {
  margin: 0 0 16px;
  text-wrap: pretty;
}

.document-content ul {
  display: grid;
  gap: 10px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}

.document-content li {
  position: relative;
  padding-left: 24px;
  text-wrap: pretty;
}

.document-content li::before {
  content: "";
  position: absolute;
  top: .72em;
  left: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--legal-mustard);
  transform: translateY(-50%);
}

.document-content a {
  color: #7d160f;
  font-weight: 700;
  overflow-wrap: anywhere;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.document-content strong {
  font-weight: 700;
}

.placeholder {
  padding: 1px 4px;
  border: 1px dashed rgba(21, 19, 13, .6);
  border-radius: 3px;
  background: var(--legal-yellow);
  color: var(--legal-ink);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.collection-hero {
  margin-bottom: 38px;
  padding: clamp(40px, 6vw, 72px) clamp(24px, 6.5vw, 72px);
  background:
    radial-gradient(circle at 92% 8%, rgba(216, 165, 0, .32), transparent 17rem),
    var(--legal-paper);
}

.collection-hero > p:not(.collection-kicker) {
  max-width: 680px;
  margin: 24px 0 0;
  color: #4e4738;
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.55;
  text-wrap: pretty;
}

.consent-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 34px;
}

.consent-cards a {
  min-height: 86px;
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 13px;
  padding: 15px;
  border: 2px solid var(--legal-ink);
  border-radius: 9px;
  background: rgba(255, 255, 255, .36);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.3;
  text-decoration: none;
  text-wrap: pretty;
  transition: background .2s ease, transform .2s ease;
}

.consent-cards a:hover,
.consent-cards a:focus-visible {
  background: var(--legal-yellow);
  transform: translateY(-2px);
}

.consent-cards span {
  color: var(--legal-red);
  font-family: "Bebas Neue Cyrillic", "Arial Narrow", sans-serif;
  font-size: 23px;
  font-weight: 400;
}

.legal-layout--collection .legal-document {
  margin-top: 38px;
}

.legal-layout--collection .legal-document:target {
  outline: 4px solid var(--legal-yellow);
  outline-offset: 5px;
}

.legal-site-footer {
  width: min(calc(100% - 48px), var(--legal-wrap));
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin: 0 auto;
  padding: 30px 0 44px;
  border-top: 1px solid rgba(244, 230, 189, .2);
  color: rgba(244, 230, 189, .7);
  font-size: 13px;
  line-height: 1.5;
}

.legal-site-footer p {
  margin: 0;
}

.legal-site-footer a {
  color: var(--legal-yellow);
}

@media (max-width: 920px) {
  .legal-layout {
    grid-template-columns: 1fr;
    padding-top: 34px;
  }

  .legal-toc {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 22px;
  }

  .toc-title {
    grid-column: 1 / -1;
  }

  .sibling-document {
    margin-bottom: 24px;
  }
}

@media (max-width: 620px) {
  .legal-site-header,
  .legal-layout,
  .legal-site-footer {
    width: min(calc(100% - 28px), var(--legal-wrap));
  }

  .legal-site-header {
    min-height: 72px;
    gap: 12px;
  }

  .legal-brand {
    width: 124px;
  }

  .back-link {
    min-height: 38px;
    padding: 0 13px;
    font-size: 12px;
  }

  .legal-layout {
    gap: 22px;
    padding: 20px 0 56px;
  }

  .legal-document,
  .collection-hero {
    border-radius: 12px;
    box-shadow: 7px 9px 0 rgba(216, 165, 0, .2);
  }

  .document-header h1,
  .document-header h2,
  .collection-hero h1 {
    font-size: clamp(30px, 10.5vw, 42px);
    line-height: .94;
  }

  .document-header,
  .collection-hero {
    padding: 30px 20px 28px;
  }

  .document-kicker,
  .collection-kicker {
    gap: 8px;
    margin-bottom: 14px;
    font-size: 10px;
    letter-spacing: .13em;
  }

  .document-kicker::before,
  .collection-kicker::before {
    width: 15px;
  }

  .document-meta {
    gap: 4px;
    margin-top: 22px;
    padding: 14px 15px;
    border-left-width: 4px;
  }

  .document-meta p {
    font-size: 13px;
  }

  .document-content {
    padding: 26px 20px 46px;
    font-size: 15px;
    line-height: 1.58;
  }

  .document-content h2,
  .legal-layout--collection .document-content h3[id] {
    margin-top: 26px;
    padding-top: 14px;
    font-size: clamp(24px, 8.5vw, 32px);
    line-height: 1;
  }

  .document-content h3[id] {
    margin-top: 22px;
    font-size: clamp(21px, 7vw, 26px);
    line-height: 1.08;
  }

  .document-content p {
    margin-bottom: 14px;
  }

  .document-content ul {
    gap: 8px;
    margin-bottom: 19px;
  }

  .document-content li {
    padding-left: 21px;
  }

  .collection-hero {
    margin-bottom: 28px;
  }

  .collection-hero > p:not(.collection-kicker) {
    margin-top: 18px;
    font-size: 15px;
  }

  .consent-cards {
    gap: 8px;
    margin-top: 24px;
  }

  .consent-cards a {
    min-height: 72px;
    padding: 13px;
    font-size: 13px;
  }

  .legal-layout--collection .legal-document {
    margin-top: 28px;
  }

  .consent-cards,
  .legal-toc {
    grid-template-columns: 1fr;
  }

  .legal-site-footer {
    display: grid;
    gap: 10px;
    padding: 24px 0 34px;
  }

  .legal-toc {
    padding: 16px;
  }
}

@media (max-width: 380px) {
  .legal-site-header,
  .legal-layout,
  .legal-site-footer {
    width: min(calc(100% - 20px), var(--legal-wrap));
  }

  .legal-brand {
    width: 112px;
  }

  .back-link {
    padding: 0 11px;
    font-size: 11px;
  }

  .document-header,
  .collection-hero,
  .document-content {
    padding-right: 17px;
    padding-left: 17px;
  }

  .document-header h1,
  .document-header h2,
  .collection-hero h1 {
    font-size: 29px;
  }
}

@media print {
  body {
    background: #fff;
    color: #000;
  }

  .legal-sidebar,
  .legal-site-footer,
  .collection-hero {
    display: none;
  }

  .legal-site-header {
    width: 100%;
    min-height: 0;
    padding-bottom: 18px;
  }

  .legal-site-header .back-link {
    display: none;
  }

  .legal-layout {
    width: 100%;
    display: block;
    padding: 0;
  }

  .legal-document {
    margin: 0 0 28px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    break-after: page;
  }

  .document-header,
  .document-content {
    padding-right: 0;
    padding-left: 0;
  }

  .document-content a {
    color: inherit;
  }
}
