/* Running Buddies — общий слой дизайна 2026-10 (поверх main.css, на всех страницах):
   токены, кнопки, подвал, финальный призыв, бегущая строка и движение (motion.js). */

:root {
  /* заливка под белым текстом: #e2492b даёт 4.0:1, этот оттенок — 4.6:1 (WCAG AA для мелкого текста) */
  --accent-fill: #d4421f;
  --radius: 22px;
}

.btn--accent,
.feature--accent,
.dock__btn--accent,
.header-cta:not(.header-cta--ghost):not(:hover) { background: var(--accent-fill); border-color: var(--accent-fill); }

/* на тёмном первом экране оранжевая рамка фокуса теряется — белая видна всегда */
.hero :focus-visible,
[data-hero] :focus-visible,
.ticker :focus-visible,
.site-header:not(.is-scrolled):not(.site-header--ink) :focus-visible,
.site-footer :focus-visible { outline-color: #fff; }

/* светлая шапка (Мытищи): вторая кнопка — тёмная обводка */
.site-header--ink .header-cta--ghost { border-color: var(--ink); color: var(--ink); }
.site-header--ink .header-cta--ghost:hover { background: var(--ink); color: #fff; }
/* текущий раздел в шапке */
.header-cta[aria-current="page"] .header-cta__dot::after { animation: none; }
.site-nav a[aria-current="page"]::after { transform: scaleX(1); }

/* ---------- Финальный призыв ---------- */

.cta { position: relative; overflow: hidden; }
/* разметка беговой дорожки на фоне — тонкие дуги, как поворот стадиона */
.cta::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(1400px, 160vw);
  aspect-ratio: 2 / 1;
  border-radius: 999px;
  background: repeating-radial-gradient(ellipse at center, transparent 0 46px, rgba(226, 73, 43, 0.12) 46px 48px);
  -webkit-mask: radial-gradient(ellipse at center, transparent 30%, #000 31%, #000 68%, transparent 70%);
  mask: radial-gradient(ellipse at center, transparent 30%, #000 31%, #000 68%, transparent 70%);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.cta__inner { position: relative; }
.cta__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}
.btn--outline { border-color: var(--ink); color: var(--ink); }
.btn--outline:hover { background: var(--ink); color: #fff; }
.cta .btn--accent:hover { background: var(--ink); color: #fff; }

/* ---------- Подвал ---------- */

.site-footer__inner { grid-template-columns: auto 1fr auto auto; }
.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px clamp(20px, 2.4vw, 36px);
}
.site-footer__nav a,
.site-footer__links a {
  display: inline-block;
  padding: 10px 0;
}
.site-footer__nav a {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.3s var(--ease);
}
.site-footer__nav a:hover,
.site-footer__nav a[aria-current="page"] { color: var(--accent); }

@media (max-width: 900px) {
  .site-footer__inner { grid-template-columns: 1fr; }
  .site-footer__nav { justify-content: flex-start; }
}
@media (max-width: 760px) {
  .cta__actions { flex-direction: column; align-items: stretch; width: 100%; max-width: 360px; }
}

/* ---------- 3D-сцена в первом экране: пока не готова — видна картинка-заглушка ---------- */

.scene3d {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.4s var(--ease);
}
.is-3d > .scene3d,
.is-3d .scene3d { opacity: 1; }

/* ---------- Бегущая строка ---------- */

.ticker {
  position: relative;
  z-index: 2;
  overflow: hidden;
  padding: clamp(14px, 1.6vw, 22px) 0;
  background: var(--accent-fill);
  color: #fff;
}
.ticker--ink { background: var(--ink); }
.ticker__track {
  display: flex;
  align-items: center;
  width: max-content;
  animation: ticker 32s linear infinite;
}
.ticker span {
  display: inline-block;
  padding: 0 0.55em;
  font-size: clamp(26px, 3.6vw, 54px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  transform: skewX(calc(var(--skew, 0deg) * -1));
}
.ticker i {
  flex: none;
  width: 0.42em;
  height: 0.42em;
  border-radius: 50%;
  background: currentColor;
  font-size: clamp(26px, 3.6vw, 54px);
}
.ticker--ink i { background: var(--accent); }
/* слова-акценты — контуром */
.ticker .o { color: transparent; -webkit-text-stroke: 1.5px #fff; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------- Движение (motion.js ставит .motion-on; при prefers-reduced-motion — .motion-off) ---------- */

/* полоска прогресса прокрутки — как финишная лента цвета дорожки */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 120;
  height: 3px;
  background: var(--accent);
  transform: scaleX(var(--progress, 0));
  transform-origin: 0 50%;
  pointer-events: none;
}
.motion-off .progress { display: none; }

/* крупный заголовок первого экрана: буквы поднимаются с переворотом по оси X ([data-split]) */
.is-split { perspective: 900px; }
.is-split .w { display: inline-block; white-space: nowrap; }
.is-split .ch {
  display: inline-block;
  transform-origin: 50% 100%;
  animation: ch-in 1.1s var(--ease) both;
  animation-delay: calc(0.25s + var(--i) * 0.04s);
}
@keyframes ch-in {
  from { opacity: 0; transform: translateY(0.35em) rotateX(-95deg); }
  to { opacity: 1; transform: none; }
}

/* 3D-наклон за курсором; блик — радиальный градиент там, где курсор */
.motion-on .tilt:not(.reveal),
.motion-on .tilt.reveal.is-visible {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.7s var(--ease), background-color 0.4s var(--ease), color 0.4s var(--ease), border-color 0.3s var(--ease);
}
.motion-on .tilt.is-tilting { transition-duration: 0.15s, 0.4s, 0.4s, 0.3s; }
.motion-on .tilt.is-tilting:not(.reveal),
.motion-on .tilt.reveal.is-visible.is-tilting {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateZ(14px);
}
.motion-on .tilt.is-tilting:not(.tilt--soft) {
  background-image: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, 0.2), transparent 55%);
}

/* дуги дорожки за финальным призывом расходятся при прокрутке (--p от 0 до 1, пока блок проходит экран) */
.motion-on .cta::before { transform: translate(-50%, -50%) scale(calc(0.75 + var(--p, 0.5) * 0.5)); }

/* заголовки разделов выезжают снизу из-под маски (обёртку .mask добавляет motion.js);
   сам заголовок не обрезан — иначе IntersectionObserver не увидит его и не покажет */
@media (scripting: enabled) and (prefers-reduced-motion: no-preference) {
  .motion-on .has-mask { overflow: hidden; padding-bottom: 0.14em; margin-bottom: -0.14em; }
  .motion-on .has-mask.reveal { opacity: 1; transform: none; }
  .motion-on .has-mask > .mask {
    display: block;
    transform: translateY(105%) rotate(2deg);
    transform-origin: 0 100%;
    transition: transform 1.1s var(--ease);
  }
  .motion-on .has-mask.is-visible > .mask { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ticker__track,
  .header-cta__dot::after { animation: none; }
  .scene3d { transition: none; }
}

/* ---------- 404: круг стадиона с огоньком-пейсером ---------- */

.lost { display: grid; place-items: center; min-height: 100vh; min-height: 100svh; }
.lost::before { display: none; }
.lost__track {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(1100px, 150vw);
  transform: translate(-50%, -50%);
  fill: none;
  stroke: rgba(226, 73, 43, 0.16);
  stroke-width: 1.2;
  pointer-events: none;
}
.lost__pacer {
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 9 91;
  animation: pacer 6s linear infinite;
  filter: drop-shadow(0 0 4px rgba(226, 73, 43, 0.8));
}
@keyframes pacer { to { stroke-dashoffset: -100; } }
@media (prefers-reduced-motion: reduce) {
  .lost__pacer { animation: none; }
}
