/* ==========================================================================
   Animations & motion
   - Reveal styles only apply when JS has added .js to <html> (content is always
     visible without JavaScript).
   - Everything is disabled for users who prefer reduced motion.
   ========================================================================== */

/* Scroll reveal ------------------------------------------------------------ */
.js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 34px, 0);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease), clip-path 1.1s var(--ease);
  transition-delay: var(--reveal-delay, 0s);
}
.js [data-reveal='left'] {
  transform: translate3d(-48px, 0, 0);
}
.js [data-reveal='right'] {
  transform: translate3d(48px, 0, 0);
}
.js [data-reveal='zoom'] {
  transform: scale(0.94);
}
.js [data-reveal='clip'] {
  opacity: 1;
  transform: none;
  clip-path: polygon(13% 0, 13% 0, 0 100%, 0 100%);
}
.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}
.js .home-about__media[data-reveal='clip'].is-visible {
  clip-path: polygon(13% 0, 100% 0, 89% 100%, 0 100%);
}
.js [data-reveal='clip'] img {
  transform: scale(1.18);
  transition: transform 1.6s var(--ease);
}
.js [data-reveal='clip'].is-visible img {
  transform: scale(1);
}

/* Staggered children ----------------------------------------------------- */
.js [data-stagger] > * {
  opacity: 0;
  transform: translate3d(0, 26px, 0);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: var(--stagger-delay, 0s);
}
.js [data-stagger].is-visible > * {
  opacity: 1;
  transform: none;
}
/* Children that are themselves revealed animate via the parent stagger */
.js [data-stagger] > [data-reveal] {
  transition-delay: var(--stagger-delay, 0s);
}

/* Hero entrance ------------------------------------------------------------- */
.js .hero__slide [data-hero-anim] {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
}
.js .hero__slide.is-active [data-hero-anim] {
  animation: heroIn 0.95s var(--ease) forwards;
  animation-delay: var(--hero-delay, 0s);
}
.js .hero__slide.is-active .hero__line--brush::before {
  animation: brushIn 0.9s var(--ease) both;
  animation-delay: calc(var(--hero-delay, 0s) + 0.25s);
}
.js .page-hero [data-hero-anim] {
  opacity: 0;
  transform: translate3d(0, 24px, 0);
  animation: heroIn 0.9s var(--ease) forwards;
  animation-delay: var(--hero-delay, 0.1s);
}
@keyframes heroIn {
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes brushIn {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}
.js .hero__stripes {
  animation: stripesIn 1.2s var(--ease) 0.2s both;
}
@keyframes stripesIn {
  from {
    opacity: 0;
    transform: translate3d(-40px, 40px, 0);
  }
}
.page-hero__stripe {
  animation: stripeRise 1.1s var(--ease) 0.3s both;
}
@keyframes stripeRise {
  from {
    transform: skewX(-28deg) translateY(110%);
  }
}

/* Slider progress on active dot */
.hero__dot.is-active::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--yellow);
  transform-origin: left;
  animation: dotProgress var(--slide-duration, 7s) linear forwards;
}
.hero.is-paused .hero__dot.is-active::before {
  animation-play-state: paused;
}
@keyframes dotProgress {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

/* Football in fixture strip: gentle float */
.fixture-strip__ball {
  animation: floatBall 6s ease-in-out infinite;
}
@keyframes floatBall {
  50% {
    transform: translateY(-4px);
  }
}

/* Page transition ---------------------------------------------------------- */
.js body {
  animation: pageIn 0.5s var(--ease) both;
}
.js body.is-leaving {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
@keyframes pageIn {
  from {
    opacity: 0;
  }
}

/* Dialog transitions -------------------------------------------------------- */
dialog[open] {
  animation: dialogIn 0.35s var(--ease);
}
dialog[open]::backdrop {
  animation: fadeIn 0.35s ease;
}
dialog.is-closing {
  animation: dialogOut 0.22s ease forwards;
}
@keyframes dialogIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
}
@keyframes dialogOut {
  to {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
}

/* Accordion panel open ---------------------------------------------------- */
.accordion__panel.is-animating {
  transition: height 0.4s var(--ease);
}

/* Tab panel switch */
.tabs__panel:not([hidden]) {
  animation: tabIn 0.45s var(--ease);
}
@keyframes tabIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* Filter items */
.js [data-filter-item].is-filter-in {
  animation: filterIn 0.5s var(--ease) both;
}
@keyframes filterIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(10px);
  }
}

/* Header hide on scroll down */
.site-header {
  transition: transform 0.45s var(--ease), box-shadow 0.4s var(--ease), background-color 0.4s, border-color 0.4s;
}

/* Reduced motion ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  html {
    scroll-behavior: auto;
  }
  .js [data-reveal],
  .js [data-stagger] > *,
  .js .hero__slide [data-hero-anim],
  .js .page-hero [data-hero-anim] {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
  }
  .hero__media img,
  .js [data-reveal='clip'] img {
    transform: none !important;
  }
}

/* ==========================================================================
   Homepage interaction polish
   ========================================================================== */

/* 1. Card hover effects (pointer devices only; keyboard focus gets the same cue) */
@keyframes arrowSlide {
  0% {
    translate: 0 0;
    opacity: 1;
  }
  45% {
    translate: 140% 0;
    opacity: 0;
  }
  46% {
    translate: -140% 0;
    opacity: 0;
  }
  100% {
    translate: 0 0;
    opacity: 1;
  }
}
@keyframes iconBounce {
  0% {
    transform: none;
  }
  30% {
    transform: translateY(-9px) scale(1.14) rotate(-6deg);
  }
  55% {
    transform: translateY(0) scale(0.95, 1.05);
  }
  75% {
    transform: translateY(-4px) scale(1.04);
  }
  100% {
    transform: translateY(-2px) scale(1.08);
  }
}
@keyframes cardShine {
  from {
    translate: -120% 0;
  }
  to {
    translate: 220% 0;
  }
}
.programme-card__arrow,
.news-feature__more {
  overflow: hidden;
}
.programme-card__link::before {
  content: '';
  position: absolute;
  z-index: 2;
  inset: 0 auto 0 0;
  width: 45%;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.28) 50%, rgba(255, 255, 255, 0) 100%);
  translate: -120% 0;
  pointer-events: none;
}
.programme-card__icon {
  transition: transform 0.45s var(--ease);
}
@media (hover: hover) {
  .programme-card__link:hover::before {
    animation: cardShine 0.9s var(--ease);
  }
  .programme-card__link:hover .programme-card__arrow,
  .programme-card__link:focus-visible .programme-card__arrow {
    transform: translateX(4px);
  }
  .programme-card__link:hover .programme-card__arrow .icon,
  .news-feature:hover .news-feature__more .icon {
    animation: arrowSlide 0.6s var(--ease);
  }
  .programme-card__link:hover .programme-card__icon {
    transform: translateY(-3px) rotate(-8deg) scale(1.08);
  }
  .news-feature:hover .news-feature__more {
    background: var(--yellow);
    color: var(--navy);
    transform: translateX(3px);
  }
  .news-compact:hover .news-compact__title a {
    color: var(--red);
  }
  .quick-link:hover .quick-link__icon {
    transform: none;
    animation: iconBounce 0.7s var(--ease) forwards;
  }
}
.programme-card__link:focus-visible .programme-card__arrow {
  background: var(--yellow);
}

/* 2. Back-to-top button with scroll-progress ring */
.to-top {
  position: fixed;
  z-index: 90;
  right: clamp(14px, 2vw, 28px);
  bottom: clamp(14px, 2vw, 28px);
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--teal-800);
  color: var(--white);
  box-shadow: 0 10px 24px rgba(0, 40, 45, 0.28);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  translate: 0 18px;
  transition: opacity 0.35s var(--ease), translate 0.35s var(--ease), visibility 0.35s, background-color 0.3s, color 0.3s;
}
.to-top.is-shown {
  opacity: 1;
  visibility: visible;
  translate: 0 0;
}
.to-top__ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  rotate: -90deg;
}
.to-top__ring circle {
  fill: none;
  stroke-width: 3;
  stroke: rgba(255, 255, 255, 0.18);
}
.to-top__ring .to-top__progress {
  stroke: var(--yellow);
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  transition: stroke-dashoffset 0.15s linear;
}
.to-top__icon {
  width: 20px;
  height: 20px;
  rotate: -90deg;
}
.to-top:hover,
.to-top:focus-visible {
  background: var(--yellow);
  color: var(--navy);
}
.to-top:hover .to-top__ring circle:first-child {
  stroke: rgba(0, 63, 70, 0.15);
}
.to-top:hover .to-top__ring .to-top__progress {
  stroke: var(--teal-800);
}
@media (hover: hover) {
  .to-top:hover .to-top__icon {
    animation: arrowSlide 0.6s var(--ease);
  }
}
@media print {
  .to-top {
    display: none;
  }
}

/* 3. CTA band: player slides in, goal panel wipes in, a football is kicked from the player's
      foot, bounces three times (squash + ground shadow) and rolls into the net, which jolts. */
.cta-band__track {
  --ball: 34px;
  position: absolute;
  z-index: -1;
  left: 12.5%;
  right: 11%;
  bottom: 10px;
  height: var(--ball);
  container-type: inline-size;
  pointer-events: none;
}
.cta-ball {
  position: absolute;
  left: 0;
  bottom: 0;
  width: var(--ball);
  height: var(--ball);
  opacity: 0;
}
.cta-ball__lift {
  width: 100%;
  height: 100%;
}
.cta-ball__svg {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: 50% 100%;
}
.cta-ball__spin {
  transform-box: view-box;
  transform-origin: 32px 32px;
}
.cta-ball__shadow {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -4px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(60, 40, 0, 0.38), rgba(60, 40, 0, 0));
}
/* horizontal travel: fast kick, decelerating roll into the net */
@keyframes ctaBallX {
  /* one strong kick: fast launch, decelerating roll into the net */
  0% {
    transform: translateX(0);
    opacity: 0;
  }
  4% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateX(calc(100cqw - var(--ball)));
    opacity: 0;
  }
}
/* vertical bounces: each arc eases out going up and eases in coming down */
@keyframes ctaBallY {
  /* each arc eases out going up and eases in coming down; bounces shrink */
  0% {
    transform: translateY(0);
    animation-timing-function: cubic-bezier(0.2, 0.7, 0.4, 1);
  }
  17% {
    transform: translateY(-70px);
    animation-timing-function: cubic-bezier(0.6, 0, 0.8, 0.4);
  }
  34% {
    transform: translateY(0);
    animation-timing-function: cubic-bezier(0.2, 0.7, 0.4, 1);
  }
  47% {
    transform: translateY(-30px);
    animation-timing-function: cubic-bezier(0.6, 0, 0.8, 0.4);
  }
  59% {
    transform: translateY(0);
    animation-timing-function: cubic-bezier(0.2, 0.7, 0.4, 1);
  }
  67% {
    transform: translateY(-10px);
    animation-timing-function: cubic-bezier(0.6, 0, 0.8, 0.4);
  }
  74%,
  100% {
    transform: translateY(0);
  }
}
/* squash on each landing */
@keyframes ctaBallSquash {
  0%,
  32%,
  38%,
  57%,
  62%,
  72%,
  76%,
  100% {
    transform: scale(1, 1);
  }
  34% {
    transform: scale(1.18, 0.8);
  }
  59% {
    transform: scale(1.1, 0.9);
  }
  74% {
    transform: scale(1.05, 0.95);
  }
}
/* shadow shrinks/fades while the ball is in the air */
@keyframes ctaBallShadow {
  0%,
  34%,
  59%,
  74%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  17% {
    transform: scale(0.45);
    opacity: 0.35;
  }
  47% {
    transform: scale(0.7);
    opacity: 0.6;
  }
  67% {
    transform: scale(0.9);
    opacity: 0.85;
  }
}
@keyframes ctaBallSpin {
  to {
    transform: rotate(1080deg);
  }
}
@keyframes ctaNetHit {
  0%,
  100% {
    transform: none;
  }
  30% {
    transform: scale(1.05) translateX(5px);
  }
  60% {
    transform: scale(0.99) translateX(-2px);
  }
}
.js .cta-band[data-inview] .cta-band__player {
  translate: -60px 0;
  opacity: 0;
  transition: translate 0.9s var(--ease), opacity 0.9s var(--ease);
}
.js .cta-band[data-inview] .cta-band__ball {
  clip-path: polygon(100% 0, 100% 0, 100% 100%, 100% 100%);
  transition: clip-path 1s var(--ease) 0.1s;
}
.js .cta-band.is-visible .cta-band__player {
  translate: 0 0;
  opacity: 0.85;
}
.js .cta-band.is-visible .cta-band__ball {
  clip-path: polygon(14% 0, 100% 0, 100% 100%, 0 100%);
}
.js .cta-band.is-visible .cta-ball {
  --t: 2.5s;
  --d: 0.75s;
  animation: ctaBallX var(--t) cubic-bezier(0.16, 0.62, 0.3, 1) var(--d) both;
}
.js .cta-band.is-visible .cta-ball__lift {
  animation: ctaBallY var(--t) linear var(--d) both;
}
.js .cta-band.is-visible .cta-ball__svg {
  animation: ctaBallSquash var(--t) linear var(--d) both;
}
.js .cta-band.is-visible .cta-ball__shadow {
  animation: ctaBallShadow var(--t) linear var(--d) both;
}
.js .cta-band.is-visible .cta-ball__spin {
  animation: ctaBallSpin var(--t) cubic-bezier(0.16, 0.62, 0.3, 1) var(--d) both;
}
.js .cta-band.is-visible .cta-band__ball img {
  animation: ctaNetHit 0.55s var(--ease) 3.05s both;
}
/* text and button always sit above the rolling ball */
.cta-band__inner {
  position: relative;
  z-index: 1;
}
@media (max-width: 767px) {
  .cta-band__track {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cta-band__track {
    display: none;
  }
}

/* 4. Section titles: slash pops up, then a two-tone underline draws out */
.section-title {
  position: relative;
}
.section-title::after {
  content: '';
  position: absolute;
  left: 30px;
  bottom: -9px;
  width: 64px;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--yellow) 0 64%, transparent 64% 72%, var(--red) 72% 100%);
  transform: skewX(-24deg);
  transform-origin: left center;
}
.section-head--center .section-title::after {
  left: 50%;
  margin-left: -32px;
}
.js [data-reveal] .section-title__slash {
  transform: skewX(-24deg) scaleY(0);
  transform-origin: bottom center;
  transition: transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s;
}
.js [data-reveal] .section-title::after {
  transform: skewX(-24deg) scaleX(0);
  transition: transform 0.8s var(--ease) 0.5s;
}
.js [data-reveal].is-visible .section-title__slash {
  transform: skewX(-24deg) scaleY(1);
}
.js [data-reveal].is-visible .section-title::after {
  transform: skewX(-24deg) scaleX(1);
}
@media (hover: hover) {
  .section-head:hover .section-title::after {
    width: 84px;
    transition: transform 0.8s var(--ease) 0.5s, width 0.4s var(--ease);
  }
}
