/* ============================================================
   Общие стили сайта. Подключается на всех страницах.
   ============================================================ */

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

:root {
  --surface: #ffffff;
  --surface-2: #f7f4ee;
  --surface-3: #efe9df;
  --line: #e0d9cc;
  --line-2: #ece5d9;
  --ink: #1f1d19;
  --ink-2: #524d44;
  --ink-3: #8a8275;
  --accent: #2f6f4e;
  --accent-2: #3f8f66;
  --accent-3: #1f4d36;
  --accent-soft: #e6f0ea;
  --accent-line: #bcd6c6;
  --gold: #c9a227;
  --gold-soft: #f7efd6;
  --blue: #4a7fc1;
  --blue-soft: #e8f0fa;
  --orange: #c98a3a;
  --orange-soft: #faf0e0;
  --ok-soft: #e6f0ea;
  --ok-line: #bcd6c6;
  --r: 10px;
  --r-lg: 16px;
  --header-h: 68px;
  --shadow-sm: 0 1px 2px rgba(31,29,25,.05), 0 2px 6px rgba(31,29,25,.05);
  --shadow: 0 4px 12px rgba(31,29,25,.07), 0 12px 32px rgba(31,29,25,.07);
  --shadow-lg: 0 10px 30px rgba(31,29,25,.10), 0 30px 60px rgba(31,29,25,.08);
  --grad-accent: linear-gradient(135deg, #2f6f4e 0%, #3f8f66 100%);
  --grad-soft: linear-gradient(180deg, #ffffff 0%, #f7f4ee 100%);
  --grad-hero: radial-gradient(1200px 600px at 50% 0%, #e6f0ea 0%, transparent 55%),
               radial-gradient(900px 500px at 85% 20%, #f7efd6 0%, transparent 50%),
               linear-gradient(180deg, #ffffff 0%, #f7f4ee 100%);
}
html[data-theme="dark"] {
  --surface: #1a1f24;
  --surface-2: #20262c;
  --surface-3: #262e35;
  --line: #2e363d;
  --line-2: #262e35;
  --ink: #f0f0f0;
  --ink-2: #b9c0c6;
  --ink-3: #808890;
  --accent: #7fc9a2;
  --accent-2: #5fb98a;
  --accent-3: #a8e0c2;
  --accent-soft: #1e2a24;
  --accent-line: #2e4a3a;
  --gold: #e0c063;
  --gold-soft: #2a2618;
  --blue: #7fa9dd;
  --blue-soft: #1a2430;
  --orange: #e0a862;
  --orange-soft: #2a2118;
  --ok-soft: #1e2a24;
  --ok-line: #2e4a3a;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3), 0 2px 6px rgba(0,0,0,.25);
  --shadow: 0 4px 12px rgba(0,0,0,.35), 0 12px 32px rgba(0,0,0,.3);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.45), 0 30px 60px rgba(0,0,0,.35);
  --grad-accent: linear-gradient(135deg, #5fb98a 0%, #7fc9a2 100%);
  --grad-soft: linear-gradient(180deg, #1f252b 0%, #1a1f24 100%);
  --grad-hero: radial-gradient(1200px 600px at 50% 0%, #1e2a24 0%, transparent 55%),
               radial-gradient(900px 500px at 85% 20%, #2a2618 0%, transparent 50%),
               linear-gradient(180deg, #1f252b 0%, #1a1f24 100%);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--surface-2);
  background-image: var(--grad-soft);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 28px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 12px; letter-spacing: -.015em; }
p { margin: 0 0 12px; }
.t-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .76rem; text-transform: uppercase;
  letter-spacing: .12em; color: var(--accent); font-weight: 700; margin-bottom: 10px;
}
.t-eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--accent); border-radius: 2px; }

/* Кнопки */
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 18px; border-radius: 10px;
  background: var(--grad-accent); color: #fff; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; font-size: .9rem;
  text-decoration: none; text-align: center;
  line-height: 1.2;
  min-height: 38px;
  box-shadow: 0 3px 10px rgba(47,111,78,.2), inset 0 1px 0 rgba(255,255,255,.15);
  transition: transform .2s ease, box-shadow .25s ease, opacity .2s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(47,111,78,.26), inset 0 1px 0 rgba(255,255,255,.15); }
.btn:active { transform: translateY(0); }
.btn.sm { padding: 6px 14px; font-size: .85rem; border-radius: 8px; min-height: 34px; }
.btn.sec { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); box-shadow: none; }
.btn.sec:hover { background: var(--accent-soft); box-shadow: 0 4px 12px rgba(47,111,78,.12); }
.btn.quiet { background: var(--surface); color: var(--ink-2); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.btn.quiet:hover { border-color: var(--accent-line); color: var(--ink); }
.btn .ripple {
  position: absolute; border-radius: 50%; transform: scale(0);
  background: rgba(255,255,255,.5); animation: ripple .6s linear; pointer-events: none;
}
.btn.sec .ripple, .btn.quiet .ripple { background: rgba(47,111,78,.25); }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }

/* Кнопка «Напиши мне в Telegram» */
.tg-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 24px;
}
.tg-btn .tg-arr {
  display: inline-block;
  transition: transform .25s ease;
}
.tg-btn:hover .tg-arr { transform: translateX(4px); }

/* Круглая кнопка переключения темы */
.theme-toggle {
  width: 38px; height: 38px; padding: 0;
  border: 1px solid var(--line); border-radius: 50%;
  background: color-mix(in oklab, var(--surface) 65%, transparent);
  backdrop-filter: blur(8px);
  cursor: pointer;
  display: inline-grid; place-items: center;
  color: var(--ink-2);
  transition: border-color .2s ease, color .2s ease, transform .25s ease, background .2s ease;
}
.theme-toggle:hover {
  border-color: var(--accent-line);
  color: var(--accent);
  background: var(--accent-soft);
  transform: rotate(20deg) scale(1.06);
}
.theme-toggle svg {
  width: 18px; height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
}
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* Шапка */
.site-bar {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in oklab, var(--surface) 88%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255,255,255,.4), 0 6px 24px rgba(31,29,25,.04);
}
.site-bar .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: var(--header-h);
  max-width: 1240px;
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; }
a.brand { color: var(--ink); text-decoration: none; }
a.brand:hover { text-decoration: none; opacity: .85; }
a.brand small { color: var(--ink-3); }
.brand .mark {
  display: inline-grid; place-items: center; width: 38px; height: 38px;
  border-radius: 10px; background: var(--grad-accent); color: #fff; font-size: 1.25rem;
  box-shadow: 0 6px 16px rgba(47,111,78,.3), inset 0 1px 0 rgba(255,255,255,.2);
  animation: markPulse 3.5s ease-in-out infinite; line-height: 1;
}
.brand .mark svg {
  width: 26px;
  height: 26px;
  display: block;
  overflow: visible;
  color: #fff;
}
.logo-nucleus {
  transform-box: fill-box;
  transform-origin: center;
  animation: logoPulse 2.4s ease-in-out infinite;
}
@keyframes logoPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}
@media (prefers-reduced-motion: reduce) {
  .logo-nucleus { animation: none; }
}
@keyframes markPulse {
  0%, 100% { box-shadow: 0 6px 16px rgba(47,111,78,.3), 0 0 0 0 rgba(47,111,78,.25); }
  50% { box-shadow: 0 6px 16px rgba(47,111,78,.3), 0 0 0 8px rgba(47,111,78,.0); }
}
.brand small { display: block; font-weight: 500; color: var(--ink-3); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; }
.brand, .site-bar .actions { flex-shrink: 0; }
.site-bar nav {
  display: flex; gap: 2px;
  flex: 1 1 auto; justify-content: center;
  flex-wrap: nowrap;
}
.site-bar nav a {
  padding: 8px 10px; border-radius: 8px; font-size: .85rem; color: var(--ink-2);
  position: relative; font-weight: 500; transition: background .2s ease, color .2s ease;
  white-space: nowrap;
}
.site-bar nav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.site-bar nav a.active { color: var(--accent); font-weight: 700; }
.site-bar nav a.active::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: 4px;
  height: 2px; background: var(--accent); border-radius: 2px; animation: navLine .3s ease;
}
@keyframes navLine { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.site-bar .actions { display: flex; gap: 10px; align-items: center; flex-wrap: nowrap; }

/* Секции */
.sec {
  position: relative; padding: 76px 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: calc(var(--header-h) + 70px);
}
.sec:first-of-type { border-top: 0; }
.sec.alt { background: color-mix(in oklab, var(--surface) 60%, transparent); }
.sec-hd { margin-bottom: 34px; max-width: 64ch; }
.sec-hd h2 {
  font-size: clamp(1.5rem, 2.6vw, 2rem); margin: 6px 0 10px;
  position: relative; padding-bottom: 12px;
}
.sec-hd h2::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 48px; height: 3px; border-radius: 2px; background: var(--grad-accent);
}
.sec-hd p { font-size: .95rem; color: var(--ink-2); }

/* Reveal */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* Hero */
.hero {
  position: relative; overflow: hidden;
  background: var(--grad-hero);
  border-bottom: 1px solid var(--line);
  text-align: center;
}
.hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-line), transparent);
}
.hero .lattice { position: absolute; inset: -10% -5% auto -5%; height: 130%; color: var(--accent); opacity: .08; pointer-events: none; animation: latticeMove 36s linear infinite; }
@keyframes latticeMove {
  0% { transform: translate(0, 0); }
  100% { transform: translate(-72px, -41.57px); }
}
.hero .wrap {
  position: relative; display: flex; flex-direction: column; align-items: center;
  padding-top: 96px; padding-bottom: 96px;
  max-width: 820px;
}
.hero h1 {
  font-size: clamp(2rem, 4.6vw, 3.1rem); line-height: 1.08; letter-spacing: -.025em;
  background: linear-gradient(135deg, var(--ink) 0%, var(--accent-3) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  max-width: 18ch;
}
html[data-theme="dark"] .hero h1 {
  background: linear-gradient(135deg, #f0f0f0 0%, var(--accent) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .sub {
  font-size: 1.28rem; font-weight: 500; color: var(--ink);
  margin-top: 20px; max-width: 52ch; line-height: 1.55;
}
.hero .cta {
  display: flex; gap: 12px; flex-wrap: wrap;
  justify-content: center; align-items: center;
  margin-top: 30px;
}
.hero .cta .btn {
  padding: 11px 26px;
  font-size: .92rem;
  border-radius: 999px;
  min-height: 42px;
}
.hero .cta .btn.sec {
  border-width: 1.5px;
}
.facts {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1px; background: var(--line); border: 1px solid var(--line);
  border-radius: var(--r-lg); overflow: hidden; margin-top: 44px;
  box-shadow: var(--shadow); width: 100%;
}
.facts div { background: var(--surface); padding: 16px 18px; text-align: center; }
.facts b { display: block; font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; color: var(--accent); }
.facts span { display: block; font-size: .78rem; color: var(--ink-3); margin-top: 4px; }
@media (max-width: 720px) {
  .facts { grid-template-columns: repeat(2, 1fr); }
  .hero .wrap { padding-top: 64px; padding-bottom: 64px; }
}

/* ============================================================
   Плавающие молекулы на фоне hero и mat-hero
   ============================================================ */
.molecules {
  position: absolute; inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.molecule {
  position: absolute;
  width: 40px; height: 40px;
  opacity: 0;
  animation: floatUp linear infinite;
}
.molecule svg { width: 100%; height: 100%; display: block; }
.molecule circle { fill: var(--accent); opacity: .3; }
.molecule line { stroke: var(--accent); stroke-width: 1.5; opacity: .22; }
.molecule.m1 { left: 6%;  width: 46px; height: 46px; animation-duration: 22s; animation-delay: 0s; }
.molecule.m2 { left: 20%; width: 28px; height: 28px; animation-duration: 28s; animation-delay: 4s; }
.molecule.m3 { left: 38%; width: 58px; height: 58px; animation-duration: 32s; animation-delay: 8s; }
.molecule.m4 { left: 56%; width: 32px; height: 32px; animation-duration: 24s; animation-delay: 2s; }
.molecule.m5 { left: 74%; width: 50px; height: 50px; animation-duration: 30s; animation-delay: 6s; }
.molecule.m6 { left: 90%; width: 36px; height: 36px; animation-duration: 26s; animation-delay: 10s; }

@keyframes floatUp {
  0%   { transform: translateY(110%) rotate(0deg); opacity: 0; }
  10%  { opacity: .8; }
  90%  { opacity: .8; }
  100% { transform: translateY(-30%) rotate(45deg); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .molecule { animation: none; opacity: .12; }
}

/* Обо мне */
.about { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 40px; align-items: start; }
.about-left { display: flex; gap: 28px; align-items: flex-start; }
.about-photo {
  flex: 0 0 240px;
  width: 240px;
  aspect-ratio: 4 / 5;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  background: var(--accent-soft);
  position: relative;
}
.about-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.about-photo::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--grad-accent);
  z-index: 2;
  border-radius: 16px 16px 0 0;
}
.about-photo::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.15);
  pointer-events: none;
}
.about .body { font-size: .96rem; line-height: 1.75; color: var(--ink-2); display: flex; flex-direction: column; gap: 14px; flex: 1; }
.about .body b { color: var(--ink); font-weight: 700; }
.creds {
  display: flex; flex-direction: column; border: 1px solid var(--line);
  border-radius: var(--r-lg); background: var(--surface); overflow: hidden;
  box-shadow: var(--shadow); position: relative;
}
.creds::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--grad-accent);
}
.creds div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; padding: 15px 18px; border-bottom: 1px solid var(--line-2); align-items: baseline; }
.creds div:last-child { border-bottom: 0; }
.creds div:hover { background: var(--surface-2); }
.creds dt { font-size: .7rem; color: var(--ink-3); margin: 0; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.creds dd { margin: 0; font-size: .9rem; }
@media (max-width: 900px) {
  .about { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .about-photo { flex: 0 0 200px; width: 200px; }
}
@media (max-width: 560px) {
  .about-left { flex-direction: column; align-items: center; text-align: center; }
  .about-photo { flex: 0 0 auto; width: 200px; }
  .about .body { text-align: left; }
}

/* Факультеты */
.fac-tabs { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 26px; justify-content: center; }
.fac-tab {
  padding: 11px 26px; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--surface); color: var(--ink-2); font-weight: 700; cursor: pointer;
  font-size: .9rem; transition: all .25s ease; position: relative; overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.fac-tab:hover { border-color: var(--accent-line); color: var(--ink); transform: translateY(-2px); box-shadow: var(--shadow); }
.fac-tab.active {
  background: var(--grad-accent); color: #fff; border-color: transparent;
  box-shadow: 0 8px 20px rgba(47,111,78,.3), inset 0 1px 0 rgba(255,255,255,.2);
}
.fac-panel {
  display: none; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); padding: 32px; box-shadow: var(--shadow-lg);
  position: relative; overflow: hidden;
}
.fac-panel::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 5px;
  background: var(--grad-accent);
}
.fac-panel.active { display: block; animation: fadeUp .45s cubic-bezier(.2,.7,.2,1); }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.fac-panel h3 { font-size: 1.35rem; margin-bottom: 8px; }
.fac-panel .fac-desc { color: var(--ink-2); font-size: .94rem; margin-bottom: 22px; }
.fac-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; }
.fac-item {
  background: var(--surface-2); border: 1px solid var(--line-2);
  border-radius: var(--r); padding: 18px;
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
  position: relative; overflow: hidden;
}
.fac-item::before {
  content: ""; position: absolute; top: 0; left: 0; width: 3px; height: 100%;
  background: var(--accent); opacity: .5;
}
.fac-item:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg), 0 0 0 1px var(--accent-line); border-color: var(--accent-line); }
.fac-item h4 { font-size: .98rem; margin: 0 0 10px; color: var(--accent); font-weight: 700; }
.fac-item ul { margin: 0; padding-left: 16px; color: var(--ink-2); font-size: .88rem; }
.fac-item li { margin-bottom: 5px; }

/* Шаги */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 22px; }
.step-c {
  display: grid; grid-template-rows: auto auto 1fr; gap: 12px;
  padding: 20px; border-radius: var(--r-lg); background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  transition: transform .3s ease, box-shadow .3s ease;
}
.step-c:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.cell {
  width: 56px; height: 56px; border: 1.5px solid var(--accent-line); border-radius: 8px;
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--surface) 100%);
  padding: 6px 7px; display: flex; flex-direction: column;
  justify-content: space-between; color: var(--accent);
  transition: transform .35s ease, box-shadow .35s ease;
  box-shadow: 0 4px 10px rgba(47,111,78,.1);
}
.step-c:hover .cell { transform: rotate(-6deg) scale(1.08); box-shadow: 0 10px 22px rgba(47,111,78,.22); }
.cell .n { font-size: .68rem; line-height: 1; font-weight: 600; opacity: .8; }
.cell .s { font-size: 1.25rem; font-weight: 800; line-height: 1; align-self: flex-end; }
.step-c h3 { font-size: 1rem; }
.step-c p { font-size: .88rem; color: var(--ink-2); line-height: 1.55; }

/* Цены */
.prices {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.price {
  background: var(--surface); padding: 28px 24px; display: flex; flex-direction: column; gap: 10px;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm); transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
  position: relative; overflow: hidden;
}
.price::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--line); transition: background .3s ease;
}
.price:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg), 0 0 0 1px var(--accent-line); border-color: var(--accent-line); }
.price:hover::before { background: var(--grad-accent); }
.price.lead { background: linear-gradient(180deg, var(--accent-soft) 0%, var(--surface) 100%); border-color: var(--accent-line); }
.price.lead::before { background: var(--grad-accent); }
.price h3 { font-size: 1rem; font-weight: 700; }
.price .v { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; color: var(--ink); }
.price .v small { font-size: .82rem; font-weight: 500; color: var(--ink-3); }
.price p { font-size: .86rem; color: var(--ink-2); line-height: 1.55; margin: 0; }
.price.lead .v { color: var(--accent); }
@media (max-width: 720px) { .prices { grid-template-columns: 1fr; } }

/* Отзывы */
.revs { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 20px; }
.rev {
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface);
  padding: 24px; display: flex; flex-direction: column;
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
  box-shadow: var(--shadow-sm); position: relative;
  border-left: 4px solid var(--accent-line);
}
.rev::before {
  content: "“"; position: absolute; top: 8px; right: 18px;
  font-size: 3rem; color: var(--accent); opacity: .15; line-height: 1; font-family: Georgia, serif;
}
.rev:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg), 0 0 0 1px var(--accent-line); }
.rev p { font-size: .92rem; line-height: 1.65; flex: 1; position: relative; z-index: 1; }
.rev .who { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-2); font-size: .82rem; color: var(--ink-3); }
.rev .who b { color: var(--accent); font-weight: 700; display: block; }
.rev .who span { display: block; margin-top: 3px; }

/* Цветные полоски отзывов по годам */
.rev[data-year="2025"] { border-left-color: var(--accent); }
.rev[data-year="2024"] { border-left-color: var(--gold); }
.rev[data-year="2023"] { border-left-color: var(--blue); }

/* Поочерёдное появление карточек отзывов */
.revs .rev {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .5s ease, transform .5s ease, box-shadow .3s ease, border-color .3s ease;
}
.revs.visible .rev {
  opacity: 1;
  transform: translateY(0);
}
.revs.visible .rev:nth-child(1) { transition-delay: 0s; }
.revs.visible .rev:nth-child(2) { transition-delay: .08s; }
.revs.visible .rev:nth-child(3) { transition-delay: .16s; }
.revs.visible .rev:nth-child(4) { transition-delay: .24s; }
.revs.visible .rev:nth-child(5) { transition-delay: .32s; }
.revs.visible .rev:nth-child(6) { transition-delay: .40s; }
.revs.visible .rev:nth-child(7) { transition-delay: .48s; }
.revs.visible .rev:nth-child(8) { transition-delay: .56s; }
.revs.visible .rev:nth-child(9) { transition-delay: .64s; }

/* Заглушка «Твой будущий отзыв» */
.rev-future {
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--surface) 100%);
  border: 2px dashed var(--accent-line);
  border-left: 4px solid var(--orange);
  box-shadow: none;
}
.rev-future::before {
  content: "?";
  font-family: inherit;
  font-size: 3rem;
  font-weight: 800;
  color: var(--orange);
  opacity: .4;
  line-height: 1;
  top: 4px;
}
.rev-future:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-sm);
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--accent-soft) 100%);
}
.rev-future p { font-style: italic; color: var(--ink-2); }
.rev-future .who b { color: var(--ink-3); }
.rev-future .who span { color: var(--ink-3); }

/* FAQ */
.faq {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); overflow: hidden; box-shadow: var(--shadow);
}
.faq details { border-bottom: 1px solid var(--line-2); }
.faq details:last-child { border-bottom: 0; }
.faq summary {
  list-style: none; cursor: pointer; padding: 18px 22px;
  font-size: .95rem; font-weight: 600; display: flex; gap: 16px; align-items: baseline;
  transition: background .2s ease;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; margin-left: auto; color: var(--accent); font-size: 1.3rem; font-weight: 400;
  transition: transform .3s ease; line-height: 1;
}
.faq details[open] summary::after { content: "–"; transform: rotate(180deg); }
.faq summary:hover { background: var(--surface-2); }
.faq .q { font-size: .72rem; color: var(--accent); font-weight: 700; letter-spacing: .05em; }
.faq .a { padding: 0 22px 20px 60px; font-size: .9rem; color: var(--ink-2); line-height: 1.65; }
.faq details[open] .a { animation: fadeUp .35s ease; }

/* Форма */
.book { display: flex; flex-direction: column; align-items: center; }
.book .form,
.book .sent { max-width: 640px; width: 100%; }
.form {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); padding: 26px; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.form::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--grad-accent);
}
.form .two { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 16px; }
.field { margin-bottom: 16px; display: flex; flex-direction: column; }
.field label { font-size: .74rem; color: var(--ink-3); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.inp {
  padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink); font: inherit; font-size: .92rem;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.inp:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(47,111,78,.12); }
textarea.inp { min-height: 84px; resize: vertical; }
.form .actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.sent {
  display: none; border: 1px solid var(--ok-line);
  background: linear-gradient(135deg, var(--ok-soft) 0%, var(--surface) 100%);
  border-radius: var(--r); padding: 18px 20px; font-size: .92rem;
  box-shadow: var(--shadow-sm);
  margin-top: 16px;
}
.sent.on { display: block; animation: fadeUp .4s ease; }
.form.done { display: none; }

/* Подвал */
footer.pg {
  border-top: 1px solid var(--line);
  background: var(--surface);
  position: relative;
}
footer.pg::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--grad-accent);
}
footer.pg .wrap {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  align-items: center;
  padding: 28px 28px 34px; font-size: .82rem; color: var(--ink-3);
}
footer.pg .tg-link {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--accent); font-weight: 600;
  padding: 6px 12px; border-radius: 999px;
  background: var(--accent-soft);
  transition: background .2s ease, transform .2s ease;
}
footer.pg .tg-link:hover {
  text-decoration: none;
  background: var(--accent-line);
  transform: translateY(-1px);
}
footer.pg .tg-icon { font-size: 1rem; line-height: 1; transition: transform .25s ease; display: inline-block; }
footer.pg .tg-link:hover .tg-icon { transform: rotate(-10deg) scale(1.1); }

/* ============================================================
   Стили страницы «Материалы»
   ============================================================ */
.mat-hero {
  position: relative; overflow: hidden; text-align: center;
  background: var(--grad-hero);
  border-bottom: 1px solid var(--line);
  padding: 72px 0 64px;
}
.mat-hero .wrap { max-width: 820px; display: flex; flex-direction: column; align-items: center; position: relative; z-index: 1; }
.mat-hero h1 {
  font-size: clamp(1.9rem, 4vw, 2.6rem); letter-spacing: -.02em;
  background: linear-gradient(135deg, var(--ink) 0%, var(--accent-3) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  max-width: 22ch;
}
html[data-theme="dark"] .mat-hero h1 {
  background: linear-gradient(135deg, #f0f0f0 0%, var(--accent) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.mat-hero .sub { font-size: 1.05rem; color: var(--ink-2); margin-top: 16px; max-width: 56ch; }

.cat-grid { display: grid; gap: 24px; }
.cat-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow);
  position: relative;
}
.cat-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--grad-accent);
}
.topic-list { list-style: none; margin: 0; padding: 0; }
.topic-item { border-bottom: 1px solid var(--line-2); }
.topic-item:last-child { border-bottom: 0; }
.topic-item a {
  display: grid; grid-template-columns: 1fr auto; gap: 16px;
  align-items: center; padding: 16px 26px;
  color: var(--ink); text-decoration: none; transition: background .2s ease;
}
.topic-item a:hover { background: var(--surface-2); text-decoration: none; }
.topic-item .t-title { font-weight: 600; font-size: .96rem; }
.topic-item .t-desc { font-size: .85rem; color: var(--ink-3); margin-top: 2px; }
.topic-item .t-meta {
  font-size: .74rem; text-transform: uppercase; letter-spacing: .06em;
  background: var(--accent-soft); color: var(--accent); padding: 4px 10px; border-radius: 999px;
  white-space: nowrap; font-weight: 600;
}
.topic-item.soon a { opacity: .55; pointer-events: none; }
.topic-item.soon .t-meta { background: var(--surface-3); color: var(--ink-3); }

/* ============================================================
   Стили страницы статьи
   ============================================================ */
.breadcrumbs { padding: 20px 0 0; font-size: .85rem; color: var(--ink-3); }
.breadcrumbs a { color: var(--ink-3); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .sep { margin: 0 8px; opacity: .5; }

.article-hero {
  position: relative; overflow: hidden;
  padding: 32px 0 40px;
  border-bottom: 1px solid var(--line);
  background: var(--grad-hero);
}
.article-hero .wrap { position: relative; z-index: 1; }
.article-hero h1 {
  font-size: clamp(1.7rem, 3.6vw, 2.4rem); letter-spacing: -.02em;
  max-width: 22ch;
}
.article-hero .lead { font-size: 1.05rem; color: var(--ink-2); margin-top: 14px; max-width: 62ch; }
.article-meta {
  display: flex; gap: 14px; flex-wrap: wrap; margin-top: 20px;
  font-size: .8rem; color: var(--ink-3);
}

.article { padding: 56px 0; }
.article-wrap {
  display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 48px; align-items: start;
}
.article-body { font-size: 1rem; line-height: 1.75; color: var(--ink-2); }
.article-body h2 {
  font-size: 1.35rem; margin: 36px 0 14px; color: var(--ink);
  padding-bottom: 8px; border-bottom: 1px solid var(--line-2);
}
.article-body h3 { font-size: 1.1rem; margin: 26px 0 10px; color: var(--ink); }
.article-body p { margin: 0 0 14px; }
.article-body ul, .article-body ol { padding-left: 22px; margin: 0 0 16px; }
.article-body li { margin-bottom: 6px; }
.article-body b { color: var(--ink); font-weight: 700; }
.article-body code {
  background: var(--surface-3); padding: 2px 6px; border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em;
  color: var(--accent-3);
}
.article-body .formula {
  display: block; background: var(--surface-2); border-left: 3px solid var(--accent);
  padding: 14px 18px; margin: 16px 0; border-radius: 0 var(--r) var(--r) 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .95rem;
  color: var(--ink); overflow-x: auto;
}
.article-body .callout {
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--surface) 100%);
  border: 1px solid var(--accent-line); border-radius: var(--r);
  padding: 18px 22px; margin: 22px 0;
}
.article-body .callout b { color: var(--accent); }

.article-aside { position: sticky; top: calc(var(--header-h) + 20px); }
.aside-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}
.aside-card h4 { font-size: .95rem; margin: 0 0 12px; color: var(--accent); }
.aside-card ul { list-style: none; padding: 0; margin: 0; }
.aside-card li { margin-bottom: 8px; font-size: .88rem; }
.aside-card li a { color: var(--ink-2); }
.aside-card li a:hover { color: var(--accent); }
.aside-cta {
  background: var(--grad-accent); color: #fff; border: none;
  border-radius: var(--r-lg); padding: 22px; text-align: center;
}
.aside-cta h4 { color: #fff; margin: 0 0 8px; font-size: 1rem; }
.aside-cta p { color: rgba(255,255,255,.85); font-size: .85rem; margin: 0 0 14px; }
.aside-cta a {
  display: inline-block; background: #fff; color: var(--accent);
  padding: 10px 20px; border-radius: 8px; font-weight: 700; font-size: .9rem;
}
.aside-cta a:hover { text-decoration: none; opacity: .92; }

@media (max-width: 900px) {
  .article-wrap { grid-template-columns: 1fr; gap: 32px; }
  .article-aside { position: static; }
}

/* Кнопка «Наверх» */
.to-top {
  position: fixed; right: 24px; bottom: 24px; z-index: 40;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--grad-accent); color: #fff; border: none; cursor: pointer;
  box-shadow: 0 8px 20px rgba(47,111,78,.35);
  opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s ease;
  display: grid; place-items: center; font-size: 1.2rem;
}
.to-top.show { opacity: 1; pointer-events: auto; }
.to-top:hover { transform: translateY(-3px); }

/* ============================================================
   Компактная шапка для внутренних страниц
   ============================================================ */
.site-bar.compact .brand small { display: none; }
.site-bar.compact .back-link {
  display: inline-flex; align-items: center; gap: 6px;
  margin-left: 4px; padding: 6px 10px; border-radius: 8px;
  font-size: .85rem; color: var(--ink-2); font-weight: 500;
}
.site-bar.compact .back-link:hover { background: var(--surface-2); color: var(--accent); text-decoration: none; }

/* ============================================================
   Sticky-строка с названием страницы и навигацией по категориям
   ============================================================ */
.page-nav {
  position: sticky; top: var(--header-h); z-index: 20;
  background: color-mix(in oklab, var(--surface) 94%, transparent);
  backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255,255,255,.3);
}
.page-nav .wrap {
  display: flex; align-items: center; gap: 20px;
  min-height: 52px; padding-top: 6px; padding-bottom: 6px;
}
.page-nav-title {
  font-weight: 700; font-size: .95rem; color: var(--ink);
  white-space: nowrap;
}
.page-nav-title::before {
  content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); margin-right: 10px; vertical-align: middle;
}
.cat-links {
  display: flex; gap: 4px; overflow-x: auto; margin-left: auto;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.cat-links::-webkit-scrollbar { display: none; }
.cat-links a {
  padding: 6px 12px; border-radius: 999px; font-size: .85rem;
  color: var(--ink-2); white-space: nowrap; font-weight: 500;
  transition: background .2s ease, color .2s ease;
}
.cat-links a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.cat-links a.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }

@media (max-width: 720px) {
  .page-nav-title { display: none; }
  .cat-links { margin-left: 0; }
}

/* ============================================================
   Превью «Материалы» на главной
   ============================================================ */
.mat-preview-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.mat-preview {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
  position: relative; overflow: hidden;
}
.mat-preview::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--grad-accent); opacity: .7;
}
.mat-preview:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--accent-line); }
.mat-preview h3 { font-size: 1rem; color: var(--accent); margin: 0 0 12px; }
.mat-preview ul { list-style: none; margin: 0 0 16px; padding: 0; flex: 1; }
.mat-preview li {
  font-size: .9rem; color: var(--ink-2); padding: 6px 0 6px 18px;
  position: relative; line-height: 1.4;
}
.mat-preview li::before {
  content: ""; position: absolute; left: 0; top: 13px;
  width: 8px; height: 1px; background: var(--accent);
}
.mat-preview .mat-count {
  font-size: .78rem; color: var(--ink-3); text-transform: uppercase;
  letter-spacing: .06em; font-weight: 600;
}

.see-all { display: flex; justify-content: center; margin-top: 34px; }
.see-all .btn { padding: 12px 28px; font-size: 1rem; min-width: 240px; }
@media (max-width: 820px) { .mat-preview-grid { grid-template-columns: 1fr; } }

/* ============================================================
   Сетка категорий материалов внутри страницы materialy.html
   ============================================================ */
.cat-block {
  padding: 48px 0 8px;
  scroll-margin-top: calc(var(--header-h) + 70px);
}
.cat-block:first-of-type { padding-top: 8px; }
.cat-block-hd {
  display: flex; align-items: center; gap: 12px; margin-bottom: 20px;
  flex-wrap: wrap;
}
.cat-block-hd h2 {
  font-size: 1.3rem; margin: 0;
  position: relative; padding-bottom: 10px;
}
.cat-block-hd h2::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 36px; height: 3px; border-radius: 2px; background: var(--grad-accent);
}
.cat-block-hd .cat-block-count {
  display: inline-flex; align-items: center;
  font-size: .72rem; color: var(--accent); text-transform: uppercase;
  letter-spacing: .06em; font-weight: 700;
  padding: 4px 10px; border-radius: 999px;
  background: var(--accent-soft);
  white-space: nowrap;
}

/* ============================================================
   Бургер-меню для мобильных
   ============================================================ */
.burger {
  display: none;
  width: 38px; height: 38px; padding: 0;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); cursor: pointer;
  align-items: center; justify-content: center;
  flex-direction: column; gap: 4px;
  transition: border-color .2s ease;
}
.burger:hover { border-color: var(--accent-line); }
.burger span {
  display: block; width: 16px; height: 2px;
  background: var(--ink-2); border-radius: 2px;
  transition: transform .25s ease, opacity .2s ease;
}
.burger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 1040px) {
  .site-bar nav { display: none; }
  .burger { display: inline-flex; }
  .site-bar.compact .back-link { display: none; }
}

.mobile-menu {
  position: fixed; top: var(--header-h); left: 0; right: 0; bottom: 0;
  background: var(--surface); z-index: 25;
  padding: 24px 28px;
  transform: translateY(-8px); opacity: 0; pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  overflow-y: auto;
}
.mobile-menu.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
.mobile-menu nav { display: flex; flex-direction: column; gap: 4px; }
.mobile-menu nav a {
  padding: 14px 16px; border-radius: 10px; font-size: 1rem;
  color: var(--ink); font-weight: 500;
  border-bottom: 1px solid var(--line-2);
}
.mobile-menu nav a:last-child { border-bottom: 0; }
.mobile-menu nav a:hover { background: var(--surface-2); text-decoration: none; }

/* ============================================================
   Прогресс-бар чтения страницы
   ============================================================ */
.read-progress {
  position: fixed; top: 0; left: 0; z-index: 100;
  height: 3px;
  width: 0%;
  background: var(--grad-accent);
  box-shadow: 0 0 8px rgba(47,111,78,.4);
  transition: width .05s linear;
  pointer-events: none;
}
/* ============================================================
   Декоративная мини-таблица Менделеева — нижняя часть hero
   ============================================================ */
.hero .periodic-deco {
  position: relative;
  margin-top: 16px;
  margin-bottom: 56px;
  display: flex;
  justify-content: center;
  pointer-events: none;
  z-index: 0;
  user-select: none;
}
.hero .periodic-deco .pt-grid { display: flex; flex-direction: column; gap: 6px; }
.hero .periodic-deco .pt-row {
  display: grid;
  grid-template-columns: repeat(18, 55px);
  gap: 6px;
}
.hero .periodic-deco .pt-cell {
  width: 55px; height: 55px;
  border-radius: 8px;
  display: grid; place-items: center;
  font-size: 18px; font-weight: 700;
  cursor: pointer;
  position: relative;
  opacity: .28;
  pointer-events: auto;
  transition: opacity .25s ease, transform .18s ease,
              box-shadow .18s ease, border-color .25s ease,
              background .25s ease, color .25s ease;
}
.hero .periodic-deco:hover .pt-cell { opacity: .55; }
.hero .periodic-deco .pt-cell:hover {
  opacity: 1;
  transform: scale(1.12);
  z-index: 5;
  box-shadow: 0 10px 28px rgba(0,0,0,.2), 0 0 0 2px var(--accent);
}

.hero .periodic-deco .pt-spacer { width: 55px; height: 55px; }
.hero .periodic-deco .pt-spacer.s16 { grid-column: span 16; }
.hero .periodic-deco .pt-spacer.s10 { grid-column: span 10; }

.hero .periodic-deco .pt-cell.nonmetal  { background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent-3); }
.hero .periodic-deco .pt-cell.metal     { background: var(--blue-soft);   border: 1px solid #b0c5e0; color: #2e4f7a; }
.hero .periodic-deco .pt-cell.noble     { background: var(--gold-soft);   border: 1px solid #d4bd6a; color: #7a5f10; }
.hero .periodic-deco .pt-cell.halogen   { background: var(--orange-soft); border: 1px solid #dbb98a; color: #7a4d10; }
.hero .periodic-deco .pt-cell.metalloid { background: #e0ecec;            border: 1px solid #a8c8c8; color: #2a5a5a; }

html[data-theme="dark"] .hero .periodic-deco .pt-cell.metal     { background: #1a2430; border-color: #3a4a5e; color: #a0c0e0; }
html[data-theme="dark"] .hero .periodic-deco .pt-cell.noble     { background: #2a2618; border-color: #5a4a20; color: #e0c063; }
html[data-theme="dark"] .hero .periodic-deco .pt-cell.halogen   { background: #2a2118; border-color: #5e4020; color: #e0a862; }
html[data-theme="dark"] .hero .periodic-deco .pt-cell.metalloid { background: #182424; border-color: #305050; color: #a0d0d0; }

/* Пояснение к таблице Менделеева — между цифрами и таблицей */
.hero .pt-info {
  position: relative;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  margin: 28px auto 0;
  background: color-mix(in oklab, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px) saturate(140%);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: .88rem;
  font-weight: 500;
  color: var(--ink-3);
  box-shadow: var(--shadow-sm);
  transition: border-color .25s ease, color .25s ease, background .25s ease;
  pointer-events: none;
  max-width: 90%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 38px;
}
.hero .pt-info.show {
  border-color: var(--accent-line);
  color: var(--ink);
  background: var(--accent-soft);
  box-shadow: var(--shadow);
}
.hero .pt-info-dot {
  flex: 0 0 auto;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 25%, transparent);
  animation: ptDotPulse 1.8s ease-in-out infinite;
}
@keyframes ptDotPulse {
  0%, 100% { box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 25%, transparent); }
  50% { box-shadow: 0 0 0 8px color-mix(in oklab, var(--accent) 0%, transparent); }
}

/* Текст hero поверх декора */
.hero .wrap {
  position: relative;
  z-index: 2;
  pointer-events: none;
}
.hero .wrap > * { pointer-events: auto; }

@media (max-width: 1250px) {
  .hero .periodic-deco { display: none; }
  .hero .pt-info { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hero .periodic-deco .pt-cell { transition: none; }
  .hero .pt-info-dot { animation: none; }
}
/* ============================================================
   МОБИЛЬНАЯ АДАПТАЦИЯ — переопределения для узких экранов
   ============================================================ */

/* --- Планшеты и небольшие ноутбуки --- */
@media (max-width: 900px) {
  .wrap { padding: 0 22px; }
  .site-bar .wrap { padding: 0 22px; }
}

/* --- Мобильные --- */
@media (max-width: 720px) {
  .wrap,
  .site-bar .wrap { padding: 0 18px; }

  /* --- Шапка: уменьшаем, чтобы всё влезло --- */
  .site-bar .wrap { gap: 10px; min-height: 60px; }
  .brand { gap: 8px; }
  .brand .mark {
    width: 34px; height: 34px;
    border-radius: 8px;
    font-size: 1.05rem;
  }
  .brand .mark svg { width: 22px; height: 22px; }
  .brand span:last-child { font-size: .95rem; }
  .brand small { font-size: .6rem; letter-spacing: .05em; }
  .actions { gap: 6px; }
  .site-bar .actions .btn.sm { padding: 6px 12px; font-size: .78rem; min-height: 32px; }
  .theme-toggle { width: 34px; height: 34px; }
  .theme-toggle svg { width: 16px; height: 16px; }
  .burger { width: 34px; height: 34px; }

  /* --- Секции: меньше вертикальные отступы --- */
  .sec { padding: 56px 0; }
  .sec-hd { margin-bottom: 26px; }
  .sec-hd h2 { font-size: 1.35rem; margin: 4px 0 8px; padding-bottom: 10px; }
  .sec-hd h2::after { width: 36px; height: 3px; }
  .sec-hd p { font-size: .9rem; }

  /* --- Hero: подгоняем типографику --- */
  .hero .wrap {
    padding-top: 48px;
    padding-bottom: 48px;
  }
  .hero h1 { max-width: 100%; }
  .hero .sub { max-width: 100%; }

  /* --- Факты: чуть плотнее --- */
  .facts div { padding: 12px 12px; }
  .facts b { font-size: 1.15rem; }
  .facts span { font-size: .7rem; }
  .facts { margin-top: 32px; }

  /* --- Обо мне --- */
  .about-left { gap: 18px; }
  .about .body { font-size: .92rem; line-height: 1.7; }

  /* --- Факультеты: панель и карточки компактнее --- */
  .fac-panel { padding: 20px 18px; }
  .fac-panel h3 { font-size: 1.15rem; }
  .fac-panel .fac-desc { font-size: .88rem; margin-bottom: 16px; }
  .fac-grid { gap: 14px; }
  .fac-item { padding: 14px 14px; }
  .fac-item h4 { font-size: .92rem; margin-bottom: 8px; }
  .fac-item ul { font-size: .84rem; padding-left: 14px; }

  /* --- Шаги --- */
  .steps { gap: 14px; }
  .step-c { padding: 16px; }
  .step-c h3 { font-size: .95rem; }
  .step-c p { font-size: .84rem; }

  /* --- Цены --- */
  .price { padding: 22px 20px; }
  .price .v { font-size: 1.7rem; }

  /* --- Отзывы --- */
  .revs { gap: 14px; }
  .rev { padding: 18px; }
  .rev p { font-size: .88rem; }
  .rev .who { font-size: .78rem; }

  /* --- FAQ --- */
  .faq summary { padding: 14px 16px; font-size: .9rem; gap: 12px; }
  .faq .a { padding: 0 16px 16px 44px; font-size: .86rem; }

  /* --- Форма: убираем лишний воздух --- */
  .form { padding: 20px 18px; }
  .book .form,
  .book .sent { max-width: 100%; }
  .field label { font-size: .72rem; }
  .inp { font-size: .9rem; padding: 10px 12px; }

  /* --- Превью материалов --- */
  .mat-preview { padding: 18px; }
  .mat-preview h3 { font-size: .95rem; }
  .mat-preview li { font-size: .86rem; }

  /* --- Категории материалов --- */
  .cat-block { padding: 36px 0 8px; }
  .cat-block-hd { margin-bottom: 14px; }
  .cat-block-hd h2 { font-size: 1.15rem; }
  .cat-block-hd .cat-block-count { font-size: .68rem; padding: 3px 8px; }

  /* --- Список тем --- */
  .topic-item a { padding: 14px 18px; gap: 12px; }
  .topic-item .t-title { font-size: .92rem; }
  .topic-item .t-desc { font-size: .78rem; }
  .topic-item .t-meta { font-size: .68rem; padding: 3px 8px; }

  /* --- Страница статьи --- */
  .article-hero { padding: 24px 0 28px; }
  .article-hero h1 { font-size: 1.45rem; }
  .article-hero .lead { font-size: .92rem; }
  .article-meta { font-size: .74rem; gap: 10px; }
  .article { padding: 32px 0; }
  .article-body { font-size: .95rem; line-height: 1.7; }
  .article-body h2 { font-size: 1.15rem; margin: 26px 0 12px; }
  .article-body h3 { font-size: 1rem; margin: 20px 0 8px; }
  .article-body ul,
  .article-body ol { padding-left: 18px; }
  .article-body .formula { font-size: .82rem; padding: 10px 14px; margin: 12px 0; }
  .article-body .callout { padding: 14px 16px; margin: 16px 0; }
  .breadcrumbs { font-size: .78rem; padding-top: 14px; }

  /* --- Sticky-навигация по категориям --- */
  .page-nav .wrap { min-height: 46px; padding: 4px 0; gap: 12px; }
  .cat-links a { padding: 5px 10px; font-size: .78rem; }

  /* --- Кнопки: уменьшаем общие размеры --- */
  .btn { padding: 10px 16px; font-size: .88rem; min-height: 40px; }
  .btn.sm { padding: 6px 12px; font-size: .8rem; min-height: 32px; }

  /* --- Кнопка «Все ... →» --- */
  .see-all .btn {
    padding: 11px 22px;
    font-size: .92rem;
    min-width: 0;
    width: 100%;
    max-width: 300px;
  }

  /* --- Кнопка Telegram --- */
  .tg-btn { padding: 11px 20px; font-size: .9rem; }
  .tg-btn .tg-arr { font-size: 1rem; }

  /* --- Подвал --- */
  footer.pg .wrap {
    flex-direction: column;
    text-align: center;
    gap: 12px;
    padding: 22px 18px 26px;
    font-size: .76rem;
  }

  /* --- Кнопка «Наверх» --- */
  .to-top { right: 16px; bottom: 16px; width: 40px; height: 40px; font-size: 1.1rem; }

  /* --- Плавающие молекулы на hero: отключаем на мобильных --- */
  .molecules { display: none; }

  /* --- Периодическая таблица: уже скрыта на <1250px --- */
}

/* --- Очень узкие экраны (< 480px) --- */
@media (max-width: 480px) {
  .wrap,
  .site-bar .wrap { padding: 0 14px; }

  /* --- Шапка: прячем подпись бренда и кнопку Записаться --- */
  .brand small { display: none; }
  .brand span:last-child { font-size: .92rem; }
  .site-bar .actions .btn.sm { display: none; }  /* Прячем — есть в hero */

  /* --- Hero --- */
  .hero .wrap { padding-top: 40px; padding-bottom: 40px; }
  .hero h1 { font-size: 1.55rem; line-height: 1.15; }
  .hero .sub { font-size: .96rem; margin-top: 14px; }
  .hero .cta { margin-top: 22px; gap: 10px; }
  .hero .cta .btn { padding: 11px 20px; font-size: .88rem; min-height: 42px; border-radius: 999px; }
  .facts { margin-top: 28px; }

  /* --- Обо мне --- */
  .about-photo { width: 160px; flex: 0 0 160px; }
  .creds div { grid-template-columns: 80px minmax(0, 1fr); gap: 10px; padding: 12px 14px; }
  .creds dt { font-size: .64rem; }
  .creds dd { font-size: .84rem; }

  /* --- Секции --- */
  .sec { padding: 44px 0; }
  .sec-hd h2 { font-size: 1.25rem; }

  /* --- Форма: одна колонка --- */
  .form { padding: 18px 14px; }
  .form .two { grid-template-columns: 1fr; gap: 0; }
  .field { margin-bottom: 14px; }

  /* --- Отзывы --- */
  .rev { padding: 16px; }

  /* --- FAQ --- */
  .faq summary { padding: 12px 14px; font-size: .86rem; }
  .faq .a { padding: 0 14px 14px 38px; font-size: .82rem; }

  /* --- Категории материалов --- */
  .topic-item a { padding: 12px 14px; grid-template-columns: 1fr auto; gap: 8px; }
  .topic-item .t-title { font-size: .88rem; }
  .topic-item .t-meta { font-size: .62rem; padding: 2px 7px; }

  /* --- Статья --- */
  .article-hero h1 { font-size: 1.3rem; }
  .article-body { font-size: .92rem; }
  .article-body h2 { font-size: 1.08rem; }

  /* --- Превью материалов --- */
  .mat-preview { padding: 16px; }
  .mat-preview h3 { font-size: .9rem; }
  .mat-preview li { font-size: .82rem; padding: 5px 0 5px 16px; }
}

/* --- Совсем узкие экраны (< 380px) --- */
@media (max-width: 380px) {
  .facts div { padding: 10px 10px; }
  .facts b { font-size: 1.05rem; }
  .facts span { font-size: .66rem; }
  .hero h1 { font-size: 1.4rem; }
  .hero .sub { font-size: .9rem; }
  .brand span:last-child { font-size: .88rem; }
  .brand .mark { width: 30px; height: 30px; }
  .brand .mark svg { width: 20px; height: 20px; }
  .theme-toggle { width: 32px; height: 32px; }
  .burger { width: 32px; height: 32px; }
}

/* --- Фикс от горизонтального скролла --- */
html, body { max-width: 100%; overflow-x: hidden; }
.hero, .sec, .mat-hero, .article-hero, .page-nav, .site-bar { max-width: 100vw; }
/* Honeypot — визуально скрыт, но НЕ через display:none.
   Боты часто определяют display:none и не заполняют такое поле,
   поэтому используем позиционирование за пределами экрана. */
.hp {
  position: absolute !important;
  left: -9999px !important;
  top: auto !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
/* ============================================================
   Чекбокс согласия на обработку персональных данных
   ============================================================ */
.field.consent {
  margin-top: 4px;
  margin-bottom: 18px;
}
.field.consent .checkbox-label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: .84rem;
  color: var(--ink-2);
  line-height: 1.5;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  margin-bottom: 0;
}
.field.consent .checkbox-label input[type="checkbox"] {
  margin-top: 3px;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}
.field.consent .checkbox-label a {
  color: var(--accent);
  text-decoration: underline;
}