/* База: шрифт, контейнер (97, 120) */
/* ===== ЭТАЛОН ШАПКИ: learn.html. Полная спецификация — см. HEADER-ETALON.md =====
   Кратко: --header-bar-height: 35px; --header-width: 1600px;
   Зазор: padding-top: calc(var(--header-bar-height) * 0.05852);
   Полоса: min-height 35px, border-radius 50px, padding calc(0.85*space-20) space-60, background #000;
   Логотип 37×37px; заголовок 18px; меню 18px; кнопки ВАЖНОЕ/НОВОСТИ 18px, padding 0.9px 7.6px, radius 8px, жёлтые;
   Затемнение ::before rgba(0,0,0,0.3); пин/поиск 28×28px, иконки 14×14px.
   ======================================================================== */
:root {
  --font: 'Oswald', sans-serif;
  /* Объём кнопки: блик сверху, тень снизу внутри, «подставка» снаружи */
  --btn-3d: inset 0 2px 0 rgba(255, 255, 255, 0.36), inset 0 -4px 0 rgba(0, 0, 0, 0.14), 0 5px 0 rgba(0, 0, 0, 0.1), 0 10px 22px rgba(0, 0, 0, 0.13);
  --btn-3d-pressed: inset 0 4px 10px rgba(0, 0, 0, 0.2), 0 2px 0 rgba(0, 0, 0, 0.08);
  --color-accent: #e5ba22;
  --header-width: 1600px;
  --header-bar-height: 35px;
  --container: 1200px;
  --space-20: 0.44rem;
  --space-30: 0.67rem;
  --space-40: 1rem;
  --space-50: 1.5rem;
  --space-60: 2.25rem;
  --space-70: 3.38rem;
  --side-link-color: #1a3a5f;
  --side-link-color-border: #0f2744;
}
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}
body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  font-family: var(--font);
  font-size: 22px;
  line-height: 1.5;
  color: #1e1e1e;
  background-color: #f8f4ed;
  overflow-x: hidden;
}
a { color: #1e1e1e; text-decoration: underline; }
a:hover { color: #181818; }
img { max-width: 100%; height: auto; display: block; }
.container {
  width: 100%;
  max-width: var(--container);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-40);
  padding-right: var(--space-40);
}
/* Шапка-эталон с learn.html: полоса 35px, зазор 0.05852, внутренний padding полосы 0.85×space-20 */
.site-header .header-top {
  display: none;
}
.site-header {
  background: transparent;
  padding: 0;
  padding-top: calc(var(--header-bar-height) * 0.05852);
}
.site-header::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: -1;
  pointer-events: none;
}
.site-header .header-main {
  max-width: var(--header-width);
  margin: 0 auto;
  padding: 0 var(--space-40);
}
.site-header .header-bar {
  min-height: clamp(26px, 4vw, var(--header-bar-height));
  box-sizing: border-box;
  background: #000;
  border-radius: 50px;
  padding: 0 var(--space-60);
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: var(--space-40);
}
.site-header .header-logo { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; }
.site-header .header-logo img { width: 37px; height: 37px; }
.site-header .header-logo a { text-decoration: none; }
.site-header .site-title { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.05; text-transform: uppercase; color: var(--color-accent); }
.site-header .site-title a { color: inherit; text-decoration: none; }
.site-header .nav-menu { flex: 1 1 auto; min-width: 0; }
.site-header .nav-menu ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: nowrap; align-items: center; gap: 1rem; justify-content: flex-end; }
.site-header .nav-menu ul li { flex-shrink: 1; min-width: 0; display: flex; align-items: center; }
.site-header .nav-menu a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: clamp(12px, 1.8vw, 18px);
  line-height: 1.05;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.site-header .nav-menu a:hover,
.site-header .nav-menu a.nav-current { color: var(--color-accent); }
.site-header .header-cta { flex-shrink: 1; min-width: 0; }
.site-header .site-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: min(100%, 360px); }
.header-search { flex: 0 0 auto; }
.search-form { display: flex; align-items: center; }
.search-form input[type="search"] { width: 0; padding: 0; border: none; border-radius: 50px; transition: width 0.2s; }
.search-form.is-open input[type="search"] { width: 180px; padding: 8px 16px; margin-right: 8px; border: 1px solid #ccc; }
.search-form .search-toggle { border: none; border-radius: 50%; background: #d9d9d9; color: var(--color-accent); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: box-shadow 0.15s ease; }
.search-form .search-toggle:active { box-shadow: inset 2px 2px 4px rgba(0, 0, 0, 0.25); }
.btn { display: inline-block; padding: 15px 30px; font-family: var(--font); font-weight: 700; text-align: center; text-decoration: none; border-radius: 50px; border: 2px solid currentColor; cursor: pointer; letter-spacing: 1px; box-shadow: var(--btn-3d); transition: box-shadow 0.15s ease, transform 0.2s ease, filter 0.2s ease; }
.btn:hover { transform: scale(1.1); }
.btn:active { box-shadow: var(--btn-3d-pressed); transform: scale(1.05) translateY(2px); }
.btn.btn-accent:hover { transform: scale(1.1); filter: brightness(0.9); }
/* Боковая кнопка: белый фон, тёмная обводка, скруглённые углы */
.btn.btn-bokovaya {
  background: #fff;
  color: #1e1e1e;
  border: 2px solid #1a1a2e;
  text-decoration: none;
}
.btn.btn-bokovaya:hover {
  filter: brightness(0.96);
  border-color: #0d0d14;
}
.btn.btn-bokovaya:active {
  box-shadow: var(--btn-3d-pressed);
  transform: translateY(2px);
}
.banner {
  background-color: #f8f4ed;
  margin-top: 0;
  position: relative;
  min-height: 720px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center top;
  color: #fff;
}
.banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  pointer-events: none;
}
.banner-inner { position: relative; z-index: 1; text-align: center; padding: var(--space-60); max-width: var(--container); margin: 0 auto; }
.banner-subtitle { margin: 0 0 0.25rem; font-size: clamp(14px, 2.5vw, 20px); font-weight: 500; color: #e5ba22; text-transform: uppercase; letter-spacing: 0.15em; text-shadow: 0 0 12px rgba(229, 186, 34, 0.5); }
/* Линия под подзаголовком «ЗДЕСЬ РАЗВИВАЮТ…»: от «з» до «а», цвет как буквы, пробегает после остановки анимации */
.banner-subtitle-wrap { display: inline-block; text-align: center; margin-bottom: 0.5rem; }
.banner-subtitle-line {
  height: 2px;
  background: #e5ba22;
  width: 0;
  margin: 0.25rem 0 0;
  box-shadow: 0 0 8px rgba(229, 186, 34, 0.4);
}
.banner-content.animated .banner-subtitle-line {
  animation: subtitle-line 0.6s cubic-bezier(0.22, 1, 0.36, 1) 3.5s both;
}
@keyframes subtitle-line {
  from { width: 0; }
  to { width: 100%; }
}
.banner .page-title { margin: 0 0 0.44rem; font-size: clamp(28px, 5vw, 65px); font-weight: 500; color: #fff; text-transform: uppercase; }
.banner .banner-title { margin: 0 0 0.44rem; font-size: clamp(34px, 6vw, 78px); font-weight: 300; color: #fff; text-transform: uppercase; }
.banner .page-lead { margin: 0 0 var(--space-40); color: rgba(255,255,255,0.9); font-size: 18px; }
body:not(.page-index) .banner .page-lead { font-size: 1.3em; }
.banner-tag-wrap { margin-bottom: 0.5rem; display: inline-block; text-align: center; }
.banner-title.glow,
.page-lead.glow {
  text-shadow: 0 0 20px rgba(229, 186, 34, 0.8), 0 0 40px rgba(229, 186, 34, 0.5);
}
.banner-buttons { margin-top: var(--space-50); }
/* Кнопка баннера на главной: серая, заглавный текст */
.page-index .banner-buttons .btn.btn-banner {
  display: inline-block;
  padding: 10px 22px;
  font-size: 0.81em;
  border-radius: 8px;
  background: #6b7280;
  color: #000;
  border: 2px solid #5b6170;
  text-transform: uppercase;
  font-weight: 400;
  letter-spacing: 0.05em;
  box-shadow: var(--btn-3d), -1px -1px 2px rgba(255, 255, 255, 0.12), 2px 2px 4px rgba(0, 0, 0, 0.18);
  transition: box-shadow 0.15s ease, filter 0.15s ease;
}
.page-index .banner-buttons .btn.btn-banner:hover {
  color: #fff;
  filter: brightness(1.1);
}
.page-index .banner-buttons .btn.btn-banner:active {
  filter: brightness(0.85);
  box-shadow: var(--btn-3d-pressed);
  transform: translateY(2px);
}
.btn-row { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }
.section-telegram {
  text-align: center;
  padding: var(--space-70) var(--space-40);
  background: #f8f4ed;
}
.page-main { padding: var(--space-70) 0; min-height: 20vh; }
.site-footer {
  background: #000;
  color: #fff;
  padding: var(--space-70) 0 0;
  --footer-marquee-duration: 31s;
}
.site-footer .footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--space-40);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-60);
  position: relative;
}

/* Бегущая строка в подвале (над «Клуб быстрых, умных и точных») */
.site-footer .footer-marquee {
  position: absolute;
  left: 0;
  right: 0;
  top: -42px;
  overflow: hidden;
  border-radius: 14px;
  padding: 10px 12px;
  background: #000;
  border: 0;
  box-shadow: none;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.site-footer .footer-marquee__label {
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-accent, #e5ba22);
  white-space: nowrap;
  line-height: 1.1;
}
.site-footer .footer-marquee__viewport {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  contain: paint;
}
.site-footer .footer-marquee__track {
  display: inline-flex;
  align-items: center;
  gap: 42px;
  white-space: nowrap;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  animation-name: footer-marquee-scroll;
  animation-duration: var(--footer-marquee-duration);
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
.site-footer .footer-marquee__text {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
  line-height: 1.1;
}
.site-footer .footer-marquee__paren {
  font-size: 0.875em;
  color: var(--color-accent, #e5ba22);
  line-height: inherit;
  vertical-align: baseline;
}
@keyframes footer-marquee-scroll {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-50%, 0, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .site-footer .footer-marquee__track { animation: none; }
}
@media (max-width: 768px) { .site-footer .footer-inner { grid-template-columns: 1fr; } }
.site-footer .footer-brand h1 { margin: 0 0 0.67rem; font-size: 28px; font-weight: 500; text-transform: uppercase; }
.site-footer .footer-brand h1 a { color: inherit; text-decoration: none; }
.site-footer .footer-brand p { margin: 0 0 var(--space-50); opacity: 0.9; max-width: 360px; }
.site-footer .footer-col h3 { font-size: 26px; font-weight: 600; margin: 0 0 var(--space-50); }
.site-footer .footer-col ul { list-style: none; margin: 0; padding: 0; }
.site-footer .footer-col li { margin-bottom: 0.44rem; }
.site-footer .footer-col a { color: inherit; text-decoration: none; }
.site-footer .footer-col a:hover { color: var(--color-accent); }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
@media (max-width: 900px) {
  .site-header .header-bar {
    flex-direction: row;
    align-items: center;
    text-align: left;
    padding: 0 var(--space-40);
    gap: var(--space-20);
  }
  .site-header .header-logo img {
    width: 30px;
    height: 30px;
  }
  .site-header .site-title {
    font-size: 14px;
  }
  .site-header .nav-menu a,
  .site-header .nav-entry-link {
    font-size: 14px;
    letter-spacing: 0.06em;
  }
  .header-cta .btn {
    padding: 4px 12px;
    font-size: 14px;
    border-radius: 10px;
  }
  .search-form.is-open input[type="search"] {
    width: 140px;
  }
}

/* Шапка: тонкая, поверх контента, закрепление по клику — эталон learn.html */
.site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 120;
  padding-top: calc(var(--header-bar-height) * 0.05852 + var(--header-bar-height) * 0.1) !important;
}
body.header-pinned .site-header {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
}
.site-header .header-bar {
  position: relative;
}

/* ==========================================================================
   Reading progress bar (under header)
   ========================================================================== */
:root {
  --reading-progress-top: 0px;
  --reading-progress-height: 2px;
}
.reading-progress-container {
  position: fixed;
  left: 0;
  top: var(--reading-progress-top);
  width: 100%;
  height: var(--reading-progress-height);
  background: transparent;
  z-index: 10000;
  pointer-events: none;
}
.reading-progress-bar {
  height: 100%;
  width: 0%;
  background: #2e7d32;
  transition: width 0.05s linear;
}
@media (prefers-reduced-motion: reduce) {
  .reading-progress-bar { transition: none; }
}

/* В шапке: при наведении на «вступить» через 1 с показывается «войти», переход 0.2 с (148) */
.site-header .nav-entry-link {
  position: relative;
  display: inline-block;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 18px;
  line-height: 1.05;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: text-shadow 0.3s ease;
}
.site-header .nav-entry-link:hover {
  color: var(--color-accent);
}
.site-header .nav-entry-link .nav-entry-default,
.site-header .nav-entry-link .nav-entry-hover {
  transition: opacity 0.2s ease;
}
.site-header .nav-entry-link .nav-entry-hover {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  pointer-events: none;
}
.site-header .nav-entry-link.hover-active .nav-entry-default {
  opacity: 0;
}
.site-header .nav-entry-link.hover-active .nav-entry-hover {
  opacity: 1;
}
.site-header .nav-entry-link.nav-entry-glow {
  text-shadow: 0 0 20px rgba(229, 186, 34, 0.8), 0 0 40px rgba(229, 186, 34, 0.5);
  transition: text-shadow 0.3s ease;
}
/* Мигание «вступить» при показе тултипа «Доступно только членам клуба» */
.site-header .nav-entry-link.nav-entry-blink .nav-entry-default {
  animation: nav-entry-blink 1.5s ease-in-out 1;
}
@keyframes nav-entry-blink {
  0%, 100% { color: #fff; }
  16.67% { color: var(--color-accent); }
  33.33% { color: #fff; }
  50% { color: var(--color-accent); }
  66.67% { color: #fff; }
  83.33% { color: var(--color-accent); }
}

/* Мерцание ссылок на книги при наведении (1 мягкое мигание за 1 с) */
.book-link-highlight {
  color: #1a3a5f;
  font-weight: 700;
  text-decoration: none;
}
.book-link-highlight:hover {
  animation: book-link-blink 1s ease-in-out 1;
}
@keyframes book-link-blink {
  0%, 100% {
    color: #1a3a5f;
    text-shadow: none;
  }
  50% {
    color: #4a6a9f;
    text-shadow: 0 0 12px rgba(26, 58, 95, 0.5);
  }
}

/* Кнопки в шапке — эталон: 8px radius, 18px, компактный padding (48, 143) */
.site-header .header-cta .btn {
  padding-top: 0.9px !important;
  padding-bottom: 0.9px !important;
  padding-left: 7.6px !important;
  padding-right: 7.6px !important;
  font-size: 18px !important;
  border-radius: 8px !important;
  transition: box-shadow 0.15s ease;
}
.site-header .header-cta .btn:active {
  box-shadow: var(--btn-3d-pressed), 0 0 0 1px rgba(0, 0, 0, 0.25);
  transform: translateY(2px);
}
/* В шапке ВАЖНОЕ и НОВОСТИ всегда жёлтые (как на learn.html), в т.ч. на главной */
.site-header .header-cta .btn.btn-accent {
  color: #000 !important;
  background: var(--color-accent, #e5ba22) !important;
  border-color: var(--color-accent, #e5ba22) !important;
  box-shadow: var(--btn-3d), 0 0 0 1px rgba(0, 0, 0, 0.25) !important;
}
.site-header .header-cta .btn.btn-accent:hover {
  opacity: 0.95;
}
.site-header .header-cta {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 0.35rem !important;
}
.site-header .header-cta .header-pin-btn,
.site-header .header-cta .header-search,
.site-header .header-cta .btn {
  flex-shrink: 0;
}
.site-header .header-search .search-form {
  display: flex;
  align-items: center;
}
.site-header .header-pin-btn,
.site-header .search-form button,
.site-header .search-form .search-toggle {
  width: 28px !important;
  height: 28px !important;
  flex-shrink: 0;
}
.site-header .search-form button:active,
.site-header .search-form .search-toggle:active {
  box-shadow: inset 2px 2px 4px rgba(0, 0, 0, 0.25);
}
.site-header .header-pin-btn svg,
.site-header .search-form button svg,
.site-header .search-form .search-toggle svg {
  width: 14px !important;
  height: 14px !important;
}
.site-header .header-cta {
  margin-left: auto;
  align-items: center;
}

/* Два мигания «ВАЖНОЕ» через 2 с после загрузки (не главная — там своя логика в index.html) */
@keyframes header-important-blink-twice {
  0%, 100% {
    filter: brightness(1);
    box-shadow: var(--btn-3d), 0 0 0 1px rgba(0, 0, 0, 0.25) !important;
  }
  25% {
    filter: brightness(1.5);
    box-shadow: var(--btn-3d), 0 0 0 1px rgba(0, 0, 0, 0.25), 0 0 26px 6px rgba(229, 186, 34, 0.98), 0 0 48px 10px rgba(255, 220, 120, 0.45) !important;
  }
  50% {
    filter: brightness(1);
    box-shadow: var(--btn-3d), 0 0 0 1px rgba(0, 0, 0, 0.25) !important;
  }
  75% {
    filter: brightness(1.5);
    box-shadow: var(--btn-3d), 0 0 0 1px rgba(0, 0, 0, 0.25), 0 0 26px 6px rgba(229, 186, 34, 0.98), 0 0 48px 10px rgba(255, 220, 120, 0.45) !important;
  }
}
body:not(.page-index) .site-header .header-cta > a[href="important.html"].btn.btn-accent {
  animation: header-important-blink-twice 1.4s ease-in-out 2s 1 both;
}
@media (prefers-reduced-motion: reduce) {
  body:not(.page-index) .site-header .header-cta > a[href="important.html"].btn.btn-accent {
    animation: none;
  }
}

/* Плашка «ДОСТУПНО» под кнопками форматов книг (мигание как «ВАЖНОЕ») */
@keyframes book-format-badge-blink-twice {
  0%, 100% {
    filter: brightness(1);
    box-shadow: 0 0 0 1px rgba(229, 186, 34, 0.35);
  }
  25% {
    filter: brightness(1.5);
    box-shadow: 0 0 0 1px rgba(229, 186, 34, 0.9), 0 0 26px 6px rgba(229, 186, 34, 0.98), 0 0 48px 10px rgba(255, 220, 120, 0.45);
  }
  50% {
    filter: brightness(1);
    box-shadow: 0 0 0 1px rgba(229, 186, 34, 0.35);
  }
  75% {
    filter: brightness(1.5);
    box-shadow: 0 0 0 1px rgba(229, 186, 34, 0.9), 0 0 26px 6px rgba(229, 186, 34, 0.98), 0 0 48px 10px rgba(255, 220, 120, 0.45);
  }
}
.book-format-available {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  vertical-align: middle;
}
.book-format-available::after {
  content: 'ДОСТУПНО';
  display: inline-block;
  padding: 6px 10px;
  border-radius: 14px;
  border: 2px solid rgba(229, 186, 34, 0.9);
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
  pointer-events: none;
  box-sizing: border-box;
  opacity: 1;
}
.book-format-available:hover::after,
.book-format-available:focus-within::after {
  animation: book-format-badge-blink-twice 1.4s ease-in-out 0.5s 1 both;
}
@media (prefers-reduced-motion: reduce) {
  .book-format-available:hover::after,
  .book-format-available:focus-within::after {
    animation: none;
  }
}

/* Мигание САМИХ кнопок форматов (темнее, чем «ВАЖНОЕ») */
@keyframes book-format-button-blink-twice-darker {
  0%, 100% {
    filter: brightness(1);
    box-shadow: var(--btn-3d), 0 0 0 1px rgba(0, 0, 0, 0.25) !important;
  }
  25% {
    filter: brightness(1.5);
    box-shadow: var(--btn-3d),
      0 0 0 1px rgba(0, 0, 0, 0.25),
      0 0 26px 6px rgba(137, 112, 20, 0.98),
      0 0 48px 10px rgba(153, 132, 72, 0.45) !important;
  }
  50% {
    filter: brightness(1);
    box-shadow: var(--btn-3d), 0 0 0 1px rgba(0, 0, 0, 0.25) !important;
  }
  75% {
    filter: brightness(1.5);
    box-shadow: var(--btn-3d),
      0 0 0 1px rgba(0, 0, 0, 0.25),
      0 0 26px 6px rgba(137, 112, 20, 0.98),
      0 0 48px 10px rgba(153, 132, 72, 0.45) !important;
  }
}
.book-format-buttons .book-format-link-live.book-format-link-blink.btn.btn-accent {
  animation: book-format-button-blink-twice-darker 1.4s ease-in-out 0.5s 1 both;
}
@media (prefers-reduced-motion: reduce) {
  .book-format-buttons .book-format-link-live.book-format-link-blink.btn.btn-accent {
    animation: none;
  }
}

/* Единый вид кнопок как ВАЖНОЕ — на всех страницах кроме главной (154) */
body:not(.page-index) .btn.btn-accent {
  font-family: var(--font) !important;
  font-size: 18px !important;
  font-weight: 700;
  color: #000 !important;
  background: var(--color-accent, #e5ba22) !important;
  border: 2px solid var(--color-accent, #e5ba22) !important;
  border-radius: 8px !important;
  box-shadow: var(--btn-3d), 0 0 0 1px rgba(0, 0, 0, 0.25) !important;
  text-decoration: none;
}
body:not(.page-index) .btn.btn-accent:hover {
  opacity: 0.95;
  box-shadow: var(--btn-3d), 0 0 0 1px rgba(0, 0, 0, 0.4) !important;
}
body:not(.page-index) .btn.btn-accent:active {
  box-shadow: var(--btn-3d-pressed), 0 0 0 1px rgba(0, 0, 0, 0.25) !important;
  transform: translateY(2px);
}
body:not(.page-index) .page-content .btn.btn-accent,
body:not(.page-index) .banner .btn.btn-accent,
body:not(.page-index) .form-submit .btn.btn-accent,
body:not(.page-index) .why-buttons .btn.btn-accent,
body:not(.page-index) .banner-buttons .btn.btn-accent,
body:not(.page-index) .kids-buttons .btn.btn-accent {
  padding: 8px 16px !important;
}
body:not(.page-index) .form-submit .btn.btn-accent {
  padding: 8px 16px !important;
  width: 100%;
}
body:not(.page-index) .fixed-buttons .btn.btn-accent {
  font-size: 12.65px !important;
  padding: 4px 12px !important;
}

/* Кнопка закрепления шапки: выпуклая (шапка не закреплена) / вжатая (шапка закреплена) (100) */
.header-pin-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-accent, #e5ba22);
  color: #000;
  border: 2px solid var(--color-accent, #e5ba22);
  /* Выпуклая: свет по верхнему-левому краю, тень снизу-справа */
  box-shadow: -1px -1px 2px rgba(255, 255, 255, 0.5), 2px 2px 4px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  flex-shrink: 0;
  transition: box-shadow 0.2s ease, opacity 0.2s ease;
  padding: 0;
}
.header-pin-btn:hover {
  opacity: 0.95;
}
.header-pin-btn:active {
  box-shadow: inset 2px 2px 4px rgba(0, 0, 0, 0.35), inset -1px -1px 1px rgba(255, 255, 255, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.25);
}
.header-pin-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}
/* Вжатая: когда шапка закреплена */
body.header-pinned .header-pin-btn {
  box-shadow: inset 2px 2px 4px rgba(0, 0, 0, 0.35), inset -1px -1px 1px rgba(255, 255, 255, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.25);
  opacity: 0.95;
}
body.header-pinned .header-pin-btn:hover {
  box-shadow: inset 2px 2px 4px rgba(0, 0, 0, 0.4), inset -1px -1px 1px rgba(255, 255, 255, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.3);
}
body.header-pinned .header-pin-btn:active {
  box-shadow: inset 3px 3px 5px rgba(0, 0, 0, 0.45), inset -1px -1px 1px rgba(255, 255, 255, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.25);
}

/* Соцсети в подвале (99) */
.site-footer .social-links {
  list-style: none;
  margin: var(--space-30, 0.67rem) 0 0;
  padding: 0;
  display: flex;
  gap: 0.5rem;
}
.site-footer .social-links a {
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 0.5rem;
  font-weight: 600;
  font-size: 1rem;
  transition: transform 0.2s ease, color 0.2s ease;
}
.site-footer .social-links a:hover {
  color: #e67e22;
  transform: scale(1.15);
}
.site-footer .social-links svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}
.site-footer .social-links a.social-vk-green {
  color: #4caf50;
}
.site-footer .social-links a.social-vk-green:hover {
  color: #e67e22;
  transform: scale(1.15);
}

/* Заголовки и кнопки в контенте — печатными (47, 51) */
.page-title {
  text-transform: uppercase;
}
.page-content .btn {
  text-transform: uppercase;
}

/* Шрифт как у кнопки «Зачем мне все это» — для всех кнопок контента и баннеров, кроме шапки, подвала, Назад/Вверх */
.banner .btn,
.page-content .btn,
.section-telegram .btn,
.form-submit .btn {
  font-size: 0.81em;
  font-weight: 400;
  letter-spacing: 0.05em;
}

/* Расстояние между кнопками в баннере: на 50% больше (базовый зазор 1rem → 1.5rem) */
.banner-inner p .btn {
  margin-left: 0.75rem;
  margin-right: 0.75rem;
}
.banner-inner p .btn:first-child {
  margin-left: 0;
}
.banner-inner p .btn:last-child {
  margin-right: 0;
}

/* Анимация появления: слова плавно поднимаются снизу вверх (19, 29, 32–34, 57) */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translate3d(0, 173px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}
.wow {
  visibility: hidden;
}
.wow.animated {
  visibility: visible;
  animation-duration: 3.5s;
  animation-fill-mode: both;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}
.wow.animated.fadeInUp {
  animation-name: fadeInUp;
}
@media (prefers-reduced-motion: reduce) {
  .wow.animated {
    animation: none;
    visibility: visible;
  }
}

/* Полоска под «Клуб быстрых, умных и точных» в шапке — раз в 30 с, старт через 20 с (58, 61, 65).
   Полоска вне потока, чтобы высота блока = только заголовок и текст меню совпадал по вертикали с навигацией. */
.site-title-wrap {
  display: inline-block;
  text-align: left;
  position: relative;
}
.site-title-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 1.5px;
  background: var(--color-accent);
  width: 0;
  margin: 0;
  opacity: 1;
  animation: header-title-line 30s ease-in-out 20s infinite;
}
@keyframes header-title-line {
  0% { width: 0; opacity: 1; }
  3.33% { width: 100%; opacity: 1; }
  5% { width: 100%; opacity: 0; }
  6.66% { width: 0; opacity: 0; }
  100% { width: 0; opacity: 0; }
}

/* Лампочка в шапке: раз в минуту золотистый свет (107, 113, 114) */
.site-header .header-logo > a {
  position: relative;
  display: inline-flex;
  overflow: visible;
}
.site-header .header-logo > a::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 0 18px 8px rgba(229, 186, 34, 0.5);
  opacity: 0;
  animation: header-lamp 60s ease-in-out 0s infinite;
  clip-path: circle(42% at 50% 50%);
}
@keyframes header-lamp {
  0%, 1% { opacity: 0; }
  1.8% { opacity: 0.95; }
  2.2% { opacity: 0.5; }
  2.6% { opacity: 0.8; }
  3% { opacity: 0.4; }
  3.4% { opacity: 0.65; }
  3.8% { opacity: 0.35; }
  4.2% { opacity: 0.5; }
  4.6% { opacity: 0.25; }
  5.5% { opacity: 0.12; }
  7% { opacity: 0.04; }
  8% { opacity: 0; }
  8.001%, 100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .site-header .header-logo a::after {
    animation: none;
    opacity: 0;
  }
}

/* Боковые ссылки слева и справа от текста: заголовки статей, тёмно-синий, hover +15% и обводка на 25% темнее */
.content-with-sides {
  display: grid;
  grid-template-columns: 1fr minmax(0, 720px) 1fr;
  gap: var(--space-60);
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-40);
  align-items: start;
}
.content-with-sides > .container.page-content {
  grid-column: 2;
}
.content-with-sides > .side-links-right {
  grid-column: 3;
}
.content-with-sides > .side-links-left {
  grid-column: 1;
}
.side-links-left {
  text-align: right;
}
body:not(.page-index) .side-links-left .side-link:hover {
  transform: scale(1.15);
  box-shadow: 0 0 0 1px var(--side-link-color-border);
  border-color: var(--side-link-color-border);
}
body:not(.page-index) .side-links-left .side-link.active {
  box-shadow: 0 0 0 1px var(--side-link-color-border);
  border-color: var(--side-link-color-border);
}
body:not(.page-index) .side-links-right .side-link {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.5s ease, color 0.5s ease;
}
body:not(.page-index) .side-links-right .side-link:hover {
  background: var(--color-accent, #e5ba22);
  color: #000;
  border-color: var(--color-accent, #e5ba22);
  transform: scale(1.15);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
}
.side-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-40);
}
.side-links-right {
  text-align: left;
}
.side-link {
  display: inline-block;
  font-size: 1rem;
  font-weight: 600;
  color: var(--side-link-color);
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  padding: 0.35rem 0.5rem;
  border: 1px solid transparent;
  border-radius: 6px;
}
.side-link:hover {
  transform: scale(1.15);
  box-shadow: 0 0 0 1px var(--side-link-color-border);
  border-color: var(--side-link-color-border);
}
/* Переключатели разделов: кнопка вместо <a href="#"> — те же размеры, что у .side-link (без font: inherit — иначе тянется 22px с body) */
.side-links-left button.side-link {
  appearance: none;
  -webkit-appearance: none;
  display: inline-block;
  margin: 0;
  padding: 0.35rem 0.5rem;
  border: 1px solid transparent;
  border-radius: 6px;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--side-link-color);
  text-align: inherit;
  cursor: pointer;
  background: transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
/* Постоянная рамка (как на systemic-thinking-kids: «Начать учиться») */
body:not(.page-index) .side-links-left .side-link.side-link-framed,
body:not(.page-index) .side-links-right .side-link.side-link-framed {
  border-color: var(--side-link-color-border, #0f2744);
  box-shadow: 0 0 0 1px rgba(15, 39, 68, 0.28);
}
@media (max-width: 900px) {
  .content-with-sides {
    grid-template-columns: 1fr;
  }
  .content-with-sides > .container.page-content,
  .content-with-sides > .side-links-right,
  .content-with-sides > .side-links-left {
    grid-column: 1;
  }
  .side-links-left {
    text-align: left;
  }
  .side-links-right {
    text-align: left;
  }
  .side-links {
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--space-20);
  }
}

/* Контент: max-width 720px, выравнивание по ширине (88) */
.page-content {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}
.page-content,
.page-content p,
.page-content .article-body,
.page-content .article-body p {
  text-align: justify;
}
.page-content .page-title,
.page-content h2 {
  text-align: center;
}
.banner .page-title {
  text-align: left;
}
.page-content .why-text p { margin: 0 0 1rem; }
.page-content .why-text h3 { margin: 1.5rem 0 0.5rem; font-size: 1.1em; font-weight: 600; text-transform: none; }
.page-content .why-text ul { margin: 1rem 0; padding-left: 1.5rem; }
.page-content .why-text li { margin-bottom: 0.25rem; }
.page-content-image { margin: 0 0 1.5rem; }
.page-content-image img { max-width: 100%; height: auto; display: block; border-radius: 8px; }
.banner-inner {
  text-align: center;
}
.banner-inner .page-title {
  text-align: center;
}

/* Подвал: приглушённый тон, текст по центру (полоса и текст уменьшены на 50%) */
.site-footer .footer-bottom {
  background-color: #c9a227 !important;
  color: #1e1e1e !important;
  text-align: center;
  padding: 0.5rem 0.75rem;
  margin-top: 0;
  font-size: 0.5em;
}
.site-footer .footer-bottom p {
  margin: 0;
}

/* Страницы без блоков текста: картинка до подвала (95) */
body.banner-to-footer {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
body.banner-to-footer .banner {
  flex: 1 1 auto;
  min-height: 720px;
}
body.banner-to-footer .page-main {
  flex: 0 0 auto;
  min-height: 0;
  padding-top: 0;
  padding-bottom: 0;
}

/* Кнопки «Вернуться» и «Наверх» — внизу слева, на всех кроме главной (62, 67, 68, 73, 79, 87) */
.fixed-buttons {
  position: fixed;
  top: auto !important;
  bottom: 24px !important;
  left: 24px !important;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
}
.fixed-buttons .fixed-return,
a.fixed-return {
  position: static;
  display: inline-block;
  border-radius: 16px;
  padding: 4px 12px;
  font-size: 12.65px;
  font-weight: 700;
  color: #000;
  background: var(--color-accent, #e5ba22);
  border: 2px solid var(--color-accent, #e5ba22);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
  text-decoration: none;
  flex-shrink: 0;
}
.fixed-buttons .fixed-return:hover,
a.fixed-return:hover {
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4);
  opacity: 0.95;
}
.fixed-buttons .fixed-return:active,
a.fixed-return:active {
  box-shadow: inset 2px 2px 4px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.25);
}
.fixed-buttons .fixed-return,
a.fixed-return {
  transition: box-shadow 0.15s ease, opacity 0.2s ease;
}
.scroll-to-top {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-accent, #e5ba22);
  color: #000;
  border: 2px solid var(--color-accent, #e5ba22);
  box-shadow: -1px -1px 2px rgba(255, 255, 255, 0.5), 2px 2px 4px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.25);
  text-decoration: none;
  flex-shrink: 0;
  transition: box-shadow 0.15s ease, opacity 0.2s ease;
}
.scroll-to-top:hover {
  opacity: 0.95;
  box-shadow: -1px -1px 2px rgba(255, 255, 255, 0.5), 2px 2px 4px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.4);
}
.scroll-to-top:active {
  box-shadow: inset 2px 2px 4px rgba(0, 0, 0, 0.35), inset -1px -1px 1px rgba(255, 255, 255, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.25);
}
.scroll-to-top svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Кнопка музыки — справа внизу; при паре с «Наверх» музыка ниже */
.fixed-buttons-right {
  position: fixed;
  top: auto !important;
  bottom: 24px !important;
  right: 24px !important;
  left: auto !important;
  z-index: 100;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 8px;
}
.music-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: var(--color-accent, #e5ba22);
  color: #000;
  box-shadow: -1px -1px 2px rgba(255, 255, 255, 0.5), 2px 2px 4px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  flex-shrink: 0;
  transition: box-shadow 0.15s ease, opacity 0.2s ease;
  position: relative;
}
.music-toggle:hover {
  opacity: 0.95;
  box-shadow: -1px -1px 2px rgba(255, 255, 255, 0.5), 2px 2px 4px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.4);
}
.music-toggle:active {
  box-shadow: inset 2px 2px 4px rgba(0, 0, 0, 0.35), inset -1px -1px 1px rgba(255, 255, 255, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.25);
}
.music-toggle svg,
.music-toggle img {
  width: 16px;
  height: 16px;
  display: block;
}
.music-toggle img { vertical-align: middle; }
.music-toggle.muted::after {
  content: '';
  position: absolute;
  left: 2px;
  right: 2px;
  top: 50%;
  height: 2px;
  background: #000;
  transform: rotate(-45deg);
  pointer-events: none;
}

/* Поиск: выпадающие результаты */
.header-search { position: relative; }
.search-results {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  min-width: 280px;
  max-width: 400px;
  max-height: 70vh;
  overflow-y: auto;
  background: #f8f4ed;
  border: 1px solid #e5e0d8;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  z-index: 1000;
  font-size: 14px;
  text-align: left;
}
.search-results.is-open { display: block; }
.search-results__list { list-style: none; margin: 0; padding: 8px 0; }
.search-results__list li { margin: 0; }
.search-results__list a {
  display: block;
  padding: 10px 14px;
  color: #1e1e1e;
  text-decoration: none;
  border-bottom: 1px solid #eee;
}
.search-results__list li:last-child a { border-bottom: 0; }
.search-results__list a:hover { background: #f5f5f5; }
.search-results__list strong { display: block; margin-bottom: 4px; }
.search-results__snippet { display: block; color: #555; font-size: 12px; line-height: 1.4; }
.search-results__empty { margin: 0; padding: 14px; color: #666; }

/* ==========================================================================
   Course release banner (all pages except главная via JS guard)
   ========================================================================== */
.course-release-banner {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + var(--header-bar-height) + 18px);
  left: 18px;
  z-index: 130;
  max-width: min(420px, calc(100vw - 36px));
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms ease;
}
.course-release-banner.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.course-release-banner a {
  display: inline-block;
  box-sizing: border-box;
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.25;
  text-transform: none;
  text-decoration: none;
  /* Высота банера -15% (текст не меняем) */
  padding: 0.47em 1.05em 0.51em;
  border-radius: 999px;
  color: #fffef5;
  background: linear-gradient(145deg, rgba(54, 201, 198, 0.42) 0%, rgba(29, 136, 201, 0.55) 45%, rgba(11, 94, 168, 0.62) 100%);
  border: 1px solid rgba(229, 186, 34, 0.65);
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.12) inset,
    0 6px 28px rgba(11, 94, 168, 0.45),
    0 0 22px rgba(229, 186, 34, 0.28);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  transition: filter 0.2s ease, box-shadow 0.2s ease;
}
.course-release-banner a:hover {
  filter: brightness(1.08);
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.14) inset,
    0 8px 32px rgba(11, 94, 168, 0.5),
    0 0 28px rgba(229, 186, 34, 0.4);
}
.course-release-banner a:focus-visible {
  outline: 3px solid rgba(229, 186, 34, 0.95);
  outline-offset: 4px;
}
@media (prefers-reduced-motion: reduce) {
  .course-release-banner { transition: none; transform: none; }
}

@media (max-width: 768px) {
  .course-release-banner {
    left: 12px;
    right: 12px;
    max-width: none;
    width: auto;
  }
  .course-release-banner a {
    display: block;
    width: 100%;
    text-align: center;
  }
}

/* Форма вступить: honeypot скрыт */
.form-submit .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-submit label { display: block; margin-top: 0.5rem; }
.form-submit input[type="text"],
.form-submit input[type="email"],
.form-submit input[type="password"] { width: 100%; max-width: 320px; padding: 8px 12px; margin-top: 0.25rem; font-family: inherit; font-size: 1rem; }
.form-submit p { margin: 0 0 1rem; }
.form-message { margin-bottom: 1rem; min-height: 1.5em; }
.form-message.form-message-error { color: #c00; }
.form-submit .btn { margin-top: 0.5rem; }

/* Вступление: многошаговый поток (email → код → успех) */
.entry-step-indicator { font-weight: 600; margin: 0 0 0.5rem; color: #333; }
.entry-flow .entry-step { display: none; }
.entry-flow .entry-step.active { display: block; }
.entry-flow .entry-step[hidden] { display: none !important; }
.entry-step-title { margin: 0 0 0.75rem; font-size: 1.25em; }
.entry-step-desc { margin: 0 0 1rem; color: #444; }
.entry-flow .entry-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.entry-flow .btn-outline { background: transparent; border: 2px solid #1e1e1e; color: #1e1e1e; }
.entry-flow .btn-outline:hover:not(:disabled) { background: #f0f0f0; }
.entry-flow .btn-outline:disabled { opacity: 0.6; cursor: not-allowed; }
.entry-flow .input-hint { display: block; font-size: 0.85em; color: #666; margin-top: 0.25rem; }
.entry-flow .entry-code-field { margin-bottom: 1rem; }
.entry-flow #code-input {
  display: block;
  max-width: 200px;
  width: 100%;
  padding: 12px 16px;
  margin-top: 0.5rem;
  font-size: 1.25rem;
  text-align: center;
  letter-spacing: 0.3em;
  font-variant-numeric: tabular-nums;
  border: 2px solid #1e1e1e;
  border-radius: 8px;
}
.entry-flow #code-input:focus { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.entry-demo-code-box {
  margin: 0 0 1.25rem;
  padding: 1rem 1.25rem;
  background: #f0ebe0;
  border: 1px solid #c9c0a8;
  border-radius: 8px;
}
.entry-demo-code-label { display: block; font-size: 0.9em; color: #555; margin-bottom: 0.35rem; }
.entry-demo-code-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  font-variant-numeric: tabular-nums;
  color: #1e1e1e;
}
.entry-success-msg { margin: 0 0 1rem; font-size: 1.1em; }
.entry-resend-timer { margin: 0; font-size: 0.9em; color: #666; }

/* Вкладки Вступить / Войти и блок входа */
.entry-tabs { display: flex; gap: 0; margin-bottom: 1.25rem; border-bottom: 2px solid #ddd; }
.entry-tab {
  padding: 0.5rem 1rem; font-family: inherit; font-size: 1rem; font-weight: 600;
  background: transparent; border: none; border-bottom: 3px solid transparent;
  margin-bottom: -2px; color: #666; cursor: pointer;
}
.entry-tab:hover { color: #1e1e1e; }
.entry-tab.active { color: var(--color-accent, #1e1e1e); border-bottom-color: currentColor; }
.entry-login-block[hidden], .entry-logged-in[hidden], .entry-flow[hidden] { display: none !important; }
.entry-logged-in .btn { margin-right: 0.5rem; margin-bottom: 0.5rem; }
.entry-login-block .entry-step-title { margin-top: 0; }
.form-submit .btn-outline { background: transparent; border: 2px solid #1e1e1e; color: #1e1e1e; cursor: pointer; font-family: var(--font); font-size: inherit; padding: 8px 16px; }
.form-submit .btn-outline:hover { background: #f0f0f0; }

/* Автор: блок «Важная заметка» и чёрные разделители */
.article-body .notice-block { margin: 0 0 1.5rem; padding: 1rem 0; }
.article-body .content-divider { height: 2px; background: #1e1e1e; margin: 1.5rem 0; border: 0; }

/* Кнопки формата книги: подсказка над кнопкой (клик/ховер) */
.book-format-btn-wrap {
  position: relative;
  display: inline-block;
  vertical-align: middle;
}
.book-format-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 8px;
  padding: 8px 12px;
  background: #1e1e1e;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  border-radius: 8px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s, visibility 0.2s;
  z-index: 20;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.book-format-btn-wrap:hover .book-format-tooltip,
.book-format-btn-wrap:focus-within .book-format-tooltip,
.book-format-btn-wrap.book-format-tooltip-visible .book-format-tooltip {
  opacity: 1;
  visibility: visible;
}
.book-format-btn-wrap:not(.book-format-btn-pending) .book-format-tooltip { display: none; }

/* ==========================================================================
   АДАПТАЦИЯ: 280px–1024px — без наложений, без горизонтального скролла
   (без смены HTML: common.css + классы из search.js)
   ========================================================================== */

@media (max-width: 1024px) {
  html {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
  }
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    font-size: clamp(16px, 2.2vw, 21px);
    line-height: 1.5;
  }

  /* Контейнеры и колонки: не вылезают за экран */
  .container,
  .content-with-sides,
  .page-main,
  .banner-inner,
  .section-telegram,
  .site-header .header-main {
    max-width: 100%;
    box-sizing: border-box;
  }
  .content-with-sides {
    padding-left: 16px;
    padding-right: 16px;
    overflow-x: hidden;
    min-width: 0;
  }
  .container {
    padding-left: 16px;
    padding-right: 16px;
  }
  .content-with-sides > *,
  .site-header .header-bar,
  .page-content,
  .container.page-content {
    min-width: 0;
  }

  /* Текст: переносы, без вылезания за границы */
  h1, h2, h3, h4, h5, h6,
  p, li, td, th,
  .page-title,
  .article-body,
  .side-links .side-link,
  .side-links button.side-link {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    max-width: 100%;
  }
  .page-content p,
  .page-content li,
  .banner-inner p {
    hyphens: auto;
    -webkit-hyphens: auto;
  }

  pre {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: pre-wrap;
    word-break: break-word;
  }
  code { overflow-wrap: break-word; word-break: break-word; }

  iframe,
  video,
  embed,
  object {
    max-width: 100%;
  }

  /* Кнопки в контенте и баннерах: перенос, не наезжают на соседний текст */
  .page-content .btn,
  .banner .btn,
  .banner-buttons .btn,
  .section-telegram .btn,
  .kids-buttons .btn,
  .why-buttons .btn,
  .form-submit .btn {
    display: inline-block;
    max-width: 100%;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
    box-sizing: border-box;
    margin-top: 12px;
    margin-bottom: 12px;
    padding-left: max(12px, 0.75rem);
    padding-right: max(12px, 0.75rem);
    font-size: max(16px, 0.81em);
    line-height: 1.4;
  }
  .site-header .header-cta .btn {
    white-space: nowrap;
    margin-top: 0;
    margin-bottom: 0;
  }

  .btn-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .btn-row .btn {
    width: 100%;
    max-width: 100%;
    text-align: center;
  }

  /* Запас снизу под фиксированные «Назад» / «Наверх» / музыку */
  body:not(.page-index) .page-main {
    padding-bottom: max(3rem, calc(env(safe-area-inset-bottom, 0px) + 5.5rem));
  }

  /* Гриды страницы — одна колонка уже с 900px; усиливаем для узких flex-элементов */
  .site-footer .footer-inner {
    min-width: 0;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .container,
  .content-with-sides {
    padding-left: 24px;
    padding-right: 24px;
  }
}

@media (max-width: 768px) {
  body { font-size: 18px; }

  .page-main { padding: 2rem 0; }

  /* Баннеры ниже на мобильных */
  .banner { min-height: 520px; background-position: center top; }
  body.banner-to-footer .banner { min-height: 520px; }
  .banner-inner { padding: 1.5rem 1rem; }

  /*
   * Шапка position:absolute — при align-items:center высокий .banner-inner
   * оказывается под шапкой. На внутренних страницах сдвигаем контент вниз
   * и выравниваем блок по верху (главную page-index не трогаем).
   */
  body:not(.page-index) .banner {
    align-items: flex-start;
    padding-top: calc(env(safe-area-inset-top, 0px) + var(--header-bar-height) * 0.15852 + max(44px, var(--header-bar-height)) + 10px);
    box-sizing: border-box;
  }

  /* Шапка: бургер (search.js) */
  .site-header .header-bar { padding: 0 16px; gap: 0.65rem; min-width: 0; }
  .site-header .site-title { max-width: min(220px, 55vw); }

  .site-header .header-pin-btn,
  .site-header .search-form button,
  .site-header .search-form .search-toggle {
    width: 44px !important;
    height: 44px !important;
  }
  .site-header .header-cta .btn { min-height: 44px; display: inline-flex; align-items: center; }

  body.has-mobile-menu .site-header .nav-menu { display: none; }
  body.has-mobile-menu.mobile-menu-open .site-header .nav-menu {
    display: block;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(var(--header-bar-height) + (var(--header-bar-height) * 0.05852));
    background: rgba(0, 0, 0, 0.96);
    border-top: 1px solid rgba(255,255,255,0.12);
    padding: 10px 16px 16px;
    z-index: 20;
  }
  body.has-mobile-menu.mobile-menu-open .site-header .nav-menu ul {
    justify-content: flex-start;
    flex-direction: column;
    gap: 0.4rem;
  }
  body.has-mobile-menu.mobile-menu-open .site-header .nav-menu a {
    display: block;
    padding: 12px 10px;
    border-radius: 10px;
    background: rgba(255,255,255,0.06);
    white-space: normal;
    overflow-wrap: break-word;
  }

  .site-header .header-burger {
    /* Увеличиваем зону нажатия (в 3 раза по ширине), не меняя размер иконки */
    width: 132px;
    height: 44px;
    position: relative;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    flex: 0 0 auto;

    /* Визуальная “кнопка” остаётся 44×44 по центру */
    background: transparent;
    border: 0;
    border-radius: 0;
  }
  .site-header .header-burger::before {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.08);
  }
  .site-header .header-burger:active { transform: translateY(1px); }
  .site-header .header-burger svg { width: 22px; height: 22px; position: relative; z-index: 1; }

  /*
   * Главная (RU/EN): в шапке много элементов — общий бургер с широкой зоной нажатия
   * визуально «растворяется». Здесь делаем вид как на эталонной мобильной шапке:
   * узкая тёмно-серая «капсула» под иконку + рядом жёлтая «капсула» у закрепления.
   * Только для body.page-index, остальные страницы не трогаем.
   */
  body.page-index .site-header .header-cta {
    gap: 0.35rem;
    flex-wrap: nowrap;
    align-items: center;
    min-width: 0;
  }
  body.page-index .site-header .header-burger {
    width: 40px;
    min-width: 40px;
    height: 44px;
    flex: 0 0 auto;
  }
  body.page-index .site-header .header-burger::before {
    width: 34px;
    height: 40px;
    border-radius: 12px;
    background: rgba(58, 58, 58, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  }
  body.page-index .site-header .header-pin-btn {
    width: 34px !important;
    height: 44px !important;
    min-width: 34px;
    border-radius: 12px !important;
    background: var(--color-accent, #e5ba22) !important;
    border: 1px solid rgba(0, 0, 0, 0.18) !important;
    box-shadow: -1px -1px 2px rgba(255, 255, 255, 0.35), 1px 2px 4px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(0, 0, 0, 0.2) !important;
  }
  body.page-index .site-header .header-pin-btn svg {
    width: 16px !important;
    height: 16px !important;
  }

  .site-footer { padding-top: 2.2rem; }
  .site-footer .footer-inner { padding: 16px; }
}

@media (max-width: 600px) {
  .banner .page-title,
  .page-content > h1:first-child {
    font-size: clamp(24px, 8vw, 36px);
  }
  .page-content h2,
  .page-content .page-title {
    font-size: clamp(20px, 6vw, 30px);
  }
  .page-content p,
  .page-content .article-body p {
    font-size: clamp(16px, 4vw, 18px);
  }
}

@media (max-width: 480px) {
  body { font-size: 16px; }
  .banner { min-height: 420px; }
  body.banner-to-footer .banner { min-height: 420px; }

  .container,
  .content-with-sides {
    padding-left: 12px;
    padding-right: 12px;
  }

  .banner .page-title { font-size: clamp(22px, 6.5vw, 38px); }
  .banner .banner-title { font-size: clamp(24px, 7vw, 44px); }

  .side-links { flex-direction: column; align-items: stretch; }
  .side-link,
  .side-links button.side-link {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  input, textarea, select, button { max-width: 100%; }

  .search-results {
    min-width: 0;
    width: min(92vw, 400px);
    left: auto;
    right: 0;
  }

  /* Опциональный класс: кнопка на всю ширину */
  .button-full-mobile {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    text-align: center;
    box-sizing: border-box;
  }
}

@media (orientation: portrait) and (max-width: 768px) {
  body { width: 100%; }
}

@media (orientation: landscape) and (max-width: 1024px) {
  body {
    font-size: clamp(16px, 1.8vw, 18px);
  }
  .container,
  .content-with-sides {
    padding-left: 20px;
    padding-right: 20px;
  }
}

/* Широкие таблицы/блоки — скролл внутри, без ломания страницы */
.page-content table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
