/* Базовый слой: сетка, шапка, боковое меню, подвал, типографика, проза. */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 150px; }
[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body.is-locked { overflow: hidden; }

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.03em; line-height: 1.05; text-wrap: balance; }
h1 { font-size: 76px; letter-spacing: -0.035em; line-height: 0.98; }
h2 { font-size: 44px; }
h3 { font-size: 21px; letter-spacing: -0.02em; line-height: 1.25; }
h4 { font-size: 18px; letter-spacing: -0.015em; line-height: 1.3; }
p { margin: 0; }

a { color: inherit; text-decoration: none; }
a { transition: color 0.2s var(--ease); }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; display: block; }
::selection { background: var(--ink); color: var(--paper); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.shell { max-width: var(--shell); margin: 0 auto; padding: 0 var(--shell-pad); }
.shell--narrow { max-width: 820px; margin: 0 auto; padding: 0 var(--shell-pad); }

.skip-link { position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--paper); padding: 10px 16px; z-index: 100; }
.skip-link:focus { left: 12px; top: 12px; }

/* ---------- мелкая типографика ---------- */
.eyebrow {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 400;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-2);
}
.eyebrow::after { content: ""; display: none; }
.eyebrow__rule { width: 28px; height: 1px; background: var(--line-strong); flex: none; }
.mono { font-family: var(--font-mono); }

.section-head {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 64px; align-items: end; margin-top: 22px;
}
.section-head p { font-size: 16px; line-height: 1.6; color: var(--ink-2); text-wrap: pretty; }

/* ---------- шапка ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(251, 251, 250, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 32px; padding-block: 10px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand__photo { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; filter: grayscale(1); background: #e9e8e4; flex: none; }
.brand span { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.site-nav { display: flex; align-items: center; gap: 28px; font-size: 14px; color: var(--ink-2); }
.site-nav a[aria-current="page"] { color: var(--ink); }

.burger {
  display: none; width: 40px; height: 40px; padding: 0;
  align-items: center; justify-content: center;
  border: 1px solid var(--line-strong); border-radius: 999px;
  background: transparent; color: var(--ink); cursor: pointer;
}
.burger span { position: relative; display: block; width: 16px; height: 1px; background: currentColor; }
.burger span::before, .burger span::after { content: ""; position: absolute; left: 0; width: 16px; height: 1px; background: currentColor; }
.burger span::before { top: -5px; }
.burger span::after { top: 5px; }

/* ---------- боковое меню ---------- */
.drawer-overlay {
  position: fixed; inset: 0; z-index: 80; background: rgba(20, 22, 26, 0.45);
  opacity: 0; pointer-events: none; transition: opacity 0.22s var(--ease);
}
.drawer-overlay.is-open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; inset: 0 0 0 auto; z-index: 90;
  width: min(86vw, 340px);
  background: var(--paper); border-left: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 8px;
  padding: 22px 24px 28px;
  transform: translateX(100%); transition: transform 0.26s var(--ease);
  overflow-y: auto;
}
.drawer.is-open { transform: translateX(0); }
.drawer__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.drawer__title { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-3); }
.drawer__close {
  width: 36px; height: 36px; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--ink); font-size: 15px; cursor: pointer;
}
.drawer__nav { display: grid; }
.drawer__nav a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 0; border-bottom: 1px solid var(--line);
  font-size: 17px; font-weight: 500; letter-spacing: -0.01em;
}
.drawer__nav a span:last-child { color: var(--muted-3); font-size: 14px; }
.drawer__foot { margin-top: auto; padding-top: 22px; display: grid; gap: 12px; }
.drawer__socials { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; font-size: 14px; color: var(--ink-2); }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 26px; border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-size: 15px; font-weight: 500; cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.btn--ink { background: var(--ink); color: var(--paper); }
.btn--ink:hover { background: var(--accent); color: #fff; }
.btn--ghost { border-color: var(--line-strong); color: var(--ink); }
.btn--ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn--outline-sm { padding: 8px 14px; border: 1px solid var(--ink); border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--ink); }
.btn--outline-sm:hover { background: var(--ink); color: var(--paper); }
.btn--light { background: var(--panel-ink); color: var(--ink); }
.btn--light:hover { background: var(--accent); color: #fff; }
.btn--onpanel { border-color: var(--panel-line); color: var(--panel-ink); }
.btn--onpanel:hover { border-color: var(--panel-ink); color: var(--panel-ink); }
.link-accent { color: var(--accent); }
.link-accent:hover { text-decoration: underline; }

/* ---------- призыв к действию ---------- */
.cta {
  background: var(--panel); color: var(--panel-ink); border-radius: 4px;
  padding: 72px 64px;
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 64px; align-items: end;
}
.cta .eyebrow { color: var(--panel-kicker); }
.cta .eyebrow__rule { background: var(--panel-line); }
.cta h2 { margin-top: 22px; font-size: 46px; max-width: 640px; }
.cta p { margin-top: 20px; max-width: 560px; font-size: 17px; line-height: 1.6; color: var(--panel-muted); text-wrap: pretty; }
.cta__actions { display: flex; flex-direction: column; gap: 10px; }

/* ---------- подвал ---------- */
.site-footer {
  display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
  gap: 48px; padding: 64px 0 56px; margin-top: 64px; border-top: 1px solid var(--line);
}
.site-footer__col { display: flex; flex-direction: column; gap: 10px; font-size: 14px; color: var(--ink-2); min-width: 0; }
.site-footer__col a { overflow-wrap: anywhere; }
.site-footer__label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted-3); }
.site-footer__name { font-size: 16px; font-weight: 600; color: var(--ink); }
.site-footer__role { font-size: 14px; color: var(--muted); }
.site-footer__note { line-height: 1.6; color: var(--muted); }
.site-bottom {
  display: flex; justify-content: space-between; gap: 24px;
  padding-bottom: 48px; font-size: 13px; color: var(--muted-3);
}

/* ---------- проза ---------- */
.prose { display: grid; gap: 1.05em; font-size: 17px; line-height: 1.7; color: var(--ink-1); }
.prose > h2 { margin-top: 0.8em; font-size: 30px; color: var(--ink); }
.prose > h3 { margin-top: 0.4em; font-size: 20px; color: var(--ink); }
.prose ul, .prose ol { margin: 0; padding-left: 1.2em; display: grid; gap: 0.5em; }
.prose li::marker { color: var(--muted-3); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose blockquote { margin: 0; padding: 18px 22px; border-left: 2px solid var(--accent); background: var(--paper-2); }
.prose code { font-family: var(--font-mono); font-size: 0.88em; background: var(--paper-2); border: 1px solid var(--line); padding: 1px 5px; }
.prose hr { border: 0; border-top: 1px solid var(--line); }
/* Таблицы в статьях. Узкий экран не переносит их по словам, поэтому таблица
   прокручивается внутри себя, а не растягивает страницу. */
.prose > table { display: block; overflow-x: auto; width: 100%; border-collapse: collapse; font-size: 15px; }
.prose th, .prose td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.prose th { font-weight: 600; color: var(--ink); white-space: nowrap; border-bottom-color: var(--line-strong); }
.prose td { color: var(--ink-1); }
.prose tbody tr:last-child td { border-bottom: 0; }
.prose pre { margin: 0; padding: 16px 18px; overflow-x: auto; background: var(--paper-2); border: 1px solid var(--line); }
.prose pre code { background: none; border: 0; padding: 0; font-size: 0.86em; }

/* ---------- адаптив ---------- */
@media (max-width: 1140px) {
  :root { --shell-pad: 28px; }
  .section-head { grid-template-columns: minmax(0, 1fr) !important; gap: 24px !important; }
  .cta { grid-template-columns: minmax(0, 1fr) !important; gap: 32px !important; padding: 48px 32px !important; }
  .site-footer { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 36px !important; }
  h1 { font-size: 56px; }
  h2, .cta h2 { font-size: 34px; }
}
@media (max-width: 860px) {
  .burger { display: inline-flex; }
  .site-nav { display: none; }
}
@media (max-width: 640px) {
  :root { --shell-pad: 20px; }
  .site-footer { grid-template-columns: minmax(0, 1fr) !important; }
  .site-bottom { flex-direction: column; gap: 8px; }
  h1 { font-size: 40px; }
  h2, .cta h2 { font-size: 28px; }
  .prose { font-size: 16px; }
}
