/* Home page sections. Shared tokens and components come from base.css. */

/* ------------------------------------------------------------------ hero */
.hero {
  --stripe-1: #f4f4f0;
  position: relative;
  min-height: 100dvh;
  display: grid;
  align-items: end;
  color: var(--on-media);
  background: #0d0e0c;
  overflow: hidden;
  isolation: isolate;
}
.hero__media { position: absolute; inset: 0; z-index: -3; transform-origin: 50% 60%; }
.hero__media video, .hero__media img { width: 100%; height: 100%; object-fit: cover; }
.hero__slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.6s var(--ease-in-out); }
.hero__slide.is-active { opacity: 1; z-index: 1; }
.hero__slide img { object-position: 50% 35%; }
html.motion .hero__slide.is-active img { animation: hero-drift 9s var(--ease-out) both; }
@keyframes hero-drift { from { transform: scale(1.12); } to { transform: scale(1); } }
.hero.is-paused .hero__slide.is-active img { animation-play-state: paused; }
.hero__scrim {
  position: absolute; inset: 0; z-index: -2;
  background:
    linear-gradient(180deg, rgb(10 11 9 / 0.5) 0%, rgb(10 11 9 / 0) 26%, rgb(10 11 9 / 0.2) 52%, rgb(10 11 9 / 0.88) 100%),
    linear-gradient(90deg, rgb(10 11 9 / 0.55) 0%, rgb(10 11 9 / 0) 62%);
}
.hero__sash { position: absolute; z-index: -1; right: -6%; bottom: 24%; width: 58%; height: 60px; transform: rotate(-22deg); transform-origin: right center; }
.hero__sash .sash { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.92; transform-origin: right center; }
.hero__content {
  position: relative;
  display: grid; justify-items: start; gap: 24px;
  padding-top: calc(var(--header-h) + 40px);
  padding-bottom: clamp(44px, 9vh, 104px);
}
.hero__eyebrow { color: rgb(244 244 240 / 0.82); }
/* 7em keeps "Uganda is / catching on." on two lines from phone to wide desktop. */
.hero__title { font-size: clamp(3rem, 0.8rem + 7.6vw, 10rem); max-width: 7em; }
.hero__title em { color: var(--accent); }
.hero__title .split-line { padding-bottom: 0.16em; margin-bottom: -0.16em; }
.hero__lead { max-width: 36ch; font-size: var(--step-1); line-height: 1.5; color: rgb(244 244 240 / 0.88); }
.hero__ctas { gap: 12px; margin-top: 8px; }
.hero__toggle { position: absolute; right: var(--gutter); bottom: clamp(44px, 9vh, 104px); color: var(--on-media); }
.hero__toggle .i-play { display: none; }
.hero__toggle.is-paused .i-play { display: block; }
.hero__toggle.is-paused .i-pause { display: none; }
html.motion .hero__eyebrow,
html.motion .hero__lead,
html.motion .hero__ctas,
html.motion .hero__toggle { opacity: 0; transform: translateY(22px); }
html.motion .hero__sash .sash { transform: scaleX(0); }
@media (max-width: 767px) {
  /* On phones the copy fills the lower half, so the sash crosses the photo above it instead,
     ending clear of the eyebrow. */
  .hero__sash { top: calc(var(--header-h) + 56px); width: 75%; right: -25%; bottom: auto; height: 28px; }
  .hero__toggle { bottom: auto; top: calc(var(--header-h) + 12px); }
  .hero__ctas .btn { width: 100%; justify-content: space-between; }
  .hero__ctas { width: 100%; }
}
/* Short phones: the copy is bottom aligned and leaves no free photo above it, so the sash would cross the text. */
@media (max-width: 767px) and (max-height: 735px) { .hero__sash { display: none; } }
/* Portrait tablets: a shorter sash so its tip starts right of the hero buttons. */
@media (min-width: 768px) and (max-width: 1023px) and (orientation: portrait) { .hero__sash { width: 40%; } }
/* Landscape phones: keep the headline and both buttons on the first screen (the lead sentence is dropped). */
@media (max-height: 520px) and (orientation: landscape) {
  .hero__content { gap: 10px; padding-top: calc(var(--header-h) + 8px); padding-bottom: 20px; }
  .hero__title { font-size: clamp(2.25rem, 13vh, 3.5rem); }
  .hero__lead { display: none; }
  .hero__ctas, .hero__ctas .btn { width: auto; }
  .hero__toggle { top: auto; bottom: 20px; }
  .hero__sash { display: none; }
}

/* ------------------------------------------------------------------ stats */
.stats__lead { max-width: 15ch; }
.stats__grid { display: grid; grid-template-columns: repeat(4, 1fr); margin: clamp(56px, 7vw, 104px) 0 0; border-top: 1px solid var(--line); }
.stat { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 14px; padding: 28px 24px 0 0; }
.stat + .stat { padding-left: clamp(16px, 2vw, 28px); border-left: 1px solid var(--line); }
.stat:nth-child(even) { padding-top: clamp(28px, 7vw, 112px); }
.stat__value { margin: 0; font-size: clamp(4rem, 1.6rem + 6.4vw, 9rem); font-weight: 900; font-stretch: 64%; line-height: 0.84; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.stat__label { color: var(--muted); max-width: 22ch; font-size: var(--step--1); }
.stat:first-child .stat__value { color: var(--accent-text); }
@media (max-width: 899px) {
  .stats__grid { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(even) { padding-top: 28px; }
  .stat:nth-child(3) { border-left: 0; padding-left: 0; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--line); margin-top: 28px; }
}
/* At 320px the counted-up "5,500+" at 4rem is wider than its column and pushed the page to 332px. */
@media (max-width: 359px) {
  .stats__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat__value { font-size: 3.25rem; }
}

/* ------------------------------------------------------------------ the game (sticky photo + panels) */
.game__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 104px); align-items: start; }
.game__sticky { position: sticky; top: calc(var(--header-h) + 20px); height: calc(100dvh - var(--header-h) - 40px); }
.game__frames { position: relative; height: 100%; border-radius: var(--radius); overflow: hidden; background: var(--bg-2); }
.game__frame { position: absolute; inset: 0; clip-path: circle(0% at 50% 55%); transition: clip-path 1.1s var(--ease-in-out); }
.game__frame.was-active { clip-path: circle(80% at 50% 55%); z-index: 1; transition: none; }
.game__frame.is-active { clip-path: circle(80% at 50% 55%); z-index: 2; }
.game__frame img { width: 100%; height: 100%; object-fit: cover; }
.game__title { margin-bottom: 14vh; max-width: 11ch; }
.game__panels { padding-bottom: 18vh; }
.game__panel { min-height: 64vh; display: grid; align-content: center; gap: 18px; max-width: 42ch; transition: opacity 0.6s var(--ease-out); }
html.motion .game__panel:not(.is-current) { opacity: 0.32; }
.game__panel-title { font-size: var(--step-4); font-weight: 860; font-stretch: 66%; text-transform: uppercase; line-height: 0.9; word-spacing: 0.14em; }
.game__panel .body-copy { font-size: var(--step-1); }
.game__panel-media { display: none; }
@media (max-width: 899px) {
  .game__grid { grid-template-columns: 1fr; }
  .game__sticky { display: none; }
  .game__title { margin-bottom: 8px; }
  .game__panels { padding-bottom: 0; display: grid; gap: 56px; }
  .game__panel { min-height: 0; max-width: none; }
  html.motion .game__panel:not(.is-current) { opacity: 1; }
  .game__panel-media { display: block; }
}

/* ------------------------------------------------------------------ league roadmap
   Default (mobile, reduced motion): intro then a swipeable row of rounds.
   .is-pinned (desktop with motion, added by home.js): one long row panned by vertical scroll. */
.league { position: relative; background: var(--bg-2); overflow: hidden; padding-block: var(--section); }
.league__track { display: grid; gap: 48px; }
.league__intro { display: grid; gap: 22px; justify-items: start; padding-inline: var(--gutter); max-width: calc(var(--wrap)); margin-inline: auto; width: 100%; }
.league__intro .h2 { max-width: 12ch; }
.league__rounds {
  display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 0 var(--gutter) 20px; scrollbar-width: thin;
  scroll-padding-inline: var(--gutter); /* snapped cards keep the page gutter instead of touching the screen edge */
}
.round { flex: none; width: min(78vw, 340px); display: grid; gap: 16px; align-content: start; scroll-snap-align: start; }
.round__media { aspect-ratio: 4 / 5; }
.round__media img { width: 100%; height: 100%; object-fit: cover; }
.round__when { display: flex; justify-content: space-between; gap: 12px; padding-top: 12px; border-top: 2px solid var(--ink); color: var(--muted); text-transform: uppercase; }
.round__when span { color: var(--ink); }
.round__region { font-size: var(--step-3); font-weight: 860; font-stretch: 66%; text-transform: uppercase; line-height: 0.92; word-spacing: 0.14em; }
.round__host { display: flex; align-items: center; gap: 6px; font-weight: 620; }
.round__districts { color: var(--muted); font-size: var(--step--1); }
.round--final .round__when { border-color: var(--accent); }
.round--final .round__media { box-shadow: 0 0 0 4px var(--accent); }

/* Pinned by CSS sticky: overflow must stay visible on the section (hidden would make it the scroller).
   The sticky box clips the wide track instead. home.js sizes the section to one viewport plus the pan. */
.league.is-pinned { padding-block: 0; overflow: visible; }
.league.is-pinned .league__pin { position: sticky; top: 0; height: 100dvh; overflow: hidden; }
.league.is-pinned .league__track {
  display: flex; align-items: center; gap: clamp(40px, 5vw, 96px);
  width: max-content; height: 100dvh;
  padding: calc(var(--header-h) + 16px) var(--gutter) 32px;
  will-change: transform;
}
.league.is-pinned .league__intro { width: min(440px, 34vw); padding: 0; margin: 0; flex: none; }
.league.is-pinned .league__rounds { overflow: visible; padding: 0; gap: clamp(20px, 2.4vw, 40px); align-items: flex-start; }
.league.is-pinned .round { width: clamp(240px, min(23vw, 40vh), 360px); }
.league.is-pinned .round--low { margin-top: clamp(32px, 9vh, 110px); }

/* ------------------------------------------------------------------ programmes bento */
.bento { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(12px, 1.4vw, 20px); }
.bento__cell {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
  min-height: 300px; padding: clamp(22px, 2.4vw, 34px);
  border-radius: var(--radius);
  background: #1b1c19; color: var(--on-media);
}
.bento__cell::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgb(10 11 9 / 0) 30%, rgb(10 11 9 / 0.86) 100%); }
.bento__media { position: absolute; inset: 0; z-index: -2; border-radius: 0; }
.bento__media img { width: 100%; height: 100%; object-fit: cover; }
.bento__cell--1 { grid-column: 1 / 8; grid-row: span 2; min-height: 600px; }
.bento__cell--2 { grid-column: 8 / 13; }
.bento__cell--3 { grid-column: 8 / 13; }
.bento__cell--4 { grid-column: 1 / 6; }
.bento__cell--5 { grid-column: 6 / 13; }
.bento__cell--accent { background: var(--accent); color: var(--accent-ink); }
.bento__cell--accent::before { display: none; }
.bento__leaf { position: absolute; top: clamp(22px, 2.4vw, 34px); left: clamp(22px, 2.4vw, 34px); width: 64px; height: 64px; }
.bento__audience { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.82; }
.bento__title { margin-top: 8px; font-size: var(--step-3); font-weight: 860; font-stretch: 68%; text-transform: uppercase; line-height: 0.92; max-width: 16ch; word-spacing: 0.14em; }
.bento__cell--1 .bento__title { font-size: var(--step-4); }
.bento__summary { margin-top: 12px; max-width: 44ch; opacity: 0.88; }
.bento__go {
  position: absolute; top: 18px; right: 18px;
  display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%;
  background: rgb(244 244 240 / 0.16);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: background 0.35s, color 0.35s, transform 0.5s var(--ease-out);
}
.bento__cell:hover .bento__go { background: var(--accent); color: var(--accent-ink); transform: rotate(45deg); }
.bento__cell--accent .bento__go { background: rgb(18 19 17 / 0.1); }
.bento__cell--accent:hover .bento__go { background: var(--flag-black); color: var(--accent); }
.programmes__more { margin-top: 36px; }
@media (max-width: 1023px) {
  .bento { grid-template-columns: 1fr 1fr; }
  .bento__cell--1 { grid-column: 1 / -1; grid-row: auto; min-height: 460px; }
  .bento__cell--2, .bento__cell--3 { grid-column: auto; }
  .bento__cell--4, .bento__cell--5 { grid-column: 1 / -1; }
}
@media (max-width: 639px) {
  .bento { grid-template-columns: 1fr; }
  .bento__cell { grid-column: 1 / -1 !important; min-height: 360px; }
}

/* ------------------------------------------------------------------ upcoming events */
.upcoming__grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(32px, 5vw, 96px); align-items: start; }
.upcoming__head { position: sticky; top: calc(var(--header-h) + 32px); display: grid; gap: 28px; justify-items: start; }
@media (max-width: 899px) {
  .upcoming__grid { grid-template-columns: 1fr; }
  .upcoming__head { position: static; }
}

/* ------------------------------------------------------------------ climate */
.climate {
  --surface: #f4f4f0;
  position: relative; overflow: hidden; isolation: isolate;
  min-height: 100dvh; display: grid; align-content: end;
  background: #0d0e0c; color: var(--on-media);
}
.climate__media { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
.climate__media img { width: 100%; height: 100%; object-fit: cover; }
.climate__scrim { position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgb(10 11 9 / 0.6) 0%, rgb(10 11 9 / 0.38) 38%, rgb(10 11 9 / 0.9) 100%); }
.climate__content { display: grid; justify-items: start; gap: 26px; padding-top: var(--section); padding-bottom: clamp(44px, 6vw, 80px); }
.climate__content .h1 { max-width: 11ch; }
.climate .lead { color: rgb(244 244 240 / 0.86); max-width: 44ch; }
.climate__marquee { border-top: 1px solid rgb(244 244 240 / 0.22); padding-block: clamp(18px, 2.4vw, 30px); overflow: hidden; white-space: nowrap; }
.climate__track { display: inline-flex; align-items: center; gap: clamp(24px, 3vw, 48px); padding-right: clamp(24px, 3vw, 48px); will-change: transform; }
.climate__msg {
  font-size: clamp(2.25rem, 1rem + 4.4vw, 5.5rem);
  font-weight: 880; font-stretch: 64%; text-transform: uppercase; line-height: 1;
  color: transparent; -webkit-text-stroke: 1.5px rgb(244 244 240 / 0.92); word-spacing: 0.14em; }
.climate__msg:nth-of-type(even) { color: var(--accent); -webkit-text-stroke: 0; }
.climate__sep { --size: clamp(30px, 3vw, 46px); }

/* ------------------------------------------------------------------ match days gallery */
.match-days { overflow: hidden; }
.match-days__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: clamp(40px, 6vw, 80px); }
.match-days__cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(12px, 1.4vw, 20px); align-items: start; }
.match-days__col { display: grid; gap: clamp(12px, 1.4vw, 20px); }
.match-days__col[data-col="1"] { margin-top: clamp(40px, 9vw, 160px); }
.match-days__item:nth-child(3n + 1) { aspect-ratio: 4 / 5; }
.match-days__item:nth-child(3n + 2) { aspect-ratio: 4 / 3; }
.match-days__item:nth-child(3n) { aspect-ratio: 1; }
@media (max-width: 767px) {
  .match-days__cols { grid-template-columns: 1fr 1fr; }
  .match-days__col[data-col="2"] { display: none; }
  .match-days__col[data-col="1"] { margin-top: 48px; }
}

/* Championship film (YouTube facade) */
.film { margin: 0 0 clamp(20px, 2.5vw, 36px); }
.film__frame { display: block; width: 100%; aspect-ratio: 16 / 9; cursor: pointer; padding: 0; }
/* The YouTube thumbnail has black side bars baked in; scaling crops them away. */
.film__frame img { transform: scale(1.19); transition: transform 1.2s var(--ease-out), filter 0.6s; filter: saturate(0.9) brightness(0.82); }
.film__frame:hover img { transform: scale(1.23); filter: saturate(1) brightness(0.9); }
.film__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.film__play {
  position: absolute; left: 50%; top: 50%;
  display: grid; place-items: center;
  width: clamp(72px, 9vw, 120px); aspect-ratio: 1; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 0 rgb(255 205 0 / 0.5);
  transition: transform 0.5s var(--ease-out), box-shadow 0.6s;
}
.film__play .icon { width: 38%; height: 38%; margin-left: 6%; }
.film__frame:hover .film__play { transform: translate(-50%, -50%) scale(1.08); box-shadow: 0 0 0 18px rgb(255 205 0 / 0.18); }
.film__caption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; margin-top: 14px; color: var(--muted); font-size: var(--step--1); }
.film__caption strong { color: var(--ink); font-weight: 700; font-stretch: 88%; font-size: var(--step-0); }

/* ------------------------------------------------------------------ partner cta */
.partner-cta .cta-band { isolation: isolate; }
.partner-cta__rings {
  position: absolute; z-index: -1;
  right: -14%; top: 50%; width: min(760px, 80vw); aspect-ratio: 1; border-radius: 50%;
  transform: translateY(-50%);
  background: repeating-radial-gradient(circle at center, transparent 0 26px, rgb(18 19 17 / 0.16) 26px 28px);
  -webkit-mask: radial-gradient(circle, #000 60%, transparent 71%);
  mask: radial-gradient(circle, #000 60%, transparent 71%);
}
@media (max-width: 767px) { .partner-cta__rings { right: -55%; top: 85%; } }
