:root {
  --ink: #17110f;
  --black: #050505;
  --paper: #f7f0df;
  --grass: #72f052;
  --yellow: #ffe348;
  --red: #ff4f32;
  --blue: #3155ff;
  --purple: #8f4be8;
  --serif: Georgia, "Times New Roman", serif;
  --sans: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 280px;
  scroll-behavior: smooth;
  background: var(--ink);
}

body {
  min-width: 280px;
  margin: 0;
  overflow-x: hidden;
  color: var(--paper);
  background: var(--ink);
  font-family: var(--serif);
}

a,
button,
select,
textarea {
  color: inherit;
  font: inherit;
}

a:focus-visible,
button:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 14px;
  color: var(--ink);
  background: var(--yellow);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.notes-header {
  position: absolute;
  top: 0;
  right: 30px;
  left: 30px;
  z-index: 20;
  min-height: 58px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid rgba(247, 240, 223, 0.35);
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.notes-header a {
  justify-self: start;
  text-decoration: none;
}

.notes-header span:last-child {
  justify-self: end;
}

.notes-hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 90px 24px 80px;
  overflow: hidden;
  text-align: center;
}

.notes-hero::before {
  position: absolute;
  top: 78px;
  right: 30px;
  bottom: 28px;
  left: 30px;
  border: 1px solid rgba(247, 240, 223, 0.16);
  content: "";
  pointer-events: none;
}

.hero-ball {
  position: absolute;
  top: 6%;
  left: 53%;
  z-index: 2;
  width: clamp(84px, 9vw, 124px);
  height: clamp(84px, 9vw, 124px);
  max-width: 124px;
  max-height: 124px;
  aspect-ratio: 1;
  display: block;
  overflow: visible;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  filter: drop-shadow(0 12px 0 rgba(5, 5, 5, 0.18));
  transform: translate(-50%, -50%) rotate(-8deg);
  transform-origin: 50% 50%;
  will-change: top, left, transform;
  animation: none;
}

.hero-ball img {
  width: 100% !important;
  height: 100% !important;
  display: block;
  object-fit: contain;
}

.hero-date,
.hero-cue,
.step-kicker,
.later-heading > p {
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.hero-date {
  margin: 24px 0 18px;
  color: var(--grass);
}

h1 {
  position: relative;
  z-index: 3;
  margin: 0;
  margin-top: 58px;
  font-size: clamp(54px, 7vw, 100px);
  font-weight: 400;
  line-height: 0.86;
  letter-spacing: 0;
}

h1 span {
  display: block;
}

h1 span:nth-child(2) {
  color: var(--grass);
  font-style: italic;
}

h1 span:last-child {
  color: var(--yellow);
  font-family: var(--sans);
  font-size: 0.72em;
  font-weight: 900;
}

.hero-deck {
  margin: 24px 0 0;
  color: #bdb4a9;
  font-size: clamp(16px, 1.5vw, 21px);
  line-height: 1.25;
}

.hero-scoreboard {
  width: min(760px, calc(100% - 32px));
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  margin-top: 30px;
  color: var(--paper);
  background: rgba(247, 240, 223, 0.22);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
  text-align: left;
  text-transform: uppercase;
}

.hero-scoreboard span {
  padding: 11px 13px;
  background: var(--black);
}

.hero-scoreboard b {
  margin-right: 10px;
  color: var(--grass);
}

.hero-cue {
  position: absolute;
  bottom: 30px;
  display: flex;
  gap: 30px;
  align-items: center;
  padding: 13px 17px;
  color: var(--paper);
  background: var(--black);
  text-decoration: none;
}

.hero-cue span {
  color: var(--grass);
  font-size: 18px;
}

.story {
  position: relative;
  min-height: 868svh;
  color: var(--paper);
  background: var(--black);
}

.sticky-visual {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 100svh;
  overflow: hidden;
  background: var(--ink);
  transition: background-color 500ms ease;
}

body[data-scene="teams"] .sticky-visual {
  background: #211126;
}

body[data-scene="cities"] .sticky-visual {
  background: var(--paper);
}

body[data-scene="matches"] .sticky-visual {
  background: var(--grass);
}

body[data-scene="thirtytwo"] .sticky-visual {
  background: var(--yellow);
}

body[data-scene="eight"] .sticky-visual {
  background: var(--red);
}

body[data-scene="oneleft"] .sticky-visual {
  background: var(--blue);
}

body[data-scene="champion"] .sticky-visual {
  background: #164c38;
}

.scorebug {
  position: absolute;
  top: 28px;
  right: 30px;
  left: 30px;
  z-index: 8;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  color: var(--paper);
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  transition: color 350ms ease;
}

.scorebug strong {
  font-size: clamp(44px, 6vw, 90px);
  line-height: 0.8;
}

.marker-key {
  position: absolute;
  top: 68px;
  right: 30px;
  z-index: 9;
  display: flex;
  gap: 15px;
  color: var(--paper);
  font-family: var(--sans);
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
}

.marker-key span {
  display: flex;
  gap: 5px;
  align-items: center;
}

.marker-key i {
  width: 8px;
  height: 8px;
  display: block;
  border-radius: 50%;
}

.key-through { background: var(--grass); }
.key-today { background: var(--yellow); }
.key-out { background: #777; }

body[data-scene="cities"] .scorebug,
body[data-scene="matches"] .scorebug,
body[data-scene="thirtytwo"] .scorebug {
  color: var(--ink);
}

body[data-scene="cities"] .marker-key,
body[data-scene="matches"] .marker-key,
body[data-scene="thirtytwo"] .marker-key {
  color: var(--ink);
}

.pitch {
  position: absolute;
  top: 50%;
  left: 58%;
  width: min(64vw, 870px);
  height: min(78vh, 700px);
  border: 1px solid rgba(247, 240, 223, 0.25);
  transform: translate(-50%, -50%);
  transition: border-color 350ms ease;
}

body[data-scene="cities"] .pitch,
body[data-scene="matches"] .pitch,
body[data-scene="thirtytwo"] .pitch {
  border-color: rgba(23, 17, 15, 0.3);
}

.pitch-markings,
.pitch-markings::before,
.pitch-markings::after,
.pitch-markings i {
  position: absolute;
}

.pitch-markings {
  inset: 0;
  pointer-events: none;
}

.pitch-markings::before {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: rgba(247, 240, 223, 0.18);
  content: "";
}

.pitch-markings::after {
  top: 50%;
  left: 50%;
  width: 20%;
  aspect-ratio: 1;
  border: 1px solid rgba(247, 240, 223, 0.18);
  border-radius: 50%;
  content: "";
  transform: translate(-50%, -50%);
}

.pitch-markings i:first-child,
.pitch-markings i:nth-child(2) {
  top: 31%;
  width: 11%;
  height: 38%;
  border: 1px solid rgba(247, 240, 223, 0.18);
}

.pitch-markings i:first-child {
  left: 0;
  border-left: 0;
}

.pitch-markings i:nth-child(2) {
  right: 0;
  border-right: 0;
}

.pitch-markings i:last-child {
  top: 50%;
  left: 50%;
  width: 5px;
  aspect-ratio: 1;
  background: rgba(247, 240, 223, 0.5);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

body[data-scene="cities"] .pitch-markings,
body[data-scene="matches"] .pitch-markings,
body[data-scene="thirtytwo"] .pitch-markings {
  filter: invert(1);
}

.team-field {
  position: absolute;
  inset: 0;
}

.team-marker {
  position: absolute;
  top: 0;
  left: 0;
  width: clamp(18px, 2.2vw, 30px);
  aspect-ratio: 1;
  padding: 0;
  color: var(--paper);
  background: var(--marker, var(--purple));
  border: 1px solid var(--black);
  border-radius: 50%;
  cursor: pointer;
  font-family: var(--sans);
  font-weight: 700;
  opacity: var(--alpha, 1);
  transform: translate(-50%, -50%) scale(var(--scale, 1));
  transition: top 700ms cubic-bezier(.2,.8,.2,1), left 700ms cubic-bezier(.2,.8,.2,1), opacity 350ms ease, transform 350ms ease;
}

.team-marker img,
.flag-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.flag-fallback {
  display: grid;
  place-items: center;
  overflow: hidden;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  font-size: clamp(13px, 1.6vw, 21px);
}

.team-marker img {
  z-index: 1;
  display: block;
  object-fit: cover;
}

.team-marker::after {
  position: absolute;
  inset: -3px;
  border: 1px solid transparent;
  border-radius: 50%;
  content: "";
  z-index: 2;
}

.team-marker:hover,
.team-marker:focus-visible,
.team-marker.is-selected {
  z-index: 4;
  --scale: 1.55;
}

.team-marker.is-selected {
  box-shadow: 0 0 0 4px var(--paper);
}

.team-marker.is-out {
  filter: grayscale(1);
}

.team-marker.is-out::after {
  border-color: var(--black);
  border-radius: 0;
  transform: rotate(-45deg) scaleX(1.15);
  clip-path: inset(47% 0 47% 0);
  background: var(--black);
}

.team-marker.is-through {
  box-shadow: 0 0 0 4px var(--grass);
}

.team-marker.is-today::after {
  border-color: var(--yellow);
  animation: match-pulse 1.4s ease-out infinite;
}

.selected-team {
  position: absolute;
  right: 0;
  bottom: -27px;
  margin: 0;
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.year-track {
  position: absolute;
  right: 30px;
  bottom: 24px;
  left: 30px;
  z-index: 8;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  color: var(--paper);
  font-family: var(--sans);
  font-size: 8px;
  font-weight: 700;
}

.year-track i {
  position: relative;
  height: 1px;
  background: currentColor;
}

.year-track b {
  position: absolute;
  top: -3px;
  left: 0;
  width: 7px;
  height: 7px;
  background: var(--yellow);
  border-radius: 50%;
  transform: translateX(calc(var(--story-progress, 0) * (100vw - 150px)));
  transition: transform 300ms linear;
}

body[data-scene="cities"] .year-track,
body[data-scene="matches"] .year-track,
body[data-scene="thirtytwo"] .year-track {
  color: var(--ink);
}

.story-steps {
  position: relative;
  z-index: 3;
  margin-top: -100svh;
  pointer-events: none;
}

.story-step {
  min-height: 108svh;
  display: flex;
  align-items: center;
  padding: 12vh 0;
}

.step-copy {
  width: min(430px, 36vw);
  margin-left: 5vw;
  padding: 22px 24px 26px;
  color: var(--paper);
  background: var(--black);
  border-top: 4px solid var(--step-accent, var(--purple));
  pointer-events: auto;
}

.story-step:nth-child(2) .step-copy { --step-accent: var(--purple); }
.story-step:nth-child(3) .step-copy { --step-accent: var(--blue); }
.story-step:nth-child(4) .step-copy { --step-accent: var(--grass); }
.story-step:nth-child(5) .step-copy { --step-accent: var(--yellow); }
.story-step:nth-child(6) .step-copy { --step-accent: var(--red); }
.story-step:nth-child(7) .step-copy { --step-accent: var(--blue); }
.story-step:nth-child(8) .step-copy { --step-accent: var(--grass); }

.step-kicker {
  margin: 0 0 18px;
  color: var(--step-accent, var(--purple));
}

.step-copy h2 {
  margin: 0 0 18px;
  font-size: clamp(29px, 3.2vw, 46px);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: 0;
}

.step-copy > p:last-child {
  margin: 0;
  color: #d0c8bc;
  font-size: clamp(15px, 1.3vw, 18px);
  line-height: 1.4;
}

.later {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 0.7fr);
  gap: clamp(50px, 10vw, 160px);
  align-items: center;
  padding: 110px clamp(24px, 8vw, 120px);
  color: var(--ink);
  background: var(--paper);
}

.later-heading > p {
  margin: 0 0 20px;
  color: var(--blue);
}

.later-heading h2 {
  margin: 0;
  font-size: clamp(54px, 7.7vw, 118px);
  font-style: italic;
  font-weight: 400;
  line-height: 0.78;
  letter-spacing: 0;
}

.note-form {
  display: grid;
  align-self: center;
  border-top: 2px solid var(--ink);
}

.note-form label {
  margin: 24px 0 8px;
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.note-form select,
.note-form textarea {
  width: 100%;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
}

.note-form select {
  padding: 10px 0;
  font-size: 28px;
}

.note-form textarea {
  min-height: 130px;
  padding: 12px 0;
  resize: vertical;
  font-size: 20px;
  line-height: 1.35;
}

.note-form textarea::placeholder {
  color: #8f887e;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
}

.form-actions > span {
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 700;
}

.form-actions button {
  display: flex;
  gap: 20px;
  align-items: center;
  padding: 13px 16px;
  color: var(--paper);
  background: var(--blue);
  border: 0;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.form-actions button span {
  color: var(--yellow);
  font-size: 18px;
}

.saved-note {
  position: relative;
  padding: 34px;
  color: var(--paper);
  background: var(--blue);
  transform: rotate(1.5deg);
}

.saved-note::before {
  position: absolute;
  top: 0;
  right: 0;
  width: 34px;
  height: 34px;
  background: linear-gradient(225deg, var(--paper) 50%, var(--yellow) 51%);
  content: "";
}

.saved-note p,
.saved-note button {
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.saved-note p {
  margin: 0;
  color: var(--yellow);
}

.saved-note blockquote {
  margin: 30px 0;
  font-size: clamp(25px, 3vw, 42px);
  font-style: italic;
  line-height: 1.05;
}

.saved-note button {
  padding: 10px 0;
  color: var(--paper);
  background: transparent;
  border: 0;
  border-bottom: 1px solid currentColor;
  cursor: pointer;
}

.notes-footer {
  min-height: 74px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 30px;
  color: var(--paper);
  background: var(--black);
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.notes-footer a {
  text-decoration: none;
}

.notes-footer p {
  margin: 0;
  line-height: 1.45;
}

.credit-link {
  color: var(--yellow);
  text-decoration: none;
}

.credit-link:hover,
.credit-link:focus-visible {
  color: var(--grass);
  text-decoration: underline;
}

.notes-footer a:last-child {
  justify-self: end;
}

@media (max-width: 820px) {
  .notes-header {
    right: 16px;
    left: 16px;
    grid-template-columns: 1fr 1fr;
  }

  .notes-header > span:first-of-type {
    display: none;
  }

  .pitch {
    top: 42%;
    left: 50%;
    width: calc(100vw - 32px);
    height: min(54vh, 470px);
  }

  .scorebug {
    top: 20px;
    right: 16px;
    left: 16px;
  }

  .marker-key {
    top: 58px;
    right: 16px;
    gap: 10px;
  }

  .year-track {
    right: 16px;
    bottom: 16px;
    left: 16px;
  }

  .story-step {
    min-height: 118svh;
    align-items: flex-end;
    padding: 0 16px 10vh;
  }

  .step-copy {
    width: min(100%, 470px);
    margin: 0;
    padding: 18px 20px 21px;
  }

  .selected-team {
    right: 0;
    bottom: -23px;
  }

  .later {
    grid-template-columns: 1fr;
    gap: 70px;
    align-content: center;
    padding: 100px 22px;
  }

  .later-heading h2 {
    font-size: clamp(52px, 15vw, 88px);
  }

  .notes-footer {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    padding: 20px 16px;
  }

  .notes-footer p {
    display: none;
  }
}

@media (max-width: 680px) {
  .notes-hero {
    justify-content: flex-start;
    padding-top: 156px;
    padding-bottom: 90px;
  }

  .hero-ball {
    top: 24px;
    right: 10%;
    left: auto;
    width: 90px;
    height: 90px;
  }

  .hero-date {
    margin: 0 0 14px;
  }

  h1 {
    margin-top: 0;
    font-size: clamp(42px, 11.5vw, 58px);
  }

  h1 span:nth-child(2) { white-space: nowrap; }

  .hero-deck {
    margin-top: 22px;
  }
}

@media (max-width: 430px) {
  .hero-ball {
    top: 20px;
    right: 8%;
    left: auto;
    width: 82px;
    height: 82px;
  }

  h1 {
    margin-top: 0;
    font-size: clamp(39px, 11.5vw, 52px);
  }

  .hero-deck {
    font-size: 15px;
  }

  .pitch {
    top: 40%;
    height: min(48vh, 390px);
  }

  .team-marker {
    width: 18px;
  }

  .flag-fallback {
    font-size: 12px;
  }

  .step-copy h2 {
    font-size: 31px;
  }

  .step-copy > p:last-child {
    font-size: 15px;
  }

  .notes-footer {
    font-size: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .hero-ball {
    animation: none;
  }
}

@keyframes match-pulse {
  to { opacity: 0; transform: scale(1.9); }
}
