:root {
  color-scheme: light;
  --background: #f7f9f8;
  --surface: #ffffff;
  --foreground: #1b211f;
  --muted: #64736f;
  --border: #dde5e2;
  --primary: #16824b;
  --primary-soft: #e8f5ed;
  font-family: "DM Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 84% 6%, rgb(22 130 75 / 10%), transparent 26rem),
    var(--background);
  color: var(--foreground);
  line-height: 1.65;
}

a {
  color: var(--primary);
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 0.12em;
}

a:focus-visible {
  border-radius: 0.25rem;
  outline: 3px solid rgb(22 130 75 / 30%);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 10;
  top: 0.75rem;
  left: 0.75rem;
  transform: translateY(-5rem);
  border-radius: 0.6rem;
  background: var(--foreground);
  color: white;
  padding: 0.65rem 0.9rem;
}

.skip-link:focus {
  transform: translateY(0);
}

.shell {
  width: min(100% - 2rem, 74rem);
  margin-inline: auto;
}

header {
  display: flex;
  min-height: 5.25rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--foreground);
  font-size: 1.1rem;
  font-weight: 750;
  text-decoration: none;
}

.brand img {
  width: 2rem;
  height: 2rem;
}

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 1rem;
  font-size: 0.9rem;
}

.hero {
  padding: clamp(3rem, 8vw, 6.5rem) 0 clamp(2rem, 5vw, 4rem);
}

.eyebrow {
  margin: 0 0 0.8rem;
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin-top: 0;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

h1 {
  max-width: 48rem;
  margin-bottom: 1.1rem;
  font-size: clamp(2.4rem, 7vw, 5rem);
  font-weight: 680;
}

h2 {
  margin-bottom: 0.85rem;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
}

h3 {
  margin-bottom: 0.55rem;
  font-size: 1.05rem;
}

.lede {
  max-width: 49rem;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.2rem);
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.5rem;
}

.pill {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgb(255 255 255 / 70%);
  color: var(--muted);
  padding: 0.35rem 0.7rem;
  font-size: 0.82rem;
}

.layout {
  display: grid;
  gap: 1.25rem;
  padding-bottom: 5rem;
}

.toc,
.content section,
.notice {
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  background: rgb(255 255 255 / 88%);
  box-shadow: 0 18px 55px rgb(19 46 34 / 5%);
}

.toc {
  align-self: start;
  padding: 1.15rem;
}

.toc strong {
  display: block;
  margin-bottom: 0.65rem;
  font-size: 0.9rem;
}

.toc ol {
  display: grid;
  gap: 0.42rem;
  margin: 0;
  padding-left: 1.15rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.content {
  display: grid;
  gap: 1rem;
}

.content section,
.notice {
  padding: clamp(1.3rem, 4vw, 2.1rem);
}

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

.content p,
.content li {
  max-width: 70ch;
}

.content ul {
  padding-left: 1.3rem;
}

.content li + li {
  margin-top: 0.45rem;
}

.notice {
  border-color: rgb(22 130 75 / 25%);
  background: var(--primary-soft);
  box-shadow: none;
}

.ru {
  scroll-margin-top: 1rem;
}

footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0 3rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
}

@media (min-width: 58rem) {
  .layout {
    grid-template-columns: 15rem minmax(0, 1fr);
    align-items: start;
  }

  .toc {
    position: sticky;
    top: 1rem;
  }
}

@media (max-width: 38rem) {
  header {
    align-items: flex-start;
    padding-block: 1rem;
  }

  nav {
    display: grid;
    gap: 0.35rem;
    text-align: right;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
