:root {
  --accent: #d2600f;
  --accent-strong: #a8480a;
  --text: #2b2e33;
  --text-soft: #3d4148;
  --muted: #6b7079;
  --page-bg: #f2f2f5;
  --surface: #fff;
  --surface-2: #ececf0;
  --surface-3: #e0e0e6;
  --line: rgba(43, 46, 51, 0.08);
  --bar-bg: rgba(255, 255, 255, 0.38);
  --bar-bg-hover: rgba(255, 255, 255, 0.5);
  --bar-border: rgba(255, 255, 255, 0.55);
  --bar-inset: rgba(255, 255, 255, 0.7);
  --chip-bg: rgba(255, 255, 255, 0.9);
  --chip-hover: #fff;
  --chip-border: rgba(255, 255, 255, 0.95);
  --on-accent: #fff;
  color-scheme: light;
  --spring: cubic-bezier(0.32, 0.72, 0, 1);
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --view-top: 92px;
}

:root[data-theme="dark"] {
  --accent: #ff9a3c;
  --accent-strong: #ffb76b;
  --text: #f2f2f5;
  --text-soft: #d4d6db;
  --muted: #a1a5ad;
  --page-bg: #0e0e10;
  --surface: #1c1c1f;
  --surface-2: #2a2a2e;
  --surface-3: #38383d;
  --line: rgba(255, 255, 255, 0.1);
  --bar-bg: rgba(28, 28, 32, 0.5);
  --bar-bg-hover: rgba(44, 44, 50, 0.65);
  --bar-border: rgba(255, 255, 255, 0.12);
  --bar-inset: rgba(255, 255, 255, 0.08);
  --chip-bg: rgba(30, 30, 34, 0.9);
  --chip-hover: rgba(48, 48, 54, 0.96);
  --chip-border: rgba(255, 255, 255, 0.12);
  --on-accent: #111114;
  color-scheme: dark;
}

:root[data-season="normal"]:not([data-theme="dark"]) { --accent: #1d6fd6; --accent-strong: #14529e; }
:root[data-season="normal"][data-theme="dark"] { --accent: #5aa9ff; --accent-strong: #8cc4ff; }
:root[data-season="winter"]:not([data-theme="dark"]) { --accent: #1993c8; --accent-strong: #0e6c96; }
:root[data-season="winter"][data-theme="dark"] { --accent: #6fd0ff; --accent-strong: #a8e4ff; }

* { box-sizing: border-box; }

html, body { margin: 0; }

html {
  overscroll-behavior-y: none;
  background: var(--page-bg);
}

body {
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
  font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

img { max-width: 100%; display: block; }

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url("assets/md/school.jpg") center / cover no-repeat;
  will-change: transform;
}
.start-elsewhere .page[data-page="events"] { display: none; }
.no-backdrop .backdrop { background-image: none; }
.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 20, 30, 0.15), rgba(15, 20, 30, 0.35));
}

.leaves {
  position: fixed;
  inset: 0;
  z-index: 5;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.leaves[hidden] { display: none; }

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 8px clamp(14px, 3vw, 32px);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.header.scrolled {
  background: color-mix(in srgb, var(--page-bg) 94%, transparent);
  border-bottom-color: var(--line);
  box-shadow: 0 4px 20px rgba(30, 40, 70, 0.08);
}

.brand {
  flex: none;
  display: inline-flex;
  border-radius: 50%;
  transition: transform 0.4s var(--spring);
}
.brand:hover { transform: scale(1.06); }
.brand:active { transform: scale(0.95); }
.brand img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  padding: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 10px rgba(30, 40, 70, 0.16);
}

.nav-center { grid-column: 2; display: flex; align-items: center; gap: 10px; min-width: 0; }
.hotbar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  scrollbar-width: none;
}
.hotbar::-webkit-scrollbar { display: none; }
.hotbar.fade-end { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); }
.hotbar.fade-start { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 36px), transparent); }
.hotbar.fade-start.fade-end {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 36px, #000 calc(100% - 36px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 36px, #000 calc(100% - 36px), transparent);
}

.hotbar a {
  position: relative;
  z-index: 2;
  flex: none;
  white-space: nowrap;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  box-shadow: 0 2px 10px rgba(20, 25, 40, 0.14);
  transition: color 0.3s var(--ease), background 0.3s var(--ease), transform 0.3s var(--spring);
}
.hotbar a:hover { background: var(--chip-hover); }
.hotbar a:active { transform: scale(0.94); }
.hotbar a.active { color: var(--on-accent); background: transparent; border-color: transparent; box-shadow: none; }
.hotbar .nav-icon { display: grid; place-items: center; padding: 8px 14px; }
.nav-icon svg { width: 22px; height: 22px; }

.pill {
  position: absolute;
  top: 4px;
  left: 0;
  height: calc(100% - 8px);
  width: 0;
  border-radius: 999px;
  pointer-events: none;
  opacity: 0;
  transition:
    transform 0.5s var(--spring),
    width 0.5s var(--spring),
    opacity 0.25s var(--ease);
}
.pill-active {
  z-index: 1;
  background: var(--accent);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 40%, transparent);
}
.pill-hover { display: none; }
.pill.visible { opacity: 1; }

.nav-tools {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 4px;
}

.theme-toggle {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text);
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  box-shadow: 0 2px 10px rgba(20, 25, 40, 0.14);
  transition: transform 0.4s var(--spring), background 0.3s var(--ease), color 0.3s var(--ease);
}
.theme-toggle:hover { transform: scale(1.06); background: var(--chip-hover); }
.theme-toggle:active { transform: scale(0.92); }
.theme-toggle svg {
  width: 22px;
  height: 22px;
  transition: transform 0.6s var(--spring);
}
:root[data-theme="dark"] .theme-toggle svg { transform: rotate(-180deg); }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.leaves-toggle { color: var(--accent); }
.leaves-toggle .icon-snow { display: none; }
.leaves-toggle[data-mode="snow"] .icon-snow { display: block; }
.leaves-toggle[data-mode="snow"] .icon-leaf { display: none; }
.leaves-toggle[hidden] { display: none; }
:root[data-theme="dark"] .leaves-toggle svg { transform: none; }
.leaves-toggle:hover svg { transform: rotate(-15deg); }
.leaf-slash {
  position: absolute;
  width: 26px;
  height: 2.5px;
  border-radius: 2px;
  background: currentColor;
  transform: rotate(-45deg) scaleX(0);
  transition: transform 0.4s var(--spring);
}
.leaves-toggle.off { color: var(--muted); }
.leaves-toggle.off .leaf-slash { transform: rotate(-45deg) scaleX(1); }

.theme-toggle[data-tip]::after,
.nav-icon[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  color: #fff;
  background: rgba(20, 22, 28, 0.85);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -4px);
  transition: opacity 0.2s var(--ease), transform 0.3s var(--spring);
}
.theme-toggle[data-tip]:hover::after,
.theme-toggle[data-tip]:focus-visible::after,
.nav-icon[data-tip]:hover::after,
.nav-icon[data-tip]:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
.nav-tools > :last-child[data-tip]::after { left: auto; right: 0; transform: translateY(-4px); }
.nav-tools > :last-child[data-tip]:hover::after,
.nav-tools > :last-child[data-tip]:focus-visible::after { transform: none; }

.view {
  flex: 1 0 auto;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--view-top) clamp(16px, 4vw, 40px) 64px;
}

.page {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
}
.page[hidden] { display: none; }
.page.enter { animation: pageIn 0.6s var(--spring) both; }
.page.leave { animation: pageOut 0.25s var(--ease) both; }

@keyframes pageIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
@keyframes pageOut {
  to { opacity: 0; transform: translateY(-8px) scale(0.99); }
}

.page-title {
  margin: 8px 0 0;
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
  letter-spacing: -0.01em;
}

.hero-media {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s var(--ease), visibility 0.5s;
}
body[data-page="events"] .hero-media { opacity: 1; visibility: visible; }
body[data-page="events"].hero-out .hero-media { visibility: hidden; transition: none; }
body[data-page="events"] .backdrop { visibility: hidden; }
.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  transform: scale(1.02);
  transition: transform 2.4s var(--spring);
}
body.hero-hover .hero-media img { transform: scale(1.07); }
.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(15, 20, 30, 0.35) 0%, transparent 22%),
    linear-gradient(0deg, rgba(15, 20, 30, 0.55) 0%, transparent 45%);
}

.page[data-page="events"] { gap: 0; }

.hero {
  position: relative;
  z-index: 1;
  width: 100vw;
  height: calc(100vh - 72px);
  height: calc(100svh - 72px);
  min-height: 420px;
  margin: calc(-1 * var(--view-top)) calc(50% - 50vw) 0;
  cursor: zoom-in;
  outline: none;
}
.hero-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 40px) clamp(40px, 6vw, 64px);
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.45), 0 4px 24px rgba(0, 0, 0, 0.5);
}
.hero h1 {
  margin: 0;
  font-size: clamp(32px, 6vw, 64px);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.hero p {
  margin: 8px 0 0;
  font-size: clamp(15px, 2vw, 19px);
  font-weight: 600;
}

.sheet {
  position: relative;
  width: 100vw;
  overflow-x: clip;
  margin: 0 calc(50% - 50vw) -64px;
  padding: clamp(28px, 5vw, 48px) clamp(16px, 4vw, 40px) 96px;
  isolation: isolate;
  min-height: 60vh;
}
.sheet::after {
  content: "";
  position: absolute;
  top: 80px;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -2;
  background:
    linear-gradient(180deg, rgba(15, 20, 30, 0.5), rgba(15, 20, 30, 0.62)),
    url("assets/school-blur.jpg") center / cover no-repeat;
}
.sheet::before {
  content: "";
  position: absolute;
  top: -240px;
  left: 0;
  right: 0;
  height: calc(100vh + 240px);
  z-index: -1;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 320px, #000 calc(100% - 320px), transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 320px, #000 calc(100% - 320px), transparent 100%);
  background:
    linear-gradient(180deg, rgba(15, 20, 30, 0.45), rgba(15, 20, 30, 0.6)),
    url("assets/md/school.jpg") center 75% / cover no-repeat;
}
.sheet-inner {
  max-width: 1600px;
  margin-inline: auto;
}

.home-block + .home-block { margin-top: 48px; }
.section-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}
.section-head .section-title { margin: 0; }

.collapse-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
  padding: 5px 5px 5px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  transition:
    transform 0.4s var(--spring),
    border-color 0.3s var(--ease),
    opacity 0.3s var(--ease);
}
.collapse-btn:hover { transform: translateY(-2px); border-color: var(--accent); }
.collapse-btn:active { transform: scale(0.95); }
.collapse-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #fff;
  background: var(--accent);
  transition: transform 0.5s var(--spring);
}
.collapse-icon svg { width: 16px; height: 16px; }
.collapse-btn:hover .collapse-icon { transform: translateY(-2px); }
.home-block.collapsed .collapse-btn {
  opacity: 0;
  transform: scale(0.9);
  pointer-events: none;
}

.count-badge {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
}

.reveal-wrap {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.6s var(--spring), opacity 0.4s var(--ease);
}
.reveal-wrap > div { min-height: 0; overflow: hidden; padding: 6px 6px 28px; margin: -6px -6px -28px; }
.home-block.collapsed .reveal-wrap { grid-template-rows: 1fr; opacity: 1; }
.news-reveal {
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
  max-width: 640px;
  margin-top: 4px;
  padding: 14px 14px 14px 18px;
  border-radius: 24px;
  font: inherit;
  text-align: left;
  color: var(--text);
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
  transition: transform 0.5s var(--spring), box-shadow 0.5s var(--spring), border-color 0.3s var(--ease);
}
.news-reveal:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.25);
}
.reveal-thumbs {
  position: relative;
  flex: none;
  width: 92px;
  height: 64px;
}
.reveal-thumbs img {
  position: absolute;
  top: 6px;
  left: 22px;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: cover;
  border: 2px solid var(--surface);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: transform 0.6s var(--spring);
}
.reveal-thumbs img:nth-child(1) { z-index: 3; }
.reveal-thumbs img:nth-child(2) { z-index: 2; transform: translateX(-14px) rotate(-10deg); }
.reveal-thumbs img:nth-child(3) { z-index: 1; transform: translateX(14px) rotate(10deg); }
.news-reveal:hover .reveal-thumbs img:nth-child(1) { transform: translateY(-4px); }
.news-reveal:hover .reveal-thumbs img:nth-child(2) { transform: translateX(-22px) rotate(-16deg); }
.news-reveal:hover .reveal-thumbs img:nth-child(3) { transform: translateX(22px) rotate(16deg); }
.reveal-text { display: grid; gap: 3px; min-width: 0; }
.reveal-text b { font-size: 16px; }
.reveal-text small {
  overflow: hidden;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  text-overflow: ellipsis;
}
.reveal-cta {
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  margin-left: auto;
  border-radius: 50%;
  color: #fff;
  background: var(--accent);
  transition: transform 0.5s var(--spring);
}
.reveal-cta svg { width: 20px; height: 20px; }
.news-reveal:hover .reveal-cta { transform: translateY(2px); }


.collapse {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.6s var(--spring), opacity 0.4s var(--ease);
}
.collapse > * {
  min-height: 0;
  overflow: hidden;
  padding: 6px 6px 24px;
  margin: -6px -6px -24px;
}
.home-block.collapsed .collapse {
  grid-template-rows: 0fr;
  opacity: 0;
}
.home-block.collapsed .section-head { margin-bottom: 0; }
.section-head { transition: margin-bottom 0.6s var(--spring); }

.sheet.moving .news,
.sheet.moving #news-block ~ .home-block,
.sheet.moving::before,
.sheet.moving::after { will-change: transform; }

.home-quote {
  position: relative;
  margin: 0;
  max-width: 820px;
  padding: 8px 0 8px 28px;
  border-left: 4px solid var(--accent);
  font-size: clamp(22px, 3.4vw, 36px);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: #fff;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.4);
}

.home-feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
}
.deck-wrap { display: grid; gap: 20px; justify-items: center; }
.deck {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  touch-action: pan-y;
  user-select: none;
}
.deck img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 26px;
  border: 4px solid #fff;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.7s var(--spring),
    opacity 0.45s var(--ease),
    filter 0.45s var(--ease);
  -webkit-user-drag: none;
}
.deck img[data-pos="0"] {
  z-index: 3;
  opacity: 1;
  pointer-events: auto;
  cursor: zoom-in;
  transform: rotate(-1.5deg);
}
.deck img[data-pos="1"] {
  z-index: 2;
  opacity: 1;
  filter: brightness(0.85);
  transform: translate(7%, -5%) rotate(5deg) scale(0.93);
}
.deck img[data-pos="2"] {
  z-index: 1;
  opacity: 0.9;
  filter: brightness(0.7);
  transform: translate(13%, -9%) rotate(10deg) scale(0.86);
}
.deck img[data-pos="hidden"] { transform: translate(13%, -9%) rotate(10deg) scale(0.86); }
.deck img.fly-out {
  z-index: 4;
  opacity: 0;
  transform: translate(-60%, 6%) rotate(-14deg) scale(0.95);
}
.deck:hover img[data-pos="0"] { transform: rotate(0) translateY(-4px); }
.deck:hover img[data-pos="1"] { transform: translate(9%, -6%) rotate(6deg) scale(0.93); }

.deck-controls {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 6px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
}
.deck-controls[hidden] { display: none; }
.deck-btn {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text);
  background: var(--surface-2);
  transition: transform 0.4s var(--spring), background 0.3s var(--ease);
}
.deck-btn.next { color: #fff; background: var(--accent); }
.deck-btn:hover { transform: scale(1.08); }
.deck-btn:active { transform: scale(0.92); }
.deck-btn svg { width: 22px; height: 22px; }
.deck-count {
  min-width: 48px;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.home-feature.reverse .home-quote {
  justify-self: end;
  padding: 8px 28px 8px 0;
  border-left: 0;
  border-right: 4px solid var(--accent);
  text-align: right;
}
.reverse .deck img[data-pos="0"] { transform: rotate(1.5deg); }
.reverse .deck img[data-pos="1"] { transform: translate(-7%, -5%) rotate(-5deg) scale(0.93); }
.reverse .deck img[data-pos="2"],
.reverse .deck img[data-pos="hidden"] { transform: translate(-13%, -9%) rotate(-10deg) scale(0.86); }
.reverse .deck img.fly-out { transform: translate(60%, 6%) rotate(14deg) scale(0.95); }
.reverse .deck:hover img[data-pos="0"] { transform: rotate(0) translateY(-4px); }
.reverse .deck:hover img[data-pos="1"] { transform: translate(-9%, -6%) rotate(-6deg) scale(0.93); }

.teacher-band {
  position: relative;
  isolation: isolate;
  margin-top: 72px;
  padding-block: clamp(64px, 9vw, 120px);
}
.teacher-band::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 0;
  left: calc(50% - 50vw);
  width: 100vw;
  background:
    linear-gradient(180deg, rgba(15, 20, 30, 0.45), rgba(15, 20, 30, 0.55)),
    url("assets/md/teacher-bg.jpg") center / cover no-repeat;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 22%, #000 78%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 22%, #000 78%, transparent 100%);
}

.sport {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(28px, 5vw, 64px);
  margin-top: 72px;
  padding-block: clamp(64px, 9vw, 120px);
}
.sport::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 0;
  left: calc(50% - 50vw);
  width: 100vw;
  background:
    linear-gradient(180deg, rgba(15, 20, 30, 0.5), rgba(15, 20, 30, 0.6)),
    url("assets/md/sport-bg.jpg") center 35% / cover no-repeat;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 22%, #000 78%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 22%, #000 78%, transparent 100%);
}

.sport-title {
  margin: 0 0 18px;
  font-size: clamp(38px, 6vw, 68px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: #fff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45);
}
.sport-text {
  max-width: 560px;
  margin: 0 0 28px;
  font-size: 16px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}
.sport-label {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
}

.sport-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}
.sport-cards li {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border-radius: 20px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  transition: transform 0.5s var(--spring), border-color 0.3s var(--ease), box-shadow 0.5s var(--spring);
}
.sport-cards li:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
}
.sport-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  font-size: 22px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}

.coaches {
  padding: 16px 18px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}
.coaches h3 {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.coaches ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.coaches li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.coach-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 20%;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #f6c445, var(--accent));
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px color-mix(in srgb, var(--accent) 50%, transparent);
}

.sport-video { justify-self: center; width: min(100%, 320px); }
.video-frame {
  position: relative;
  aspect-ratio: 9 / 16;
  border-radius: 26px;
  overflow: hidden;
  border: 4px solid #fff;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  background: #000 url("assets/md/sport-bg.jpg") 35% center / cover no-repeat;
  transform: rotate(1.5deg);
  transition: transform 0.7s var(--spring), box-shadow 0.7s var(--spring);
}
.video-frame:hover {
  transform: rotate(0) translateY(-4px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.video-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  width: 100%;
  border: 0;
  font: inherit;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.55));
}
.video-play-icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.18), 0 12px 30px rgba(0, 0, 0, 0.35);
  transition: transform 0.5s var(--spring), box-shadow 0.5s var(--spring);
}
.video-play-icon svg { width: 30px; height: 30px; margin-left: 4px; }
.video-play:hover .video-play-icon {
  transform: scale(1.1);
  box-shadow: 0 0 0 16px rgba(255, 255, 255, 0.22), 0 16px 40px rgba(0, 0, 0, 0.4);
}
.video-play-text {
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.45);
}
@media (max-width: 820px) {
  .sport { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .sport-cards { grid-template-columns: 1fr; }
  .sport-cards li { flex-direction: row; align-items: center; }
}

.contact-cta {
  max-width: 640px;
  margin-inline: auto;
  padding: 48px 24px 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  text-align: center;
  color: #fff;
}
.contact-cta h2 {
  margin: 0 0 8px;
  font-size: clamp(20px, 2.6vw, 26px);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.contact-cta p {
  margin: 0 0 22px;
  font-size: 15px;
  opacity: 0.75;
}
.contact-cta-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  color: #fff;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.contact-cta-link span { transition: transform 0.4s var(--spring); }
.contact-cta-link:hover {
  color: #1c1c1f;
  background: #fff;
  border-color: #fff;
}
.contact-cta-link:hover span { transform: translateX(4px); }

@media (max-width: 720px) {
  .home-feature { grid-template-columns: 1fr; }
  .home-feature.reverse .home-quote { order: -1; justify-self: start; }
}

.site-footer {
  position: relative;
  z-index: 6;
  flex: none;
  padding: 24px clamp(16px, 4vw, 40px) calc(24px + env(safe-area-inset-bottom, 0px));
  color: var(--muted);
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-brand img {
  width: 40px;
  height: 40px;
  padding: 3px;
  border-radius: 50%;
  background: #fff;
  object-fit: contain;
  box-shadow: 0 0 0 1px var(--line);
}
.footer-brand b { color: var(--text); }
.site-footer small { font-size: 13px; }
.footer-social { display: flex; flex-wrap: wrap; gap: 8px; }
.footer-social-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
  background: var(--surface-2);
  transition: transform 0.4s var(--spring), color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.footer-social-link svg { width: 20px; height: 20px; }
.footer-social-link:hover { transform: translateY(-2px); }
.footer-social-link.facebook:hover { color: #1877f2; border-color: #1877f2; }
.footer-social-link.instagram:hover { color: #d62976; border-color: #d62976; }
@media (max-width: 560px) {
  .footer-inner { justify-content: center; text-align: center; }
  .footer-social { order: 3; justify-content: center; width: 100%; }
}
body[data-page="memory"] .footer-social-link { color: #d9cfb6; background: rgba(40, 34, 24, 0.6); border-color: rgba(184, 149, 90, 0.3); }

.section-title {
  margin: 0 0 24px;
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #fff;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
}

.news {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  align-items: start;
  gap: 16px;
}
.news-scroller { position: relative; }
.news.scroll {
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 32px) / 3);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: 4px 2px 8px;
}
.news.scroll::-webkit-scrollbar { display: none; }
.news.scroll > .news-item { scroll-snap-align: start; }
.news-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0 0 3px;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 30px;
  line-height: 1;
  color: var(--text);
  cursor: pointer;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  transform: translateY(-50%);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--spring);
}
.news-arrow:hover { transform: translateY(-50%) scale(1.08); }
.news-arrow.prev { left: 8px; }
.news-arrow.next { right: 8px; }
.news-arrow:disabled { opacity: 0; pointer-events: none; }
@media (max-width: 960px) { .news.scroll { grid-auto-columns: calc((100% - 16px) / 2); } }
@media (max-width: 720px) { .news.scroll { grid-template-columns: none; grid-auto-columns: 84%; } }
@media (hover: none) { .news-arrow { display: none; } }

.news-item {
  padding: 12px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  cursor: pointer;
  outline: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  transition:
    transform 0.5s var(--spring),
    box-shadow 0.5s var(--spring),
    border-color 0.3s var(--ease);
}
.news-item:hover,
.news-item:focus-visible {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
}

.news-item time,
.article-date {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.article-date { font-size: 14px; }
.article-date[hidden] { display: none; }

.news-item h3 {
  margin: 0 0 8px;
  font-size: 15px;
  line-height: 1.3;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-photos {
  display: grid;
  grid-template-columns: repeat(var(--count, 1), minmax(0, 1fr));
  gap: 4px;
  height: 120px;
  border-radius: 12px;
  overflow: hidden;
}
.news-photos div {
  overflow: hidden;
  background: var(--surface-2);
}
.news-photos img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  transition: transform 0.8s var(--spring);
}
.news-item:hover .news-photos img,
.news-item:focus-visible .news-photos img { transform: scale(1.05); }

.news-item p {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}
.news-more::after {
  content: "→";
  transition: transform 0.4s var(--spring);
}
.news-item:hover .news-more::after { transform: translateX(4px); }

.article {
  position: fixed;
  inset: 0;
  z-index: 40;
  overflow-y: auto;
  padding: clamp(16px, 5vh, 48px) 16px;
  background: var(--page-bg);
  animation: fadeIn 0.3s var(--ease);
}
.article[hidden] { display: none; }
.article-panel {
  max-width: 900px;
  margin: 0 auto;
  animation: sheetUp 0.6s var(--spring);
}
@keyframes sheetUp { from { opacity: 0; transform: translateY(40px) scale(0.98); } }

.article-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.article-head h2 {
  margin: 4px 0 0;
  font-size: clamp(26px, 4.5vw, 40px);
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.article-close {
  flex: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 26px;
  line-height: 1;
  color: var(--text);
  cursor: pointer;
  background: var(--surface-2);
  transition: transform 0.4s var(--spring), background 0.3s var(--ease);
}
.article-close:hover { transform: scale(1.08); background: var(--surface-3); }
.article-close:active { transform: scale(0.94); }

.carousel { position: relative; }
.carousel-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  border-radius: 24px;
  scrollbar-width: none;
  background: #000;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track img {
  flex: 0 0 100%;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: contain;
  scroll-snap-align: center;
  cursor: zoom-in;
}
.carousel-btn {
  position: absolute;
  top: 50%;
  width: 44px;
  height: 44px;
  margin-top: -22px;
  border: 0;
  border-radius: 50%;
  font-size: 22px;
  color: #fff;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.45);
  transition: transform 0.4s var(--spring), opacity 0.3s var(--ease), background 0.3s var(--ease);
}
.carousel-btn:hover { background: rgba(0, 0, 0, 0.65); transform: scale(1.08); }
.carousel-btn:disabled { opacity: 0; pointer-events: none; }
.carousel-btn.prev { left: 14px; }
.carousel-btn.next { right: 14px; }
.carousel-thumbs {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  overflow-x: auto;
  padding: 4px;
  scrollbar-width: none;
}
.carousel-thumbs::-webkit-scrollbar { display: none; }
.carousel-thumbs button {
  flex: none;
  width: 84px;
  height: 60px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  opacity: 0.55;
  outline: 2px solid transparent;
  outline-offset: 2px;
  transition: opacity 0.3s var(--ease), outline-color 0.3s var(--ease), transform 0.4s var(--spring);
}
.carousel-thumbs button:hover { opacity: 0.85; transform: scale(1.05); }
.carousel-thumbs button.active { opacity: 1; outline-color: var(--accent); }
.carousel-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.carousel[data-count="1"] .carousel-btn,
.carousel[data-count="1"] .carousel-thumbs { display: none; }

.article-text {
  max-width: 680px;
  margin-top: 28px;
}
.article-text p {
  margin: 0 0 16px;
  font-size: 17px;
  line-height: 1.75;
  color: var(--text-soft);
}

.backdrop { transition: opacity 0.5s var(--ease); }
body[data-page="teachers"] .backdrop { opacity: 0; }
body[data-page="teachers"] .view { max-width: none; }
body[data-page="teachers"] .view { padding-top: 76px; }

.page[data-page="upbringing"] { align-items: stretch; }
.upbringing { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; width: 100%; max-width: 1120px; margin: 0 auto; }

.ub-top { display: grid; justify-items: start; gap: 14px; }
.ub-title {
  margin: 0;
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: #fff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45);
}
.ub-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  padding: 5px;
  border-radius: 999px;
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  box-shadow: 0 6px 22px rgba(20, 25, 40, 0.18);
}
.ub-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}
.ub-tab:hover { background: color-mix(in srgb, var(--text) 8%, transparent); }
.ub-tab.active { color: var(--on-accent); background: var(--accent); }
.ub-tab-icon svg { display: block; width: 18px; height: 18px; }
.ub-lead { margin: 0 0 4px; font-size: 18px; color: #fff; text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45); }

.ub-section { display: grid; gap: 18px; animation: pageIn 0.5s var(--spring) both; }
.ub-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.ub-block {
  grid-column: 1 / -1;
  min-width: 0;
  padding: clamp(20px, 3vw, 32px);
  border-radius: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}
.ub-block.half { grid-column: auto; }
.ub-block > p { margin: 0 0 12px; font-size: 16.5px; line-height: 1.7; color: var(--text-soft); }
.ub-block > p:last-child { margin-bottom: 0; }
.ub-block-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; margin-bottom: 18px; }
.ub-block-head h2 { flex: 1 1 0; min-width: 10ch; margin: 0; font-size: clamp(20px, 2.3vw, 26px); line-height: 1.25; color: var(--text); text-wrap: balance; }
.ub-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  color: var(--accent-strong);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.ub-icon svg { width: 24px; height: 24px; }

.ub-who { display: flex; align-items: center; gap: 16px; text-decoration: none; color: var(--text); }
.ub-who img {
  flex: none;
  width: 92px;
  height: 116px;
  border-radius: 18px;
  object-fit: cover;
  object-position: center 20%;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
  transition: transform 0.5s var(--spring);
}
.ub-who:hover img { transform: scale(1.04) rotate(-1deg); }
.ub-who-text { display: grid; gap: 4px; }
.ub-who-text b { font-size: 19px; line-height: 1.25; }
.ub-who-text small { font-size: 14px; color: var(--muted); }
.ub-who-go { margin-top: 4px; font-size: 14px; font-weight: 700; color: var(--accent-strong); }
.ub-contacts { display: grid; gap: 8px; margin-top: 18px; }
.ub-contact {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
  background: var(--surface-2);
  word-break: break-word;
  transition: transform 0.4s var(--spring), background 0.3s var(--ease);
}
.ub-contact:hover { transform: translateX(3px); background: var(--surface-3); }
.ub-btn-icon svg { display: block; width: 20px; height: 20px; color: var(--accent-strong); }

.ub-callout {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  color: var(--on-accent);
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(255, 255, 255, 0.18), transparent 55%),
    var(--accent);
  border-color: transparent;
  box-shadow: 0 16px 40px color-mix(in srgb, var(--accent) 30%, transparent);
}
.ub-callout-icon svg { width: 44px; height: 44px; }
.ub-callout-text p { margin: 0; font-size: clamp(18px, 2vw, 22px); font-weight: 800; line-height: 1.4; }

.ub-text .ub-block-head,
.ub-person .ub-block-head,
.ub-phones .ub-block-head { margin-bottom: 12px; }
.ub-text .ub-block-head h2,
.ub-person .ub-block-head h2,
.ub-phones .ub-block-head h2 { font-size: 18px; font-weight: 800; }
.ub-text.half > p { font-size: 15px; line-height: 1.65; }
.ub-person .ub-block-head h2 { font-size: 15px; font-weight: 700; color: var(--muted); }

.ub-phones { padding-block: clamp(18px, 2.4vw, 24px); }
.ub-poster-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-soft);
  cursor: zoom-in;
  background: var(--surface-2);
}
.ub-poster-link:hover { color: var(--text); }
.ub-poster-link .ub-btn-icon svg { width: 16px; height: 16px; }
.ub-lines { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; margin: 0; padding: 0; list-style: none; }
.ub-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 12px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.ub-line-title { flex: 1 1 180px; font-size: 13.5px; line-height: 1.4; color: var(--text-soft); }
.ub-line-phones { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 2px 12px; }
.ub-phone {
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
  color: var(--accent-strong);
}
.ub-phone:hover { text-decoration: underline; }

.ub-docs-list { display: grid; gap: 10px; }
.ub-doc {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px 16px;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--surface-2);
}
.ub-doc-type {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--accent-strong);
  background: var(--surface);
  border: 1px solid var(--line);
}
.ub-doc-name { font-size: 15.5px; line-height: 1.4; color: var(--text); }
.ub-doc-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.ub-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: transform 0.4s var(--spring), filter 0.3s var(--ease);
}
.ub-btn:hover { transform: translateY(-2px); }
.ub-btn.primary { color: var(--on-accent); background: var(--accent); border-color: transparent; }
.ub-btn.primary .ub-btn-icon svg { color: currentColor; }
.ub-btn .ub-btn-icon svg { width: 18px; height: 18px; }

.ub-empty { margin: 0; padding: 18px 20px; border-radius: 18px; font-size: 15.5px; color: var(--muted); background: var(--surface-2); }
.ub-post-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); align-items: start; gap: 16px; }
.ub-post { display: grid; overflow: hidden; border-radius: 22px; background: var(--surface-2); border: 1px solid var(--line); }
.ub-post.open { grid-column: 1 / -1; }
.ub-post-cover { display: block; padding: 0; border: 0; cursor: zoom-in; background: var(--surface-3); }
.ub-post-cover img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform 0.8s var(--spring); }
.ub-post.open .ub-post-cover img { aspect-ratio: 16 / 9; max-height: 520px; }
.ub-post-cover:hover img { transform: scale(1.03); }
.ub-post-body { display: grid; gap: 8px; padding: 16px 18px 18px; }
.ub-post-date { font-size: 13px; font-weight: 700; color: var(--accent-strong); }
.ub-post h3 { margin: 0; font-size: 17px; line-height: 1.35; color: var(--text); }
.ub-post-text p { margin: 0 0 8px; font-size: 15px; line-height: 1.6; color: var(--text-soft); }
.ub-post-text p:last-child { margin-bottom: 0; }
.ub-post:not(.open) .ub-post-text { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.ub-post:not(.open) .ub-post-text p + p { display: none; }
.ub-post-more { display: none; }
.ub-post.open .ub-post-more { display: block; margin-top: 6px; }
.ub-more {
  display: block;
  margin: 18px auto 0;
  padding: 11px 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  background: var(--surface-2);
}
.ub-more:hover { border-color: var(--accent); }
.ub-post-toggle {
  justify-self: start;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--accent-strong);
  cursor: pointer;
  background: var(--surface);
}
.ub-club-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.ub-club {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: var(--surface-2);
}
.ub-club-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; font-size: 26px; background: var(--surface); }
.ub-club-text { display: grid; gap: 2px; }
.ub-club-text b { font-size: 16px; color: var(--text); }
.ub-club-text small { font-size: 13px; color: var(--muted); }
.ub-sub { margin: 22px 0 12px; font-size: 15px; font-weight: 800; color: var(--text); }
.ub-leaders { display: flex; flex-wrap: wrap; gap: 8px; }
.ub-leader {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 5px 16px 5px 5px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
  background: var(--surface-2);
}
a.ub-leader:hover { color: var(--accent-strong); }
.ub-leader img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; object-position: center 20%; }
.ub-video .ub-video-frame { width: min(100%, 300px); margin: 0 auto; }
.ub-photo-img { display: block; width: 100%; padding: 0; border: 0; border-radius: 20px; overflow: hidden; cursor: zoom-in; background: var(--surface-2); }
.ub-photo-img img { width: 100%; max-height: 560px; object-fit: cover; }
.ub-photo-note { margin: 12px 0 0; font-size: 14.5px; color: var(--muted); text-align: center; }
.ub-motto { margin: 0; }

.fg-forms .ub-docs-list { margin-top: 4px; }

@media (max-width: 860px) {
  .ub-grid { grid-template-columns: minmax(0, 1fr); }
  .ub-block.half { grid-column: 1 / -1; }
  .ub-lines { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .ub-tabs { display: flex; width: 100%; }
  .ub-tab { flex: 1; justify-content: center; padding: 10px 12px; }
  .ub-doc { grid-template-columns: auto minmax(0, 1fr); }
  .ub-doc-actions { grid-column: 1 / -1; justify-content: stretch; }
  .ub-doc-actions .ub-btn { flex: 1; justify-content: center; }
  .ub-doc-type { width: 44px; height: 44px; font-size: 11px; }
  .ub-who img { width: 76px; height: 96px; }
}

.page[data-page="first"] { align-items: stretch; }
.first { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; width: 100%; max-width: 980px; margin: 0 auto; }

.fg-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(20px, 4vw, 44px);
  overflow: hidden;
  background:
    radial-gradient(circle at 0% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 55%),
    var(--surface);
}
.fg-title {
  margin: 0;
  font-size: clamp(26px, 3.6vw, 40px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
}
.profile-card .fg-intro { margin: 16px 0 0; font-size: 17px; line-height: 1.65; }
.fg-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.fg-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  background: var(--surface-2);
  transition: transform 0.4s var(--spring), background 0.3s var(--ease), color 0.3s var(--ease);
}
.fg-btn:hover { transform: translateY(-2px); }
.fg-btn.primary { color: #fff; border-color: transparent; background: var(--accent); }
.fg-btn.primary:hover { filter: brightness(1.08); }
.fg-hero-photo {
  display: block;
  padding: 0;
  border: 6px solid #fff;
  border-radius: 24px;
  overflow: hidden;
  cursor: zoom-in;
  background: var(--surface-2);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
  transform: rotate(2deg);
  transition: transform 0.7s var(--spring);
}
.fg-hero-photo:hover { transform: rotate(0) scale(1.02); }
.fg-hero-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

.fg-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.fg-steps li { position: relative; display: grid; align-content: start; gap: 6px; }
.fg-step-num {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-bottom: 4px;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  background: var(--accent);
}
.fg-step-date { font-size: 24px; font-weight: 800; letter-spacing: -0.01em; color: var(--text); }
.profile-card .fg-steps p, .fg-steps p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--text-soft); }

.fg-q { border-top: 1px solid var(--line); }
.fg-q:last-child { border-bottom: 1px solid var(--line); }
.fg-q summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 2px;
  list-style: none;
  cursor: pointer;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
}
.fg-q summary::-webkit-details-marker { display: none; }
.fg-q summary::after {
  content: "";
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background:
    linear-gradient(var(--accent-strong), var(--accent-strong)) center / 12px 2px no-repeat,
    linear-gradient(var(--accent-strong), var(--accent-strong)) center / 2px 12px no-repeat,
    color-mix(in srgb, var(--accent) 14%, transparent);
  transition: transform 0.4s var(--spring);
}
.fg-q[open] summary::after { transform: rotate(135deg); }
.fg-q summary:hover { color: var(--accent-strong); }
.fg-a { padding: 0 2px 18px; animation: fgOpen 0.45s var(--spring); }
@keyframes fgOpen { from { opacity: 0; transform: translateY(-6px); } }
.profile-card .fg-a p { margin: 0 0 10px; font-size: 16px; }
.fg-a ul, .fg-a ol { display: grid; gap: 8px; margin: 0 0 10px; padding-left: 22px; font-size: 16px; line-height: 1.6; color: var(--text-soft); }
.fg-a li::marker { color: var(--accent-strong); font-weight: 700; }
.fg-a > :last-child { margin-bottom: 0; }
.fg-a a, .fg-contact a:not(.fg-btn) { color: var(--accent-strong); font-weight: 700; }

.fg-forms .materials { grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); }
.fg-teacher-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 14px; margin-bottom: 20px; }
.fg-teacher {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  border-radius: 22px;
  text-decoration: none;
  color: var(--text);
  background: var(--surface-2);
  transition: transform 0.4s var(--spring), box-shadow 0.4s var(--spring);
}
.fg-teacher:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12); }
.fg-teacher img { flex: none; width: 92px; height: 112px; border-radius: 16px; object-fit: cover; object-position: center 20%; }
.fg-teacher-info { display: grid; gap: 4px; }
.fg-teacher-info b { font-size: 17px; line-height: 1.3; }
.fg-teacher-info small { font-size: 14px; color: var(--muted); }
.fg-teacher-go { margin-top: 6px; font-size: 14px; font-weight: 700; color: var(--accent-strong); }
.profile-card .fg-cta {
  margin-top: 6px;
  padding: 14px 18px;
  border-radius: 18px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.fg-contact { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.fg-contact h2 { margin: 0 0 6px; font-size: 22px; color: var(--text); }
.profile-card.fg-contact p { margin: 0; }
.fg-contact-links { display: flex; flex-wrap: wrap; gap: 10px; }

@media (max-width: 760px) {
  .fg-hero { grid-template-columns: minmax(0, 1fr); }
  .fg-hero-photo { transform: none; order: -1; }
  .fg-q summary { font-size: 16px; }
}

.page[data-page="teachers"] { align-items: stretch; gap: 28px; }
.page[data-page="teachers"] .page-title {
  color: var(--text);
  text-shadow: none;
}

.teachers {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 20px;
}
@media (max-width: 1200px) { .teachers { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 960px)  { .teachers { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px)  { .teachers { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
@media (max-width: 440px)  { .teachers { gap: 10px; } }

.teacher-email { overflow-wrap: anywhere; }
.teacher-email a { color: var(--accent-strong); font-weight: 700; }
.teachers-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.mk-side {
  padding: 18px;
  border-radius: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}
.mk-side-title { margin: 0 0 12px; font-size: 13px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.mk-side-list { display: grid; gap: 8px; }
.mk-side-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "text go" "faces go";
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  border-radius: 18px;
  text-decoration: none;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid transparent;
  transition: transform 0.4s var(--spring), border-color 0.3s var(--ease);
}
.mk-side-item:hover { transform: translateY(-2px); border-color: var(--accent); }
.mk-side-faces { grid-area: faces; display: flex; align-items: center; }
.mk-side-faces img, .mk-side-more {
  width: 28px;
  height: 28px;
  margin-left: -8px;
  border-radius: 50%;
  border: 2px solid var(--surface-2);
  object-fit: cover;
  object-position: center 20%;
  background: var(--surface-3);
}
.mk-side-faces > :first-child { margin-left: 0; }
.mk-side-faces .mk-side-count { margin-left: 10px; font-size: 12px; font-weight: 600; white-space: nowrap; color: var(--muted); }
.mk-side-more { display: grid; place-items: center; font-size: 11.5px; font-weight: 800; color: var(--text-soft); }
.mk-side-text { grid-area: text; display: grid; gap: 3px; min-width: 0; }
.mk-side-text b { font-size: 14.5px; line-height: 1.3; }
.mk-side-text small { font-size: 12px; line-height: 1.35; color: var(--muted); }
.mk-side-go { grid-area: go; font-weight: 800; color: var(--accent-strong); transition: transform 0.4s var(--spring); }
.mk-side-item:hover .mk-side-go { transform: translateX(3px); }

@media (min-width: 1200px) {
  .teachers-layout { grid-template-columns: minmax(0, 1fr) 280px; align-items: start; gap: 24px; }
  .teachers-layout .teachers { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
  .mk-side {
    position: sticky;
    top: 84px;
    max-height: calc(100vh - 100px);
    max-height: calc(100dvh - 100px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }
}
@media (max-width: 1199px) {
  .teachers-layout .mk-side { order: -1; padding: 14px; }
  .mk-side-list { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin-inline: -14px; padding-inline: 14px; }
  .mk-side-list::-webkit-scrollbar { display: none; }
  .mk-side-item { flex: 0 0 min(82%, 280px); scroll-snap-align: start; }
}

.teacher {
  aspect-ratio: 5 / 8;
  perspective: 1600px;
  container: card / inline-size;
}
.teacher-inner {
  position: relative;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.9s var(--spring);
}
.teacher.flipped .teacher-inner { transform: rotateY(180deg); }
.teacher-front { cursor: pointer; }
.teacher-back { cursor: pointer; }
.teacher-unflip {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text);
  background: var(--surface-2);
  transition: transform 0.5s var(--spring), background 0.3s var(--ease), color 0.3s var(--ease);
}
.teacher-unflip svg { width: 16px; height: 16px; }
.teacher-unflip:hover { transform: rotate(-90deg) scale(1.08); color: #fff; background: var(--accent); }
.teacher-back .teacher-head { padding-right: 34px; }
.teacher:not(.flipped) .teacher-back,
.teacher.flipped .teacher-front { pointer-events: none; visibility: hidden; }
.teacher-face { transition: visibility 0s 0.15s; }

.teacher-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  border-radius: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  overflow: hidden;
}
.teacher-back {
  transform: rotateY(180deg);
  padding: 16px;
}

.teacher-top { padding: 16px 16px 12px; }
.teacher-name {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text);
}
.teacher-role {
  display: inline-block;
  margin: 8px 0 0;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-strong);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.teacher-photo {
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 0 8px 8px;
  border-radius: 22px;
  overflow: hidden;
  background: var(--surface-2);
}
.teacher-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}
.teacher-photo::after {
  content: "";
  position: absolute;
  inset: 55% 0 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.45), transparent);
  pointer-events: none;
}
.teacher-actions {
  position: absolute;
  z-index: 1;
  left: 10px;
  right: 10px;
  bottom: 10px;
  display: flex;
  gap: 6px;
  container-type: inline-size;
}
.teacher-actions .teacher-btn,
.teacher-flip {
  margin: 0;
  color: #fff;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
}
.teacher-actions .teacher-btn { flex: 1; min-width: 0; padding-inline: 10px; white-space: nowrap; }
@container (max-width: 210px) {
  .teacher-actions .teacher-btn { padding-inline: 8px; font-size: 13px; }
  .teacher-actions .teacher-btn::after { display: none; }
}
@container card (max-width: 205px) {
  .teacher-top { padding: 11px 11px 8px; }
  .teacher-name { font-size: 14px; }
  .teacher-role { margin-top: 6px; padding: 3px 8px; font-size: 10.5px; line-height: 1.3; }
  .teacher-photo { margin: 0 6px 6px; border-radius: 16px; }
  .teacher-actions { left: 6px; right: 6px; bottom: 6px; gap: 4px; }
  .teacher-actions .teacher-btn { padding: 6px 8px; font-size: 11.5px; line-height: 1.15; white-space: normal; text-align: center; }
  .teacher-actions .teacher-flip { display: none; }
  .teacher-face { border-radius: 20px; }
}
.teacher-flip {
  display: grid;
  flex: none;
  place-items: center;
  width: 42px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.5s var(--spring), background 0.3s var(--ease);
}
.teacher-flip svg { width: 17px; height: 17px; }
.teacher-flip:hover { transform: rotate(-90deg); background: rgba(255, 255, 255, 0.34); }

.teacher-btn {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  padding: 11px 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  background: var(--accent);
  transition: transform 0.4s var(--spring), filter 0.3s var(--ease), background 0.3s var(--ease);
}
.teacher-btn::after {
  content: "→";
  transition: transform 0.4s var(--spring);
}
.teacher-btn:hover { transform: scale(1.03); filter: brightness(1.08); }
.teacher-btn:hover::after { transform: translateX(3px); }
.teacher-btn:active { transform: scale(0.96); }

.teacher-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.teacher-oval {
  flex: none;
  width: 60px;
  height: 78px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 20%;
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--accent);
}
.teacher-back .teacher-name { font-size: 15px; }
.teacher-info {
  flex: 1;
  min-height: 0;
  margin: 0;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
}
.teacher-info dt {
  margin-top: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.teacher-info dt:first-child { margin-top: 0; }
.teacher-info dd { margin: 3px 0 0; font-weight: 600; }
.teacher-info .credo {
  position: relative;
  margin-top: 6px;
  padding: 12px 14px 12px 34px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 500;
  font-style: italic;
  color: var(--text-soft);
  background: color-mix(in srgb, var(--accent) 9%, transparent);
}
.teacher-info .credo::before {
  content: "“";
  position: absolute;
  left: 10px;
  top: 2px;
  font-size: 36px;
  font-style: normal;
  line-height: 1;
  color: var(--accent);
}

.page[data-page="contacts"] { align-items: stretch; gap: 28px; }
.contacts-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
}
.quick {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 20px;
}
.quick-card,
.contacts-card {
  border-radius: 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}
.quick-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 24px;
  transition: transform 0.5s var(--spring), box-shadow 0.5s var(--spring);
}
.quick-card:hover { transform: translateY(-3px); box-shadow: 0 18px 44px rgba(0, 0, 0, 0.18); }
.quick-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  border-radius: 16px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.quick-icon svg { width: 24px; height: 24px; }
.quick-card small {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.quick-card b { font-size: 19px; line-height: 1.3; color: var(--text); }
.quick-card b a { color: inherit; text-decoration: none; }
.quick-card b a:hover { color: var(--accent); }
.quick-sub { font-size: 14px; color: var(--muted); }
.quick-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 16px;
  border: 0;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  color: var(--accent);
  background: none;
  cursor: pointer;
}
.quick-action svg { width: 16px; height: 16px; transition: transform 0.4s var(--spring); }
.quick-action:hover svg { transform: translate(2px, -2px); }
.copy-btn.done { color: #2e9d57; }

.contacts-card { padding: 24px; }
.contacts-card h2 { margin: 0 0 16px; font-size: 20px; color: var(--text); }

.people { margin: 0; padding: 0; list-style: none; }
.person {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.person:last-child { border-bottom: 0; padding-bottom: 0; }
.person img {
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 20%;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px color-mix(in srgb, var(--accent) 50%, transparent);
}
.person-text { display: grid; gap: 2px; min-width: 0; }
.person-text b { font-size: 15px; color: var(--text); }
.person-text span { font-size: 13px; color: var(--muted); }
.person-phone {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  color: var(--text);
  background: var(--surface-2);
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}
.person-phone svg { width: 15px; height: 15px; }
.person-phone:hover { color: #fff; background: var(--accent); }

.map-card {
  position: relative;
  padding: 0;
  overflow: hidden;
  min-height: 360px;
}
.map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.map-open {
  position: absolute;
  left: 16px;
  bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
  transition: transform 0.4s var(--spring);
}
.map-open svg { width: 18px; height: 18px; }
.map-open:hover { transform: translateY(-2px) scale(1.03); }

@media (max-width: 820px) {
  .contacts-grid { grid-template-columns: 1fr; }
  .person { flex-wrap: wrap; }
  .person-text { flex: 1 1 160px; }
  .person-phone { margin-left: 66px; }
}

.page[data-page="info"] { align-items: stretch; gap: 28px; }
.info-head .page-title { margin-bottom: 10px; }
.info-lead {
  max-width: 720px;
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  color: #fff;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45);
}
.info-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.info-icon svg { width: 22px; height: 22px; }
.info-badge {
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  color: var(--accent-strong);
  background: color-mix(in srgb, var(--accent) 13%, transparent);
}
.info-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-radius: 18px;
  background: var(--page-bg);
}
.info-note p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--text-soft); }

body[data-page="info"] .view { max-width: none; padding-bottom: 24px; }
.page[data-page="info"] { height: calc(100vh - var(--view-top) - 24px); height: calc(100dvh - var(--view-top) - 24px); gap: 20px; }
.transparency {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr);
  gap: 24px;
  width: 100%;
}
.tp-panel,
.tp-feed {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.tp-panel {
  padding: clamp(20px, 3vw, 32px);
  border-radius: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.18);
}
.tp-panel.swap > :not([hidden]) { animation: panelIn 0.5s var(--spring); }
@keyframes panelIn { from { opacity: 0; transform: translateY(10px); } }

.tp-kicker {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.tp-home-head {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-bottom: 22px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.tp-home-head img {
  flex: none;
  width: 64px;
  height: 64px;
  padding: 4px;
  border-radius: 50%;
  object-fit: contain;
  background: #fff;
  box-shadow: 0 0 0 1px var(--line);
}
.tp-home-head h2 { margin: 4px 0 4px; font-size: clamp(20px, 2.6vw, 26px); line-height: 1.25; color: var(--text); }
.tp-home-head p { margin: 0; font-size: 14px; color: var(--muted); }
.tp-section { padding-top: 18px; }
.tp-section h3 {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
}
.tp-rows { margin: 0; }
.tp-rows div {
  display: grid;
  grid-template-columns: minmax(130px, 0.8fr) minmax(0, 1.6fr);
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.tp-rows div:last-child { border-bottom: 0; }
.tp-rows dt { font-size: 14px; color: var(--muted); }
.tp-rows dd { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.45; color: var(--text); }
.tp-rows a { color: inherit; text-decoration: none; }
.tp-rows a:hover { color: var(--accent); }
.tp-hint {
  margin: 20px 0 0;
  padding: 14px 16px;
  border-radius: 16px;
  font-size: 14px;
  color: var(--text-soft);
  background: color-mix(in srgb, var(--accent) 9%, transparent);
}

.tp-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.tp-back {
  padding: 9px 14px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  background: var(--surface-2);
  transition: background 0.3s var(--ease), transform 0.4s var(--spring);
}
.tp-back:hover { background: var(--surface-3); transform: translateX(-2px); }
.tp-close {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  color: var(--text);
  cursor: pointer;
  background: var(--surface-2);
  transition: background 0.3s var(--ease), transform 0.4s var(--spring);
}
.tp-close:hover { background: var(--surface-3); transform: scale(1.08); }
.tp-detail h2 { margin: 6px 0 6px; font-size: clamp(20px, 2.6vw, 28px); line-height: 1.25; color: var(--text); }
.tp-about { margin: 0 0 20px; font-size: 15px; color: var(--muted); }
.tp-body .doc-intro { font-size: 16px; }
.tp-body .doc-pdf { height: 560px; }
.tp-body > :last-child { margin-bottom: 0; }

.tp-feed {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 2px 10px 16px 8px;
  margin: -2px -10px 0 -8px;
}
.tp-group {
  margin: 14px 0 2px 4px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}
.tp-group:first-child { margin-top: 0; }
.tp-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  font: inherit;
  text-align: left;
  color: var(--text);
  cursor: pointer;
  background: var(--surface);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transition: transform 0.4s var(--spring), border-color 0.3s var(--ease), box-shadow 0.4s var(--spring);
}
.tp-item:hover { transform: translateX(-3px); border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.tp-item.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent), 0 10px 28px rgba(0, 0, 0, 0.16);
}
.tp-item .info-icon { width: 40px; height: 40px; border-radius: 13px; }
.tp-item .info-icon svg { width: 20px; height: 20px; }
.tp-item-text { display: grid; gap: 2px; }
.tp-item-text b { font-size: 14px; line-height: 1.3; }
.tp-item-text small { font-size: 12px; line-height: 1.4; color: var(--muted); }
.tp-item.soon { opacity: 0.55; }
.tp-item.soon:hover,
.tp-item.soon.active { opacity: 0.85; }
.tp-item.soon .info-badge,
.tp-item.soon .info-icon { color: var(--muted); background: var(--surface-2); }
.tp-item .info-badge { font-size: 11px; padding: 4px 9px; }

@media (max-width: 900px) {
  .page[data-page="info"] { height: auto; }
  .transparency { grid-template-columns: 1fr; }
  .tp-panel, .tp-feed { height: auto; overflow: visible; }
  .tp-panel { scroll-margin-top: calc(var(--view-top) + 8px); }
}
@media (max-width: 520px) {
  .tp-rows div { grid-template-columns: 1fr; gap: 2px; }
  .tp-item .info-badge { display: none; }
}

.doc-intro {
  max-width: 720px;
  margin: 0 0 24px;
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-soft);
}
.doc-facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 12px;
  margin: 0 0 28px;
}
.doc-facts div {
  padding: 16px 18px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.doc-facts dt {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.doc-facts dd { margin: 6px 0 0; font-size: 15px; font-weight: 700; line-height: 1.45; color: var(--text); }
.doc-block { margin-bottom: 28px; }
.doc-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
  gap: 12px;
  margin: 0 0 24px;
}
.doc-stats div {
  display: grid;
  gap: 4px;
  padding: 18px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}
.doc-stats b {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--accent-strong);
}
.doc-stats span { font-size: 13px; font-weight: 600; color: var(--muted); }
.doc-rows {
  padding: 4px 18px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.doc-block h3 { margin: 0 0 12px; font-size: 18px; color: var(--text); }
.doc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.doc-chips li {
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-strong);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.doc-people {
  padding: 8px 20px;
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.doc-people .person:last-child { padding-bottom: 12px; }
.doc-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: 12px;
}
.doc-gallery img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: top;
  border-radius: 16px;
  border: 1px solid var(--line);
  cursor: zoom-in;
  transition: transform 0.5s var(--spring), box-shadow 0.5s var(--spring);
}
.doc-gallery img:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18); }
.doc-file {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.doc-file-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 56px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  background: var(--accent);
}
.doc-file-text { display: grid; gap: 2px; flex: 1 1 220px; min-width: 0; }
.doc-file-text b { font-size: 15px; color: var(--text); }
.doc-file-text span { font-size: 13px; color: var(--muted); }
.doc-btn {
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
  background: var(--surface-2);
  transition: transform 0.4s var(--spring), background 0.3s var(--ease);
}
.doc-btn:hover { transform: translateY(-2px); background: var(--surface-3); }
.doc-btn.primary { color: #fff; background: var(--accent); }
.doc-btn.primary:hover { background: var(--accent-strong); }
.doc-pdf-wrap { position: relative; margin-top: 12px; }
.doc-pdf-wrap .doc-pdf { margin-top: 0; pointer-events: none; }
.doc-pdf-wrap.active .doc-pdf { pointer-events: auto; }
.doc-pdf-cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: end center;
  padding-bottom: 18px;
  border: 0;
  border-radius: 20px;
  font: inherit;
  cursor: pointer;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.18), transparent 35%);
  transition: opacity 0.3s var(--ease);
}
.doc-pdf-cover span {
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: rgba(20, 22, 28, 0.8);
}
.doc-pdf-wrap.active .doc-pdf-cover { opacity: 0; pointer-events: none; }
.doc-pdf {
  display: block;
  width: 100%;
  height: min(80vh, 900px);
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
}
@media (max-width: 720px) {
  .doc-pdf, .doc-pdf-wrap { display: none; }
}
.page[data-page="teacher"],
.page[data-page="mk"] { align-items: stretch; }
.profile { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; width: 100%; max-width: 980px; margin: 0 auto; }

.back-pill,
.pager-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 10px 18px;
  border: 1px solid var(--bar-border);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
  background: var(--bar-bg);
  box-shadow: 0 8px 32px rgba(30, 40, 70, 0.14), inset 0 1px 0 var(--bar-inset);
  transition: transform 0.4s var(--spring), background 0.3s var(--ease);
}
.back-pill { justify-self: start; }
.back-pill::before,
.pager-link.prev::before { content: "←"; }
.pager-link.next::after { content: "→"; }
.back-pill:hover,
.pager-link:hover { transform: scale(1.04); background: var(--bar-bg-hover); }
.profile-pager { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
.pager-link.next { margin-left: auto; }

.profile-card {
  padding: clamp(20px, 3vw, 32px);
  border-radius: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}
.profile-card > h2 { margin: 0 0 14px; font-size: 22px; color: var(--text); }
.profile-card p { margin: 0 0 12px; font-size: 16px; line-height: 1.7; color: var(--text-soft); }
.profile-card p:last-child { margin-bottom: 0; }

.profile-main {
  display: grid;
  grid-template-columns: minmax(200px, 320px) minmax(0, 1fr);
  align-items: start;
  gap: clamp(20px, 3vw, 36px);
}
.profile-photo {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 22px;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  background: var(--surface-2);
}
button.profile-photo { cursor: zoom-in; }
.profile-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; transition: transform 0.8s var(--spring); }
button.profile-photo:hover img { transform: scale(1.04); }
.profile-name {
  margin: 12px 0 6px;
  font-size: clamp(26px, 3.4vw, 38px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--text);
}
.profile-card .profile-subject { margin: 0; font-size: 17px; font-weight: 700; color: var(--accent-strong); }
.profile-facts { display: grid; gap: 10px; margin: 20px 0 0; }
.profile-facts div { padding: 12px 16px; border-radius: 16px; background: var(--surface-2); }
.profile-facts dt { font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.profile-facts dd { margin: 4px 0 0; font-weight: 600; line-height: 1.5; color: var(--text); }
.profile-facts a { color: var(--accent-strong); }
.profile-credo {
  margin: 20px 0 0;
  padding: 4px 0 4px 20px;
  border-left: 4px solid var(--accent);
  font-size: 18px;
  font-weight: 600;
  font-style: italic;
  line-height: 1.55;
  color: var(--text);
}

.mk-kicker {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-strong);
}
.mk-teaser > h2 { margin-bottom: 10px; }
.mk-members { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 20px; }
.mk-member {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 14px 4px 4px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
  background: var(--surface-2);
  transition: transform 0.4s var(--spring), background 0.3s var(--ease);
}
.mk-member:hover { transform: translateY(-2px); background: var(--surface-3); }
.mk-member.current { color: var(--accent-strong); background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }
.mk-member img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; object-position: center 20%; }
.mk-teaser .doc-btn { display: inline-flex; }

.profile.mk { max-width: 1160px; gap: 24px; }

.mk-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr);
  align-items: center;
  gap: clamp(24px, 4vw, 56px);
  overflow: hidden;
  padding: clamp(24px, 4vw, 52px);
  background:
    radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--accent) 15%, transparent), transparent 60%),
    var(--surface);
}
.mk-hero.single, .mk-hero.bare { grid-template-columns: minmax(0, 1fr); }
.mk-hero.single .mk-hero-text { max-width: 820px; }
.mk-title {
  margin: 0;
  font-size: clamp(28px, 3.8vw, 46px);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--text);
  text-wrap: balance;
}
.profile-card .mk-lead { margin: 18px 0 0; font-size: clamp(17px, 1.6vw, 20px); line-height: 1.6; color: var(--text-soft); }
.mk-facts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.mk-fact {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  padding: 7px 18px 7px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: inherit;
  text-align: left;
  text-decoration: none;
  color: var(--text);
  cursor: pointer;
  background: var(--surface-2);
  transition: transform 0.4s var(--spring), border-color 0.3s var(--ease);
}
.mk-fact:hover { transform: translateY(-2px); border-color: var(--accent); }
.mk-fact > b {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 17px;
  font-weight: 800;
  color: var(--surface);
  background: var(--accent);
}
.mk-fact > span { font-size: 15px; font-weight: 700; }
.mk-fact-head img { flex: none; width: 40px; height: 40px; border-radius: 50%; object-fit: cover; object-position: center 20%; }
.mk-fact-who { display: grid; min-width: 0; line-height: 1.25; }
.mk-fact-who small { font-size: 12px; font-weight: 700; color: var(--muted); }
.mk-fact-who b { font-size: 15px; }

.mk-hero-photos { min-width: 0; }
.mk-hero-photos.n2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(12px, 2vw, 22px); padding-block: 22px; }
.mk-hero-photo {
  display: block;
  width: 100%;
  padding: 0;
  border: 6px solid #fff;
  border-radius: 24px;
  overflow: hidden;
  cursor: zoom-in;
  background: var(--surface-2);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
  transition: transform 0.7s var(--spring);
}
.mk-hero-photo img { width: 100%; height: 100%; object-fit: cover; }
.mk-hero-photos.n2 .mk-hero-photo { aspect-ratio: 3 / 4; }
.mk-hero-photos.n2 .mk-hero-photo img { object-position: center 25%; }
.mk-hero-photos.n2 .mk-hero-photo:first-child { transform: rotate(-3deg) translateY(-12px); }
.mk-hero-photos.n2 .mk-hero-photo:last-child { transform: rotate(3deg) translateY(12px); }
.mk-hero-photos.n2 .mk-hero-photo:hover { position: relative; z-index: 1; transform: rotate(0) scale(1.03); }
.mk-hero-photos.n1 .mk-hero-photo { border: 0; border-radius: 22px; box-shadow: none; }
.mk-hero-photos.n1 .mk-hero-photo img { max-height: 640px; object-position: center 25%; transition: transform 0.8s var(--spring); }
.mk-hero-photos.n1 .mk-hero-photo:hover img { transform: scale(1.02); }

.mk-motto {
  padding: clamp(28px, 4vw, 44px) clamp(20px, 5vw, 64px);
  border-radius: 28px;
  text-align: center;
  color: var(--surface);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(0, 0, 0, 0.12)), var(--accent);
  box-shadow: 0 16px 40px color-mix(in srgb, var(--accent) 28%, transparent);
}
.mk-motto-quote { margin: 0; }
.mk-motto-quote::before { content: "“"; display: block; height: 0.5em; font: 800 72px/1 Georgia, "Times New Roman", serif; opacity: 0.55; }
.mk-motto-quote p { max-width: 900px; margin: 0 auto; font-size: clamp(20px, 2.6vw, 30px); font-weight: 800; line-height: 1.35; text-wrap: balance; }

.mk-team { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr)); gap: 14px; }
.mk-person {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 8px 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  transition: transform 0.4s var(--spring), border-color 0.3s var(--ease), box-shadow 0.4s var(--spring);
}
.mk-person:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 14px 30px rgba(0, 0, 0, 0.12); }
.mk-person.head { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.mk-person-photo { position: relative; display: block; aspect-ratio: 4 / 5; border-radius: 16px; overflow: hidden; background: var(--surface-2); }
.mk-person-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; transition: transform 0.8s var(--spring); }
.mk-person:hover .mk-person-photo img { transform: scale(1.05); }
.mk-head-badge {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  color: var(--surface);
  background: var(--accent);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.mk-person-text { display: grid; gap: 3px; min-width: 0; padding-inline: 6px; }
.mk-person-text b { font-size: 15px; line-height: 1.3; }
.mk-person-text span { font-size: 13px; line-height: 1.35; color: var(--muted); }

.mk-feature { display: grid; gap: 22px; }
.mk-feature-quote { position: relative; margin: 0; padding-left: clamp(50px, 7vw, 84px); }
.mk-feature-quote::before {
  content: "“";
  position: absolute;
  left: 0;
  top: -0.1em;
  font: 800 clamp(84px, 11vw, 130px)/1 Georgia, "Times New Roman", serif;
  color: var(--accent);
}
.profile-card .mk-feature-quote p { margin: 0; font-size: clamp(18px, 2.1vw, 24px); font-weight: 700; line-height: 1.5; color: var(--text); }
.mk-quote { margin: 0; padding: 4px 0 4px 22px; border-left: 4px solid var(--accent); }
.profile-card .mk-quote p { margin: 0; font-size: clamp(18px, 2.2vw, 22px); font-weight: 700; line-height: 1.5; color: var(--text); }
.mk-quote cite, .mk-feature-quote cite, .mk-motto-quote cite { display: block; margin-top: 12px; font-size: 15px; font-weight: 800; font-style: normal; color: var(--accent-strong); }
.mk-motto-quote cite { color: inherit; opacity: 0.85; }
.mk-quote cite::before, .mk-feature-quote cite::before, .mk-motto-quote cite::before { content: "— "; }
.mk-quote + p, .mk-quote + .mk-figure { margin-top: 16px; }

.photo-row { display: flex; align-items: flex-start; gap: 12px; }
.photo-row-item {
  flex: var(--r, 1) 1 0;
  min-width: 0;
  aspect-ratio: var(--r, 1);
  padding: 0;
  border: 0;
  border-radius: 18px;
  overflow: hidden;
  cursor: zoom-in;
  background: var(--surface-2);
}
.photo-row-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s var(--spring); }
.photo-row-item:hover img { transform: scale(1.04); }
.profile-card > :not(h2) + .photo-row { margin-top: 18px; }
.mk-feature > .photo-row { margin-top: 0; }

.mk-figure { display: block; width: 100%; padding: 0; border: 0; border-radius: 20px; overflow: hidden; cursor: zoom-in; background: var(--surface-2); }
.mk-figure img { width: 100%; max-height: 560px; object-fit: cover; transition: transform 0.8s var(--spring); }
.mk-figure:hover img { transform: scale(1.03); }

.mk-chapters { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.mk-chapter-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; min-width: 0; }
.mk-toc { display: none; }
.mk-toc-title { padding: 4px 10px 8px; font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.mk-toc-link {
  display: flex;
  align-items: baseline;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 12px;
  font: inherit;
  text-align: left;
  color: var(--text-soft);
  background: transparent;
  cursor: pointer;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}
.mk-toc-link span { flex: none; font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--muted); }
.mk-toc-link b { font-size: 14px; font-weight: 700; line-height: 1.35; }
.mk-toc-link:hover { color: var(--text); background: var(--surface-2); }
.mk-toc-link.active { color: var(--accent-strong); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.mk-toc-link.active span { color: var(--accent-strong); }
@media (min-width: 1024px) {
  .mk-chapters.with-toc { grid-template-columns: 250px minmax(0, 1fr); align-items: start; }
  .mk-chapters.with-toc .mk-toc {
    position: sticky;
    top: calc(var(--view-top) + 4px);
    display: grid;
    gap: 2px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  }
}
.mk-chapter { scroll-margin-top: calc(var(--view-top) + 12px); }
.mk-feature, .mk-team-card { scroll-margin-top: calc(var(--view-top) + 12px); }
.mk-chapter-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.mk-chapter-num {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--accent-strong);
  background: color-mix(in srgb, var(--accent) 13%, transparent);
}
.mk-chapter-head h2 { margin: 0; font-size: clamp(20px, 2.2vw, 24px); line-height: 1.25; color: var(--text); }
.mk-list { counter-reset: mk; display: grid; gap: 10px; margin: 6px 0 0; padding: 0; list-style: none; }
.mk-list li {
  counter-increment: mk;
  position: relative;
  padding: 12px 16px 12px 54px;
  border-radius: 14px;
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--text-soft);
  background: var(--surface-2);
}
.mk-list li::before {
  content: counter(mk);
  position: absolute;
  left: 13px;
  top: 11px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 800;
  color: var(--surface);
  background: var(--accent);
}

@media (max-width: 760px) {
  .mk-hero { grid-template-columns: minmax(0, 1fr); }
  .mk-hero-photos.n2 { width: 100%; max-width: 460px; justify-self: center; padding-block: 8px 14px; }
  .mk-hero-photos.n2 .mk-hero-photo { border-width: 4px; border-radius: 20px; }
  .mk-hero-photos.n2 .mk-hero-photo:first-child { transform: rotate(-2deg); }
  .mk-hero-photos.n2 .mk-hero-photo:last-child { transform: rotate(2deg) translateY(10px); }
  .mk-facts { margin-top: 20px; }
}
@media (max-width: 640px) {
  .photo-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .photo-row-item { aspect-ratio: 3 / 4; border-radius: 14px; }
  .photo-row-item.wide { grid-column: 1 / -1; aspect-ratio: var(--r, 1.6); }
  .mk-team { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .mk-person { flex-direction: row; align-items: center; gap: 14px; padding: 8px 14px 8px 8px; border-radius: 18px; }
  .mk-person-photo { flex: none; width: 64px; border-radius: 13px; overflow: visible; }
  .mk-person-photo img { border-radius: 13px; }
  .mk-person.head .mk-person-text::before { content: "Голова комісії"; justify-self: start; margin-bottom: 2px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; color: var(--surface); background: var(--accent); }
  .mk-head-badge { display: none; }
  .mk-person-text { padding-inline: 0; }
  .mk-feature-quote { padding-left: 0; }
  .mk-feature-quote::before { position: static; display: block; height: 0.42em; font-size: 84px; }
  .mk-list li { padding: 10px 12px 10px 48px; font-size: 15px; }
  .mk-list li::before { left: 10px; top: 9px; }
  .mk-chapter-head { gap: 12px; }
  .mk-chapter-num { width: 40px; height: 40px; border-radius: 12px; font-size: 15px; }
}

.materials { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 10px; }
.material {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  transition: transform 0.4s var(--spring), border-color 0.3s var(--ease), box-shadow 0.4s var(--spring);
}
.material:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1); }
.material.soon { border-style: dashed; cursor: default; opacity: 0.7; }
.material.soon:hover { transform: none; border-color: var(--line); box-shadow: none; }
.material.soon .material-icon { color: var(--muted); background: var(--surface-2); }
.material-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
}
.material-icon svg { width: 22px; height: 22px; }
.material-text { display: grid; flex: 1; gap: 2px; min-width: 0; }
.material-text b { font-size: 15px; line-height: 1.3; }
.material-text small { overflow: hidden; font-size: 13px; white-space: nowrap; text-overflow: ellipsis; color: var(--muted); }
.material-go { flex: none; font-size: 18px; font-weight: 700; color: var(--muted); transition: transform 0.3s var(--spring), color 0.3s var(--ease); }
.material:hover .material-go { color: var(--accent); transform: translate(2px, -2px); }

.portfolio { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 14px; }
.portfolio + .materials { margin-top: 14px; }
.portfolio-item {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  transition: transform 0.4s var(--spring), box-shadow 0.4s var(--spring), border-color 0.3s var(--ease);
}
.portfolio-item:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 14px 32px rgba(0, 0, 0, 0.12); }
.portfolio-photo { display: block; width: 100%; padding: 0; border: 0; aspect-ratio: 4 / 3; overflow: hidden; cursor: zoom-in; background: var(--surface-2); }
.portfolio-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s var(--spring); }
.portfolio-photo:hover img { transform: scale(1.05); }
.portfolio-body { display: flex; flex: 1; flex-direction: column; gap: 8px; padding: 14px 16px 16px; }
.portfolio-body h3 { margin: 0; font-size: 16px; line-height: 1.35; color: var(--text); }
.profile-card .portfolio-body p { margin: 0; font-size: 14px; line-height: 1.6; }
.portfolio-body .doc-btn { align-self: flex-start; margin-top: auto; }

.panorama { position: relative; }
.profile-card > h2 + .panorama { margin-top: 4px; }
.profile-card > :not(h2) + .panorama,
.profile-card > :not(h2) + .mk-figure { margin-top: 18px; }
.panorama-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.panorama-track::-webkit-scrollbar { display: none; }
.panorama-item {
  flex: none;
  min-width: 160px;
  height: clamp(180px, 26vw, 260px);
  padding: 0;
  border: 0;
  border-radius: 18px;
  overflow: hidden;
  cursor: zoom-in;
  scroll-snap-align: start;
  background: var(--surface-2);
}
.panorama-item img {
  display: block;
  width: auto;
  max-width: none;
  height: 100%;
  transition: transform 0.8s var(--spring);
}
.panorama-item:hover img { transform: scale(1.04); }
.panorama-btn {
  position: absolute;
  top: 50%;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0 0 3px;
  border: 0;
  border-radius: 50%;
  font-size: 28px;
  line-height: 1;
  color: #fff;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.5);
  transform: translateY(-50%);
  transition: opacity 0.3s var(--ease), background 0.3s var(--ease);
}
.panorama-btn:hover { background: rgba(0, 0, 0, 0.7); }
.panorama-btn.prev { left: 10px; }
.panorama-btn.next { right: 10px; }
.panorama-btn:disabled { opacity: 0; pointer-events: none; }
@media (hover: none) { .panorama-btn { display: none; } }

@media (max-width: 720px) {
  .profile-main { grid-template-columns: minmax(0, 1fr); }
  .profile-photo { max-width: 340px; }
  .profile-credo { font-size: 16px; }
}

body[data-page="memory"] { background: #0e0d0b; }
body[data-page="memory"] .header.scrolled {
  background: rgba(14, 13, 11, 0.94);
  border-color: rgba(194, 160, 103, 0.28);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}
body[data-page="memory"] .hotbar a,
body[data-page="memory"] .theme-toggle { color: #d9cfb6; background: rgba(24, 21, 16, 0.88); border-color: rgba(194, 160, 103, 0.3); box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4); }
body[data-page="memory"] .hotbar a:hover,
body[data-page="memory"] .theme-toggle:hover { background: rgba(48, 41, 31, 0.95); }
body[data-page="memory"] .hotbar a.active { color: #f1e3c0; background: transparent; border-color: transparent; box-shadow: none; }
body[data-page="memory"] .pill-active { background: #3b3328; box-shadow: inset 0 0 0 1px #c2a067; }
body[data-page="memory"] .backdrop { opacity: 0; }
body[data-page="memory"] .leaves-toggle { display: none; }
body[data-page="memory"] .site-footer { color: #9a8f78; background: #0e0d0b; border-top-color: rgba(184, 149, 90, 0.2); }
body[data-page="memory"] .site-footer b { color: #d9cfb6; }
.page[data-page="memory"] { gap: 0; }

.memory {
  --m-bg: #0e0d0b;
  --m-ink: #e3d9c2;
  --m-paper: #f1e7d0;
  --m-muted: #9a907c;
  --m-brass: #c9a66b;
  --m-red: #cf4a37;
  --m-glass-border: rgba(201, 166, 107, 0.3);
  --m-display: "Oswald", "Arial Narrow", sans-serif;
  --m-text: "Golos Text", "Helvetica Neue", Arial, sans-serif;
  --m-closing: "Oswald", "Arial Narrow", sans-serif;
  --m-film: cubic-bezier(0.65, 0, 0.2, 1);
  width: 100vw;
  margin: calc(-1 * var(--view-top)) calc(50% - 50vw) -64px;
  overflow: clip;
  color: var(--m-ink);
  background: var(--m-bg);
  font-family: var(--m-text);
}
:root .memory .theme-toggle svg { transform: none; }

.mem-hero { --p: 0; position: relative; height: 190vh; }
.mem-stage {
  position: sticky;
  top: 0;
  display: grid;
  place-items: center;
  height: 100vh;
  height: 100svh;
  padding: 90px 20px 60px;
  overflow: hidden;
  isolation: isolate;
  text-align: center;
}
.mem-stage::before,
.mem-stage::after {
  content: "";
  position: absolute;
  z-index: 6;
  left: 0;
  right: 0;
  height: 50%;
  background: #000;
  pointer-events: none;
  animation: memBars 2.2s var(--m-film) 0.2s forwards;
}
.mem-stage::before { top: 0; }
.mem-stage::after { bottom: 0; }
@keyframes memBars { to { height: 6vh; } }

.mem-hero-media {
  position: absolute;
  inset: -4%;
  z-index: -3;
  transform: scale(calc(1 + var(--p) * 0.45));
  transform-origin: 50% 60%;
  will-change: transform;
}
.mem-hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: memZoom 30s ease-out both;
}
@keyframes memZoom {
  from { transform: scale(1.25) translate(2%, 1%); }
  to { transform: scale(1.04) translate(0, 0); }
}
.mem-hero-media::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  animation: memFlicker 6s steps(1) infinite;
}
@keyframes memFlicker {
  0%, 100% { opacity: 0; }
  12% { opacity: 0.08; }
  13% { opacity: 0; }
  47% { opacity: 0.05; }
  48% { opacity: 0; }
  81% { opacity: 0.1; }
  82% { opacity: 0; }
}
.mem-hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, rgba(8, 7, 5, 0.15) 20%, rgba(8, 7, 5, 0.9) 100%),
    linear-gradient(180deg, rgba(14, 13, 11, 0.45), rgba(14, 13, 11, 0.96) 98%),
    rgba(52, 36, 16, 0.5);
}

.mem-beams { position: absolute; inset: 0; z-index: -2; pointer-events: none; opacity: 0; animation: memFade 3s ease 1.6s forwards; }
.mem-beams span {
  position: absolute;
  bottom: -8%;
  left: 18%;
  width: 34vmax;
  height: 130vh;
  margin-left: -17vmax;
  transform-origin: 50% 100%;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 300' preserveAspectRatio='none'><defs><linearGradient id='g' x1='0' y1='1' x2='0' y2='0'><stop offset='0' stop-color='%23fff0cd' stop-opacity='0.24'/><stop offset='0.55' stop-color='%23fff0cd' stop-opacity='0.07'/><stop offset='0.9' stop-color='%23fff0cd' stop-opacity='0'/></linearGradient><filter id='b' x='-20%' y='-5%' width='140%' height='110%'><feGaussianBlur stdDeviation='2.5'/></filter></defs><polygon points='48,300 52,300 96,0 4,0' fill='url(%23g)' filter='url(%23b)'/></svg>") center / 100% 100% no-repeat;
  will-change: transform;
  animation: memSweep 17s ease-in-out infinite alternate;
}
.mem-beams span:nth-child(2) { left: 80%; animation-duration: 21s; animation-delay: -7s; animation-direction: alternate-reverse; }
.mem-beams span:nth-child(3) { left: 52%; opacity: 0.6; animation-duration: 26s; animation-delay: -12s; }
@keyframes memSweep {
  from { transform: rotate(-32deg); }
  to { transform: rotate(30deg); }
}

.mem-ring {
  position: absolute;
  inset: 0;
  z-index: -1;
  perspective: 1300px;
  pointer-events: none;
  opacity: 0;
  animation: memRingIn 3.2s var(--m-film) 1.4s forwards;
}
@keyframes memRingIn {
  from { opacity: 0; transform: scale(0.55); }
  to { opacity: 1; transform: none; }
}
.mem-ring-tilt {
  position: absolute;
  top: 54%;
  left: 50%;
  transform-style: preserve-3d;
  transform: rotateX(calc(-14deg + var(--p) * 58deg)) scale(calc(1 + var(--p) * 0.9));
  will-change: transform;
}
.mem-ring-spin { transform-style: preserve-3d; animation: memSpin 70s linear infinite; }
@keyframes memSpin { to { transform: rotateY(-360deg); } }
.mem-ring-item {
  --r: clamp(260px, 38vw, 600px);
  position: absolute;
  width: clamp(110px, 13vw, 210px);
  aspect-ratio: 3 / 2;
  margin: calc(clamp(110px, 13vw, 210px) / -3) 0 0 calc(clamp(110px, 13vw, 210px) / -2);
  transform: rotateY(var(--a)) translateZ(var(--r));
  transform-style: preserve-3d;
}
.mem-ring-item img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  backface-visibility: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  border: 4px solid #d9ccad;
  opacity: 0.62;
}
.mem-ring-item img.back { transform: rotateY(180deg); opacity: 0.4; }

.mem-hero-inner {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 16px;
  opacity: calc(1 - var(--p) * 2.2);
  transform: translateY(calc(var(--p) * -14vh)) scale(calc(1 - var(--p) * 0.2));
  will-change: transform, opacity;
}
.mem-emblem {
  display: grid;
  place-items: center;
  width: clamp(76px, 8vw, 100px);
  aspect-ratio: 1;
  border-radius: 50%;
  color: var(--m-brass);
  background: rgba(22, 20, 16, 0.82);
  border: 1px solid var(--m-glass-border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 60px rgba(201, 166, 107, 0.15);
  opacity: 0;
  transform: perspective(600px) rotateY(180deg) scale(0.6);
  animation: memCoin 2s var(--m-film) 1.1s forwards;
}
@keyframes memCoin { to { opacity: 1; transform: perspective(600px) rotateY(0) scale(1); } }
.mem-emblem svg { width: 50%; height: auto; }
.mem-emblem path,
.mem-emblem circle {
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  animation: memDraw 2.6s var(--m-film) 1.8s forwards;
}
@keyframes memDraw { to { stroke-dashoffset: 0; } }
.mem-kicker {
  margin: 4px 0 0;
  font-size: clamp(11px, 1.1vw, 13px);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #c5b99e;
  opacity: 0;
  animation: memFade 1.6s ease 2.2s forwards;
}
.mem-title {
  margin: 0;
  font-family: var(--m-display);
  font-size: clamp(34px, 5.6vw, 76px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--m-paper);
  text-shadow: 0 6px 40px rgba(0, 0, 0, 0.85);
}
.mem-title .mem-word { display: inline-block; white-space: nowrap; }
.mem-title .mem-word span {
  display: inline-block;
  opacity: 0;
  filter: blur(14px);
  transform: perspective(500px) rotateX(-80deg) translateY(0.3em);
  transform-origin: 50% 100%;
  animation: memLetter 1.5s var(--m-film) forwards;
  animation-delay: calc(2.4s + var(--i) * 70ms);
}
@keyframes memLetter { to { opacity: 1; filter: none; transform: none; } }
@keyframes memFade { to { opacity: 1; } }
.mem-since {
  margin: 4px 0 0;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--m-brass);
  background: rgba(22, 20, 16, 0.82);
  border: 1px solid var(--m-glass-border);
  opacity: 0;
  animation: memFade 1.6s ease 3.4s forwards;
}

.mem-grain {
  position: absolute;
  inset: -8%;
  z-index: -1;
  opacity: 0.1;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: memGrain 0.9s steps(5) infinite;
}
@keyframes memGrain {
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -3%); }
  60% { transform: translate(-1%, 3%); }
  80% { transform: translate(3%, 1%); }
}

.mem-section { position: relative; max-width: 1060px; margin: 0 auto; padding: clamp(80px, 12vw, 150px) clamp(20px, 5vw, 40px); }
.mem-label {
  display: block;
  margin-bottom: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--m-red);
}
.mem-heading {
  margin: 0;
  font-family: var(--m-display);
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--m-paper);
}

.mem-reveal {
  opacity: 0;
  filter: blur(8px);
  transform: translateY(36px);
  transition: opacity 1.4s var(--m-film), transform 1.4s var(--m-film), filter 1.4s var(--m-film);
  transition-delay: var(--d, 0ms);
}
.mem-reveal.in { opacity: 1; filter: none; transform: none; }

.mem-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.mem-bg img {
  width: 100%;
  height: 130%;
  margin-top: -15%;
  object-fit: cover;
  transform: translateY(var(--shift, 0px));
}
.mem-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, var(--m-bg), rgba(14, 13, 11, 0.55) 30%, rgba(14, 13, 11, 0.55) 70%, var(--m-bg)),
    rgba(40, 28, 12, 0.6);
}

.mem-motto { isolation: isolate; max-width: none; text-align: center; }
.mem-quote {
  display: grid;
  gap: 8px;
  margin: 0;
  font-family: var(--m-display);
  font-size: clamp(28px, 4.4vw, 54px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--m-paper);
  perspective: 800px;
}
.mem-quote span.mem-reveal { transform: rotateX(-75deg) translateY(30px); transform-origin: 50% 100%; }
.mem-quote span.mem-reveal.in { transform: none; }
.mem-quote span:last-child { color: var(--m-brass); }
.mem-note { max-width: 560px; margin: 40px auto 0; font-size: 17px; line-height: 1.7; color: var(--m-muted); }

.mem-chronicle { position: relative; height: calc((var(--n) * 90 + 170) * 1vh); }
.mem-chron-view {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  isolation: isolate;
  perspective: 900px;
  background: radial-gradient(ellipse at 50% 55%, #221d16, var(--m-bg) 70%);
}
.mem-chron-intro {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  pointer-events: none;
}
.mem-chron-intro .mem-label { margin-bottom: 14px; }
.mem-chron-scene { position: absolute; inset: 0; transform-style: preserve-3d; }
.mem-chron-item {
  --x: -16vw;
  --y: -2vh;
  --ry: 10deg;
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(64vw, 760px);
  margin: 0;
  translate: -50% -50%;
  opacity: 0;
  will-change: transform, opacity;
}
.mem-chron-item.right { --x: 16vw; --y: 3vh; --ry: -10deg; }
.mem-chron-item img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border: 8px solid #d9ccad;
  filter: grayscale(1) sepia(0.45) contrast(1.1) brightness(0.85);
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.7);
}
.mem-chron-item figcaption {
  margin-top: 14px;
  font-size: clamp(14px, 1.4vw, 17px);
  font-weight: 500;
  color: var(--m-paper);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.mem-chron-item.near figcaption { opacity: 1; transform: none; }
.mem-modern .mem-chron-item img { filter: saturate(0.8) contrast(1.05) brightness(0.92); border-color: #e4e0d6; }
.mem-chron-item figcaption small { display: block; margin-top: 4px; font-size: 11px; font-weight: 400; color: var(--m-muted); }
.mem-chron-year {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: -1;
  font-family: var(--m-display);
  font-size: clamp(140px, 30vw, 420px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--m-paper);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.9);
  transition: opacity 1s ease, transform 1.6s var(--m-film);
  pointer-events: none;
}
.mem-chron-year.on { opacity: 0.06; transform: translate(-50%, -50%); }
.mem-chron-view .mem-grain { z-index: 3; }

.mem-history { text-align: center; }
.mem-words {
  max-width: 820px;
  margin: 0 auto 24px;
  font-size: clamp(20px, 2.4vw, 28px);
  font-weight: 500;
  line-height: 1.45;
  color: var(--m-paper);
}
.mem-words span {
  display: inline-block;
  opacity: 0.06;
  filter: blur(8px);
  transition: opacity 1.4s var(--m-film), filter 1.4s var(--m-film);
  transition-delay: calc(var(--w) * 70ms);
}
.mem-words.in span { opacity: 1; filter: none; }
.mem-years {
  display: flex;
  justify-content: center;
  gap: clamp(40px, 10vw, 130px);
  margin: clamp(56px, 8vw, 96px) 0 0;
  padding: 0;
  list-style: none;
}
.mem-years li { display: grid; justify-items: center; align-content: start; gap: 12px; }
.mem-year { display: flex; gap: 6px; perspective: 400px; }
.mem-digit {
  display: grid;
  place-items: center;
  width: 0.78em;
  height: 1.2em;
  border-radius: 8px;
  font-family: var(--m-display);
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 500;
  line-height: 1;
  color: var(--m-paper);
  background: linear-gradient(180deg, #2a251d, #17140f);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transform-origin: 50% 50%;
}
.mem-digit.flip { animation: memFlip 0.16s ease-out; }
@keyframes memFlip {
  from { transform: rotateX(-90deg); filter: brightness(0.5); }
  to { transform: none; filter: none; }
}
.mem-years time { font-size: 13px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--m-red); }
.mem-year-text { max-width: 260px; font-size: 16px; line-height: 1.5; color: var(--m-muted); }

.mem-keeper {
  display: inline-grid;
  justify-items: center;
  gap: 8px;
  margin-top: clamp(70px, 10vw, 110px);
  color: var(--m-ink);
  text-decoration: none;
}
.mem-keeper.mem-reveal { transform: perspective(800px) rotateY(-70deg); }
.mem-keeper.mem-reveal.in { transform: none; }
.mem-keeper img {
  width: 120px;
  height: 120px;
  margin-bottom: 12px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 20%;
  filter: grayscale(1) sepia(0.35) contrast(1.05);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  transition: filter 1.2s ease, transform 1.2s var(--m-film);
}
.mem-keeper:hover img { filter: none; transform: scale(1.05); }
.mem-keeper small { font-size: 12px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--m-red); }
.mem-keeper b { font-family: var(--m-display); font-size: clamp(20px, 2.2vw, 24px); font-weight: 500; letter-spacing: 0.04em; color: var(--m-paper); }
.mem-keeper > span { font-size: 15px; color: var(--m-muted); }

.mem-lead { max-width: 820px; margin: 0 0 56px; font-size: clamp(20px, 2.3vw, 26px); line-height: 1.55; color: var(--m-paper); }
.mem-photos { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: clamp(28px, 4vw, 56px); }
.mem-photo {
  position: relative;
  display: block;
  padding: 12px 12px 46px;
  border: 0;
  cursor: zoom-in;
  background: #e7dcc2;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.55);
}
.mem-photo,
.mem-photo.mem-reveal,
.mem-photo.mem-reveal.in {
  --tx: 0;
  --ty: 0;
  transform: perspective(1000px) rotateX(calc(var(--ty) * -14deg)) rotateY(calc(var(--tx) * 16deg));
  transition: opacity 1.6s var(--m-film), translate 1.8s var(--m-film), scale 1.8s var(--m-film), filter 1.6s var(--m-film), transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.mem-photo.mem-reveal { translate: 0 90px; scale: 0.9; }
.mem-photo.mem-reveal.in { translate: none; scale: none; }
.mem-photo.tilt-left { rotate: -1.4deg; }
.mem-photo.tilt-right { rotate: 1.2deg; margin-top: 40px; }
.mem-photo img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  filter: grayscale(0.85) sepia(0.5) contrast(1.05);
  clip-path: inset(0 0 100% 0);
  transform: scale(1.18);
  transition: clip-path 1.8s var(--m-film) 0.2s, transform 3s var(--m-film), filter 1.2s ease;
}
.mem-photo.in img { clip-path: inset(0); transform: none; }
.mem-photo:hover img { filter: none; }
.mem-caption {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  overflow: hidden;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #4a4234;
}
.mem-photo::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: -12px;
  left: 50%;
  width: 96px;
  height: 26px;
  background: rgba(235, 224, 198, 0.55);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transform: translateX(-50%) rotate(-3deg);
}

.mem-exposition { position: relative; height: calc(var(--n) * 40vh + 100vh); }
.mem-exp-view {
  position: sticky;
  top: 0;
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.5fr);
  align-items: center;
  gap: clamp(24px, 5vw, 70px);
  max-width: 1100px;
  height: 100vh;
  height: 100svh;
  margin: 0 auto;
  padding: 80px clamp(20px, 5vw, 40px) 40px;
}
.mem-exp-aside { display: grid; justify-items: start; gap: 14px; }
.mem-exp-aside .mem-label { margin-bottom: 0; }
.mem-exp-lead { max-width: 320px; margin: 0; font-size: 16px; line-height: 1.6; color: var(--m-muted); }
.mem-count { display: flex; align-items: baseline; gap: 12px; margin: 24px 0 0; color: var(--m-muted); }
.mem-count b {
  font-family: var(--m-display);
  font-size: clamp(48px, 6vw, 76px);
  font-weight: 500;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--m-paper);
}
.mem-count span { font-size: 16px; font-weight: 600; }
.mem-drum {
  --r: 300px;
  position: relative;
  height: min(70vh, 620px);
  perspective: 1100px;
  -webkit-mask-image: linear-gradient(transparent, #000 22%, #000 78%, transparent);
  mask-image: linear-gradient(transparent, #000 22%, #000 78%, transparent);
}
.mem-wheel {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  transform-style: preserve-3d;
  transform: translateZ(calc(var(--r) * -1));
}
.mem-wheel li {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  display: grid;
  gap: 8px;
  translate: 0 -50%;
  backface-visibility: hidden;
  will-change: transform, opacity;
}
.mem-credit-num { font-size: 12px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--m-red); }
.mem-credit {
  font-size: clamp(20px, 2.4vw, 30px);
  font-weight: 500;
  line-height: 1.3;
  color: var(--m-paper);
  transition: text-shadow 0.8s ease;
}
.mem-wheel li.lit .mem-credit { text-shadow: 0 0 30px rgba(241, 227, 192, 0.25); }

.mem-closing { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); align-items: center; gap: clamp(30px, 6vw, 80px); }
.mem-poster { max-width: 360px; justify-self: center; rotate: -2deg; }
.mem-poster img { aspect-ratio: 3 / 4; }
.mem-closing-text { display: grid; justify-items: start; gap: 26px; }
.mem-closing-quote { margin: 0; font-size: clamp(22px, 2.8vw, 32px); line-height: 1.5; color: var(--m-paper); }
.mem-closing-word {
  margin: 0;
  font-family: var(--m-closing);
  font-size: clamp(40px, 7vw, 86px);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--m-brass);
  text-shadow: 0 0 40px rgba(194, 160, 103, 0.35);
}
.mem-candle {
  position: relative;
  width: 14px;
  height: 64px;
  margin-left: 20px;
  background: linear-gradient(90deg, #d9cdb0, #f1e7cf 45%, #b9ac8f);
}
.mem-candle::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  width: 14px;
  height: 26px;
  margin-left: -7px;
  border-radius: 50% 50% 50% 50% / 65% 65% 35% 35%;
  background: radial-gradient(ellipse at 50% 75%, #fff6d6 10%, #ffc85a 45%, rgba(255, 120, 30, 0.5) 70%, transparent 72%);
  transform-origin: 50% 100%;
  animation: memFlame 2.6s ease-in-out infinite;
}
.mem-candle::after {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  width: 180px;
  height: 180px;
  margin: 0 0 -80px -90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 190, 90, 0.28), transparent 65%);
  pointer-events: none;
  animation: memGlow 2.6s ease-in-out infinite;
}
@keyframes memFlame {
  0%, 100% { transform: scale(1, 1) rotate(-1deg); }
  30% { transform: scale(0.94, 1.08) rotate(2deg); }
  60% { transform: scale(1.04, 0.95) rotate(-2deg); }
}
@keyframes memGlow { 0%, 100% { opacity: 0.85; } 45% { opacity: 1; } 70% { opacity: 0.7; } }

.mem-end { display: grid; place-items: center; padding: 0 0 clamp(70px, 9vw, 110px); }

@media (max-width: 760px) {
  .mem-closing { grid-template-columns: minmax(0, 1fr); }
  .mem-title { font-size: 9.4vw; letter-spacing: 0.1em; }
  .mem-kicker { letter-spacing: 0.1em; }
  .mem-beams span:nth-child(3) { display: none; }
  .mem-chron-item { --x: -4vw; width: 84vw; }
  .mem-chron-item.right { --x: 4vw; }
  .mem-chron-item img { border-width: 5px; }
  .mem-exp-view { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; align-items: stretch; padding-top: 140px; }
  .mem-exp-lead { display: none; }
  .mem-exp-aside { grid-template-columns: minmax(0, 1fr) auto; align-items: end; column-gap: 16px; }
  .mem-count { margin: 0; }
  .mem-count b { font-size: 44px; }
  .mem-drum { --r: 200px; height: auto; }
  .mem-years { flex-direction: column; align-items: center; gap: 56px; }
  .mem-photo.tilt-right { margin-top: 0; }
  .mem-poster { max-width: 280px; }
}
@media (prefers-reduced-motion: reduce) {
  .mem-hero { height: auto; }
  .mem-stage { position: relative; }
  .mem-stage::before, .mem-stage::after { height: 6vh; animation: none; }
  .mem-grain, .mem-beams span, .mem-ring-spin, .mem-hero-media img, .mem-hero-media::before { animation: none; }
  .mem-reveal, .mem-title .mem-word span, .mem-kicker, .mem-since, .mem-emblem, .mem-beams, .mem-ring,
  .mem-words span { opacity: 1; filter: none; transform: none; }
  .mem-photo img { clip-path: none; transform: none; }
  .mem-emblem path, .mem-emblem circle { stroke-dashoffset: 0; }
  .mem-chronicle, .mem-exposition { height: auto; }
  .mem-chron-view, .mem-exp-view { position: relative; height: auto; }
  .mem-chron-view { padding: 80px 20px; }
  .mem-chron-intro { position: static; margin-bottom: 40px; }
  .mem-chron-scene { position: static; display: grid; gap: 40px; justify-items: center; }
  .mem-chron-item { position: static; translate: none; opacity: 1; }
  .mem-chron-item figcaption { opacity: 1; transform: none; }
  .mem-drum { height: auto; -webkit-mask-image: none; mask-image: none; }
  .mem-wheel { position: static; display: grid; gap: 28px; transform: none; }
  .mem-wheel li { position: static; translate: none; }
  .mem-count { display: none; }
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(20, 24, 32, 0.45);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  cursor: zoom-out;
  animation: fadeIn 0.3s var(--ease);
}
.lightbox[hidden] { display: none; }
.lightbox img {
  max-height: 88vh;
  border-radius: 24px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  animation: popIn 0.5s var(--spring);
}
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: scale(0.9); } }

@media (max-width: 1240px) {
  .hotbar a { padding: 9px 14px; font-size: 14px; }
  .hotbar .nav-icon { padding: 7px 12px; }
}

@media (max-width: 980px) {
  .header { grid-template-columns: minmax(0, 1fr) auto; row-gap: 2px; padding-block: 6px 4px; }
  .nav-center { display: contents; }
  .brand { grid-row: 1; grid-column: 1; justify-self: start; }
  .nav-tools { grid-row: 1; grid-column: 2; }
  .hotbar { grid-row: 2; grid-column: 1 / -1; justify-self: center; max-width: 100%; overflow-x: auto; }
  .nav-icon[data-tip]::after { display: none; }
  .brand img { width: 40px; height: 40px; }
  :root { --view-top: 128px; }
  body[data-page="teachers"] .view { padding-top: 116px; }
}

@media (max-width: 720px) {
  .news { grid-template-columns: 1fr; }
  .carousel-btn { display: none; }
}

@media (max-width: 460px) {
  .hotbar a { padding: 8px 11px; font-size: 13.5px; }
  .hotbar .nav-icon { padding: 6px 10px; }
  .nav-icon svg { width: 20px; height: 20px; }
  .theme-toggle { width: 40px; height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
