/* docs.mentoriumm.ru — стиль по брендбуку v1 + лендингу v4:
   кремовая бумага, красный знак, чернильный текст, клетка 36px,
   Roboto Condensed (плакатные заголовки), Golos (текст), Plex Mono (номера), Caveat (одна заметка). */
@font-face { font-family: Poster; src: url('fonts/roboto-condensed.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: Golos; src: url('fonts/golos.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: Plex; src: url('fonts/plex-mono.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Hand; src: url('fonts/caveat.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }

:root {
  --paper: #fff4de;
  --bg: #f8f6ed;
  --red: #c92d28;
  --red-dark: #a71b22;
  --ink: #182b3a;
  --muted: #58656e;
  --yellow: #f4c542;
  --green: #26765a;
  --blue: #2355d6;
  --line: #182b3a26;
  --grid: #182b3a08;
  --wrap: 1240px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--bg);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 36px 36px;
  color: var(--ink);
  font: 400 16px/1.6 Golos, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4, p, figure, ul, ol { margin: 0; }
::selection { background: var(--yellow); color: var(--ink); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
.mono { font-family: Plex, ui-monospace, monospace; }
.wrap { width: min(var(--wrap), calc(100% - 48px)); margin-inline: auto; }
.skip { position: fixed; top: 10px; left: 16px; z-index: 50; background: var(--ink); color: var(--paper); padding: 12px 16px; }
.skip:not(:focus) { clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; opacity: 0; }

/* ── шапка ── */
.top { position: sticky; top: 0; z-index: 20; background: #fbf9f2ee; backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; gap: 24px; height: 76px; }
.logo img { height: 30px; width: auto; }
.top-docs { margin-left: auto; font-size: 14px; font-weight: 500; text-decoration: none; }
.top-docs:hover { color: var(--red); }
.btn-line { display: inline-flex; align-items: center; gap: 14px; height: 40px; padding: 0 16px; border: 1px solid var(--ink); border-radius: 3px; font-size: 14px; font-weight: 500; text-decoration: none; transition: background .15s, color .15s; }
.btn-line:hover { background: var(--ink); color: var(--paper); }
.btn { display: inline-flex; align-items: center; gap: 16px; padding: 15px 22px; background: var(--red); color: var(--paper); border-radius: 3px; font-weight: 600; font-size: 15px; text-decoration: none; box-shadow: 5px 5px 0 var(--ink); transition: transform .15s, box-shadow .15s; }
.btn:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--ink); }

/* ── общая верхняя строка ── */
.topline { display: flex; justify-content: space-between; gap: 20px; padding: 26px 0 0; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.topline > span:first-child { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.topline i { width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
.topline .mono { font-size: 10px; text-transform: none; letter-spacing: .02em; color: var(--muted); }

/* ── главная: герой ── */
.hero { overflow: clip; }
.hero-grid { display: grid; grid-template-columns: 1.15fr 1fr; align-items: center; gap: 32px; padding: 28px 0 44px; }
.hero h1, .doc-hero h1 { font-family: Poster, 'Arial Narrow', sans-serif; font-weight: 800; text-transform: uppercase; letter-spacing: -.02em; line-height: 1.02; }
.hero h1 { display: flex; flex-direction: column; align-items: flex-start; font-size: clamp(54px, 7.4vw, 104px); }
.hero h1 strong { white-space: nowrap; font-size: .8em; margin: 14px 0 0 -14px; padding: .02em .22em .08em; background: var(--red); color: var(--paper); transform: rotate(-2.5deg); box-shadow: 7px 7px 0 var(--ink); font-weight: 800; }
.lead { max-width: 520px; margin-top: 34px; font-size: 19px; line-height: 1.5; }
.hero-art { position: relative; justify-self: center; width: min(460px, 100%); }
.hero-art .sun { position: absolute; inset: 12% 2% 0 8%; border-radius: 50%; background: var(--yellow); }
.hero-art .sun::after { content: ''; position: absolute; inset: 14px; border-radius: 50%; border: 1.5px dashed #182b3a40; }
.hero-art img { position: relative; width: 100%; height: auto; }
.hero-art figcaption { position: absolute; right: -4px; top: 18%; font: 700 30px/1 Hand, cursive; color: var(--red); transform: rotate(-8deg); }
.hero-art figcaption::after { content: ''; display: block; height: 3px; margin-top: 6px; background: var(--red); border-radius: 2px; transform: rotate(2deg); }

/* ── главная: карточки ── */
.index-body { padding-bottom: 72px; }
.group { padding-top: 36px; border-top: 1px solid var(--line); margin-top: 8px; }
.group + .group { margin-top: 52px; }
.group h2 { display: flex; align-items: baseline; gap: 14px; font: 800 30px/1.1 Poster, sans-serif; text-transform: uppercase; letter-spacing: -.01em; margin-bottom: 26px; }
.num { font: 400 13px/1 Plex, monospace; color: var(--red); letter-spacing: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 22px; }
.card { position: relative; display: flex; flex-direction: column; gap: 10px; min-height: 212px; padding: 22px 22px 18px; background: var(--paper); border: 1.5px solid var(--ink); border-radius: 4px; box-shadow: 5px 5px 0 var(--ink); text-decoration: none; transition: transform .15s, box-shadow .15s; }
.card:hover { transform: translate(-3px, -3px); box-shadow: 8px 8px 0 var(--red); }
.card-num { font: 400 12px/1 Plex, monospace; color: var(--muted); }
.card-title { font: 750 24px/1.12 Poster, sans-serif; text-transform: uppercase; }
.card-desc { font-size: 14.5px; line-height: 1.5; color: #34434f; }
.card-meta { margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--line); display: flex; justify-content: space-between; align-items: center; font: 400 11px/1 Plex, monospace; color: var(--muted); }
.arrow { font: 600 20px/1 Golos, sans-serif; color: var(--red); transition: transform .15s; }
.card:hover .arrow { transform: translateX(4px); }

/* ── документ: шапка ── */
.doc-hero { border-bottom: 1px solid var(--line); background: linear-gradient(180deg, transparent, #fff4de80); }
.crumbs { margin-top: 30px; font: 400 12px/1 Plex, monospace; color: var(--muted); display: flex; gap: 8px; }
.crumbs a { color: var(--red); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.doc-hero h1 { margin-top: 14px; font-size: clamp(40px, 5.4vw, 72px); max-width: 16ch; }
.official { max-width: 780px; margin-top: 18px; font-size: 16px; line-height: 1.5; color: #34434f; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 22px 0 34px; }
.chips span { padding: 6px 10px; border: 1px solid var(--line); border-radius: 3px; background: var(--paper); font: 400 12px/1 Plex, monospace; }
.chips span:first-child { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ── документ: раскладка ── */
.doc-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 56px; padding: 44px 0 80px; }
.toc details { position: sticky; top: 100px; max-height: calc(100vh - 124px); overflow: auto; }
.toc summary { list-style: none; cursor: default; pointer-events: none; font: 400 11px/1 Plex, monospace; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.toc summary::-webkit-details-marker { display: none; }
.toc ol { list-style: none; padding: 10px 0 0; }
.toc a { display: flex; gap: 10px; padding: 6px 0; font-size: 13.5px; line-height: 1.35; text-decoration: none; color: #34434f; }
.toc a span { flex: 0 0 22px; font: 400 11px/1.6 Plex, monospace; color: var(--red); }
.toc a:hover { color: var(--red); }

.doc { max-width: 780px; font-size: 16.5px; line-height: 1.68; }
.doc > p { margin-bottom: 14px; }
.doc section { padding-top: 34px; }
.doc section:first-of-type { padding-top: 0; }
.doc h2 { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; padding-bottom: 12px; border-bottom: 2px solid var(--ink); font: 800 26px/1.15 Poster, sans-serif; text-transform: uppercase; letter-spacing: -.005em; }
.doc h2 .num { flex: none; }
.doc h3 { margin: 26px 0 12px; font: 700 20px/1.25 Poster, sans-serif; }
.doc h3 .cnum { margin-right: 10px; }
.cnum { font: 400 12.5px/1 Plex, monospace; color: var(--red); white-space: nowrap; }
.clause { position: relative; margin: 0 0 12px; padding-left: 62px; }
.clause .cnum { position: absolute; left: 0; top: .42em; }
.clause.d2 { padding-left: 86px; }
.clause.d2 .cnum { left: 24px; color: var(--muted); }
.clause.d3 { padding-left: 106px; }
.clause.d3 .cnum { left: 34px; color: var(--muted); }
.doc section > p:not(.clause):not(.formula) { margin: 0 0 12px; padding-left: 62px; }
.doc ul { list-style: none; margin: 4px 0 16px; padding-left: 62px; }
.doc li { position: relative; padding-left: 22px; margin-bottom: 6px; }
.doc li::before { content: ''; position: absolute; left: 2px; top: .7em; width: 9px; height: 2px; background: var(--red); }
.doc > ul { padding-left: 0; }
.doc a { color: var(--red-dark); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; overflow-wrap: anywhere; }
.doc a:hover { color: var(--ink); }
.formula { margin: 8px 0 18px 62px !important; padding: 16px 18px !important; background: var(--paper); border: 1.5px solid var(--ink); border-left: 6px solid var(--red); border-radius: 3px; font: 400 14.5px/1.55 Plex, monospace; }

/* реквизиты */
.req-section { position: relative; }
.req-card { position: relative; margin: 66px 0 16px 62px; padding: 22px 24px; background: var(--paper); border: 1.5px solid var(--ink); border-radius: 4px; box-shadow: 5px 5px 0 var(--ink); }
.req-card::before { content: ''; position: absolute; right: 26px; bottom: 100%; width: 150px; height: 110px; background: url('img/mascot-peek.webp') bottom center / contain no-repeat; margin-bottom: -2px; }
.req-name { font: 700 19px/1.3 Poster, sans-serif; margin-bottom: 12px; }
.req-row { display: grid; grid-template-columns: 200px 1fr; gap: 12px; padding: 7px 0; border-top: 1px dashed var(--line); font-size: 15px; }
.req-row span { font: 400 12px/1.9 Plex, monospace; color: var(--muted); }
.req-row b { font-weight: 500; overflow-wrap: anywhere; }
.req-card + .req-card::before { display: none; }
.req-card + .req-card { margin-top: 16px; }

/* листалка */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--line); }
.pager a { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border: 1.5px solid var(--ink); border-radius: 4px; background: var(--paper); text-decoration: none; color: var(--ink); font: 700 18px/1.2 Poster, sans-serif; transition: box-shadow .15s, transform .15s; }
.pager a:hover { box-shadow: 5px 5px 0 var(--red); transform: translate(-2px, -2px); color: var(--ink); }
.pager small { font: 400 11px/1 Plex, monospace; color: var(--muted); }
.pager .next { text-align: right; }

/* ── подвал ── */
.foot { background: var(--ink); color: #e9e2d0; }
.foot-in { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 32px; padding: 56px 0 40px; }
.foot-brand img { height: 28px; width: auto; }
.foot-brand p { margin-top: 16px; max-width: 260px; font-size: 14px; color: #b9c0c4; }
.foot h4 { margin-bottom: 14px; font: 400 11px/1 Plex, monospace; text-transform: uppercase; letter-spacing: .08em; color: var(--yellow); }
.foot ul { list-style: none; padding: 0; }
.foot li { margin-bottom: 8px; font-size: 14px; }
.foot a { text-decoration: none; overflow-wrap: anywhere; }
.foot a:hover { color: var(--yellow); }
.foot-legal { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 18px 0 26px; border-top: 1px solid #ffffff1f; font: 400 11px/1.5 Plex, monospace; color: #9aa4aa; }

/* ── адаптив ── */
@media (max-width: 980px) {
  .doc-layout { grid-template-columns: 1fr; gap: 24px; padding-top: 24px; }
  .toc details { position: static; max-height: none; border: 1.5px solid var(--ink); border-radius: 4px; background: var(--paper); padding: 14px 16px; }
  .toc summary { pointer-events: auto; cursor: pointer; border: 0; padding: 0; display: flex; justify-content: space-between; }
  .toc summary::after { content: '+'; font-size: 16px; color: var(--red); }
  .toc details[open] summary::after { content: '−'; }
  .toc details[open] summary { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
  .foot-in { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .wrap { width: calc(100% - 36px); }
  .top-in { height: 64px; gap: 14px; }
  .logo img { height: 22px; }
  .top-docs { display: none; }
  .btn-line { margin-left: auto; height: 36px; padding: 0 12px; font-size: 13px; }
  .topline .mono { display: none; }
  .hero-grid { grid-template-columns: 1fr; gap: 8px; padding-bottom: 28px; }
  .hero h1 strong { white-space: normal; font-size: 1em; margin-left: -8px; box-shadow: 5px 5px 0 var(--ink); }
  .lead { margin-top: 26px; font-size: 17px; }
  .hero-art { width: min(340px, 88%); justify-self: end; }
  .hero-art figcaption { font-size: 25px; right: auto; left: -18px; top: 8%; }
  .group h2 { font-size: 25px; }
  .doc { font-size: 16px; }
  .doc h2 { font-size: 22px; }
  .clause, .doc section > p:not(.clause):not(.formula), .doc ul { padding-left: 0; }
  .clause .cnum { position: static; display: block; margin-bottom: 2px; }
  .clause.d2, .clause.d3 { padding-left: 14px; border-left: 2px solid var(--line); }
  .formula { margin-left: 0 !important; }
  .req-card { margin-left: 0; padding: 18px; }
  .req-card::before { width: 118px; height: 88px; right: 14px; }
  .req-row { grid-template-columns: 1fr; gap: 0; }
  .pager { grid-template-columns: 1fr; }
  .foot-in { grid-template-columns: 1fr; gap: 26px; padding-top: 44px; }
}
@media print {
  body { background: #fff; font-size: 12pt; }
  .top, .toc, .pager, .foot, .skip, .req-card::before { display: none !important; }
  .doc-layout { display: block; padding: 0; }
  .doc { max-width: none; }
  .doc-hero { background: none; }
  .req-card, .formula { box-shadow: none; }
  a { color: inherit !important; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
.req-card > .req-row:first-child { border-top: 0; }
