@font-face {
  font-family: 'Fira Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/fonts/fira-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: 'Fira Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/fonts/fira-sans-400-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Fira Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/assets/fonts/fira-sans-500-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Fira Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/assets/fonts/fira-sans-500-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Fira Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/assets/fonts/fira-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: 'Fira Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/assets/fonts/fira-sans-600-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Yanone Kaffeesatz';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/assets/fonts/yanone-kaffeesatz-400-700-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Yanone Kaffeesatz';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/assets/fonts/yanone-kaffeesatz-400-700-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* guides.mmix.biz — «КОРЕШКИ». Токены — закон, см. DESIGN.md */
:root {
  --board: #E6E7E2; --leaf: #F3F4F0; --ink: #1B1E23; --graphite: #555B65; --rule: #C6C8C1; --ribbon: #A8213A; --on-ribbon: #F7F2F2;
  --shadow: 27 30 35;
  --display: "Yanone Kaffeesatz", "Arial Narrow", sans-serif;
  --text: "Fira Sans", "Segoe UI", Roboto, sans-serif;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --gut: clamp(16px, 4vw, 56px);
  --max: 1320px;
  --spine-h: 300px;
  --r: 2px;
  color-scheme: light;
  --rv-accent: var(--ribbon);
}
@media (prefers-color-scheme: dark) {
  :root {
    --board: #16181C; --leaf: #1F2227; --ink: #E7E5E0; --graphite: #A0A6AF; --rule: #353940; --ribbon: #E2607A; --on-ribbon: #1A0E11;
    --shadow: 0 0 0; color-scheme: dark;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--board); color: var(--ink); font: 400 17px/1.6 var(--text); overflow-x: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: .98; letter-spacing: -.005em; margin: 0; }
:focus-visible { outline: 2px solid var(--ribbon); outline-offset: 3px; }
.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: 16px; top: 12px; z-index: 50; background: var(--leaf); padding: 8px 12px; }

/* шапка */
.top { max-width: var(--max); margin: 0 auto; padding: 18px var(--gut); display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--rule); }
.mark { display: inline-flex; align-items: flex-end; gap: 10px; text-decoration: none; font: 600 26px/1 var(--display); }
.mark-sp { display: inline-flex; align-items: flex-end; gap: 2px; height: 24px; }
.mark-sp i { display: block; width: 5px; height: 100%; background: var(--ink); }
.mark-sp i:nth-child(2) { width: 8px; height: 82%; background: var(--ribbon); }
.mark-sp i:nth-child(3) { height: 92%; }
.top-meta { color: var(--graphite); font-size: 14px; letter-spacing: .02em; }

.eyebrow { font: 500 14px/1.3 var(--text); letter-spacing: .08em; text-transform: uppercase; color: var(--graphite); margin: 0 0 14px; }
.lede { font-size: clamp(17px, 1.5vw, 20px); color: var(--graphite); max-width: 60ch; margin: 22px 0 0; }

/* герой главной */
.hero { max-width: var(--max); margin: 0 auto; padding: clamp(32px, 4.5vw, 64px) var(--gut) 24px; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 0 48px; align-items: end; }
.hero .eyebrow { grid-column: 1 / -1; }
.hero h1 { font-size: clamp(60px, 7.6vw, 118px); line-height: .9; font-weight: 700; }
.hero .lede { margin: 0 0 10px; }
.ln { display: block; overflow: hidden; padding-bottom: .04em; }
.ln > span { display: inline-block; }
.js .ln > span { transform: translateY(105%); transition: transform 900ms var(--ease-out); }
.js .ln + .ln > span { transition-delay: 90ms; }
.ready .ln > span { transform: none; }

/* полка */
.shelf-wrap { max-width: var(--max); margin: 0 auto; padding: 12px var(--gut) 0; }
.chips { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 7px 14px 8px; border: 1px solid var(--rule); border-radius: 999px; text-decoration: none; font-size: 15px; line-height: 1.2; color: var(--ink); background: transparent; transition: background-color 200ms, border-color 200ms, color 200ms; }
.chip b { font: 600 15px/1 var(--display); color: var(--graphite); font-size: 17px; }
.chip:hover { border-color: var(--ink); }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--board); }
.chip.on b { color: var(--board); opacity: .75; }
.shelf-scroll { overflow-x: auto; overflow-y: hidden; padding-top: 22px; scrollbar-width: thin; }
.shelf { list-style: none; margin: 0; padding: 0 2px; display: flex; align-items: flex-end; gap: 3px; min-width: 100%; width: max-content; height: calc(var(--spine-h) + 2px); position: relative; }
.shelf-scroll { border-bottom: 12px solid var(--rule); box-shadow: 0 10px 0 -6px rgb(var(--shadow) / .12); }
.sp { flex: var(--p) 1 22px; height: var(--spine-h); }
.sp.g0 { margin-left: 14px; }
.sp.g0:first-child { margin-left: 0; }
.sp a { display: flex; flex-direction: column; justify-content: space-between; align-items: center; height: 100%; padding: 14px 0 10px; text-decoration: none; color: var(--t);
  background: linear-gradient(90deg, rgb(0 0 0 / .22), rgb(255 255 255 / .1) 28%, rgb(0 0 0 / 0) 60%, rgb(0 0 0 / .18)), var(--c);
  box-shadow: inset 0 9px 0 -6px rgb(255 255 255 / .22), inset 0 -40px 0 -37px rgb(255 255 255 / .22);
  border-radius: var(--r) var(--r) 0 0; transition: transform 320ms var(--ease-out), opacity 240ms; }
.sp-t { writing-mode: vertical-rl; transform: rotate(180deg); font: 600 19px/1 var(--display); letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-height: calc(var(--spine-h) - 58px); }
.sp-n { font: 700 15px/1 var(--display); opacity: .8; }
.sp a:hover, .sp a:focus-visible { transform: translateY(-14px); }
.js .sp { transform: translateY(104%); transition: transform 700ms var(--ease-out); transition-delay: calc(var(--i, 0) * 18ms + 250ms); }
.ready .sp { transform: none; }
.shelf[data-f]:not([data-f="all"]) .sp:not(.hit) a { opacity: .22; transform: translateY(22px); }
.shelf[data-f]:not([data-f="all"]) .sp.hit a { transform: translateY(-8px); }
.shelf-note { color: var(--graphite); font-size: 14px; margin: 14px 0 0; }

/* каталог */
.catalog { max-width: var(--max); margin: 0 auto; padding: clamp(40px, 6vw, 80px) var(--gut) 40px; }
.group { margin-bottom: clamp(48px, 6vw, 80px); }
.group[hidden] { display: none; }
.group-h { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--ink); padding-bottom: 10px; margin-bottom: 28px; }
.group-h h2 { font-size: clamp(36px, 4.4vw, 56px); }
.group-h span { color: var(--graphite); font-size: 14px; white-space: nowrap; }
.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 36px 24px; }
.bk a { display: block; text-decoration: none; }
.bk-cv { display: block; position: relative; aspect-ratio: 2 / 3; background: var(--rule); box-shadow: 0 1px 2px rgb(var(--shadow) / .18), 0 10px 22px -12px rgb(var(--shadow) / .45); transition: transform 320ms var(--ease-out), box-shadow 320ms var(--ease-out); }
.bk-cv::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 7%; background: linear-gradient(90deg, rgb(0 0 0 / .28), rgb(255 255 255 / .12) 70%, rgb(0 0 0 / .1)); pointer-events: none; }
.bk-cv img { width: 100%; height: 100%; object-fit: cover; }
.bk a:hover .bk-cv, .bk a:focus-visible .bk-cv { transform: translateY(-6px); box-shadow: 0 2px 4px rgb(var(--shadow) / .2), 0 22px 30px -14px rgb(var(--shadow) / .5); }
.bk-meta { display: block; margin-top: 14px; font: 600 16px/1 var(--display); letter-spacing: .04em; color: var(--graphite); }
.bk-t { display: block; margin-top: 6px; font-size: 15px; line-height: 1.35; }
.bk a:hover .bk-t { text-decoration: underline; text-underline-offset: 3px; }
.js .rv { opacity: 0; transform: translateY(18px); transition: opacity 600ms var(--ease-out), transform 700ms var(--ease-out); transition-delay: calc(var(--d, 0) * 60ms); }
.js .rv.in { opacity: 1; transform: none; }

/* страница книги */
.book { max-width: var(--max); margin: 0 auto; padding: 20px var(--gut) 40px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; color: var(--graphite); margin-bottom: clamp(24px, 4vw, 48px); }
.crumbs a { color: var(--graphite); text-underline-offset: 3px; }
.crumbs a:hover { color: var(--ink); }
.bk-page { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 80px); align-items: start; }
.bk-cover { perspective: 1400px; position: sticky; top: 24px; }
.bk-cover picture { display: block; position: relative; box-shadow: 0 2px 4px rgb(var(--shadow) / .2), 0 30px 50px -24px rgb(var(--shadow) / .6); transform-origin: left center; }
.bk-cover picture::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 6%; background: linear-gradient(90deg, rgb(0 0 0 / .3), rgb(255 255 255 / .14) 70%, rgb(0 0 0 / .1)); }
.js .bk-cover picture { transform: rotateY(-16deg); opacity: 0; transition: transform 1000ms var(--ease-out), opacity 500ms; }
.ready .bk-cover picture { transform: none; opacity: 1; }
.bk-body h1 { font-size: clamp(44px, 5.4vw, 80px); line-height: .95; }
.sub { font-size: clamp(18px, 1.6vw, 21px); color: var(--graphite); margin: 18px 0 0; max-width: 46ch; }
.desc { margin: 28px 0 0; max-width: 62ch; }
.dl { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.btn { display: inline-flex; align-items: baseline; gap: 10px; padding: 14px 22px 15px; border: 1.5px solid var(--ink); border-radius: var(--r); text-decoration: none; font-weight: 500; font-size: 17px; line-height: 1.1; transition: transform 160ms var(--ease-out), background-color 200ms, color 200ms; }
.btn small { font-size: 13px; font-weight: 400; opacity: .75; }
.btn:hover { background: var(--ink); color: var(--board); }
.btn:active { transform: translateY(1px); }
.btn-main { background: var(--ribbon); border-color: var(--ribbon); color: var(--on-ribbon); }
.btn-main:hover { background: var(--ink); border-color: var(--ink); color: var(--board); }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 36px 0 0; border-top: 1px solid var(--rule); }
.facts div { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--rule); }
.facts .wide { grid-column: 1 / -1; }
.facts dt { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--graphite); }
.facts dd { margin: 4px 0 0; font-weight: 500; }
.ext { cursor: pointer; }
.ext-inline { text-decoration: underline; text-underline-offset: 3px; }

/* вкладыш «Помощь по теме книги» с лентой-ляссе */
.help { position: relative; margin: clamp(48px, 7vw, 96px) 0 0; background: var(--leaf); border: 1px solid var(--rule); padding: clamp(24px, 4vw, 48px) clamp(20px, 4vw, 56px); padding-right: clamp(64px, 8vw, 120px); }
.ribbon { position: absolute; top: -14px; right: clamp(20px, 4vw, 48px); width: 30px; height: calc(100% + 34px); background: var(--ribbon); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 16px), 0 100%); transform-origin: top; }
.js .ribbon { transform: scaleY(0); transition: transform 900ms var(--ease-out) 350ms; }
.js .help.in .ribbon { transform: none; }
.help h2 { font-size: clamp(36px, 4vw, 54px); }
.help p { margin: 14px 0 0; max-width: 60ch; color: var(--graphite); }
.help-list { list-style: none; margin: 26px 0 0; padding: 0; border-top: 1.5px solid var(--ink); }
.help-list li { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 24px; padding: 16px 0 15px; border-bottom: 1px solid var(--rule); }
.help-list li:first-child .help-link { font-size: clamp(26px, 2.8vw, 36px); }
.help-topic { color: var(--graphite); font-size: 15px; flex: 1 1 260px; }
.help-link { order: -1; flex: 1 1 100%; font: 600 clamp(22px, 2.2vw, 28px)/1.1 var(--display); text-decoration: none; color: var(--ink); }
.help-link b { display: inline-block; margin-left: 10px; font-weight: 600; color: var(--ribbon); transition: transform 220ms var(--ease-out); }
.help-link:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }
.help-link:hover b { transform: translateX(6px); }

/* где ещё читать */
.where { margin-top: clamp(48px, 6vw, 80px); display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 8px 48px; }
.where h2, .more h2 { font-size: clamp(34px, 3.6vw, 48px); }
.where { grid-template-rows: auto 1fr; }
.where-lede { color: var(--graphite); margin: 10px 0 0; grid-column: 1; align-self: start; }
.where-list { list-style: none; margin: 0; padding: 0; grid-column: 2; grid-row: 1 / span 2; border-top: 1px solid var(--rule); }
.where-list .ext { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; align-items: baseline; gap: 16px; padding: 14px 4px; border-bottom: 1px solid var(--rule); transition: background-color 180ms, padding 220ms var(--ease-out); }
.where-list .ext b { font-weight: 500; }
.where-list .ext span { color: var(--graphite); font-size: 15px; }
.where-list .ext i { font-style: normal; color: var(--ribbon); }
.where-list .ext:hover { background: var(--leaf); padding-left: 12px; }

/* ещё в серии */
.more { margin-top: clamp(56px, 7vw, 96px); }
.more h2 { border-bottom: 1px solid var(--ink); padding-bottom: 10px; margin-bottom: 28px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.more-all { margin: 32px 0 0; }
.more-all a { font-weight: 500; text-underline-offset: 4px; }

/* 404 */
.nf { max-width: var(--max); margin: 0 auto; padding: clamp(60px, 10vw, 140px) var(--gut); }
.nf h1 { font-size: clamp(56px, 8vw, 110px); }
.nf .btn { margin-top: 28px; }

/* подвал */
.foot { border-top: 1px solid var(--rule); margin-top: 40px; }
.foot-in { max-width: var(--max); margin: 0 auto; padding: 28px var(--gut) 90px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px 40px; color: var(--graphite); font-size: 14px; }
.foot-in p { margin: 0; max-width: 70ch; }
.credit { display: inline-flex; align-items: center; gap: 10px; }
.credit a { display: inline-flex; padding: 4px 8px; background: rgb(255 255 255 / .9); border-radius: 4px; }
.credit img { height: 36px; width: auto; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero .lede { margin-top: 20px; }
  .bk-page { grid-template-columns: 1fr; }
  .bk-cover { position: static; max-width: 340px; }
  .where { grid-template-columns: 1fr; }
  .where-list { grid-column: 1; grid-row: auto; margin-top: 18px; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  :root { --spine-h: 236px; }
  .sp { flex: 0 0 var(--w); }
  body { font-size: 16px; }
  .top-meta { display: none; }
  .sp-t { font-size: 16px; }
  .sp-n { font-size: 13px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin-right: calc(-1 * var(--gut)); padding-right: var(--gut); scrollbar-width: none; }
  .chip { white-space: nowrap; }
  .shelf-scroll { margin-right: calc(-1 * var(--gut)); }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 16px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .where-list .ext { grid-template-columns: minmax(0, 1fr) auto; }
  .where-list .ext span { grid-column: 1; grid-row: 2; margin-top: -10px; }
  .where-list .ext i { grid-row: 1 / span 2; }
  .help { padding-right: 60px; }
  .ribbon { right: 16px; width: 24px; }
  .btn { flex: 1 1 100%; justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) {
  .js .ln > span, .js .sp, .js .bk-cover picture, .js .ribbon, .js .rv { transform: none !important; opacity: 1 !important; transition: none !important; }
  .sp a, .bk-cv, .help-link b { transition: none; }
}
