:root {
  /* Homepage overrides: taller header than the app */
  --header-block-size: 93px;
  --header-font-size: 22px;

  --title-font-size: 40px;
}

html,
body {
  margin: 0;
  padding: 0;
  background-color: var(--color-background);
  background-image: none;
}

/* ===== The homepage before signing in (#welcome-section) =====
   It carries on the hero's picture: its sky, its meadow, and the sand path
   that leaves it at the bottom edge and runs down through a board to play on
   and the four levels of lessons. The colours are the picture's own. */
.landing {
  --sky: #e3fffe;
  --grass: #9bb847;
  --sand: #ead389;
  --meadow: #3f6b22;
  --meadow-dark: #2f5418;
  --bark: #4a2a0e;
  --chestnut: #a4501f;
  --crown: #f0b522;
  --paper: #ffffff;

  --font-display: "Baloo 2", "Nunito Sans", sans-serif;
  --font-text: "Nunito Sans", system-ui, sans-serif;

  /* Major third from an 18px text. */
  --step-0: 1.125rem;
  --step-1: 1.375rem;
  --step-2: clamp(1.75rem, 1.2rem + 1.5vw, 2.5rem);
  --step-3: clamp(2.125rem, 1.3rem + 2.9vw, 3.5rem);

  /* The page's margin, as .landing-inner's, for what lies in a column of
     the meadow's grid (where 100% is the column). */
  --inline-pad: max(24px, calc((100vw - 1200px) / 2 + 24px));

  color: var(--bark);
  font-family: var(--font-text);
  font-size: var(--step-0);
  line-height: 1.6;
  background: var(--sky);

  h1,
  h2,
  h3 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.15;
    color: var(--bark);
    margin: 0;
  }

  h2 {
    font-size: var(--step-2);
    letter-spacing: -0.01em;
  }

  h3 {
    font-size: var(--step-1);
    font-weight: 600;
  }

  p {
    margin: 0;
  }

  ul,
  ol {
    list-style: none;
    margin: 0;
    padding: 0;
  }
}

.landing-inner {
  max-inline-size: 1200px;
  margin-inline: auto;
  padding-inline: 24px;
}

.landing-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-block-size: 52px;
  padding: 0.6em 1.6em;
  border: 2px solid var(--meadow);
  border-radius: 999px;
  background: var(--meadow);
  color: #fff;
  font-family: var(--font-display);
  font-size: var(--step-0);
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease;

  &:hover {
    background: var(--meadow-dark);
    border-color: var(--meadow-dark);
    color: #fff;
  }

  &.is-quiet {
    background: rgba(255, 255, 255, 0.75);
    color: var(--meadow-dark);

    &:hover {
      background: #fff;
      color: var(--meadow-dark);
    }
  }
}

.landing :focus-visible {
  outline: 3px solid var(--bark);
  outline-offset: 3px;
}

/* ----- Hero: the trainers' cards in the picture's sky ----- */
.landing-hero {
  position: relative;
  /* The picture is pulled up under the cards: not above the banner. */
  overflow: clip;
  background: var(--sky);
}

.hero-trainers {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
  max-inline-size: 1200px;
  margin-inline: auto;
  padding: clamp(28px, 4vw, 56px) 24px 0;
}

/* The picture's sky is see-through: the cards sit in it, over the clouds
   and clear of the trainers' heads (half way down the picture). */
.landing-hero-art {
  display: block;
  inline-size: 100%;
  block-size: auto;
  margin-block-start: calc(-1 * clamp(0px, 40vw - 180px, 420px));
}

/* ----- The meadow and its path ----- */
.landing-meadow {
  /* The sides the path runs on, in % of the width (the numbers the bends'
     SVG paths in index.html are drawn with), and its width: the picture's
     path is 2% of it where it leaves the picture. */
  --path-w: clamp(18px, 2vw, 32px);
  --bend: 150px;

  background: linear-gradient(
    var(--grass) 0,
    #a6c056 420px,
    #b2c96a 100%
  );
  padding-block-end: clamp(72px, 9vw, 128px);
}

.meadow-part {
  --x: 27;

  position: relative;
  display: grid;
  grid-template-columns: 54% 46%;
  padding-block-start: var(--bend);

  &.at-right {
    --x: 73;

    grid-template-columns: 46% 54%;
  }

  /* A part on the side the one above left the path at: no bend. */
  &.from-left.at-left,
  &.from-right.at-right {
    --bend: 48px;
  }

  /* The straight stretch, down past the content. */
  &::before {
    content: "";
    position: absolute;
    inset-block: var(--bend) 0;
    inset-inline-start: calc(var(--x) * 1% - var(--path-w) / 2);
    inline-size: var(--path-w);
    background: var(--sand);
  }

  > :not(.path-bend, .path-turn) {
    position: relative;
  }
}

.path-bend {
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
  inline-size: 100%;
  block-size: var(--bend);
  overflow: visible;

  path {
    fill: none;
    stroke: var(--sand);
    stroke-width: var(--path-w);
    vector-effect: non-scaling-stroke;
  }
}

.path-turn {
  display: none;
}

/* The board, on the path. */
.meadow-try {
  --bend: 110px;

  align-items: start;
  padding-block-end: 24px;
}

.try-board-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  justify-self: center;
}

.try-board {
  --frame: 10px;

  position: relative;
  inline-size: min(420px, 40vw);
  aspect-ratio: 1;
  padding: var(--frame);
  border-radius: 14px;
  background: #603913;
  box-shadow: 0 22px 32px -16px rgba(47, 70, 12, 0.7);

  .chessboard-server {
    border-radius: 6px;
  }
}

/* The hand that shows what to do (js/landing.js), over the board's squares:
   a1 is the bottom-left eighth. It comes in, presses the rook (its square
   rings), drags a copy of it two squares up, lets go, and again. */
.try-hint {
  position: absolute;
  inset: var(--frame);
  z-index: 20;
  pointer-events: none;
}

.try-hint-ring,
.try-hint-hand {
  position: absolute;
  inset-inline-start: 0;
  inset-block-start: 87.5%;
  inline-size: 12.5%;
  block-size: 12.5%;
}

.try-hint-ring {
  box-sizing: border-box;
  border: 4px solid var(--crown);
  border-radius: 6px;
  box-shadow: 0 0 0 4px rgba(240, 181, 34, 0.35);
  animation: try-hint-ring 3.2s ease-in-out 0.6s infinite both;
}

.try-hint-hand {
  animation: try-hint-hand 3.2s ease-in-out 0.6s infinite both;
}

.try-hint-ghost {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  animation: try-hint-ghost 3.2s ease-in-out 0.6s infinite both;
}

/* The fingertip (the cursor's hotspot) on the square's centre. */
.try-hint-finger {
  position: absolute;
  inset-inline-start: 1%;
  inset-block-start: 46%;
  inline-size: 110%;
  block-size: auto;
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.35));
}

@keyframes try-hint-hand {
  0% { opacity: 0; transform: translate(80%, 70%); }
  14% { opacity: 1; transform: translate(80%, 70%); }
  30% { opacity: 1; transform: translate(0, 0) scale(1); }
  38% { opacity: 1; transform: translate(0, 0) scale(0.88); }
  66% { opacity: 1; transform: translate(0, -200%) scale(0.88); }
  74% { opacity: 1; transform: translate(0, -200%) scale(1); }
  88%, 100% { opacity: 0; transform: translate(0, -200%) scale(1); }
}

@keyframes try-hint-ghost {
  0%, 36% { opacity: 0; }
  42%, 70% { opacity: 0.7; }
  80%, 100% { opacity: 0; }
}

@keyframes try-hint-ring {
  0%, 32% { opacity: 0; transform: scale(0.8); }
  40%, 72% { opacity: 1; transform: scale(1); }
  86%, 100% { opacity: 0; transform: scale(1); }
}

/* Still: the hand rests on the rook, its square ringed. */
@media (prefers-reduced-motion: reduce) {
  .try-hint-ring,
  .try-hint-hand,
  .try-hint-ghost {
    animation: none;
  }

  .try-hint-ghost {
    opacity: 0;
  }
}

.try-again {
  padding: 0.4em 1.2em;
  border: 2px solid var(--bark);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--bark);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;

  &:hover {
    background: #fff;
  }
}

.try-text {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-inline-size: 30rem;
  padding-inline-end: var(--inline-pad);
  padding-block-start: 8px;
}

/* Chessnut answers each move. */
.try-coach {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  margin-block-start: 8px;

  img {
    flex: none;
    inline-size: 104px;
    block-size: auto;
  }
}

/* The bubble, and on its corner the button of Chessnut's voice. */
.try-say {
  position: relative;
  flex: 1;
  align-self: center;
}

.try-bubble {
  position: relative;
  margin: 0;
  padding: 14px 18px;
  border: 2px solid var(--bark);
  border-radius: 20px 20px 20px 6px;
  background: #fff;
  font-size: 1rem;
  line-height: 1.5;

  .has-voice > & {
    padding-inline-end: 30px;
  }

  &[data-state="wrong"] {
    background: #fff4dd;
  }

  &[data-state="solved"] {
    background: #eef7de;
    border-color: var(--meadow);
  }

  strong {
    font-family: var(--font-display);
    font-weight: 700;
  }
}

/* Chessnut's voice: plays again, or stops, what the bubble says. */
.try-voice {
  position: absolute;
  inset-block-start: -18px;
  inset-inline-end: -14px;
  display: grid;
  place-items: center;
  inline-size: 44px;
  block-size: 44px;
  padding: 0;
  border: 2px solid var(--bark);
  border-radius: 50%;
  background: #fff;
  color: var(--bark);
  cursor: pointer;

  &[hidden] {
    display: none;
  }

  svg {
    inline-size: 24px;
    block-size: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .try-voice-speaker {
    fill: currentColor;
  }

  &:hover {
    background: #eef7de;
  }

  &:focus-visible {
    outline: 3px solid var(--crown);
    outline-offset: 2px;
  }

  /* A recording waiting to be heard calls for a tap, three slow times. */
  &.is-waiting {
    animation: try-voice-call 2.2s ease-out 1.2s 3;
  }

  &.is-playing {
    border-color: var(--meadow);
    background: var(--meadow);
    color: #fff;

    .try-voice-wave {
      animation: try-voice-wave 0.9s ease-in-out infinite;
    }

    .is-far {
      animation-delay: 0.2s;
    }
  }
}

@keyframes try-voice-call {
  0% {
    box-shadow: 0 0 0 0 rgba(240, 181, 34, 0.9);
    transform: scale(1);
  }

  15% {
    transform: scale(1.12);
  }

  30% {
    transform: scale(1);
  }

  100% {
    box-shadow: 0 0 0 16px rgba(240, 181, 34, 0);
  }
}

@keyframes try-voice-wave {
  0%,
  100% {
    opacity: 0.25;
  }

  50% {
    opacity: 1;
  }
}

/* The levels. */
.meadow-heading {
  --bend: 170px;

  h2,
  p {
    grid-column: 1;
    justify-self: start;
    max-inline-size: 26rem;
    margin-inline-start: var(--inline-pad);
  }

  h2 {
    max-inline-size: 22ch;
    margin-block-start: -24px;
  }

  p {
    margin-block-start: 12px;
  }
}

.level-stop {
  --marker: 64px;

  grid-template-rows: auto 1fr;
  column-gap: 0;
  padding-block-end: 8px;

  .level-marker {
    grid-row: 1 / span 2;
    grid-column: 1;
    justify-self: center;
    display: grid;
    place-items: center;
    inline-size: var(--marker);
    block-size: var(--marker);
    border: 5px solid #fff;
    border-radius: 50%;
    background: var(--crown);
    color: var(--bark);
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 6px 12px -6px rgba(47, 70, 12, 0.6);
  }

  h3,
  p {
    grid-column: 2;
    justify-self: start;
    max-inline-size: min(calc(26rem + 36px), calc(100% - 24px));
    padding-inline-start: 36px;
  }

  h3 {
    padding-block-start: 14px;
  }

  p {
    margin-block-start: 6px;
  }

  &.at-right {
    .level-marker {
      grid-column: 2;
    }

    h3,
    p {
      grid-column: 1;
      justify-self: end;
      max-inline-size: min(calc(26rem + 36px), calc(100% - 24px));
      padding-inline: 0 36px;
      text-align: end;
    }
  }

  /* The path ends at the cup. */
  &.is-goal {
    --marker: 112px;

    &::before {
      inset-block-end: auto;
      block-size: 40px;
    }

    .level-marker {
      border: 0;
      border-radius: 0;
      background: none;
      box-shadow: none;
      object-fit: contain;
    }

    h3 {
      padding-block-start: 32px;
    }
  }
}

/* ----- Games, problems, the training session ----- */
.landing-play {
  background: var(--paper);
  padding-block: clamp(64px, 8vw, 112px);

  h2 {
    margin-block-end: 40px;
  }
}

.opponents {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  align-items: end;
  gap: 48px;
  margin: 0;

  figcaption {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-inline-size: 28rem;
    padding-block-end: 36px;
  }
}

/* The computer's levels, weakest to strongest, standing on a shelf. */
.opponents-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  padding-inline: 8px;
  border-block-end: 8px solid var(--sand);

  li {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding-block-end: 10px;
    font-family: var(--font-display);
    font-size: 0.9375rem;
    font-weight: 600;
  }

  img {
    block-size: var(--h);
    inline-size: auto;
  }

  li:nth-child(1) { --h: clamp(64px, 8vw, 100px); }
  li:nth-child(2) { --h: clamp(70px, 8.8vw, 112px); }
  li:nth-child(3) { --h: clamp(76px, 9.6vw, 124px); }
  li:nth-child(4) { --h: clamp(80px, 10.2vw, 132px); }
  li:nth-child(5) { --h: clamp(88px, 11.4vw, 148px); }
  li:nth-child(6) { --h: clamp(96px, 12.4vw, 160px); }
}

.play-more {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px 64px;
  margin-block-start: 64px;

  /* Each feature: its drawn icon beside the heading and the text. */
  > div {
    display: grid;
    grid-template-columns: var(--icon, 60px) minmax(0, 1fr);
    align-content: start;
    gap: 10px 18px;
    max-inline-size: 36rem;

    > :not(.play-icon) {
      grid-column: 2;
    }
  }
}

.play-icon {
  grid-row: 1 / span 2;
  inline-size: var(--icon, 60px);
  block-size: var(--icon, 60px);
  overflow: visible;
  stroke: var(--bark);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ----- A trainer's card: white, outlined as the picture's figures are. */
.trainer {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  align-items: start;
  gap: 22px;
  padding: 22px;
  border: 2px solid var(--bark);
  border-radius: 20px;
  background: #fff;
  font-size: 1rem;
  line-height: 1.55;

  > img {
    inline-size: 100%;
    block-size: auto;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: 12px;
  }

  > div {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  h2 {
    font-size: 1.5rem;
  }

  .trainer-title {
    margin-block-start: -8px;
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--chestnut);
  }
}

.trainer-facts {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.9375rem;

  li {
    display: flex;
    gap: 10px;
    align-items: baseline;
  }

  li::before {
    content: "";
    flex: none;
    inline-size: 10px;
    block-size: 10px;
    border-radius: 50%;
    background: var(--crown);
    transform: translateY(-1px);
  }
}

/* ----- What chess gives a child ----- */
.landing-benefits {
  background: var(--paper);
  padding-block: clamp(64px, 8vw, 112px);

  h2 {
    margin-block-end: 48px;
  }
}

.benefits {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 56px 48px;

  li {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  img {
    block-size: 132px;
    inline-size: auto;
    max-inline-size: 100%;
    object-fit: contain;
    align-self: flex-start;
    margin-block-end: 8px;
  }

  p {
    font-size: 1rem;
  }
}

/* ----- Gallery ----- */
.landing-gallery {
  background: var(--sky);
  padding-block: clamp(64px, 8vw, 112px) clamp(24px, 4vw, 48px);

  h2 {
    margin-block-end: 40px;
  }

  .gallery-grid {
    padding: 0;
  }
}

/* ----- Closing: the trial ----- */
.landing-close {
  background: var(--grass);
  padding-block: clamp(56px, 7vw, 96px);

  .landing-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(24px, 4vw, 56px);
  }

  img {
    inline-size: clamp(140px, 16vw, 220px);
    block-size: auto;
  }

  .landing-inner > div {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    max-inline-size: 34rem;
  }
}

.welcome-footer {
  background: var(--color-gray);
  color: var(--color-text-light);
  padding-block: 1rem;
  font-family: "Nunito Sans", system-ui, sans-serif;

  .footer-link {
    color: var(--color-text-light);
    text-decoration: none;
    transition: color 0.2s ease;

    &:hover {
      color: #adb5bd;
    }
  }
}

/* ----- Black Friday: a black band with Chessnut's checkered belt for an
   edge (the mascot's black and cream squares), the price in the crown's
   gold, the code as a coupon to cut out. One row. ----- */
.promo {
  --checker: 10px;

  position: relative;
  background: #000;
  color: #fff;
  padding-block: 18px calc(18px + var(--checker));

  &::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    inset-block-end: 0;
    block-size: var(--checker);
    background: repeating-linear-gradient(
      90deg,
      #000 0 var(--checker),
      #f7f3a7 var(--checker) calc(2 * var(--checker))
    );
  }

  h2 {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
  }
}

.promo-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 36px;
  max-inline-size: 1200px;
  margin-inline: auto;
  padding-inline: 24px;
}

.promo-offer {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.promo-price {
  font-family: var(--font-display);
  font-size: clamp(2rem, 1.3rem + 2.2vw, 3.25rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--crown);
}

.promo-how {
  flex: 1 1 18rem;
  max-inline-size: 26rem;
  font-size: 1rem;
  line-height: 1.5;
  color: #f2f2f2;

  strong {
    font-family: var(--font-display);
    font-weight: 700;
    color: #fff;
  }
}

.promo-left {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--crown);

  &:empty {
    display: none;
  }
}

.promo-code {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

/* The code to cut out: a dashed coupon edge. */
.promo-coupon {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 8px 16px;
  border: 3px dashed #000;
  border-radius: 10px;
  outline: 3px solid #f7f3a7;
  outline-offset: -1px;
  background: #f7f3a7;
  color: #000;
  font-family: var(--font-display);
  cursor: pointer;

  &:hover {
    background: #fff;
    outline-color: #fff;
  }

  &:focus-visible {
    outline: 3px solid var(--crown);
    outline-offset: 4px;
  }
}

.promo-coupon-code {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.06em;
}

.promo-coupon-action {
  min-inline-size: 7.5em;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: start;
}

.promo-button {
  min-block-size: 44px;
  font-size: 1rem;
  border-color: var(--crown);
  background: var(--crown);
  color: #000;

  &:hover {
    border-color: #fff;
    background: #fff;
    color: #000;
  }
}

.landing .promo :focus-visible {
  outline-color: var(--crown);
}

/* ----- Narrower screens ----- */
@media (max-width: 1024px) {
  .benefits {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

/* One column: the path runs down the left edge, every part beside it. */
@media (max-width: 899px) {
  .hero-trainers {
    grid-template-columns: minmax(0, 1fr);
    max-inline-size: 40rem;
    gap: 20px;
  }

  .landing-hero-art {
    margin-block-start: 24px;
  }

  .landing-meadow {
    --rail: 30px;
    --path-w: 18px;
    /* Where the picture's path leaves it, as above. */
    --exit: 40.2%;
  }

  .path-bend {
    display: none;
  }

  /* No bends: the path runs straight down the rail, through the gaps
     between the parts too. */
  .landing-meadow .meadow-part {
    --bend: 0px;

    grid-template-columns: minmax(0, 1fr);
    padding-block-start: 36px;
    padding-inline: calc(var(--rail) + 34px) 20px;

    &::before {
      inset-inline-start: calc(var(--rail) - var(--path-w) / 2);
    }
  }

  .landing-meadow .meadow-try {
    --bend: 72px;

    padding-block: 108px 40px;
  }

  /* An S from the picture's path down to the rail: the upper half turns
     the path left, the lower half turns it down again. */
  .path-turn {
    --turn-r: 28px;

    display: block;
    position: absolute;
    inset-block-start: 0;
    inset-inline-start: calc(var(--rail) - var(--path-w) / 2);
    inline-size: calc(var(--exit) - var(--rail) + var(--path-w));
    block-size: var(--bend);

    &::before,
    &::after {
      content: "";
      box-sizing: border-box;
      position: absolute;
      block-size: calc(50% + var(--path-w) / 2);
      border: 0 solid var(--sand);
    }

    &::before {
      inset-block-start: 0;
      inset-inline-end: 0;
      inline-size: 50%;
      border-inline-end-width: var(--path-w);
      border-block-end-width: var(--path-w);
      border-end-end-radius: var(--turn-r);
    }

    &::after {
      inset-block-end: 0;
      inset-inline-start: 0;
      inline-size: calc(50% + 1px);
      border-inline-start-width: var(--path-w);
      border-block-start-width: var(--path-w);
      border-start-start-radius: var(--turn-r);
    }
  }

  .try-board-column {
    justify-self: stretch;
  }

  .try-board {
    --frame: 7px;

    inline-size: 100%;
    max-inline-size: 420px;
  }

  .try-text {
    order: -1;
    max-inline-size: none;
    padding: 0 0 24px;
  }

  .meadow-heading {
    padding-block-end: 32px;

    h2,
    p {
      margin-inline-start: 0;
    }

    h2 {
      margin-block-start: 0;
    }
  }

  .level-stop,
  .level-stop.at-right {
    --marker: 48px;

    grid-template-rows: auto auto;
    padding-block-end: 0;

    /* Out of the grid, so it is placed in the part's box, not its area. */
    .level-marker {
      grid-area: auto;
      position: absolute;
      inset-block-start: 36px;
      inset-inline-start: calc(var(--rail) - var(--marker) / 2);
      border-width: 4px;
      font-size: 1.375rem;
    }

    h3,
    p {
      grid-column: 1;
      justify-self: start;
      padding-inline: 0;
      text-align: start;
    }

    h3 {
      padding-block-start: 8px;
    }

    &.is-goal {
      --marker: 60px;

      padding-block-end: 0;

      &::before {
        block-size: 64px;
      }

      h3 {
        padding-block-start: 12px;
      }
    }
  }

  .opponents {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;

    figcaption {
      padding-block-end: 0;
    }
  }

  .play-more {
    --icon: 48px;
    grid-template-columns: minmax(0, 1fr);
    margin-block-start: 48px;
  }
}

@media (max-width: 600px) {
  /* The banner: the coupon and the button on one row. */
  .promo-how {
    font-size: 0.9375rem;
  }

  .promo-code {
    flex-wrap: nowrap;
    gap: 10px;
  }

  .promo-coupon {
    gap: 8px;
    padding: 6px 12px;
  }

  .promo-coupon-code {
    font-size: 1.375rem;
  }

  .promo-coupon-action {
    min-inline-size: 5.5em;
    font-size: 0.8125rem;
  }

  .promo-button {
    min-block-size: 40px;
    padding-inline: 1em;
    white-space: nowrap;
  }

  /* The picture cropped to the trainers and Chessnut. */
  .landing-hero-art {
    aspect-ratio: 6 / 5;
    object-fit: cover;
    object-position: 0% 100%;
  }

  /* Cropped, the picture is 6/5 × 1577/1000 of the width wide, its path
     leaving it at 40.2% of that. */
  .landing-meadow {
    --exit: 52.8%;
  }

  .benefits {
    grid-template-columns: minmax(0, 1fr);
    gap: 44px;
  }

  .trainer {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 16px;
    padding: 18px;
  }

  .benefits img {
    block-size: 104px;
  }

  .opponents-row li {
    font-size: 0.75rem;
  }

  /* The voice button kept clear of the window's edge. */
  .try-voice {
    inset-inline-end: -6px;
  }

  .landing-close .landing-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .landing-button {
    transition: none;
  }

  .try-voice.is-waiting,
  .try-voice.is-playing .try-voice-wave {
    animation: none;
  }
}

/* Short landscape viewports (phones held sideways): same slim header the
   narrow-width breakpoint below gets — a 93px bar on a 390px-tall screen
   would leave the lesson area almost no height. */
@media (max-height: 520px) {
  :root {
    --header-block-size: 50px;
    --header-font-size: 16px;
  }
}

@media (max-width: 768px) {
  :root {
    --header-block-size: 50px;
    --header-font-size: 16px;
    --title-font-size: 30px;
  }
}
