/* block, not swap: Safari paints the fallback first, and swapping it out visibly jumps the text. */
@font-face { font-family: Anton; src: url(/fonts/anton.woff2) format("woff2"); font-display: block; }
@font-face { font-family: "Barlow Condensed"; src: url(/fonts/barlow-condensed-500.woff2) format("woff2"); font-weight: 500; font-display: block; }
@font-face { font-family: "Barlow Condensed"; src: url(/fonts/barlow-condensed-700.woff2) format("woff2"); font-weight: 700; font-display: block; }
@font-face { font-family: Cairo; src: url(/fonts/cairo-700.woff2) format("woff2"); font-weight: 700; font-display: block; unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: Cairo; src: url(/fonts/cairo-900.woff2) format("woff2"); font-weight: 900; font-display: block; unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }

/* Colours sampled from the logo. Green and red fall under 4.5:1 on black, so they stay decorative. */
:root {
  color-scheme: dark;
  --black: #000;
  --white: #fff;
  --mute: #a6a6a6;
  --line: #2b2b2b;
  --green: #2f9e1e;
  --gold: #f5c518;
  --red: #e0170c;
  --flag: linear-gradient(90deg, var(--green), var(--gold) 50%, var(--red));
  --dw: 400; /* weight of display text: Anton only has one, the fallbacks below need their heaviest */
  --display: Anton, var(--script, Impact), "Arial Narrow", sans-serif;
  --ui: "Barlow Condensed", var(--script, "Arial Narrow"), sans-serif;
  font-synthesis: none; /* no fake bold on Anton when --dw is 900 */
  --gutter: clamp(16px, 4vw, 56px);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

/* Anton and Barlow only cover Latin. Other scripts use Cairo (only downloaded on Arabic pages) or the
   system's fonts, because Chinese, Japanese and Korean web fonts run to several megabytes each. */
:root:lang(ar) { --script: Cairo, "Geeza Pro", Tahoma; --dw: 900; }
:root:lang(zh) { --script: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC"; --dw: 900; }
:root:lang(ja) { --script: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans CJK JP"; --dw: 800; } /* 900 clogs dense kanji */
:root:lang(ko) { --script: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans CJK KR"; --dw: 900; }
:lang(ar) * { letter-spacing: 0 !important; } /* spacing breaks the joins between Arabic letters */
/* These scripts are far wider than Anton, and Arabic reaches well above and below the line. */
:is(:lang(ar), :lang(zh), :lang(ja), :lang(ko)) .title { font-size: clamp(2.75rem, 8vw, 7rem); line-height: 1.25; }
:lang(ar) :is(.title, .about-lead, .about-section h2, .event-name) { line-height: 1.45; }
:lang(ar) #nav:popover-open :is(a, summary) { line-height: 1.45; }
[dir="rtl"] .arrow path { transform: scaleX(-1); transform-origin: center; }
[dir="rtl"] .stripe, [dir="rtl"] #nav > a::after, [dir="rtl"] .sub > summary::after { transform-origin: right; }

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--black); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--black);
  color: var(--white);
  font: 500 1.25rem/1.5 var(--ui);
}
main { flex: 1; width: 100%; max-width: 1500px; margin-inline: auto; padding: clamp(16px, 3vw, 40px) var(--gutter) clamp(48px, 7vw, 96px); }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: var(--gutter); top: -100px; z-index: 30; padding: 10px 16px; background: var(--gold); color: var(--black); font-weight: 700; }
.skip:focus { top: 8px; }

/* Header */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  min-height: 72px;
  padding: 8px var(--gutter);
  background: var(--black);
}
.brand { display: flex; align-items: center; min-height: 44px; width: clamp(120px, 13vw, 176px); transition: transform .2s var(--ease); }
.brand:hover { transform: scale(1.04); }
.top-end { margin-inline-start: auto; display: flex; align-items: center; gap: clamp(12px, 2vw, 32px); }

#nav {
  display: flex; align-items: center; gap: clamp(14px, 2.2vw, 36px);
  position: static; inset: auto; width: auto; height: auto;
  margin: 0; padding: 0; border: 0; overflow: visible;
  background: none; color: inherit;
}
#nav > a, .sub > summary {
  position: relative; display: flex; align-items: center; min-height: 44px;
  font-weight: 700; font-size: 1.15rem; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
}
#nav > a::after, .sub > summary::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 6px; height: 3px;
  background: var(--flag);
  transform: scaleX(0); transform-origin: left;
  transition: transform .3s var(--ease);
}
#nav > a:hover::after, #nav > a[aria-current]::after, .sub > summary:hover::after, .sub > summary[aria-current]::after { transform: scaleX(1); }

/* Submenus: a dropdown on desktop, an accordion inside the phone menu */
.sub { position: relative; }
.sub > summary { gap: 8px; list-style: none; cursor: pointer; }
.sub > summary::-webkit-details-marker { display: none; }
.sub > summary::before {
  content: ""; order: 1; width: 8px; height: 8px; margin-top: -4px;
  border: solid currentColor; border-width: 0 2px 2px 0;
  transform: rotate(45deg); transition: transform .2s var(--ease), margin .2s var(--ease);
}
.sub[open] > summary::before { margin-top: 4px; transform: rotate(225deg); }
.sub > ul {
  position: absolute; top: 100%; inset-inline-start: -16px; z-index: 25;
  min-width: 240px; margin: 0; padding: 8px 0; list-style: none;
  background: var(--black); border: 1px solid var(--line);
}
.sub a {
  display: flex; align-items: center; min-height: 44px; padding: 6px 16px;
  font-weight: 700; font-size: 1.05rem; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap;
  transition: color .15s;
}
.sub a:hover, .sub a[aria-current] { color: var(--gold); }

.langs > summary { justify-content: center; min-width: 64px; padding: 0 12px; border: 1px solid var(--line); font-size: 1rem; transition: border-color .15s; }
.langs > summary:hover { border-color: var(--gold); }
.langs > summary::after { display: none; }
.langs > ul { inset-inline: auto 0; min-width: 170px; }

.menu-btn, .close-btn {
  display: none; min-height: 44px; padding: 0 14px;
  border: 1px solid var(--line); background: none; color: var(--white);
  font: 700 1rem var(--ui); letter-spacing: .08em; text-transform: uppercase; cursor: pointer;
}

@media (max-width: 860px) {
  .menu-btn { display: block; }
  /* Full-screen menu using the native popover, so it works without any JavaScript. */
  #nav:not(:popover-open) { display: none; }
  #nav:popover-open {
    position: fixed; inset: 0; width: 100%; height: 100%;
    flex-direction: column; align-items: flex-start; justify-content: center; justify-content: safe center; gap: 8px;
    padding: var(--gutter); background: var(--black); overflow-y: auto;
  }
  #nav:popover-open > a, #nav:popover-open .sub > summary { font: var(--dw) clamp(2.75rem, 13vw, 4.5rem)/1.15 var(--display); letter-spacing: .01em; white-space: normal; }
  #nav:popover-open > a::after, #nav:popover-open .sub > summary::after { bottom: 0; height: 5px; }
  #nav:popover-open .sub > summary { gap: 16px; }
  #nav:popover-open .sub > summary::before { width: 14px; height: 14px; border-width: 0 4px 4px 0; }
  #nav:popover-open .sub > ul { position: static; min-width: 0; padding: 8px 0 12px; background: none; border: 0; }
  #nav:popover-open .sub a { padding-inline: 0; font-size: 1.4rem; white-space: normal; }
  .close-btn { display: block; position: absolute; top: 14px; inset-inline-end: var(--gutter); }
}
@supports not selector(:popover-open) {
  .menu-btn, .close-btn { display: none; }
  #nav:not(:popover-open) { display: flex; flex-wrap: wrap; }
}

/* Shared pieces */
.title {
  margin: 0;
  font: var(--dw) clamp(3.5rem, 12.5vw, 10.5rem)/1.12 var(--display); /* room for accents when it wraps */
  letter-spacing: .005em; text-transform: uppercase; text-wrap: balance;
}
.stripe {
  height: 6px; width: min(100%, 420px);
  margin: clamp(14px, 2vw, 24px) 0 clamp(28px, 4.5vw, 64px);
  background: var(--flag);
  transform-origin: left;
}
.suffix-img { display: inline-block; width: auto; height: 1.15em; vertical-align: -.16em; }

.tag {
  display: inline-block; align-self: flex-start;
  padding: 3px 12px;
  border: 1px solid var(--line);
  color: var(--mute);
  font-weight: 700; font-size: 1rem; letter-spacing: .1em; text-transform: uppercase;
  transform: skewX(-10deg);
}
.tag--next { border-color: var(--gold); background: var(--gold); color: var(--black); }

.btn {
  display: inline-flex; align-items: center; gap: 14px; align-self: flex-start;
  min-height: 56px; padding: 10px 30px;
  background: var(--gold); color: var(--black);
  font-weight: 700; font-size: 1.3rem; letter-spacing: .06em; text-transform: uppercase;
  clip-path: polygon(14px 0, 100% 0, calc(100% - 14px) 100%, 0 100%);
  transition: background-color .2s, transform .2s var(--ease);
}
.btn .arrow { transition: transform .2s var(--ease); }
a.btn:hover { background: var(--white); transform: translateX(4px); }
a.btn:hover .arrow { transform: translateX(6px); }
a.btn:active { transform: scale(.98); }
a.btn:focus-visible { clip-path: none; }

/* Posters: a real image, or a placeholder drawn at any size from the card's own width */
.poster { position: relative; aspect-ratio: 1; background: var(--black); overflow: hidden; container-type: inline-size; }
.poster > img, .poster > video { width: 100%; height: 100%; object-fit: contain; }
.poster > video { position: absolute; inset: 0; }
.card video { pointer-events: none; } /* clicks on the list go to the card's link */
.still:checked ~ video { display: none; }
.still-btn {
  position: absolute; inset-inline-end: 8px; bottom: 8px;
  display: grid; place-items: center; width: 44px; height: 44px;
  border: 1px solid var(--line); background: rgba(0, 0, 0, .7); cursor: pointer;
  transition: border-color .15s;
}
.still-btn:hover { border-color: var(--gold); }
.still-btn::before { content: ""; width: 12px; height: 14px; border-inline: 4px solid var(--white); }
.still:checked ~ .still-btn::before { width: 0; height: 0; border: solid transparent; border-width: 7px 0 7px 12px; border-left-color: var(--white); }
.still:focus-visible ~ .still-btn { outline: 3px solid var(--gold); outline-offset: 3px; }
/* The still underneath takes over. */
@media (prefers-reduced-motion: reduce) { .poster > video, .still-btn { display: none; } }
.ph {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 5cqw;
  border: 1px solid var(--line);
  text-align: center;
}
.ph img { width: 46cqw; }
.ph .num-img { width: auto; height: 60cqw; transition: transform .35s var(--ease); }
.ph .num {
  font: var(--dw) 60cqw/1 var(--display);
  background: var(--flag); -webkit-background-clip: text; background-clip: text; color: transparent;
  /* Speckled noise so the numeral sits closer to the logo's worn letters. */
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='320'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 -9 6.3'/%3E%3C/filter%3E%3Crect width='320' height='320' filter='url(%23n)'/%3E%3C/svg%3E");
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='320'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 -9 6.3'/%3E%3C/filter%3E%3Crect width='320' height='320' filter='url(%23n)'/%3E%3C/svg%3E");
  transition: transform .35s var(--ease);
}
.ph span { font-weight: 700; font-size: clamp(.75rem, 6cqw, 1.5rem); letter-spacing: .08em; white-space: nowrap; text-transform: uppercase; color: var(--mute); }

/* Events list: the next event runs tall on the left, the title sits above the past ones */
.events { display: grid; grid-template-columns: 1.45fr 1fr 1fr; grid-template-rows: 1fr auto; gap: clamp(16px, 2.6vw, 40px); align-items: end; }
.events-head { grid-column: 2 / -1; grid-row: 1; align-self: start; container-type: inline-size; }
.events-head .title { font-size: min(10.5rem, 20cqw); } /* sized to its column, so long words like ÉVÉNEMENTS fit */
:is(:lang(ar), :lang(zh), :lang(ja), :lang(ko)) .events-head .title { font-size: min(7rem, 20cqw); }
.events-head .stripe { margin-bottom: 0; }
.card--next { grid-column: 1; grid-row: 1 / 3; }
.card { display: block; }
.card .poster { transition: transform .3s var(--ease), box-shadow .3s; }
.card:hover .poster { transform: translateY(-6px); box-shadow: 0 10px 0 -6px var(--gold); }
.card:hover .num, .card:hover .num-img { transform: scale(1.05) rotate(-2deg); }
.card:active .poster { transform: translateY(-2px); }
.card-meta { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.card-name { font: var(--dw) clamp(1.6rem, 2.8vw, 2.4rem)/1.1 var(--display); text-transform: uppercase; }
.card--next .card-name { font-size: clamp(2.2rem, 4.2vw, 3.75rem); }
@media (max-width: 720px) {
  .events { grid-template-columns: 1fr 1fr; grid-template-rows: none; }
  .events-head, .card--next { grid-column: 1 / -1; grid-row: auto; }
  .card .tag { font-size: .875rem; }
}

/* Event page */
.event { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); gap: clamp(28px, 6vw, 96px); align-items: center; }
.event .poster { width: min(46vw, 100dvh - 150px); }
.event .poster--tall { aspect-ratio: 9 / 16; width: calc(min(46vw, 100dvh - 150px) * 9 / 16); }
/* 16:9, the usual YouTube shape. A vertical recap would need 9 / 16 here. */
.recap { position: relative; width: min(46vw, 760px); aspect-ratio: 16 / 9; background: var(--black); }
.recap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.event-info { display: flex; flex-direction: column; gap: clamp(18px, 2.4vw, 30px); }
.event-name { margin: 0; font: var(--dw) clamp(3.5rem, 8vw, 8rem)/1.02 var(--display); text-transform: uppercase; text-wrap: balance; }
.facts { display: flex; flex-wrap: wrap; gap: 16px clamp(32px, 5vw, 72px); margin: 0; }
.facts dt { color: var(--mute); font-size: 1rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.facts dd { margin: 0; font-size: clamp(1.5rem, 2.4vw, 2rem); font-weight: 700; line-height: 1.2; text-transform: uppercase; }
.facts a { text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: .18em; transition: color .15s; }
.facts a:hover { color: var(--gold); }
.back {
  display: inline-flex; align-items: center; gap: 10px; align-self: flex-start;
  min-height: 48px; padding: 0 18px 0 14px;
  border: 1px solid var(--line);
  font-size: 1.05rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  transition: border-color .15s, color .15s;
}
.back .arrow { width: 20px; height: 20px; transform: rotate(180deg); transition: transform .2s var(--ease); }
.back:hover { border-color: var(--gold); color: var(--gold); }
.back:hover .arrow { transform: rotate(180deg) translateX(4px); }
@media (max-width: 720px) {
  .event { grid-template-columns: 1fr; }
  .event .poster, .event .poster--tall { width: min(100%, 420px); }
  .event .recap { width: 100%; }
}

/* About */
.about-lead { font: var(--dw) clamp(1.9rem, 3.6vw, 3.25rem)/1.18 var(--display); text-transform: uppercase; text-wrap: balance; }
.about-body { display: flex; flex-direction: column; gap: 20px; font-size: clamp(1.3rem, 1.9vw, 1.6rem); line-height: 1.4; max-width: 34em; }
.about-body .btn { margin-top: 12px; }
.about-section { scroll-margin-top: 88px; }
.about-section + .about-section { margin-top: clamp(48px, 7vw, 96px); }
.about-section h2 { margin: 0 0 clamp(14px, 2vw, 24px); font: var(--dw) clamp(2.25rem, 5vw, 4.5rem)/1.05 var(--display); text-transform: uppercase; }
.about-soon { padding: clamp(24px, 4vw, 48px); border: 1px dashed var(--line); color: var(--mute); font-size: clamp(1.15rem, 1.7vw, 1.4rem); text-align: center; }

/* Social */
.social-note { max-width: 40em; margin: 0 0 clamp(20px, 3vw, 40px); font-size: clamp(1.3rem, 1.9vw, 1.6rem); line-height: 1.4; }
.socials { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.socials li { border-bottom: 1px solid var(--line); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: clamp(10px, 1.6vw, 22px) 0; }
.row-name {
  font: var(--dw) clamp(2.5rem, 8vw, 6.5rem)/1.1 var(--display); text-transform: uppercase;
  /* Two layers so the flag colours can sweep across the white text on hover. */
  background-image: var(--flag), linear-gradient(var(--white), var(--white));
  background-size: 0 100%, 100% 100%;
  background-repeat: no-repeat;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  transition: background-size .45s var(--ease);
}
.row .arrow { width: clamp(28px, 5vw, 64px); height: auto; flex: none; transition: transform .3s var(--ease); }
a.row:hover .row-name { background-size: 100% 100%, 100% 100%; }
a.row:hover .arrow { transform: translateX(8px); }
.row--off .row-name { background-image: none; color: #767676; }
.row .tag { flex: none; margin-inline-end: 4px; } /* the skew pokes past the box */

/* Sponsors: a quiet strip above the footer, on every page but the home page */
.sponsors, .foot { width: 100%; max-width: 1500px; margin-inline: auto; }
.sponsors { padding: 0 var(--gutter); }
.sponsors h2 {
  margin: 0 0 14px; padding-top: clamp(18px, 2vw, 26px);
  border-top: 1px solid var(--line);
  color: var(--mute);
  font-size: 1rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
}
.sponsors ul { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(12px, 2vw, 24px); list-style: none; margin: 0; padding: 0; }
@media (max-width: 560px) {
  .sponsors ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sponsors ul:has(> :nth-child(3):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); } /* three sponsors: one row, no orphan */
}
.slot { position: relative; display: grid; place-items: center; aspect-ratio: 1; border: 1px solid var(--line); transition: border-color .15s; }
.slot--empty { border-style: dashed; color: #767676; font-size: .95rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.slot a { position: absolute; inset: 0; }
/* Positioned, because percentage heights inside an aspect-ratio box aren't reliable across browsers. */
.slot img { position: absolute; inset: 8px; width: calc(100% - 16px); height: calc(100% - 16px); object-fit: contain; }
.slot:has(a:hover) { border-color: var(--gold); }

.foot { padding: 20px var(--gutter); color: var(--mute); font-size: 1rem; letter-spacing: .04em; }

/* Home: the logo and nothing else */
/* The empty rows keep the logo and countdown centred while the sponsors sit at the very bottom. */
.home main { display: grid; grid-template-rows: 1fr auto auto 1fr auto; place-items: center; row-gap: clamp(10px, 2.2vh, 26px); padding-block: 0 clamp(12px, 2.2vh, 24px); overflow: hidden; }
.logo { grid-row: 2; }
.countdown { grid-row: 3; }
/* With a poster instead of the logo, the poster takes whatever height the countdown and sponsors leave. */
.home:has(.hero) { height: 100dvh; } /* a fixed height, so the poster's row can shrink instead of growing to the image */
.backdrop { display: none; position: fixed; inset: 0; z-index: 0; background: center top / cover no-repeat; }
.home:has(.backdrop) .top { background: transparent; }
/* On upright screens the poster's own shape almost fits, so the poster itself fills the screen, sharp, with its logo up
   behind the menu. The script in homePage sizes it so its 3 ends just above the countdown, and darkens from there down.
   Wider screens show the poster on plain black, since filling them would crop the faces. */
@media (max-aspect-ratio: 4/5) {
  .backdrop { display: block; }
  .backdrop::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent calc(var(--fade, 75%) - 120px), rgba(0, 0, 0, .88) calc(var(--fade, 75%) + 30px)); }
  .hero img { opacity: 0; } /* kept for screen readers and to hold the space above the countdown */
  .hero { justify-self: stretch; }
  .hero > a { width: 100%; } /* the poster here fills the screen, so the whole area above the countdown opens the event */
  .home .top :is(.menu-btn, .langs > summary) { background: rgba(0, 0, 0, .55); } /* readable over the logo */
}
.home main:has(.hero) { grid-template-rows: minmax(0, 1fr) auto auto; min-height: 0; padding-top: clamp(8px, 2vh, 24px); }
.hero { grid-row: 1; position: relative; z-index: 1; display: flex; justify-content: center; height: 100%; min-height: 0; margin: 0; }
.hero > a { display: flex; justify-content: center; height: 100%; }
.hero img { width: auto; max-width: 100%; height: 100%; object-fit: contain; transition: scale .3s var(--ease); }
.hero > a:hover img { scale: 1.02; } /* scale, not transform, so the entrance animation doesn't override it */
.home main:has(.hero) .countdown { grid-row: 2; }
.home main:has(.hero) .home-sponsors { grid-row: 3; }
.home-sponsors { grid-row: 5; position: relative; z-index: 1; display: flex; justify-content: center; gap: clamp(12px, 2vw, 24px); list-style: none; margin: 0; padding: 0; }
.home-sponsors li { width: clamp(52px, 7.4vh, 76px); aspect-ratio: 1; }
.home-sponsors a { display: block; height: 100%; }
.home-sponsors img { width: 100%; height: 100%; object-fit: contain; transition: transform .2s var(--ease); }
.home-sponsors a:hover img { transform: scale(1.08); }
.countdown { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: clamp(10px, 1.6vh, 16px); width: min(100%, 640px); }
.cd-info { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px 16px; text-align: center; }
.cd-info time { font-weight: 700; font-size: clamp(1.15rem, 2vw, 1.6rem); letter-spacing: .06em; text-transform: uppercase; }
.cd-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(8px, 1.4vw, 16px); width: 100%; }
.cd-grid[hidden] { display: none; }
.cd-grid > span { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: clamp(8px, min(1.6vw, 1.6vh), 18px) 4px; border: 1px solid rgba(255, 255, 255, .14); background: rgba(0, 0, 0, .6); transition: border-color .15s; }
.countdown:hover .cd-grid > span { border-color: var(--gold); }
.cd-grid b { font: var(--dw) clamp(2.25rem, min(5.4vw, 6.5vh), 4.25rem)/1 var(--display); /* height-aware too, so short laptops leave room for the poster */ font-variant-numeric: tabular-nums; }
.cd-grid small { color: var(--mute); font-size: clamp(.8rem, 1.2vw, 1rem); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
@media (max-height: 480px) {
  .home main { padding-block-end: 6px; row-gap: 4px; }
  .countdown { gap: 2px; width: min(100%, 420px); }
  .home-sponsors li { width: 44px; }
  .cd-grid > span { padding-block: 4px; }
  .cd-grid b { font-size: 1.75rem; }
}
.logo { position: relative; margin: 0; z-index: 1; }
/* Black backdrop because .art is its own blending group, and the glint needs black to blend against. */
/* The height limit keeps the countdown on screen on short windows and phones held sideways. */
.art { position: relative; display: block; width: min(92vw, 1180px, 110dvh); aspect-ratio: 750 / 241; background: var(--black); }
.l, .f, .glow, .flash, .glint, .sparks { position: absolute; inset: 0; display: block; }
.l {
  background: url(/img/portugal.webp) center / 100% 100% no-repeat;
  clip-path: inset(0 var(--to) 0 var(--from));
  transform-origin: var(--c) 40%;
}
.f { background: url(/img/fight.webp) center / 100% 100% no-repeat; transform-origin: 50% 72%; }
.glow, .flash, .glint, .sparks, .embers { pointer-events: none; }
/* Screen so it lights the opaque logo layers from above instead of hiding behind them. */
.glow { inset: 25% 12% -25%; background: radial-gradient(closest-side, rgba(245, 197, 24, .18), transparent); mix-blend-mode: screen; opacity: 0; }
.flash { inset: -50% -10%; background: radial-gradient(closest-side, rgba(255, 226, 120, .85), transparent 70%); opacity: 0; }
.sparks { left: 50%; top: 72%; right: auto; bottom: auto; }
.sparks i, .embers i { position: absolute; display: block; }
.sparks i { width: var(--w); height: 2px; background: linear-gradient(90deg, #fff, var(--gold)); opacity: 0; }
.embers { position: fixed; inset: 0; z-index: 2; overflow: hidden; }
.embers i { left: var(--x); bottom: 0; width: var(--s); height: var(--s); border-radius: 50%; background: var(--gold); opacity: 0; }
.embers i:nth-child(3n) { background: var(--red); }
.embers i:nth-child(5n) { background: var(--green); }
/* overlay leaves black untouched, so the glint only catches the letters. */
.glint { overflow: hidden; mix-blend-mode: overlay; opacity: 0; }
.glint::before {
  content: ""; position: absolute; top: -20%; bottom: -20%; left: -30%; width: 22%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .8), transparent);
}

/* Everything that moves. Without this block the site renders its final, still state. */
@media (prefers-reduced-motion: no-preference) {
  /* No @view-transition: Safari holds its toolbar on the wrong shade until one ends, which reads as a flicker. */
  .rise { animation: rise .55s var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms); }
  .stripe { animation: draw .7s var(--ease) .1s both; }
  .countdown { animation: rise .6s var(--ease) 1.35s both; } /* arrives once the logo has landed */
  .home-sponsors { animation: rise .6s var(--ease) 1.6s both; }
  .hero img { animation: rise .7s var(--ease) .1s both; }
  .home main:has(.hero) .countdown { animation-delay: .35s; }
  .home main:has(.hero) .home-sponsors { animation-delay: .55s; }
  /* Waits for the menu font, or the line shows at the wrong width and then jumps. */
  #nav > a[aria-current]::after, .sub > summary[aria-current]::after { animation: draw .4s var(--ease) .25s both; }
  #nav:popover-open > a, #nav:popover-open > .sub { animation: rise .4s var(--ease) both; animation-delay: calc(var(--i) * 55ms + 40ms); }
  .sub[open] > ul { animation: rise .22s var(--ease) both; }

  .l { animation: slam .42s var(--ease) both; animation-delay: calc(var(--i) * 65ms + 150ms); }
  .f { animation: fight .5s cubic-bezier(.3, 0, .2, 1) .86s both; }
  .art { animation: shake .4s linear 1.12s; }
  .flash { animation: flash .6s ease-out 1.1s; }
  .sparks i { animation: spark .75s var(--ease) 1.12s; }
  .glow { animation: breathe 4.5s ease-in-out 1.5s infinite; }
  .glint { opacity: 1; }
  .glint::before { animation: glint 7s ease-in-out 2.4s infinite; }
  .embers i { animation: ember var(--t) linear var(--d) infinite; }
  .embers { animation: appear 1s ease-out 1.1s both; }

  @keyframes rise { from { opacity: 0; transform: translateY(18px); } }
  @keyframes draw { from { transform: scaleX(0); } }
  @keyframes appear { from { opacity: 0; } }
  @keyframes slam {
    0% { opacity: 0; transform: translateY(-16%) scale(1.3); }
    55% { opacity: 1; transform: translateY(0) scale(1); }
    72% { transform: translateY(1.4%) scale(.985); }
    100% { transform: none; }
  }
  @keyframes fight {
    0% { opacity: 0; transform: scale(2.8) rotate(-5deg); }
    52% { opacity: 1; transform: scale(.95) rotate(0); }
    72% { transform: scale(1.03); }
    100% { transform: none; }
  }
  @keyframes shake {
    0%, 100% { transform: none; }
    15% { transform: translate(-1.1%, .9%); }
    35% { transform: translate(.9%, -.7%); }
    55% { transform: translate(-.6%, .4%); }
    75% { transform: translate(.3%, -.2%); }
  }
  @keyframes flash { 0% { opacity: 0; } 15% { opacity: 1; } 100% { opacity: 0; } }
  @keyframes spark {
    0% { opacity: 1; transform: rotate(var(--a)) translateX(4vmin) scaleX(1.6); }
    100% { opacity: 0; transform: rotate(var(--a)) translateX(var(--r)) scaleX(.3); }
  }
  @keyframes breathe { 50% { opacity: 1; } }
  @keyframes glint { 0% { transform: translateX(0); } 22%, 100% { transform: translateX(650%); } }
  @keyframes ember {
    0% { opacity: 0; transform: translate(0, 4vh); }
    12% { opacity: .75; }
    70% { opacity: .35; }
    100% { opacity: 0; transform: translate(var(--dx), -100vh); }
  }
}
