/* The car in the calendar: a racing team's season, one race per row. When the list reaches the middle of the screen
   a car seen from above drives in and stays there while the rows slide under it; the row crossing the middle lights
   up. At the end of the list the car drives off, and if you scroll back it comes back the other way round. */
:root {
  --night: #0b0e14;         /* the page */
  --paper: #f2f1ec;         /* text */
  --accent: #b6ff3b;        /* the row under the car */
  --muted: rgba(242, 241, 236, 0.58);
  --edge: clamp(18px, 3.2vw, 48px);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  overflow-x: clip;
}

body {
  background: var(--night);
  color: var(--paper);
  font-family: 'Barlow', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

.bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px var(--edge);
  font-size: 14px;
  background: linear-gradient(to bottom, rgba(11, 14, 20, 0.92), rgba(11, 14, 20, 0));
}

.brand {
  font-family: 'Big Shoulders Display Variable', Impact, sans-serif;
  font-size: 22px;
  font-weight: 800;
  text-transform: uppercase;
}

.bar__nav {
  display: flex;
  gap: clamp(16px, 2.4vw, 34px);
}

.bar__nav a {
  transition: opacity 0.2s;
}

@media (hover: hover) {
  .bar__nav a:hover {
    opacity: 0.55;
  }
}

.bar a:focus-visible,
.outro__link:focus-visible {
  outline: 2px solid var(--paper);
  outline-offset: 3px;
}

.intro,
.outro {
  min-height: 80svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 110px var(--edge);
  text-align: center;
}

.intro__kicker {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.intro__title,
.outro__title {
  max-width: 13em;
  margin: 0;
  font-family: 'Big Shoulders Display Variable', Impact, sans-serif;
  font-size: clamp(48px, 7vw, 116px);
  font-weight: 900;
  line-height: 0.9;
  text-transform: uppercase;
}

.intro__hint {
  margin: 8px 0 0;
  font-size: 15px;
  color: var(--muted);
}

.outro__link {
  margin-top: 6px;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--night);
  font-size: 15px;
  font-weight: 600;
}

/* ---------------------------------------------------------------- the calendar */
/* clip, not hidden: the car is cut at the edges of the section, and the sticky frame still sticks */
.calendar {
  position: relative;
  padding: 0 var(--edge) 30svh;
  overflow: clip;
}

/* a frame as tall as the screen that sticks while the list goes by; the negative margin keeps it out of the flow */
.calendar__sticky {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 100vh;
  height: 100lvh;
  margin-bottom: -100vh;
  margin-bottom: -100lvh;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.drift {
  display: grid;
  place-items: center;
}

.car {
  display: block;
  width: clamp(130px, 12vw, 200px);
  height: auto;
  filter: drop-shadow(0 24px 30px rgba(0, 0, 0, 0.45));
}

.calendar__title {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  padding: 18vh 0 7vh;
  font-family: 'Big Shoulders Display Variable', Impact, sans-serif;
  font-size: clamp(56px, 8vw, 132px);
  font-weight: 900;
  line-height: 0.9;
  text-transform: uppercase;
}

.rounds {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.round {
  position: relative;
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 24px;
  padding: 28px 0;
  color: var(--paper);
}

.round__no {
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.7;
}

.round__name {
  font-family: 'Big Shoulders Display Variable', Impact, sans-serif;
  font-size: clamp(30px, 3.6vw, 56px);
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.round__date {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.round__line {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: rgba(242, 241, 236, 0.18);
}

@media (max-width: 760px) {
  .bar__nav {
    display: none;
  }

  .car {
    width: 30vw;
  }

  .round {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 16px;
    padding: 22px 0;
  }

  .round__no {
    grid-column: 1 / -1;
  }

  .round__date {
    font-size: 13px;
  }
}
