/* vharin.ru — «Методичка» */

/* ---------- Шрифты (self-hosted, cyrillic+latin) ---------- */
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(fonts/plex-sans-400-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(fonts/plex-sans-400-latin.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: swap;
  src: url(fonts/plex-sans-600-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: swap;
  src: url(fonts/plex-sans-600-latin.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 700; font-display: swap;
  src: url(fonts/plex-sans-700-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 700; font-display: swap;
  src: url(fonts/plex-sans-700-latin.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Serif'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(fonts/plex-serif-400-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'IBM Plex Serif'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(fonts/plex-serif-400-latin.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(fonts/plex-mono-400-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(fonts/plex-mono-400-latin.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap;
  src: url(fonts/plex-mono-500-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap;
  src: url(fonts/plex-mono-500-latin.woff2) format('woff2'); }

/* ---------- Токены ---------- */
:root {
  --paper: #FFFFFF;
  --ink: #191919;
  --muted: #5C6066;
  --hairline: #E4E2DD;
  --accent: #FFD500;        /* жёлтый 1С */
  --wash: #FAF9F6;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'IBM Plex Serif', Georgia, serif;
  --mono: 'IBM Plex Mono', 'Consolas', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

body {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
}

.page {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 24px 64px;
}

a { color: var(--ink); }
a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- Шапка-документ ---------- */
.doc-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0 14px;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: .04em;
  color: var(--muted);
  text-transform: uppercase;
}

header.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  padding: 40px 0 32px;
}

.hero h1 {
  font-size: clamp(34px, 6vw, 54px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.015em;
}

.hero .role {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--muted);
}

.hero .portrait {
  flex: 0 0 auto;
  width: 132px;
  height: 132px;
  object-fit: cover;
  border-radius: 4px;
  border-bottom: 6px solid var(--accent);
}

.rule-accent {
  height: 8px;
  background: var(--accent);
  border: 0;
}

.lead {
  font-family: var(--serif);
  font-size: clamp(19px, 2.6vw, 23px);
  line-height: 1.55;
  padding: 30px 0 8px;
  max-width: 640px;
}

/* ---------- Разделы-оглавление ---------- */
.toc { margin-top: 26px; }

.section {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 8px 24px;
  padding: 28px 0;
  border-top: 1px solid var(--hairline);
}

.section .num {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  padding-top: 5px;
}

.section h2 {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
}

.section p {
  grid-column: 2;
  color: var(--muted);
  max-width: 560px;
}

.section .links {
  grid-column: 2;
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
}

.section .links a {
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 1px;
  transition: background-color .15s ease;
}

.section .links a:hover { background: var(--accent); }

.section .links .ext {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  align-self: center;
}

/* ---------- Контакты ---------- */
.contact {
  margin-top: 8px;
  border-top: 1px solid var(--hairline);
  padding: 30px 0 0;
  background: transparent;
}

.contact .box {
  background: var(--wash);
  border: 1px solid var(--hairline);
  border-left: 6px solid var(--accent);
  border-radius: 4px;
  padding: 22px 26px;
}

.contact .box .label {
  font-family: var(--mono);
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: 8px;
}

.contact .box p { font-size: 17px; }
.contact .box a { font-weight: 600; }

footer {
  margin-top: 48px;
  padding-top: 18px;
  border-top: 1px solid var(--hairline);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
}

footer a { color: var(--muted); }

/* ---------- Мобильная ---------- */
@media (max-width: 560px) {
  header.hero { flex-direction: column-reverse; align-items: flex-start; padding-top: 8px; }
  .hero .portrait { width: 104px; height: 104px; }
  .section { grid-template-columns: 1fr; }
  .section .num { padding-top: 0; }
  .section p, .section .links { grid-column: 1; }
  .doc-meta span:last-child { display: none; }
}
