/* Локальные шрифты (Google Fonts, subset cyrillic+latin) */
@font-face {
  font-family: 'Caveat';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/static/fonts/caveat-normal-700-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Caveat';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/static/fonts/caveat-normal-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;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/static/fonts/jetbrainsmono-normal-400-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/static/fonts/jetbrainsmono-normal-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: 'JetBrains Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/static/fonts/jetbrainsmono-normal-700-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/static/fonts/jetbrainsmono-normal-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;
}
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url(/static/fonts/onest-normal-400-900-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url(/static/fonts/onest-normal-400-900-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: 'Playfair Display';
  font-style: italic;
  font-weight: 500 600;
  font-display: swap;
  src: url(/static/fonts/playfairdisplay-italic-500-600-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Playfair Display';
  font-style: italic;
  font-weight: 500 600;
  font-display: swap;
  src: url(/static/fonts/playfairdisplay-italic-500-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;
}
/* ==========================================================================
   «Дано:» — kursyege.ru · основной стиль
   Цвета и шрифты — по брендбуку (раздел 14–16).
   ========================================================================== */
:root {
  --indigo: #1C1F4A;
  --ultra: #3A4BE0;
  --ultra-d: #2C3BC4;
  --saffron: #FFC53D;
  --coral: #FF6A4D;
  --emerald: #13A57F;
  --cream: #FBF6EC;
  --lavender: #ECEBFA;
  --lav-text: #C4C6E6;
  --white: #fff;
  --ink: var(--indigo);
  --ink-2: rgba(28, 31, 74, .74);
  --ink-3: rgba(28, 31, 74, .55);
  --line: rgba(28, 31, 74, .10);
  --line-2: rgba(28, 31, 74, .16);
  --subj: var(--ultra);
  --subj-soft: #E7E9FD;
  --r-sm: 12px;
  --r: 20px;
  --r-lg: 28px;
  --shadow-1: 0 1px 2px rgba(28, 31, 74, .04), 0 8px 24px -12px rgba(28, 31, 74, .14);
  --shadow-2: 0 2px 6px rgba(28, 31, 74, .05), 0 30px 60px -28px rgba(28, 31, 74, .28);
  --shadow-3: 0 2px 8px rgba(28, 31, 74, .06), 0 36px 70px -26px rgba(28, 31, 74, .34);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --f-sans: "Onest", Arial, system-ui, sans-serif;
  --f-accent: "Playfair Display", Georgia, serif;
  --f-hand: "Caveat", "Comic Sans MS", cursive;
  --f-mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --container: 1240px;
  --gutter: clamp(20px, 4vw, 48px);
  --header-h: 80px;
  --dots: radial-gradient(circle, rgba(28, 31, 74, .14) 1.1px, transparent 1.4px);
  --dots-light: radial-gradient(circle, rgba(255, 255, 255, .10) 1.1px, transparent 1.4px);
}
.subj-math { --subj: var(--ultra); --subj-soft: #E7E9FD; }
.subj-physics { --subj: var(--coral); --subj-soft: #FFE9E3; }
.subj-informatics { --subj: var(--emerald); --subj-soft: #DDF4EC; }
.subj-other { --subj: var(--ultra); --subj-soft: #E7E9FD; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  font: 400 clamp(16px, .25vw + 15.2px, 18px)/1.6 var(--f-sans);
  color: var(--ink);
  background-color: var(--cream);
  background-image: var(--dots);
  background-size: 26px 26px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern", "liga";
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; height: auto; }
svg.ico { height: auto; flex: none; }
a { color: var(--ultra); text-decoration-thickness: 1.5px; text-underline-offset: .2em; }
a:hover { color: var(--ultra-d); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--ultra); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--saffron); color: var(--indigo); }
code, kbd, pre { font-family: var(--f-mono); font-size: .9em; }
.container { width: 100%; max-width: calc(var(--container) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.container--text > * { max-width: 820px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; background: var(--indigo); color: #fff; border-radius: 10px; }
.skip:focus { top: 12px; color: #fff; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Типографика ---------- */
.h1, .h2, h1, h2, h3 { color: var(--indigo); margin: 0; }
.h1 {
  font-weight: 900;
  font-size: clamp(38px, 5.2vw + 8px, 80px);
  line-height: 1.02;
  letter-spacing: -.04em;
  text-wrap: balance;
}
.hero--home .h1 { font-size: clamp(42px, 6.2vw + 6px, 96px); }
.h2 {
  font-weight: 800;
  font-size: clamp(28px, 2.4vw + 14px, 48px);
  line-height: 1.08;
  letter-spacing: -.032em;
  margin-bottom: clamp(20px, 2.4vw, 32px);
  text-wrap: balance;
}
.eyebrow {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 0 18px;
  font-size: clamp(12.5px, .3vw + 11.5px, 14px);
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--subj);
}
.lead { font-size: clamp(18px, .6vw + 15px, 22px); line-height: 1.55; color: var(--ink-2); max-width: 640px; margin-top: clamp(18px, 2vw, 28px); }
.lead p { margin: 0; }
.hand { font-family: var(--f-hand); font-weight: 700; font-size: clamp(24px, 1vw + 18px, 30px); line-height: 1.1; transform: rotate(-3deg); margin: 0; }
.hand--coral { color: var(--coral); }
.hand--saffron { color: var(--saffron); }
.accent { font-family: var(--f-accent); font-style: italic; font-weight: 500; letter-spacing: 0; color: var(--coral); }
mark.marker {
  color: inherit;
  background: none;
  position: relative;
  white-space: nowrap;
  z-index: 0;
  padding: 0 .04em;
}
mark.marker::before {
  content: "";
  position: absolute; z-index: -1;
  left: -.06em; right: -.08em; top: .42em; bottom: -.02em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 40' preserveAspectRatio='none'%3E%3Cpath fill='%23FFC53D' d='M3 7 C40 3 110 4 197 1 L199 30 C150 33 70 36 6 39 L2 22Z'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
  transform: rotate(-1.2deg);
}
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--ultra); flex: none; }
.dot--math { background: var(--ultra); }
.dot--physics { background: var(--coral); }
.dot--informatics { background: var(--emerald); }
.dot--other { background: var(--lav-text); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 8px; font-size: 13px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #fff; background: var(--ultra); }
.chip--physics { background: var(--coral); }
.chip--informatics { background: var(--emerald); }
.chip--other { background: var(--lavender); color: var(--indigo); }

/* ---------- Кнопки ---------- */
.btn {
  --btn-bg: var(--indigo); --btn-fg: #fff; --btn-bd: transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 22px;
  border: 2px solid var(--btn-bd); border-radius: 14px;
  background: var(--btn-bg); color: var(--btn-fg);
  font-weight: 700; font-size: 16px; line-height: 1.2; letter-spacing: -.005em;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .2s, color .2s, border-color .2s, box-shadow .25s var(--ease), transform .25s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { color: var(--btn-fg); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.99); }
.btn .ico { width: 20px; }
.btn--lg { min-height: 60px; padding: 16px 28px; font-size: 18px; border-radius: 16px; }
.btn--md { min-height: 46px; padding: 10px 20px; font-size: 16px; border-radius: 13px; }
.btn--block { width: 100%; }
.btn--primary { --btn-bg: var(--ultra); box-shadow: 0 10px 24px -12px rgba(58, 75, 224, .7); }
.btn--primary:hover { --btn-bg: var(--ultra-d); box-shadow: 0 16px 30px -12px rgba(58, 75, 224, .75); }
.btn--outline { --btn-bg: transparent; --btn-fg: var(--indigo); --btn-bd: var(--indigo); }
.btn--outline:hover { --btn-bg: var(--indigo); --btn-fg: #fff; }
.btn--ghost { --btn-bg: #fff; --btn-fg: var(--indigo); --btn-bd: var(--line-2); }
.btn--ghost:hover { --btn-bd: var(--indigo); }
.btn--tg { --btn-bg: var(--indigo); --btn-fg: #fff; }
.btn--tg:hover { --btn-bg: #2A2E66; }
.btn__arrow { transition: transform .25s var(--ease); }
.btn:hover .btn__arrow { transform: translateX(3px); }
.btn__chev { margin-left: auto; transition: transform .3s var(--ease); opacity: .6; }
.link-arrow { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; text-decoration: none; }
.link-arrow .ico { transition: transform .25s var(--ease); }
.link-arrow:hover .ico { transform: translateX(4px); }

/* ---------- Шапка ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 246, 236, .86);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, box-shadow .3s;
}
.site-header.is-scrolled { border-color: var(--line); box-shadow: 0 10px 30px -24px rgba(28, 31, 74, .4); }
.site-header__row { position: relative; display: flex; align-items: center; gap: 24px; height: var(--header-h); }
.logo { flex: none; display: block; margin-right: auto; padding: 4px 0; border-radius: 8px; }
.logo img { width: 196px; height: auto; margin-block: -6px; }
.mainnav { margin-right: 8px; }
.mainnav__list { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; }
.mainnav__item { position: relative; display: flex; align-items: center; }
.mainnav__item.has-mega { position: static; }
.mainnav__link {
  display: block; padding: 10px 12px; border-radius: 10px;
  font-size: 16px; font-weight: 600; color: var(--indigo); text-decoration: none; white-space: nowrap;
  transition: color .2s, background-color .2s;
}
.has-drop > .mainnav__link { padding-right: 2px; }
.mainnav__link:hover, .mainnav__item.is-current > .mainnav__link { color: var(--ultra); }
.mainnav__caret {
  display: grid; place-items: center; width: 26px; height: 32px; margin-right: 4px;
  border: 0; background: none; cursor: pointer; color: var(--ink-3); border-radius: 8px;
  transition: color .2s, transform .3s var(--ease);
}
.mainnav__item:hover .mainnav__caret, .mainnav__item.is-open .mainnav__caret { color: var(--ultra); }
.mainnav__item.is-open .mainnav__caret { transform: rotate(180deg); }
.drop {
  position: absolute; top: calc(100% + 6px); left: -8px; z-index: 5;
  min-width: 250px; padding: 10px;
  background: #fff; border-radius: 18px; box-shadow: var(--shadow-3); border: 1px solid var(--line);
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .22s, transform .3s var(--ease), visibility 0s .3s;
}
.drop::before { content: ""; position: absolute; left: 0; right: 0; top: -14px; height: 14px; }
.mainnav__item:hover > .drop, .mainnav__item:focus-within > .drop, .mainnav__item.is-open > .drop {
  opacity: 1; visibility: visible; transform: none; transition: opacity .22s, transform .3s var(--ease), visibility 0s;
}
.mainnav__item.is-closed > .drop { opacity: 0; visibility: hidden; transform: translateY(8px); }
.drop__list, .mega__list { list-style: none; margin: 0; padding: 0; }
.drop__list a, .mega__list a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px;
  color: var(--indigo); text-decoration: none; font-weight: 500; font-size: 15.5px; line-height: 1.3;
  transition: background-color .15s, color .15s;
}
.drop__list a:hover, .mega__list a:hover { background: var(--lavender); color: var(--ultra); }
.drop--mega { left: var(--gutter); right: var(--gutter); top: calc(var(--header-h) - 8px); padding: 28px; }
.mega { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px 28px; }
.mega__col { padding-top: 4px; }
.mega__title { display: block; margin: 0 0 6px 12px; font-weight: 800; font-size: 17px; color: var(--indigo); text-decoration: none; letter-spacing: -.01em; }
.mega__title:hover { color: var(--ultra); }
.mega__list--two { display: grid; grid-template-columns: 1fr 1fr; column-gap: 4px; }
.mega__list a { padding: 6px 12px; font-size: 15px; }
.header-cta { flex: none; }
.burger { display: none; position: relative; width: 46px; height: 46px; border: 0; background: #fff; border-radius: 13px; cursor: pointer; box-shadow: inset 0 0 0 1.5px var(--line-2); flex: none; }
.burger span { position: absolute; left: 13px; right: 13px; height: 2px; border-radius: 2px; background: var(--indigo); transition: transform .3s var(--ease), opacity .2s; }
.burger span:nth-child(1) { top: 16px; } .burger span:nth-child(2) { top: 22px; } .burger span:nth-child(3) { top: 28px; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.mobnav { display: none; }

@media (max-width: 1140px) {
  .mainnav__link { padding-inline: 9px; font-size: 15px; }
}
@media (max-width: 1060px) {
  :root { --header-h: 68px; }
  .mainnav { display: none; }
  .burger { display: block; }
  .logo img { width: 160px; }
  .site-header__row { gap: 10px; }
  .mobnav {
    display: grid; grid-template-rows: 0fr;
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--cream); border-bottom: 1px solid var(--line);
    box-shadow: 0 30px 40px -30px rgba(28, 31, 74, .35);
    transition: grid-template-rows .4s var(--ease), visibility 0s .4s; visibility: hidden;
  }
  .mobnav.is-open { grid-template-rows: 1fr; visibility: visible; transition: grid-template-rows .4s var(--ease), visibility 0s; }
  .mobnav__inner { min-height: 0; overflow: auto; max-height: calc(100dvh - var(--header-h)); }
  .mobnav.is-open .mobnav__inner { padding-block: 8px 24px; }
  .mobnav__inner > .btn { margin-top: 18px; }
}
@media (max-width: 420px) {
  .logo img { width: 128px; }
  .header-cta { padding-inline: 14px; font-size: 15px; min-height: 44px; }
  .burger { width: 44px; height: 44px; }
  .burger span:nth-child(1) { top: 15px; } .burger span:nth-child(2) { top: 21px; } .burger span:nth-child(3) { top: 27px; }
}
.mobnav__link, .mobnav details > summary {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 4px; border-bottom: 1px solid var(--line);
  font-size: 19px; font-weight: 700; color: var(--indigo); text-decoration: none; cursor: pointer; list-style: none;
}
.mobnav details > summary::-webkit-details-marker { display: none; }
.mobnav details > summary .ico { transition: transform .3s var(--ease); color: var(--ink-3); }
.mobnav details[open] > summary .ico { transform: rotate(180deg); color: var(--ultra); }
.mobnav ul { list-style: none; margin: 0; padding: 6px 0 10px 4px; }
.mobnav ul a { display: flex; align-items: center; gap: 10px; padding: 10px 6px; color: var(--indigo); text-decoration: none; font-size: 17px; font-weight: 500; }
.mobnav .mobnav__all { color: var(--ultra); font-weight: 700; }
.mobnav .mobnav__sub > summary { font-size: 17px; font-weight: 600; padding: 10px 6px; border-bottom: 0; }
.mobnav .mobnav__sub ul { padding-left: 14px; border-left: 2px solid var(--line); margin-left: 8px; }

/* ---------- Крошки ---------- */
.crumbs ol { display: flex; flex-wrap: wrap; gap: 4px 0; list-style: none; margin: 0 0 clamp(20px, 3vw, 36px); padding: 0; font-size: 14px; color: var(--ink-3); }
.crumbs li + li::before { content: "/"; margin: 0 10px; opacity: .5; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--ultra); text-decoration: underline; }
@media (max-width: 640px) {
  .crumbs ol { font-size: 13.5px; }
  .crumbs li { white-space: nowrap; }
  .crumbs li:last-child { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
}

/* ---------- Hero ---------- */
.hero { padding: clamp(28px, 4vw, 56px) 0 clamp(40px, 5vw, 72px); }
.hero--compact { padding-bottom: clamp(16px, 2vw, 24px); }
.hero__grid { display: grid; gap: clamp(36px, 5vw, 72px); align-items: center; }
.hero__grid--aside { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
.hero__actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 14px; margin-top: clamp(28px, 3vw, 40px); }
.hero__actions .signup { width: min(100%, 380px); }
.hero__aside { position: relative; }
.hero__note { text-align: right; margin: 18px 10px 0 0; }
.hero__figure { margin: 0; border-radius: 24px; overflow: hidden; border: 1px solid var(--lavender); box-shadow: 0 18px 40px -30px rgba(28, 31, 74, .22); }
.hero__figure img { width: 100%; height: auto; }
/* картинка: на широких экранах — половина сетки (≈ 6/12, 560–620px) */
@media (min-width: 1100px) {
  .hero__grid--img { grid-template-columns: minmax(0, 1fr) minmax(560px, 600px); gap: clamp(40px, 4vw, 64px); }
  .hero__grid--img .h1 { font-size: clamp(48px, 3.4vw + 14px, 72px); }
}
@media (max-width: 960px) {
  .hero__grid--aside { grid-template-columns: 1fr; }
  .hero__note { text-align: left; margin-left: 20px; }
  .hero__grid--img { gap: 28px; }
  .hero__figure img { max-height: 260px; object-fit: cover; }
}
@media (min-width: 600px) and (max-width: 960px) {
  .hero__figure img { max-height: 340px; }
}
@media (max-width: 520px) {
  .hero__actions { flex-direction: column; align-items: stretch; }
  .hero__actions .signup, .hero__actions > .btn { width: 100%; }
}

/* ---------- Дано / Найти / Решение ---------- */
.dnr-card { background: #fff; border-radius: var(--r-lg); padding: clamp(24px, 3vw, 40px) clamp(22px, 3vw, 44px); box-shadow: var(--shadow-2); }
.dnr-card dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: clamp(14px, 1.6vw, 22px) clamp(18px, 2vw, 32px); font-size: clamp(17px, .7vw + 13px, 22px); line-height: 1.4; }
.dnr-card__row { display: contents; }
.dnr-card dt, .dnr-card dd { align-self: baseline; }
.dnr-card dt { font-weight: 800; color: var(--indigo); letter-spacing: -.01em; }
.dnr-card dd { margin: 0; color: var(--indigo); }
.dnr-card__row--res dt { color: var(--coral); }
@media (max-width: 420px) { .dnr-card dl { grid-template-columns: 1fr; row-gap: 4px; } .dnr-card dd { margin-bottom: 10px; } .dnr-card dd:last-child { margin-bottom: 0; } }
.dnr-wrap { max-width: 720px; }
.dnr-wrap__note { text-align: right; margin-top: 16px; }
/* Отдельный блок «Дано/Найти/Решение» под hero с картинкой: горизонтальная карточка на всю ширину */
.block--dnr { padding-top: 0; }
.hero + .block--dnr { margin-top: calc(-1 * clamp(4px, 2vw, 28px)); }
.block--dnr .dnr-wrap__note { margin: 22px 10px 0 0; }
.block--dnr .dnr-wrap { max-width: none; }
.dnr-card--wide { padding: 0; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.dnr-card--wide dl { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; font-size: clamp(17px, .35vw + 15px, 20px); line-height: 1.45; }
.dnr-card--wide .dnr-card__row { display: flex; flex-direction: column; gap: 8px; padding: clamp(22px, 2.4vw, 34px) clamp(22px, 2.4vw, 36px); border-left: 1px solid var(--line); }
.dnr-card--wide .dnr-card__row:first-child { border-left: 0; }
.dnr-card--wide dt { font-size: 14px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.dnr-card--wide .dnr-card__row--res { background: var(--subj-soft); }
.dnr-card--wide .dnr-card__row--res dt { color: var(--coral); }
.dnr-card--wide dd { margin: 0; }
@media (max-width: 860px) {
  .dnr-card--wide dl { grid-template-columns: 1fr; }
  .dnr-card--wide .dnr-card__row { border-left: 0; border-top: 1px solid var(--line); padding: 18px 22px; gap: 4px; }
  .dnr-card--wide .dnr-card__row:first-child { border-top: 0; }
  .dnr-card--wide dd { margin-bottom: 0 !important; }
}

/* ---------- Блоки ---------- */
.block { padding: clamp(36px, 5vw, 64px) 0; }
.block__lead { font-size: clamp(17px, .4vw + 15px, 20px); color: var(--ink-2); max-width: 760px; margin: -8px 0 clamp(24px, 3vw, 36px); }
.block__lead p { margin: 0; }

/* Текст */
.prose { color: var(--ink); }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose p { margin: 0 0 1em; }
.prose h2 { font-size: clamp(24px, 1.2vw + 18px, 32px); font-weight: 800; letter-spacing: -.025em; line-height: 1.15; margin: 1.6em 0 .6em; }
.prose h3 { font-size: clamp(20px, .6vw + 17px, 24px); font-weight: 800; letter-spacing: -.02em; line-height: 1.2; margin: 1.5em 0 .5em; }
.prose ul, .prose ol { margin: 0 0 1.1em; padding-left: 1.4em; }
.prose li { margin: .35em 0; padding-left: .2em; }
.prose ul { list-style: none; padding-left: 1.5em; }
.prose ul > li { position: relative; }
.prose ul > li::before { content: ""; position: absolute; left: -1.15em; top: .62em; width: 8px; height: 8px; border-radius: 50%; background: var(--subj); }
.prose ol > li::marker { color: var(--subj); font-weight: 800; }
.prose strong { font-weight: 700; }
.prose blockquote { margin: 1.4em 0; padding: 4px 0 4px 22px; border-left: 4px solid var(--saffron); color: var(--ink-2); }
.prose img { border-radius: var(--r); margin: 1.4em 0; }
.prose hr { border: 0; height: 1px; background: var(--line-2); margin: 2em 0; }
.prose :not(pre) > code { padding: .12em .4em; border-radius: 6px; background: var(--lavender); color: var(--indigo); font-size: .88em; }
.table-wrap { margin: 1.4em 0; overflow-x: auto; -webkit-overflow-scrolling: touch; background: #fff; border-radius: 14px; border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.prose table { width: 100%; border-collapse: collapse; font-size: .95em; }
.prose th, .prose td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { background: var(--lavender); font-weight: 700; }
.prose tr:last-child td { border-bottom: 0; }
.prose .katex-display { overflow-x: auto; overflow-y: hidden; padding: 6px 0; }

/* Подсветка кода (Pygments, классы codehilite) */
.hl { margin: 1.4em 0; border-radius: 16px; background: var(--indigo); box-shadow: var(--shadow-1); overflow: hidden; }
.hl pre { margin: 0; padding: 20px 22px; overflow-x: auto; color: #ECEBFA; font-size: 15px; line-height: 1.6; tab-size: 4; }
.hl .k, .hl .kn, .hl .kd, .hl .kc, .hl .kr, .hl .ow, .hl .kw { color: #3DDBAE; }
.hl .s, .hl .s1, .hl .s2, .hl .sa, .hl .sb, .hl .sc, .hl .sd, .hl .se, .hl .si, .hl .sx { color: #FFD36E; }
.hl .mi, .hl .mf, .hl .mh, .hl .mo, .hl .m, .hl .il { color: #FF9A85; }
.hl .c, .hl .c1, .hl .cm, .hl .ch, .hl .cs, .hl .cp { color: #8E92C8; font-style: italic; }
.hl .nb, .hl .bp { color: #9FAAFF; }
.hl .nf, .hl .nc, .hl .fm { color: #fff; font-weight: 700; }
.hl .o, .hl .p { color: #C4C6E6; }
.hl .err { color: #FF9A85; }

/* Карточки */
.cards { display: grid; gap: clamp(14px, 1.6vw, 22px); grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.cards--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.cards--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.card {
  position: relative; background: #fff; border-radius: var(--r); padding: clamp(22px, 2.2vw, 30px);
  box-shadow: var(--shadow-1); border: 1px solid var(--line);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.card__icon { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 18px; border-radius: 15px; background: var(--subj-soft); color: var(--subj); }
.card__icon .ico { width: 26px; }
.card__title { font-size: clamp(19px, .4vw + 17px, 22px); font-weight: 800; letter-spacing: -.02em; line-height: 1.2; margin: 0 0 8px; }
.card__text { color: var(--ink-2); font-size: .97em; }
.card__text p { margin: 0 0 .6em; } .card__text p:last-child { margin: 0; }

/* Три ритма */
.rhythms { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(12px, 1.6vw, 22px); }
.rhythm { border-radius: var(--r); padding: clamp(22px, 2.4vw, 32px) clamp(22px, 2.4vw, 34px); color: #fff; position: relative; overflow: hidden; transition: transform .3s var(--ease); }
.rhythm:hover { transform: translateY(-3px); }
.rhythm::after { content: ""; position: absolute; inset: 0; background-image: var(--dots-light); background-size: 18px 18px; pointer-events: none; }
.rhythm--1 { background: var(--ultra); }
.rhythm--2 { background: var(--saffron); color: var(--indigo); }
.rhythm--2::after { background-image: radial-gradient(circle, rgba(28, 31, 74, .10) 1.1px, transparent 1.4px); }
.rhythm--3 { background: var(--coral); }
.rhythm__value { margin: 0; font-weight: 900; font-size: clamp(30px, 2vw + 18px, 44px); letter-spacing: -.035em; line-height: 1.05; }
.rhythm__title { margin: 8px 0 0; font-size: clamp(16px, .3vw + 15px, 19px); font-weight: 600; }
.rhythm__text { margin: 12px 0 0; font-size: 15.5px; line-height: 1.5; opacity: .88; }
@media (max-width: 860px) { .rhythms { grid-template-columns: 1fr; } }

/* Шаги */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(14px, 1.6vw, 22px); grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); counter-reset: s; }
.step { position: relative; background: #fff; border-radius: var(--r); padding: clamp(22px, 2.2vw, 30px); box-shadow: var(--shadow-1); border: 1px solid var(--line); }
.step__num { display: block; font-weight: 900; font-size: 54px; line-height: .9; letter-spacing: -.05em; color: var(--subj); margin-bottom: 16px; font-variant-numeric: tabular-nums; }
.step__num::before { content: "0"; opacity: .25; }
.step__title { font-size: 20px; font-weight: 800; letter-spacing: -.02em; line-height: 1.25; margin: 0 0 8px; }
.step__text { color: var(--ink-2); font-size: .97em; }
.step__text p { margin: 0 0 .5em; } .step__text p:last-child { margin: 0; }

/* Факты */
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 0; background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow-1); border: 1px solid var(--line); overflow: hidden; }
.facts--1 { grid-template-columns: 1fr; } .facts--2 { grid-template-columns: repeat(2, 1fr); } .facts--3 { grid-template-columns: repeat(3, 1fr); }
.fact { padding: clamp(22px, 2.6vw, 36px); border-left: 1px solid var(--line); }
.fact:first-child { border-left: 0; }
.fact__value { font-weight: 900; font-size: clamp(30px, 1.8vw + 18px, 46px); letter-spacing: -.04em; line-height: 1.05; color: var(--subj); }
.fact__label { margin: 8px 0 0; color: var(--ink-2); font-size: 16px; line-height: 1.45; }
@media (max-width: 860px) {
  .facts, .facts--3, .facts--4 { grid-template-columns: repeat(2, 1fr); }
  .fact:nth-child(odd) { border-left: 0; }
  .fact:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 420px) { .fact { padding: 20px 18px; } .fact__value { font-size: 28px; } .fact__label { font-size: 15px; } }

/* Преподаватель */
.teacher { display: grid; grid-template-columns: minmax(0, 380px) 1fr; gap: clamp(28px, 4vw, 64px); align-items: center; background: #fff; border-radius: var(--r-lg); padding: clamp(18px, 2.4vw, 32px); box-shadow: var(--shadow-2); }
.teacher__media img { border-radius: 22px; width: 100%; height: auto; }
.teacher__badge { position: relative; display: grid; place-items: center; gap: 18px; aspect-ratio: 1 / 1.05; border-radius: 22px; background-color: var(--lavender); background-image: radial-gradient(circle, rgba(58, 75, 224, .22) 1.1px, transparent 1.4px); background-size: 20px 20px; }
.teacher__badge img { width: 42%; transform: rotate(-3deg); filter: drop-shadow(0 18px 30px rgba(58, 75, 224, .35)); }
.teacher__badge .hand { position: absolute; bottom: 9%; color: var(--ultra); font-size: 28px; }
.teacher__body { padding: clamp(4px, 1vw, 16px) clamp(4px, 2vw, 24px) clamp(8px, 1vw, 16px) 0; }
.teacher__lead { font-size: clamp(18px, .5vw + 16px, 21px); color: var(--ink-2); margin: -6px 0 20px; }
.teacher__lead .accent { font-size: 1.12em; }
.teacher__facts { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 14px; }
.teacher__facts li { display: flex; gap: 14px; align-items: flex-start; }
.teacher__facts .ico { width: 22px; margin-top: 2px; color: var(--ultra); }
@media (max-width: 860px) {
  .teacher { grid-template-columns: 1fr; } .teacher__media { max-width: 420px; }
  .teacher__badge { aspect-ratio: auto; height: 200px; }
  .teacher__badge img { width: 96px; }
  .teacher__badge .hand { bottom: 18px; font-size: 24px; }
}

/* Пометка */
.callout { position: relative; border-radius: var(--r); padding: clamp(22px, 2.6vw, 32px) clamp(22px, 2.8vw, 36px); background: #fff; box-shadow: var(--shadow-1); border: 1px solid var(--line); }
.callout--trap { background: #FFF3EF; border-color: rgba(255, 106, 77, .25); }
.callout--note { background: var(--lavender); border-color: rgba(58, 75, 224, .14); }
.callout__tag { font-size: clamp(24px, .8vw + 20px, 30px); margin: -4px 0 10px; display: inline-block; }
.callout--trap .callout__tag { color: var(--coral); }
.callout--note .callout__tag { color: var(--ultra); }
.callout__title { font-weight: 800; font-size: clamp(19px, .4vw + 17px, 22px); letter-spacing: -.02em; margin: 0 0 8px; }

/* Ссылки-карточки */
.links { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(12px, 1.4vw, 20px); grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); }
.link-card {
  position: relative; display: flex; flex-direction: column; gap: 10px; height: 100%;
  padding: 22px 24px 64px; background: #fff; border-radius: var(--r); text-decoration: none; color: var(--indigo);
  border: 1px solid var(--line); box-shadow: var(--shadow-1);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s;
}
.link-card--math { --c: var(--ultra); } .link-card--physics { --c: var(--coral); } .link-card--informatics { --c: var(--emerald); } .link-card--other { --c: var(--indigo); }
.link-card:hover { color: var(--indigo); transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: color-mix(in srgb, var(--c) 40%, transparent); }
.link-card__top:empty { display: none; }
.link-card__title { font-size: clamp(19px, .4vw + 17px, 22px); font-weight: 800; line-height: 1.2; letter-spacing: -.02em; }
.link-card__text { color: var(--ink-2); font-size: 15.5px; line-height: 1.5; }
.link-card__go { position: absolute; left: 24px; bottom: 20px; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--lavender); color: var(--c); transition: background-color .3s, color .3s, transform .3s var(--ease); }
.link-card:hover .link-card__go { background: var(--c); color: #fff; transform: translateX(4px); }
.link-card__go .ico { width: 18px; }

/* FAQ */
.faq { display: grid; gap: 12px; }
.faq__item { background: #fff; border-radius: 18px; border: 1px solid var(--line); box-shadow: var(--shadow-1); transition: box-shadow .3s; interpolate-size: allow-keywords; }
.faq__item[open] { box-shadow: var(--shadow-2); }
.faq__item > summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 24px; cursor: pointer; list-style: none; border-radius: 18px; }
.faq__item > summary::-webkit-details-marker { display: none; }
.faq__q { font-size: clamp(17px, .4vw + 15.5px, 20px); font-weight: 700; letter-spacing: -.01em; line-height: 1.35; margin: 0; }
.faq__icon { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--lavender); color: var(--ultra); transition: transform .35s var(--ease), background-color .3s, color .3s; }
.faq__item[open] .faq__icon { transform: rotate(180deg); background: var(--ultra); color: #fff; }
.faq__a { padding: 0 24px 22px; color: var(--ink-2); }
.faq__item::details-content { block-size: 0; overflow: clip; transition: block-size .35s var(--ease), content-visibility .35s allow-discrete; }
.faq__item[open]::details-content { block-size: auto; }

/* CTA */
.cta {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(28px, 4vw, 64px); align-items: center;
  padding: clamp(32px, 5vw, 72px); border-radius: clamp(24px, 3vw, 36px);
  background-color: var(--indigo); background-image: var(--dots-light); background-size: 24px 24px; color: #fff;
}
.cta__note { margin-bottom: 14px; }
.cta__title { color: #fff; margin-bottom: 16px; }
.cta__lead { color: var(--lav-text); font-size: clamp(17px, .4vw + 15px, 20px); }
.cta__lead p { margin: 0 0 .6em; } .cta__lead a { color: #fff; }
.cta__action { justify-self: end; width: min(100%, 420px); }
@media (max-width: 860px) { .cta { grid-template-columns: 1fr; } .cta__action { justify-self: stretch; } }

/* ---------- Кнопка записи (раскрывашка) ---------- */
.signup { position: relative; width: 100%; }
.signup__head, .signup__panel, .signup__formwrap { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .5s var(--ease), opacity .35s var(--ease); }
.signup__clip { min-height: 0; overflow: hidden; margin: -16px; padding: 16px; }
.signup__toggle { width: 100%; }
.signup__choices { display: grid; gap: 10px; transition: transform .5s var(--ease); }
.signup__choices .btn { width: 100%; justify-content: flex-start; padding-inline: 22px; }
.signup__formwrap .signup__clip > * { margin-top: 12px; }
html.js .signup__panel { grid-template-rows: 0fr; opacity: 0; }
html.js .signup__panel .signup__choices { transform: translateY(-10px); }
html.js .signup__formwrap { grid-template-rows: 0fr; opacity: 0; }
html.js .signup.is-open .signup__head { grid-template-rows: 0fr; opacity: 0; }
html.js .signup.is-open .signup__panel { grid-template-rows: 1fr; opacity: 1; }
html.js .signup.is-open .signup__choices { transform: none; }
html.js .signup.is-form .signup__formwrap { grid-template-rows: 1fr; opacity: 1; }
html.no-js .signup__head { display: none; }
.signup.is-form [data-form-toggle] { --btn-bd: var(--ultra); }
.signup.is-form [data-form-toggle] .btn__chev { transform: rotate(180deg); }
.signup--dark .btn--tg { --btn-bg: #fff; --btn-fg: var(--indigo); }
.signup--dark .btn--tg:hover { --btn-bg: var(--lavender); }
.signup--dark .btn--ghost { --btn-bg: transparent; --btn-fg: #fff; --btn-bd: rgba(255, 255, 255, .35); }
.signup--dark .btn--ghost:hover { --btn-bd: #fff; }
.signup--dark.is-form [data-form-toggle] { --btn-bd: #fff; }

.lead-form, .lead-success { background: #fff; border-radius: var(--r); padding: 22px; box-shadow: 0 1px 2px rgba(28, 31, 74, .05), 0 14px 30px -18px rgba(28, 31, 74, .3); border: 1px solid var(--line); color: var(--indigo); }
.lead-form__hint { margin: 0 0 14px; font-size: 15px; color: var(--ink-2); line-height: 1.45; }
.field { margin-bottom: 12px; }
.field__label { display: block; margin: 0 0 6px; font-size: 14px; font-weight: 700; }
.field__input {
  width: 100%; height: 52px; padding: 0 16px; border-radius: 13px;
  border: 1.5px solid var(--line-2); background: var(--cream); color: var(--indigo);
  font: 500 17px/1 var(--f-sans);
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.field__input::placeholder { color: var(--ink-3); font-weight: 400; }
.field__input:hover { border-color: rgba(28, 31, 74, .3); }
.field__input:focus { outline: none; border-color: var(--ultra); background: #fff; box-shadow: 0 0 0 4px rgba(58, 75, 224, .14); }
.field__input[aria-invalid="true"] { border-color: var(--coral); box-shadow: 0 0 0 4px rgba(255, 106, 77, .14); }
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.consent { position: relative; display: flex; gap: 12px; align-items: flex-start; margin: 14px 0 16px; font-size: 14px; line-height: 1.45; color: var(--ink-2); cursor: pointer; }
.consent input { position: absolute; opacity: 0; width: 22px; height: 22px; margin: 0; cursor: pointer; }
.consent__box { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--line-2); background: var(--cream); transition: background-color .2s, border-color .2s; }
.consent__tick { width: 20px; opacity: 0; transform: scale(.6); transition: opacity .2s, transform .25s var(--ease); color: #fff; }
.consent__tick circle { display: none; }
.consent input:checked + .consent__box { background: var(--ultra); border-color: var(--ultra); }
.consent input:checked + .consent__box .consent__tick { opacity: 1; transform: none; }
.consent input:focus-visible + .consent__box { outline: 3px solid var(--ultra); outline-offset: 2px; }
.consent input[aria-invalid="true"] + .consent__box { border-color: var(--coral); }
.lead-form__submit { position: relative; }
.spinner { display: none; width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: spin .8s linear infinite; }
.lead-form.is-loading .spinner { display: inline-block; }
.lead-form.is-loading .lead-form__submit { pointer-events: none; opacity: .85; }
@keyframes spin { to { transform: rotate(360deg); } }
.lead-form__msg { margin: 10px 0 0; font-size: 14.5px; color: #D9472B; min-height: 0; }
.lead-form__msg:empty { display: none; }
.lead-success { display: flex; gap: 16px; align-items: flex-start; animation: pop .5s var(--ease); }
.lead-success[hidden] { display: none; }
.lead-success__icon { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: #DDF4EC; color: var(--emerald); }
.lead-success__title { margin: 2px 0 4px; font-weight: 800; font-size: 19px; letter-spacing: -.01em; }
.lead-success__text { margin: 0; font-size: 15px; color: var(--ink-2); line-height: 1.5; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

/* Модальное окно записи */
.signup-dialog { padding: 0; border: 0; background: transparent; max-width: min(480px, calc(100vw - 24px)); width: 100%; max-height: calc(100dvh - 24px); overflow: visible; color: var(--indigo); }
.signup-dialog::backdrop { background: rgba(28, 31, 74, .5); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.signup-dialog[open] { animation: dlg-in .45s var(--ease); }
.signup-dialog[open]::backdrop { animation: fade-in .3s ease; }
@keyframes dlg-in { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.signup-dialog__card { position: relative; max-height: calc(100dvh - 24px); overflow: auto; padding: clamp(26px, 4vw, 38px); border-radius: var(--r-lg); background-color: var(--cream); background-image: var(--dots); background-size: 22px 22px; box-shadow: 0 40px 80px -30px rgba(28, 31, 74, .6); }
.signup-dialog__close { position: absolute; top: 14px; right: 14px; display: grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 50%; background: #fff; cursor: pointer; box-shadow: var(--shadow-1); transition: transform .3s var(--ease); }
.signup-dialog__close:hover { transform: rotate(90deg); }
.signup-dialog__note { color: var(--coral); margin-bottom: 8px; font-size: 26px; }
.signup-dialog__title { font-size: clamp(28px, 2vw + 18px, 36px); font-weight: 900; letter-spacing: -.035em; line-height: 1.05; margin: 0 0 10px; }
.signup-dialog__text { margin: 0 0 22px; color: var(--ink-2); font-size: 16px; }
html.js body.has-dialog { overflow: hidden; }

/* ---------- Блог ---------- */
.posts { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(18px, 2vw, 28px); grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); }
.post-card { display: flex; flex-direction: column; height: 100%; background: #fff; border-radius: var(--r); overflow: hidden; text-decoration: none; color: var(--indigo); border: 1px solid var(--line); box-shadow: var(--shadow-1); transition: transform .3s var(--ease), box-shadow .3s var(--ease); }
.post-card:hover { color: var(--indigo); transform: translateY(-4px); box-shadow: var(--shadow-2); }
.post-card__cover { aspect-ratio: 3 / 2; background: var(--indigo); overflow: hidden; }
.post-card__cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.post-card:hover .post-card__cover img { transform: scale(1.03); }
.cover-fallback { position: relative; display: flex; flex-direction: column; justify-content: space-between; height: 100%; padding: 22px 24px; background-color: var(--indigo); background-image: var(--dots-light); background-size: 16px 16px; color: #fff; }
.post-card--math .cover-fallback { background-color: var(--ultra); }
.post-card--physics .cover-fallback { background-color: #E5553A; }
.post-card--informatics .cover-fallback { background-color: #0F8C6B; }
.cover-fallback img { width: 64px; height: auto; }
.cover-fallback__title { font-weight: 900; font-size: 24px; line-height: 1.1; letter-spacing: -.03em; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-card__body { display: flex; flex-direction: column; gap: 10px; padding: 20px 22px 22px; flex: 1; }
.post-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.post-card__date { font-size: 13.5px; color: var(--ink-3); font-weight: 600; }
.post-card__title { font-size: 20px; font-weight: 800; line-height: 1.25; letter-spacing: -.02em; margin: 0; }
.post-card__text { margin: 0; font-size: 15.5px; color: var(--ink-2); line-height: 1.5; }
.post-card__more { display: inline-flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 6px; font-size: 15px; font-weight: 700; color: var(--ultra); }
.post-card__more .ico { transition: transform .25s var(--ease); }
.post-card:hover .post-card__more .ico { transform: translateX(4px); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.tag { padding: 4px 10px; border-radius: 8px; font-size: 13px; font-weight: 700; line-height: 1.3; background: var(--lavender); color: var(--indigo); }
.tag--math { background: #E7E9FD; color: var(--ultra-d); }
.tag--physics { background: #FFE9E3; color: #C2412A; }
.tag--informatics { background: #DDF4EC; color: #0B7A5D; }
.tags--sm .tag { padding: 2px 8px; font-size: 13px; }
.empty { padding: 40px; text-align: center; background: #fff; border-radius: var(--r); color: var(--ink-2); box-shadow: var(--shadow-1); }
.pager { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 40px; }
.pager a, .pager span { display: grid; place-items: center; min-width: 46px; height: 46px; padding: 0 14px; border-radius: 12px; background: #fff; text-decoration: none; color: var(--indigo); font-weight: 700; box-shadow: var(--shadow-1); }
.pager a:hover { color: var(--ultra); }
.pager [aria-current] { background: var(--ultra); color: #fff; }
.block--posts { padding-top: clamp(8px, 2vw, 24px); }

/* Статья: читабельная колонка ~720px по центру, обложка шире */
.article { padding: clamp(24px, 4vw, 56px) 0 clamp(24px, 3vw, 40px); }
.article__col { max-width: 720px; margin-inline: auto; }
.article .h1 { font-size: clamp(32px, 2.4vw + 18px, 52px); line-height: 1.06; }
.article .tags { margin-top: 18px; }
.article__byline { display: flex; align-items: center; gap: 14px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.article__byline img { flex: none; width: 44px; height: 44px; }
.article__author { margin: 0; font-size: 16px; color: var(--ink); line-height: 1.4; }
.article__meta { display: flex; flex-wrap: wrap; gap: 2px 14px; margin: 3px 0 0; color: var(--ink-3); font-size: 14.5px; }
.article__cover { margin: clamp(24px, 3vw, 40px) auto 0; max-width: 920px; border-radius: 24px; overflow: hidden; border: 1px solid var(--lavender); }
.article__cover img { width: 100%; height: auto; }
.article__body { margin-top: clamp(28px, 3.5vw, 44px); font-size: clamp(17px, .25vw + 16px, 19px); line-height: 1.65; }
.article__body h2 { scroll-margin-top: calc(var(--header-h) + 16px); }
.article__body img { width: 100%; height: auto; border-radius: 20px; border: 1px solid var(--lavender); }
.article__body .hl { margin-inline: 0; }
.article__body .hl pre { font-size: 14.5px; }
.article__body .katex { font-size: 1.08em; }
.article__body .katex-display { margin: 1.2em 0; }
.prose td .katex, .prose th .katex { white-space: nowrap; }
.prose blockquote p:last-child { margin-bottom: 0; }
/* «Где теряют баллы» в статье */
.prose blockquote.trap { position: relative; margin: 1.8em 0; padding: 18px 22px 20px 24px; border-left: 4px solid var(--coral); border-radius: 0 16px 16px 0; background: #FFF3EF; color: var(--ink); }
.trap__tag { color: var(--coral); font-size: 26px; margin: 0 0 6px !important; display: inline-block; }
.trap__tag::before { content: "← "; }
/* Оглавление */
.toc { margin: clamp(24px, 3vw, 36px) 0 0; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-1); }
.toc > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; cursor: pointer; list-style: none; font-weight: 800; font-size: 14px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.toc > summary::-webkit-details-marker { display: none; }
.toc > summary .ico { transition: transform .3s var(--ease); }
.toc[open] > summary .ico { transform: rotate(180deg); }
.toc ol { margin: 0; padding: 0 20px 16px 44px; columns: 2; column-gap: 32px; font-size: 16px; line-height: 1.4; }
.toc li { margin: 0 0 8px; break-inside: avoid; }
.toc li::marker { color: var(--subj); font-weight: 800; }
.toc a { color: var(--indigo); text-decoration: none; }
.toc a:hover { color: var(--ultra); text-decoration: underline; }
@media (max-width: 640px) { .toc ol { columns: 1; } }
/* Подпись автора */
.article__sign { display: flex; gap: 18px; align-items: flex-start; margin-top: clamp(32px, 4vw, 48px); padding: 22px 24px; background: #fff; border-radius: 20px; border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.article__sign img { flex: none; width: 56px; height: 56px; }
.article__sign p { margin: 0; }
.article__sign-note { display: inline-block; font-size: 24px; margin-bottom: 8px !important; }
.article__sign-name { font-weight: 800; font-size: 19px; }
.article__sign-name a { color: var(--indigo); text-decoration: none; }
.article__sign-name a:hover { color: var(--ultra); }
.article__sign-text { margin-top: 4px !important; font-size: 15px; color: var(--ink-2); line-height: 1.5; }
@media (max-width: 640px) {
  .article__body { font-size: 17px; }
  .article__body .hl pre { font-size: 13.5px; padding: 16px 18px; }
  .prose table { font-size: 15px; }
  .prose th, .prose td { padding: 10px 12px; }
  .article__cover { border-radius: 18px; }
}

/* ---------- 404 ---------- */
.notfound__grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: center; padding: clamp(20px, 4vw, 60px) 0; }
@media (max-width: 860px) { .notfound__grid { grid-template-columns: 1fr; } }

/* ---------- Подвал ---------- */
.site-footer { margin-top: clamp(40px, 6vw, 80px); background-color: var(--indigo); background-image: var(--dots-light); background-size: 26px 26px; color: var(--lav-text); font-size: 15px; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { color: var(--saffron); }
.site-footer__grid { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr) 1.3fr; gap: 36px 28px; padding: clamp(48px, 6vw, 80px) 0 40px; }
.site-footer__logo img { width: 170px; height: auto; }
.site-footer__slogan { margin: 18px 0 0; max-width: 260px; line-height: 1.55; }
.site-footer__slogan a { text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .35); }
.site-footer__h { margin: 0 0 14px; font-weight: 800; font-size: 15px; letter-spacing: .02em; color: #fff; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.site-footer__col ul a { color: var(--lav-text); }
.site-footer__col ul a:hover { color: #fff; }
.site-footer__phone { display: block; font-size: 22px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; }
.site-footer__bot { display: inline-flex; align-items: center; gap: 8px; margin: 10px 0 18px; font-weight: 600; }
.socials { gap: 8px !important; }
.socials a { display: inline-flex; align-items: center; gap: 10px; padding: 7px 12px 7px 9px; border-radius: 11px; background: rgba(255, 255, 255, .07); color: var(--lav-text) !important; font-size: 14px; transition: background-color .2s, color .2s; }
.socials a:hover { background: rgba(255, 255, 255, .14); color: #fff !important; }
.socials .ico { width: 20px; color: #fff; }
.site-footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; padding: 22px 0 28px; border-top: 1px solid rgba(255, 255, 255, .12); font-size: 14px; }
.site-footer__bottom p { margin: 0; }
.site-footer__bottom a { color: var(--lav-text); }
@media (max-width: 1100px) {
  .site-footer__grid { grid-template-columns: repeat(3, 1fr); }
  .site-footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .site-footer__grid { grid-template-columns: 1fr 1fr; }
  .site-footer__contacts { grid-column: 1 / -1; }
}

/* ---------- Доступность / движение ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media print {
  .site-header, .site-footer, .signup, .block--cta, .signup-dialog { display: none !important; }
  body { background: #fff; }
}
