@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400..900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --paper: #f7f3ec;
  --surface: #ffffff;
  --ink: #1a1712;
  --ink-soft: #5b5347;
  --line: #ded4c0;
  --stamp: #b5451b;
  --stamp-dark: #8f3714;
  --radius: 3px;
  --container: 1180px;
  color-scheme: light;
  font-family: "IBM Plex Sans", sans-serif;
  font-synthesis: none;
  color: var(--ink);
  background: var(--paper);
}

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

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

body {
  min-width: 320px;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-size: clamp(16px, 1.2vw, 18px);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration-color: var(--stamp);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover { color: inherit; text-decoration-color: var(--stamp-dark); }

a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--stamp);
  outline-offset: 3px;
}

header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 243, 236, .97);
}

nav, main, footer p {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(24px, 5vw, 64px);
}

nav {
  display: flex;
  align-items: center;
  min-height: 64px;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
}

nav a {
  flex: 0 0 auto;
  padding: 8px;
  border-bottom: 2px solid transparent;
  border-radius: var(--radius);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
}

nav a:hover { border-bottom-color: var(--stamp); transform: translateY(-2px); }

nav a[aria-current="page"], nav a:active { border-bottom-color: var(--stamp); color: var(--ink); }

nav a:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  margin-right: 16px;
  padding-left: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Fraunces", serif;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -.02em;
}

.brand-mark { flex: none; width: 24px; height: 24px; margin-right: 8px; overflow: visible; }
.brand-mark circle, .brand-mark path { fill: none; stroke: var(--stamp); stroke-width: 2; stroke-linecap: square; }

article { padding-block: clamp(64px, 8vw, 96px) 96px; counter-reset: section; }

h1, h2, h3 {
  margin-top: 0;
  font-family: "Fraunces", serif;
  color: var(--ink);
  font-variation-settings: "opsz" 72;
  line-height: 1.1;
  text-wrap: balance;
}

h1 { max-width: 18ch; margin-bottom: 24px; font-size: clamp(50px, 6vw, 67px); font-weight: 750; letter-spacing: -.035em; }
h2 { max-width: 24ch; margin-bottom: 24px; font-size: clamp(28px, 3.4vw, 37px); font-weight: 700; letter-spacing: -.025em; }
h3 { font-size: 21px; font-weight: 600; }

p, li, dd { overflow-wrap: break-word; }
p { max-width: 65ch; margin: 0 0 24px; }

article > h1 + p {
  max-width: 65ch;
  margin-bottom: 64px;
  padding-left: 24px;
  border-left: 2px solid var(--stamp);
  color: var(--ink-soft);
  font-size: clamp(17px, 1.5vw, 21px);
}

section { position: relative; margin-top: 96px; scroll-margin-top: 96px; counter-increment: section; }
section > h2::before {
  display: block;
  margin-bottom: 8px;
  color: var(--stamp);
  content: "§ " counter(section, decimal-leading-zero);
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .08em;
  line-height: 1.4;
  text-transform: uppercase;
}

ul, ol { max-width: 65ch; margin: 24px 0 0; padding-left: 24px; }
li { margin-bottom: 16px; padding-left: 8px; }
li::marker { color: var(--stamp); }

section[aria-labelledby="four-products"] > ul,
section[aria-labelledby="articles"] > ul {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  max-width: none;
  padding: 0;
  gap: 16px;
  list-style: none;
}

section[aria-labelledby="four-products"] li,
section[aria-labelledby="articles"] li {
  grid-column: span 6;
  margin: 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

section[aria-labelledby="four-products"] li:nth-child(1) { grid-column: span 7; }
section[aria-labelledby="four-products"] li:nth-child(2) { grid-column: 1 / span 5; }
section[aria-labelledby="four-products"] li:nth-child(3) { grid-column: span 4; }
section[aria-labelledby="four-products"] li:nth-child(4) { grid-column: span 3; }

section[aria-labelledby="four-products"] li:hover,
section[aria-labelledby="articles"] li:hover {
  border-color: var(--stamp);
  border-bottom: 2px solid var(--stamp);
  transform: translateY(-2px);
}

figure {
  position: relative;
  min-height: 320px;
  margin: 48px 0 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 720 300'%3E%3Cg fill='none' stroke='%23ded4c0' stroke-width='1.5'%3E%3Cpath d='M125 85L275 52 372 142 535 75M275 52L242 218 372 142 555 225M372 142L535 75M372 142L555 225M242 218L555 225'/%3E%3C/g%3E%3Cg fill='%23fff' stroke='%23b5451b' stroke-width='2'%3E%3Ccircle cx='125' cy='85' r='7'/%3E%3Ccircle cx='275' cy='52' r='8'/%3E%3Ccircle cx='372' cy='142' r='10'/%3E%3Ccircle cx='535' cy='75' r='7'/%3E%3Ccircle cx='242' cy='218' r='6'/%3E%3Ccircle cx='555' cy='225' r='8'/%3E%3C/g%3E%3Ctext x='390' y='137' fill='%235b5347' font-family='IBM Plex Mono,monospace' font-size='11'%3Eисточник%3C/text%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: min(92%, 720px) auto;
}

figcaption {
  position: absolute;
  right: 24px;
  bottom: 16px;
  left: 24px;
  max-width: 65ch;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.4;
}

dl { max-width: 65ch; margin: 32px 0 0; border-top: 1px solid var(--line); counter-reset: question; }
dt {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(24px, 1fr) minmax(0, auto);
  align-items: baseline;
  padding: 24px 32px 8px 0;
  border-top: 1px solid var(--line);
  font-family: "Fraunces", serif;
  font-size: 21px;
  font-weight: 600;
  line-height: 1.3;
  counter-increment: question;
}
dt:first-child { border-top: 0; }
dt::before {
  grid-column: 1;
  margin-right: 8px;
  color: var(--stamp);
  content: "Q" counter(question, decimal-leading-zero);
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .08em;
}
dt::after {
  grid-column: 2;
  min-width: 24px;
  margin: 0 8px 5px;
  border-bottom: 1px dotted var(--line);
  content: "";
}
dd { position: relative; margin: 0; padding: 0 32px 24px 60px; color: var(--ink-soft); }
dd::before {
  position: absolute;
  top: -43px;
  right: 8px;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid var(--stamp);
  content: "";
  transform: rotate(90deg);
  transition: transform 160ms ease;
}

table { display: block; width: 100%; margin-top: 32px; overflow-x: auto; border: 1px solid var(--line); border-spacing: 0; border-collapse: separate; border-radius: var(--radius); background: var(--surface); }
thead, tbody { display: table; width: 100%; min-width: 680px; table-layout: fixed; }
th, td { padding: 16px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th:last-child, td:last-child { border-right: 0; }
tbody tr:last-child td { border-bottom: 0; }
th { background: var(--ink); color: var(--paper); font-size: 13px; font-weight: 600; letter-spacing: .04em; }
tbody tr:nth-child(odd) td { background: var(--paper); }
tbody tr:nth-child(even) td { background: var(--surface); }
td:not(:first-child) { font-family: "IBM Plex Mono", monospace; font-size: 13px; text-align: right; }

pre { max-width: 100%; margin: 24px 0; padding: 24px; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--ink); color: var(--paper); font-size: 13px; line-height: 1.6; tab-size: 2; }
code { font-family: "IBM Plex Mono", monospace; }

form { display: grid; max-width: 720px; margin-top: 32px; padding: 32px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); gap: 8px; }
label { margin-top: 8px; color: var(--ink); font-size: 13px; font-weight: 600; }
input, select, textarea, button { width: 100%; border-radius: var(--radius); font: inherit; }
input, select, textarea { min-height: 48px; padding: 8px 16px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
textarea { min-height: 144px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: var(--stamp); }
label:has(input[type="checkbox"]) { display: grid; grid-template-columns: 16px 1fr; align-items: start; margin: 16px 0; color: var(--ink-soft); font-size: 12px; font-weight: 500; line-height: 1.4; }
input[type="checkbox"] { width: 16px; min-height: 16px; margin: 2px 0 0; accent-color: var(--stamp); }
button { min-height: 48px; padding: 8px 16px; border: 1px solid var(--stamp); background: var(--stamp); color: var(--surface); cursor: pointer; font-weight: 600; }
button:hover { border-color: var(--stamp-dark); background: var(--stamp-dark); transform: translateY(-2px); }
small { color: var(--ink-soft); font-size: 12px; line-height: 1.4; }

section[aria-labelledby="cta"] {
  padding: clamp(32px, 6vw, 64px);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background-color: var(--ink);
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.04) 0, rgba(255,255,255,.04) 1px, transparent 1px, transparent 8px);
  color: var(--paper);
}
section[aria-labelledby="cta"] h2, section[aria-labelledby="cta"] label { color: var(--paper); }
section[aria-labelledby="cta"] h2::before { color: var(--stamp); }
section[aria-labelledby="cta"] form { color: var(--ink); }
section[aria-labelledby="cta"] form label { color: var(--ink); }
section[aria-labelledby="cta"] form label:has(input[type="checkbox"]) { color: var(--ink-soft); }

footer { border-top: 1px solid var(--line); background-color: var(--ink); background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.04) 0, rgba(255,255,255,.04) 1px, transparent 1px, transparent 8px); color: var(--paper); }
footer p { max-width: var(--container); margin: 0 auto; padding-block: 32px; font-size: 13px; }

@media (min-width: 720px) {
  nav { gap: 16px; }
  form { grid-template-columns: 1fr 1fr; column-gap: 16px; }
  form > label, form > input, form > select, form > textarea, form > button { grid-column: 1 / -1; }
}

@media (max-width: 1079px) {
  nav { overflow-x: visible; flex-wrap: wrap; row-gap: 4px; }
  nav a:first-child { position: static; padding-left: 1.55rem; margin-right: 0.25rem; flex: 1 0 100%; }
}

@media (max-width: 719px) {
  h1 { font-size: clamp(37px, 12vw, 50px); }
  article { padding-block: 48px 64px; }
  section { margin-top: 64px; }
  section[aria-labelledby="four-products"] li, section[aria-labelledby="articles"] li { grid-column: 1 / -1 !important; }
  figure { min-height: 260px; }
  dt { grid-template-columns: auto minmax(24px, 1fr); }
  dt::after { grid-column: 2; grid-row: 1; margin: 0 8px 7px; }
  dd { padding-left: 0; }
  form { padding: 24px; }
}

@media (prefers-reduced-motion: no-preference) {
  a, button, input, select, textarea,
  section[aria-labelledby="four-products"] li,
  section[aria-labelledby="articles"] li { transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease; }
}

@media print {
  header { position: static; }
  nav { overflow: visible; flex-wrap: wrap; }
  body { background: white; }
  section[aria-labelledby="cta"], footer, pre { color: var(--ink); background: white; }
}
