/* =========================================================
   Портал педагога — осовремененная версия текущего дизайна
   Палитра и структура сохранены: голубой / синий / красный / жёлтый
   ========================================================= */

:root {
  --brand: #1e628d;
  --brand-d: #154a6b;
  --brand-l: #78bbe6;
  --sky: #a9d6ef;
  --tab-hover: #a9d6ef;
  --navy: #204964;
  --navy-d: #173a52;
  --red: #c9030c;
  --yellow: #ffc103;

  --bg: #eef4f8;
  --surface: #fff;
  --text: #1d2f3c;
  --muted: #5b7285;
  --line: #dce8f0;
  --line-2: #eaf2f7;

  --tint: #eef5fa;
  --tint-2: #f0f7fc;
  --tint-3: #dceef9;
  --tint-4: #eaf3f9;
  --tint-5: #fbfdfe;
  --pic-a: #f4f9fc;
  --pic-b: #e7f1f8;
  --tab-cta-bg: #fff4d2;
  --tab-cta-fg: #8a5c00;
  --search-bg: rgba(255, 255, 255, .96);
  --cookie-bg: rgba(255, 255, 255, .97);
  --tile-bg: #fff;
  --theme-btn-bg: #56768e; /* было #5c7f99: белый текст давал 4.24:1, стало 4.80:1 */
  --theme-btn-fg: #ffffff;
  --heading: #204964;

  color-scheme: light;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;

  --shadow-sm: 0 1px 2px rgba(23, 58, 82, .05), 0 3px 10px rgba(23, 58, 82, .05);
  --shadow-md: 0 2px 6px rgba(23, 58, 82, .06), 0 12px 28px rgba(23, 58, 82, .09);
  --shadow-lg: 0 10px 30px rgba(23, 58, 82, .14);

  --wrap: 1120px;
  --font: "Golos Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-d); }

h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }

:focus-visible { outline: 3px solid rgba(30, 98, 141, .45); outline-offset: 3px; border-radius: 6px; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(14px, 3vw, 28px);
}

.skip {
  position: fixed; top: 8px; left: 8px; z-index: 100;
  padding: 10px 16px; border-radius: 8px;
  background: var(--navy-d); color: #fff;
  transform: translateY(-160%); transition: transform .2s;
}
.skip:focus { transform: none; color: #fff; }

/* ---------- верхняя полоса ---------- */
.strip {
  background: var(--surface);
  border-bottom: 1px solid var(--line-2);
  font-size: 12.5px;
  color: var(--muted);
}
.strip__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 34px;
  padding-block: 4px;
}
.strip__date { font-weight: 500; color: var(--text); }

/* ---------- вкладки ---------- */
.tabs {
  background: var(--surface);
  padding-top: 10px;
  border-bottom: 3px solid var(--brand);
}
.tabs__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tab {
  flex: 1 1 0;
  min-width: 0;
  padding: 11px 8px;
  border-radius: 10px 10px 0 0;
  background: var(--tint);
  color: var(--brand);
  font-size: 15.5px;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background-color .16s, color .16s;
}
.tab:hover { background: var(--tab-hover); color: #fff; }
.tab.is-active { background: var(--brand); color: #fff; }
.tab--cta { background: var(--tab-cta-bg); color: var(--tab-cta-fg); }
.tab--cta:hover { background: var(--yellow); color: #3a2800; }
/* ---------- служебная страница ---------- */
.page { padding-block: clamp(36px, 6vw, 72px); }
.page__card {
  max-width: 720px;
  margin-inline: auto;
  padding: clamp(24px, 4vw, 40px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  text-align: center;
}
.page__icon {
  display: grid;
  place-items: center;
  width: 64px; height: 64px;
  margin: 0 auto 18px;
  border-radius: 18px;
  background: var(--tint-4);
  color: var(--brand);
  font-size: 28px;
}
.page h1 { font-size: clamp(26px, 3vw, 34px); color: var(--heading); margin-bottom: 12px; }
.page p { color: var(--muted); font-size: 15.5px; max-width: 46em; margin: 0 auto 22px; }

/* ---------- синяя шапка ---------- */
.brandbar {
  background: linear-gradient(100deg, #5fa9d6 0%, var(--brand) 62%, var(--brand-d) 100%);
}
.brandbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 104px;
  padding-block: 14px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  color: #fff;
}
.brand:hover { color: #fff; }
.brand__logo {
  width: 64px;
  height: 64px;
  flex: none;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .18));
}
.brand__name {
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  line-height: 1.1;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}

.search {
  display: flex;
  align-items: center;
  flex: 0 1 340px;
  min-width: 200px;
  height: 44px;
  padding: 4px 4px 4px 16px;
  border-radius: 999px;
  background: var(--search-bg);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
}
.search__input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 14.5px;
  color: var(--text);
  outline: none;
}
.search__input::placeholder { color: #7d94a5; }
.search__btn {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  transition: background-color .16s;
}
.search__btn:hover { background: var(--brand-d); }
.search__btn svg { width: 19px; height: 19px; }

/* ---------- тёмный блок ---------- */
.hero {
  background: var(--navy);
  padding-block: 22px 26px;
}
.hero__banner {
  position: relative;
  min-height: 236px;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: url("/images/banner_portal.jpg") center / cover no-repeat;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), var(--shadow-lg);
}
.hero__banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(32, 73, 100, 0) 30%, rgba(32, 73, 100, .55) 58%, rgba(23, 58, 82, .92) 100%);
}
.hero__text {
  position: relative;
  z-index: 1;
  max-width: 700px;
  margin-left: auto;
  padding: 34px clamp(20px, 4vw, 44px);
  text-align: right;
  color: #fff;
}
.hero__kicker {
  display: block;
  font-size: clamp(15px, 1.6vw, 20px);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--sky);
}
.hero__title {
  margin: 4px 0 14px;
  font-size: clamp(20px, 2.15vw, 28px);
  font-weight: 600;
  letter-spacing: .03em;
  line-height: 1.2;
  text-transform: uppercase;
}
.hero__smi {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  font-size: clamp(12.5px, 1.1vw, 14.5px);
  line-height: 1.3;
}
.hero__smi span { font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }

/* образцы документов */
.collage {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}
.tile {
  position: relative;
  display: block;
  aspect-ratio: 85 / 118;
  padding: 4px;
  border-radius: 9px;
  background: var(--tile-bg);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .18);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}
.tile img {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(100% - 8px);
  height: calc(100% - 8px);
  object-fit: cover;
  border-radius: 5px;
  box-shadow: 0 0 0 1px rgba(23, 58, 82, .14);
}
.tile:hover { transform: translateY(-4px); box-shadow: 0 10px 24px rgba(0, 0, 0, .28); }
.tile__overlay {
  position: absolute;
  inset: 4px;
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 7px;
  background: linear-gradient(180deg, rgba(23, 58, 82, .72) 0%, rgba(23, 58, 82, .93) 42%, rgba(23, 58, 82, .97) 100%);
  opacity: 0;
  transition: opacity .18s ease;
}
.tile:hover .tile__overlay,
.tile:focus-visible .tile__overlay { opacity: 1; }
.tile__cap {
  display: block;
  color: #fff;
  font-size: 9.5px;
  line-height: 1.28;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .4);
}

/* ---------- вводный текст ---------- */
.intro { background: var(--navy); padding-bottom: 30px; }
.intro__inner { text-align: center; }
.intro p {
  max-width: 860px;
  margin-inline: auto;
  color: rgba(255, 255, 255, .82);
  font-size: 14.5px;
  line-height: 1.6;
}
.intro a { color: var(--sky); text-decoration: underline; text-underline-offset: 3px; }
.intro a:hover { color: #fff; }

/* ---------- секции ---------- */
.section { padding-block: clamp(26px, 4vw, 46px); }
.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--line);
}
.section__head h2 {
  font-size: clamp(20px, 2.2vw, 26px);
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--heading);
}
.section__link { font-size: 14px; font-weight: 500; white-space: nowrap; }
.section__link span { display: inline-block; transition: transform .16s; }
.section__link:hover span { transform: translateX(3px); }

/* ---------- услуги ---------- */
.services { background: var(--bg); }
.svc {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: clamp(20px, 3vw, 34px);
  padding: clamp(16px, 2.4vw, 26px);
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .18s ease, transform .18s ease;
}
.svc:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.svc__pic {
  display: block;
  align-self: start;
  padding: 8px;
  border-radius: var(--r);
  background: linear-gradient(180deg, var(--pic-a), var(--pic-b));
  border: 1px solid var(--line);
}
.svc__pic img {
  width: 100%;
  aspect-ratio: 210 / 287;
  object-fit: cover;
  border-radius: 7px;
  box-shadow: 0 6px 16px rgba(23, 58, 82, .16);
}
.svc__title {
  font-size: clamp(17px, 1.7vw, 21px);
  font-weight: 600;
  line-height: 1.3;
  color: var(--heading);
  margin-bottom: 10px;
}
.svc__text { font-size: 15px; line-height: 1.65; color: var(--muted); }
.svc__text strong { color: var(--text); font-weight: 600; }
.svc__text a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }
.svc__text br + br { line-height: .6; }

.btn-blue {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  margin-top: 18px;
  padding: 10px 26px;
  border-radius: 10px;
  /* было #6fb5df → белый текст на светлой части давал ~2.2:1; теперь ≥4.65:1 */
  background: linear-gradient(180deg, #2f7ba8, var(--brand));
  color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .35) inset, 0 6px 16px rgba(30, 98, 141, .28);
  transition: filter .16s, transform .16s;
  text-align: center;
}
.btn-blue:hover { color: #fff; filter: brightness(1.06); transform: translateY(-1px); }
.btn-blue__main { font-size: 14.5px; font-weight: 600; }
.btn-blue__cap { font-size: 11px; color: #fff; font-weight: 400; }

/* ---------- панели списков ---------- */
.lists { background: var(--surface); }
.panel {
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  background: linear-gradient(180deg, #2d6f99, var(--brand-d));
  color: #fff;
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: .02em;
}
.panel__head:hover { color: #fff; filter: brightness(1.07); }
.panel__go {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, .78);
  white-space: nowrap;
}
.panel__go span { transition: transform .16s; }
.panel__head:hover .panel__go span { transform: translateX(3px); }
.panel--solo { display: block; margin-bottom: 18px; }
.panel--solo .panel__head { border-radius: var(--r); }
.cat__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 20px;
  background: var(--tint-3);
  color: var(--brand-d);
  font-weight: 600;
  font-size: 15px;
}
.cat__all { font-size: 13px; font-weight: 500; white-space: nowrap; }
.cat__all span { display: inline-block; transition: transform .16s; }
.cat__all:hover span { transform: translateX(3px); }
.cat__list { padding: 4px 10px 10px; }
.cat__list li + li { border-top: 1px dashed var(--line); }
.cat__list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--text);
  font-size: 14.5px;
  transition: background-color .14s, color .14s;
}
.cat__list a:hover { background: var(--tint-2); color: var(--brand); }
.cat__list .arr { color: var(--brand); flex: none; }
.cat__list--plain { padding: 8px 10px; }

/* ---------- публикации ---------- */
.pubs { background: var(--bg); }
.pubs__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.pub {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .16s, transform .16s;
}
.pub:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.pub__date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 8px 4px;
  border-radius: 10px;
  background: var(--tint-4);
  color: var(--brand);
  font-size: 11.5px;
  line-height: 1.2;
  text-align: center;
  text-transform: lowercase;
}
.pub__date b { font-size: 22px; line-height: 1; letter-spacing: -.02em; }
.pub__title { font-size: 15.5px; font-weight: 600; line-height: 1.35; margin-bottom: 5px; }
.pub__title a { color: var(--text); }
.pub__title a:hover { color: var(--brand); }
.pub__author { font-size: 12.5px; color: var(--muted); }

/* ---------- ФГОС ---------- */
.reference { background: var(--surface); }
.reference__inner {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  gap: clamp(20px, 4vw, 48px);
  align-items: start;
}
.reference__col h2 {
  font-size: clamp(20px, 2.2vw, 26px);
  color: var(--heading);
  font-weight: 600;
  margin-bottom: 10px;
}
.reference__lead { color: var(--muted); font-size: 15px; }
.linklist {
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.linklist li + li { border-top: 1px solid var(--line-2); }
.linklist a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 16px;
  font-size: 14.5px;
  color: var(--text);
  background: var(--tint-5);
  transition: background-color .14s, color .14s;
}
.linklist a:hover { background: var(--tint-2); color: var(--brand); }
.linklist .arr { color: var(--brand); flex: none; }

/* ---------- новости ---------- */
.news { background: var(--bg); }
.news__list {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.news-item {
  display: grid;
  grid-template-columns: 165px minmax(0, 1fr);
  gap: 18px;
  padding: 13px 18px;
}
.news-item + .news-item { border-top: 1px solid var(--line-2); }
.news-item time { font-size: 13px; color: var(--muted); }
.news-item a { color: var(--text); font-size: 14.5px; font-weight: 500; }
.news-item a:hover { color: var(--brand); }

/* ---------- реквизиты ---------- */
.legal { background: var(--surface); padding-block: 8px 26px; }
.legal__inner {
  display: grid;
  gap: 6px;
  padding-top: 18px;
  border-top: 1px solid var(--line-2);
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
}

/* ---------- подвал ---------- */
.footer { background: var(--navy-d); color: rgba(255, 255, 255, .72); padding-top: 34px; }
.footer__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(0, .8fr));
  gap: 34px;
  padding-bottom: 30px;
}
.brand--footer { gap: 10px; margin-bottom: 12px; }
.brand--footer .brand__logo { width: 40px; height: 40px; }
.brand--footer .brand__name { font-size: 19px; letter-spacing: .06em; }
.footer__brand p { font-size: 12.5px; line-height: 1.6; margin-bottom: 8px; max-width: 36em; }
.footer__col { display: flex; flex-direction: column; gap: 9px; }
.footer__col h3 {
  margin-bottom: 4px;
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #fff;
  font-weight: 600;
}
.footer__col a { color: rgba(255, 255, 255, .7); font-size: 14px; }
.footer__col a:hover { color: #fff; }
.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  padding-block: 16px 22px;
  border-top: 1px solid rgba(255, 255, 255, .12);
  font-size: 12px;
  color: rgba(255, 255, 255, .45);
}

/* ---------- cookie ---------- */
.cookie {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 60;
  background: var(--cookie-bg);
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 24px rgba(23, 58, 82, .12);
  backdrop-filter: blur(8px);
}
.cookie.is-hidden { display: none; }
.cookie__inner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-block: 10px;
}
.cookie p { font-size: 12px; line-height: 1.45; color: var(--muted); }
.cookie__btn {
  flex: none;
  padding: 9px 24px;
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.cookie__btn:hover { background: var(--brand-d); }


/* ---------- бургер (мобильная шапка) ---------- */
.header-stack { position: relative; z-index: 45; }
.burger {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 44px; height: 44px;
  flex: none;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .38);
  border-radius: 12px;
  background: rgba(255, 255, 255, .14);
  cursor: pointer;
  transition: background-color .16s;
}
.burger:hover { background: rgba(255, 255, 255, .24); }
.burger span {
  display: block;
  width: 20px; height: 2px;
  border-radius: 2px;
  background: #fff;
  transition: transform .2s, opacity .2s;
}
body.nav-open .scroll-nav { opacity: 0; visibility: hidden; }
body.nav-open .burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.nav-open .burger span:nth-child(2) { opacity: 0; }
body.nav-open .burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- переключатель темы ---------- */
.strip__right { display: inline-flex; align-items: center; gap: 12px; }
.theme {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  flex: none;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--theme-btn-bg);
  color: var(--theme-btn-fg);
  font: inherit;
  font-size: 12.5px;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: filter .16s, background-color .16s, color .16s;
}
.theme:hover { filter: brightness(1.07); }
.theme svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme__sun { display: none; }
.theme__label--to-light { display: none; }
html[data-theme="dark"] .theme__label--to-dark { display: none; }
html[data-theme="dark"] .theme__label--to-light { display: inline; }
html[data-theme="dark"] .theme__sun { display: block; }
html[data-theme="dark"] .theme__moon { display: none; }

/* ---------- тёмная тема ---------- */
html[data-theme="dark"] {
  --brand: #4fa8dc;
  --brand-d: #74c4ef;
  --brand-l: #6fb8e2;
  --sky: #b7dff5;
  --tab-hover: #24506a;
  --navy: #142b3a;
  --navy-d: #0c1720;

  --bg: #0e1a24;
  --surface: #15232e;
  --text: #e6eef4;
  --muted: #a9bdcc;
  --line: #263a4b;
  --line-2: #1f3140;
  --heading: #dbe7f0;

  --tint: #1c2c39;
  --tint-2: #223542;
  --tint-3: #1b3648;
  --tint-4: #1b2f3e;
  --tint-5: #182833;
  --pic-a: #1d2f3d;
  --pic-b: #192935;
  --tab-cta-bg: #3a2f12;
  --tab-cta-fg: #ffd45e;
  --search-bg: rgba(28, 44, 57, .92);
  --cookie-bg: rgba(18, 29, 38, .97);
  --tile-bg: #33485a;
  --theme-btn-bg: #a9bcc9;
  --theme-btn-fg: #223340;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .45), 0 3px 10px rgba(0, 0, 0, .3);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, .5), 0 12px 28px rgba(0, 0, 0, .38);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, .55);

  color-scheme: dark;
}
html[data-theme="dark"] .brandbar {
  background: linear-gradient(100deg, #1c3e52 0%, #143141 62%, #0e2431 100%);
}
html[data-theme="dark"] .tab.is-active { background: #2a76a2; color: #fff; }
html[data-theme="dark"] .search__input { color: #16232e; }
html[data-theme="dark"] .search__input::placeholder { color: #6c8496; }

html[data-theme="dark"] .tab:hover { background: var(--tab-hover); color: #fff; }
html[data-theme="dark"] .panel__head { background: linear-gradient(180deg, #21536e, #16374a); }
html[data-theme="dark"] .btn-blue { background: linear-gradient(180deg, #2f7ba8, #1e628d); }
html[data-theme="dark"] .search__btn,
html[data-theme="dark"] .cookie__btn { background: #1d5d85; }
html[data-theme="dark"] .search__btn:hover,
html[data-theme="dark"] .cookie__btn:hover { background: #174b6c; }
html[data-theme="dark"] .tile { box-shadow: 0 4px 14px rgba(0, 0, 0, .5); }
html[data-theme="dark"] .tile:hover { box-shadow: 0 10px 26px rgba(0, 0, 0, .6); }


/* ---------- кнопки навигации по странице ---------- */
.scroll-nav {
  position: fixed;
  right: clamp(12px, 2vw, 24px);
  bottom: calc(var(--cookie-h, 0px) + 18px);
  z-index: 55;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.scroll-btn {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--brand);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .18s, transform .18s, visibility .18s, background-color .16s, color .16s, border-color .16s;
}
.scroll-btn.is-visible { opacity: 1; visibility: visible; transform: none; }
.scroll-btn:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.scroll-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
html[data-theme="dark"] .scroll-btn { background: #1b2e3d; border-color: #2b4356; color: #7cc4ea; }
html[data-theme="dark"] .scroll-btn:hover { background: #2a76a2; border-color: #2a76a2; color: #fff; }
body { --cookie-h: 76px; }
body.cookie-off { --cookie-h: 0px; }

/* =========================================================
   Адаптив
   ========================================================= */
@media (max-width: 1024px) {
  .collage { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .svc { grid-template-columns: 190px minmax(0, 1fr); }
  .hero__text { max-width: 520px; }
}

@media (max-width: 820px) {
  .burger { display: inline-flex; }

  .tabs {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    z-index: 60;
    max-height: calc(100vh - 96px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 10px 16px 14px;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    background: var(--surface);
  }
  body.nav-open .tabs { display: block; }
  .tabs__inner { flex-direction: column; gap: 5px; }
  .tab {
    flex: none;
    width: 100%;
    padding: 13px 16px;
    border-radius: 10px;
    background: var(--tint);
    font-size: 16px;
    text-align: left;
  }

  .brandbar__inner { min-height: 84px; gap: 12px; }
  .brand__logo { width: 48px; height: 48px; }
  .search { flex: 1 1 200px; }

  .hero__banner { min-height: 210px; }
  .hero__text { max-width: none; padding: 26px 20px; }
  .hero__banner::after { background: linear-gradient(180deg, rgba(23,58,82,.35) 0%, rgba(23,58,82,.72) 52%, rgba(23,58,82,.95) 100%); }

  .collage { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }

  .svc { grid-template-columns: 150px minmax(0, 1fr); }
  .pubs__list { grid-template-columns: 1fr; }
  .reference__inner { grid-template-columns: 1fr; }
  .footer__inner { grid-template-columns: 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  .strip__left { display: none; }
  .strip__inner { justify-content: flex-end; }
  .strip__right { flex-wrap: wrap; justify-content: flex-end; row-gap: 6px; }
  .brandbar__inner { flex-wrap: wrap; }
  .brand { flex: 1 1 auto; min-width: 0; gap: 10px; }
  .brand__logo { width: 40px; height: 40px; }
  .brand__name { font-size: 16px; letter-spacing: .03em; }
  .search { flex: 1 1 100%; order: 3; }
  .hero__text { text-align: center; padding: 26px 18px; }
  .hero__smi { justify-content: center; }
  .hero__title { text-shadow: 0 2px 10px rgba(0,0,0,.25); }

  .collage { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tile:nth-child(n+10) { display: none; }

  .svc { grid-template-columns: 1fr; }
  .svc__pic { max-width: 200px; }
  .btn-blue { width: 100%; }

  .cat__head { flex-direction: column; align-items: flex-start; gap: 4px; }
  .news-item { grid-template-columns: 1fr; gap: 3px; }
  .footer__inner { grid-template-columns: 1fr; }
  .cookie__inner { flex-direction: column; align-items: stretch; gap: 8px; }
  body { --cookie-h: 128px; }
  .cookie__btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .001ms !important; animation: none !important; }
  html { scroll-behavior: auto; }
}
