/*
  Landing-page-only styles (redesigned 2026-09-17, trimmed 2026-09-19).

  Everything here is scoped under `.landing-page`, which only index.html
  carries, and everything left here is genuinely landing-only: the hero
  game, the chalk scenes, the marker annotations, the journey loop and the
  consultation block.

  The parts of this redesign the whole site now shares — the type tokens, the
  vertical drop shadows, the tags, the buttons, the nav and the card chrome —
  moved into style.css. Change those there, not here.
*/

/* ---------- Tokens ---------- */

.landing-page {
  /* Desktop minimum from the content's border box to the panel's inner
     bottom border. Reference: docs/homepage-design.md. */
  --section-min-bottom-gap: 42px;
  /* The chalk and marker colours, the swash and the yellow-only glow began
     here and are the whole site's now (style.css, 2026-11-15). */
}

.landing-page :where(a, button):focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 4px;
}

.landing-page .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Type ---------- */

/*
  This page's big titles (owner, 2026-10-25). They were in the dot-matrix
  Array, which visitors found hard to read. The hero's titles, short and loud,
  take the arcade face (Upheaval, capitals only); the section titles, longer
  sentences, take the display face (Pixel Operator, with lowercase).
  Balanced wrapping keeps a lone word off the last line.
*/
.landing-page .game-title,
.landing-page .section-heading h2,
.landing-page .consult-block h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.1;
  text-wrap: balance;
}

.landing-page .section-heading h2,
.landing-page .consult-block h2 {
  font-size: clamp(1.95rem, 3.2vw, 2.75rem);
  /* The pixel-font bold and spacing, as for every display-face title (style.css). */
  letter-spacing: 0.0625em;
  text-shadow: 0.0625em 0 0 currentColor;
}

.landing-page .feature-card h3,
.landing-page .journey-step h3 {
  text-wrap: balance;
}

/* Except around a circled figure: balanced, it starts a line and its circle
   runs into the line above. */
.landing-page h3:has(.marker-circle) {
  text-wrap: wrap;
}

/* The section titles carry no full stops (owner, 2026-10-29: the pixel face
   draws one as a low square that reads as an underscore). Two sentences in
   one title share its line, set apart by a spaced hyphen (owner, 2026-11-10). */

/* A phrase a title should break around, not inside. It still wraps within
   itself when it is wider than the line. */
.landing-page .phrase {
  display: inline-block;
}

.landing-page .journey-step h3 {
  margin: 0 0 8px;
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 1.15rem;
  line-height: 1.2;
}

.landing-page .journey-step p,
.landing-page .consult-copy p:not(.eyebrow) {
  color: var(--ink-soft);
  font-size: 1.06rem;
  line-height: 1.6;
  text-wrap: pretty;
}

/* The level chip and the illustration tag borrow the shared tag's face. */
.landing-page .journey-level,
.landing-page .art-placeholder-tag {
  font-family: "Bungee", var(--font-label);
  font-weight: 400;
  letter-spacing: 0.08em;
}

/* ---------- Header bar ---------- */

/*
  The header sits on a white bar with the cards' border and shadow
  (2026-10-25). On the bare background the nav text ran into the dot grid.
  Since 2026-11-10 the bar is drawn by ::before, and its two ends are caps:
  the logo on a black tile at the left, Log in (or the menu button) at the
  right, each the bar's full height with its corners (see Masthead below).
*/
.landing-page .site-header {
  --bar-height: 64px;
  --bar-radius: 18px;
  min-height: var(--bar-height);
  margin-bottom: 28px;
  padding: 0;
}

.landing-page .site-nav {
  gap: 26px;
}

/* Just above the menu button's breakpoint the full nav would wrap to a second
   row; slightly tighter, it stays on one. */
/* Four links since Student Tools (2026-11-11): tightened up to 1250px so
   the header keeps one row down to the 1000px menu breakpoint. */
@media (min-width: 1001px) and (max-width: 1250px) {
  .landing-page .site-nav {
    gap: 10px;
    font-size: 0.86rem;
  }
}

@media (min-width: 1001px) and (max-width: 1100px) {
  .landing-page .site-nav {
    gap: 6px;
    font-size: 0.78rem;
  }
}

/* ---------- Section snapping ---------- */

/*
  On desktop the page glides from panel to panel instead of scrolling as one
  long sheet (owner, 2026-10-25), with the browser's own scroll snapping.
  A wheel notch, a trackpad flick or an arrow key lands on the next panel's
  top; snap-stop keeps a hard flick from flying past more than one. The
  first stop is the top of the page, header and hero together; the last is
  the bottom of the page.

  The panels are spaced to fit a laptop window: at 150% display scaling a
  1920x1080 screen gives a window about 1280x665, and every panel then fits
  with room to spare. In a window too short for one, the browser lets the
  page scroll freely within that panel and snaps only at its edges, so
  nothing is ever out of reach. Phones and tablets keep plain scrolling.
  A wheel-paging script came first and was dropped: it had to guess where
  one trackpad flick's momentum ended and the next began, and real
  trackpads fooled it both ways. A second one, in the 2026-11 redesign,
  fought the browser's own snapping and was dropped too: snapping stays
  native. What makes it work is that every panel fits the window whole, which
  landing.js now ensures by zooming the page out on short windows (see
  Panel size and fitting the window, below).

  The first stop is the hero rather than the header (2026-11-10): the header
  became sticky, and a moving element makes no stable snap target. The
  padding keeps each snapped panel 100px down, clear of the floating header,
  scaled with the page's zoom.
*/
html:has(> body.landing-page) {
  scroll-padding-top: calc(100px * var(--fit, 1));
}

@media (min-width: 861px) {
  html:has(> body.landing-page) {
    scroll-snap-type: y mandatory;
  }

  /* About 25px off each panel's height, so it fits the window above. */
  .landing-page .content-block {
    padding-top: 28px;
    padding-bottom: 28px;
  }

  .landing-page .content-block .eyebrow {
    margin-bottom: 12px;
  }

  .landing-page .section-heading {
    margin-bottom: 22px;
  }

  .landing-page .content-block .section-kicker {
    margin-top: 8px;
  }

  .landing-page main > section {
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  /* The hero's stop is the very top of the page: the margin puts its snap
     position above the top, and the browser holds it there. Not the body:
     a snap area taller than the window makes every position inside it a
     valid stop, which let the page come to rest between panels. */
  .landing-page .hero {
    scroll-margin-top: 100vh;
  }

  /* The margin makes the last stop the very bottom of the page, below the
     page's own bottom padding; without it a notch up from the bottom moved
     just that padding's 56px. */
  .landing-page .site-footer {
    scroll-snap-align: end;
    scroll-snap-stop: always;
    scroll-margin-bottom: 100vh;
  }
}

/* ---------- Panels ---------- */

.landing-page .content-block {
  border-radius: 22px;
}

.landing-page .section-kicker {
  margin: 12px 0 0;
  font-size: clamp(1.05rem, 1.7vw, 1.3rem);
}

.landing-page .feature-card {
  border-radius: 18px;
}

/* The text sits under its title, not a paragraph's default gap away, and
   the card ends at its padding. */
.landing-page .feature-card p {
  margin: 0;
}

/* ---------- Hero game (2026-11-11) ---------- */

/*
  The hero is a level of a platform game, built on a plan (see the comment
  in index.html). The scene is drawn on a stage 1194 x 766 units big, and
  landing-hero.js scales it to the hero with --hero-scale, anchored to the
  bottom right; on desktop the copy scales by --copy-scale, anchored to the
  top left, and the hero fills the window under the header (--hero-height).

  Everything that moves is keyed to data-phase on the hero (the steps are
  listed in landing-hero.js), and the dialogue bar to data-step. The script
  lays the bricks out and sets the positions as custom properties, all in
  stage units. Each step's resting look is a plain rule; the animations only
  carry it there, so with reduced motion every step still shows correctly.

  The sprites are strips of frames (scripts/build-hero-sprites.mjs), four
  units to a pixel; a frame is chosen by sliding the strip.
*/
.landing-page .hero-game {
  --hero-scale: 1;
  --ground: 90px;
  /* The plan behind the scene, in blues that sit behind the sky's. */
  --plan-grid: #abdbea;
  --plan-line: #4d9bb8;
  --plan-brick: #eef9fc;
  --plan-ink: #1c5f7d;
  /* A brick: its face, the light on its top edge, the shade under it. */
  --brick: #fff6da;
  --brick-lit: #fffdf2;
  --brick-shade: #e8dcb8;
  --spring: cubic-bezier(0.3, 1.25, 0.5, 1);
  position: relative;
  display: flex;
  flex-direction: column;
  margin-bottom: 36px;
  overflow: hidden;
  border: 3px solid var(--ink);
  border-radius: 24px;
  background: var(--sky);
  box-shadow: var(--shadow);
}

.landing-page .game-view {
  position: relative;
  overflow: hidden;
}

/* Without the script, the copy alone. */
.landing-page .hero-game:not(.is-ready) :is(.game-view, .game-legend) {
  display: none;
}

/* ---- The plan ---- */

/* Every topic as a wall of bricks, one per atom, with the prerequisite links
   between them (scripts/build-hero-map.mjs). It pans slowly from end to end,
   and is held back behind the copy: the two fades together leave the top
   left faint and everything right of it or below it clear. */
.landing-page .game-map {
  position: absolute;
  inset: 0 0 calc(var(--ground) * var(--hero-scale));
  overflow: hidden;
  -webkit-mask-image:
    linear-gradient(90deg, rgba(0, 0, 0, 0.1) 0 50%, #000 61%),
    linear-gradient(rgba(0, 0, 0, 0.1) 0 72%, #000 84%);
  mask-image:
    linear-gradient(90deg, rgba(0, 0, 0, 0.1) 0 50%, #000 61%),
    linear-gradient(rgba(0, 0, 0, 0.1) 0 72%, #000 84%);
}

.landing-page .game-map-pan {
  position: absolute;
  left: 0;
  bottom: 0;
  width: calc(2200px * var(--hero-scale));
  height: calc(676px * var(--hero-scale));
  animation: map-pan 150s ease-in-out infinite alternate;
}

@keyframes map-pan {
  to { transform: translateX(var(--map-shift, 0px)); }
}

.landing-page .game-map-art {
  display: block;
  width: 100%;
  height: 100%;
}

.landing-page .game-map-art .map-grid {
  fill: none;
  stroke: var(--plan-grid);
  stroke-width: 2;
}

.landing-page .game-map-art .map-link {
  fill: none;
  stroke: var(--plan-line);
  stroke-width: 2.5;
  stroke-dasharray: 7 5;
}

.landing-page .game-map-art .map-head {
  fill: var(--plan-line);
}

.landing-page .game-map-art .map-bricks {
  fill: var(--plan-brick);
  stroke: var(--plan-line);
  stroke-width: 1.5;
}

.landing-page .game-map-art .map-name {
  fill: var(--plan-ink);
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 0.0625em;
  text-anchor: middle;
}

/* The gap in the plan's Quadratic Equations: ringed while the brick is
   missing from the pillar, filled once it is back. */
.landing-page .game-map-art .map-gap {
  fill: var(--sky);
  stroke: var(--ink);
  stroke-width: 1.5;
  stroke-dasharray: 3 2;
}

.landing-page .game-map-art .map-gap-ring {
  fill: none;
  stroke: var(--yellow);
  stroke-width: 4;
  transform-box: fill-box;
  transform-origin: center;
  animation: gap-ring 1.6s ease-in-out infinite;
}

@keyframes gap-ring {
  50% { transform: scale(1.18); }
}

.landing-page .hero-game:is([data-phase="settle"], [data-phase="jump"], [data-phase="done"], [data-phase="fade"]) .map-gap {
  fill: var(--yellow);
  stroke-dasharray: none;
}

.landing-page .hero-game:is([data-phase="settle"], [data-phase="jump"], [data-phase="done"], [data-phase="fade"]) .map-gap-ring {
  opacity: 0;
}

/* ---- The sky's haze and the ground ---- */

.landing-page .game-haze {
  position: absolute;
  inset: auto 0 calc(var(--ground) * var(--hero-scale));
  height: calc(64px * var(--hero-scale));
  background: linear-gradient(to top, rgba(255, 255, 255, 0.3) 0 50%, rgba(255, 255, 255, 0.14) 50%);
  pointer-events: none;
}

/* A kerb of stones over packed earth. Sized in the stage's units, so it
   scales with the scene. */
.landing-page .game-ground {
  --u: calc(1px * var(--hero-scale));
  position: absolute;
  inset: auto 0 0;
  height: calc(var(--ground) * var(--hero-scale));
  border-top: calc(4 * var(--u)) solid var(--ink);
  background-color: #3b3127;
  background-image:
    repeating-linear-gradient(90deg, transparent 0 calc(52 * var(--u)), #2c241c calc(52 * var(--u)) calc(56 * var(--u))),
    linear-gradient(#8a775f 0 calc(4 * var(--u)), #6a5945 calc(4 * var(--u)) calc(12 * var(--u)), #2c241c calc(12 * var(--u)) calc(16 * var(--u)), transparent calc(16 * var(--u))),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' shape-rendering='crispEdges'%3E%3Cpath fill='%234b3f32' d='M2 7h3v1h-3zM14 3h2v1h-2zM19 15h3v1h-3zM8 19h2v1h-2zM11 11h1v1h-1z'/%3E%3Cpath fill='%232e261d' d='M8 10h3v1h-3zM20 6h2v1h-2zM2 20h3v1h-3zM14 21h2v1h-2zM5 14h1v1h-1zM17 10h1v1h-1z'/%3E%3C/svg%3E");
  background-size: auto calc(12 * var(--u)), auto, calc(96 * var(--u)) calc(96 * var(--u));
  background-repeat: repeat-x, no-repeat, repeat;
}

/* ---- The stage ---- */

/* Only its buttons take the pointer, so the copy beside the pillars stays
   clickable. Between rounds it fades out and back in with the next gap. */
.landing-page .game-stage {
  position: absolute;
  right: var(--stage-shift, 0px);
  bottom: 0;
  width: 1194px;
  height: 766px;
  transform: scale(var(--hero-scale));
  transform-origin: right bottom;
  pointer-events: none;
  transition: opacity 0.4s;
}

.landing-page .game-stage button {
  pointer-events: auto;
}

.landing-page .hero-game[data-phase="fade"] .game-stage {
  opacity: 0;
}

/* The jolt as the brick lands. */
.landing-page .game-stage.is-shaking {
  animation: stage-shake 0.3s steps(1);
}

@keyframes stage-shake {
  0% { transform: scale(var(--hero-scale)) translate(0, 3px); }
  25% { transform: scale(var(--hero-scale)) translate(-2px, -2px); }
  50% { transform: scale(var(--hero-scale)) translate(2px, 1px); }
  75% { transform: scale(var(--hero-scale)) translate(-1px, 0); }
}

/* ---- The pillars ---- */

.landing-page .pillar {
  position: absolute;
  left: var(--x);
  top: var(--top);
  width: var(--w);
  height: var(--h);
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

/* Quadratics takes a click only while it leans (and, with reduced motion,
   whenever it rests). */
.landing-page .pillar.is-broken:not(.is-leaning) {
  cursor: default;
}

.landing-page .pillar:focus-visible {
  outline: 3px dashed var(--ink);
  outline-offset: 10px;
}

/* Its shadow on the kerb. */
.landing-page .pillar::after {
  content: "";
  position: absolute;
  inset: auto -8px -10px;
  height: 6px;
  background: rgba(23, 20, 15, 0.3);
}

.landing-page :is(.pillar-row, .pillar-cap) {
  position: absolute;
  left: 0;
  bottom: var(--bottom);
  width: 100%;
  height: 30px;
  transform: translateY(var(--lift, 0px)) rotate(var(--tilt, 0deg));
  transform-origin: var(--pivot, 50% 50%);
  transition: transform 0.75s var(--spring);
}

/* The leaning stack creaks now and then: it is what to click. */
.landing-page :is(.pillar-row, .pillar-cap).is-over {
  animation: lean-sway 3.2s ease-in-out 1.4s infinite;
}

@keyframes lean-sway {
  0%, 58%, 100% { transform: translateY(var(--lift, 0px)) rotate(var(--tilt, 0deg)); }
  68% { transform: translateY(var(--lift, 0px)) rotate(calc(var(--tilt, 0deg) + 1.8deg * var(--sway, 1))); }
  78% { transform: translateY(var(--lift, 0px)) rotate(calc(var(--tilt, 0deg) - 1deg * var(--sway, 1))); }
  88% { transform: translateY(var(--lift, 0px)) rotate(calc(var(--tilt, 0deg) + 0.5deg * var(--sway, 1))); }
}

/* The topic's name, on a capital a little wider than the pillar. */
.landing-page .pillar-cap {
  left: -8px;
  width: calc(100% + 16px);
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 4px;
  border: 3px solid var(--ink);
  border-radius: 4px;
  background: var(--paper);
  box-shadow: inset 0 6px 0 var(--yellow), inset 0 -5px 0 #e8dfc4;
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.0625em;
  text-shadow: 0.0625em 0 0 currentColor;
  white-space: nowrap;
}

.landing-page .pillar:not(.is-broken):hover .pillar-cap,
.landing-page .pillar.is-leaning:hover .pillar-cap {
  background: var(--yellow-soft);
}

.landing-page .pillar:not(.is-broken):active,
.landing-page .pillar.is-leaning:active {
  translate: 0 2px;
}

/* A brick's label shows only when its pillar is opened up. */
.landing-page .brick {
  position: absolute;
  top: 0;
  left: var(--bx);
  width: var(--bw);
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 2px;
  border: 2px solid var(--ink);
  background: var(--brick);
  box-shadow: inset 0 2px 0 var(--brick-lit), inset 0 -5px 0 var(--brick-shade);
  color: transparent;
  font: 600 15px/1 var(--font-label);
  white-space: nowrap;
  transform: translateX(var(--slide, 0px));
  transition:
    transform 0.75s var(--spring),
    background-color 0.3s,
    opacity 0.3s,
    color 0.25s;
}

/* Some bricks are fired a shade darker, as in any wall. */
.landing-page .pillar-row:nth-child(3n) .brick:nth-child(odd),
.landing-page .pillar-row:nth-child(4n + 1) .brick:nth-child(even) {
  --brick: #fdefc4;
  --brick-shade: #e2d3a6;
}

.landing-page .pillar.is-open .brick {
  color: var(--ink);
  transition:
    transform 0.75s var(--spring),
    background-color 0.3s,
    opacity 0.3s,
    color 0.25s 0.3s;
}

/* Each row lights as the scan's line reads it. */
.landing-page .hero-game[data-phase="scan"] .pillar.is-broken .brick:not(.is-missing) {
  animation: brick-read 0.55s var(--read-delay, 1s);
}

@keyframes brick-read {
  0%, 30% { background-color: var(--yellow); box-shadow: inset 0 2px 0 #fff3a0, inset 0 -5px 0 #c9a90e; }
}

/* The missing brick: a hole, then the slot the scan finds, then filled. */
.landing-page .brick.is-missing {
  opacity: 0;
}

.landing-page .hero-game[data-phase="scan"] .brick.is-missing {
  animation: brick-spot 0.7s var(--spot-delay, 1s) both;
}

.landing-page .hero-game:is([data-phase="bring"], [data-phase="ready"], [data-phase="place"]) .brick.is-missing {
  opacity: 1;
  border: 3px dashed var(--ink);
  background: rgba(255, 240, 168, 0.7);
  box-shadow: none;
  color: transparent;
  animation: slot-wait 1.2s ease-in-out infinite;
}

@keyframes brick-spot {
  0% { opacity: 0; }
  25%, 75%, 100% { opacity: 1; border: 3px dashed var(--ink); background: rgba(255, 240, 168, 0.7); box-shadow: none; color: transparent; }
  50% { opacity: 0.25; border: 3px dashed var(--ink); background: rgba(255, 240, 168, 0.7); box-shadow: none; color: transparent; }
}

@keyframes slot-wait {
  50% { background: rgba(246, 213, 27, 0.75); }
}

.landing-page .hero-game:is([data-phase="settle"], [data-phase="jump"], [data-phase="done"], [data-phase="fade"]) .brick.is-missing {
  opacity: 1;
  background: var(--yellow);
  box-shadow: inset 0 2px 0 #fff3a0, inset 0 -5px 0 #c9a90e;
  transition: transform 0.75s var(--spring);
}

.landing-page .hero-game[data-phase="settle"] .brick.is-missing {
  animation: brick-land 0.45s;
}

@keyframes brick-land {
  0% { background: var(--paper); box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.9); scale: 1.12 0.8; }
  40% { scale: 0.96 1.08; }
}

/* A ring thrown out from the slot as the scan finds it. */
.landing-page .game-ping {
  position: absolute;
  left: calc(var(--ping-x) - 34px);
  top: calc(var(--ping-y) - 24px);
  width: 68px;
  height: 48px;
  border: 4px solid var(--yellow);
  outline: 2px solid var(--ink);
  border-radius: 6px;
  opacity: 0;
}

.landing-page .hero-game[data-phase="scan"] .game-ping {
  animation: ping 0.9s var(--ping-delay, 1.6s) 2;
}

@keyframes ping {
  0% { opacity: 1; transform: scale(0.7); }
  100% { opacity: 0; transform: scale(2.1); }
}

/* ---- The tutor and the brick they carry ---- */

/* Both wait out of view, past its left edge (--walk-edge); they walk in
   together, and stop in front of Equations. */
.landing-page :is(.game-tutor, .game-brick) {
  position: absolute;
  visibility: hidden;
  transform: translateX(calc(var(--walk-edge, -400px) - var(--tutor-x)));
}

.landing-page .hero-game:not([data-phase="idle"], [data-phase="split"], [data-phase="scan"]) .game-tutor,
.landing-page .hero-game:is([data-phase="bring"], [data-phase="ready"], [data-phase="place"]) .game-brick {
  visibility: visible;
  transform: none;
}

.landing-page .hero-game[data-phase="bring"] :is(.game-tutor, .game-brick) {
  transition: transform 1.9s linear;
}

.landing-page .game-tutor {
  left: var(--tutor-x);
  top: var(--tutor-y);
  width: 72px;
  height: 120px;
}

/* Frames: rest, carry, step, toss, glad. */
.landing-page .game-tutor-art {
  display: block;
  width: 72px;
  height: 120px;
  background: url("/assets/images/hero/tutor.svg") 0 0 / 360px 120px no-repeat;
}

.landing-page .hero-game[data-phase="bring"] .game-tutor-art {
  background-position: -72px 0;
  animation: tutor-walk 0.36s steps(1) infinite;
}

@keyframes tutor-walk {
  50% { background-position: -144px 0; transform: translateY(-4px); }
}

.landing-page .hero-game[data-phase="ready"] .game-tutor-art {
  background-position: -72px 0;
  animation: carry-bob 1.4s steps(1) infinite;
}

@keyframes carry-bob {
  50% { transform: translateY(-4px); }
}

.landing-page .hero-game[data-phase="place"] .game-tutor-art {
  background-position: -216px 0;
}

.landing-page .hero-game:is([data-phase="done"], [data-phase="fade"]) .game-tutor-art {
  background-position: -288px 0;
  animation: carry-bob 0.5s steps(1) infinite;
}

.landing-page .game-brick {
  left: var(--loose-x);
  top: var(--loose-y);
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.landing-page .game-brick:disabled {
  cursor: default;
}

.landing-page .game-brick:focus-visible {
  outline: 3px dashed var(--ink);
  outline-offset: 6px;
}

/* Two boxes, so the throw is an arc: across steadily (the button), up and
   over and down into the slot (its face). */
.landing-page .game-brick-face {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--loose-w);
  height: 32px;
  padding-bottom: 2px;
  border: 2px solid var(--ink);
  background: var(--yellow);
  box-shadow: inset 0 2px 0 #fff3a0, inset 0 -5px 0 #c9a90e;
  color: var(--ink);
  font: 600 15px/1 var(--font-label);
  white-space: nowrap;
}

.landing-page .hero-game[data-phase="bring"] .game-brick-face {
  animation: tutor-step 0.36s steps(1) infinite;
}

@keyframes tutor-step {
  50% { transform: translateY(-4px); }
}

.landing-page .hero-game[data-phase="ready"] .game-brick-face {
  animation: carry-bob 1.4s steps(1) infinite, brick-glow 1.1s ease-in-out infinite;
}

.landing-page .hero-game[data-phase="ready"] .game-brick:hover .game-brick-face {
  background: #ffe45c;
}

@keyframes brick-glow {
  0%, 100% { box-shadow: inset 0 2px 0 #fff3a0, inset 0 -5px 0 #c9a90e, 0 0 0 0 rgba(246, 213, 27, 0.95); }
  50% { box-shadow: inset 0 2px 0 #fff3a0, inset 0 -5px 0 #c9a90e, 0 0 0 10px rgba(246, 213, 27, 0); }
}

.landing-page .hero-game[data-phase="place"] .game-brick {
  transform: translateX(var(--fly-x));
  transition: transform 0.8s linear;
}

.landing-page .hero-game[data-phase="place"] .game-brick-face {
  transform: translateY(var(--fly-y));
  animation: brick-fly 0.8s both;
}

@keyframes brick-fly {
  0% { transform: translateY(0) rotate(0deg); animation-timing-function: cubic-bezier(0.2, 0.7, 0.5, 1); }
  48% { transform: translateY(var(--fly-peak)) rotate(-8deg); animation-timing-function: cubic-bezier(0.5, 0, 0.9, 0.5); }
  100% { transform: translateY(var(--fly-y)) rotate(0deg); }
}

/* ---- The student and the flag ---- */

.landing-page .game-kid {
  position: absolute;
  left: var(--kid-x);
  top: var(--kid-y);
  width: 64px;
  height: 100px;
}

/* Frames: stand, blink, jump, cheer. */
.landing-page .game-kid-art {
  display: block;
  width: 64px;
  height: 100px;
  background: url("/assets/images/hero/kid.svg") 0 0 / 256px 100px no-repeat;
  transform-origin: 50% 100%;
  animation: kid-blink 3.8s steps(1) infinite;
}

@keyframes kid-blink {
  93% { background-position: -64px 0; }
  96% { background-position: 0 0; }
}

/* The hop: across to Quadratics, a beat, across to Functions. The outer box
   travels; the art squashes at each take-off and landing, and changes frame. */
.landing-page .hero-game[data-phase="jump"] .game-kid {
  animation: kid-hop 1.7s 0.15s both;
}

.landing-page .hero-game[data-phase="jump"] .game-kid-art {
  animation: kid-pose 1.7s 0.15s steps(1) both, kid-squash 1.7s 0.15s both;
}

.landing-page .hero-game:is([data-phase="done"], [data-phase="fade"]) .game-kid {
  transform: translate(var(--hop2-x), var(--hop2-y));
}

.landing-page .hero-game:is([data-phase="done"], [data-phase="fade"]) .game-kid-art {
  background-position: -192px 0;
  animation: carry-bob 0.5s steps(1) infinite;
}

@keyframes kid-hop {
  0% { transform: translate(0, 0); animation-timing-function: cubic-bezier(0.2, 0.6, 0.4, 1); }
  22% { transform: translate(var(--peak1-x), var(--peak1-y)); animation-timing-function: cubic-bezier(0.6, 0, 0.8, 0.4); }
  44%, 54% { transform: translate(var(--hop1-x), var(--hop1-y)); }
  54% { animation-timing-function: cubic-bezier(0.2, 0.6, 0.4, 1); }
  76% { transform: translate(var(--peak2-x), var(--peak2-y)); animation-timing-function: cubic-bezier(0.6, 0, 0.8, 0.4); }
  100% { transform: translate(var(--hop2-x), var(--hop2-y)); }
}

@keyframes kid-pose {
  0% { background-position: 0 0; }
  3% { background-position: -128px 0; }
  44% { background-position: 0 0; }
  57% { background-position: -128px 0; }
  100% { background-position: -192px 0; }
}

@keyframes kid-squash {
  0% { transform: scale(1.14, 0.82); }
  6% { transform: scale(0.9, 1.12); }
  22% { transform: scale(1, 1); }
  42% { transform: scale(0.94, 1.08); }
  45% { transform: scale(1.16, 0.8); }
  50% { transform: scale(1, 1); }
  54% { transform: scale(1.14, 0.82); }
  60% { transform: scale(0.9, 1.12); }
  76% { transform: scale(1, 1); }
  97% { transform: scale(0.94, 1.08); }
  100% { transform: scale(1.16, 0.8); }
}

/* What the student thinks, over their head. Frames: ?, !, a heart. */
.landing-page .game-emote {
  position: absolute;
  left: 16px;
  top: -56px;
  width: 44px;
  height: 52px;
  background: url("/assets/images/hero/emote.svg") 0 0 / 132px 52px no-repeat;
  opacity: 0;
  transform: translateY(10px) scale(0.5);
  transform-origin: 50% 100%;
  transition: opacity 0.12s, transform 0.25s var(--spring);
}

.landing-page .hero-game:is([data-phase="idle"], [data-phase="bring"], [data-phase="done"]) .game-emote {
  opacity: 1;
  transform: none;
  transition-delay: 0.6s;
  animation: carry-bob 1.2s steps(1) 1s infinite;
}

.landing-page .hero-game[data-phase="bring"] .game-emote {
  background-position: -44px 0;
  transition-delay: 0.2s;
}

.landing-page .hero-game[data-phase="done"] .game-emote {
  background-position: -88px 0;
  transition-delay: 0.1s;
}

/* The flag: a pole with its cloth, low until the student arrives. */
.landing-page .game-flag {
  position: absolute;
  left: var(--flag-x);
  top: var(--flag-y);
  width: 8px;
  height: 118px;
  background: var(--ink);
}

.landing-page .game-flag::before {
  content: "";
  position: absolute;
  left: -6px;
  top: -10px;
  width: 20px;
  height: 14px;
  border: 3px solid var(--ink);
  background: var(--yellow);
}

.landing-page .game-cloth {
  position: absolute;
  left: 8px;
  top: 66px;
  width: 60px;
  height: 48px;
  background: url("/assets/images/hero/flag.svg") 0 0 / 120px 48px no-repeat;
  animation: flag-wave 0.9s steps(1) infinite;
  transition: transform 0.6s cubic-bezier(0.3, 1.4, 0.5, 1);
}

@keyframes flag-wave {
  50% { background-position: -60px 0; }
}

.landing-page .hero-game[data-phase="jump"] .game-cloth {
  transform: translateY(-58px);
  transition-delay: 1.75s;
}

.landing-page .hero-game:is([data-phase="done"], [data-phase="fade"]) .game-cloth {
  transform: translateY(-58px);
}

/* ---- The AI scan ---- */

/* A line that reads down the opened pillar, a glow trailing above it, under
   a tag with its name. At the level with the empty slot it stops and opens
   into a box round that level, which stays until the brick is home. The box
   is the resting look; the line is where the animations start from. */
.landing-page .game-scan {
  position: absolute;
  left: var(--box-x);
  top: var(--box-y);
  width: var(--box-w);
  height: var(--box-h);
  border: 4px solid var(--yellow);
  border-radius: 4px;
  background: rgba(246, 213, 27, 0.14);
  box-shadow: 0 0 0 2px var(--ink), inset 0 0 0 2px var(--ink);
  opacity: 0;
  transition: opacity 0.2s;
}

.landing-page .hero-game:is([data-phase="scan"], [data-phase="bring"], [data-phase="ready"], [data-phase="place"]) .game-scan {
  opacity: 1;
}

.landing-page .game-scan::before {
  content: "";
  position: absolute;
  inset: auto 0 100%;
  height: 56px;
  background: linear-gradient(to top, rgba(246, 213, 27, 0.55), rgba(246, 213, 27, 0));
  opacity: 0;
}

.landing-page .game-scan::after {
  content: "AI";
  position: absolute;
  left: -6px;
  bottom: calc(100% + 4px);
  padding: 6px 6px 4px 7px;
  background: var(--ink);
  color: var(--yellow);
  font: 400 10px/1 "Press Start 2P", monospace;
}

.landing-page .hero-game[data-phase="scan"] .game-scan {
  animation:
    scan-in 0.15s 0.25s both,
    scan-sweep var(--scan-time, 1.5s) 0.25s linear both,
    scan-box 0.4s calc(0.25s + var(--scan-time, 1.5s)) var(--spring) both;
}

.landing-page .hero-game[data-phase="scan"] .game-scan::before {
  animation: scan-glow var(--scan-time, 1.5s) 0.25s linear both;
}

.landing-page .hero-game[data-phase="scan"] .game-scan::after {
  animation: scan-tag 0.4s calc(0.25s + var(--scan-time, 1.5s)) both;
}

@keyframes scan-in {
  from { opacity: 0; }
}

@keyframes scan-sweep {
  from { translate: 0 calc(var(--scan-y) - var(--scan-stop)); }
}

@keyframes scan-box {
  from {
    left: var(--scan-x);
    top: var(--scan-stop);
    width: var(--scan-w);
    height: 6px;
    border-width: 0;
    border-radius: 0;
    background: var(--yellow);
    box-shadow: 0 0 0 2px var(--ink), inset 0 0 0 0 var(--ink);
  }
}

@keyframes scan-glow {
  0%, 92% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes scan-tag {
  from { left: -2px; bottom: calc(100% + 2px); }
}

/* ---- Dust, sparks and confetti ---- */

.landing-page .game-fx i {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--s);
  height: var(--s);
  margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2);
  background: var(--c);
  animation: bit-fly var(--life) cubic-bezier(0.15, 0.7, 0.4, 1) forwards;
}

.landing-page .game-fx i.is-arc {
  animation: bit-arc var(--life) linear forwards;
}

@keyframes bit-fly {
  70% { opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)); opacity: 0; }
}

@keyframes bit-arc {
  0% { animation-timing-function: cubic-bezier(0.2, 0.7, 0.5, 1); }
  35% { transform: translate(calc(var(--dx) * 0.5), var(--up)); animation-timing-function: cubic-bezier(0.5, 0, 0.9, 0.5); }
  80% { opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)); opacity: 0; }
}

/* ---- The dialogue bar ---- */

/* A light plate set into the ground, across the view (not on the stage, so
   it has the whole width however the stage is scaled; --say-scale sizes
   it). It rises as the round starts and sinks when it ends. The newest line
   is typed out at its left, large, under its icon; the lines before fold
   into two short rows and move along to the right, so by the flag all
   three are there to read. */
.landing-page .game-says {
  position: absolute;
  left: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(100% / var(--say-scale, 1));
  height: calc(var(--ground) * var(--hero-scale) / var(--say-scale, 1));
  /* Clear of the pause button at the ground's right-hand end, and as much
     on the left so the plate sits in the middle. */
  padding: 6px calc(72px / var(--say-scale, 1)) 0;
  transform: scale(var(--say-scale, 1));
  transform-origin: left bottom;
  pointer-events: none;
}

.landing-page .game-says-bar {
  display: flex;
  align-items: center;
  height: 62px;
  padding: 0 16px 3px 8px;
  border: 3px solid var(--ink);
  border-radius: 10px;
  background: var(--paper);
  box-shadow: inset 0 -5px 0 #e8dfc4, 0 5px 0 rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.2s, transform 0.3s var(--spring);
}

.landing-page .hero-game[data-step] .game-says-bar {
  opacity: 1;
  transform: none;
}

/* A line: nothing until its step, then the newest, then one of the earlier. */
.landing-page .game-say {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 0;
  margin: 0;
  overflow: hidden;
  opacity: 0;
  color: var(--ink);
  font: 400 22px/1 var(--font-display);
  letter-spacing: 0.0625em;
  white-space: nowrap;
  transition: max-width 0.45s cubic-bezier(0.3, 1, 0.4, 1), opacity 0.2s;
}

.landing-page .hero-game[data-step="map"] .game-say[data-step="map"],
.landing-page .hero-game[data-step="ai"] .game-say[data-step="ai"],
.landing-page .hero-game[data-step="tutor"] .game-say[data-step="tutor"] {
  max-width: 480px;
  opacity: 1;
}

.landing-page .hero-game[data-step="ai"] .game-say[data-step="map"],
.landing-page .hero-game[data-step="tutor"] .game-say:is([data-step="map"], [data-step="ai"]) {
  gap: 8px;
  max-width: 240px;
  margin-left: 16px;
  padding-left: 16px;
  border-left: 2px dashed #b9ae8c;
  opacity: 1;
  font-size: 16px;
  line-height: 1.2;
}

/* Its icon, on a dark tile. Frames: the plan, the review, the tutor with
   the student. */
.landing-page .game-say-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 45px;
  height: 45px;
  border-radius: 6px;
  background: var(--ink);
}

.landing-page .game-say-icon::before {
  content: "";
  width: 33px;
  height: 33px;
  background: url("/assets/images/hero/icon.svg") 0 0 / 300% 100% no-repeat;
}

.landing-page .game-say[data-step="ai"] .game-say-icon::before { background-position: 50% 0; }
.landing-page .game-say[data-step="tutor"] .game-say-icon::before { background-position: 100% 0; }

.landing-page .hero-game[data-step="ai"] .game-say[data-step="map"] .game-say-icon,
.landing-page .hero-game[data-step="tutor"] .game-say:is([data-step="map"], [data-step="ai"]) .game-say-icon {
  width: 30px;
  height: 30px;
  border-radius: 4px;
}

.landing-page .hero-game[data-step="ai"] .game-say[data-step="map"] .game-say-icon::before,
.landing-page .hero-game[data-step="tutor"] .game-say:is([data-step="map"], [data-step="ai"]) .game-say-icon::before {
  width: 22px;
  height: 22px;
}

/* The words that matter are run over with the highlighter. */
.landing-page .game-say b {
  padding: 3px 5px 1px;
  background: var(--yellow);
  font-weight: 400;
}

/* The newest line types itself out. */
.landing-page .hero-game[data-step="map"] .game-say[data-step="map"] .game-say-text,
.landing-page .hero-game[data-step="ai"] .game-say[data-step="ai"] .game-say-text,
.landing-page .hero-game[data-step="tutor"] .game-say[data-step="tutor"] .game-say-text {
  animation: say-type 0.5s steps(14) 0.15s both;
}

@keyframes say-type {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}

/* An earlier line: its plain words over its highlighted ones. */
.landing-page .hero-game[data-step="ai"] .game-say[data-step="map"] .game-say-text,
.landing-page .hero-game[data-step="tutor"] .game-say:is([data-step="map"], [data-step="ai"]) .game-say-text {
  animation: say-fold 0.45s both;
}

.landing-page .hero-game[data-step="ai"] .game-say[data-step="map"] b,
.landing-page .hero-game[data-step="tutor"] .game-say:is([data-step="map"], [data-step="ai"]) b {
  display: block;
  width: fit-content;
  margin-top: 1px;
  padding: 2px 4px 0;
  background: var(--yellow-soft);
}

@keyframes say-fold {
  0%, 45% { opacity: 0; }
}

/* A pip per step so far, where there is only room for the newest line
   (phones). */
.landing-page .game-pips {
  display: none;
  gap: 6px;
  margin-left: auto;
}

.landing-page .game-pips i {
  width: 10px;
  height: 10px;
  background: #d5ccb0;
}

.landing-page .hero-game[data-step] .game-pips i:first-child,
.landing-page .hero-game:is([data-step="ai"], [data-step="tutor"]) .game-pips i:nth-child(2),
.landing-page .hero-game[data-step="tutor"] .game-pips i:nth-child(3) {
  background: var(--ink);
}

/* ---- The click hints ---- */

/* A pointing hand and a tag, on whatever takes the next click. */
.landing-page .game-hint {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}

.landing-page .game-hint b {
  padding: 5px 6px 3px 7px;
  border: 2px solid var(--ink);
  background: var(--yellow);
  box-shadow: 0 3px 0 var(--ink);
  color: var(--ink);
  font: 400 10px/1 "Press Start 2P", monospace;
}

.landing-page .game-hint b::after {
  content: "CLICK";
}

@media (hover: none) {
  .landing-page .game-hint b::after {
    content: "TAP";
  }
}

.landing-page .game-hand {
  display: block;
  width: 39px;
  height: 39px;
  background: url("/assets/images/hero/hand.svg") 0 0 / 39px 39px no-repeat;
  animation: hand-poke 0.9s ease-in-out infinite;
}

@keyframes hand-poke {
  50% { translate: 0 7px; }
}

/* Under the pillar's side, pointing up at it. */
.landing-page .game-hint-pillar {
  left: calc(var(--hint-x) - 26px);
  top: var(--hint-y);
}

/* Left of the brick, pointing across at it: over the brick is the pillar
   the tutor stands in front of. */
.landing-page .game-hint-brick {
  right: calc(1194px - var(--tap-x));
  top: calc(var(--tap-y) - 20px);
  flex-direction: row;
  gap: 8px;
}

.landing-page .game-hint-brick .game-hand {
  rotate: 90deg;
  animation-name: hand-poke-across;
}

@keyframes hand-poke-across {
  50% { translate: 7px 0; }
}

.landing-page .hero-game[data-phase="idle"] .game-hint-pillar {
  opacity: 1;
  transition-delay: 1.2s;
}

.landing-page .hero-game[data-phase="ready"] .game-hint-brick {
  opacity: 1;
  transition-delay: 0.3s;
}

/* ---- Pause ---- */

/* The scene plays by itself, so it can be stopped: a small button set in
   the ground's right-hand end, clear of the plan and the pillars. Hidden
   with reduced motion, where nothing plays. */
.landing-page .game-pause {
  position: absolute;
  z-index: 2;
  right: 16px;
  bottom: calc((var(--ground) * var(--hero-scale) - 42px) / 2);
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 3px solid var(--ink);
  border-radius: 10px;
  background: var(--paper);
  box-shadow: 0 4px 0 var(--ink);
  cursor: pointer;
}

.landing-page .game-pause:hover {
  background: var(--yellow-soft);
}

.landing-page .game-pause:active {
  translate: 0 3px;
  box-shadow: 0 1px 0 var(--ink);
}

.landing-page .game-pause span {
  width: 12px;
  height: 14px;
  border: solid var(--ink);
  border-width: 0 4px;
}

.landing-page .game-pause[aria-pressed="true"] span {
  width: 0;
  height: 0;
  margin-left: 3px;
  border-width: 8px 0 8px 13px;
  border-color: transparent transparent transparent var(--ink);
}

.landing-page .hero-game.is-paused *,
.landing-page .hero-game.is-paused *::before,
.landing-page .hero-game.is-paused *::after {
  animation-play-state: paused !important;
}

/* ---- The copy ---- */

.landing-page .game-copy {
  position: relative;
  z-index: 1;
}

/* The kicker is a tag like the later panels' (.eyebrow, style.css). */
.landing-page .game-kicker {
  margin: 0;
}

.landing-page .game-titles {
  display: grid;
  margin-top: 16px;
}

/* The two titles share one cell, so the copy never jumps when they swap:
   one fades out, then the other's first line fades in and its punchline is
   typed. They swap as a round of the game ends (landing.js), so the title
   and the scene change together. */
.landing-page .game-title {
  grid-area: 1 / 1;
  margin: 0;
  font-family: var(--font-arcade);
  font-size: clamp(2.1rem, 9vw, 3.25rem);
  line-height: 1.12;
  letter-spacing: 0;
  text-shadow: none;
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.landing-page .hero-game.is-ready .game-title:not(.is-active) {
  opacity: 0;
  visibility: hidden;
}

.landing-page .hero-game.is-ready .game-title.is-active {
  transition: opacity 0.3s ease 0.4s;
}

.landing-page .hero-game:not(.is-ready) .game-title + .game-title {
  display: none;
}

/* Each line is as wide as its words, so the scene is fitted round the
   words and not the column (sizeHeroGame). */
.landing-page .hero-line {
  display: block;
  width: fit-content;
}

/* The punchline, lifted off the sky on a hard yellow shadow (the arcade
   face has one weight and no italic). Each letter arrives as the caret's
   block, then shows. */
.landing-page .hero-punch {
  text-shadow: 0.07em 0.07em 0 var(--yellow);
}

.landing-page .hero-game.is-ready .game-title.is-active .hero-char {
  animation: char-type 0.1s linear calc(0.9s + var(--i) * 0.055s) both;
}

@keyframes char-type {
  from { opacity: 0; }
  1%, 99% { opacity: 1; background-color: var(--ink); text-shadow: none; }
}

/* The pitch: the line and, under it, the button at the line's width, then
   the log-in link (owner). The box is as wide as the line; on a phone,
   where the line wraps, that is the column. */
.landing-page .game-pitch {
  width: fit-content;
  max-width: 100%;
}

.landing-page .game-pitch .hero-actions {
  flex-flow: column nowrap;
  align-items: stretch;
  gap: 6px;
}

.landing-page .game-pitch .hero-actions > a:not(.button) {
  align-self: flex-start;
}

.landing-page .game-lede {
  width: fit-content;
  margin: 16px 0 0;
  font-size: clamp(1.1rem, 1.6vw, 1.45rem);
  line-height: 1.35;
}

/* The plan's legend: what it is, and what its marks mean, drawn as the plan
   draws them. On desktop it is a plate in the hero's top right corner, on
   the plan and away from the copy's buttons (owner). */
.landing-page .game-legend {
  margin: 0 20px 20px;
  padding: 10px 14px 11px;
  border: 3px solid var(--ink);
  border-radius: 10px;
  background: var(--paper);
}

.landing-page .game-legend-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
}

.landing-page .game-legend-keys {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin: 8px 0 0;
  padding: 8px 0 0;
  border-top: 2px dashed var(--plan-line);
  list-style: none;
  font-size: 0.9rem;
  line-height: 1.2;
}

.landing-page .game-legend-keys li {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.landing-page .game-legend-keys svg {
  flex: none;
  height: 14px;
}

.landing-page .game-legend-keys .key-brick {
  fill: var(--plan-brick);
  stroke: var(--plan-line);
  stroke-width: 1.5;
}

.landing-page .game-legend-keys .key-link {
  fill: none;
  stroke: var(--plan-line);
  stroke-width: 2.5;
  stroke-dasharray: 5 3;
}

.landing-page .game-legend-keys .key-head {
  fill: var(--plan-line);
}

.landing-page .game-legend-keys .key-ring {
  fill: none;
  stroke: var(--yellow);
  stroke-width: 3;
}

.landing-page .game-legend-keys .key-gap {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.2;
  stroke-dasharray: 2.5 1.5;
}

/* Desktop: the hero fills the window under the header, and the copy sits
   over the scene's top left, scaled with it. Only its links and buttons take
   the pointer, so the pillars under its box stay clickable. */
@media (min-width: 861px) {
  .landing-page .hero-game {
    height: var(--hero-height, calc(100dvh / var(--fit, 1) - 128px));
    min-height: 480px;
  }

  .landing-page .game-view {
    position: absolute;
    inset: 0;
  }

  .landing-page .hero-game.is-ready .game-copy {
    position: absolute;
    top: 0;
    left: 0;
    width: 680px;
    padding: 60px 0 0 52px;
    transform: scale(var(--copy-scale, 1));
    transform-origin: left top;
    pointer-events: none;
  }

  .landing-page .hero-game.is-ready .game-copy :is(a, button) {
    pointer-events: auto;
  }

  .landing-page .hero-game.is-ready .game-kicker { font-size: 13px; }
  .landing-page .hero-game.is-ready .game-titles { margin-top: 18px; }
  .landing-page .hero-game.is-ready .game-title { font-size: 52px; }
  .landing-page .hero-game.is-ready .game-lede { margin-top: 18px; font-size: 23px; }

  /* The legend's plate: flush in the corner, scaled with the copy. */
  .landing-page .hero-game.is-ready .game-legend {
    position: absolute;
    z-index: 1;
    top: 0;
    right: 0;
    margin: 0;
    padding: 12px 20px 12px 16px;
    border-width: 0 0 3px 3px;
    border-radius: 0 0 0 14px;
    transform: scale(var(--copy-scale, 1));
    transform-origin: right top;
  }

  .landing-page .hero-game.is-ready .game-legend-title { font-size: 16px; }
  .landing-page .hero-game.is-ready .game-legend-keys { font-size: 14px; }

  .landing-page .hero-game:not(.is-ready) .game-copy {
    padding: 48px;
  }
}

/* Phones: the copy, then the scene under it, cropped to Quadratics, which
   simply plays: no hints, nothing to tap but pause (landing-hero.js). */
@media (max-width: 860px) {
  .landing-page .game-copy {
    padding: 24px 20px 20px;
  }

  .landing-page .game-view {
    aspect-ratio: 540 / 626;
    border-top: 3px solid var(--ink);
  }

  .landing-page .game-map {
    -webkit-mask-image: none;
    mask-image: none;
  }

  .landing-page .hero-actions {
    margin-top: 18px;
  }

  .landing-page .game-hint {
    display: none;
  }

  /* The dialogue bar: the newest line alone, across the view, with a pip
     per step so far. */
  .landing-page .game-says {
    padding: 6px 8px 0;
  }

  .landing-page .game-says-bar {
    flex: 1;
    padding-right: 12px;
  }

  .landing-page .game-say {
    gap: 10px;
    font-size: 20px;
    transition: none;
  }

  .landing-page .hero-game[data-step="ai"] .game-say[data-step="map"],
  .landing-page .hero-game[data-step="tutor"] .game-say:is([data-step="map"], [data-step="ai"]) {
    display: none;
  }

  .landing-page .game-pips {
    display: flex;
  }

  /* The bar fills the ground there, so the button moves to the sky. */
  .landing-page .game-pause {
    top: 10px;
    right: 10px;
    bottom: auto;
    width: 44px;
    height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .landing-page .hero-game *,
  .landing-page .hero-game *::before,
  .landing-page .hero-game *::after {
    animation: none !important;
    transition: none !important;
  }

  .landing-page .pillar.is-broken {
    cursor: pointer;
  }
}

/* ---------- Swash ---------- */

/*
  The highlighter swash as a motif (owner, 2026-10-29; first drawn behind
  the old hero's tagline): the nav and footer links, the section kickers,
  the journey's card titles and the cohort line all sit on one. One padded
  box with the stroke stretched behind it, so a title that wraps sits on one
  swash, standing 0.55em over the text and 0.64em under it.
*/
/* The .swash class itself is in style.css. */
.landing-page .consult-block .swash {
  --swash-image: var(--swash-white);
}

/* Swashed lines, in the heading face; a card title that wraps sets its lines
   closer, inside the one stroke. */
.landing-page :is(.section-kicker, .consult-cohort, .journey-step h3) {
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: 1.45;
}

.landing-page .journey-step h3 {
  line-height: 1.25;
}

/* On the dark footer the links take ink on white strokes (owner,
   2026-10-29). White text on the yellow strokes was tried and dropped:
   about 1.4:1. */
.landing-page .footer-links .swash {
  --swash-image: var(--swash-white);
  color: var(--ink);
}

/* ---------- Chalk ---------- */

/* Chalk strokes, for the journey's and How We Teach's boards. */
.landing-page .sketch {
  fill: none;
  stroke: var(--chalk);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}

.landing-page .sketch text {
  fill: var(--chalk);
  stroke: none;
  font-family: var(--font-hand);
}

.landing-page .sketch .chalk-yellow {
  stroke: var(--yellow);
}

.landing-page .sketch .chalk-yellow text {
  fill: var(--yellow);
  font-weight: 700;
}

/* The How We Teach cloze cycles through its three questions with this. */
@keyframes board-cycle {
  0% { opacity: 0; }
  4% { opacity: 1; }
  29% { opacity: 1; }
  33% { opacity: 0; }
  100% { opacity: 0; }
}

/* ---------- Drawing in ---------- */

/*
  Every stroke carries pathLength="1", so a dash of 1 is the whole line and
  sliding the offset from 1 to 0 draws it. Each group sets --d to stagger the
  scribbling. Motion-only: with reduced motion (and in the visual suite, which
  runs with it) every drawing is simply shown complete.
*/
@media (prefers-reduced-motion: no-preference) {
  .landing-page .is-waiting .sketch :is(path, line, circle, ellipse, rect, polyline),
  .landing-page .is-waiting.sketch :is(path, line, circle, ellipse, rect, polyline) {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
  }

  .landing-page .is-waiting .sketch text {
    opacity: 0;
  }

  .landing-page .is-drawing .sketch :is(path, line, circle, ellipse, rect, polyline) {
    stroke-dasharray: 1;
    animation: sketch-draw 0.8s ease-out var(--d, 0s) both;
  }

  .landing-page .is-drawing .sketch text {
    animation: sketch-write 0.7s ease-out var(--d, 0s) both;
  }
}

@keyframes sketch-draw {
  0% { stroke-dashoffset: 1; opacity: 0; }
  1% { opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 1; }
}

@keyframes sketch-write {
  from { opacity: 0; clip-path: inset(0 100% 0 0); }
  to { opacity: 1; clip-path: inset(0 0 0 0); }
}

/* ---------- Marker annotations ---------- */

.landing-page .marker .sketch {
  stroke: var(--marker);
  stroke-width: 3;
}

.landing-page .marker-underline,
.landing-page .marker-circle {
  position: relative;
  white-space: nowrap;
}

.landing-page .marker-underline .sketch {
  position: absolute;
  left: -4%;
  bottom: -0.32em;
  width: 108%;
  height: 0.5em;
}

.landing-page .marker-circle {
  margin: 0 0.3em;
}

.landing-page .marker-circle .sketch {
  position: absolute;
  left: -14%;
  top: -34%;
  width: 128%;
  height: 168%;
  stroke-width: 2.5;
}

/* ---------- Journey ---------- */

.landing-page .journey-heading {
  margin-bottom: 14px;
}

.landing-page .journey-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Tight padding since the chalkboard scenes (2026-11-10), so the four
   boards get the width and the panel still fits a laptop window. */
.landing-page .journey-step {
  position: relative;
  z-index: 1;
  padding: 12px;
  border: 3px solid var(--ink);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

/* Arrow to the next step, in the gap between cards, level with the boards.
   A blocky arrow, in the hero's pixels. */
.landing-page .journey-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 95px;
  right: -30px;
  width: 26px;
  height: 22px;
  transform: translateY(-50%);
  background: no-repeat center / contain
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 13 11' shape-rendering='crispEdges'%3E%3Cpath fill='%2317140f' d='M0 4h8v3H0zM8 1h1v9H8zM9 2h1v7H9zM10 3h1v5h-1zM11 4h1v3h-1zM12 5h1v1h-1z'/%3E%3C/svg%3E");
}

/* The step's number, on one of the hero's bricks. */
.landing-page .journey-level {
  display: inline-block;
  margin-bottom: 8px;
  padding: 4px 10px 5px;
  border: 2px solid var(--ink);
  background: var(--yellow);
  box-shadow: inset 0 2px 0 #fff3a0, inset 0 -4px 0 #c9a90e;
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* The hero's tutor and student, standing on the last card of the top row:
   two of the sprites the game uses (assets/images/hero), at half its size. */
.landing-page .journey {
  position: relative;
}

.landing-page .journey-cast {
  position: absolute;
  z-index: 2;
  right: 30px;
  bottom: calc(100% - 3px);
  display: flex;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}

.landing-page .journey-tutor {
  width: 36px;
  height: 60px;
  background: url("/assets/images/hero/tutor.svg") 0 0 / 180px 60px no-repeat;
}

/* The student faces the tutor, and blinks. */
.landing-page .journey-kid {
  width: 32px;
  height: 50px;
  scale: -1 1;
  background: url("/assets/images/hero/kid.svg") 0 0 / 128px 50px no-repeat;
  animation: journey-blink 4.2s steps(1) infinite;
}

@keyframes journey-blink {
  93% { background-position: -32px 0; }
  96% { background-position: 0 0; }
}

/* The Behind cards' size since the titles took the swash (2026-10-29), so
   "Diagnose Gaps" stays on one line and no title runs to three. */
.landing-page .journey-step h3 {
  margin-bottom: 6px;
  font-size: 1.15rem;
}

.landing-page .journey-step p {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.45;
}

/* In the row of four (narrow desktop windows), each card shares its rows
   with the others (2026-10-29): brick, board, title, text. A one-line title
   then leaves its text level with the text beside it instead of starting
   higher. */
@media (min-width: 861px) and (max-width: 1100px) {
  .landing-page .journey-steps {
    grid-template-rows: repeat(4, auto);
    row-gap: 0;
  }

  .landing-page .journey-step {
    display: grid;
    grid-row: span 4;
    grid-template-rows: subgrid;
    align-content: start;
  }

  .landing-page .journey-level {
    justify-self: start;
  }
}

/*
  The return path: a dashed bracket under the row, running from the last card
  back to the first, with an arrowhead pointing up into step 1.
*/
/* The gap above the path leaves the arrowhead in clear space: at -3px it sat
   under step 1's drop shadow and read as a blob rather than an arrow. */
.landing-page .journey-loop {
  position: relative;
  height: 30px;
  margin: 14px 12.5% 0;
  border: 3px dashed var(--ink);
  border-top: 0;
  border-radius: 0 0 28px 28px;
  text-align: center;
}

.landing-page .journey-loop::before {
  content: "";
  position: absolute;
  top: -16px;
  left: -10.5px;
  border: 9px solid transparent;
  border-top: 0;
  border-bottom: 14px solid var(--ink);
}

.landing-page .journey-loop-label {
  position: absolute;
  left: 50%;
  bottom: -0.8em;
  transform: translateX(-50%) rotate(-2deg);
  padding: 0 12px;
  background: var(--yellow-soft);
  color: var(--marker);
  font-family: var(--font-hand);
  font-size: 1.2rem;
  white-space: nowrap;
}

/*
  The loop (owner, 2026-11-11: restack the steps so the boards can grow).
  From 1101px the four cards stand two by two and the steps run round them:
  1 to 2 across the top, down to 3, back to 4, and up to 1 again, an arrow
  in each gap. A card is its board with the words beside it.

  The cards share the panel's height, and the boards grow with it. The row
  of cards is a size container, so a board can be sized from the card's
  height and width before the card is laid out: as tall as the card allows
  less a little, and never so wide that the words beside it run out of room
  (a taller card can spare more width, since the words have more lines to
  wrap into). test/usability/landing.spec.js checks that the words fit.
*/
@media (min-width: 1101px) {
  .landing-page #journey {
    display: flex;
    flex-direction: column;
    padding-bottom: var(--section-min-bottom-gap);
  }

  .landing-page .journey {
    flex: 1;
    display: flex;
  }

  .landing-page .journey-steps {
    --loop-gap: 40px;
    flex: 1;
    container-type: size;
    min-height: 454px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: var(--loop-gap);
  }

  .landing-page .journey-step:nth-child(1) { grid-area: 1 / 1; }
  .landing-page .journey-step:nth-child(2) { grid-area: 1 / 2; }
  .landing-page .journey-step:nth-child(3) { grid-area: 2 / 2; }
  .landing-page .journey-step:nth-child(4) { grid-area: 2 / 1; }

  .landing-page .journey-step {
    /* The room inside a card, top to bottom, and the board's height. */
    --inner: calc((100cqh - var(--loop-gap)) / 2 - 34px);
    --board-h: min(var(--inner) - 40px, (100cqw - var(--loop-gap)) / 2 * 0.24 + var(--inner) * 0.13);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: 1fr auto auto 1fr;
    column-gap: 18px;
    padding: 14px 18px 14px 14px;
  }

  .landing-page #journey .journey-illustration {
    grid-row: 1 / -1;
    align-self: center;
    width: calc(var(--board-h) * 1.6);
    height: var(--board-h);
    aspect-ratio: auto;
    margin: 0;
  }

  .landing-page .journey-step h3 {
    grid-area: 2 / 2;
  }

  .landing-page .journey-step p {
    grid-area: 3 / 2;
    line-height: 1.4;
  }

  /* The brick sits on the card's top edge, over the board's corner. */
  .landing-page .journey-level {
    position: absolute;
    z-index: 1;
    top: -13px;
    left: 22px;
    margin: 0;
  }

  /* An arrow in each gap, pointing the way round. */
  .landing-page .journey-step::after,
  .landing-page .journey-step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 50%;
    right: calc(var(--loop-gap) / -2);
    width: 26px;
    height: 22px;
    transform: none;
    translate: 50% -50%;
    background: no-repeat center / contain
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 13 11' shape-rendering='crispEdges'%3E%3Cpath fill='%2317140f' d='M0 4h8v3H0zM8 1h1v9H8zM9 2h1v7H9zM10 3h1v5h-1zM11 4h1v3h-1zM12 5h1v1h-1z'/%3E%3C/svg%3E");
  }

  .landing-page .journey-step:nth-child(2)::after {
    top: auto;
    right: 50%;
    bottom: calc(var(--loop-gap) / -2);
    translate: 50% 50%;
    rotate: 90deg;
  }

  .landing-page .journey-step:nth-child(3)::after {
    right: auto;
    left: calc(var(--loop-gap) / -2);
    translate: -50% -50%;
    rotate: 180deg;
  }

  .landing-page .journey-step:nth-child(4)::after {
    top: calc(var(--loop-gap) / -2);
    right: auto;
    left: 50%;
    translate: -50% -50%;
    rotate: -90deg;
  }

  /* The way back to step 1 says what it is, beside its arrow. */
  .landing-page .journey-loop {
    position: absolute;
    top: 50%;
    left: calc(25% + 14px);
    height: auto;
    margin: 0;
    border: 0;
    translate: 0 -50%;
  }

  .landing-page .journey-loop::before {
    display: none;
  }

  .landing-page .journey-loop-label {
    position: static;
    display: block;
    padding: 0;
    background: none;
    transform: rotate(-2deg);
  }

  /* On a tall window the cards are tall enough to put the board over the
     words, where it can be wider than beside them. */
  @container (min-height: 760px) {
    .landing-page .journey-step {
      --board-h: min(var(--inner) - 122px, ((100cqw - var(--loop-gap)) / 2 - 38px) / 1.6);
      grid-template-columns: minmax(0, 1fr);
      grid-template-rows: 1fr auto auto auto 1fr;
      justify-items: center;
      padding: 14px 16px;
      text-align: center;
    }

    .landing-page #journey .journey-illustration {
      grid-area: 2 / 1;
      margin-bottom: 12px;
    }

    .landing-page .journey-step h3 {
      grid-area: 3 / 1;
    }

    .landing-page .journey-step p {
      grid-area: 4 / 1;
      max-width: 44ch;
    }
  }
}

/* ---------- Consultation ---------- */

.landing-page .consult-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 28px;
  align-items: center;
  background: var(--yellow);
}

.landing-page .consult-block h2 {
  margin-bottom: 16px;
}

/* Room above and below so the marker circle clears the heading and the next
   paragraph. */
.landing-page .consult-copy p.consult-cohort:not(.eyebrow) {
  margin: 4px 0 18px;
  color: var(--ink);
  font-size: 1.2rem;
}

.landing-page .consult-copy p:not(.eyebrow) {
  margin: 0 0 12px;
}

/* The envelope above the button it points at, with its arrow and label, in
   the middle of the card. The artwork carries its own white background,
   which is the card's colour anyway. */
.landing-page .consult-art {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  margin: 0 0 2px;
}

.landing-page .consult-art img {
  display: block;
  width: 104px;
  height: auto;
}

/* The hero's student at the flag, standing on the card's top edge (the
   sprites the game uses, at half its size). */
.landing-page .consult-send {
  position: relative;
}

.landing-page .consult-cast {
  position: absolute;
  z-index: 1;
  right: 34px;
  bottom: calc(100% - 3px);
  display: flex;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}

.landing-page .consult-kid {
  width: 32px;
  height: 50px;
  background: url("/assets/images/hero/kid.svg") -96px 0 / 128px 50px no-repeat;
  animation: consult-cheer 0.5s steps(1) infinite;
}

@keyframes consult-cheer {
  50% { translate: 0 -2px; }
}

/* The pole, its knob and the cloth. */
.landing-page .consult-flag {
  position: relative;
  width: 4px;
  height: 50px;
  margin-right: 30px;
  background: var(--ink);
}

.landing-page .consult-flag::before {
  content: "";
  position: absolute;
  left: -3px;
  top: -5px;
  width: 10px;
  height: 7px;
  border: 2px solid var(--ink);
  background: var(--yellow);
}

.landing-page .consult-flag::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 5px;
  width: 30px;
  height: 24px;
  background: url("/assets/images/hero/flag.svg") 0 0 / 60px 24px no-repeat;
  animation: consult-wave 0.9s steps(1) infinite;
}

@keyframes consult-wave {
  50% { background-position: -30px 0; }
}

/* Hand-drawn dotted curve from the envelope down to the button, its head just
   above the button. Static: it is a pointer, not an animation. */
.landing-page .consult-arrow {
  flex: none;
  width: 120px;
  height: 96px;
  margin: 14px 0 0 -4px;
  fill: none;
  stroke: var(--marker);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 0.1 11;
}

/* The arrowhead stays solid; only the tail is dotted. */
.landing-page .consult-arrow path + path {
  stroke-dasharray: none;
}

/* The arrow's label, written beside the top of its curve. */
.landing-page .consult-start {
  margin: 20px 0 0 2px;
  color: var(--marker);
  font-family: var(--font-hand);
  font-size: 1.15rem;
  line-height: 1.2;
  white-space: nowrap;
  transform: rotate(-3deg);
}

.landing-page .consult-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  border: 3px solid var(--ink);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.landing-page .consult-actions .button {
  width: 100%;
}

.landing-page .consult-note {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.5;
}

.landing-page .hero-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.landing-page .hero-actions > a:not(.button) {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  text-decoration: underline;
}

.landing-page .consultation-form {
  display: grid;
  gap: 14px;
  text-align: left;
}

.landing-page .consultation-field {
  display: grid;
  gap: 6px;
}

.landing-page .consultation-field label {
  font-weight: 600;
}

.landing-page .consultation-field label span {
  font-size: 0.82rem;
  color: var(--muted);
}

.landing-page .consultation-field :is(input, select, textarea) {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 10px 12px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  font: inherit;
  background: var(--paper);
  color: var(--ink);
}

.landing-page .consultation-field textarea {
  resize: vertical;
}

.landing-page .inquiry-field-error {
  margin: 0;
  font-weight: 600;
  color: #9c251d;
}

.landing-page .inquiry-honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.landing-page #inquiry-status:empty {
  display: none;
}

.landing-page .consult-note a {
  text-decoration: underline;
}

/* Native modal behavior contains focus and makes the background inert. */
html.consultation-open {
  overflow: hidden;
  scrollbar-gutter: stable;
}

.landing-page .consultation-dialog {
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 3px solid var(--ink);
  border-radius: 18px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.landing-page .consultation-dialog::backdrop {
  background: rgb(23 20 15 / 60%);
}

.landing-page .consultation-dialog-inner {
  padding: clamp(18px, 4vw, 28px);
}

.landing-page .consultation-dialog-heading {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.landing-page .consultation-dialog-heading h2 {
  flex: 1;
  font-size: clamp(1.2rem, 3vw, 1.5rem);
}

.landing-page .consultation-close {
  flex: 0 0 44px;
  min-height: 44px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font: 1.6rem/1 var(--font-body);
  cursor: pointer;
}

.landing-page #consultation-next-step {
  margin: 16px 0 20px;
  line-height: 1.6;
}

.landing-page .consultation-dialog .consult-note {
  margin-top: 16px;
}

.landing-page .consultation-dialog #send-inquiry {
  width: 100%;
}

/* ---------- Footer ---------- */

/* Compact (2026-10-29): wordmark and links on one row, the two notes on one
   row under them. It was 295px tall, with the stacked logo seal. Its edge
   and drop shadow are yellow, not ink (owner, 2026-10-29). */
.landing-page .site-footer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px 24px;
  padding: 20px 28px;
  border-color: var(--yellow);
  box-shadow: 0 8px 0 var(--yellow);
}

.landing-page .site-footer .brand {
  justify-self: start;
}

.landing-page .site-footer .brand-mark {
  height: 34px;
}

/* The gap was 26px; 14px keeps the four links and Log in on one row since
   Student Tools joined them (2026-11-11). */
.landing-page .footer-links {
  grid-column: 2 / 4;
  justify-content: flex-end;
  gap: 14px;
}

@media (min-width: 861px) and (max-width: 1250px) {
  .landing-page .footer-links {
    gap: 8px;
    font-size: 0.86rem;
  }
}

@media (min-width: 861px) and (max-width: 1100px) {
  .landing-page .footer-links {
    gap: 6px;
    font-size: 0.78rem;
  }
}

/* A line of the note's own text clear of the links above (owner,
   2026-10-29), on top of the row gap. */
.landing-page .footer-note {
  grid-column: 1 / 3;
  width: auto;
  margin: 1lh 0 0;
}

.landing-page .footer-note.footer-legal {
  grid-column: 3;
  justify-self: end;
  white-space: nowrap;
}

.landing-page .footer-note a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* The login link stands out in the note as the way back in. */
.landing-page .footer-note a[href="login.html"] {
  color: var(--yellow);
  font-weight: 600;
}

/* The footer's Log in matches the header's: 44px tall, not the usual 48
   (owner, 2026-10-29). It is white with ink text inside a yellow edge and
   yellow shadow (style.css's yellow shadow, now on a white button, so the
   two no longer merge into one taller-looking block). Tried and dropped the
   same day: a white edge and shadow on the yellow button, and white text,
   which is about 1.4:1 on yellow. */
.landing-page .site-footer .button {
  min-height: 44px;
  border-color: var(--yellow);
  background: var(--paper);
  color: var(--ink);
}

/* ---------- Motion off ---------- */

/* Also pins the visual suite (reducedMotion: "reduce") to a stable first frame. */
@media (prefers-reduced-motion: reduce) {
  .landing-page .game-title,
  .landing-page .button {
    transition: none;
  }

  /* The sprites on the Journey and the consultation card stand still. */
  .landing-page .journey-kid,
  .landing-page .consult-kid,
  .landing-page .consult-flag::after {
    animation: none;
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 980px) {
  .landing-page .consult-block {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .landing-page .consult-block {
    grid-template-columns: 1fr;
  }

  .landing-page .consult-art img {
    width: 72px;
  }

  /* No room over the cards for the hero's characters on a phone. */
  .landing-page .journey-cast,
  .landing-page .consult-cast {
    display: none;
  }

  .landing-page .consult-arrow {
    width: 96px;
    height: 77px;
  }

  /* The journey turns vertical: arrows point down, and the return path runs
     up the left-hand side into step 1. */
  .landing-page .journey {
    position: relative;
    padding-left: 38px;
  }

  .landing-page .journey-steps {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .landing-page .journey-step:not(:last-child)::after {
    top: auto;
    right: auto;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%) rotate(90deg);
  }

  .landing-page .journey-loop {
    position: absolute;
    top: 40px;
    bottom: 40px;
    left: 0;
    width: 38px;
    height: auto;
    margin: 0;
    border: 3px dashed var(--ink);
    border-right: 0;
    border-radius: 24px 0 0 24px;
  }

  .landing-page .journey-loop::before {
    top: -10.5px;
    left: auto;
    right: -4px;
    border: 9px solid transparent;
    border-right: 0;
    border-left: 13px solid var(--ink);
  }

  .landing-page .journey-loop-label {
    left: -10px;
    top: 50%;
    bottom: auto;
    transform: translate(-50%, -50%) rotate(-90deg);
    font-size: 1.05rem;
  }
}

/* ---------- Phone menu ---------- */

/*
  The button exists in the markup on every width but only ever shows below
  860px (640px until 2026-10-25, which left tablets with the nav stacked in
  three rows). Keeping the breakpoint here and nowhere else is deliberate: landing.js
  never checks the width, it only toggles a class, so there is one place to
  change and no chance of the two disagreeing.
*/
.landing-page .nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: var(--yellow);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.landing-page .nav-toggle:active {
  transform: translateY(5px);
  box-shadow: 0 0 0 var(--ink);
}

/*
  Three bars drawn from one element: the middle is the box itself, the outer
  two are its pseudo-elements. They cross into an X when the menu is open, so
  the control says what it will do next rather than what it did.
*/
.landing-page .nav-toggle-bars,
.landing-page .nav-toggle-bars::before,
.landing-page .nav-toggle-bars::after {
  display: block;
  width: 24px;
  height: 3px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.landing-page .nav-toggle-bars::before,
.landing-page .nav-toggle-bars::after {
  content: "";
  position: absolute;
}

.landing-page .nav-toggle-bars::before {
  transform: translateY(-8px);
}

.landing-page .nav-toggle-bars::after {
  transform: translateY(8px);
}

.landing-page .nav-toggle[aria-expanded="true"] .nav-toggle-bars {
  /* The middle bar goes, so the two that remain can cross cleanly. */
  background: transparent;
}

.landing-page .nav-toggle[aria-expanded="true"] .nav-toggle-bars::before {
  transform: rotate(45deg);
}

.landing-page .nav-toggle[aria-expanded="true"] .nav-toggle-bars::after {
  transform: rotate(-45deg);
}

@media (prefers-reduced-motion: reduce) {
  .landing-page .nav-toggle,
  .landing-page .nav-toggle-bars,
  .landing-page .nav-toggle-bars::before,
  .landing-page .nav-toggle-bars::after {
    transition: none;
  }
}

/* The menu button takes over at 1000px, as in every page's shared header. */
@media (max-width: 1000px) {
  /*
    style.css turns the header into a column at 860px, which is what stacked
    five nav items into a 248px-tall block on a phone. Back to a row here: the
    wordmark and the button share the top line and the nav wraps underneath as
    a full-width panel.
  */
  .landing-page .site-header {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 24px;
  }

  .landing-page .nav-toggle {
    display: inline-flex;
    /* Anchors the absolutely positioned bars above. */
    position: relative;
  }

  /*
    In flow rather than overlaid. The header sits at the top of the page, so
    pushing the hero down is honest about what opened, and it avoids an overlay
    that would need its own z-index and scroll handling on a small screen.
  */

  /* The panel opens inside the header bar, so a rule sets it off rather
     than a second border. */
  .landing-page .site-nav {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 8px 0 4px;
    border-top: 2px solid var(--ink);
  }

  .landing-page .site-nav.is-open {
    display: flex;
  }

  /* Full-width rows, each a comfortable tap target. */
  .landing-page .site-nav a {
    display: flex;
    align-items: center;
    min-height: 52px;
    padding: 0 14px;
    border-radius: 10px;
  }

  .landing-page .site-nav a:not(.button) + a.button {
    margin-top: 6px;
  }

  .landing-page .site-nav a.button {
    justify-content: center;
  }
}

@media (max-width: 860px) {
  .landing-page .site-footer {
    grid-template-columns: 1fr;
  }

  .landing-page .site-footer > *,
  .landing-page .site-footer > .footer-note.footer-legal {
    grid-column: 1;
  }

  .landing-page .footer-links {
    justify-content: flex-start;
  }

  /* Stacked under the note here, so it keeps just the row gap. */
  .landing-page .footer-note.footer-legal {
    justify-self: start;
    margin-top: 0;
  }
}

/* ---------- Masthead (2026-11-10) ---------- */

/*
  At the top of the page the header is a masthead: its bar hangs from the
  window's top edge and spans the window. Past the hero (landing.js adds
  .is-compact) the bar's two end caps, the logo tile and Log in, slide in and
  press it into a floating island the panels' width, 10px down.

  The header's own box never changes: it is always the island, so nothing
  reflows mid-animation and the page below never moves. What moves is drawn
  over it, all on one curve, so the caps stay locked to the bar's ends:
  - the bar (::before) reaches out to the window by --masthead-gutter, the
    distance from the island to the window's edge (set by landing.js);
  - the caps translate out by the same distance;
  - the nav links follow part of the way, so the row spreads a little;
  - the header itself drops 10px.
  The content is centred in the bar's height in both states.
*/
.landing-page .page-shell {
  padding-top: 0;
}

.landing-page .site-header {
  --gutter: var(--masthead-gutter, 0px);
  --bar-motion: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: sticky;
  top: 0;
  z-index: 20;
  transition: transform var(--bar-motion);
}

.landing-page .site-header.is-compact {
  --gutter: 0px;
  transform: translateY(10px);
}

/* Custom properties do not animate, so each moving part transitions the
   property it sets from them. */
.landing-page .site-header::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  right: calc(-1 * var(--gutter));
  bottom: 0;
  left: calc(-1 * var(--gutter));
  border: 3px solid var(--ink);
  border-radius: var(--bar-radius);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  transition: left var(--bar-motion), right var(--bar-motion);
}

/* The left cap: the logo on a black tile, flush with the bar's left end. Pure
   black, to match the logo's own disc. */
.landing-page .site-header .brand {
  gap: 14px;
  transform: translateX(calc(-1 * var(--gutter)));
  transition: transform var(--bar-motion);
}

/* The logo fills the tile: Logo.png is 421x376 with its disc 357px across, so
   covering the tile's height crops only the empty sides and leaves the disc
   about 95% of the tile, its yellow ring 3-4px in from the edges. */
.landing-page .site-header .brand-mark {
  box-sizing: border-box;
  width: var(--bar-height);
  height: var(--bar-height);
  border-radius: var(--bar-radius);
  background: #000;
  object-fit: cover;
}

/* The right cap: Log in, or the menu button where the nav folds away. Each
   is the bar's full height with its corners, and presses in place of the
   shared buttons' sink, which would fight the slide. */
.landing-page .site-header :is(.site-nav a.button, .nav-toggle) {
  height: var(--bar-height);
  min-height: var(--bar-height);
  border-radius: var(--bar-radius);
  box-shadow: none;
  transform: translateX(var(--gutter));
  transition: transform var(--bar-motion), box-shadow 0.1s ease;
}

.landing-page .site-header .site-nav a.button {
  padding: 2px 28px 0;
}

.landing-page .site-header .nav-toggle {
  width: var(--bar-height);
}

.landing-page .site-header :is(.site-nav a.button, .nav-toggle):hover {
  box-shadow: inset 0 -4px 0 rgba(23, 20, 15, 0.22);
}

.landing-page .site-header :is(.site-nav a.button, .nav-toggle):active {
  box-shadow: inset 0 3px 0 rgba(23, 20, 15, 0.28);
}

/* The links between the caps follow them part of the way out. */
.landing-page .site-header .site-nav a:not(.button) {
  transform: translateX(calc(var(--spread, 0.5) * var(--gutter)));
  transition: transform var(--bar-motion);
}

.landing-page .site-header .site-nav a:nth-child(1) { --spread: 0.35; }
.landing-page .site-header .site-nav a:nth-child(2) { --spread: 0.5; }
.landing-page .site-header .site-nav a:nth-child(3) { --spread: 0.65; }
.landing-page .site-header .site-nav a:nth-child(4) { --spread: 0.8; }

/* The menu panel opens under the caps' row, inside the bar. */
@media (max-width: 1000px) {
  .landing-page .site-header .site-nav.is-open {
    margin: 0 14px;
    padding-bottom: 12px;
  }

  .landing-page .site-header .site-nav a:not(.button) {
    transform: none;
  }

  .landing-page .site-header .site-nav.is-open a.button {
    height: auto;
    min-height: 52px;
    border-radius: 12px;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .landing-page .site-header,
  .landing-page .site-header::before,
  .landing-page .site-header :is(.brand, .brand-mark, .site-nav a, .nav-toggle) {
    transition: none;
  }
}

/* ---------- Panel size and fitting the window (2026-11-10) ---------- */

/*
  One panel at a time, whole, at the common landscape sizes. landing.js sets
  --fit on <html>: 1 when the window is tall enough for the tallest panel with
  its 100px gaps, and below 1 when it is not, by as much as it takes. The hero
  is left out: it sizes itself to the window (Hero game). The page then
  zooms out by that factor, as
  the browser's own zoom would: text, panels, gaps and snap padding all
  shrink, and the narrower panels leave room at the sides. It stops at 0.65;
  windows shorter than that scroll within their panels.

  Viewport units inside a zoomed element are zoomed too, hence the division:
  a panel's minimum stays the window less two scaled 100px gaps.
*/
@media (min-width: 861px) {
  .landing-page {
    zoom: var(--fit, 1);
  }

  /* Wider panels, with the original content measure kept below the hero. */
  .landing-page .page-shell {
    width: min(1200px, calc(100% - 32px));
    --panel-extra-inset: clamp(0px, (var(--page-width, 100vw) - 1152px) / 2, 40px);
  }

  .landing-page main > .content-block {
    padding-left: calc(32px + var(--panel-extra-inset));
    padding-right: calc(32px + var(--panel-extra-inset));
  }

  /* Headings take the wider panels' width. style.css caps .section-heading
     at 760px, which split "The Technology Behind Students' Learning". */
  .landing-page .section-heading {
    max-width: none;
  }

  /* When snapped into place, the explanatory panels get matching gaps
     above and below on screens taller than their content. */
  .landing-page :is(#journey, #method, #tools) {
    min-height: calc(100dvh / var(--fit, 1) - 200px);
  }

  /* landing.js measures the panels' own heights with the minimum off. */
  html.is-fitting .landing-page :is(#journey, #method, #tools) {
    min-height: 0;
  }

  /* How We Teach shares the remaining height between equal chalkboards.
     Subgrid keeps the titles and descriptions aligned when copy wraps. The
     boards' 148px minimum (164px with their margin) took the 48px the title
     gave up when it went to one line (owner, 2026-11-10), so on short
     windows too the space goes to the boards rather than to a smaller zoom. */
  .landing-page #method {
    display: flex;
    flex-direction: column;
    padding-bottom: var(--section-min-bottom-gap);
  }

  .landing-page #method .feature-grid {
    flex: 1;
    grid-template-rows: minmax(164px, 1fr) auto auto;
    row-gap: 0;
  }

  .landing-page #method .feature-card {
    display: grid;
    grid-row: span 3;
    grid-template-rows: subgrid;
  }
}

/* ---------- Chalkboard scenes (2026-11-10) ---------- */

/* The journey's boards and How We Teach's. */
.landing-page .journey-illustration,
.landing-page .principle-art {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: var(--board);
  box-shadow: inset 0 -5px 0 rgba(246, 213, 27, .3);
}

/* The journey's wider canvas gives each step room for a complete scene. */
.landing-page .journey-illustration {
  width: 100%;
  aspect-ratio: 1 / .62;
  margin-bottom: 8px;
}

.landing-page .principle-art {
  height: 100px;
  margin-bottom: 16px;
}

@media (min-width: 861px) {
  .landing-page #method .principle-art {
    height: auto;
    min-height: 148px;
  }
}

/* A phone gives the boards their drawing's own proportions: at a fixed 100px
   the scenes shrank to the height and read as thumbnails. */
@media (max-width: 860px) {
  .landing-page .journey-illustration { max-width: 220px; }
  .landing-page .principle-art { height: auto; aspect-ratio: 340 / 220; }
}

.landing-page :is(.journey-illustration, .principle-art) .sketch {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 8px;
  fill: none;
  stroke: var(--chalk);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.landing-page .journey-illustration .sketch { padding: 4px; stroke-width: 2.7; }
.landing-page .journey-illustration .chalk-muted { opacity: .42; }
.landing-page .teaching-scene .sketch { padding: 6px; stroke-width: 2.7; }

/* Retrieval Practice: the cloze hides the angle, the function, then the result. */
.landing-page .recall-frame { opacity: 0; }
.landing-page .recall-frame-1 { opacity: 1; }
.landing-page .recall-blank { stroke: var(--chalk); stroke-dasharray: 4 4; }

/* Spaced Repetition: each day's board lights up in turn. */
.landing-page .revisit-stop { color: var(--chalk); stroke: currentColor; }
.landing-page .revisit-stop text { fill: currentColor; }

/* Interleaving: six problems on a vertical wheel, turned by landing.js. */
.landing-page .problem-wheel {
  container-type: size;
  perspective: 600px;
  isolation: isolate;
  font-family: var(--font-hand);
}
.landing-page .wheel-problem {
  --wheel-step: clamp(32px, 33cqh, 115px);
  position: absolute;
  top: 50%;
  left: 12%;
  width: 76%;
  height: clamp(40px, 36cqh, 120px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--chalk);
  opacity: var(--wheel-opacity);
  transform: translateY(calc(-50% + var(--wheel-offset) * var(--wheel-step))) rotateX(var(--wheel-tilt)) scale(var(--wheel-scale));
  transition: transform .7s cubic-bezier(.4, 0, .2, 1), opacity .7s ease;
}
.landing-page .wheel-problem svg {
  flex: 0 0 clamp(28px, 25cqh, 56px);
  width: clamp(28px, 25cqh, 56px);
  height: clamp(28px, 25cqh, 56px);
  fill: none;
  stroke: var(--yellow);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.landing-page .wheel-problem svg text { fill: var(--yellow); stroke: none; font: 25px var(--font-hand); text-anchor: middle; }
.landing-page .wheel-problem span { min-width: 0; }
.landing-page .wheel-problem small { display: block; font-size: clamp(10px, 8cqh, 15px); opacity: .65; line-height: 1.2; }
.landing-page .wheel-problem strong { display: block; font-weight: 400; font-size: clamp(16px, 13cqh, 25px); line-height: 1.3; white-space: nowrap; }
.landing-page .wheel-focus {
  position: absolute;
  inset: 32% 6%;
  border-left: 2px solid var(--yellow);
  border-right: 2px solid var(--yellow);
  opacity: .65;
}

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

/*
  Section motion: landing.js adds .is-illustrating while a panel is in view and
  takes it off when it leaves, so its drawings replay on every return. Nothing
  is hidden beforehand, and with reduced motion every scene is simply shown.
*/
@media (prefers-reduced-motion: no-preference) {
  .landing-page .is-illustrating :is(.journey-illustration, .principle-art) svg {
    animation: illustration-arrive .7s ease both;
  }

  .landing-page :is(#journey .journey-illustration, #method .teaching-scene) .sketch {
    animation: none;
  }

  .landing-page :is(#journey.is-illustrating .journey-illustration, #method.is-illustrating .teaching-scene) .sketch :is(path, rect, circle, line, polyline, ellipse) {
    stroke-dasharray: 1;
    animation: sketch-draw .75s ease-out var(--d, 0s) both;
  }

  .landing-page :is(#journey.is-illustrating .journey-illustration, #method.is-illustrating .teaching-scene) .sketch text {
    animation: sketch-write .7s ease-out var(--d, 0s) both;
  }

  /* The cloze and the day boards cycle only while the panel is in view. */
  .landing-page #method .recall-frame {
    opacity: 0;
    animation: board-cycle 9s linear infinite;
    animation-play-state: paused;
  }
  .landing-page #method .recall-frame-2 { animation-delay: 3s; }
  .landing-page #method .recall-frame-3 { animation-delay: 6s; }
  .landing-page #method.is-illustrating .recall-frame { animation-play-state: running; }
  .landing-page #method.is-illustrating .teaching-scene .sketch .recall-frame :is(text, rect) { animation: none; }
  .landing-page #method.is-illustrating .teaching-scene .sketch .recall-blank { stroke-dasharray: 4 4; }

  .landing-page #method .revisit-stop { animation: revisit-highlight 4.2s linear infinite; animation-play-state: paused; }
  .landing-page #method .revisit-stop-2 { animation-delay: 1.4s; }
  .landing-page #method .revisit-stop-3 { animation-delay: 2.8s; }
  .landing-page #method.is-illustrating .revisit-stop { animation-play-state: running; }
}

@keyframes illustration-arrive {
  from { opacity: 0; transform: translateY(8px) scale(.96); }
  to { opacity: 1; transform: none; }
}

@keyframes revisit-highlight {
  0%, 30% { color: var(--yellow); }
  35%, 100% { color: var(--chalk); }
}

/* ---------- Student tools (2026-11-11) ---------- */

/*
  A gallery: one picture large, on a screen with its area's name on a plate
  under it, and the four as thumbnails beside it (owner: the pictures had
  too little room). The pictures are whole, never cropped: each screen takes
  its picture's own background, so the picture sits in it without a seam.

  landing.js adds .is-ready on desktop, where the thumbnails choose the
  picture. Without it, and on phones, the four follow each other.
*/
.landing-page .tools-heading {
  position: relative;
}

/* The saying the panel rests on, in the margin beside the title (it was the
   title until the pictures needed the height). */
.landing-page .tools-quote {
  margin: 10px 0 0;
  color: var(--marker);
  font-family: var(--font-hand);
  font-size: 1.15rem;
  line-height: 1.25;
}

.landing-page .tools-gallery {
  display: grid;
  gap: 18px;
}

.landing-page .tools-stage {
  display: grid;
  gap: 18px;
}

.landing-page .tool-view {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 3px solid var(--ink);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

/* The showing picture's frame: yellow inside the ink, as on its thumbnail. */
.landing-page .tools-gallery.is-ready .tool-view {
  position: relative;
}

.landing-page .tools-gallery.is-ready .tool-view::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 4px solid var(--yellow);
  border-radius: 14px;
  pointer-events: none;
}

/* Each picture's own ground. */
.landing-page .tool-view-learn { --screen: #ffffff; }
.landing-page .tool-view-observe { --screen: #fffcf1; }
.landing-page .tool-view-tinker { --screen: #fffcf1; }
.landing-page .tool-view-challenge { --screen: #151a22; }

.landing-page .tool-screen {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--screen);
}

.landing-page .tool-screen img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 10px;
  object-fit: contain;
}

/* Matrix Busters fills its screen edge to edge, as it does in play. */
.landing-page .tool-view-challenge .tool-screen img {
  padding: 0;
}

/* The plate: the area's name and what it is for. */
.landing-page .tool-plate {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 14px;
  padding: 9px 18px 10px;
  border-top: 3px solid var(--ink);
  background: var(--yellow);
}

.landing-page .tool-plate h3 {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 1.3rem;
  line-height: 1.2;
}

.landing-page .tool-plate p {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.3;
}

/* ---- Thumbnails ---- */

.landing-page .tools-thumbs {
  display: grid;
  grid-template-rows: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.landing-page .tools-thumbs[hidden] {
  display: none;
}

.landing-page .tool-thumb {
  position: relative;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: var(--screen);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: translate 0.15s ease, box-shadow 0.15s ease;
}

.landing-page .tool-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--focus, 50% 50%);
  transition: opacity 0.2s ease;
}

/* The part of each picture a thumbnail shows. */
.landing-page .tool-thumb.tool-view-learn { --focus: 50% 62%; }
.landing-page .tool-thumb.tool-view-observe { --focus: 50% 38%; }
.landing-page .tool-thumb.tool-view-tinker { --focus: 50% 72%; }
.landing-page .tool-thumb.tool-view-challenge { --focus: 50% 42%; }

.landing-page .tool-thumb span {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 3px 10px 2px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--paper);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  line-height: 1.3;
}

/* Away from the showing one, the pictures step back a little. */
.landing-page .tool-thumb:not(.is-active) img {
  opacity: 0.72;
}

.landing-page .tool-thumb:not(.is-active):hover {
  translate: 0 -2px;
  box-shadow: 0 7px 0 var(--ink);
}

.landing-page .tool-thumb:hover img {
  opacity: 1;
}

/* The showing one: a yellow frame inside the ink, and its name on yellow. */
.landing-page .tool-thumb.is-active {
  box-shadow: var(--shadow-sm), inset 0 0 0 4px var(--yellow);
  cursor: default;
}

.landing-page .tool-thumb.is-active::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  border: 4px solid var(--yellow);
  border-radius: 10px;
  pointer-events: none;
}

.landing-page .tool-thumb.is-active span {
  background: var(--yellow);
}

/* The timer: a bar along the showing thumbnail's foot while the gallery
   steps on by itself. When it fills, landing.js shows the next; holding it
   holds the gallery. */
.landing-page .tool-thumb::after {
  content: "";
  position: absolute;
  z-index: 1;
  left: 0;
  bottom: 0;
  width: 0;
  height: 6px;
  background: var(--ink);
}

.landing-page .tools-gallery.is-playing .tool-thumb.is-active::after {
  animation: tool-timer 5s linear forwards;
}

.landing-page .tools-gallery:is(:hover, :focus-within) .tool-thumb::after {
  animation-play-state: paused;
}

@keyframes tool-timer {
  from { width: 0; }
  to { width: 100%; }
}

/* Desktop: the gallery takes the height the panel has left; the pictures
   are placed in it, so they never set it. */
@media (min-width: 861px) {
  .landing-page #tools {
    display: flex;
    flex-direction: column;
    padding-bottom: var(--section-min-bottom-gap);
  }

  .landing-page .tools-heading {
    margin-bottom: 18px;
  }

  /* The saying sits at the heading's right-hand end, a line to a clause. */
  .landing-page .tools-quote {
    position: absolute;
    right: 0;
    bottom: -4px;
    margin: 0;
    rotate: -3deg;
    text-align: left;
  }

  .landing-page .tools-quote span {
    display: block;
  }

  .landing-page #tools .tools-gallery {
    flex: 1;
    min-height: 360px;
  }

  .landing-page .tools-gallery.is-ready {
    grid-template-columns: minmax(0, 1fr) clamp(220px, 27%, 300px);
    gap: 16px;
  }

  /* The four share the stage; the showing one is on top. */
  .landing-page .tools-gallery.is-ready .tools-stage {
    gap: 0;
  }

  .landing-page .tools-gallery.is-ready .tool-view {
    grid-area: 1 / 1;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0s linear 0.35s;
  }

  .landing-page .tools-gallery.is-ready .tool-view.is-active {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.35s ease;
  }

  .landing-page .tools-gallery.is-ready .tool-screen {
    aspect-ratio: auto;
  }

  /* Without the script: two by two. */
  .landing-page .tools-gallery:not(.is-ready) .tools-stage {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .landing-page .tools-gallery:not(.is-ready) .tool-screen {
    aspect-ratio: auto;
    min-height: 150px;
  }
}

@media (max-width: 860px) {
  .landing-page .tool-plate h3 {
    font-size: 1.2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .landing-page .tool-view,
  .landing-page .tool-thumb,
  .landing-page .tool-thumb img {
    transition: none !important;
  }

  .landing-page .tool-thumb::after {
    animation: none !important;
  }
}
