@font-face {
  font-family: 'Museo Sans Cyrl';
  src:
    local('Museo Sans Cyrl 900'),
    local('Museo Sans Cyrl Bold'),
    url('../assets/fonts/museosanscyrl-900.ttf') format('truetype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #fffff0;
  --bg-deep: #f4f4e8;
  --ink: #404040;
  --muted: #5f5f5f;
  --line: rgba(64, 64, 64, 0.18);
  --card: rgba(255, 255, 240, 0.9);
  --card-strong: rgba(255, 255, 240, 0.96);
  --cyan: #1dacd6;
  --cyan-soft: rgba(29, 172, 214, 0.16);
  --yellow: #fddd00;
  --yellow-soft: rgba(253, 221, 0, 0.18);
  --ivory: #fffff0;
  --gray: #404040;
  --shadow: 0 28px 70px rgba(64, 64, 64, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Segoe UI', 'Trebuchet MS', sans-serif;
  font-weight: 400;
  color: var(--ink);
  background:
    radial-gradient(900px 500px at -12% -18%, rgba(29, 172, 214, 0.22), transparent 60%),
    radial-gradient(820px 440px at 102% 4%, rgba(253, 221, 0, 0.32), transparent 58%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.32;
  background-image:
    linear-gradient(rgba(64, 64, 64, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(64, 64, 64, 0.04) 1px, transparent 1px);
  background-size: 72px 72px;
}

body::after {
  content: '';
  position: fixed;
  right: -140px;
  bottom: -160px;
  z-index: -1;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.82;
  background:
    radial-gradient(circle at center, transparent 54%, rgba(29, 172, 214, 0.18) 55% 56%, transparent 57% 66%, rgba(253, 221, 0, 0.28) 67% 68%, transparent 69%);
}

.container {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(10px);
  background: linear-gradient(90deg, rgba(58, 58, 58, 0.96), rgba(74, 74, 74, 0.94));
  border-bottom: 1px solid rgba(253, 221, 0, 0.38);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}

.topbar-inner {
  min-height: 76px;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 14px;
  border: 1px solid rgba(253, 221, 0, 0.42);
  background: rgba(255, 255, 240, 0.06);
}

.brand img {
  width: 122px;
  height: auto;
  display: block;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  font-size: 14px;
  flex-wrap: wrap;
}

.nav a,
.topbar-link {
  color: rgba(255, 255, 240, 0.9);
  text-decoration: none;
  transition: color 180ms ease;
}

.nav a:hover,
.nav a.is-active,
.topbar-link:hover {
  color: var(--yellow);
}

.legal-top-actions {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.topbar-link {
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 240, 0.26);
  font-size: 13px;
}

.theme-toggle-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 240, 0.28);
  background: rgba(255, 255, 240, 0.06);
  color: var(--ivory);
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.theme-toggle-btn:hover {
  border-color: rgba(253, 221, 0, 0.72);
  background: rgba(253, 221, 0, 0.12);
}

.theme-toggle-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle-btn .sun-icon,
body.theme-night .theme-toggle-btn .moon-icon {
  display: none;
}

body.theme-night .theme-toggle-btn .sun-icon {
  display: block;
}

.legal-hero {
  padding: 74px 0 34px;
}

.legal-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 28px;
  align-items: end;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: var(--cyan);
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
}

.kicker::before {
  content: '';
  width: 34px;
  height: 2px;
  background: var(--yellow);
}

h1,
h2,
h3 {
  color: var(--gray);
}

h1 {
  max-width: 940px;
  margin: 0;
  font-family: 'Museo Sans Cyrl', 'Trebuchet MS', sans-serif;
  font-size: clamp(28px, 4.1vw, 52px);
  line-height: 1.08;
  letter-spacing: 0;
  text-transform: uppercase;
  font-weight: 900;
}

.legal-lead {
  max-width: 780px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.65;
}

.hero-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(160deg, rgba(255, 255, 240, 0.94), rgba(255, 255, 240, 0.76)),
    var(--card);
  box-shadow: var(--shadow);
  padding: 22px;
}

.hero-note-label {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-note-date {
  margin-top: 10px;
  font-family: 'Museo Sans Cyrl', 'Trebuchet MS', sans-serif;
  font-size: 28px;
  line-height: 1;
  font-weight: 900;
}

.hero-note-text {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.legal-meta {
  margin: 10px auto 40px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.meta-card {
  min-height: 128px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  box-shadow: 0 16px 42px rgba(64, 64, 64, 0.08);
}

.meta-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.meta-card strong,
.meta-card a {
  display: block;
  margin-top: 10px;
  color: var(--gray);
  font-size: 16px;
  line-height: 1.45;
  text-decoration: none;
}

.meta-card a {
  border-bottom: 1px dashed rgba(64, 64, 64, 0.38);
  width: fit-content;
}

.legal-shell {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 34px;
  align-items: start;
  padding-bottom: 72px;
}

.toc {
  position: sticky;
  top: 102px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 240, 0.86);
  box-shadow: 0 18px 46px rgba(64, 64, 64, 0.1);
  padding: 18px;
}

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

.toc a {
  display: block;
  padding: 9px 0;
  color: var(--gray);
  font-size: 14px;
  line-height: 1.35;
  text-decoration: none;
  border-top: 1px solid rgba(64, 64, 64, 0.08);
}

.toc a:first-of-type {
  border-top: 0;
}

.toc a:hover {
  color: #147fa1;
}

.legal-article {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-strong);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.legal-section {
  padding: 38px clamp(22px, 4.2vw, 54px);
  border-top: 1px solid rgba(64, 64, 64, 0.12);
}

.legal-section:first-child {
  border-top: 0;
}

.legal-section h2 {
  margin: 0 0 18px;
  font-family: 'Museo Sans Cyrl', 'Trebuchet MS', sans-serif;
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.22;
  text-transform: uppercase;
  font-weight: 900;
}

.legal-section h3 {
  margin: 26px 0 10px;
  font-size: 20px;
  line-height: 1.28;
}

.legal-section p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.78;
}

.legal-section a {
  color: var(--gray);
  text-decoration: none;
  border-bottom: 1px dashed rgba(64, 64, 64, 0.38);
}

.legal-section p:last-child,
.legal-section ul:last-child {
  margin-bottom: 0;
}

.legal-section ul {
  margin: 0 0 16px;
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.legal-section li {
  position: relative;
  padding-left: 22px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.68;
}

.legal-section li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--cyan);
  box-shadow: 0 0 0 4px var(--cyan-soft);
}

.legal-callout {
  margin-top: 22px;
  padding: 20px;
  border: 1px solid rgba(29, 172, 214, 0.32);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(29, 172, 214, 0.1), rgba(253, 221, 0, 0.08)),
    rgba(255, 255, 240, 0.82);
}

.legal-callout strong {
  display: block;
  margin-bottom: 8px;
  color: var(--gray);
}

.contact-panel {
  margin-top: 0;
  padding: 30px;
  border-top: 1px solid rgba(64, 64, 64, 0.12);
  background:
    radial-gradient(380px 170px at 94% 8%, rgba(253, 221, 0, 0.22), transparent 72%),
    rgba(64, 64, 64, 0.04);
}

.contact-panel h2 {
  margin: 0;
  font-family: 'Museo Sans Cyrl', 'Trebuchet MS', sans-serif;
  font-size: clamp(24px, 3vw, 34px);
  text-transform: uppercase;
}

.contact-panel p {
  max-width: 760px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.contact-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.legal-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid rgba(64, 64, 64, 0.22);
  color: var(--gray);
  background: rgba(255, 255, 240, 0.78);
  text-decoration: none;
  font-size: 14px;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.legal-button:hover {
  transform: translateY(-1px);
  border-color: rgba(29, 172, 214, 0.58);
  background: rgba(29, 172, 214, 0.12);
}

.legal-button.primary {
  border-color: transparent;
  background: var(--yellow);
  box-shadow: 0 10px 22px rgba(253, 221, 0, 0.28);
}

.legal-footer {
  padding: 28px 0 42px;
  color: rgba(64, 64, 64, 0.64);
  font-size: 13px;
  text-align: center;
}

.legal-footer-links {
  margin-top: 10px;
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.legal-footer a {
  color: rgba(64, 64, 64, 0.76);
  text-decoration: none;
  border-bottom: 1px dashed rgba(64, 64, 64, 0.34);
}

body.theme-night {
  --bg: #0a0d14;
  --bg-deep: #131a28;
  --ink: #f7f1dd;
  --muted: rgba(247, 241, 221, 0.76);
  --line: rgba(255, 255, 240, 0.18);
  --card: rgba(255, 255, 240, 0.06);
  --card-strong: rgba(8, 12, 22, 0.86);
  --gray: #f7f1dd;
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.42);
  background:
    radial-gradient(860px 480px at -10% -16%, rgba(29, 172, 214, 0.24), transparent 60%),
    radial-gradient(760px 420px at 104% 6%, rgba(253, 221, 0, 0.14), transparent 56%),
    linear-gradient(180deg, #090c14 0%, #111826 100%);
}

body.theme-night::before {
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(255, 255, 240, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 240, 0.08) 1px, transparent 1px);
}

body.theme-night::after {
  opacity: 0.44;
  background:
    radial-gradient(circle at center, transparent 54%, rgba(29, 172, 214, 0.28) 55% 56%, transparent 57% 66%, rgba(253, 221, 0, 0.3) 67% 68%, transparent 69%);
}

body.theme-night .topbar {
  background: rgba(10, 14, 24, 0.84);
  border-bottom-color: rgba(255, 255, 240, 0.16);
}

body.theme-night .brand {
  border-color: rgba(255, 255, 240, 0.24);
  background: rgba(255, 255, 240, 0.05);
}

body.theme-night .nav a,
body.theme-night .topbar-link {
  color: rgba(247, 241, 221, 0.86);
}

body.theme-night .nav a:hover,
body.theme-night .nav a.is-active,
body.theme-night .topbar-link:hover {
  color: var(--yellow);
}

body.theme-night .theme-toggle-btn {
  border-color: rgba(255, 255, 240, 0.28);
  background: rgba(255, 255, 240, 0.06);
  color: var(--ivory);
}

body.theme-night .theme-toggle-btn:hover {
  border-color: rgba(253, 221, 0, 0.76);
  background: rgba(253, 221, 0, 0.16);
}

body.theme-night .hero-note,
body.theme-night .meta-card,
body.theme-night .toc,
body.theme-night .legal-article {
  background: rgba(255, 255, 240, 0.06);
  border-color: rgba(255, 255, 240, 0.18);
}

body.theme-night .hero-note {
  background:
    linear-gradient(160deg, rgba(255, 255, 240, 0.08), rgba(255, 255, 240, 0.04)),
    rgba(8, 12, 22, 0.76);
}

body.theme-night .legal-section {
  border-top-color: rgba(255, 255, 240, 0.14);
}

body.theme-night .toc a {
  border-top-color: rgba(255, 255, 240, 0.1);
  color: rgba(247, 241, 221, 0.86);
}

body.theme-night .toc a:hover {
  color: var(--yellow);
}

body.theme-night .legal-section a,
body.theme-night .meta-card a,
body.theme-night .legal-footer a {
  color: rgba(247, 241, 221, 0.86);
  border-bottom-color: rgba(247, 241, 221, 0.34);
}

body.theme-night .legal-callout {
  border-color: rgba(29, 172, 214, 0.38);
  background:
    linear-gradient(135deg, rgba(29, 172, 214, 0.16), rgba(253, 221, 0, 0.08)),
    rgba(8, 14, 30, 0.68);
}

body.theme-night .contact-panel {
  border-top-color: rgba(255, 255, 240, 0.14);
  background:
    radial-gradient(380px 170px at 94% 8%, rgba(253, 221, 0, 0.14), transparent 72%),
    rgba(255, 255, 240, 0.04);
}

body.theme-night .legal-button {
  border-color: rgba(255, 255, 240, 0.22);
  color: var(--ivory);
  background: rgba(255, 255, 240, 0.06);
}

body.theme-night .legal-button:hover {
  border-color: rgba(29, 172, 214, 0.7);
  background: rgba(29, 172, 214, 0.18);
}

body.theme-night .legal-button.primary {
  color: #101217;
  background: var(--yellow);
}

body.theme-night .legal-footer {
  color: rgba(247, 241, 221, 0.66);
}

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

@media (max-width: 980px) {
  .topbar-inner {
    grid-template-columns: 1fr auto;
    min-height: auto;
    padding: 14px 0;
    align-items: start;
  }

  .nav {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .legal-top-actions {
    grid-column: 2;
    grid-row: 1;
  }

  .legal-hero {
    padding-top: 46px;
  }

  .legal-hero-grid,
  .legal-shell {
    grid-template-columns: 1fr;
  }

  .hero-note {
    max-width: 420px;
  }

  .legal-meta {
    grid-template-columns: repeat(2, 1fr);
  }

  .toc {
    position: static;
  }

  .toc a {
    display: inline-flex;
    margin-right: 14px;
    border-top: 0;
    border-bottom: 1px solid rgba(64, 64, 64, 0.1);
  }
}

@media (max-width: 640px) {
  .container {
    width: calc(100% - 26px);
  }

  .brand img {
    width: 104px;
  }

  .nav {
    gap: 12px;
    font-size: 13px;
  }

  .topbar-link {
    padding: 9px 11px;
    font-size: 12px;
  }

  .theme-toggle-btn {
    width: 40px;
    height: 40px;
  }

  .legal-hero {
    padding-top: 34px;
  }

  .legal-lead {
    font-size: 16px;
  }

  .hero-note,
  .meta-card,
  .toc,
  .legal-article {
    border-radius: 8px;
  }

  .legal-meta {
    grid-template-columns: 1fr;
  }

  .meta-card {
    min-height: auto;
  }

  .legal-section {
    padding: 28px 18px;
  }

  .legal-section p,
  .legal-section li {
    font-size: 15px;
  }

  .contact-panel {
    padding: 24px 18px;
  }

  .contact-actions {
    display: grid;
  }
}
