/*
 * playsocceratlas.com's scroll film. Loaded after the site's own styles.css, whose
 * tokens, type, cards and buttons it uses as they are.
 *
 * Two pages in one: with html.film (set by boot.js) the beats are panels over
 * a sticky canvas; without it (no script, reduced motion, no AVIF) they are a
 * plain column of stills and words.
 */

/* ---------------------------------------------------------- the film */
/* The film is a <section>: none of the site's section padding. */
.film { padding-block: 0; }
/* Over the film the header is solid paper: a backdrop blur over a picture that
   changes every frame is re-blurred every frame, and that was much of the jank. */
html.film .top { position: fixed; top: 0; left: 0; right: 0; padding-top: env(safe-area-inset-top, 0px); background: color-mix(in srgb, var(--paper) 96%, transparent); -webkit-backdrop-filter: none; backdrop-filter: none; }
html.film main > section:not(.film) { scroll-margin-top: 72px; }
html.film .film { position: relative; height: 1055vh; background: #0b1a2e; }
html.film .film-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  background: #0b1a2e url('frames/d/000.avif') center / cover no-repeat;
}
@media (orientation: portrait) {
  html.film .film-stage { background-image: url('frames/p/000.avif'); }
}
html.film .film-canvas,
html.film .film-flags { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
html.film .film-beats { position: absolute; left: 0; right: 0; top: 0; height: 100vh; height: 100svh; pointer-events: none; }
html.film .beat {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 88px clamp(16px, 4vw, 56px) max(clamp(16px, 4vh, 48px), env(safe-area-inset-bottom));
  opacity: 0;
  visibility: hidden;
  will-change: opacity, transform;
}
html.film .beat-1 { opacity: 1; visibility: visible; }
html.film .beat-still,
html.film .flag-row { display: none; }
html.film .beat-words { position: relative; pointer-events: auto; width: 100%; }
html.film .beat .card { box-shadow: var(--shadow); }

/* A soft shade behind the words, where they sit on the picture. */
html.film .beat::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to top, rgba(8, 14, 24, 0.5), rgba(8, 14, 24, 0) 45%);
}

/* Beat 1: the site's hero card, on the picture. */
html.film .beat-1 { align-items: center; }
html.film .beat-1::before { background: linear-gradient(to right, rgba(8, 14, 24, 0.42), rgba(8, 14, 24, 0) 55%); }
html.film .beat-1 .hero-card {
  margin: 0;
  max-width: 540px;
  padding: 28px 30px 26px;
  text-align: left;
  justify-items: start;
  gap: 16px;
  background: color-mix(in srgb, var(--paper) 96%, transparent);
  border: 2px solid var(--edge);
  border-bottom-width: 6px;
  border-radius: 28px;
  box-shadow: var(--shadow);
}
html.film .beat-1 .hero-card h1 { font-size: clamp(2.2rem, 4.2vw, 3.4rem); }
html.film .beat-1 .hero-card .ctas,
html.film .beat-1 .hero-card .chips { justify-content: flex-start; }

/* Beats 2, 4 and 5: one card each. */
html.film .beat-2 .beat-words,
html.film .beat-4 .beat-words,
html.film .beat-5 .beat-words { max-width: 380px; }

/* Beat 3: the three games. */
html.film .beat-3 { justify-content: center; }
html.film .beat-3 .beat-words {
  max-width: 1040px;
  padding: 22px 22px 20px;
  background: color-mix(in srgb, var(--paper) 96%, transparent);
  border: 2px solid var(--edge);
  border-bottom-width: 6px;
  border-radius: 28px;
  box-shadow: var(--shadow);
}
html.film .beat-3 .head { margin-bottom: 16px; gap: 6px; }
html.film .beat-3 .head h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
html.film .beat-3 .card { box-shadow: none; padding: 16px 18px; gap: 6px; }
html.film .beat-3 .badge { width: 44px; height: 44px; font-size: 1.45rem; border-radius: 14px; }

/* Beat 6: the goal. */
html.film .beat-6 { align-items: center; }
html.film .beat-6::before { background: linear-gradient(to right, rgba(8, 14, 24, 0.55), rgba(8, 14, 24, 0) 60%); }
html.film .beat-6 .beat-words { max-width: 460px; display: grid; gap: 16px; }
.goal { font-family: var(--font-display); font-weight: 700; line-height: 1; margin: 0; }
html.film .goal { color: #fff; font-size: clamp(3.2rem, 9vw, 6.5rem); text-shadow: 0 4px 28px rgba(0, 0, 0, 0.5), 0 2px 4px rgba(0, 0, 0, 0.35); }
html.film .beat-6 .rule { background: var(--paper); box-shadow: var(--shadow); }

/* Phones and anything upright: every beat at the bottom, full width, tighter. */
@media (orientation: portrait) {
  html.film .beat { justify-content: center; padding: 76px 16px max(16px, env(safe-area-inset-bottom)); }
  html.film .beat-1,
  html.film .beat-6 { align-items: flex-end; }
  html.film .beat-1::before,
  html.film .beat-6::before { background: linear-gradient(to top, rgba(8, 14, 24, 0.55), rgba(8, 14, 24, 0) 55%); }
  html.film .beat-words,
  html.film .beat-2 .beat-words,
  html.film .beat-4 .beat-words,
  html.film .beat-5 .beat-words,
  html.film .beat-6 .beat-words { max-width: 560px; }
  html.film .beat-1 .hero-card { padding: 20px 18px 18px; gap: 12px; text-align: left; }
  html.film .beat-1 .hero-card h1 { font-size: clamp(1.9rem, 8.4vw, 2.6rem); }
  html.film .beat-1 .hero-card .lead { font-size: 1rem; }
  html.film .beat-1 .hero-card .btn-soon { min-height: 46px; min-width: 0; padding: 6px 14px; }
  html.film .beat-1 .hero-card .chips li { font-size: 0.8rem; padding: 4px 10px; }
  html.film .beat .card { padding: 16px 16px 14px; }
  html.film .beat-3 .beat-words { padding: 16px 14px 14px; border-radius: 24px; }
  html.film .beat-3 .head { margin-bottom: 10px; }
  html.film .beat-3 .head h2 { font-size: 1.45rem; }
  html.film .beat-3 .head .lead { font-size: 1rem; }
  html.film .beat-3 .cards { gap: 8px; grid-template-columns: 1fr; }
  html.film .beat-3 .card { grid-template-columns: 40px 1fr; column-gap: 12px; row-gap: 2px; padding: 10px 12px; border-bottom-width: 4px; border-radius: 16px; }
  html.film .beat-3 .card .badge { grid-row: span 2; width: 40px; height: 40px; font-size: 1.25rem; border-radius: 12px; }
  html.film .beat-3 .card h3 { font-size: 1.05rem; }
  html.film .beat-3 .card p { font-size: 0.92rem; line-height: 1.4; }
  html.film .goal { font-size: clamp(3rem, 16vw, 5rem); }
}
/* A short landscape window (a phone on its side): smaller words. */
@media (orientation: landscape) and (max-height: 560px) {
  html.film .beat { padding-top: 72px; }
  html.film .beat-1 .hero-card { padding: 16px 18px; gap: 10px; max-width: 480px; }
  html.film .beat-1 .hero-card .lead,
  html.film .beat-1 .hero-card .chips { display: none; }
  html.film .beat-3 .head .lead,
  html.film .beat-3 .card p { display: none; }
}

/* ----------------------------------------------------- the still page */
html:not(.film) .film-canvas,
html:not(.film) .film-flags { display: none; }
html:not(.film) .film-beats {
  display: grid;
  gap: clamp(48px, 8vw, 88px);
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding: clamp(24px, 4vw, 40px) 16px clamp(44px, 8vw, 88px);
}
@media (min-width: 720px) { html:not(.film) .film-beats { padding-inline: 24px; } }
html:not(.film) .beat { display: grid; justify-items: center; gap: 20px; }
html:not(.film) .beat::before { content: none; }
html:not(.film) .beat-still {
  width: 100%;
  max-width: 980px;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 28px;
  border: 2px solid var(--edge);
  border-bottom-width: 6px;
  box-shadow: var(--shadow);
  background: #0b1a2e;
}
html:not(.film) .beat-words { width: 100%; max-width: 760px; }
html:not(.film) .beat-2 .beat-words,
html:not(.film) .beat-4 .beat-words,
html:not(.film) .beat-5 .beat-words { max-width: 460px; }
html:not(.film) .beat-1 .hero-card { margin-top: -84px; }
html:not(.film) .beat-6 .beat-words { display: grid; gap: 16px; justify-items: center; text-align: center; max-width: 560px; }
html:not(.film) .goal { font-size: clamp(2.6rem, 8vw, 4.4rem); color: var(--ink); }
html:not(.film) .beat-6 .rule { text-align: left; }
@media (min-width: 1100px) {
  /* As the site's hero on a laptop: the words beside the picture. */
  html:not(.film) .beat-1 { grid-template-columns: 1fr 1.05fr; align-items: center; gap: 48px; }
  html:not(.film) .beat-1 .beat-still { order: 2; }
  html:not(.film) .beat-1 .hero-card { margin-top: 0; }
}
.flag-row { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(8px, 2vw, 16px); }
.flag-row img {
  width: clamp(48px, 11vw, 92px);
  height: auto;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(20, 28, 36, 0.18), 0 0 0 1px rgba(20, 28, 36, 0.08);
}
