/* ===========================================================
   Розумне Майбутнє — design system
   Colors sourced from the fund's brand book (#663399 family)
   =========================================================== */

:root {
  --c-primary: #663399;
  --c-primary-dark: #4a1f75;
  --c-primary-light: #8e58cc;
  --c-lilac: #a174e2;
  --c-lilac-soft: #e7dbfa;
  --c-amber: #ffb648;
  --c-amber-dark: #f2932a;

  --c-ink: #221238;
  --c-ink-soft: #5c5270;
  --c-bg: #faf8fd;
  --c-surface: #ffffff;
  --c-surface-alt: #f4eefb;
  --c-border: #e7e1f2;

  --gradient-brand: linear-gradient(135deg, #7a3fc4 0%, #9c63e0 55%, #b98af0 100%);
  --gradient-dark: linear-gradient(160deg, #3c1c63 0%, #663399 100%);
  --gradient-amber: linear-gradient(135deg, #ffcf7a 0%, #ffb648 100%);

  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --radius-pill: 999px;

  --shadow-sm: 0 2px 10px rgba(76, 32, 120, 0.08);
  --shadow-md: 0 10px 30px rgba(76, 32, 120, 0.12);
  --shadow-lg: 0 22px 60px rgba(58, 24, 97, 0.18);

  --container: 1180px;
  --font-display: "Manrope", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--c-ink);
  background: var(--c-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; cursor: pointer; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 .5em;
  color: var(--c-primary-dark);
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.section { padding: 96px 0; position: relative; }
.section-alt { background: var(--c-surface-alt); }
@media (max-width: 720px) {
  .section { padding: 64px 0; }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .78rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--c-primary-light);
  background: var(--c-lilac-soft);
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  margin-bottom: 18px;
}

.section-head {
  max-width: 720px;
  margin: 0 auto 56px;
  text-align: center;
}
.section-head h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
.section-head p { color: var(--c-ink-soft); font-size: 1.05rem; margin: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .96rem;
  padding: 15px 30px;
  border-radius: var(--radius-pill);
  border: none;
  transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: var(--gradient-brand);
  color: #fff;
  box-shadow: var(--shadow-md);
}
.btn-primary:hover { box-shadow: var(--shadow-lg); }
.btn-ghost {
  background: rgba(255,255,255,.12);
  color: #fff;
  border: 1.5px solid rgba(255,255,255,.55);
}
.btn-ghost:hover { background: rgba(255,255,255,.22); }
.btn-outline {
  background: transparent;
  color: var(--c-primary);
  border: 1.5px solid var(--c-primary-light);
}
.btn-outline:hover { background: var(--c-lilac-soft); }
.btn-amber {
  background: var(--gradient-amber);
  color: #4a2b02;
  box-shadow: 0 10px 26px rgba(242, 147, 42, .35);
}
.btn-sm { padding: 10px 20px; font-size: .85rem; }

/* ===== Header ===== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 14px 0;
  transition: background .3s ease, box-shadow .3s ease, padding .3s ease;
}
.site-header.is-scrolled {
  background: rgba(250, 248, 253, .9);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 24px rgba(76,32,120,.08);
  padding: 8px 0;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 36px;
}
.brand { display: flex; align-items: center; gap: 10px; flex: none; margin-right: 12px; }
.brand img { height: 46px; width: auto; transition: height .3s ease; }
.is-scrolled .brand img { height: 38px; }
.brand-text { font-family: var(--font-display); line-height: 1.1; }
.brand-text strong { display: block; font-size: .82rem; font-weight: 800; color: var(--c-primary-dark); }
.brand-text span { display: block; font-size: .64rem; color: var(--c-ink-soft); letter-spacing: .03em; }
.site-header:not(.is-scrolled) .brand-text strong,
.site-header:not(.is-scrolled) .brand-text span { color: #fff; }

.main-nav { display: flex; align-items: center; gap: 34px; }
.main-nav a {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .92rem;
  color: var(--c-ink);
  position: relative;
  padding: 4px 0;
  white-space: nowrap;
}
.site-header:not(.is-scrolled) .main-nav a { color: #fff; }
.main-nav a::after {
  content: "";
  position: absolute; left: 0; bottom: -4px;
  width: 0; height: 2px; background: currentColor;
  transition: width .2s ease;
}
.main-nav a:hover::after { width: 100%; }

.header-actions { display: flex; align-items: center; gap: 22px; flex: none; }
.lang-switch { display: flex; gap: 4px; font-family: var(--font-display); font-weight: 700; font-size: .8rem; margin-right: 4px; }
.lang-switch a {
  padding: 5px 9px; border-radius: var(--radius-pill);
  color: var(--c-ink-soft);
}
.site-header:not(.is-scrolled) .lang-switch a { color: rgba(255,255,255,.75); }
.lang-switch a.is-active { background: var(--c-primary); color: #fff !important; }

.nav-toggle {
  display: none;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.15);
  position: relative;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: ""; position: absolute; left: 11px; width: 20px; height: 2px;
  background: #fff; transition: transform .25s ease, opacity .25s ease, top .25s ease;
}
.is-scrolled .nav-toggle span, .is-scrolled .nav-toggle span::before, .is-scrolled .nav-toggle span::after { background: var(--c-primary-dark); }
.nav-toggle span { top: 20px; }
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }
.nav-open .nav-toggle span { background: transparent; }
.nav-open .nav-toggle span::before { transform: rotate(45deg); top: 0; }
.nav-open .nav-toggle span::after { transform: rotate(-45deg); top: 0; }

@media (max-width: 940px) {
  .main-nav { position: fixed; top: 0; right: -100%; height: 100vh; width: min(320px, 84vw);
    background: var(--c-surface); flex-direction: column; align-items: flex-start; justify-content: center;
    gap: 26px; padding: 40px; box-shadow: var(--shadow-lg); transition: right .3s ease; }
  .main-nav a { color: var(--c-ink) !important; font-size: 1.1rem; }
  .nav-open .main-nav { right: 0; }
  .nav-toggle { display: block; }
  .header-actions .lang-switch { display: none; }
  .header-actions .btn-primary { display: none; }
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  color: #fff;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background: url("../img/photos/hero.jpg") center/cover;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(38,16,66,.78) 0%, rgba(58,24,97,.72) 45%, rgba(58,24,97,.92) 100%);
}
.hero-content { position: relative; z-index: 2; max-width: 1000px; margin: 0 auto; text-align: center; display: flex; flex-direction: column; align-items: center; }
.hero-content .eyebrow { background: rgba(255,255,255,.14); color: #fff; font-size: .88rem; padding: 9px 20px; }
.hero-content h1 { color: #fff; font-size: clamp(2.6rem, 6.4vw, 4.6rem); }
.hero-content p { font-size: 1.3rem; color: rgba(255,255,255,.9); max-width: 760px; margin-bottom: 42px; }
.hero-actions { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; }
.hero-actions .btn { font-size: 1.08rem; padding: 19px 40px; }
@media (max-width: 720px) {
  .hero-content h1 { font-size: clamp(2rem, 8vw, 3rem); }
  .hero-content p { font-size: 1.08rem; }
  .hero-actions .btn { font-size: .96rem; padding: 15px 30px; }
}
.scroll-cue {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  z-index: 2; width: 34px; height: 34px; border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.5);
  display: flex; align-items: center; justify-content: center;
  animation: bob 2.2s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: translate(-50%,0);} 50% { transform: translate(-50%,8px);} }

/* ===== About ===== */
.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 56px;
  align-items: center;
}
.about-copy p { color: var(--c-ink-soft); }
.about-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 22px; margin: 22px 0 30px; }
.about-list li {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: .92rem; color: var(--c-ink);
}
.about-list li::before {
  content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%;
  background: var(--gradient-brand);
}
.hero-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
.hero-stat strong { display: block; font-family: var(--font-display); font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
.hero-stat span { display: block; font-size: .88rem; }
@media (max-width: 480px) {
  .hero-stats { gap: 10px; }
}
/* Фото "летять" у правій половині.
   Розкид — через різні розміри, зсуви та нахили; рух — лише через transform,
   тому налізти на текст або одне на одного вони фізично не можуть. */
.photo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.photo-grid img {
  width: 100%;
  border-radius: var(--radius-md);
  /* рамка повторює пропорцію самого знімка (--ar), тому нічого не обрізає:
     на широких кадрах видно і дитину, і екран монітора */
  aspect-ratio: var(--ar, 1);
  object-fit: cover;
  box-shadow: 0 14px 34px rgba(76, 32, 120, .16);
  will-change: transform;
}
/* Хаотичне розташування: різні розміри та вертикальні зсуви.
   Широкі кадри виходять низькими, тож їм дано трохи вилізти в проміжок —
   зайняте місце й далі не перетинається із сусідом у тому ж ряду. */
.photo-grid img:nth-child(1) { width: 108%; margin-top: 0;    justify-self: start; animation: drift-a  9s ease-in-out infinite; }
.photo-grid img:nth-child(2) { width: 76%;  margin-top: 58px; justify-self: end;   animation: drift-b 11s ease-in-out infinite .6s; }
.photo-grid img:nth-child(3) { width: 90%;  margin-top: 16px; justify-self: start; animation: drift-c 10s ease-in-out infinite 1.1s; }
.photo-grid img:nth-child(4) { width: 108%; margin-top: 50px; justify-self: end;   animation: drift-d 12s ease-in-out infinite .3s; }

@keyframes drift-a {
  0%   { transform: translate3d(0, -5px, 0) rotate(-2.8deg); }
  33%  { transform: translate3d(6px, 5px, 0) rotate(-1.2deg); }
  66%  { transform: translate3d(-4px, 7px, 0) rotate(-3deg); }
  100% { transform: translate3d(0, -5px, 0) rotate(-2.8deg); }
}
@keyframes drift-b {
  0%   { transform: translate3d(0, 6px, 0) rotate(2.6deg); }
  40%  { transform: translate3d(-6px, -6px, 0) rotate(1deg); }
  70%  { transform: translate3d(4px, -2px, 0) rotate(3deg); }
  100% { transform: translate3d(0, 6px, 0) rotate(2.6deg); }
}
@keyframes drift-c {
  0%   { transform: translate3d(-3px, 4px, 0) rotate(1.9deg); }
  45%  { transform: translate3d(6px, -7px, 0) rotate(3deg); }
  75%  { transform: translate3d(-2px, -3px, 0) rotate(1.2deg); }
  100% { transform: translate3d(-3px, 4px, 0) rotate(1.9deg); }
}
@keyframes drift-d {
  0%   { transform: translate3d(4px, -6px, 0) rotate(-2.4deg); }
  35%  { transform: translate3d(-6px, 5px, 0) rotate(-.6deg); }
  68%  { transform: translate3d(3px, 7px, 0) rotate(-2.9deg); }
  100% { transform: translate3d(4px, -6px, 0) rotate(-2.4deg); }
}

@media (prefers-reduced-motion: reduce) {
  .photo-grid img { animation: none; }
}

@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
}

/* ===== Directions (accordion) ===== */
.directions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 28px; align-items: start; }
.direction-item {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: 22px 26px;
  transition: box-shadow .2s ease, border-color .2s ease;
}
.direction-item[open] { box-shadow: var(--shadow-md); border-color: transparent; }
.direction-item summary {
  list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  cursor: pointer;
  font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; color: var(--c-primary-dark);
}
.direction-item summary::-webkit-details-marker { display: none; }
.direction-icon {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  background: var(--c-lilac-soft); display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}
.direction-plus { flex: none; width: 26px; height: 26px; position: relative; }
.direction-plus::before, .direction-plus::after {
  content: ""; position: absolute; background: var(--c-primary); border-radius: 2px;
}
.direction-plus::before { top: 50%; left: 0; width: 100%; height: 2px; margin-top: -1px; }
.direction-plus::after { left: 50%; top: 0; height: 100%; width: 2px; margin-left: -1px; transition: transform .36s cubic-bezier(0,0,.58,1), opacity .36s ease; }
.direction-item[open] .direction-plus::after { transform: rotate(90deg); opacity: 0; }
/* обгортку створює скрипт — вміст плавно розгортається за висотою */
.direction-body { overflow: hidden; }
.direction-item p { margin: 14px 0 0 56px; color: var(--c-ink-soft); font-size: .95rem; }
.direction-list { margin: 8px 0 0 56px; padding: 0; list-style: none; }
.direction-list li { position: relative; padding-left: 18px; color: var(--c-ink-soft); font-size: .95rem; line-height: 1.9; }
.direction-list li::before { content: ""; position: absolute; left: 0; top: 12px; width: 6px; height: 6px; border-radius: 50%; background: var(--c-primary-light); }
@media (max-width: 720px) { .directions-grid { grid-template-columns: 1fr; } }

/* Заклик записатися — стоїть у звичайному потоці одразу за сіткою,
   тому розгорнутий напрямок штовхає його вниз, а не накриває собою. */
.signup-cta { margin-top: 44px; text-align: center; }
.signup-cta-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.12rem; color: var(--c-primary-dark);
  margin: 0 0 18px;
}
.signup-cta-buttons { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }
@media (max-width: 420px) {
  .signup-cta-buttons { flex-direction: column; align-items: stretch; }
}

/* ===== Roadmap ("Як ми це робимо") ===== */
.roadmap { position: relative; max-width: 1000px; margin: 0 auto; }

/* проста лінія, що з'єднує пункти */
.roadmap::before {
  content: ""; position: absolute; left: 50%; top: 10px; bottom: 10px; width: 3px;
  transform: translateX(-50%);
  background: linear-gradient(var(--c-lilac-soft), var(--c-primary-light) 45%, var(--c-lilac-soft));
  border-radius: 3px;
}

.roadmap-step { position: relative; width: 50%; padding-right: 68px; margin-bottom: 32px; }
.roadmap-step:nth-child(even) { margin-left: 50%; padding-right: 0; padding-left: 68px; }
.roadmap-step:last-child { margin-bottom: 0; }

/* пунктирний "з'їзд" від картки до дороги */
.roadmap-step::after {
  content: ""; position: absolute; top: 48px; right: 23px; width: 45px; height: 3px;
  background: repeating-linear-gradient(to right, var(--c-primary-light) 0 7px, transparent 7px 14px);
}
.roadmap-step:nth-child(even)::after { right: auto; left: 23px; }

/* кружечок з номером просто на дорозі */
.roadmap-num {
  position: absolute; top: 26px; right: -23px; z-index: 2;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--gradient-brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800; font-size: 1rem;
  border: 4px solid var(--c-surface-alt);
  box-shadow: 0 6px 16px rgba(58, 24, 97, .28);
}
.roadmap-step:nth-child(even) .roadmap-num { right: auto; left: -23px; }

.roadmap-card {
  position: relative; overflow: hidden;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 24px 26px;
  box-shadow: var(--shadow-sm);
  transition: transform .25s ease, box-shadow .25s ease;
}
.roadmap-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.roadmap-card h3 { position: relative; font-size: 1.1rem; margin-bottom: 6px; }
.roadmap-card p { position: relative; margin: 0; color: var(--c-ink-soft); font-size: .95rem; max-width: 82%; }

/* ледь помітна картинка-підказка на фоні картки */
.roadmap-icon {
  position: absolute; right: 12px; bottom: -18px;
  font-size: 5.4rem; line-height: 1;
  opacity: .12; filter: saturate(.35);
  pointer-events: none; user-select: none;
}

@media (max-width: 780px) {
  /* лінія по центру кружечків: кружечок 0..46px, центр = 23px */
  .roadmap::before { left: 23px; }
  .roadmap-step,
  .roadmap-step:nth-child(even) {
    width: 100%; margin-left: 0; padding-left: 76px; padding-right: 0;
  }
  .roadmap-step .roadmap-num,
  .roadmap-step:nth-child(even) .roadmap-num { left: 0; right: auto; }
  .roadmap-step::after,
  .roadmap-step:nth-child(even)::after { left: 46px; right: auto; width: 30px; }
  .roadmap-card p { max-width: 100%; }
  .roadmap-icon { font-size: 4.2rem; }
}

/* ===== Works grid ===== */
.works-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.work-card { position: relative; border-radius: var(--radius-md); overflow: hidden; aspect-ratio: 1; box-shadow: var(--shadow-sm); }
.work-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.work-card:hover img { transform: scale(1.06); }
.work-card .tag {
  position: absolute; left: 14px; bottom: 14px; z-index: 2;
  background: rgba(34,18,56,.7); color: #fff; backdrop-filter: blur(4px);
  font-family: var(--font-display); font-weight: 700; font-size: .82rem;
  padding: 7px 14px; border-radius: var(--radius-pill);
}
@media (max-width: 860px) { .works-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .works-grid { grid-template-columns: 1fr 1fr; gap: 12px; } }

/* ===== Partners =====
   ПК: логотипи розкидані "бульбашками" й ледь помітно дрейфують.
   Кожен живе у власній комірці сітки, а зсув (--dx/--dy) разом з амплітудою
   руху (--mx/--my) завжди менші за вільне місце в комірці — тому бульбашки
   фізично не можуть налізти одна на одну.
   Мобільний: рівна сітка 2×2, гортання лише стрілками (див. main.js). */
.partners-wrap { position: relative; }

.partners-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-auto-rows: 172px;
  gap: 16px 24px;
  align-items: center;
  justify-items: center;
}

.partner-link {
  display: flex; align-items: center; justify-content: center;
  width: 80%;
  height: var(--h, 84px);
  transform: translate(var(--dx, 0px), var(--dy, 0px));
  animation: bubble-drift var(--dur, 11s) ease-in-out infinite var(--delay, 0s);
  will-change: transform;
}
.partner-link img { width: 100%; height: 100%; object-fit: contain; }

@keyframes bubble-drift {
  0%, 100% { transform: translate(var(--dx, 0px), var(--dy, 0px)); }
  33% {
    transform: translate(calc(var(--dx, 0px) + var(--mx, 0px)),
                         calc(var(--dy, 0px) + var(--my, 0px)));
  }
  66% {
    transform: translate(calc(var(--dx, 0px) - var(--my, 0px)),
                         calc(var(--dy, 0px) - var(--mx, 0px)));
  }
}

/* зупиняємо дрейф під курсором — так у логотип легше поцілити */
.partner-link:hover { animation-play-state: paused; }
/* партнер без сайту: просто показується, не реагує на клік */
.partner-link.is-static { cursor: default; }

.partners-arrow { display: none; }

@media (prefers-reduced-motion: reduce) {
  .partner-link { animation: none; }
}

@media (max-width: 1100px) { .partners-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 860px)  { .partners-grid { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 150px; } }

@media (max-width: 620px) {
  /* стрілки стоять збоку від сітки, а не поверх лого */
  .partners-wrap { display: flex; align-items: center; gap: 10px; }
  .partners-grid {
    flex: 1; min-width: 0;
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: 108px;
    gap: 16px 12px;
    transition: opacity .2s ease;
  }
  .partners-grid.is-swapping { opacity: 0; }
  /* поза поточною сторінкою — ховаємо (діє лише на мобільному) */
  .partner-link.is-off { display: none; }
  /* рівно, без розкиду й руху */
  .partner-link {
    width: 100%; height: 82px;
    transform: none;
    animation: none;
  }

  .partners-arrow {
    display: flex; align-items: center; justify-content: center;
    flex: none; width: 42px; height: 42px; padding: 0;
    border: 2px solid var(--c-surface);
    border-radius: 50%;
    background: var(--gradient-brand); color: #fff;
    box-shadow: 0 8px 20px rgba(76, 32, 120, .34);
    transition: transform .18s ease, opacity .2s ease, box-shadow .2s ease;
  }
  .partners-arrow svg { width: 18px; height: 18px; display: block; }
  .partners-arrow:active { transform: scale(.9); }
  .partners-arrow[disabled] { opacity: .28; box-shadow: none; cursor: default; }
}

/* ===== Team ===== */
.team-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 340px)); gap: 44px; justify-content: center; }
.team-card {
  background: var(--c-surface); border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-sm); text-align: center;
  transition: transform .28s ease, box-shadow .28s ease;
}
/* таке саме підняття з тінню, як у картках роадмапу */
.team-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.team-card img { width: 100%; aspect-ratio: 1; object-fit: cover; filter: grayscale(.15); transition: filter .28s ease; }
.team-card:hover img { filter: grayscale(0); }
.team-card .team-info { padding: 26px 20px 30px; }
.team-card h3 { margin-bottom: 4px; font-size: 1.22rem; }
.team-card span { color: var(--c-primary-light); font-weight: 600; font-size: .96rem; }
@media (prefers-reduced-motion: reduce) { .team-card:hover { transform: none; } }
@media (max-width: 720px) { .team-grid { grid-template-columns: 1fr; max-width: 330px; margin: 0 auto; gap: 28px; } }

/* ===== Reviews slider =====
   Картка займає рівно стільки місця, скільки треба її тексту.
   Довгий відгук згортається, повний текст відкривається у вікні. */
.reviews-wrap { position: relative; }
.reviews-track {
  display: flex; gap: 22px; overflow-x: auto;
  /* усі картки однакової висоти: у коротких відгуків
     просто лишається вільне поле під текстом */
  align-items: stretch;
  padding: 8px 4px 28px;
  scrollbar-width: thin; scrollbar-color: var(--c-lilac) transparent;
}
.review-card {
  flex: 0 0 min(360px, 84vw);
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius-md); padding: 26px;
  display: flex; flex-direction: column; gap: 14px;
  transition: transform .25s ease, box-shadow .25s ease;
}
.review-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.review-head { display: flex; align-items: center; gap: 12px; }
.review-avatar { width: 54px; height: 54px; border-radius: 50%; object-fit: cover; flex: none; }
.review-avatar--letter {
  display: flex; align-items: center; justify-content: center;
  background: var(--gradient-brand); color: #fff;
  font-family: var(--font-display); font-weight: 800; font-size: 1.3rem;
}
.review-who strong { display: block; font-size: .96rem; }
.review-who span { font-size: .82rem; color: var(--c-ink-soft); }
.review-stars { color: var(--c-amber-dark); letter-spacing: 2px; font-size: .9rem; }

.review-text { position: relative; max-height: 16.5em; overflow: hidden; }
.review-text p { margin: 0 0 .7em; font-size: .92rem; color: var(--c-ink-soft); }
.review-text p:last-child { margin-bottom: 0; }
/* Згасання показуємо лише там, де текст справді обрізано:
   інакше воно затирало б останні рядки коротких відгуків. */
.review-text::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3em;
  background: linear-gradient(rgba(255,255,255,0), var(--c-surface) 85%);
  pointer-events: none;
  display: none;
}
.review-card.is-clamped .review-text::after { display: block; }
.review-card.is-full .review-text { max-height: none; }
.review-card.is-full .review-text::after { display: none; }

.review-more {
  align-self: flex-start; background: none; border: none; padding: 0;
  font-family: var(--font-display); font-weight: 700; font-size: .88rem;
  color: var(--c-primary); cursor: pointer;
}
.review-more:hover { text-decoration: underline; }

.slider-nav { display: flex; gap: 10px; justify-content: center; margin-top: 8px; }
.slider-btn {
  width: 42px; height: 42px; border-radius: 50%; border: 1.5px solid var(--c-border);
  background: var(--c-surface); display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; color: var(--c-primary);
}
.slider-btn:hover { background: var(--c-lilac-soft); }
.slider-btn[disabled] { opacity: .35; cursor: default; }

/* вікно з повним відгуком */
.review-modal .modal-box { max-width: 640px; text-align: left; padding: 34px 34px 30px; }
.review-modal .review-head { margin-bottom: 12px; }
.review-modal .review-text { max-height: min(60vh, 520px); overflow-y: auto; }
.review-modal .review-text::after { display: none; }
.review-modal .review-text p { font-size: .96rem; }

/* ===== Gallery =====
   ПК: колаж із рядків однакової висоти. Ширину знімка задає його власна
   пропорція --ar (ширина ÷ висота), а flex-grow тієї ж величини дотягує
   рядок до краю — тому вертикальні лишаються вертикальними, горизонтальні
   широкими, і все одно немає порожнеч.
   Кожен знімок ледь помітно дихає; розмах руху менший за половину проміжку,
   тож сусіди не торкаються. Мобільний: стрічки, що їдуть назустріч. */

/* --- ПК: колаж --- */
.gallery-grid {
  --row-h: 240px;
  --g: 26px;
  --amp: 7px;
  display: flex;
  flex-wrap: wrap;
  gap: var(--g);
  /* на всю ширину екрана */
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: 0 26px;
}
.gallery-grid img {
  height: var(--row-h);
  /* росте пропорційно своїй ширині, стартова ширина — теж за пропорцією */
  flex: var(--ar, 1.5) 1 calc(var(--ar, 1.5) * var(--row-h));
  min-width: 0;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: 0 10px 26px rgba(76, 32, 120, .22);
  will-change: transform;
  animation-duration: var(--dur, 10s);
  animation-delay: var(--delay, 0s);
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}
/* добирає порожнє місце в останньому ряду, якщо скрипт не відпрацював */
.gallery-grid::after { content: ""; flex-grow: 999999; }

/* Коли скрипт порахував ряди (justified-розкладка), кожен ряд має власну
   висоту й заповнює ширину до краю — порожнечі в кінці не лишається. */
.gallery-grid.is-laid {
  flex-direction: column;
  flex-wrap: nowrap;
}
.gallery-grid.is-laid::after { content: none; }
.gallery-line { display: flex; gap: var(--g); }
.gallery-line img { min-width: 0; }

/* чотири траєкторії — сусіди рухаються по-різному.
   nth-child працює до розкладки, класи .g-* — після неї. */
.gallery-grid img:nth-child(4n+1) { animation-name: gbreathe-a; }
.gallery-grid img:nth-child(4n+2) { animation-name: gbreathe-b; }
.gallery-grid img:nth-child(4n+3) { animation-name: gbreathe-c; }
.gallery-grid img:nth-child(4n)   { animation-name: gbreathe-d; }
.gallery-grid img.g-a { animation-name: gbreathe-a; }
.gallery-grid img.g-b { animation-name: gbreathe-b; }
.gallery-grid img.g-c { animation-name: gbreathe-c; }
.gallery-grid img.g-d { animation-name: gbreathe-d; }

/* Розмах --amp прив'язаний до проміжку --g, тому на вужчих екранах, де
   проміжок менший, рух автоматично стає стриманішим і знімки не торкаються.
   Найширший знімок (~490px) при scale 1.014 підростає на 3.4px убік, плюс
   зсув 7px — двоє сусідів з'їдають щонайбільше 20.8px із 26px. */
@keyframes gbreathe-a {
  0%, 100% { transform: translate3d(0, calc(var(--amp) * -1), 0) scale(1); }
  50%      { transform: translate3d(var(--amp), calc(var(--amp) * .55), 0) scale(1.014); }
}
@keyframes gbreathe-b {
  0%, 100% { transform: translate3d(calc(var(--amp) * .85), calc(var(--amp) * .85), 0) scale(1.012); }
  50%      { transform: translate3d(calc(var(--amp) * -.85), calc(var(--amp) * -.85), 0) scale(1); }
}
@keyframes gbreathe-c {
  0%, 100% { transform: translate3d(calc(var(--amp) * -.85), calc(var(--amp) * .4), 0) scale(1); }
  50%      { transform: translate3d(calc(var(--amp) * .55), calc(var(--amp) * -1), 0) scale(1.014); }
}
@keyframes gbreathe-d {
  0%, 100% { transform: translate3d(calc(var(--amp) * .55), calc(var(--amp) * -.55), 0) scale(1.01); }
  50%      { transform: translate3d(calc(var(--amp) * -1), calc(var(--amp) * .85), 0) scale(1); }
}

/* --- Мобільний: стрічки --- */
.gallery-marquee { display: none; }
.gallery-row {
  display: flex; width: max-content;
  animation: gallery-slide 50s linear infinite;
}
.gallery-strip { display: flex; flex: none; }
.gallery-row--rev { animation-direction: reverse; }
.gallery-row img {
  height: 150px; width: auto; margin-right: 12px;
  max-width: none; flex: none;
  border-radius: var(--radius-md);
  object-fit: cover;
  box-shadow: var(--shadow-sm);
}
@keyframes gallery-slide {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-grid img { animation: none; }
  .gallery-row { animation: none; }
  .gallery-marquee { overflow-x: auto; }
}

@media (max-width: 1100px) { .gallery-grid { --row-h: 200px; --g: 20px; --amp: 5px; } }
@media (max-width: 860px)  { .gallery-grid { --row-h: 170px; --g: 16px; --amp: 4px; } }

@media (max-width: 720px) {
  .gallery-grid { display: none; }
  .gallery-marquee {
    display: flex; flex-direction: column; gap: 12px;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
            mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
  }
}

/* ===== News =====
   Картка: обкладинка, дата, заголовок, короткий опис.
   Клік відкриває вікно з повним текстом і галереєю фото. */
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; align-items: stretch; }
.news-card {
  background: var(--c-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
  cursor: pointer;
  transition: transform .25s ease, box-shadow .25s ease;
}
.news-card:hover,
.news-card:focus-visible { transform: translateY(-5px); box-shadow: var(--shadow-md); outline: none; }
.news-cover {
  width: 100%; aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--c-surface-alt);
}
/* новина без фото — м'яка фірмова плашка замість обкладинки */
.news-cover--empty {
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, var(--c-lilac-soft), var(--c-surface-alt));
  position: relative;
}
.news-cover--empty::after {
  content: "";
  position: absolute; inset: 0;
  background: url("../img/logo/logo-mark-purple.png") center/34% no-repeat;
  opacity: .25;
}
.news-card .body { padding: 20px 22px 24px; flex: 1; display: flex; flex-direction: column; }
.news-date { font-size: .8rem; color: var(--c-ink-soft); margin-bottom: 8px; font-weight: 600; }
.news-card h3 { font-size: 1.02rem; margin-bottom: 8px; }
.news-card p {
  color: var(--c-ink-soft); font-size: .9rem; margin: 0;
  /* короткий опис не роздуває картку */
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden;
}

.news-more-wrap { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 36px; }
/* стрілка «згорнути» — та сама кнопка, тільки кругла й лише зі знаком */
.news-collapse { padding: 0; width: 54px; height: 54px; border-radius: 50%; }
.news-collapse svg { width: 20px; height: 20px; }

/* вікно з повною новиною */
/* Прокручується все вікно, а не текст усередині: інакше довга новина
   з десятком фото не вміщалась у екран і нижні знімки просто зрізало. */
.news-modal .modal-box {
  max-width: 760px; text-align: left; padding: 26px 34px 30px;
  max-height: calc(100vh - 48px); overflow-y: auto;
  overscroll-behavior: contain;
}
/* хрестик їде разом із прокруткою, тож завжди під рукою */
.news-modal .modal-close {
  position: sticky; top: 0; right: auto;
  display: block; margin: 0 -12px -34px auto;
  z-index: 2;
}
.news-modal h3 { font-size: 1.35rem; margin: 6px 0 16px; padding-right: 40px; }
.news-modal-body p { margin: 0 0 .8em; color: var(--c-ink-soft); font-size: .96rem; }
.news-modal-body p:last-child { margin-bottom: 0; }
/* фото новини — великі превʼю, клік відкриває знімок на весь екран */
.news-photos-hint {
  margin: 22px 0 8px; font-size: .82rem; font-weight: 600;
  color: var(--c-ink-soft); letter-spacing: .01em;
}
.news-modal-gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(152px, 1fr));
  gap: 12px;
}
.news-modal-gallery:empty { display: none; }
.news-modal-gallery img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: 12px; cursor: zoom-in; display: block;
  transition: transform .2s ease, box-shadow .2s ease;
}
.news-modal-gallery img:hover,
.news-modal-gallery img:focus-visible {
  transform: scale(1.04);
  box-shadow: 0 8px 22px rgba(76, 32, 120, .28);
  outline: none;
}

/* ===== Перегляд фото на весь екран ===== */
.lightbox {
  position: fixed; inset: 0; z-index: 300;
  display: none; align-items: center; justify-content: center;
  background: rgba(24, 10, 40, .9);
  padding: 56px 76px;
}
.lightbox.is-open { display: flex; }
.lightbox img {
  max-width: 100%; max-height: 100%;
  object-fit: contain; border-radius: 12px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .55);
}
.lightbox-btn {
  position: absolute; border: none; cursor: pointer;
  background: rgba(255, 255, 255, .14); color: #fff;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  transition: background .2s ease;
}
.lightbox-btn:hover { background: rgba(255, 255, 255, .3); }
.lightbox-btn[disabled] { opacity: .25; cursor: default; }
.lightbox-close { top: 20px; right: 24px; width: 42px; height: 42px; font-size: 1.4rem; }
.lightbox-prev,
.lightbox-next { top: 50%; margin-top: -26px; width: 52px; height: 52px; font-size: 1.9rem; line-height: 1; }
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }
.lightbox-count {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  color: rgba(255, 255, 255, .75); font-size: .85rem; font-weight: 600;
}
@media (max-width: 620px) {
  .lightbox { padding: 60px 14px; }
  .lightbox-prev, .lightbox-next { width: 42px; height: 42px; margin-top: -21px; }
  .lightbox-prev { left: 6px; }
  .lightbox-next { right: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .news-card:hover, .news-card:focus-visible { transform: none; }
}
@media (max-width: 900px) { .news-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .news-grid { grid-template-columns: 1fr; } }

/* ===== Donate ===== */
.donate-section {
  background: var(--gradient-dark);
  border-radius: var(--radius-lg);
  margin: 0 24px;
  max-width: calc(var(--container) - 48px);
  margin-inline: auto;
  padding: 72px 48px;
  color: #fff;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.donate-section::before {
  /* фото переїхало в галерею — поки лишаємо тільки градієнт */
  content: none;
}
.donate-section > * { position: relative; z-index: 1; }
.donate-section h2 { color: #fff; }
.donate-section p { color: rgba(255,255,255,.82); max-width: 620px; margin: 0 auto 30px; }
.donate-options { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; }
.donate-note { margin-top: 22px; font-size: .82rem; color: rgba(255,255,255,.6); }
@media (max-width: 640px) { .donate-section { padding: 52px 24px; margin: 0 14px; } }

/* ===== Footer ===== */
.site-footer { background: #241040; color: rgba(255,255,255,.78); padding: 70px 0 26px; }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.1fr; gap: 40px; padding-bottom: 46px; }
.footer-brand img { height: 50px; margin-bottom: 16px; }
.footer-brand p { font-size: .9rem; max-width: 280px; color: rgba(255,255,255,.6); }
.footer-social { display: flex; gap: 10px; margin-top: 18px; }
.footer-social a {
  width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.08);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.8);
  transition: background .2s ease, color .2s ease;
}
.footer-social a svg { width: 18px; height: 18px; display: block; }
.footer-social a:hover { background: var(--c-primary-light); color: #fff; }
.footer-col h4 { color: #fff; font-size: .92rem; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 18px; }
.footer-col ul { display: flex; flex-direction: column; gap: 11px; }
.footer-col a, .footer-col li { font-size: .92rem; color: rgba(255,255,255,.7); }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.12); padding-top: 22px;
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center;
  font-size: .82rem; color: rgba(255,255,255,.5);
}
@media (max-width: 860px) {
  .footer-top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 540px) {
  .footer-top { grid-template-columns: 1fr; gap: 30px; }
}

/* ===== Modal (popup) ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(34,18,56,.55); backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center; z-index: 200; padding: 20px;
}
.modal-overlay.is-open { display: flex; }
.modal-box {
  background: #fff; border-radius: var(--radius-lg); padding: 40px; max-width: 420px; width: 100%;
  position: relative; box-shadow: var(--shadow-lg); text-align: center;
}
.modal-box h3 { margin-bottom: 10px; }
.modal-box p { color: var(--c-ink-soft); margin-bottom: 22px; }
.modal-close {
  position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%;
  border: none; background: var(--c-surface-alt); font-size: 1.1rem; color: var(--c-ink-soft);
}

/* Вікна «Онлайн / Офлайн школа»: тексту чимало, тож ширше й з вирівнюванням
   ліворуч. Якщо не вміщається у висоту екрана — прокручується саме вікно. */
.signup-modal .modal-box {
  max-width: 580px; text-align: left; padding: 34px 36px 32px;
  max-height: calc(100vh - 48px); overflow-y: auto;
  overscroll-behavior: contain;
}
.signup-modal h3 { margin: 0 0 16px; padding-right: 40px; font-size: 1.3rem; }
.signup-modal p { color: var(--c-ink-soft); font-size: .95rem; margin: 0 0 .9em; }
.signup-sub {
  font-family: var(--font-display); font-weight: 700;
  font-size: 1rem; color: var(--c-primary-dark);
  margin: 20px 0 8px;
  display: flex; align-items: center; gap: 9px;
}
.signup-go { margin-top: 18px; }
.signup-modal .modal-close { position: sticky; top: 0; right: auto; display: block; margin: 0 -14px -34px auto; }
@media (max-width: 620px) {
  .signup-modal .modal-box { padding: 30px 24px 26px; }
}

/* ===== Utilities ===== */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
