/* Лендинг «100 лет СПбГУП»
   Сетка: белая основа, бордовые смысловые блоки, золото — только тонкие линии и паспарту.
   Ширина контента: 1120 px на 1440, 1440 px на 1920; планшет — поля 40 px, телефон — 20 px. */
:root {
  --burgundy: #8E070B;
  --burgundy-dark: #5A0407;
  --gold: #A8834F;
  --gold-light: #D4B07A;
  --ink: #141414;
  --text: #3C3C3C;
  --muted: #6B6B6B;
  --line: #E7E3DC;
  --tint: #F8F1EF;
  --white: #FFFFFF;

  --serif: "Merriweather", Georgia, "Times New Roman", serif;
  --sans: "Inter", "Segoe UI", Arial, sans-serif;

  --gutter: clamp(20px, 11.1vw, 240px);
  --section-y: clamp(64px, 9.7vw, 160px);
  --max: 1440px;

  --fs-h1: clamp(34px, 4.4vw, 80px);
  --fs-h2: clamp(28px, 3.6vw, 62px);
  --fs-h3: clamp(23px, 2.36vw, 40px);
  --fs-num: clamp(30px, 3.9vw, 66px);
  --fs-numeral: clamp(56px, 6.7vw, 116px);
  --fs-year: clamp(22px, 2.1vw, 34px);
  --fs-lead: clamp(16px, 1.05vw + 3px, 20px);
  --fs-body: clamp(15px, 0.55vw + 8px, 18px);
  --fs-small: clamp(13px, 0.3vw + 10px, 15px);
  color-scheme: light;
}
@media (max-width: 1024px) { :root { --gutter: 40px; } }
@media (max-width: 600px) { :root { --gutter: 20px; } }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; --hdr-h: 92px; --cnav-h: 0px; }
/* якорные ссылки: заголовок раздела встаёт сразу под шапкой (высоту шапки подставляет main.js) */
.section[id] { scroll-margin-top: var(--hdr-h); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
body { margin: 0; background: var(--white); color: var(--text); font: 400 var(--fs-body)/1.65 var(--sans); }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, p, figure, ul, ol, dl, dd { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: 100%; max-width: calc(var(--max) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section-y); }
.section--tint { background: var(--tint); }
.section--burgundy { background: var(--burgundy); color: var(--white); }
.section + .section:not(.section--tint):not(.section--burgundy) { padding-top: 0; }
.section--tint + .section, .section--burgundy + .section { padding-top: var(--section-y) !important; }

/* типографика */
.h1 { font: 300 var(--fs-h1)/1.08 var(--serif); letter-spacing: -0.015em; color: var(--white); }
.h2 { font: 300 var(--fs-h2)/1.15 var(--serif); letter-spacing: -0.01em; color: var(--ink); }
.h3 { font: 400 var(--fs-h3)/1.22 var(--serif); letter-spacing: -0.005em; color: var(--ink); }
.lead { font-size: var(--fs-lead); line-height: 1.6; }
.small { font-size: var(--fs-small); line-height: 1.5; }
.muted { color: var(--muted); }
.cap { display: inline-flex; align-items: center; gap: 14px; font: 500 12px/1.2 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--burgundy); }
.cap::before { content: ""; width: 32px; height: 1px; background: var(--gold); flex: none; }
.cap--plain::before { display: none; }
.on-dark .cap, .cap--light { color: var(--gold-light); }
.on-dark .cap::before, .cap--light::before { background: var(--gold-light); }
.num { font: 300 var(--fs-num)/1 var(--serif); color: var(--burgundy); letter-spacing: -0.01em; font-variant-numeric: lining-nums; white-space: nowrap; }
.quote { font: italic 300 var(--fs-body)/1.6 var(--serif); color: var(--ink); }

/* заголовок секции: подпись слева, заголовок справа */
.head { display: grid; grid-template-columns: minmax(0, 280px) minmax(0, 1fr); gap: 40px; margin-bottom: clamp(32px, 4.4vw, 72px); }
.head .cap { padding-top: .9em; align-self: start; }
.head__text { display: grid; gap: 20px; min-width: 0; }
.head__text .lead { max-width: 62ch; }
@media (max-width: 1024px) { .head { grid-template-columns: 1fr; gap: 16px; } .head .cap { padding-top: 0; } }

/* кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 16px 28px; font: 500 15px/1 var(--sans); text-decoration: none; border: 1px solid transparent; cursor: pointer; transition: background-color .2s, color .2s, border-color .2s; background: none; }
.btn--burgundy { background: var(--burgundy); color: var(--white); }
.btn--burgundy:hover { background: var(--burgundy-dark); }
.btn--white { background: var(--white); color: var(--burgundy); }
.btn--white:hover { background: var(--tint); }
.btn--outline { border-color: var(--burgundy); color: var(--burgundy); }
.btn--outline:hover { background: var(--burgundy); color: var(--white); }
.btn--outline-light { border-color: rgba(255,255,255,.6); color: var(--white); }
.btn--outline-light:hover { background: rgba(255,255,255,.1); border-color: var(--white); }
.btns { display: flex; flex-wrap: wrap; gap: 16px; }
@media (max-width: 600px) { .btns { flex-direction: column; } .btns .btn { width: 100%; } }

/* паспарту и портреты */
.pp { border: 1px solid var(--gold); padding: clamp(8px, .85vw, 14px); background: var(--white); }
.pp img { width: 100%; height: 100%; object-fit: cover; }
.pp--light { border-color: var(--gold-light); background: transparent; }
figcaption { margin-top: 12px; font-size: var(--fs-small); color: var(--muted); }
.on-dark figcaption { color: rgba(255,255,255,.7); }
.portrait { display: block; position: relative; padding: 0 8px 8px 0; }
.portrait::before { content: ""; position: absolute; inset: 8px 0 0 8px; border: 1px solid var(--burgundy); }
.portrait img { position: relative; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; filter: grayscale(1) contrast(1.08); }

/* ---------- шапка ---------- */
.site-header { background: var(--burgundy); color: var(--white); position: sticky; top: 0; z-index: 20; }
.site-header__in { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-block: 20px; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--white); }
.brand img { width: 168px; height: auto; }
.brand b { display: block; font: 500 17px/1.3 var(--sans); }
.brand span { display: block; font-size: 14px; opacity: .6; }
.nav { display: flex; gap: clamp(20px, 2.5vw, 40px); }
.nav a { font-size: 14px; text-decoration: none; opacity: .9; }
.nav a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 6px; text-decoration-color: var(--gold-light); }
.burger { display: none; width: 44px; height: 44px; padding: 12px 8px; background: none; border: 0; cursor: pointer; }
.burger span { display: block; height: 2px; background: var(--white); margin-bottom: 7px; }
.burger span:last-child { margin-bottom: 0; }
@media (max-width: 1024px) { .nav, .site-header .btn { display: none; } .burger { display: block; } .brand img { width: 140px; } }

.menu { position: fixed; inset: 0; z-index: 40; background: var(--burgundy-dark); color: var(--white); padding: 20px var(--gutter) 48px; overflow-y: auto; display: flex; flex-direction: column; gap: 32px; }
.menu__top { display: flex; justify-content: space-between; align-items: center; }
.menu__top img { width: 140px; }
.menu__close { width: 44px; height: 44px; background: none; border: 0; color: var(--white); font-size: 26px; cursor: pointer; }
.menu nav a { display: block; padding: 16px 0; border-bottom: 1px solid rgba(212,176,122,.3); font: 400 var(--fs-h3)/1.2 var(--serif); text-decoration: none; }

/* ---------- первый экран ---------- */
.hero { background: var(--burgundy); color: var(--white); padding-block: 56px 80px; }
.hero__caps { display: flex; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; padding-bottom: 18px; border-bottom: 1px solid rgba(212,176,122,.5); margin-bottom: 56px; }
.hero__grid { display: grid; grid-template-columns: minmax(0, 520fr) minmax(0, 528fr); gap: 72px; align-items: center; }
.hero__logo { width: 100%; max-width: 480px; }
.hero__text { display: grid; gap: 22px; }
.hero__text .lead { color: rgba(255,255,255,.85); max-width: 46ch; }
.hero__text .btns { padding-top: 10px; }
@media (max-width: 1024px) {
  .hero { padding-block: 40px 56px; }
  .hero__caps { flex-direction: column; margin-bottom: 36px; }
  .hero__grid { grid-template-columns: 1fr; gap: 36px; }
  .hero__logo { max-width: 380px; }
}
@media (max-width: 600px) { .hero__logo { max-width: 280px; } }
.band { background: linear-gradient(180deg, var(--burgundy) 0%, var(--burgundy) 30%, #C3787A 62%, var(--tint) 88%, var(--white) 100%); padding-bottom: 8px; }
.band img { width: 100%; aspect-ratio: 1120 / 620; object-fit: cover; }
@media (max-width: 600px) { .band img { aspect-ratio: 335 / 240; } }
.band + .section { padding-top: var(--section-y) !important; }

/* ---------- о проекте ---------- */

/* ---------- цифры ---------- */
.stats { display: grid; grid-template-columns: minmax(0, 560fr) minmax(0, 480fr); gap: 80px; align-items: center; }
.stats .pp img { aspect-ratio: 536 / 516; }
.stats__nums { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 56px; }
.stat { display: grid; gap: 12px; align-content: start; }
.stat::before { content: ""; width: 32px; height: 2px; background: var(--gold); }
.stat p { font-size: var(--fs-small); color: var(--muted); }
@media (max-width: 1024px) { .stats { grid-template-columns: 1fr; gap: 40px; } .stats .pp img { aspect-ratio: 688 / 420; } .stats__nums { gap: 40px 32px; } }
@media (max-width: 600px) { .stats__nums { gap: 28px 16px; } .stats .pp img { aspect-ratio: 4 / 3; } }

/* ---------- летопись ---------- */
.tabs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border-top: 1px solid var(--gold); margin-bottom: 56px; }
.tab { text-align: left; background: none; border: 0; border-right: 1px solid var(--line); padding: 22px 20px 24px; cursor: pointer; font: inherit; color: var(--text); display: grid; gap: 6px; align-content: start; }
.tab:last-child { border-right: 0; }
.tab b { font: 300 var(--fs-year)/1 var(--serif); color: var(--burgundy); }
.tab span { font-size: var(--fs-small); line-height: 1.4; }
.tab .tab__years { color: var(--gold); }
.tab:hover { background: var(--tint); }
.tab[aria-selected="true"] { background: var(--burgundy); color: var(--white); border-right-color: var(--burgundy); }
.tab[aria-selected="true"] b, .tab[aria-selected="true"] .tab__years { color: var(--gold-light); }
.chapter { display: grid; grid-template-columns: minmax(0, 560fr) minmax(0, 496fr); gap: 64px; align-items: start; }
.chapter .pp img { aspect-ratio: 536 / 400; }
.chapter__text { display: grid; gap: 18px; min-width: 0; }
.chapter__no { display: flex; align-items: flex-end; gap: 20px; }
.chapter__no b { font: 300 var(--fs-numeral)/.9 var(--serif); color: var(--gold); }
.chapter__no span { font-size: var(--fs-small); color: var(--burgundy); padding-bottom: .4em; }
.keydates { margin-top: 10px; }
.keydates div { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 20px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.keydates dt { font: 300 var(--fs-year)/1 var(--serif); color: var(--burgundy); }
.keydates dd { color: var(--ink); }
.chapter-nav { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); }
.chapter-nav button { background: none; border: 0; padding: 8px 0; font: 500 15px/1.3 var(--sans); color: var(--burgundy); cursor: pointer; text-align: left; }
.chapter-nav button[data-dir="-1"] { color: var(--muted); }
.chapter-nav button:disabled { visibility: hidden; }
.dots { display: flex; gap: 6px; align-items: center; }
.dots i { width: 18px; height: 3px; background: var(--line); }
.dots i.on { width: 40px; background: var(--burgundy); }
@media (max-width: 1024px) {
  .tabs { margin-bottom: 32px; }
  .tab { padding: 16px 12px 18px; }
  .tab .tab__title { display: none; }
  .chapter { grid-template-columns: 1fr; gap: 28px; }
  .chapter .pp img { aspect-ratio: 688 / 420; }
  .chapter-nav { margin-top: 32px; }
}
@media (max-width: 600px) {
  .tab { padding: 12px 0 14px; justify-items: center; text-align: center; }
  .tab .tab__years { display: none; }
  .chapter .pp img { aspect-ratio: 3 / 2; }
  .chapter__text { order: -1; }   /* на телефоне сначала период, текст и даты, потом фото */
  .keydates div { grid-template-columns: 112px minmax(0, 1fr); gap: 16px; }
  .keydates dd { font-size: var(--fs-small); }
  .chapter-nav .nav-title { display: none; }
  .dots i { width: 10px; } .dots i.on { width: 24px; }
}

/* ---------- почётные доктора ---------- */
.doctors { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 48px 22px; }
.doctor { all: unset; display: grid; gap: 6px; align-content: start; cursor: pointer; }
.doctor:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
.doctor .portrait { margin-bottom: 8px; transition: transform .25s; }
.doctor:hover .portrait { transform: translateY(-3px); }
.doctor--static { cursor: default; } .doctor--static:hover .portrait { transform: none; }
.doctor .cap { font-size: 11px; color: var(--gold); }
.doctor .cap::before { display: none; }
.doctor b { font: 500 17px/1.3 var(--sans); color: var(--ink); }
.doctor span:last-child { font-size: var(--fs-small); color: var(--muted); }
.doctors:not(.is-open) .doctor:nth-child(n+7) { display: none; }
.more { display: flex; justify-content: center; margin-top: 48px; }
@media (max-width: 1024px) { .doctors { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px 24px; } .doctors:not(.is-open) .doctor:nth-child(n+5) { display: none; } }
@media (max-width: 600px) { .doctors { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 16px; } .more .btn { width: 100%; } }

.dialog { border: 1px solid var(--gold); padding: 48px; width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; background: var(--white); color: var(--text); box-shadow: 0 24px 60px rgba(51,5,8,.18); }
.dialog::backdrop { background: rgba(20,4,5,.55); }
.dialog__in { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 40px; }
.dialog__body { display: grid; gap: 14px; align-content: start; }
.dialog__close { position: absolute; top: 16px; right: 16px; width: 44px; height: 44px; border: 0; background: none; font-size: 22px; color: var(--muted); cursor: pointer; }
.dialog .reg { color: var(--burgundy); font-size: var(--fs-small); }
.dialog hr { width: 40px; border: 0; border-top: 1px solid var(--gold); margin: 0; }
@media (max-width: 600px) { .dialog { padding: 28px 24px; } .dialog__in { grid-template-columns: 1fr; gap: 20px; } .dialog__in .portrait { width: 140px; } }

/* ---------- Лихачёвские чтения ---------- */
.likh { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 520px); gap: 80px; align-items: center; }
.likh__text { display: grid; gap: 24px; min-width: 0; }
.likh__nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; padding-block: 8px; }
.likh__nums div { border-top: 1px solid var(--gold); padding-top: 20px; display: grid; gap: 8px; }
.likh__nums p { font-size: var(--fs-small); color: var(--muted); }
.likh .pp img { aspect-ratio: 496 / 360; }
@media (max-width: 1024px) { .likh { grid-template-columns: 1fr; gap: 40px; } .likh .pp img { aspect-ratio: 688 / 400; } }
@media (max-width: 600px) {
  .likh__nums { grid-template-columns: 1fr; gap: 0; }
  .likh__nums div { grid-template-columns: 104px minmax(0, 1fr); align-items: center; padding: 14px 0; gap: 16px; }
  .likh .btns .btn { width: 100%; }
}

/* ---------- кампус ---------- */
.campus { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 40px 24px; }
.place { display: grid; gap: 8px; align-content: start; min-width: 0; }
.place img { width: 100%; object-fit: cover; margin-bottom: 4px; }
.place b { font: 500 17px/1.3 var(--sans); color: var(--ink); }
.place span { font-size: var(--fs-small); color: var(--muted); }
.place--l { grid-column: span 6; } .place--l img { aspect-ratio: 548 / 366; }
.place--m { grid-column: span 4; } .place--m img { aspect-ratio: 357 / 238; }
.place--s { grid-column: span 3; } .place--s img { aspect-ratio: 3 / 2; }
.campus + .btns { margin-top: 48px; }
@media (max-width: 1024px) { .place--s { grid-column: span 6; } .place--s img { aspect-ratio: 332 / 200; } }
@media (max-width: 600px) {
  .campus { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 16px; }
  .place--l, .place--first-m { grid-column: span 2; }
  .place--l img, .place--first-m img { aspect-ratio: 3 / 2; }
  .place--m:not(.place--first-m), .place--s { grid-column: span 1; }
  .place--m:not(.place--first-m) img, .place--s img { aspect-ratio: 4 / 3; }
  .place b { font-size: 15px; }
}

/* ---------- выпускники ---------- */
.faculties { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--gold); }
.faculty { background: none; border: 0; border-right: 1px solid var(--line); padding: 20px 18px 22px; text-align: left; font: 500 15px/1.35 var(--sans); color: var(--ink); cursor: pointer; }
.faculty:last-child { border-right: 0; }
.faculty:hover { background: var(--tint); }
.faculty[aria-selected="true"] { background: var(--burgundy); color: var(--white); }
.specs { display: flex; flex-wrap: wrap; gap: 12px 32px; padding-block: 28px 8px; }
.spec { background: none; border: 0; border-bottom: 2px solid transparent; padding: 0 0 8px; font: 400 15px/1.3 var(--sans); color: var(--muted); cursor: pointer; }
.spec:hover { color: var(--ink); }
.spec[aria-selected="true"] { color: var(--burgundy); border-bottom-color: var(--burgundy); }
.alumni__label { margin-block: 24px 28px; }
.alumni { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.alum { display: grid; grid-template-columns: 158px minmax(0, 1fr); gap: 28px; padding-top: 28px; border-top: 1px solid var(--line); }
.alum__body { display: grid; gap: 10px; align-content: start; min-width: 0; }
.alum b { font: 500 17px/1.3 var(--sans); color: var(--ink); }
.alum .cap { font-size: 11px; color: var(--gold); } .alum .cap::before { display: none; }
.alum__role { font-size: var(--fs-small); color: var(--muted); }
@media (max-width: 1024px) { .alumni { grid-template-columns: 1fr; } .faculty { padding: 16px 12px 18px; font-size: 14px; } }
@media (max-width: 600px) {
  .faculties { display: flex; flex-wrap: wrap; gap: 8px; border-top: 0; }
  .faculty { border: 1px solid var(--line); padding: 10px 14px; font-weight: 400; font-size: 13px; }
  .faculty:last-child { border-right: 1px solid var(--line); }
  .faculty[aria-selected="true"] { border-color: var(--burgundy); }
  .specs { gap: 10px 16px; padding-top: 20px; }
  .alum { grid-template-columns: 104px minmax(0, 1fr); gap: 16px; }
  .alum .quote { grid-column: 1 / -1; }
}

/* ---------- поздравления ---------- */
.on-dark .h2 { color: var(--white); }
.on-dark .lead { color: rgba(255,255,255,.8); }
#congrats .congrats { display: grid; grid-template-columns: minmax(0, 480px) minmax(0, 1fr); gap: 80px; align-items: start; }
#congrats .form { display: grid; gap: 28px; min-width: 0; }
#congrats .field { display: grid; gap: 10px; min-width: 0; }
#congrats .field label { font: 500 12px/1.2 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--gold-light); }
#congrats .field input:not([type="checkbox"]), #congrats .field textarea { width: 100%; background: transparent; border: 0; border-bottom: 1px solid rgba(255,255,255,.5); padding: 6px 0 14px; color: var(--white); font: 400 var(--fs-body)/1.5 var(--sans); border-radius: 0; resize: vertical; }
#congrats .field input::placeholder, #congrats .field textarea::placeholder { color: rgba(255,255,255,.65); }
#congrats .field input:not([type="checkbox"]):focus, #congrats .field textarea:focus { outline: none; border-bottom-color: var(--gold-light); }
#congrats .field[data-error] input:not([type="checkbox"]), #congrats .field[data-error] textarea { border-bottom-color: #F2B8A8; }
#congrats .field__err { font-size: 13px; color: #F7CFC3; }
#congrats .form__note { font-size: var(--fs-small); line-height: 1.6; color: rgba(255,255,255,.78); }
#congrats .form__note a { text-underline-offset: 4px; overflow-wrap: anywhere; }
#congrats .form__status { font-size: var(--fs-small); color: var(--white); background: var(--burgundy-dark); padding: 14px 18px; border-left: 2px solid var(--gold-light); }
#congrats .form__status[data-kind="error"] { border-left-color: #F2B8A8; }
#congrats .form .btn:disabled { opacity: .6; cursor: wait; }
#congrats .form__trap { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#congrats .field .form__consent { display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: start; gap: 12px; font: 400 var(--fs-small)/1.6 var(--sans); letter-spacing: normal; text-transform: none; color: rgba(255,255,255,.88); cursor: pointer; }
#congrats .form__consent input { width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--gold-light); cursor: pointer; }
#congrats .field--consent[data-error] .form__consent input { outline: 1px solid #F2B8A8; outline-offset: 3px; }
#congrats .wall { display: grid; gap: 20px; min-width: 0; }
#congrats .wall .pp img { aspect-ratio: 540 / 300; }
#congrats .wall__list { display: grid; gap: 12px; min-width: 0; }
#congrats .wall__list:empty { display: none; }
#congrats .wall__message { font-size: var(--fs-small); color: rgba(255,255,255,.8); }
#congrats .wish { margin: 0; min-width: 0; background: var(--burgundy-dark); border-left: 2px solid var(--gold-light); padding: 22px 26px; display: grid; gap: 14px; animation: wish-in .45s ease both; overflow-wrap: anywhere; }
#congrats .wish__text { font: italic 300 var(--fs-body)/1.6 var(--serif); color: rgba(255,255,255,.92); white-space: pre-wrap; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; max-height: 4.8em; }
#congrats .wish footer { display: grid; gap: 2px; }
#congrats .wish b { font: 500 15px/1.3 var(--sans); color: var(--white); }
#congrats .wish span { font-size: 13px; color: var(--gold-light); }
#congrats .wish__more, #congrats .wall__retry { justify-self: start; background: none; border: 0; border-bottom: 1px solid rgba(212,176,122,.55); padding: 4px 0; font: 500 13px/1.5 var(--sans); text-align: left; color: var(--gold-light); cursor: pointer; }
#congrats .wish__more:hover, #congrats .wall__retry:hover { color: var(--white); border-color: var(--white); }
#congrats .wall__nav { display: flex; align-items: center; gap: 16px; }
#congrats .wall__nav button { width: 44px; height: 44px; border: 1px solid rgba(212,176,122,.6); background: none; color: var(--white); font-size: 18px; cursor: pointer; transition: background .2s, border-color .2s; }
#congrats .wall__nav button:hover { background: rgba(255,255,255,.08); border-color: var(--gold-light); }
#congrats .wall__count { font-size: 13px; letter-spacing: .1em; color: var(--gold-light); font-variant-numeric: tabular-nums; }
#congrats .wish-dialog { padding: 0; border: 1px solid var(--gold); margin: auto; width: min(720px, calc(100vw - 32px)); max-width: none; max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); overflow: hidden; background: var(--white); color: var(--text); box-shadow: 0 24px 80px rgba(20,4,5,.25); }
#congrats .wish-dialog[open] { display: flex; flex-direction: column; }
#congrats .wish-dialog::backdrop { background: rgba(20,4,5,.65); backdrop-filter: blur(3px); }
#congrats .wish-dialog__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: none; padding: 18px 24px 0 40px; }
#congrats .wish-dialog .cap { color: var(--burgundy); font-size: 11px; }
#congrats .wish-dialog .cap::before { background: var(--gold); }
#congrats .wish-dialog__close { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border: 0; background: transparent; color: var(--burgundy); cursor: pointer; }
#congrats .wish-dialog__close:hover { background: var(--tint); }
#congrats .wish-dialog__body { padding: 20px 40px 40px; overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
#congrats .wish-dialog__body .h3 { font-size: clamp(24px, 3vw, 32px); color: var(--burgundy); }
#congrats .wish-dialog__quote { margin: 24px 0 0; }
#congrats .wish-dialog__text { font: italic 300 clamp(16px, 1.2vw, 19px)/1.8 var(--serif); white-space: pre-wrap; overflow-wrap: anywhere; }
#congrats .wish-dialog__author { display: grid; gap: 6px; border-top: 1px solid var(--line); padding-top: 22px; margin-top: 28px; overflow-wrap: anywhere; }
#congrats .wish-dialog__name { font: 500 16px/1.4 var(--sans); color: var(--burgundy); }
#congrats .wish-dialog__who { font-size: var(--fs-small); color: var(--muted); }
@keyframes wish-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (max-width: 600px) {
  #congrats .wish { padding: 18px 20px; }
  #congrats .field input:not([type="checkbox"]), #congrats .field textarea { font-size: 16px; }
  #congrats .wish-dialog { max-height: calc(100dvh - 24px); width: calc(100vw - 24px); }
  #congrats .wish-dialog__head { padding: 12px 12px 0 22px; }
  #congrats .wish-dialog__body { padding: 16px 22px 28px; }
}
@media (max-width: 1024px) { #congrats .congrats { grid-template-columns: 1fr; gap: 48px; } #congrats .form .btn { width: 100%; } }

/* ---------- поступление ---------- */
.cta { border: 1px solid var(--burgundy); padding: 10px; }
.cta__in { border: 1px solid var(--gold); padding: 48px; display: grid; grid-template-columns: minmax(0, 460px) minmax(0, 1fr); gap: 56px; align-items: center; }
.cta__in img { width: 100%; aspect-ratio: 460 / 340; object-fit: cover; }
.cta__text { display: grid; gap: 22px; }
@media (max-width: 1024px) { .cta { padding: 8px; } .cta__in { grid-template-columns: 1fr; padding: 36px; gap: 28px; } }
@media (max-width: 600px) { .cta { padding: 6px; } .cta__in { padding: 20px; gap: 20px; } .cta__in img { aspect-ratio: 3 / 2; } }

/* ---------- подвал ---------- */
.footer { background: var(--burgundy-dark); color: var(--white); padding-block: 72px 48px; }
.footer__top { display: flex; justify-content: space-between; gap: 32px 48px; flex-wrap: wrap; }
.footer__brand { display: flex; align-items: center; }
.footer__brand img { width: 380px; max-width: 100%; }
.footer__brand b { font: 500 17px/1.35 var(--sans); }
.footer address { font-style: normal; font-size: var(--fs-small); color: rgba(255,255,255,.75); line-height: 1.7; }
.footer ul { list-style: none; padding: 0; display: grid; gap: 10px; font-size: var(--fs-small); }
.footer ul a { text-decoration: none; } .footer ul a:hover { text-decoration: underline; }
.footer__bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; margin-top: 48px; padding-top: 24px; border-top: 1px solid rgba(212,176,122,.4); }
.footer__bottom span { font: 500 12px/1.2 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--gold-light); }
@media (max-width: 600px) { .footer { padding-block: 48px 32px; } .footer__top { flex-direction: column; } .footer__brand img { width: 300px; } }

/* «Читать далее» в летописи */
.chapter__body.is-clamped { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.more-link { justify-self: start; background: none; border: 0; padding: 4px 0; font: 500 15px/1.3 var(--sans); color: var(--burgundy); cursor: pointer; border-bottom: 1px solid var(--gold); }
.more-link:hover { color: var(--burgundy-dark); }
@media (max-width: 600px) { .chapter__body.is-clamped { -webkit-line-clamp: 6; } }
/* выпускники — цветные портреты */
.alum .portrait img { filter: none; }
/* карточка доктора: рамка по высоте фото */
.dialog__in { align-items: start; }
.dialog__in .portrait { align-self: start; }

/* фотоархив главы */
.chapter__media { display: grid; gap: 20px; min-width: 0; }
.gallery { display: grid; gap: 10px; }
.gallery__label { color: var(--gold); font-size: 11px; }
.gallery__row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.thumb { padding: 0; border: 1px solid var(--line); background: var(--white); cursor: zoom-in; aspect-ratio: 1 / 1; overflow: hidden; transition: border-color .2s; }
.thumb img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1); transition: transform .3s; }
.thumb:hover { border-color: var(--gold); } .thumb:hover img { transform: scale(1.05); }
@media (max-width: 600px) { .gallery__row { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; } .thumb { flex: 0 0 30%; scroll-snap-align: start; } }
/* фотолента: на весь экран, непрозрачный фон — страница под ней не просвечивает; фото, подпись и стрелки всегда в пределах экрана */
.lightbox { border: 0; margin: 0; padding: 56px 16px 20px; width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; background: #1a0607; color: var(--white); overflow: hidden; }
.lightbox[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.lightbox::backdrop { background: #1a0607; }
.lightbox figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; min-height: 0; flex: 0 1 auto; max-width: min(1200px, 100%); }
.lightbox img { display: block; max-height: calc(100dvh - 210px); width: auto; max-width: 100%; object-fit: contain; border: 1px solid var(--gold-light); }
.lightbox.is-single .lightbox__nav { display: none; }
.pp--zoom { display: block; width: 100%; cursor: zoom-in; font: inherit; color: inherit; transition: border-color .2s; }
.pp--zoom:hover { border-color: var(--burgundy); }
.pp--zoom:focus-visible { outline: 2px solid var(--burgundy); outline-offset: 4px; }
.lc { text-transform: none !important; }
.lightbox figcaption { color: rgba(255,255,255,.85); text-align: center; font-size: var(--fs-small); max-width: 70ch; margin-inline: auto; }
.lightbox__close { position: fixed; top: 16px; right: 16px; width: 44px; height: 44px; border: 0; background: none; color: var(--white); font-size: 24px; cursor: pointer; }
.lightbox__nav { display: flex; justify-content: center; align-items: center; gap: 24px; flex: none; }
.lightbox__nav button { width: 48px; height: 48px; border: 1px solid rgba(212,176,122,.6); background: none; color: var(--white); font-size: 20px; cursor: pointer; }
.lightbox__count { font-size: 13px; color: var(--gold-light); letter-spacing: .1em; }

/* вкладки «Почётные доктора / профессора» */
.people-tabs { display: flex; flex-wrap: wrap; gap: 8px 32px; border-bottom: 1px solid var(--line, rgba(142,7,11,.18)); margin: 0 0 40px; }
.ptab { all: unset; cursor: pointer; padding: 0 0 14px; margin-bottom: -1px; border-bottom: 2px solid transparent; font: 500 18px/1.3 var(--sans); color: var(--muted); }
.ptab span { font-size: 13px; color: var(--gold); margin-left: 6px; }
.ptab[aria-selected="true"] { color: var(--burgundy); border-bottom-color: var(--burgundy); }
.ptab:hover { color: var(--burgundy); }
.ptab:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
@media (max-width: 600px) { .people-tabs { gap: 4px 20px; margin-bottom: 28px; } .ptab { font-size: 16px; } }

/* одна ключевая дата в блоке «О проекте» */

/* ссылка на полную хронику в «Летописи» */
.chron-link { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 32px; margin: -24px 0 32px; color: var(--muted); font-size: var(--fs-small); }
.chron-link .chapter__all { margin-top: 0; }
.chapter__all { display: inline-block; width: fit-content; align-self: flex-start; justify-self: start; margin-top: 22px; color: var(--burgundy); font: 500 var(--fs-small)/1.3 var(--sans); text-decoration: none; border-bottom: 1px solid var(--gold); padding-bottom: 4px; }
.chapter__all:hover { border-color: var(--burgundy); }

/* страница «Хроника Университета» */
.chron-hero { background: var(--burgundy); color: var(--white); padding-block: 48px 72px; }
.chron-hero .wrap { display: grid; gap: 18px; }
.chron-hero .lead { max-width: 62ch; opacity: .85; }
.chron-back { color: var(--gold-light); font: 500 var(--fs-small)/1 var(--sans); text-decoration: none; margin-bottom: 18px; justify-self: start; }
.chron-back:hover { color: var(--white); }
.cap--light { color: var(--gold-light); }
.chron { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 72px; padding-block: 72px var(--section-y); }
.chron-nav { position: sticky; top: 104px; align-self: start; display: grid; border-top: 1px solid var(--gold); }
.chron-nav a { display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--text); }
.chron-nav b { grid-row: span 2; font: 300 26px/1 var(--serif); color: var(--gold); }
.chron-nav span { font-size: 12px; color: var(--burgundy); letter-spacing: .04em; }
.chron-nav em { font-style: normal; font-size: var(--fs-small); line-height: 1.35; color: var(--ink); }
.chron-nav a.is-active, .chron-nav a:hover { background: var(--tint); }
.chron-nav a.is-active b { color: var(--burgundy); }
.chron-ch { scroll-margin-top: calc(var(--hdr-h) + var(--cnav-h) + 32px); }
.chron-ch + .chron-ch { margin-top: 88px; }
.chron-ch__head { display: flex; align-items: flex-end; gap: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--gold); margin-bottom: 8px; }
.chron-ch__no { font: 300 var(--fs-numeral)/.9 var(--serif); color: var(--gold); }
.chron-ch__head .cap { color: var(--burgundy); }
.chron-year { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 32px; padding-block: 22px; border-bottom: 1px solid var(--line); }
.chron-year__y { font: 300 var(--fs-year)/1.1 var(--serif); color: var(--burgundy); font-variant-numeric: tabular-nums; }
.chron-year ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; max-width: 72ch; }
.chron-year li { color: var(--ink); }
.chron-year li b { font-weight: 500; color: var(--burgundy); }
.chron-top { margin-top: 56px; }
@media (max-width: 1024px) {
  .chron { grid-template-columns: 1fr; gap: 32px; padding-top: 0; }
  .chron-nav { position: sticky; top: var(--hdr-h); z-index: 5; display: flex; overflow-x: auto; gap: 0; background: var(--white); border-top: 0; border-bottom: 1px solid var(--gold); margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); scrollbar-width: none; }
  .chron-nav a { flex: 0 0 auto; display: flex; gap: 8px; align-items: baseline; padding: 14px 16px; border-bottom: 2px solid transparent; }
  .chron-nav a.is-active { background: none; border-bottom-color: var(--burgundy); }
  .chron-nav b { font-size: 20px; }
  .chron-nav em { display: none; }
  .chron-ch:first-child { margin-top: 24px; }
}
@media (max-width: 600px) {
  .chron-year { grid-template-columns: 1fr; gap: 8px; padding-block: 18px; }
  .chron-ch__head { gap: 16px; }
  .chron-ch + .chron-ch { margin-top: 56px; }
  .chron-link { margin-top: -12px; }
}

/* мобильное интро (только телефон, ≤ 600 px): полный логотип по центру; при прокрутке название
   сжимается гармошкой в «СПбГУП», буквы пристыковываются к «100», и логотип улетает в шапку */
.intro { display: none; }
@media (max-width: 600px) {
  html.has-intro .intro { display: block; position: relative; height: 62svh; background: var(--burgundy); margin-top: -84px; }
  html.has-intro .hero__logo { display: none; }
  html.has-intro .hero { padding-top: 4px; }
  /* «Век служения культуре» на старте скрыт и всплывает с первого движения прокрутки */
  html.has-intro .hero > .wrap { position: relative; z-index: 2; opacity: 0; will-change: opacity, transform; }
  html.has-intro .band img { opacity: 0; will-change: opacity; }
  /* золотой салют: позади логотипа и текста первого экрана */
  .intro .fw { position: fixed; left: 0; top: 0; z-index: 1; pointer-events: none; }
  /* пока идёт интро, шапка прозрачная — иначе её фон срезает верх салюта ровной линией */
  html.has-intro:not(.intro-done) .site-header { background: transparent; }
  html.has-intro .site-header .brand img, html.has-intro .site-header .burger { opacity: 0; }
  .intro .lm { position: absolute; left: 0; top: 0; width: 100vw; height: 100vh; z-index: 30; will-change: transform; pointer-events: none; overflow: visible; }
  .intro .lm path { fill: #fff; }
  .lm-gl path { animation: lm-in .9s cubic-bezier(.2, .7, .2, 1) both; }
  .lm-mark { animation: lm-in 1.1s cubic-bezier(.2, .7, .2, 1) both; }
  .intro__hint { position: fixed; left: 0; right: 0; bottom: calc(28px + env(safe-area-inset-bottom, 0px)); z-index: 30; display: grid; justify-items: center; gap: 10px;
    color: var(--gold-light); font: 500 12px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; pointer-events: none; }
  .intro__hint i { width: 1px; height: 32px; background: linear-gradient(var(--gold-light), transparent); animation: intro-hint 1.6s ease-in-out infinite; }
  html.intro-done .intro .lm, html.intro-done .intro__hint { visibility: hidden; }
}
@keyframes lm-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes intro-hint { 0%, 100% { transform: translateY(-6px); opacity: .4; } 50% { transform: translateY(4px); opacity: 1; } }

/* золотой салют первого экрана — планшет и компьютер (assets/salute.js) */
.fwd { display: none; }
@media (min-width: 601px) {
  .hero { position: relative; }
  .hero > .wrap { position: relative; z-index: 1; }
  html.has-salute .fwd { display: block; position: absolute; left: 0; right: 0; top: calc(-1 * var(--hdr-h)); bottom: 0; z-index: 0; pointer-events: none; background: var(--burgundy);
    -webkit-mask-image: linear-gradient(#000 0, #000 80%, transparent 100%); mask-image: linear-gradient(#000 0, #000 80%, transparent 100%); }
  .fwd canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
  /* пока виден первый экран, шапка прозрачная (под ней тот же бордовый) — салют не срезается её краем */
  html.has-salute.salute-top .site-header { background: transparent; }
}
