/* Сальто — школа спортивной гимнастики
   Палитра взята из зала: индиго арены под софитами, магнезия, розовый купальник, голубая пыль в свете. */

:root {
  --ink: #140F3A;        /* арена */
  --ink-2: #1F1857;      /* помост */
  --ink-3: #2C2370;
  --chalk: #EDF0F7;      /* магнезия */
  --chalk-2: #DCE1EE;
  --pink: #FF4F9A;       /* купальник */
  --ice: #8FD3FF;        /* пыль в луче */
  --muted: #9A95C9;
  --text: var(--chalk);

  --f-display: "Unbounded", system-ui, sans-serif;
  --f-body: "Manrope", system-ui, sans-serif;

  --gutter: clamp(16px, 4vw, 56px);
  --radius-l: 28px;
  --radius-s: 999px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--f-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-x: clip;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--ice); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--pink); color: var(--ink); }

.skip {
  position: fixed; left: 12px; top: -60px; z-index: 100;
  background: var(--chalk); color: var(--ink); padding: 10px 16px; border-radius: 10px;
}
.skip:focus { top: 12px; }

.h2 {
  font: 800 clamp(2rem, 5.2vw, 4.4rem)/1.02 var(--f-display);
  letter-spacing: -0.03em;
  margin: 0;
  text-wrap: balance;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 54px; padding: 0 28px;
  border-radius: var(--radius-s); border: 0; cursor: pointer;
  font: 600 .95rem/1 var(--f-display); letter-spacing: -0.01em;
  text-decoration: none; white-space: nowrap;
  transition: background .3s var(--ease), color .3s var(--ease), box-shadow .3s var(--ease);
}
.btn--pink { background: var(--pink); color: var(--ink); box-shadow: 0 10px 40px -10px rgba(255, 79, 154, .7); }
.btn--pink:hover { background: var(--chalk); }
.btn--ghost { background: rgba(237, 240, 247, .08); color: var(--chalk); box-shadow: inset 0 0 0 1.5px rgba(237, 240, 247, .35); backdrop-filter: blur(8px); }
.btn--ghost:hover { background: var(--chalk); color: var(--ink); }
.btn--ink { background: var(--ink); color: var(--chalk); }
.btn--ink:hover { background: var(--chalk); color: var(--ink); }
.btn--line { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.btn--line:hover { background: var(--ink); color: var(--pink); }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; gap: 24px;
  padding: 14px var(--gutter);
  transition: background .4s var(--ease), padding .4s var(--ease), transform .5s var(--ease);
}
.nav.is-scrolled { background: rgba(20, 15, 58, .72); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); padding-block: 10px; }
.nav.is-hidden { transform: translateY(-110%); }
.nav__logo {
  display: inline-flex; align-items: center; gap: 10px;
  font: 800 1.15rem/1 var(--f-display); text-decoration: none; letter-spacing: -0.02em;
}
.nav__logo svg { width: 34px; height: 22px; fill: none; stroke-width: 3.2; }
.nav__logo circle:first-child { stroke: var(--pink); }
.nav__logo circle:last-child { stroke: var(--chalk); }
.nav__links { display: flex; gap: 6px; margin-left: auto; }
.nav__links a {
  text-decoration: none; padding: 10px 16px; border-radius: var(--radius-s);
  font-weight: 500; font-size: .95rem; transition: background .25s;
}
.nav__links a:hover { background: rgba(237, 240, 247, .1); }
.nav__phone {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; font: 600 .9rem/1 var(--f-display);
  padding: 13px 20px; border-radius: var(--radius-s);
  background: var(--chalk); color: var(--ink);
}
.nav__dot { width: 8px; height: 8px; border-radius: 50%; background: #2BD47D; box-shadow: 0 0 0 0 rgba(43, 212, 125, .6); animation: ping 2s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 10px rgba(43, 212, 125, 0); } 100% { box-shadow: 0 0 0 0 rgba(43, 212, 125, 0); } }
.nav__burger { display: none; }

.menu {
  position: fixed; inset: 0; z-index: 45;
  background: var(--pink); color: var(--ink);
  display: flex; flex-direction: column; justify-content: center; gap: 40px;
  padding: 90px var(--gutter) 40px;
  clip-path: circle(0% at calc(100% - 40px) 36px);
  transition: clip-path .7s var(--ease);
  visibility: hidden;
}
.menu.is-open { clip-path: circle(150% at calc(100% - 40px) 36px); visibility: visible; }
.menu nav { display: flex; flex-direction: column; }
.menu nav a { font: 800 clamp(2.4rem, 11vw, 4rem)/1.15 var(--f-display); text-decoration: none; letter-spacing: -0.03em; }
.menu__phone { font: 600 1.3rem/1 var(--f-display); text-decoration: none; }

@media (max-width: 860px) {
  .nav__links, .nav__phone { display: none; }
  .nav__burger {
    display: grid; place-content: center; gap: 7px; margin-left: auto;
    width: 52px; height: 52px; border-radius: 50%; border: 0; cursor: pointer;
    background: var(--chalk);
  }
  .nav__burger span { display: block; width: 20px; height: 2.5px; background: var(--ink); border-radius: 2px; transition: transform .4s var(--ease); }
  .nav__burger[aria-expanded="true"] span:first-child { transform: translateY(4.75px) rotate(45deg); }
  .nav__burger[aria-expanded="true"] span:last-child { transform: translateY(-4.75px) rotate(-45deg); }
  .nav.menu-open { background: transparent; backdrop-filter: none; }
  .nav.menu-open .nav__logo { color: var(--ink); }
  .nav.menu-open .nav__logo circle:first-child { stroke: var(--ink); }
  .nav.menu-open .nav__logo circle:last-child { stroke: var(--chalk); }
  .nav.menu-open .nav__burger { background: var(--ink); }
  .nav.menu-open .nav__burger span { background: var(--chalk); }
}

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: 100svh; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 120px var(--gutter) clamp(28px, 5vw, 56px);
  isolation: isolate;
  touch-action: pan-y;
}
.hero__media {
  position: absolute; z-index: -2;
  inset: 0 0 0 34%;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 40%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 40%);
}
.hero__media img { width: 100%; height: 110%; object-fit: cover; object-position: 50% 30%; }
.hero__media::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(0deg, var(--ink) 0%, rgba(20, 15, 58, 0) 45%);
}
.chalk { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; }

.hero__kicker { margin: 0 0 8px; font-weight: 500; color: var(--ice); font-size: clamp(1rem, 1.6vw, 1.25rem); }
.hero__title {
  margin: 0 0 0 -0.05em;
  font: 900 clamp(3.6rem, 17.5vw, 21rem)/.86 var(--f-display);
  letter-spacing: -0.025em;
  white-space: nowrap;
  perspective: 900px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.hero__title span { display: inline-block; transform-origin: 50% 55%; }
.hero__title span:nth-child(odd) { color: var(--chalk); }
.hero__title span:nth-child(even) {
  color: transparent;
  background: url(img/ballet.jpg) 70% 18% / 300% auto;
  -webkit-background-clip: text; background-clip: text;
}
.hero__bottom {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; flex-wrap: wrap;
  margin-top: clamp(20px, 3vw, 40px);
}
.hero__lead { max-width: 34ch; margin: 0; font-size: clamp(1.05rem, 1.5vw, 1.3rem); line-height: 1.5; color: rgba(237, 240, 247, .86); }
.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero__hint {
  position: absolute; right: var(--gutter); top: 50%; margin: 0;
  writing-mode: vertical-rl; font-size: .8rem; color: var(--muted); letter-spacing: .02em;
}

@media (max-width: 860px) {
  .hero { padding-top: 100px; }
  .hero__media { inset: 0; -webkit-mask-image: none; mask-image: none; }
  .hero__media img { object-position: 60% 20%; }
  .hero__media::after {
    background: linear-gradient(0deg, var(--ink) 18%, rgba(20, 15, 58, .5) 55%, rgba(20, 15, 58, .15) 100%);
  }
  .hero__hint { display: none; }
  .hero__cta { width: 100%; }
  .hero__cta .btn { flex: 1 1 auto; }
}

/* ---------- marquee ---------- */
.marquee {
  background: var(--pink); color: var(--ink);
  overflow: hidden; padding: 18px 0;
  transform: rotate(-2deg) scale(1.04);
  margin: 0 0 -10px;
  position: relative; z-index: 2;
}
.marquee__track { display: flex; width: max-content; align-items: center; gap: 28px; will-change: transform; }
.marquee__track span { font: 800 clamp(1.4rem, 3vw, 2.4rem)/1 var(--f-display); letter-spacing: -0.02em; white-space: nowrap; }
.marquee__track i { font-style: normal; font-size: 1.4rem; }

/* ---------- apparatus ---------- */
.app { position: relative; background: var(--ink); }
.app__pin {
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center; gap: clamp(28px, 4vw, 48px);
  padding: clamp(80px, 10vw, 120px) 0 clamp(40px, 6vw, 72px);
  overflow: hidden;
}
.app__head {
  display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 16px 40px;
  padding: 0 var(--gutter);
}
.app__head h2 { font-size: clamp(2rem, 4vw, 3.6rem); }
.app__note { margin: 0; color: var(--muted); max-width: 30ch; }
.app__count { color: var(--chalk); font-weight: 700; white-space: nowrap; }
.app__count b { color: var(--pink); }
.app__progress { grid-column: 1 / -1; height: 3px; background: rgba(237, 240, 247, .12); border-radius: 3px; overflow: hidden; }
.app__progress span { display: block; height: 100%; width: 100%; background: var(--pink); transform-origin: 0 50%; transform: scaleX(.125); }

.app__viewport { overflow: visible; }
.app__track {
  list-style: none; margin: 0; padding: 0 var(--gutter);
  display: flex; gap: clamp(14px, 1.6vw, 24px);
  width: max-content;
  will-change: transform;
}
.card-a {
  width: clamp(290px, 30vw, 420px);
  background: var(--ink-2);
  border-radius: var(--radius-l);
  padding: 22px 26px 28px;
  display: flex; flex-direction: column;
  position: relative;
  transition: background .4s var(--ease), transform .5s var(--ease);
}
.card-a:hover { background: var(--ink-3); }
.card-a__art {
  width: 100%; height: clamp(140px, 24vh, 240px); margin-bottom: 14px;
  fill: none; stroke: var(--chalk); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round;
  background: radial-gradient(circle at 50% 60%, rgba(143, 211, 255, .14), transparent 65%);
  border-radius: 18px;
}
.card-a__art .thin { stroke-width: 2; stroke: var(--muted); }
.card-a__art .dash { stroke: var(--pink); stroke-width: 2.4; stroke-dasharray: 2 9; }
.card-a__tag { margin: 0 0 6px; color: var(--ice); font-size: .88rem; font-weight: 500; }
.card-a h3 { margin: 0 0 10px; font: 800 clamp(1.35rem, 2vw, 1.75rem)/1.1 var(--f-display); letter-spacing: -0.02em; }
.card-a p { margin: 0 0 16px; color: rgba(237, 240, 247, .78); font-size: .98rem; }
.card-a .card-a__key { margin-top: auto; margin-bottom: 0; padding-top: 14px; border-top: 1px solid rgba(237, 240, 247, .12); font-size: .9rem; color: var(--muted); }
.card-a__key b { color: var(--chalk); font-weight: 700; }

/* mobile: native swipe instead of pin */
@media (max-width: 860px) {
  .app__head { grid-template-columns: 1fr; }
  .app__viewport { overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .app__viewport::-webkit-scrollbar { display: none; }
  .card-a { scroll-snap-align: center; width: 82vw; }
}

/* ---------- exercises ---------- */
.ex {
  background: var(--chalk); color: var(--ink);
  padding: clamp(80px, 10vw, 140px) var(--gutter);
  border-radius: 40px 40px 0 0;
  position: relative; z-index: 2;
}
.ex__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px 40px; flex-wrap: wrap; margin-bottom: 32px; }
.ex__head .h2 { max-width: 16ch; }
.ex__sub { margin: 0; max-width: 32ch; color: #4A4675; }
.ex__filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.chip {
  border: 0; cursor: pointer; padding: 12px 20px; border-radius: var(--radius-s);
  background: var(--chalk-2); color: var(--ink); font-weight: 700; font-size: .95rem;
  transition: background .3s var(--ease), color .3s var(--ease);
}
.chip:hover { background: #CDD3E5; }
.chip.is-active { background: var(--ink); color: var(--chalk); }

.ex__grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px;
}
.ex-card { perspective: 1200px; }
.ex-card button {
  all: unset; display: block; width: 100%; height: 100%; cursor: pointer;
  border-radius: 24px;
}
.ex-card button:focus-visible { outline: 3px solid var(--pink); outline-offset: 4px; }
.ex-card__inner {
  position: relative; width: 100%; height: 100%; min-height: 280px;
  display: grid;
  transform-style: preserve-3d;
  transition: transform .8s cubic-bezier(.3, 1.4, .4, 1);
}
.ex-card.is-flipped .ex-card__inner { transform: rotateY(180deg); }
.ex-card__face {
  grid-area: 1 / 1; border-radius: 24px; padding: 24px;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  display: flex; flex-direction: column;
}
.ex-card__front { background: #fff; box-shadow: 0 1px 0 rgba(20, 15, 58, .06), 0 20px 40px -24px rgba(20, 15, 58, .35); }
.ex-card__back { background: var(--ink); color: var(--chalk); transform: rotateY(180deg); }
.ex-card__level { display: flex; align-items: center; gap: 10px; font-size: .85rem; font-weight: 700; color: #4A4675; }
.ex-card__dots { display: inline-flex; gap: 4px; }
.ex-card__dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--chalk-2); }
.ex-card__dots i.on { background: var(--pink); }
.ex-card__emoji {
  margin: auto 0 14px; transform-origin: 0 100%;
  font: 900 clamp(2.4rem, 3.4vw, 3rem)/1 var(--f-display); letter-spacing: -0.05em; color: var(--ink);
  transition: transform .5s var(--ease), color .3s;
}
.ex-card:hover .ex-card__emoji { transform: rotate(-4deg) scale(1.06); color: var(--pink); }
.ex-card h3 { margin: 0 0 6px; font: 800 1.45rem/1.1 var(--f-display); letter-spacing: -0.02em; }
.ex-card__meta { margin: 0; color: #4A4675; font-size: .95rem; }
.ex-card__more { margin-top: 14px; font-size: .85rem; font-weight: 700; color: var(--pink); }
.ex-card__back h3 { font-size: 1.1rem; margin-bottom: 12px; }
.ex-card__back ol { margin: 0; padding-left: 1.2em; font-size: .93rem; line-height: 1.5; color: rgba(237, 240, 247, .88); }
.ex-card__back li { margin-bottom: 6px; }
.ex-card__back li::marker { color: var(--pink); font-weight: 700; }
.ex-card__tip { margin: auto 0 0; padding-top: 10px; font-size: .85rem; color: var(--ice); }

/* ---------- gallery ---------- */
.gal { background: var(--ink); padding: clamp(80px, 10vw, 140px) var(--gutter); overflow: hidden; }
.gal__title { max-width: 18ch; margin-bottom: clamp(36px, 5vw, 64px); }
.gal__grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; align-items: start; }
.gal__item { margin: 0; border-radius: var(--radius-l); overflow: hidden; background: var(--ink-2); }
.gal__item img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.15); }
.gal__item:nth-child(1) { grid-column: 1 / span 4; aspect-ratio: 3 / 4; }
.gal__item:nth-child(2) { grid-column: 5 / span 5; aspect-ratio: 4 / 3; margin-top: 80px; }
.gal__item:nth-child(3) { grid-column: 10 / span 3; aspect-ratio: 2 / 3; margin-top: 20px; }
.gal__item:nth-child(4) { grid-column: 2 / span 5; aspect-ratio: 4 / 3; margin-top: 40px; }
.gal__item:nth-child(5) { grid-column: 8 / span 4; aspect-ratio: 3 / 4; margin-top: 0; }
@media (max-width: 860px) {
  .gal__grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .gal__item:nth-child(n) { grid-column: auto; margin-top: 0; border-radius: 18px; }
  .gal__item:nth-child(2) { margin-top: 40px; }
  .gal__item:nth-child(5) { grid-column: 1 / -1; aspect-ratio: 4 / 3; }
}

/* ---------- groups ---------- */
.groups {
  background: var(--chalk); color: var(--ink);
  padding: clamp(80px, 10vw, 140px) var(--gutter);
  position: relative;
}
.groups__sub { margin: 12px 0 36px; color: #4A4675; }
.groups__list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.row {
  display: grid; grid-template-columns: 1.3fr .5fr 1.4fr auto; gap: 24px; align-items: center;
  padding: 26px 8px; border-bottom: 2px solid var(--ink);
  cursor: pointer; position: relative;
  transition: background .35s var(--ease), color .35s var(--ease), padding .45s var(--ease);
}
.row:hover, .row.is-open { background: var(--ink); color: var(--chalk); padding-inline: 24px; }
.row__name { font: 800 clamp(1.4rem, 2.8vw, 2.4rem)/1.05 var(--f-display); letter-spacing: -0.03em; }
.row__age { font-weight: 700; }
.row__info { color: inherit; opacity: .78; font-size: .98rem; }
.row__price { font: 600 1rem/1 var(--f-display); white-space: nowrap; padding: 12px 16px; border-radius: var(--radius-s); background: var(--pink); color: var(--ink); }
.row__img { display: none; }
.groups__float {
  position: fixed; left: 0; top: 0; z-index: 30;
  width: 280px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 22px;
  pointer-events: none; opacity: 0; transform: scale(.6);
  box-shadow: 0 30px 60px -20px rgba(20, 15, 58, .6);
}
@media (hover: none), (max-width: 860px) {
  .groups__float { display: none; }
  .row { grid-template-columns: 1fr auto; gap: 6px 16px; padding: 22px 4px; }
  .row:hover { background: transparent; color: var(--ink); padding-inline: 4px; }
  .row.is-open { background: var(--ink); color: var(--chalk); padding-inline: 16px; }
  .row__info { grid-column: 1 / -1; }
  .row__price { grid-column: 1 / -1; justify-self: start; }
  .row__img { display: block; grid-column: 1 / -1; width: 100%; height: 0; object-fit: cover; border-radius: 16px; transition: height .5s var(--ease), margin .5s var(--ease); }
  .row.is-open .row__img { height: 220px; margin-top: 10px; }
}

/* ---------- contact ---------- */
.contact {
  background: var(--pink); color: var(--ink);
  padding: clamp(80px, 10vw, 140px) var(--gutter) clamp(60px, 8vw, 100px);
  overflow: hidden;
}
.contact__kicker { margin: 0 0 18px; font-weight: 700; font-size: clamp(1.05rem, 1.6vw, 1.35rem); max-width: 34ch; }
.contact__phone {
  display: flex; flex-direction: column; text-decoration: none;
  font: 900 clamp(3.3rem, 11vw, 11rem)/.9 var(--f-display); letter-spacing: -0.055em;
  margin-left: -0.04em;
}
.contact__phone span { display: block; transition: transform .6s var(--ease); }
.contact__phone span:last-child { padding-left: .9em; }
.contact__phone:hover span:first-child { transform: translateX(.25em); }
.contact__phone:hover span:last-child { transform: translateX(-.25em); }
.contact__actions { display: flex; flex-wrap: wrap; gap: 10px; margin: clamp(28px, 4vw, 48px) 0; }
.contact__info { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin: 0; padding-top: 28px; border-top: 2px solid var(--ink); }
.contact__info dt { font-weight: 700; margin-bottom: 6px; }
.contact__info dd { margin: 0; max-width: 30ch; }
@media (max-width: 860px) {
  .contact__phone span:last-child { padding-left: 0; }
  .contact__info { grid-template-columns: 1fr; }
  .contact__actions .btn { flex: 1 1 100%; }
}

/* ---------- footer, toast ---------- */
.foot { display: flex; justify-content: space-between; padding: 26px var(--gutter); color: var(--muted); font-size: .9rem; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--chalk); }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 60;
  transform: translate(-50%, calc(100% + 40px)); visibility: hidden;
  background: var(--ink); color: var(--chalk);
  padding: 14px 22px; border-radius: var(--radius-s);
  font-weight: 700; box-shadow: 0 20px 50px -10px rgba(20, 15, 58, .6);
  transition: transform .5s cubic-bezier(.3, 1.5, .5, 1), visibility 0s .5s;
}
.toast.is-on { transform: translate(-50%, 0); visibility: visible; transition-delay: 0s; }

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