/* ==========================================================================
   Γύρος Περιβολιών
   Editorial one-pager: a deep slate canvas, white type, full-bleed
   photography and numbered chapters. The page is dark on every device: it
   never flips with the visitor's system setting. The slates and the sky
   blue come from the race logo (November 2026; see Tones).
   ========================================================================== */

:root {
  /* --black is the page colour and --cream the ink, whatever they are: the
     names stayed when the palette moved to the logo's slate and white. */
  --black:    #1E2A2E;
  --panel:    #253337;
  --panel-2:  #2C3B40;

  --cream:    #EEF4F6;
  --cream-hi: #FFFFFF;
  /* Both read at WCAG AA against the page: --faint at 5.7:1 (it was
     .38 — 2.75:1, too pale for the small labels, the table and the form),
     --dim at 7:1 for running text, a step above it. */
  --dim:      rgba(238, 244, 246, .74);
  --faint:    rgba(238, 244, 246, .6);
  --line:     rgba(238, 244, 246, .16);
  --line-hi:  rgba(238, 244, 246, .34);
  --on-cream: #1E2A2E;
  /* The tiles behind sponsor logos, and where the hero photo fades into the
     page. */
  --logo-bg:  #EEF4F6;
  --hero-end: rgb(30 42 46 / .92);
  /* Buttons: white, turning deep slate under the pointer, in every tone. */
  --btn-bg:  #EEF4F6;
  --btn-ink: #1E2A2E;

  /* Route coding is information, not brand: the first two are the actual
     colours of the arrows on the road. */
  --r10: #F5C518;
  --r5:  #6BB6E8;
  --r1:  #8FC47C;

  --display: "Inter", "Helvetica Neue", Arial, sans-serif;
  --body:    "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, Consolas, "Courier New", monospace;

  --gut:  clamp(1.25rem, 4.5vw, 4.5rem);
  --maxw: 1500px;
  --bar:  62px;

  /* Vertical rhythm between chapters. */
  --chapter: clamp(5.5rem, 13vh, 10rem);

  /* Motion: one pair of curves for the whole page. The first settles quickly
     and is used for things sliding into place; the second is slower at the end
     and carries the big type and the image curtains. */
  --ease-out:  cubic-bezier(.165, .84, .44, 1);
  --ease-soft: cubic-bezier(.23, 1, .32, 1);

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

/* The scrollbar's width stays reserved even while scrolling is locked (menu
   open, intro playing). Without it the bar vanished, the page grew wider by
   its width and everything fixed to the edges — the menu button first of all
   — jumped sideways and back. */
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }

body {
  margin: 0;
  background: var(--black);
  color: var(--cream);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

h1, h2, h3, h4 { margin: 0; font-family: var(--display); font-weight: 800; }
p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }

/* The width and height on each <img> only reserve the space while it loads;
   the frame's own width and aspect ratio decide the size it is shown at. */
img { height: auto; }
button { font: inherit; color: inherit; }

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

::selection { background: var(--cream); color: var(--on-cream); }

/* What Lenis needs from the page while it drives the scroll (its own
   stylesheet, inlined). */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }

.shell {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gut);
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Type scale
   Statements are set in heavy uppercase Inter with the leading pulled tight;
   everything small and technical is mono.
   -------------------------------------------------------------------------- */

.display {
  font-family: var(--display);
  font-weight: 800;
  text-transform: uppercase;
  line-height: .92;
  letter-spacing: -.022em;
  text-wrap: balance;
}

.d-xl { font-size: clamp(2.9rem, 11.5vw, 10.5rem); font-weight: 900; letter-spacing: -.035em; }
.d-lg { font-size: clamp(2.1rem, 6.2vw, 5.4rem); }
.d-md { font-size: clamp(1.7rem, 3.6vw, 3.1rem); }
.d-sm { font-size: clamp(1.25rem, 2.1vw, 1.75rem); letter-spacing: -.01em; }

.mono {
  font-family: var(--mono);
  font-size: .7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .15em;
  line-height: 1.5;
}

.lede {
  font-size: clamp(1.02rem, 1.35vw, 1.2rem);
  line-height: 1.62;
  color: var(--dim);
  max-width: 62ch;
}

.note { font-size: .92rem; color: var(--faint); }

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

   Modelled on imperialebolgheri.com, whose signature is the slanted edge:
   headings are uncovered line by line by a slanted wipe as they rise into
   place, pictures wait behind a cream panel with a slanted top that drops
   away, and the page opens with a short intro on the first visit.

   Nothing here is played by a parent's state. The script adds .is-in to each
   element itself, so a picture is never uncovered before it has loaded and
   the hero never plays behind the intro. Individual transform properties
   (translate, scale) are used throughout so a reveal, a parallax and a hover
   can move the same element without cancelling one another.

   Sharp text while scrolling. On an ordinary (not high-density) Windows
   screen, text the graphics card draws on a layer of its own loses ClearType
   and looks blurred. A moving transform puts an element on such a layer —
   and, because the browser cannot tell where it will end up, everything
   painted after it on the page as well. So on those screens nothing that
   carries text slides: blocks only fade in, the picture frames do not rise,
   the line under a chapter label is drawn by its background, and nothing has
   will-change. Measured in Chrome while scrolling the page, text on layers
   went from about 10 million square pixels on average to under 2 million,
   and to almost none at rest. On a high-density screen (phones, retina
   laptops) text is drawn the same way on a layer or off it, so the blocks
   keep their rise there.
   -------------------------------------------------------------------------- */

/* Blocks fade in, and on a high-density screen also rise into place.
   --stagger lets a group of siblings arrive one after the other. */
[data-reveal],
[data-reveal-childs] > * {
  opacity: 0;
  transition: opacity .8s ease;
  transition-delay: calc(var(--d, 0ms) + var(--stagger, 0) * 60ms);
}

[data-reveal].is-in,
[data-reveal-childs].is-in > * { opacity: 1; }

@media (min-resolution: 1.5dppx) {
  [data-reveal],
  [data-reveal-childs] > * {
    translate: 0 var(--reveal-y, 42px);
    transition-property: translate, opacity;
    transition-duration: 1s, .6s;
    transition-timing-function: var(--ease-out), ease;
  }

  [data-reveal].is-in,
  [data-reveal-childs].is-in > * { translate: 0 0; }
}

[data-reveal-childs] > :nth-child(1) { --stagger: 0; }
[data-reveal-childs] > :nth-child(2) { --stagger: 1; }
[data-reveal-childs] > :nth-child(3) { --stagger: 2; }
[data-reveal-childs] > :nth-child(4) { --stagger: 3; }
[data-reveal-childs] > :nth-child(5) { --stagger: 4; }
[data-reveal-childs] > :nth-child(6) { --stagger: 5; }
[data-reveal-childs] > :nth-child(7) { --stagger: 6; }
[data-reveal-childs] > :nth-child(n+8) { --stagger: 7; }

/* On touch screens (phones, tablets) text does not reveal at all: headings
   and blocks are simply there. iPhone Safari kept cutting the text reveals
   short or replaying them while its toolbar moved. Pictures keep their
   curtain, the menu and the intro their movement. The same rules are
   repeated at the end of the Motion section so they win over the later
   reveal rules. */

/* --------------------------------------------------------------------------
   Headings, line by line

   Each line sits in a clipping mask and carries a gradient mask of its own,
   split at 50% on a -4° slant. The gradient starts above the line and slides
   down over it while the line rises from a little below and to the right —
   so the letters are uncovered by a tilted edge rather than simply sliding
   out of a slot.

   The gradient is five lines tall (the reference uses three) so that at rest
   its slanted edge is clear of the bottom of even the longest line; with a
   shorter gradient the tilt would leave one lower corner of a wide heading
   cut off. Until the script has cut a heading into lines it is held back —
   but only once the page has said it can run scripts.
   -------------------------------------------------------------------------- */

html.motion [data-lines]:not(.is-split) { visibility: hidden; }

.line-mask {
  display: block;
  overflow: hidden;
  overflow: clip;
}

.line {
  display: block;
  transform-origin: 0 100%;
  translate: 2% 34%;
  -webkit-mask-image: linear-gradient(-4deg, transparent 50%, #000 50%);
          mask-image: linear-gradient(-4deg, transparent 50%, #000 50%);
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-size: 140% 500%;
          mask-size: 140% 500%;
  -webkit-mask-position: 0 125%;
          mask-position: 0 125%;
  transition:
    translate 1s var(--ease-soft),
    -webkit-mask-position 1.2s var(--ease-soft),
    mask-position 1.2s var(--ease-soft);
  transition-delay: calc(var(--line, 0) * 80ms + var(--d, 0ms));
}

[data-lines].is-in .line {
  translate: 0 0;
  -webkit-mask-position: 0 0%;
          mask-position: 0 0%;
}

/* --------------------------------------------------------------------------
   Pictures behind a curtain

   A panel with a slanted top, in the colour of the section it sits in,
   covers the picture, so the picture seems to come out of the page with
   no coloured panel of its own. When the picture has
   loaded and reaches the screen, the panel drops out of it; on a high-density
   screen the frame also rises a little and the picture settles back from a
   slight enlargement.

   The panel drops by its clip-path: the slanted edge travels down to the
   bottom of the frame. It used to slide down with a transform, and the
   picture shrank with scale — and while any of that ran, the browser put
   everything painted after it on a layer (see Motion, above). Measured over
   the whole page while scrolling, the two together were half of what was
   left on layers.

   On a phone the panel falls quickly and eases out; on a larger screen it
   accelerates and brakes, which reads better over a big picture.
   -------------------------------------------------------------------------- */

.reveal-mask {
  --clip: 10%;
  position: relative;
  overflow: hidden;
}

/* The bottom corners sit well below the frame, so the edge can pass right
   out of it. It also runs 2px past the sides: a frame of a fractional width
   (the chapel, 466.05px) otherwise left a hairline of the picture showing
   down its right edge before the reveal. */
.reveal-mask::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: calc(var(--clip) * -1.5) -2px 0 -2px;
  background: var(--curtain, var(--black));
  -webkit-clip-path: polygon(0 var(--clip), 100% calc(var(--clip) * .4), 100% 200%, 0 200%);
          clip-path: polygon(0 var(--clip), 100% calc(var(--clip) * .4), 100% 200%, 0 200%);
  pointer-events: none;
  transition:
    -webkit-clip-path .75s var(--ease-out) var(--curtain-d, 0ms),
    clip-path .75s var(--ease-out) var(--curtain-d, 0ms);
}

.reveal-mask.is-in::after {
  -webkit-clip-path: polygon(0 calc(102% + var(--clip)), 100% calc(102% + var(--clip) * .4), 100% 200%, 0 200%);
          clip-path: polygon(0 calc(102% + var(--clip)), 100% calc(102% + var(--clip) * .4), 100% 200%, 0 200%);
}

@media (min-width: 768px) {
  .reveal-mask::after { transition-duration: .95s; transition-timing-function: cubic-bezier(.77, 0, .175, 1); }
}

.reveal-mask img { scale: var(--rest, 1); }

@media (min-resolution: 1.5dppx) {
  .reveal-mask {
    translate: 0 var(--mask-rise, 56px);
    transition: translate 1.1s var(--ease-out) var(--curtain-d, 0ms);
  }

  .reveal-mask img {
    scale: calc(var(--rest, 1) + .16);
    transition: scale 1.6s var(--ease-soft) var(--curtain-d, 0ms);
  }

  .reveal-mask.is-in { translate: 0 0; }
  .reveal-mask.is-in img { scale: var(--rest, 1); }
}

/* Parallax. The picture rests slightly enlarged so it can drift without
   opening a gap, and the drift is written straight to translate every frame —
   it is never transitioned, so it stays locked to the scroll.

   No will-change: it kept every picture on a layer of its own for good, and
   all the text painted after the first one followed it onto layers — most of
   the page lost ClearType and looked blurred whenever it moved. The picture
   is simply repainted as it drifts. contain: paint tells the browser it never
   leaves its frame. */
.parallax-media { --rest: 1.14; overflow: hidden; contain: paint; }
.parallax-media img { translate: 0 var(--py, 0px); }

/* --------------------------------------------------------------------------
   After the entrance

   The script adds .is-done once an entrance has finished, and everything it
   used to move comes off: the transform, the heading masks, the curtain. An
   element that keeps any of them is drawn by the graphics card apart from the
   page, and on Windows its text loses ClearType — it looked blurred while
   scrolling. The values it rests at are the same, so nothing visibly moves.
   -------------------------------------------------------------------------- */

[data-reveal].is-done,
[data-reveal-childs].is-done > *,
.reveal-mask.is-done {
  translate: none;
  transition: none;
}

[data-lines].is-done .line {
  translate: none;
  transition: none;
  -webkit-mask-image: none;
          mask-image: none;
}

.reveal-mask.is-done::after { display: none; }

/* Text stays put on touch screens (see the note above "Headings, line by
   line"). */
@media (hover: none) and (pointer: coarse) {
  html.motion [data-lines]:not(.is-split) { visibility: visible; }

  [data-reveal],
  [data-reveal-childs] > *,
  .line {
    opacity: 1;
    translate: none;
    transition: none;
  }

  .line { -webkit-mask-image: none; mask-image: none; }
}
.reveal-mask.is-done:not(.parallax-media) img { scale: none; }

/* A line beside the chapter label draws itself across once the label is in —
   by its background growing, not by a transform, which would lift the label
   onto a layer while it ran. */
.chapter-tag::after {
  background: linear-gradient(var(--line), var(--line)) no-repeat 0 0 / 0% 100%;
  transition: background-size 1.4s var(--ease-soft) .2s;
}

.chapter-tag.is-in::after { background-size: 100% 100%; }

/* --------------------------------------------------------------------------
   Intro

   First visit of the session only: the wordmark is uncovered on black, then
   the panel is wiped off the top of the screen with a slanted edge and the
   hero plays. It lasts under two seconds, and the page underneath has had
   that time to load its large photograph.
   -------------------------------------------------------------------------- */

.intro { display: none; }

/* The page must not scroll behind the intro. The lock goes on body, never on
   html: body's overflow is then handed to the viewport as usual. Put on html
   instead, it turned body into a scroll container of its own — and Chrome
   dropped the transitions of the hero and froze the scroll observers created
   during the intro, so headings further down never appeared. */
html.is-intro body { overflow: hidden; }

html.is-intro .intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--black);
  -webkit-clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
          clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  transition: -webkit-clip-path 1s cubic-bezier(.77, 0, .175, 1), clip-path 1s cubic-bezier(.77, 0, .175, 1);
}

/* The bottom edge rises faster on the right than on the left, so the panel
   leaves on a slant. */
html.is-intro.is-intro-out .intro {
  -webkit-clip-path: polygon(0 0, 100% 0, 100% -12%, 0 0);
          clip-path: polygon(0 0, 100% 0, 100% -12%, 0 0);
}

.intro-in {
  display: grid;
  justify-items: center;
  gap: 1.6rem;
  text-align: center;
  padding-inline: var(--gut);
}

.intro-mark {
  width: 54px;
  height: 54px;
  opacity: 0;
  scale: .6;
  rotate: -90deg;
  transition: opacity .6s ease, scale 1.2s var(--ease-soft), rotate 1.4s var(--ease-soft);
}

html.is-intro-play .intro-mark { opacity: 1; scale: 1; rotate: 0deg; }

.intro-title {
  font-size: clamp(2.8rem, 11vw, 9.5rem);
  font-weight: 900;
  letter-spacing: -.035em;
  line-height: .9;
  text-transform: uppercase;
  color: var(--cream);
}

.intro-claim {
  position: absolute;
  bottom: clamp(1.2rem, 4vh, 2.4rem);
  margin: 0;
  color: var(--dim);
  opacity: 0;
  transition: opacity .8s ease .5s;
}

.intro-claim--l { left: var(--gut); }
.intro-claim--r { right: var(--gut); }

html.is-intro-play .intro-claim { opacity: 1; }

/* --------------------------------------------------------------------------
   Nothing moves for a visitor who has asked for less motion
   -------------------------------------------------------------------------- */

/* Touch screens scroll natively, on their own thread, and a position the
   script writes lands a frame or more late: the banner photo seemed to stick,
   then jump. There the browser ties the drift to the scroll itself, with
   scroll-driven animations, on the same thread as the scrolling. A browser
   without them simply keeps the photos still. With a mouse the script does it
   (app.js adds .js-parallax), in step with Lenis. */
@supports (animation-timeline: scroll()) {
  html.motion:not(.js-parallax) .hero-bg img {
    animation: hero-sink linear both;
    animation-timeline: scroll(root block);
    animation-range: 0 100svh;
  }

  html.motion:not(.js-parallax) .parallax-media:not(.hero-bg) { view-timeline: --drift block; }

  html.motion:not(.js-parallax) .parallax-media:not(.hero-bg) img {
    animation: media-drift linear both;
    animation-timeline: --drift;
  }
}

/* The same distances the script uses: the photo sinks at a third of the
   scroll, the photos drift 5.5%. */
@keyframes hero-sink { to { translate: 0 32svh; } }
@keyframes media-drift { from { translate: 0 5.5%; } to { translate: 0 -5.5%; } }

@media (prefers-reduced-motion: reduce) {
  /* Same selector as the rule that holds headings back, so this one wins —
     a lighter selector here left every heading hidden. */
  html.motion [data-lines]:not(.is-split) { visibility: visible; }

  [data-reveal],
  [data-reveal-childs] > *,
  .line,
  .reveal-mask,
  .reveal-mask img,
  .parallax-media img {
    opacity: 1;
    translate: none;
    scale: none;
    transition: none;
  }

  .line { -webkit-mask-image: none; mask-image: none; }
  .reveal-mask::after { display: none; }
  .chapter-tag::after { background-size: 100% 100%; transition: none; }
  html.is-intro .intro { display: none; }
}

/* --------------------------------------------------------------------------
   Running strip

   A band rather than a hairline: set in the display face at the size of a
   small heading, so it carries the same weight as the chapters around it. It
   keeps no margin of its own — the chapters either side already end and begin
   with a --chapter of padding.
   -------------------------------------------------------------------------- */

/* The strip never stops moving, so it lives on a layer of its own — and
   anything the browser draws above such a layer, it has to lift onto a layer
   too. The chapters are positioned, so they were drawn above the strip, and
   the one after it was lifted: its text went soft. Stacked above them
   (z-index) and contained, the strip keeps its layer to itself. */
.marquee {
  position: relative;
  z-index: 1;
  overflow: hidden;
  contain: paint;
  border-block: 1px solid var(--line);
  padding-block: clamp(1.4rem, 2.8vw, 2.3rem);
  margin-block: 0;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent);
}

.marquee-in {
  display: flex;
  width: max-content;
  animation: marquee 55s linear infinite;
}

.marquee span {
  display: inline-flex;
  align-items: center;
  gap: clamp(1.5rem, 2.8vw, 2.6rem);
  padding-right: clamp(1.5rem, 2.8vw, 2.6rem);
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.3rem, 2.9vw, 2.4rem);
  text-transform: uppercase;
  letter-spacing: -.015em;
  color: var(--cream);
  white-space: nowrap;
}

/* The dot follows the type, so it stays in proportion at every size. */
.marquee span::after {
  content: "";
  width: .32em;
  height: .32em;
  border-radius: 50%;
  background: var(--line-hi);
  flex: 0 0 auto;
}

/* The three races, each in the colour of its arrows on the road. */
.marquee .m-r10 { color: var(--r10); }
.marquee .m-r5  { color: var(--r5); }
.marquee .m-r1  { color: var(--r1); }

@keyframes marquee { to { transform: translateX(-50%); } }

@media (prefers-reduced-motion: reduce) {
  .marquee-in { animation: none; }
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

/* Buttons: square white blocks with the label in heavy capitals, like the
   chapter titles. Under the pointer they turn deep slate. The edge takes the
   ink of the chapter: on the dark ones it melts into the white and outlines
   the slate on hover; on a sky chapter it draws the white block. Hover only
   changes colours: nothing moves, so nothing is put on a layer (see Motion). */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1.05rem 1.4rem;
  border: 1.5px solid var(--cream);
  border-radius: 0;
  background: var(--btn-bg);
  color: var(--btn-ink);
  font-family: var(--display);
  font-size: .875rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.01em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .3s ease, border-color .3s ease, color .3s ease;
}

.btn:hover,
.btn:focus-visible { background: var(--btn-ink); color: var(--btn-bg); }

.btn[disabled] { opacity: .5; cursor: progress; }

.btn-row { display: flex; flex-wrap: wrap; gap: .7rem; }

/* --------------------------------------------------------------------------
   Top bar
   -------------------------------------------------------------------------- */

.bar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  height: var(--bar);
  display: flex;
  align-items: center;
  pointer-events: none;
  transition: background .2s ease;
}

/* A plain black band as soon as the page moves — no frosted-glass filter:
   that blurred whatever passed underneath it, which read as the page itself
   going out of focus while scrolling. Fully opaque, so the browser can keep
   the bar's own lettering sharp (ClearType needs an opaque background).

   It used to stay clear until the banner had scrolled away, and the banner's
   title, date and countdown slid up underneath the wordmark and the menu
   button: two sets of letters on top of each other the whole way. */
.bar.is-stuck { background: var(--black); }

.bar-in {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gut);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.bar a, .bar button { pointer-events: auto; }

.brand { display: flex; align-items: center; gap: .7rem; }
.brand img { width: 34px; height: 34px; }

.brand span {
  font-family: var(--display);
  font-weight: 800;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  line-height: 1.08;
  max-width: 7.5em;
}

.menu-btn {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  min-height: 2.75rem;
  padding: .55rem 1.05rem;
  border: 1.5px solid var(--btn-bg);
  border-radius: 0;
  background: var(--btn-bg);
  color: var(--btn-ink);
  font-family: var(--display);
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: -.01em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color .3s ease, color .3s ease;
}
/* The open button is three white bars and nothing else; its name is in
   aria-label. The tap area stays 44px, the bars sit on the right edge. */
.menu-btn[data-menu-open],
.menu-btn[data-menu-open]:hover {
  width: 2.75rem;
  padding: 0;
  justify-content: flex-end;
  border-color: transparent;
  background: transparent;
  color: var(--btn-bg);
}
.menu-btn[data-menu-open]::before {
  content: "";
  width: 1.6rem;
  height: 1.05rem;
  border-block: 2px solid currentColor;
  background: linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat;
}
.menu-btn:hover { background: var(--btn-ink); color: var(--btn-bg); }

/* The close button sits where the three bars were and draws them as an X:
   the outer two turn in while the panel comes down, the middle one is gone. */
.menu-btn[data-menu-close],
.menu-btn[data-menu-close]:hover {
  position: relative;
  width: 2.75rem;
  padding: 0;
  border-color: transparent;
  background: transparent;
  color: var(--cream);
}
.menu-btn[data-menu-close]::before,
.menu-btn[data-menu-close]::after {
  content: "";
  position: absolute;
  right: 0;
  top: calc(50% - 1px);
  width: 1.6rem;
  height: 2px;
  background: currentColor;
  /* On closing the X stays an X while the panel is wiped back up over the
     three bars, and only resets once it is out of sight: turning back into
     two bars first read as a broken hamburger. */
  transition: transform 0s linear .85s;
}
.menu-btn[data-menu-close]::before { transform: translateY(-.425rem); }
.menu-btn[data-menu-close]::after { transform: translateY(.425rem); }
.menu.is-open .menu-btn[data-menu-close]::before { transform: rotate(45deg); transition: transform .45s var(--ease-soft) .35s; }
.menu.is-open .menu-btn[data-menu-close]::after { transform: rotate(-45deg); transition: transform .45s var(--ease-soft) .35s; }

@media (prefers-reduced-motion: reduce) {
  .menu-btn[data-menu-close]::before,
  .menu-btn[data-menu-close]::after { transition: none !important; }
}

/* Reading progress, a hairline across the very top. */
.progress {
  position: fixed;
  inset: 0 auto auto 0;
  z-index: 61;
  height: 2px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: var(--cream);
  opacity: .75;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Menu overlay
   -------------------------------------------------------------------------- */

.menu {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: var(--black);
  display: grid;
  /* Without an explicit column the implicit one is auto-sized, so a long line
     inside the overlay made it wider than the screen. */
  grid-template-columns: minmax(0, 1fr);
  /* minmax(0, …): on a window too short for the list, the list scrolls inside
     its row instead of growing over the bar and the sign-off. */
  grid-template-rows: var(--bar) minmax(0, 1fr) auto;

  /* Opens as a panel wiped down from the top on a slant, and closes by being
     wiped back up — the intro's movement in reverse. The two lower corners
     travel different distances, which is what tilts the edge. */
  visibility: hidden;
  -webkit-clip-path: polygon(0 0, 100% 0, 100% -12%, 0 0);
          clip-path: polygon(0 0, 100% 0, 100% -12%, 0 0);
  transition:
    -webkit-clip-path .85s cubic-bezier(.77, 0, .175, 1),
    clip-path .85s cubic-bezier(.77, 0, .175, 1),
    visibility 0s linear .85s;
}

.menu.is-open {
  visibility: visible;
  -webkit-clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
          clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  transition:
    -webkit-clip-path .85s cubic-bezier(.77, 0, .175, 1),
    clip-path .85s cubic-bezier(.77, 0, .175, 1),
    visibility 0s;
}

@media (prefers-reduced-motion: reduce) {
  .menu, .menu.is-open { -webkit-clip-path: none; clip-path: none; transition: none; }
}

.menu-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gut);
}

/* The list is sized to fit the screen, so it only scrolls on a very short
   window — and then without a visible bar, and without the scroll running on
   into the page behind. */
.menu-nav {
  align-self: center;
  /* Centred, it is only as tall as the list; capped at its row, it scrolls
     instead of spilling over the bar and the sign-off. */
  max-height: 100%;
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 1rem var(--gut);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.menu-nav::-webkit-scrollbar { display: none; }

/* Ruled rows across the full width, like a start list: the number, the
   chapter, and an arrow that comes in on the right under the pointer. */
.menu-list { display: grid; border-top: 1px solid var(--line); }
.menu-list li { border-bottom: 1px solid var(--line); }

/* Each row takes the colour of a course in turn when pointed at. */
.menu-list li:nth-child(3n + 1) { --c: var(--r10); }
.menu-list li:nth-child(3n + 2) { --c: var(--r5); }
.menu-list li:nth-child(3n) { --c: var(--r1); }

/* Each entry rises out of a slot of its own, like the headings. The slot
   clips it, so the entries waiting below never make the list taller than it
   is — that overflow is what flashed a scrollbar in the menu as it opened. */
.menu-list li { overflow: hidden; overflow: clip; }

.menu-list a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(.8rem, 2.5vw, 2rem);
  padding: clamp(.45rem, 1.4vh, .95rem) 0;
  color: var(--dim);
  translate: 0 105%;
  transition: color .3s ease, translate .5s var(--ease-soft);
}

.menu.is-open .menu-list a {
  translate: 0 0;
  transition: color .3s ease, translate .9s var(--ease-soft) var(--d, 0ms);
}

@media (prefers-reduced-motion: reduce) {
  .menu-list a, .menu.is-open .menu-list a { translate: none; transition: color .3s ease; }
}

.menu-list a:hover,
.menu-list a:focus-visible,
.menu-list a[aria-current] { color: var(--cream); }

/* While one row is pointed at, the rest step back. */
.menu-list:hover a:not(:hover) { color: var(--faint); }

.menu-list a::after {
  content: "→";
  font-family: var(--mono);
  font-size: clamp(1rem, 2vw, 1.5rem);
  color: var(--c);
  opacity: 0;
  translate: -.8rem 0;
  transition: opacity .3s ease, translate .4s var(--ease-soft);
}

.menu-list a:hover::after,
.menu-list a:focus-visible::after { opacity: 1; translate: 0 0; }

.menu-list a:hover .num,
.menu-list a:focus-visible .num,
.menu-list a[aria-current] .num { color: var(--c); }

/* The chapter being read when the menu was opened. */
.menu-list a[aria-current] .num::before {
  content: "";
  display: inline-block;
  width: .45em;
  height: .45em;
  margin-right: .5em;
  border-radius: 50%;
  background: var(--c);
  vertical-align: .1em;
}

/* The race's mark, very faint, behind the list on a wide screen. */
@media (min-width: 900px) {
  .menu::before {
    content: "";
    position: absolute;
    right: calc(var(--gut) - 4vh);
    top: 50%;
    width: min(70vh, 44vw);
    aspect-ratio: 1;
    translate: 0 -50%;
    background: url("../img/logo-mark-light.svg") center / contain no-repeat;
    opacity: .035;
    pointer-events: none;
  }
  .menu > * { position: relative; }
}

.menu-list .num {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .14em;
  min-width: 2.4em;
}

/* Up to nine entries plus the sign-off have to fit one screen, so the size
   follows the shorter of the two axes — a laptop in landscape is
   height-bound. */
.menu-list .lbl {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.35rem, min(4.6vw, 4.7vh), 3.2rem);
  line-height: 1;
  letter-spacing: -.02em;
  text-transform: uppercase;
}

.menu-foot {
  padding: 0 var(--gut);
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
}


/* The wordmark signs the page off at full width. It is drawn as SVG with a
   fixed viewBox and textLength, so the whole word always fits the screen
   exactly — no clipping at any width, whatever font ends up being used. */
.wordmark {
  display: block;
  width: 100%;
  margin-top: 1rem;
  fill: var(--cream);
}

.wordmark text {
  font-family: var(--display);
  font-weight: 900;
  font-size: 100px;
}

.menu-foot .wordmark { max-height: 15vh; margin-top: 0; }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-rows: 1fr auto;
  overflow: hidden;
  isolation: isolate;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
}

/* The photograph settles from a zoom when the hero plays, and sinks slower
   than the page as it scrolls away (--hy). Only ever moved downwards, so the
   gap it opens is above the top of the screen. */
.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 42%;
  scale: 1.16;
  translate: 0 var(--hy, 0px);
  transition: scale 2.6s var(--ease-soft);
}

.hero.is-playing .hero-bg img { scale: 1; }

@media (prefers-reduced-motion: reduce) {
  .hero-bg img { scale: 1; translate: none; transition: none; }
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(0,0,0,.72) 0%, rgba(0,0,0,.28) 32%, rgba(0,0,0,.42) 62%, var(--hero-end) 100%),
    rgba(0, 0, 0, .18);
}

/* The hero's text stays put and sharp as the page scrolls: it used to lift
   and fade, and while it faded it was drawn on a layer and lost ClearType. */
/* Only the name and one button: everything else about the next race is on
   the bottom edge. */
.hero-mid {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: clamp(1.6rem, 3vw, 2.4rem);
  padding: calc(var(--bar) + 2rem) var(--gut) 2rem;
  text-align: center;
}

/* The title is written on two lines and the <br> keeps it that way, whatever
   the screen is wide enough to fit. */
.hero h1 { max-width: 14ch; }

.hero-cta { display: flex; flex-wrap: wrap; justify-content: center; gap: .7rem; }

/* The next race, on a hairline along the bottom edge: which and where on the
   left, the date and the countdown in the middle, the distances on the
   right. */
.hero-foot {
  border-top: 1px solid var(--line);
  padding-block: 1.2rem 1.5rem;
}

.hero-foot-in {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gut);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 1.2rem 2rem;
}

.hero-race {
  display: grid;
  gap: .4rem;
  justify-self: start;
  font-size: .66rem;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--dim);
}

.hero-race span:first-child { color: var(--cream); }

.hero-clock { display: grid; justify-items: center; gap: .8rem; }

.hero-date {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .18em;
}

.countdown { display: flex; gap: clamp(1.1rem, 3vw, 2.6rem); }

.cd-unit { display: grid; justify-items: center; gap: .25rem; }

.cd-unit b {
  font-family: var(--mono);
  font-size: clamp(1.5rem, 3.4vw, 2.5rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}

.cd-unit span {
  font-family: var(--mono);
  font-size: .6rem;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--faint);
}

.cd-today {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(1.4rem, 3.4vw, 2.3rem);
  text-transform: uppercase;
  letter-spacing: -.02em;
}

/* No next race on the calendar yet: a message in the clock's place. */
.hero-clock .cd-today { text-align: center; }

.hero-dists { display: flex; flex-wrap: wrap; justify-content: flex-end; justify-self: end; gap: .5rem; }

.hero-dists li {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .42rem .9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: .64rem;
  text-transform: uppercase;
  letter-spacing: .14em;
}

.dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }

/* --------------------------------------------------------------------------
   Chapters
   -------------------------------------------------------------------------- */

.chapter { padding-block: var(--chapter); position: relative; }
.chapter + .chapter { padding-top: 0; }

/* --------------------------------------------------------------------------
   Tones

   The colours come from the race logo, a gradient from slate (#46595D)
   through blue-grey (#607D85) to sky blue (#A5D3E2). So the page is not one
   colour from top to bottom, chapters alternate between three tones
   (data-tone in the template): the deep slate of the page, the logo's slate,
   and a pale sky blue with the deep slate as ink. The ink is the white of
   the logo's lettering, with a breath of its sky in it. A tone only
   redefines the colour tokens, so everything inside follows: text, lines,
   buttons, tables, the chart.
   The photo gallery is on the sky; a photograph between two chapters takes
   the tone of the chapters around it.

   The small labels (--faint) stay at WCAG AA in every tone: 5.1:1 on slate,
   4.9:1 on sky.
   -------------------------------------------------------------------------- */

[data-tone] { background: var(--black); color: var(--cream); }

[data-tone="slate"] {
  --black:   #46595D;
  --panel:   #4E6266;
  --panel-2: #56696E;
  --dim:     rgba(238, 244, 246, .9);
  --faint:   rgba(238, 244, 246, .82);
  --line:    rgba(238, 244, 246, .22);
  --line-hi: rgba(238, 244, 246, .45);
}

[data-tone="sky"] {
  --black:    #CFE6EE;
  --panel:    #C2DDE7;
  --panel-2:  #B5D5E0;
  --cream:    #1E2A2E;
  --cream-hi: #000000;
  --dim:      rgba(30, 42, 46, .82);
  --faint:    rgba(30, 42, 46, .7);
  --line:     rgba(30, 42, 46, .16);
  --line-hi:  rgba(30, 42, 46, .34);
  --on-cream: #CFE6EE;
  --logo-bg:  #FFFFFF;
  color-scheme: light;
}

/* A change of colour needs its own space above; two chapters in the same
   tone still run on, as they do on the plain page. */
.chapter[data-tone] + .chapter,
.chapter + .chapter[data-tone] { padding-top: var(--chapter); }

.chapter[data-tone="slate"] + .chapter[data-tone="slate"],
.chapter[data-tone="sky"] + .chapter[data-tone="sky"] { padding-top: 0; }

.chapter-head {
  display: grid;
  gap: 1.5rem;
  padding-bottom: clamp(2.5rem, 5vw, 4.5rem);
}

.chapter-tag {
  display: flex;
  align-items: center;
  gap: .9rem;
  color: var(--faint);
  font-family: var(--mono);
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .2em;
}

/* Its colour is set with the drawing, under Motion. */
.chapter-tag::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
}

/* A statement block: one oversized cream sentence across the page, with the
   quiet paragraph set underneath and indented to the right. Kept a step below
   the chapter titles so a long sentence never fills the whole screen. */
.statement { display: grid; gap: clamp(1.6rem, 3.2vw, 2.8rem); }

.statement h2 {
  font-size: clamp(1.85rem, 4.4vw, 3.7rem);
  max-width: 26ch;
}

.statement-note { margin-left: auto; max-width: 54ch; }

/* The start of a race beside the story of how it began. */
.statement-row { display: grid; gap: clamp(1.6rem, 3.2vw, 2.8rem); }
.statement-media { margin: 0; }
.statement-media img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

@media (min-width: 900px) {
  .statement-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
}
.statement p { color: var(--dim); font-size: 1.03rem; line-height: 1.68; }

/* One grade for the site's own photographs, so pictures from different
   cameras and light read as one set: colour pulled back, a touch more
   contrast, warm mid-tones (as in the hero's evening light), and a thin wash
   of the page's slate laid over them. The gallery (an archive of the races
   as they were) and the route maps are left as they are.

   The wash is a ::before on the frame (the frame's ::after is the curtain);
   on the two big photographs it joins their shades for the bar and title. */
:root { --grade: saturate(.8) contrast(1.07) sepia(.12) brightness(.98); --wash: rgba(30, 42, 46, .14); }

.statement-media img,
.bleed-media img,
.course-media img,
.org-photo img { filter: var(--grade); }

.statement-media::before,
.course-media figure::before,
.card-media::before,
.org-photo::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--wash);
  pointer-events: none;
}

/* Photograph between chapters, without a caption, as wide as the chapters'
   content (the .shell): edge to edge it read badly. The figure itself runs
   the full width so that its tone (data-tone, that of the chapters around
   it) fills the sides.

   The same --chapter of space above and below the frame, inside the
   figure's tone, so the picture never sits on the edge where one colour
   meets the next. Where the chapter next to it is in the same tone, that
   chapter's own padding already gives the space and the figure adds none,
   so the gap is never doubled. */
.bleed {
  margin-block: 0;
  padding-inline: var(--gut);
  padding-block: var(--chapter);
  display: grid;
}

.chapter[data-tone="slate"] + .bleed[data-tone="slate"],
.chapter:not([data-tone]) + .bleed:not([data-tone]) { padding-top: 0; }

.bleed[data-tone="slate"]:has(+ .chapter[data-tone="slate"]),
.bleed:not([data-tone]):has(+ .chapter:not([data-tone])) { padding-bottom: 0; }

/* The picture and its title share one cell, the title on the bottom-left of
   the frame, like the lettering on a race poster. The title is a sibling of
   the frame, not inside it, so the frame's rise and parallax never move it
   (moving type loses ClearType); it shows on the curtain first and the
   picture opens behind it. */
.bleed > * { grid-area: 1 / 1; }

.bleed-media { position: relative; z-index: 1; }

.bleed-media {
  width: 100%;
  max-width: calc(var(--maxw) - 2 * var(--gut));
  margin-inline: auto;
  height: clamp(320px, 74vh, 760px);
}

/* Both are colour photographs whose colour is the point (the runners' shoes),
   so they are shown nearly as they are, with only a light shade under the bar.
   --focus on the frame keeps the part that matters in a wide crop. */
.bleed-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--focus, 50% 50%);
}

/* A light shade under the bar at the top, and a deeper one rising from the
   bottom-left corner for the title. */
.bleed-media::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(var(--wash), var(--wash)),
    linear-gradient(to bottom, rgba(0,0,0,.28) 0%, rgba(0,0,0,0) 22%),
    linear-gradient(to top, rgba(14,20,22,.72) 0%, rgba(14,20,22,.32) 30%, rgba(14,20,22,0) 55%),
    radial-gradient(ellipse 70% 60% at 0% 100%, rgba(14,20,22,.45), rgba(14,20,22,0) 70%);
  pointer-events: none;
}

.bleed-title {
  position: relative;
  z-index: 3;
  align-self: end;
  width: 100%;
  max-width: calc(var(--maxw) - 2 * var(--gut));
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 3.5vw, 3.5rem) clamp(1.25rem, 3.2vw, 3.2rem);
  color: var(--cream);
  font-size: clamp(2.4rem, 7.4vw, 7rem);
  text-shadow: 0 2px 30px rgba(0, 0, 0, .25);
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   01 — Routes
   -------------------------------------------------------------------------- */

.routes { display: grid; gap: 0; }

.route {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(1.2rem, 3vw, 3rem);
  align-items: start;
  padding-block: clamp(2.2rem, 4vw, 3.4rem);
  /* Each route is ruled off in the colour of its arrows on the road
     (--route on the article), as are its number and its name. */
  border-top: 2px solid var(--route, var(--line));
}

.route:last-child { border-bottom: 1px solid var(--line); }

/* Η διαδρομή now closes the routes chapter, without a head of its own. */
.routes + .course { margin-top: var(--chapter); }

.route-num {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(3rem, 6vw, 5.2rem);
  line-height: .82;
  letter-spacing: -.05em;
  color: var(--route, var(--cream));
}

/* Next to a 5rem numeral a whisper of a unit disappears, so "χλμ" is set
   bigger, heavier and in the full cream. */
.route-num small {
  display: block;
  font-family: var(--mono);
  font-size: .95rem;
  font-weight: 500;
  letter-spacing: .16em;
  margin-top: .45rem;
  color: var(--cream);
}

.route-body { display: grid; gap: 1rem; align-content: start; }

.route-body h3 { font-size: 1.28rem; letter-spacing: -.01em; color: var(--route, var(--cream)); }
.route-body p { color: var(--dim); }

.arrow-tag {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-family: var(--mono);
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--cream);
}

.route-facts {
  display: grid;
  gap: .05rem;
  border-top: 1px solid var(--line);
  margin-top: .3rem;
}

.route-facts > div {
  display: grid;
  grid-template-columns: minmax(0, 11rem) minmax(0, 1fr);
  gap: 1rem;
  padding: .62rem 0;
  border-bottom: 1px solid var(--line);
}

.route-facts dt {
  font-family: var(--mono);
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--faint);
  padding-top: .18em;
}

.route-facts dd { font-size: .95rem; }

/* A route's two course records: men on the left, women on the right, each
   label above its time. */
.rec-pair { display: flex; flex-wrap: wrap; gap: .5rem 2.6rem; }

.rec-pair > span {
  display: grid;
  gap: .15rem;
  font-family: var(--mono);
  font-size: 1.02rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.rec-pair small {
  font-size: .6rem;
  text-transform: uppercase;
  letter-spacing: .15em;
  color: var(--dim);
}

/* The course maps, drawn dark like the page with the route in its colour:
   shown as they are, whole. */
.route-map { align-self: start; overflow: hidden; }
.route-map img {
  width: 100%;
  aspect-ratio: 1239 / 768;
  object-fit: cover;
}

.route-map-missing {
  display: grid;
  place-content: center;
  gap: .35rem;
  text-align: center;
  aspect-ratio: 4 / 3;
  border: 1px dashed var(--line-hi);
  padding: 1rem;
}

.route-map-missing strong {
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .15em;
}

.route-map-missing span { font-size: .85rem; color: var(--faint); }

/* --------------------------------------------------------------------------
   02 — The course
   -------------------------------------------------------------------------- */

.course {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.3fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}

.course-media { display: grid; gap: 1.4rem; align-content: start; }

.course-media img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

/* Eight short waypoints, read down the first column and then the second:
   01–04 on the left, 05–08 on the right. */
.waypoints {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(4, auto);
  grid-auto-flow: column;
  column-gap: clamp(1.4rem, 3vw, 2.6rem);
  counter-reset: wp;
}

.waypoints li {
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr);
  gap: .3rem 1rem;
  padding: 1.05rem 0;
  border-bottom: 1px solid var(--line);
  counter-increment: wp;
  /* The rows are as tall as the taller waypoint beside them: the title and
     its note stay together at the top instead of spreading apart. */
  align-content: start;
}

/* The top of each column. */
.waypoints li:nth-child(4n + 1) { border-top: 1px solid var(--line); }

.waypoints li::before {
  content: counter(wp, decimal-leading-zero);
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .12em;
  color: var(--faint);
  padding-top: .22em;
}

/* The number is the first grid item, so the title and the note both have to be
   sent to the second column — otherwise the note drops under the number and is
   squeezed to one word per line. */
.waypoints b,
.waypoints span { grid-column: 2; }

.waypoints b {
  display: block;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -.005em;
}

.waypoints span { display: block; color: var(--dim); font-size: .93rem; margin-top: .18rem; }

.pull {
  font-family: var(--display);
  font-weight: 800;
  text-transform: uppercase;
  font-size: clamp(1.3rem, 2.6vw, 2.1rem);
  line-height: 1.02;
  letter-spacing: -.02em;
  color: var(--cream);
  margin-block: 1.6rem;
  max-width: 22ch;
}

/* --------------------------------------------------------------------------
   03 — Records
   -------------------------------------------------------------------------- */

/* Men on the left, women on the right: two groups, each under its own
   heading, with enough room between them to read as two. */
.block-label {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .3rem 1rem;
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--cream);
  padding-bottom: .9rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.4rem;
}

.block-label span { color: var(--faint); }

/* The course records head the results chapter, on a panel of their own
   with the three course colours along its top edge, so they read apart from
   the table of every finish underneath. */
.res-block {
  margin-bottom: clamp(3.2rem, 6vw, 5rem);
  padding: clamp(1.6rem, 4vw, 3.2rem);
  background:
    linear-gradient(90deg, var(--r10) 0 33.33%, var(--r5) 33.33% 66.66%, var(--r1) 66.66%) top / 100% 4px no-repeat,
    var(--panel);
}

.res-block .rec-time { font-size: clamp(1.9rem, 3.6vw, 2.9rem); font-weight: 600; }

.records {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(2rem, 5vw, 4.5rem);
}

.rec-head {
  font-family: var(--display);
  font-weight: 800;
  text-transform: uppercase;
  font-size: clamp(1.5rem, 2.8vw, 2.3rem);
  line-height: 1;
  letter-spacing: -.02em;
  padding-bottom: .85rem;
  border-bottom: 2px solid var(--cream);
}

.rec-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }

.record {
  display: grid;
  align-content: start;
  gap: .45rem;
  padding: clamp(1.2rem, 2.4vw, 2rem) clamp(.8rem, 2vw, 1.6rem) clamp(1.4rem, 2.6vw, 2.2rem) 0;
  border-bottom: 1px solid var(--line);
}

.record + .record { border-left: 1px solid var(--line); padding-left: clamp(.9rem, 2vw, 1.6rem); }

.rec-label {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--mono);
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .15em;
  color: var(--faint);
}

.rec-time {
  font-family: var(--mono);
  font-size: clamp(1.45rem, 2.7vw, 2.1rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  margin-block: .3rem .1rem;
}

.rec-who { font-size: .95rem; }
.rec-year { font-family: var(--mono); font-size: .62rem; letter-spacing: .15em; color: var(--faint); }

/* --------------------------------------------------------------------------
   04 — Registration
   -------------------------------------------------------------------------- */

/* Latest notes for the runners (clothes, shoes, parking…), under the
   registration details. Written per edition in the admin. */
.updates {
  margin-top: clamp(3rem, 6vw, 5rem);
}

.updates-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .6rem 2rem;
  margin-bottom: clamp(1.2rem, 2.6vw, 2rem);
}

.updates-title {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  text-transform: uppercase;
  letter-spacing: -.02em;
}

.updates-date {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-size: .7rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--faint);
}

.updates-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  gap: 0 clamp(1.5rem, 3vw, 2.6rem);
  margin: 0;
}

.updates-list > div {
  padding: 1.2rem 0 1.6rem;
  border-top: 1px solid var(--line-hi);
}

.updates-list dt {
  margin-bottom: .6rem;
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 800;
}

.updates-list dd {
  margin: 0;
  color: var(--dim);
  font-size: .97rem;
  line-height: 1.62;
}

.signup {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(1.8rem, 4vw, 4rem);
  align-items: start;
}

.status-tag {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--mono);
  font-size: .66rem;
  text-transform: uppercase;
  letter-spacing: .16em;
  margin-bottom: 1.2rem;
}

.pulse {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--cream);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--cream) 60%, transparent);
  animation: pulse 2.4s ease-out infinite;
}

@keyframes pulse {
  70%  { box-shadow: 0 0 0 9px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }

.known {
  display: grid;
  border-top: 1px solid var(--line);
  margin-top: 1.6rem;
}

.known > div {
  display: grid;
  grid-template-columns: minmax(0, 11rem) minmax(0, 1fr);
  gap: 1rem;
  padding: .8rem 0;
  border-bottom: 1px solid var(--line);
}

.known dt {
  font-family: var(--mono);
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--faint);
  padding-top: .25em;
}

.known dd { font-size: .97rem; }
.known a { border-bottom: 1px solid var(--line-hi); }
.known a:hover { border-color: var(--cream); }

.sched-row { display: block; }
.sched-row b { font-family: var(--mono); font-size: .76rem; font-weight: 500; letter-spacing: .04em; margin-right: .5rem; }

.card {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: clamp(1.5rem, 3vw, 2.4rem);
  display: grid;
  gap: 1rem;
  align-content: start;
}

.card h3 { font-size: 1.3rem; text-transform: uppercase; letter-spacing: -.01em; }
.card p { color: var(--dim); font-size: .97rem; }

.card-media { margin: calc(-1 * clamp(1.5rem, 3vw, 2.4rem)); margin-bottom: 0; }

.card-media img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  filter: grayscale(1) contrast(1.05) brightness(.9);
}

/* The black-and-white pictures come into colour once they are reached: the
   curtain drops on the grey picture, and the colour follows a moment later,
   slowly enough to be seen happening. */
.route-map.is-in img {
  filter: none;
  transition: filter 1.6s ease .7s, scale 1.2s var(--ease-soft);
}

.card-media.is-in img {
  filter: var(--grade);
  transition: filter 1.6s ease .7s, scale 1.2s var(--ease-soft);
}

/* --------------------------------------------------------------------------
   05 — Results
   -------------------------------------------------------------------------- */

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-bottom: 1.6rem;
}

/* Each filter is one control the size of its whole box: the dropdown (or the
   search field) fills the box, and the label is laid over it without taking
   clicks — so a click anywhere in the box opens the list, not only a click
   on the value itself. A chevron and a hover state say it is a control. */
.field {
  position: relative;
  display: block;
  background: var(--black);
  transition: background .3s ease, box-shadow .3s ease;
}

.field:hover { background: var(--panel-2); }
.field:focus-within { background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--cream); }

.field-search { grid-column: span 2; }

.field label {
  position: absolute;
  top: .85rem;
  left: 1rem;
  right: 2.8rem;
  pointer-events: none;
  font-family: var(--mono);
  font-size: .58rem;
  text-transform: uppercase;
  letter-spacing: .17em;
  color: var(--faint);
  transition: color .3s ease;
}

.field:hover label,
.field:focus-within label { color: var(--dim); }

.field select,
.field input {
  display: block;
  width: 100%;
  min-height: 4.1rem;
  margin: 0;
  padding: 2.05rem 2.8rem .85rem 1rem;
  border: 0;
  border-radius: 0;
  background-color: transparent;
  background-repeat: no-repeat;
  background-position: right 1.05rem center;
  background-size: 12px 12px;
  color: var(--cream);
  font-family: var(--body);
  font-size: .98rem;
  line-height: 1.2;
  -webkit-appearance: none;
          appearance: none;
}

.field select:focus,
.field input:focus { outline: none; }

/* Chevron for the dropdowns, magnifier for the search — drawn in the page's
   cream. */
.field select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M1.5 4l4.5 4.5L10.5 4' fill='none' stroke='%23EEF4F6' stroke-width='1.4'/%3E%3C/svg%3E");
}

.field input {
  cursor: text;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Ccircle cx='5' cy='5' r='3.6' fill='none' stroke='%23EEF4F6' stroke-width='1.3'/%3E%3Cpath d='M7.7 7.7L11 11' stroke='%23EEF4F6' stroke-width='1.3'/%3E%3C/svg%3E");
}

.field select option { background: #101010; color: var(--cream); }
.field input::placeholder { color: var(--faint); }

/* The browser's own clear button is hidden; the magnifier stays put. */
.field input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }

.res-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .4rem 1.5rem;
  font-family: var(--mono);
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .15em;
  color: var(--faint);
  padding-bottom: .8rem;
}

.table-wrap { overflow-x: auto; }

.res { width: 100%; border-collapse: collapse; }

.res th {
  text-align: left;
  font-family: var(--mono);
  font-size: .58rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--faint);
  padding: .7rem .8rem;
  border-bottom: 1px solid var(--line-hi);
  white-space: nowrap;
}

.res td {
  padding: .78rem .8rem;
  border-bottom: 1px solid var(--line);
  font-size: .95rem;
  vertical-align: baseline;
}

.res tbody tr:hover td { background: color-mix(in srgb, var(--cream) 4.5%, transparent); }

.col-num { text-align: right; font-variant-numeric: tabular-nums; }
.col-rank { font-family: var(--mono); font-size: .9rem; color: var(--faint); width: 1%; }
.rank-1, .rank-2, .rank-3 { color: var(--cream); }
.col-name { font-weight: 500; }
.col-time { font-family: var(--mono); font-size: .95rem; }
.col-pace { font-family: var(--mono); font-size: .82rem; color: var(--faint); }
.res-unit { font-size: .62em; letter-spacing: .08em; margin-left: .18em; }
.res-sub { display: none; }
.res-empty { text-align: center; color: var(--faint); padding-block: 2rem; }

.load-more { display: flex; justify-content: center; padding-top: 1.6rem; }

.archive-note { color: var(--faint); font-size: .88rem; padding-top: 1.2rem; }

/* --------------------------------------------------------------------------
   06 — The organisation
   -------------------------------------------------------------------------- */

/* Three rows: the story beside the chart, the numbers across the full width,
   then the volunteers' photo beside the call for volunteers. Each row is
   about as tall on both sides, so neither column runs on alone. */
.org {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2.4rem, 5vw, 4.5rem) clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}

.org > .stats,
.org-help { grid-column: 1 / -1; }

.org-help {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: clamp(1rem, 2vw, 1.5rem);
}

.org-photo img { width: 100%; height: 100%; aspect-ratio: 16 / 10; object-fit: cover; }

/* The card stands as tall as the photo: its label at the top, the call and
   the link at the bottom. */
.card.volunteer { display: flex; flex-direction: column; justify-content: flex-end; }
.volunteer-tag { margin-bottom: auto; padding-bottom: 1.5rem; color: var(--faint); }
.card.volunteer h3 { font-size: clamp(1.8rem, 3.4vw, 3rem); line-height: .95; letter-spacing: -.025em; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.stat { display: grid; gap: .3rem; padding: 1.1rem 1.2rem; background: var(--black); }

.stat b {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(1.7rem, 3.4vw, 2.6rem);
  line-height: 1;
  letter-spacing: -.035em;
}

.stat span {
  font-family: var(--mono);
  font-size: .58rem;
  text-transform: uppercase;
  letter-spacing: .15em;
  color: var(--faint);
}

.chart-card { display: grid; gap: 1rem; align-content: start; }
.chart-card h3 { font-size: 1.05rem; text-transform: uppercase; letter-spacing: .01em; }

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.2rem;
  font-family: var(--mono);
  font-size: .58rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--faint);
}

.chart-legend span { display: inline-flex; align-items: center; gap: .45rem; }
.chart-legend i { width: 9px; height: 9px; border-radius: 2px; }

.chart-wrap svg { width: 100%; height: auto; }
.chart-grid { stroke: color-mix(in srgb, var(--cream) 14%, transparent); stroke-width: 1; }
.chart-axis { fill: color-mix(in srgb, var(--cream) 38%, transparent); font-family: var(--mono); font-size: 11px; }
.chart-total { fill: var(--cream); font-family: var(--mono); font-size: 12px; }
/* The timed runners' bars are drawn in the ink of the chapter, so they show on cream too. */
.chart-timed { fill: var(--cream); }
.chart-year  { fill: color-mix(in srgb, var(--cream) 55%, transparent); font-family: var(--mono); font-size: 12px; letter-spacing: .06em; }

/* --------------------------------------------------------------------------
   Photos
   Justified rows: every picture keeps its own shape and each row fills the
   width. The script sizes the rows; without it they still wrap, only with a
   ragged end.
   -------------------------------------------------------------------------- */

.gallery { display: flex; flex-wrap: wrap; gap: var(--gal-gap, .75rem); }
.gallery li { flex: var(--r) 1 calc(var(--r) * 15rem); min-width: 0; }
.gallery.is-justified li { flex: none; }

.gallery-item {
  display: block;
  aspect-ratio: var(--r);
  background: var(--panel);
  cursor: zoom-in;
}

.gallery.is-justified .gallery-item { aspect-ratio: auto; height: 100%; }

.gallery-item img { width: 100%; height: 100%; object-fit: cover; }

/* Same weight as the rule that settles the picture after its entrance, plus
   one, or the hover would never show. */
.gallery .reveal-mask.gallery-item:hover img,
.gallery .reveal-mask.gallery-item:focus-visible img { scale: 1.04; }

.gallery .reveal-mask.gallery-item.is-done img { transition: scale 1.2s var(--ease-soft); }

/* The photo viewer. */
.lightbox {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(0, 0, 0, .97);
  color: #EEF4F6;
  overflow: hidden;
  overscroll-behavior: contain;
}

.lightbox::backdrop { background: rgba(0, 0, 0, .6); }
.lightbox[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }

.lb-top,
.lb-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .9rem var(--gut);
  font-family: var(--mono);
  font-size: .66rem;
  text-transform: uppercase;
  letter-spacing: .15em;
}

/* The picture is placed absolutely so its maximum size is measured against
   the stage, whose height is fixed by the viewer; as a grid item it was
   measured against an auto row and spilled out at full size. */
.lb-stage { --lb-pad: clamp(.5rem, 5vw, 5.5rem); position: relative; min-height: 0; }

.lb-stage img {
  position: absolute;
  inset: 0 var(--lb-pad);
  margin: auto;
  width: auto;
  height: auto;
  max-width: calc(100% - 2 * var(--lb-pad));
  max-height: 100%;
  user-select: none;
  -webkit-user-drag: none;
}
.lb-foot { justify-content: center; min-height: 3.4rem; text-align: center; color: rgba(238, 244, 246, .78); text-transform: none; letter-spacing: .02em; font-family: var(--body); font-size: .92rem; }

.lb-btn {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  height: 44px;
  padding: 0 .9rem;
  border: 1px solid rgba(238, 244, 246, .34);
  background: rgba(0, 0, 0, .4);
  color: #EEF4F6;
  font-family: var(--mono);
  font-size: .66rem;
  text-transform: uppercase;
  letter-spacing: .15em;
  cursor: pointer;
  transition: background .3s ease, color .3s ease;
}

.lb-btn:hover,
.lb-btn:focus-visible { background: #EEF4F6; color: #1E2A2E; }

.lb-prev,
.lb-next { position: absolute; top: 50%; translate: 0 -50%; font-family: var(--body); font-size: 1.3rem; letter-spacing: 0; }
.lb-prev { left: clamp(.5rem, 1.5vw, 1.5rem); }
.lb-next { right: clamp(.5rem, 1.5vw, 1.5rem); }

/* --------------------------------------------------------------------------
   07 — Partners
   -------------------------------------------------------------------------- */

/* The organiser on the left, its crest large; on the right every supporter
   in one even field, without boxes or tier titles. The logos are the club's,
   redrawn for the dark page (transparent, dark lettering made light), and
   each is drawn at the same apparent size: the template sets --k from its
   proportions, so a wide logo is lower and a square one taller, each
   covering about the same area. Those with a website link to it. */
.partners {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 2.2fr);
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: start;
}

/* The organiser stays in view beside the tiers on a wide screen. */
.partner-lead { position: sticky; top: calc(var(--bar) + 2rem); }

.partner-tiers { display: grid; gap: clamp(2.6rem, 5vw, 4rem); }
.partner-group .block-label { margin-bottom: clamp(1.6rem, 3vw, 2.4rem); }

.partner-lead { display: grid; gap: 1.4rem; justify-items: start; }
.lead-crest { width: clamp(150px, 15vw, 210px); height: auto; }

.lead-name {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.35rem;
  line-height: 1.05;
  letter-spacing: -.01em;
  text-transform: uppercase;
}

.lead-note { color: var(--dim); font-size: .95rem; margin-top: .6rem; max-width: 32ch; }

.sp-field {
  --logo-h: 92px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 10.5rem), 1fr));
  align-items: center;
  gap: clamp(2.2rem, 4vw, 3.4rem) clamp(1.4rem, 3vw, 2.6rem);
}

/* Each logo in a band of the same height. */
.sp-field li {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(var(--logo-h) * 1.18);
  text-align: center;
}

.sp-role {
  font-family: var(--mono);
  font-size: .58rem;
  line-height: 1.5;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--faint);
}

.partner-lead .sp-role { margin-bottom: .55rem; }

.sp { display: inline-flex; border-radius: 2px; }
.sp img {
  display: block;
  width: auto;
  height: calc(var(--logo-h) * var(--k, 1));
  max-width: 100%;
  object-fit: contain;
  transition: translate .35s var(--ease-out), opacity .35s ease;
}

a.sp:hover img { translate: 0 -3px; }
a.sp:focus-visible { outline: 1px solid var(--cream); outline-offset: 8px; }

.sp-text {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.05rem;
  text-align: center;
}

.names { display: flex; flex-wrap: wrap; gap: .5rem; }

.names li {
  padding: .45rem .9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .13em;
  color: var(--dim);
}

/* --------------------------------------------------------------------------
   08 — FAQ
   -------------------------------------------------------------------------- */

.faq { border-top: 1px solid var(--line); }

.faq details { border-bottom: 1px solid var(--line); }

.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1.15rem 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1rem, 1.7vw, 1.22rem);
  letter-spacing: -.005em;
  transition: color .3s ease;
}

.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--cream-hi); }

.faq summary::after {
  content: "";
  flex: 0 0 auto;
  margin-left: auto;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line-hi);
  border-radius: 50%;
  background:
    linear-gradient(var(--cream), var(--cream)) center / 11px 1px no-repeat,
    linear-gradient(var(--cream), var(--cream)) center / 1px 11px no-repeat;
  transition: transform .35s cubic-bezier(.22, .7, .25, 1), border-color .3s ease;
}

.faq details[open] summary::after { transform: rotate(135deg); border-color: var(--cream); }
.faq details.is-closing summary::after { transform: none; }

.faq-body { overflow: hidden; }
.faq-body p { color: var(--dim); max-width: 70ch; padding-bottom: 1.15rem; }
.faq-body p + p { padding-top: .8rem; }

/* --------------------------------------------------------------------------
   09 — Contact
   -------------------------------------------------------------------------- */

.contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.form-field { display: grid; gap: .4rem; }

.form-field label,
.consent span {
  font-family: var(--mono);
  font-size: .58rem;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--faint);
}

.form-field input,
.form-field textarea {
  width: 100%;
  padding: .75rem 0;
  border: 0;
  border-bottom: 1px solid var(--line-hi);
  background: transparent;
  color: var(--cream);
  font-family: var(--body);
  font-size: 1rem;
  resize: vertical;
  transition: border-color .3s ease;
}

.form-field input:focus,
.form-field textarea:focus { outline: none; border-color: var(--cream); }

.consent { display: flex; gap: .7rem; align-items: start; cursor: pointer; }
.consent span { text-transform: none; letter-spacing: .01em; font-family: var(--body); font-size: .86rem; line-height: 1.5; }
.consent input { margin-top: .25rem; accent-color: var(--cream); flex: 0 0 auto; }

.contact-form, .signup-form { display: grid; gap: 1.1rem; }

.form-msg { font-family: var(--mono); font-size: .64rem; text-transform: uppercase; letter-spacing: .13em; min-height: 1em; }
.form-msg.is-ok  { color: var(--cream); }
.form-msg.is-err { color: #F0A39A; }

/* Honeypot: off-screen, never announced. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

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

/* In the logo's slate, so it reads apart from the last chapter. */
.foot { padding-top: clamp(3rem, 6vw, 5rem); overflow: hidden; }

/* The contact column is the widest: four phones, each with a full name. */
.foot-grid {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, .8fr);
  gap: 2rem;
  padding-bottom: clamp(2rem, 4vw, 3rem);
}

.foot h3 {
  font-family: var(--mono);
  font-size: .6rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--faint);
  margin-bottom: .8rem;
}

.foot ul { display: grid; gap: .4rem; }
.foot li { color: var(--dim); font-size: .95rem; }
.foot a:hover { color: var(--cream); }
.foot-org img { width: clamp(120px, 12vw, 180px); height: auto; }

.foot-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem 1.5rem;
  padding-block: 1.2rem;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: .6rem;
  text-transform: uppercase;
  letter-spacing: .15em;
  color: var(--faint);
}

.foot-bottom { align-items: center; }

/* The agency's signature, its name a little brighter than the rest. */
.foot-credit b { font-weight: 500; color: var(--cream); }
.foot-credit:hover b,
.foot-credit:focus-visible b { text-decoration: underline; text-underline-offset: .3em; }

.foot .wordmark { margin-top: 0; padding-bottom: 0; }

/* --------------------------------------------------------------------------
   Narrow screens
   -------------------------------------------------------------------------- */

/* On a tablet each route stays on one row: the number moves above the text
   and the map takes the right-hand column instead of dropping underneath. */
@media (max-width: 1080px) {
  .route { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); column-gap: clamp(1.2rem, 3vw, 2rem); row-gap: 1.1rem; }
  .route-num { grid-column: 1; display: flex; align-items: baseline; gap: .7rem; }
  .route-num small { margin-top: 0; }
  .route-body { grid-column: 1; }
  .route-map { grid-column: 2; grid-row: 1 / span 2; }
  .route-facts > div { grid-template-columns: minmax(0, 8.5rem) minmax(0, 1fr); }
}

@media (max-width: 900px) {
  :root { --bar: 56px; }

  .statement,
  .course,
  .signup,
  .org,
  .org-help,
  .records,
  .contact,
  .partners { grid-template-columns: minmax(0, 1fr); }

  .partner-lead { position: static; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 1.4rem; }
  .lead-crest { width: 110px; }

  /* The text column opens up so the photograph can sit between the lede and
     the line about the view. */
  .course > div:not(.course-media) { display: contents; }
  .course-media { position: static; order: 2; }
  .course .lede { order: 1; }
  .course .pull { order: 3; margin-top: 0; }
  .course .waypoints { order: 4; }
  .course-media img { aspect-ratio: 4 / 3; }

  .field-search { grid-column: 1 / -1; }

  .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* On phones the bib, club and category collapse under the name so the
     table fits without sideways scrolling. */
  .col-club, .col-cat { display: none; }
  .res-sub { display: block; font-size: .76rem; color: var(--faint); margin-top: .18rem; }
  .res td { padding-inline: .45rem; }
  .res th { padding-inline: .45rem; }
}

/* Up to 655px the filters go two by two with the search underneath, as on a
   phone, rather than three, one and one. */
@media (max-width: 655px) {
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-search { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  /* Buttons sized for a phone, the tap area still above 44px. */
  .btn { padding: .85rem 1.1rem; font-size: .78rem; }

  /* Footer on the centre line. */
  .foot-grid { justify-items: center; text-align: center; gap: 2.4rem; }
  .foot-org img { width: 130px; margin-inline: auto; }
  .foot-bottom { flex-direction: column; align-items: center; text-align: center; }

  body { font-size: 16px; }

  /* The chapters breathe less on a phone: at desktop spacing the black gaps
     between sections turn into whole empty screens. */
  :root { --chapter: 3.4rem; }

  /* Pictures stay around a third of the screen instead of filling it; the
     hero is the exception and keeps its full height. */
  /* The frame sets the height, not the picture: the picture fills it and is
     clipped, so the parallax has room to move without opening a gap. */
  .bleed-media { height: 380px; }
  .course-media img { aspect-ratio: auto; height: 360px; }
  .card-media img { aspect-ratio: auto; height: 220px; }

  .route { grid-template-columns: minmax(0, 1fr); gap: 1.2rem; }
  .route-num, .route-body, .route-map { grid-column: auto; grid-row: auto; }

  /* The statement under the hero is a step smaller on a phone, where at the
     desktop minimum it filled most of the first screen. */
  .statement h2 { font-size: clamp(1.3rem, 6vw, 1.6rem); }


  .sp-field { --logo-h: 64px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem 1rem; }
  .route-num { display: flex; align-items: baseline; gap: .7rem; }
  .route-num small { margin-top: 0; }
  .route-facts > div { grid-template-columns: minmax(0, 1fr); gap: .15rem; }
  .known > div { grid-template-columns: minmax(0, 1fr); gap: .15rem; }

  /* The waypoint number sits right next to its title rather than a whole
     column away. */
  .waypoints li { grid-template-columns: 2.1rem minmax(0, 1fr); gap: .3rem .55rem; }

  /* One column on a phone, 01 to 08 straight down, ruled once between each. */
  .waypoints { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-auto-flow: row; }
  .waypoints li:nth-child(4n + 1):not(:first-child) { border-top: 0; }

  .rec-time { font-size: 1.4rem; }
  .gallery { --gal-gap: .45rem; }

  .stats { grid-template-columns: minmax(0, 1fr); }
  .form-row { grid-template-columns: minmax(0, 1fr); }
  .foot-grid { grid-template-columns: minmax(0, 1fr); }

  /* The bottom edge stacks, centred: the date and the countdown first, then
     the edition and the venue on one line, then the distances. */
  .hero-foot-in { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; gap: 1rem; }
  .hero-clock { order: -1; }
  .hero-race { display: flex; flex-wrap: wrap; justify-content: center; justify-self: center; gap: .3rem .9rem; }
  .hero-dists { justify-content: center; justify-self: center; }


  .menu-list .num { width: auto; }
  .menu-list .lbl { font-size: clamp(1.45rem, 7vw, 1.9rem); }

}



/* --------------------------------------------------------------------------
   Text pages (the privacy policy) and the 404 page
   -------------------------------------------------------------------------- */

.doc-page { padding-top: calc(var(--chapter) + 3rem); min-height: 70svh; }
.doc {
  display: grid;
  gap: 1.1rem;
  max-width: 46rem;
  font-family: var(--body);
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--dim);
}
.doc > * { margin: 0; }
.doc h2 {
  margin-top: 1.4rem;
  font-family: var(--display);
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.01em;
  color: var(--cream);
}
.doc ul { display: grid; gap: .45rem; padding-left: 1.2rem; list-style: disc; }
.doc li::marker { color: var(--faint); }
.doc a,
.doc strong { color: var(--cream); }
.doc a { text-underline-offset: .2em; }
.not-found .lede { max-width: 40rem; margin-bottom: 2rem; }
.btn-quiet { background: transparent; color: var(--cream); box-shadow: inset 0 0 0 1px var(--line-hi); }

/* The consent link, and Google's notice in place of its floating badge. */
.consent a { color: var(--cream); text-underline-offset: .2em; }
.form-captcha { margin: 0; font-size: .78rem; line-height: 1.5; color: var(--faint); }
.form-captcha a { color: inherit; text-underline-offset: .2em; }
.grecaptcha-badge { visibility: hidden !important; }
.foot-bottom span a { color: inherit; text-underline-offset: .2em; }
