/* =========================================================
   Тема по буклету «Справочник абитуриента. Физфак МГУ» (2026)
   Подключается после всех остальных стилей и переопределяет их.
   ========================================================= */

:root {
  /* Один тон: индиго #2A2055, белый и светлые оттенки того же тона */
  --night: #1A1438;        /* тот же индиго, темнее: низ градиента и наведение */
  --indigo: #2A2055;       /* основной цвет */
  --royal: #2A2055;
  --violet: #2A2055;       /* акцент = тот же индиго (имя оставлено для совместимости) */
  --periwinkle: #2A2055;
  --mint: #FFFFFF;         /* акцент на тёмном фоне — белый */
  --sky: #A9A3C8;
  --hover: #2A2055;        /* наведение — тот же индиго, что в шапке */

  --ink: #1B1640;          /* основной текст */
  --ink-soft: #4B4670;     /* второстепенный текст */
  --paper: #FFFFFF;        /* основной фон — белый */
  --lilac-50: #FFFFFF;     /* мелкие подложки — белые, с тонкой рамкой там, где нужна граница */
  --lilac-100: #ECEAF4;
  --lilac-200: #D7D3E6;

  --grad-cover: var(--indigo);        /* тёмное поле ровное, без градиента */
  --grad-pill: linear-gradient(180deg, #66DBD2 0%, #685DF7 100%);   /* «таблетки» буклета: мятный → фиолетовый */
  --grad-pill-h: linear-gradient(90deg, #8FE0DA 0%, #8F88F5 100%);   /* треки: тот же переход, мягче */
  --grad-pill-light: linear-gradient(180deg, rgba(255, 255, 255, .9) 0%, rgba(255, 255, 255, .22) 100%); /* на тёмном */

  --font-display: 'Unbounded', 'Geologica', sans-serif;
  --font-text: 'Jost', 'Geologica', sans-serif;

  /* Шкала: заголовок, подзаголовок, текст, мелкий (+ крупные цифры и первый экран) */
  --fs-hero: clamp(1.7rem, 1rem + 2.4vw, 2.85rem);
  --fs-head: clamp(1.6rem, 1.05rem + 2vw, 2.75rem);
  --fs-num: clamp(2rem, 1.4rem + 2vw, 3rem);
  --fs-sub: 20px;
  --fs-text: 17px;
  --fs-small: 14px;
  --expo: cubic-bezier(.16, 1, .3, 1);

  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(26, 22, 45, .10);
  --header-h: 72px;
}

/* ---------- База ---------- */
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }

body {
  font-family: var(--font-text);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .page-hero__title, .section-title, .facts-title, .olympiad-title {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}

h2 {
  font-weight: 700;
  font-size: var(--fs-head);
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--violet);
}

h3 {
  font-weight: 700;
  font-size: var(--fs-sub);
  line-height: 1.25;
}

p { font-size: var(--fs-text); line-height: 1.5; }

a { color: var(--indigo); }

::selection { background: var(--violet); color: #fff; }

/* ---------- Шапка ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--grad-cover);
  padding: 0;
  box-shadow: 0 6px 24px rgba(26, 22, 45, .25);
}

.header .wrapper { max-width: 1240px; }

.header .container {
  min-height: var(--header-h);
  max-width: none;
  padding: 0;
  gap: 24px;
}

.logo { display: inline-flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.logo svg.logo__mark { height: 34px; width: auto; flex: none; }
.logo__text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  line-height: 1.12;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: #fff;
}
.footer-logo-main.logo { transform: none; gap: 16px; margin-bottom: 22px; }
.footer-logo-main.logo svg.logo__mark { height: 54px; }
.footer-logo-main .logo__text { font-size: var(--fs-sub); }

.header nav,
.nav {
  position: static;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav__item { position: relative; }

.nav__link,
.nav a.nav__link {
  display: block;
  padding: 10px 12px;
  border-radius: 999px;
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  transition: background .2s ease;
}

.nav__link:hover,
.nav__item:focus-within > .nav__link { background: rgba(255, 255, 255, .12); opacity: 1; }

.nav__item.is-active > .nav__link {
  background: rgba(255, 255, 255, .16);
  box-shadow: inset 0 -2px 0 var(--mint);
}

.nav__item--has-sub > .nav__link::after {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-3px) rotate(45deg);
  opacity: .7;
}

.nav__sub {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 250px;
  padding: 10px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(26, 22, 45, .22);
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}

.nav__sub::before { /* мостик, чтобы меню не закрывалось при переводе курсора */
  content: '';
  position: absolute;
  inset: -10px 0 auto 0;
  height: 10px;
}

.nav__item--has-sub:hover > .nav__sub,
.nav__item--has-sub:focus-within > .nav__sub {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.nav .nav__sub a {
  display: block;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--ink);
  font-size: 15px;
  white-space: nowrap;
}

.nav .nav__sub a:hover { background: var(--lilac-100); color: var(--hover); }

.burger span { transition: transform .2s ease, opacity .2s ease; }
.burger.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.burger.is-open span:nth-child(2) { opacity: 0; }
.burger.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 1100px) {
  .nav__link, .nav a.nav__link { padding: 10px 8px; font-size: 14px; }
}

@media (max-width: 1180px) {
  .burger { display: flex; position: static; padding: 10px; }
  .burger span { width: 26px; }

  .header nav,
  .nav {
    position: absolute;
    top: 100%;
    right: -20px;
    left: -20px;
    width: auto;
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
    padding: 12px 20px 24px;
    background: var(--indigo);
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    display: none;
  }

  .nav.active { display: flex; }

  .nav__link, .nav a.nav__link { font-size: 17px; padding: 12px 8px; border-radius: 10px; }
  .nav__item--has-sub > .nav__link::after { display: none; }

  .nav__sub {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    background: none;
    box-shadow: none;
    min-width: 0;
    padding: 0 0 8px 16px;
    border-left: 2px solid rgba(255, 255, 255, .5);
    margin-left: 8px;
    border-radius: 0;
  }

  .nav .nav__sub a { color: rgba(255, 255, 255, .8); padding: 8px 10px; white-space: normal; }
  .nav .nav__sub a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
}

/* ---------- Подвал ---------- */
.site-footer {
  position: relative;
  overflow: hidden;
  background: var(--grad-cover);
  padding: 56px 20px 48px;
}

.site-footer::after { /* «таблетки» из буклета */
  content: '';
  position: absolute;
  right: 6%;
  top: -30px;
  width: 46px;
  height: 120px;
  border-radius: 14px;
  background: var(--grad-pill);
  box-shadow: 40px 90px 0 -6px rgba(102, 219, 210, .3);
  opacity: .9;
  pointer-events: none;
}

.footer-nav ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, max-content));
  gap: 12px 40px;
}

.footer-nav a { font-size: 17px; color: rgba(255, 255, 255, .88); }
.footer-nav a:hover { color: #fff; }

@media (min-width: 768px) {
  .footer-container { grid-template-columns: 3fr 3fr 2fr; }
}

@media (max-width: 768px) {
  .footer-nav ul { grid-template-columns: repeat(2, minmax(0, 1fr)); text-align: left; }
}

/* ---------- Кнопки и ссылки ---------- */
.btn { border-radius: 999px; font-family: var(--font-text); font-weight: 500; }
.btn.mgu { background: var(--indigo); }

.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  font-family: var(--font-text);
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.btn-primary {
  color: var(--night);
  background: #fff;
  box-shadow: none;
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: none; }

.btn-ghost {
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, .45);
}

.btn-ghost:hover { background: rgba(255, 255, 255, .1); }

.btn-ghost--dark { color: var(--violet); border-color: var(--violet); }
.btn-ghost--dark:hover { background: var(--indigo); color: #fff; }

.faq-crosslink a { border-radius: 999px; }

/* Боковое меню разделов на внутренних страницах */
.menu-list a { color: #9A94BF; font-family: var(--font-text); }
.menu-list a:hover,
.menu-list a.active { color: var(--violet); }

/* Карточки 404 и прочие стеклянные блоки */
.error__title { background: linear-gradient(90deg, var(--indigo) 0%, var(--violet) 100%); -webkit-background-clip: text; background-clip: text; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .nav__sub, .btn-primary, .btn-ghost { transition: none; }
}

/* Главная: цифры в «Цифры и факты» — фирменным шрифтом вместо засечного Wremena */
.fact-number { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; }
.fact-number span { font-weight: inherit; color: var(--violet); }

/* Плашка режима предпросмотра */
.redesign-badge {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 1000;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--night);
  color: var(--mint);
  font-size: 13px;
  box-shadow: 0 6px 18px rgba(26, 22, 45, .35);
}
.redesign-badge:hover { color: #fff; }
