/* ILoveSport.kz — motion layer (transform/opacity only). Pair with motion.js.
   Everything hidden by default lives under .js, and is switched off for prefers-reduced-motion. */
:root {
  --ease-out: cubic-bezier(.2, .7, .2, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --t-fast: .18s;
  --t-med: .6s;
}

/* ---------- Page transitions (View Transitions API, cross-document) ---------- */
@view-transition { navigation: auto; }
.site-header { view-transition-name: site-header; }
::view-transition-old(root) { animation: vt-out .18s ease both; }
::view-transition-new(root) { animation: vt-in .32s var(--ease-out) both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Sticky header: translucent blur once scrolled ---------- */
.site-header { background: var(--paper); transition: background-color .25s, border-color .25s; }
.site-header.is-stuck { background: rgba(255, 255, 255, .8); border-bottom-color: rgba(14, 30, 54, .08); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); }
.site-header.is-stuck .mobile-nav { background: transparent; }
.nav > a { position: relative; border-bottom: 0; padding-block: 10px; }
.nav > a::after { content: ''; position: absolute; left: 0; right: 0; bottom: 2px; height: 2px; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform .28s var(--ease-out); }
.nav > a:hover::after, .nav > a[aria-current="page"]::after { transform: scaleX(1); }
.nav > a:hover, .more-btn:hover { border-bottom-color: transparent; }
.logo__mark { transition: transform .35s var(--ease-out); }
.logo:hover .logo__mark { transform: rotate(-8deg) scale(1.06); }

/* ---------- Buttons: lift, press ---------- */
.btn { transition: background-color .18s, border-color .18s, color .18s, transform .2s var(--ease-out), box-shadow .2s var(--ease-out); will-change: transform; }
.btn:hover:not(:disabled):not([aria-disabled="true"]) { transform: translateY(-2px); }
.btn:active:not(:disabled):not([aria-disabled="true"]) { transform: translateY(0) scale(.97); transition-duration: .06s; }
.btn--cta:hover { box-shadow: 0 10px 22px -8px rgba(242, 180, 0, .75); }
.btn--dark:hover { box-shadow: 0 10px 22px -10px rgba(14, 30, 54, .6); }
.btn .arr { transition: transform .25s var(--ease-out); }
.btn:hover .arr { transform: translateX(4px); }
.icon-btn, .lang button, .chip { transition: background-color .15s, color .15s, transform .15s; }
.icon-btn:active, .lang button:active { transform: scale(.92); }

/* ---------- Links: animated underline ---------- */
.more-link, .acard-news__more { position: relative; text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 calc(100% - 9px) / 0 2px no-repeat; transition: background-size .3s var(--ease-out), color .15s; }
.more-link:hover, .acard-news__more:hover { background-size: 100% 2px; }
.more-link .arr { display: inline-block; margin-left: 4px; transition: transform .25s var(--ease-out); }
.more-link:hover .arr { transform: translateX(5px); }

/* ---------- Cards: hover lift, image zoom ---------- */
.ecard, .acard-news, .arch-item, .steps li { transition: transform .35s var(--ease-out), box-shadow .35s var(--ease-out), border-color .2s, background-color .2s; }
.ecard__media, .acard-news__media { overflow: hidden; }
.ecard__media img, .acard-news__media img { transition: transform .8s var(--ease-out), opacity .5s; }
.ecard__media::after, .acard-news__media::after { content: ''; position: absolute; inset: auto 0 0 0; height: 55%; background: linear-gradient(180deg, rgba(9, 21, 38, 0), rgba(9, 21, 38, .55)); pointer-events: none; }
.ecard__date, .ecard__sport, .acard-news__cat { z-index: 1; }
@media (hover: hover) {
  .ecard:hover, .acard-news:hover { transform: translateY(-6px); box-shadow: 0 22px 36px -20px rgba(14, 30, 54, .45); }
  .ecard:hover .ecard__media img, .acard-news:hover .acard-news__media img { transform: scale(1.06); }
  .steps li:hover { transform: translateY(-4px); box-shadow: 0 18px 30px -20px rgba(14, 30, 54, .4); }
  .arch-item:hover img { transform: scale(1.05); }
}
.arch-item { overflow: hidden; }
.arch-item img { transition: transform .5s var(--ease-out); }
.ecard:active, .acard-news:active { transform: translateY(-2px) scale(.99); }
.bar > i { transform-origin: left; }

/* ---------- Image loading: skeleton, then fade in ---------- */
.js img.is-loading { opacity: 0; }
.js img.is-loaded { opacity: 1; }
.ecard__media, .acard-news__media, .arch-item img { background: linear-gradient(100deg, #17294A 30%, #223963 50%, #17294A 70%) 0 0 / 200% 100%; }
.js .ecard__media:has(img.is-loading), .js .acard-news__media:has(img.is-loading) { animation: shimmer 1.3s linear infinite; }

/* ---------- Scroll reveal ---------- */
.js [data-r] { opacity: 0; transform: translate3d(0, 28px, 0); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); transition-delay: calc(var(--d, 0) * 70ms); }
.js [data-r="left"] { transform: translate3d(-28px, 0, 0); }
.js [data-r="fade"] { transform: none; }
.js [data-r].is-in { opacity: 1; transform: none; }
/* after the reveal ends, hand transitions back to hover rules */
.js [data-r].is-done { transition-delay: 0s; }
.js .ecard[data-r].is-done, .js .acard-news[data-r].is-done { transition-duration: .35s, .35s, .2s, .2s; transition-property: transform, box-shadow, border-color, background-color; }

/* ---------- Hero entrance ---------- */
.hero__img { transform: translate3d(0, var(--py, 0px), 0); scale: 1.08; animation: hero-zoom 2.8s var(--ease-out) backwards; will-change: transform; }
@keyframes hero-zoom { from { scale: 1.2; } }
.hero__title span { overflow: hidden; padding: .03em .05em; margin: -.03em -.05em; }
.hero__title span > i { display: block; font-style: normal; animation: line-up .95s var(--ease-out) backwards; animation-delay: .12s; }
.hero__title span:nth-child(2) > i { animation-delay: .23s; }
.hero__title span:nth-child(3) > i { animation-delay: .34s; }
@keyframes line-up { from { transform: translate3d(0, 105%, 0); } }
.hero__kicker, .hero__facts, .hero__cta { animation: rise .8s var(--ease-out) backwards; }
.hero__kicker { animation-delay: .05s; }
.hero__facts { animation-delay: .62s; }
.hero__cta { animation-delay: .74s; }
@keyframes rise { from { opacity: 0; transform: translate3d(0, 20px, 0); } }
.hero .scroll-cue { animation: rise .8s var(--ease-out) 1s backwards; }

/* page heads (inner pages) */
.page-head .wrap > *, .event-cover .wrap > * { animation: rise .7s var(--ease-out) backwards; }
.page-head .wrap > :nth-child(2), .event-cover .wrap > :nth-child(2) { animation-delay: .08s; }
.page-head .wrap > :nth-child(3), .event-cover .wrap > :nth-child(3) { animation-delay: .16s; }
.page-head .wrap > :nth-child(n+4), .event-cover .wrap > :nth-child(n+4) { animation-delay: .24s; }

/* шаги регистрации и оплаты: без входных анимаций */
.page-register .page-head .wrap > *, .page-confirm .page-head .wrap > * { animation: none; }

/* ---------- Marquee ---------- */
.marquee { position: relative; z-index: 1; background: var(--ink); color: var(--paper); overflow: hidden; border-block: 1px solid rgba(255, 255, 255, .08); }
.marquee__track { display: flex; width: max-content; animation: marquee 48s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__list { display: flex; align-items: center; flex-shrink: 0; margin: 0; padding: 0; list-style: none; }
.marquee__list li { flex-shrink: 0; }
.marquee a { display: flex; align-items: baseline; gap: 10px; padding: 16px 28px; color: var(--paper); text-decoration: none; font: 700 20px/1 var(--f-display); text-transform: uppercase; letter-spacing: .02em; transition: color .2s; white-space: nowrap; }
.marquee a:hover { color: var(--sun); }
.marquee a b { color: var(--sky); font-weight: 800; }
.marquee a span { font: 500 14px/1 var(--f-body); color: #AEBBCB; text-transform: none; letter-spacing: 0; }
.marquee__list li::after { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .25); vertical-align: middle; margin-left: 0; }
.marquee__list li { display: flex; align-items: center; }
@keyframes marquee { to { transform: translate3d(-50%, 0, 0); } }
@media (min-width: 768px) { .marquee a { font-size: 24px; padding: 20px 36px; } }

/* ---------- Skeleton shimmer keyframes (shared) ---------- */
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Reduced motion: static, content intact ---------- */
@media (prefers-reduced-motion: reduce) {
  .js [data-r], .js [data-r].is-in { opacity: 1 !important; transform: none !important; }
  .js img.is-loading { opacity: 1; }
  .hero__img { transform: none !important; scale: 1 !important; animation: none !important; }
  .hero__title span > i, .hero__kicker, .hero__facts, .hero__cta, .page-head .wrap > *, .event-cover .wrap > * { animation: none !important; }
  .marquee { overflow-x: auto; }
  .marquee__track { animation: none !important; }
  .marquee__list[aria-hidden="true"] { display: none; }
  .btn:hover, .btn:active, .ecard:hover, .acard-news:hover, .steps li:hover { transform: none !important; }
  .ecard:hover .ecard__media img, .acard-news:hover .acard-news__media img { transform: none !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
@media (prefers-reduced-motion: reduce) { .steps li:hover, .arch-item:hover .go { transform: none !important; } }
