/* The home page (views/pages/landing.php). It sits in the shop's frame (pages/shop.css: the hexagons and glow at the
   top, the sticky header, the footer) and uses the shop's hero layout for the words (.shop-hero). This file adds the
   sign-in pill, the hexagon bullet before the eyebrow, and the floating hexagon.
   The hexagon: a pointy-top hexagon with a thin white border that hovers gently (three nested movements of different
   lengths, so the path never repeats the same way). Inside it 9 photos take turns, 7 seconds each: each one grows out
   of the background hexagons from its own point, stays, then shrinks away to another point while the next one grows.
   Its title, in a white chip under it, grows and shrinks with it. All CSS: each photo's turn is set by its delay.
   The two products are see-through bottles in a hexagon that is half white inside, so the hexagons behind show.
   Up to 767px: the hexagon first, centred, then the words; from 768px beside the words. With reduced motion: no movement,
   the first photo stays.
   Behind it all, some of the background hexagons are filled in, each at its own strength: one set stays, six more sets
   fade in and out, each on its own timing, so single hexagons seem to light up at random. */

/* --- The sign-in pill: on phones the person icon, in one pill with the menu button (no glass of its own, so no round
   shape inside the pill; both classes, as shop.css comes later); from 768px a pill of its own with the words --- */
.shop__phone .home-signin {
  height: 100%;
  font-size: var(--fs-lead); /* the icon as big as the menu button's */
  background: none;
  box-shadow: none;
}

.shop__phone .home-signin:hover {
  box-shadow: none; /* the pill's hover shadow would show a circle round the icon */
}

.home-signin__words {
  display: none;
}

/* The phone menu has only the pages (no Deliver to under them, as in the shop), so no line under them. */
.shop__menu-nav:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

/* --- The eyebrow's hexagon bullet --- */
.home-bullet {
  margin-right: var(--sp-2);
  color: var(--c-menu-button);
}

/* --- Less room above the header than the shop: 16px of page plus the header's own 16px, on every screen (both
   classes: shop.css comes later and gives the shop 32px from 992px) --- */
.shop.home {
  padding-top: var(--sp-4);
}

/* --- The hero: more room under the header than the shop has. Both classes: shop.css comes later and sets the shop's
   own columns (side by side from 576px); the home page stays one column until 768px. --- */
.shop-hero.home-hero {
  padding-top: var(--sp-8);
}

/* --- The buttons under the words --- */
.home-hero__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-top: var(--sp-2);
}

/* --- The filled background hexagons: the shop's hexagons again (same place, colour and fade), but drawn from a tile of
   filled cells instead of the lines. Each tile lines up with the lines' tile. --- */
.home-fill {
  --hex-size: var(--home-fill-size);
}

.home-fill--still { --hex-tile: url("../../img/home/hexagons/fill-still.svg"); }

/* The six sets that fade: each its own length and start, so they never fade together the same way twice. */
/* Each set's length and start are shares of --home-glow-time (tokens.css). */
.home-fill--live {
  opacity: 0;
  animation: home-glow var(--glow-time) var(--ease) var(--glow-start) infinite;
}

.home-fill--1 { --hex-tile: url("../../img/home/hexagons/fill-1.svg"); --glow-time: calc(var(--home-glow-time) * 0.8); --glow-start: calc(var(--home-glow-time) * 0); }
.home-fill--2 { --hex-tile: url("../../img/home/hexagons/fill-2.svg"); --glow-time: calc(var(--home-glow-time) * 0.97); --glow-start: calc(var(--home-glow-time) * -0.26); }
.home-fill--3 { --hex-tile: url("../../img/home/hexagons/fill-3.svg"); --glow-time: calc(var(--home-glow-time) * 1.14); --glow-start: calc(var(--home-glow-time) * -0.62); }
.home-fill--4 { --hex-tile: url("../../img/home/hexagons/fill-4.svg"); --glow-time: calc(var(--home-glow-time) * 0.86); --glow-start: calc(var(--home-glow-time) * -0.43); }
.home-fill--5 { --hex-tile: url("../../img/home/hexagons/fill-5.svg"); --glow-time: calc(var(--home-glow-time) * 1.2); --glow-start: calc(var(--home-glow-time) * -0.17); }
.home-fill--6 { --hex-tile: url("../../img/home/hexagons/fill-6.svg"); --glow-time: calc(var(--home-glow-time) * 1.03); --glow-start: calc(var(--home-glow-time) * -0.78); }

@keyframes home-glow {
  0%, 100% { opacity: 0; }
  35%, 55% { opacity: 1; }
}

/* --- The floating hexagon --- */
.home-hex {
  order: -1; /* phones: above the words */
  justify-self: center;
  width: min(72%, var(--home-hex-w-phone));
}

.home-hex__drift {
  animation: home-drift var(--home-drift) var(--ease) infinite;
}

.home-hex__tilt {
  animation: home-tilt var(--home-tilt) var(--ease) infinite;
}

.home-hex__float {
  position: relative;
  aspect-ratio: 1040 / 1200; /* the photos' shape: a pointy-top hexagon fits it exactly */
  margin-bottom: var(--sp-12); /* room for the title chip under it */
  animation: home-float var(--home-float) var(--ease) infinite;
}

/* One photo with its title. --in-x/--in-y: where it grows from; --out-x/--out-y: where it shrinks away to. */
.home-hex__item {
  position: absolute;
  inset: 0;
  opacity: 0;
  animation: home-swap var(--home-cycle) var(--ease-swap) infinite;
}

.home-hex__frame {
  height: 100%;
  padding: var(--home-hex-border);
  background-color: var(--c-page);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  filter: var(--shadow-home-hex);
}

.home-hex__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}

/* A product: the border stays solid white (a ring cut out of the white), the inside is half see-through. */
.home-hex__frame--clear {
  position: relative;
  background-color: var(--c-home-hex-clear);
}

.home-hex__frame--clear::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: var(--c-page);
  clip-path: polygon(evenodd,
    50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%, 50% 0,
    50% var(--home-hex-border),
    var(--home-hex-border) calc(25% + var(--home-hex-border) / 2),
    var(--home-hex-border) calc(75% - var(--home-hex-border) / 2),
    50% calc(100% - var(--home-hex-border)),
    calc(100% - var(--home-hex-border)) calc(75% - var(--home-hex-border) / 2),
    calc(100% - var(--home-hex-border)) calc(25% + var(--home-hex-border) / 2),
    50% var(--home-hex-border));
}

.home-hex__title {
  position: absolute;
  top: calc(100% + var(--sp-5));
  left: 50%;
  translate: -50% 0;
  padding: var(--sp-1) var(--sp-4);
  white-space: nowrap;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--c-accent-text);
  background-color: var(--c-page);
  border: var(--border-1) solid var(--c-chip-border);
  border-radius: var(--radius-pill);
}

/* Each photo's turn (its delay: its place in the order, less 0.29 of a turn (2 seconds at 7) so the first one is already in at the start)
   and its own points. The order keeps the two products, and the two consultations, apart. */
.home-hex__item--1 { --in-x: 70%;  --in-y: -55%; --out-x: -75%; --out-y: -60%; animation-delay: calc(var(--home-photo-time) * (0 - 0.29)); }
.home-hex__item--7 { --in-x: 85%;  --in-y: 55%;  --out-x: -60%; --out-y: -75%; animation-delay: calc(var(--home-photo-time) * (1 - 0.29)); }
.home-hex__item--3 { --in-x: 60%;  --in-y: 70%;  --out-x: -70%; --out-y: 65%;  animation-delay: calc(var(--home-photo-time) * (2 - 0.29)); }
.home-hex__item--4 { --in-x: -65%; --in-y: 75%;  --out-x: 80%;  --out-y: -70%; animation-delay: calc(var(--home-photo-time) * (3 - 0.29)); }
.home-hex__item--2 { --in-x: -80%; --in-y: -40%; --out-x: 85%;  --out-y: -35%; animation-delay: calc(var(--home-photo-time) * (4 - 0.29)); }
.home-hex__item--8 { --in-x: -90%; --in-y: 20%;  --out-x: 70%;  --out-y: -50%; animation-delay: calc(var(--home-photo-time) * (5 - 0.29)); }
.home-hex__item--5 { --in-x: 90%;  --in-y: 10%;  --out-x: -90%; --out-y: 5%;   animation-delay: calc(var(--home-photo-time) * (6 - 0.29)); }
.home-hex__item--9 { --in-x: 75%;  --in-y: -70%; --out-x: -85%; --out-y: 40%;  animation-delay: calc(var(--home-photo-time) * (7 - 0.29)); }
.home-hex__item--6 { --in-x: -40%; --in-y: -80%; --out-x: 45%;  --out-y: 80%;  animation-delay: calc(var(--home-photo-time) * (8 - 0.29)); }

/* One full turn (9 photos; 63 seconds at 7 each): 2.54% to grow (1.6 seconds at 7), on show until 11.11%, 2.54% to shrink away
   while the next one grows, then hidden for the rest of the turn. */
@keyframes home-swap {
  0%     { opacity: 0; transform: translate(var(--in-x), var(--in-y)) scale(0.12); }
  2.54%  { opacity: 1; transform: none; }
  11.11% { opacity: 1; transform: none; }
  13.65% { opacity: 0; transform: translate(var(--out-x), var(--out-y)) scale(0.12); }
  100%   { opacity: 0; transform: translate(var(--out-x), var(--out-y)) scale(0.12); }
}

@keyframes home-drift {
  0%, 100% { translate: 0 0; }
  30%      { translate: var(--sp-2) 0; }
  70%      { translate: calc(-1 * var(--sp-2)) 0; }
}

@keyframes home-float {
  0%, 100% { translate: 0 0; }
  45%      { translate: 0 calc(-1 * var(--sp-3)); }
  75%      { translate: 0 calc(-1 * var(--sp-1)); }
}

@keyframes home-tilt {
  0%, 100% { rotate: 0deg; }
  35%      { rotate: var(--home-turn); }
  80%      { rotate: calc(-0.75 * var(--home-turn)); }
}

/* Reduced motion: nothing moves and the first photo stays (base.css shortens animations to nothing, which would
   leave every photo hidden, so they are switched off here). */
@media (prefers-reduced-motion: reduce) {
  .home-fill--live,
  .home-hex__drift,
  .home-hex__tilt,
  .home-hex__float,
  .home-hex__item {
    animation: none;
  }

  .home-hex__item--1 {
    opacity: 1;
  }
}

/* --- The trust bar under the hero: four facts in white glass cards (the header pills' glass). Phones: two columns
   with all four; from 768px three in a row (the fourth left out); from 992px four. The icon sits above the number,
   and at the top right from 1200px, where the cards are wide enough for Worldwide beside it. --- */
.home-trust {
  margin-bottom: var(--sp-16);
}

.home-trust__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-trust__item {
  position: relative;
  display: grid;
  align-content: start;
  gap: var(--sp-1);
  padding: var(--sp-4);
  background-image: linear-gradient(var(--c-glass-top), var(--c-glass-bottom));
  border-radius: var(--radius-2);
  box-shadow: var(--shadow-glass);
}

.home-trust__icon {
  margin-bottom: var(--sp-1);
  font-size: var(--fs-h4);
  line-height: 1;
  color: var(--c-menu-button);
}

.home-trust__value {
  font-family: var(--font-heading);
  font-size: var(--fs-h4);
  line-height: 1.2;
  color: var(--c-heading);
}

.home-trust__unit {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--c-accent-text);
}

.home-trust__text {
  margin-top: var(--sp-1);
  font-size: var(--fs-small);
  line-height: 1.5;
  color: var(--c-text-muted);
}

/* --- From 576px: still one column (the shop goes side by side here; the hexagon looks too small beside the words) --- */
@media (min-width: 576px) {
  .shop-hero.home-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .home-trust__item {
    padding: var(--sp-5);
  }

  .home-trust__value {
    font-size: var(--fs-h3);
  }
}

/* --- Up to 767px (one column): the hero's words centred under the hexagon --- */
@media (max-width: 767.98px) {
  .home-hero .shop-hero__words {
    justify-self: center;
    justify-items: center;
    text-align: center;
  }

  .home-hero .shop-hero__eyebrow,
  .home-hero__buttons {
    justify-content: center;
  }
}

/* --- From 768px: the hexagon beside the words (the shop's columns); the sign-in pill with its words --- */
@media (min-width: 768px) {
  .shop-hero.home-hero {
    grid-template-columns: minmax(0, 6fr) minmax(0, 4fr);
  }

  .home-hex {
    order: 0;
    width: 100%;
  }

  /* The words' box in the middle of its column, like the hexagon in its own; the words inside stay aligned left. */
  .home-hero .shop-hero__words {
    justify-self: center;
  }

  .shop__phone .home-signin {
    height: var(--button-h-sm);
    font-size: var(--fs-small);
    background-image: linear-gradient(var(--c-glass-top), var(--c-glass-bottom));
    box-shadow: var(--shadow-glass);
  }

  .shop__phone .home-signin:hover {
    box-shadow: var(--shadow-glass-hover);
  }

  .home-signin__words {
    display: inline;
  }

  .home-trust__list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .home-trust__item:nth-child(4) {
    display: none;
  }
}

/* --- From 992px: the words on the left (the shop's columns), the hexagon at its full size in the middle of its column --- */
@media (min-width: 992px) {
  .shop-hero.home-hero {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  }

  .home-hex {
    width: min(100%, var(--home-hex-w));
  }

  .home-trust__list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--sp-4);
  }

  .home-trust__item {
    padding: var(--sp-8) var(--sp-6);
  }

  .home-trust__item:nth-child(4) {
    display: grid;
  }
}

/* --- From 1200px: the trust bar's icons at the top right of their cards --- */
@media (min-width: 1200px) {
  .home-trust__icon {
    position: absolute;
    top: var(--sp-8);
    right: var(--sp-6);
    margin-bottom: 0;
  }

  .home-trust__value {
    padding-right: var(--sp-8);
  }
}

/* Clicking a step's tab glides to it (base.css turns this off for reduced motion). */
html {
  scroll-behavior: smooth;
}

/* --- What we do, under the trust bar: the four steps (Test, Treat, Retest, Feel better) in a frosted glass bar, the
   chosen one in a glossy anthracite pill, and the step in a white glass box. The glass photo behind is at 10%, fading
   in at the top and out at the bottom.
   The steps: Consult, Test & Treat, Check-up, Feel better (landing.php). Two ways of showing it, both CSS only:
   - Stacked (phones, screens too short for the whole section, browsers without scroll-driven animations such as
     Firefox): the four steps one under another, the bar stays under the header and lights up the step being read.
   - Pinned (from 768px wide, on screens tall enough): the section stops under the header and scrolling moves through
     the steps, one per --home-what-step of scrolling, then the page carries on.
   The tabs are links to the marks (one per step), so clicking one jumps to its step in both. --- */
.home-what {
  position: relative;
  isolation: isolate;
  margin-bottom: var(--sp-24);
}

.home-what::before,
.home-steps__pin::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: calc(50% - 50vw);
  width: 100vw;
  pointer-events: none;
  background: url("../../img/home/what-we-do/glass-1200.jpg") center / cover no-repeat;
  opacity: var(--home-what-photo-opacity);
  -webkit-mask-image: var(--home-what-photo-fade); /* Safari before 15.4 */
  mask-image: var(--home-what-photo-fade);
}

/* Stacked: the photo is one screen high and stays in the middle of the screen while the section scrolls by (it takes
   no room: the negative margin gives back its height). */
.home-what::before {
  position: sticky;
  top: 0;
  left: auto;
  display: block;
  margin-left: calc(50% - 50vw);
  height: 100vh;
  height: 100dvh; /* 100vh first for browsers without dvh */
  margin-bottom: -100vh;
  margin-bottom: -100dvh;
}

.home-steps {
  position: relative;
  display: grid;
}

/* Stacked: the pin and the box of panels step aside, so the intro, the bar, each mark and its step, and the button
   share the one grid and can be put in order: each mark sits just above its step. */
.home-steps__pin,
.home-steps__panels {
  display: contents;
}

.home-what__intro {
  order: -1;
  display: grid;
  justify-items: center;
  gap: var(--sp-4);
  max-width: var(--home-what-intro-w);
  margin-inline: auto;
  text-align: center;
}

.home-what__intro .shop-hero__eyebrow {
  margin: 0;
}

.home-what__title {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: var(--fs-h2);
  line-height: 1.15;
  color: var(--c-heading);
  text-wrap: balance;
}

.home-what__text {
  margin: 0;
  line-height: 1.6;
  color: var(--c-text-muted);
}

.home-steps__bar {
  position: sticky;
  top: calc(var(--home-what-top) + var(--sp-2));
  z-index: 2;
  order: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: var(--sp-10);
  padding: var(--sp-1);
  background-color: var(--c-what-bar);
  background-image: var(--what-bar-shine);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-what-bar);
  -webkit-backdrop-filter: var(--blur-bar); /* Safari before 18 */
  backdrop-filter: var(--blur-bar);
}

/* The sliding pill (pinned only). */
.home-steps__bar::before {
  content: "";
  display: none;
  position: absolute;
  top: var(--sp-1);
  bottom: var(--sp-1);
  left: var(--sp-1);
  width: calc((100% - 2 * var(--sp-1)) / 4);
  background: var(--what-pill);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-what-pill);
}

.home-steps__tab {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: var(--button-h);
  padding-inline: var(--sp-1);
  font-size: var(--fs-small);
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  color: var(--c-text-muted);
  border-radius: var(--radius-pill);
}

.home-steps__tab:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.home-steps__tab .bi {
  display: none;
}

/* The pill behind a tab while its step is being read (stacked only). */
.home-steps__tab::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0;
  background: var(--what-pill);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-what-pill);
}

.home-steps__mark {
  display: block;
  scroll-margin-top: calc(var(--home-what-top) + 2 * var(--sp-2) + var(--button-h));
}

.home-steps__panel {
  display: grid;
  padding-top: var(--sp-6);
}

/* Stacked: clear space between one step and the next. */
.home-steps__panel:not(.home-steps__panel--1) {
  padding-top: var(--sp-16);
}

.home-steps__panel--1, .home-steps__mark--1 { order: 1; }
.home-steps__panel--2, .home-steps__mark--2 { order: 2; }
.home-steps__panel--3, .home-steps__mark--3 { order: 3; }
.home-steps__panel--4, .home-steps__mark--4 { order: 4; }

/* Step n of 4: a chip on the box's top edge, joined to the bar by a short line (on the first step only when stacked). */
.home-steps__number {
  position: relative;
  z-index: 1;
  justify-self: center;
  display: flex;
  align-items: center;
  min-height: var(--button-h-sm);
  margin: 0 0 calc(-1 * var(--button-h-sm) / 2);
  padding-inline: var(--sp-4);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--c-accent-text);
  background-color: var(--c-page);
  border: var(--border-1) solid var(--c-chip-border);
  border-radius: var(--radius-pill);
}

.home-steps__number::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  height: var(--sp-6);
  border-left: var(--border-1) solid var(--c-chip-border);
  transform: translateX(-50%);
}

.home-steps__panel:not(.home-steps__panel--1) .home-steps__number::before {
  display: none;
}

.home-steps__box {
  display: grid;
  gap: var(--sp-6);
  padding: var(--sp-10) var(--sp-5) var(--sp-6);
  background-image: linear-gradient(var(--c-glass-top), var(--c-glass-bottom));
  border-radius: var(--radius-2);
  box-shadow: var(--shadow-glass);
}

.home-steps__head {
  display: grid;
  gap: var(--sp-3);
}

.home-steps__title {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: var(--fs-h2);
  line-height: 1.15;
  color: var(--c-heading);
}

.home-steps__text {
  margin: 0;
  line-height: 1.6;
  color: var(--c-text-muted);
}

.home-steps__points {
  display: grid;
  gap: var(--sp-6);
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-steps__point {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: var(--sp-3);
  row-gap: var(--sp-1);
}

.home-steps__point .bi {
  font-size: var(--fs-h4);
  line-height: 1;
  color: var(--c-menu-button);
}

.home-steps__point-title {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: 600;
  color: var(--c-heading);
}

.home-steps__point-text {
  grid-column: 1 / -1;
  margin: 0;
  font-size: var(--fs-small);
  line-height: 1.5;
  color: var(--c-text-muted);
}

.home-what__actions {
  order: 5;
  display: flex;
  justify-content: center;
  margin-top: var(--sp-8);
}

@media (min-width: 576px) {
  .home-steps__tab {
    padding-inline: var(--sp-2);
    white-space: nowrap;
  }

  .home-steps__tab .bi {
    display: inline;
  }

  .home-steps__box {
    padding: var(--sp-10) var(--sp-8) var(--sp-8);
  }

  .home-steps__points {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .home-what::before,
  .home-steps__pin::before {
    background-image: url("../../img/home/what-we-do/glass-2400.jpg");
  }

  .home-steps__bar {
    justify-self: center;
    width: fit-content;
  }

  .home-steps__tab {
    min-height: var(--button-h-lg);
    padding-inline: var(--sp-8);
    font-size: var(--fs-body);
  }
}

@media (min-width: 992px) {
  .home-steps__box {
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    align-items: center;
    gap: var(--sp-10);
    padding: var(--sp-12);
  }
}

/* Stacked, with scroll-driven animations: each step has its own timeline, a thin line just under the bar, and the
   tab of the step crossing that line has the pill. Before the first step, the first tab has it; after the last, the last. */
@supports (animation-timeline: view()) {
  .home-steps {
    timeline-scope: --what-1, --what-2, --what-3, --what-4;
  }

  .home-steps__panel {
    view-timeline-inset:
      calc(var(--home-what-top) + 2 * var(--sp-2) + var(--button-h) + var(--sp-16))
      calc(100% - var(--home-what-top) - 2 * var(--sp-2) - var(--button-h) - var(--sp-16) - var(--border-1));
  }

  .home-steps__panel--1 { view-timeline-name: --what-1; }
  .home-steps__panel--2 { view-timeline-name: --what-2; }
  .home-steps__panel--3 { view-timeline-name: --what-3; }
  .home-steps__panel--4 { view-timeline-name: --what-4; }

  .home-steps__tab,
  .home-steps__tab::before {
    animation: linear both;
    animation-range: cover;
  }

  .home-steps__tab { animation-name: home-tab-on; }
  .home-steps__tab::before { animation-name: home-pill-on; }
  .home-steps__tab--1, .home-steps__tab--1::before { animation-timeline: --what-1; animation-fill-mode: backwards; }
  .home-steps__tab--2, .home-steps__tab--2::before { animation-timeline: --what-2; animation-fill-mode: none; }
  .home-steps__tab--3, .home-steps__tab--3::before { animation-timeline: --what-3; animation-fill-mode: none; }
  .home-steps__tab--4, .home-steps__tab--4::before { animation-timeline: --what-4; animation-fill-mode: forwards; }
}

/* Pinned: from 768px wide, on screens tall enough for the whole section (it is taller where the box is narrower).
   .home-steps is as tall as the screen plus three steps of scrolling; the pin sticks under the header all that time,
   and where it has got to picks the step: the first quarter Test, the second Treat and so on. */
@supports (animation-timeline: view()) {
  @media (min-width: 768px) and (min-height: 880px), (min-width: 992px) and (min-height: 820px), (min-width: 1200px) and (min-height: 760px) {
    .home-what::before {
      display: none;
    }

    .home-steps {
      display: block;
      height: calc(100vh - var(--home-what-top) + 3 * var(--home-what-step));
      height: calc(100dvh - var(--home-what-top) + 3 * var(--home-what-step-dvh)); /* 100vh first for browsers without dvh */
      view-timeline: --what block;
      view-timeline-inset: var(--home-what-top) 0;
    }

    .home-steps__pin {
      position: sticky;
      top: var(--home-what-top);
      isolation: isolate;
      display: flex;
      flex-direction: column;
      justify-content: center;
      height: calc(100vh - var(--home-what-top));
      height: calc(100dvh - var(--home-what-top));
    }

    /* The photo stays with the pin and drifts sideways as the steps go by. */
    .home-steps__pin::before {
      top: 0;
      bottom: 0;
      background-size: auto 120%;
      animation: home-what-pan linear both;
      animation-timeline: --what;
      animation-range: contain;
    }

    .home-steps__bar {
      position: relative;
      top: auto;
      align-self: center;
    }

    .home-steps__bar::before {
      display: block;
      animation: home-pill-slide linear both;
      animation-timeline: --what;
      animation-range: contain;
    }

    .home-steps__tab::before {
      display: none;
    }

    .home-steps__tab { animation-timeline: --what; }
    .home-steps__tab--1 { animation-name: home-tab-first; animation-range: contain 0% contain 25%; }
    .home-steps__tab--2 { animation-name: home-tab-middle; animation-range: contain 25% contain 50%; }
    .home-steps__tab--3 { animation-name: home-tab-middle; animation-range: contain 50% contain 75%; }
    .home-steps__tab--4 { animation-name: home-tab-last; animation-range: contain 75% contain 100%; }

    .home-steps__mark {
      position: absolute;
      left: 0;
      scroll-margin-top: var(--home-what-top);
    }

    /* Each mark a little way into its step's quarter, so a click lands on that step. */
    .home-steps__mark--1 { top: 0; }
    .home-steps__mark--2 { top: calc(1.05 * var(--home-what-step)); }
    .home-steps__mark--3 { top: calc(2.05 * var(--home-what-step)); }
    .home-steps__mark--4 { top: calc(3.05 * var(--home-what-step)); }

    .home-steps__panels {
      display: grid;
    }

    /* All four steps in the same place, only the one being read showing; the box keeps the tallest one's height. */
    .home-steps__panel {
      grid-area: 1 / 1;
      padding-top: var(--sp-6);
      visibility: hidden;
      opacity: 0;
      view-timeline-name: none;
      animation: linear both;
      animation-timeline: --what;
    }

    .home-steps__panel:not(.home-steps__panel--1) {
      padding-top: var(--sp-6);
    }

    .home-steps__panel:not(.home-steps__panel--1) .home-steps__number::before {
      display: block;
    }

    .home-steps__panel--1 { animation-name: home-step-first; animation-range: contain 0% contain 25%; animation-fill-mode: backwards; }
    .home-steps__panel--2 { animation-name: home-step-middle; animation-range: contain 25% contain 50%; animation-fill-mode: none; }
    .home-steps__panel--3 { animation-name: home-step-middle; animation-range: contain 50% contain 75%; animation-fill-mode: none; }
    .home-steps__panel--4 { animation-name: home-step-last; animation-range: contain 75% contain 100%; animation-fill-mode: forwards; }
  }
}

@keyframes home-tab-on { from, to { color: var(--c-off-white); } }
@keyframes home-pill-on { from, to { opacity: 1; } }
@keyframes home-tab-first { 0%, 97% { color: var(--c-off-white); } 100% { color: var(--c-text-muted); } }
@keyframes home-tab-middle { 0% { color: var(--c-text-muted); } 3%, 97% { color: var(--c-off-white); } 100% { color: var(--c-text-muted); } }
@keyframes home-tab-last { 0% { color: var(--c-text-muted); } 3%, 100% { color: var(--c-off-white); } }
@keyframes home-pill-slide {
  0%, 22% { transform: none; }
  28%, 47% { transform: translateX(100%); }
  53%, 72% { transform: translateX(200%); }
  78%, 100% { transform: translateX(300%); }
}
@keyframes home-step-first { 0%, 88% { visibility: visible; opacity: 1; } 100% { visibility: visible; opacity: 0; } }
@keyframes home-step-middle {
  0% { visibility: visible; opacity: 0; transform: translateY(var(--sp-2)); }
  12%, 88% { visibility: visible; opacity: 1; transform: none; }
  100% { visibility: visible; opacity: 0; }
}
@keyframes home-step-last {
  0% { visibility: visible; opacity: 0; transform: translateY(var(--sp-2)); }
  12%, 100% { visibility: visible; opacity: 1; transform: none; }
}
@keyframes home-what-pan { from { background-position: 30% 50%; } to { background-position: 70% 50%; } }

/* Reduced motion: the steps still change as the page scrolls, but the photo stays still. */
@media (prefers-reduced-motion: reduce) {
  .home-steps__pin::before {
    animation: none;
  }
}

/* --- Our areas of expertise ---
   Its background (tokens --areas-*) reaches the screen's edges and fades into the page at the top and the bottom, so it
   has no edges. On it: the title over three lines, Dr. Beran a little right of centre with two products on her left,
   then three cards (two on top, one wide under them from 768px). The hexagons run in a band from top left to bottom
   right behind the title and photo only: they fade in from the top and out where the cards start, which overlap the
   bottom of her photo by --areas-overlap. Some hexagons light up one after another, going down (img/home/areas/
   trail-1 to 8.svg: each file holds the next step of every trail). On tablets (768-991px) the cards reach nearer the
   screen's edges, as an exception to lining up with the menu (Christopher's choice). */
.home-areas {
  --areas-pad-top: var(--sp-12);
  --areas-pad-x: var(--sp-4);
  --areas-overlap: var(--sp-10);
  position: relative; /* paints over What we do's photo, which stays in view for a screen after that section ends */
  isolation: isolate;
  margin-bottom: var(--sp-24);
}

.home-areas::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 auto;
  left: calc(50% - 50vw);
  width: 100vw;
  background-image: var(--areas-bg);
}

.home-areas__panel {
  padding: var(--areas-pad-top) var(--areas-pad-x) var(--areas-pad-x);
}

.home-areas__top {
  position: relative;
  isolation: isolate;
}

.home-areas__hexes {
  position: absolute;
  z-index: -1;
  top: calc(-1 * var(--areas-pad-top));
  bottom: 0;
  left: calc(50% - 50vw);
  width: 100vw;
  /* The diagonal band and the top and bottom fades live here, on this still wrapper, and not on each hexagon layer:
     Chrome sometimes loses a two-part mask on a layer whose opacity is animating and paints it as a solid blue band
     until the page is reloaded. */
  -webkit-mask-image: var(--areas-hex-band), linear-gradient(transparent, rgb(0, 0, 0) var(--areas-hex-fade-in), rgb(0, 0, 0) calc(100% - var(--areas-overlap)), transparent); /* Safari before 15.4 */
  -webkit-mask-composite: source-in;
  mask-image: var(--areas-hex-band), linear-gradient(transparent, rgb(0, 0, 0) var(--areas-hex-fade-in), rgb(0, 0, 0) calc(100% - var(--areas-overlap)), transparent);
  mask-composite: intersect;
}

/* Each layer only has the honeycomb shape as its mask. */
.home-areas__hex {
  inset: 0;
  -webkit-mask-image: var(--hex-tile);
  mask-image: var(--hex-tile);
  -webkit-mask-size: var(--hex-size);
  mask-size: var(--hex-size);
  mask-repeat: repeat;
  mask-composite: add;
}

/* The travelling hexagons: eight steps, each lit a step after the one before, fading in as the one above fades out. */
.home-areas__trail {
  --hex-size: var(--home-fill-size);
  opacity: 0;
  animation: areas-trail var(--areas-trail-time) linear calc(var(--areas-trail-time) / 8 * (var(--step) - 9)) infinite;
}

.home-areas__trail--1 { --step: 1; --hex-tile: url("../../img/home/areas/trail-1.svg"); }
.home-areas__trail--2 { --step: 2; --hex-tile: url("../../img/home/areas/trail-2.svg"); }
.home-areas__trail--3 { --step: 3; --hex-tile: url("../../img/home/areas/trail-3.svg"); }
.home-areas__trail--4 { --step: 4; --hex-tile: url("../../img/home/areas/trail-4.svg"); }
.home-areas__trail--5 { --step: 5; --hex-tile: url("../../img/home/areas/trail-5.svg"); }
.home-areas__trail--6 { --step: 6; --hex-tile: url("../../img/home/areas/trail-6.svg"); }
.home-areas__trail--7 { --step: 7; --hex-tile: url("../../img/home/areas/trail-7.svg"); }
.home-areas__trail--8 { --step: 8; --hex-tile: url("../../img/home/areas/trail-8.svg"); }

@keyframes areas-trail {
  0%, 25%, 100% { opacity: 0; }
  12.5% { opacity: 1; }
}

/* Reduced motion: the travelling hexagons stay hidden. */
@media (prefers-reduced-motion: reduce) {
  .home-areas__trail {
    animation: none;
  }
}

.home-areas__filters {
  position: absolute;
  width: 0;
  height: 0;
}

.home-areas__intro {
  display: grid;
  justify-items: center;
  gap: var(--sp-4);
  text-align: center;
}

.home-areas__intro .shop-hero__eyebrow {
  margin: 0;
}

.home-areas__title {
  max-width: var(--areas-title-w);
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: var(--fs-h2);
  line-height: 1.1;
  color: var(--c-heading);
  text-wrap: balance;
}

/* Her photo and the products move together: the whole group sits a little right of centre. */
.home-areas__stage {
  position: relative;
  width: min(72%, var(--areas-her-w));
  margin: var(--sp-4) auto 0;
  translate: 20% 0;
}

/* The shadow is on a wrapper: on the photo itself, the bottom fade would cut it off in a straight line. */
.home-areas__shadow {
  filter: var(--shadow-areas-her);
}

.home-areas__her {
  display: block;
  width: 100%;
  height: auto;
  filter: url("#areas-feather") var(--areas-her-look); /* a very soft edge (the filter in landing.php), then warmer */
  -webkit-mask-image: var(--areas-her-fade); /* Safari before 15.4 */
  mask-image: var(--areas-her-fade);
}

.home-areas__product {
  position: absolute;
  height: auto;
  filter: var(--shadow-areas-product);
}

.home-areas__product--1 {
  right: 102%;
  top: 40%;
  width: 14%;
  rotate: -5deg;
}

.home-areas__product--2 {
  right: 90%;
  top: 48%;
  width: 17%;
  rotate: 4deg;
}

/* The cards: two on top and one wide under them from 768px; each title is split by its photo, as two lines. */
.home-areas__list {
  position: relative;
  display: grid;
  gap: var(--sp-4);
  margin: calc(-1 * var(--areas-overlap)) 0 0;
  padding: 0;
  list-style: none;
}

.home-areas__card {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: var(--sp-6);
  padding: var(--sp-10) var(--sp-6);
  border: var(--border-1) solid var(--c-areas-card-line);
  border-radius: var(--areas-card-radius);
  background-color: var(--c-areas-card);
  text-align: center;
}

.home-areas__name {
  display: grid;
  justify-items: center;
  width: 100%;
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: var(--fs-h3);
  line-height: 1.1;
  color: var(--c-heading);
}

.home-areas__accent {
  color: var(--c-accent-text);
}

/* The photo sits between the two lines of the title, with room above and below it. */
.home-areas__photo {
  display: grid;
  width: min(100%, var(--areas-photo-w));
  aspect-ratio: 4 / 3;
  margin-block: var(--sp-4);
}

/* The wide card's photo is wide on every screen. */
.home-areas__card--3 .home-areas__photo {
  aspect-ratio: 16 / 9;
}

.home-areas__photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* A cut-out (no background): it fades out at the bottom into the card. */
.home-areas__photo--cutout img {
  -webkit-mask-image: var(--areas-cutout-fade); /* Safari before 15.4 */
  mask-image: var(--areas-cutout-fade);
}

/* A photo on a white background: multiplied onto the card, so its white disappears, and faded out at the sides and
   the bottom, where its hands and coats are cut off. */
.home-areas__photo--white {
  mix-blend-mode: multiply; /* on the box, not the photo (the box is a layer of its own); nothing between it and the section is a layer, so it blends with the card and the background behind it */
}

.home-areas__photo--white img {
  -webkit-mask-image: var(--areas-white-fade-x), var(--areas-cutout-fade); /* Safari before 15.4 */
  -webkit-mask-composite: source-in;
  mask-image: var(--areas-white-fade-x), var(--areas-cutout-fade);
  mask-composite: intersect;
}

.home-areas__text {
  max-width: var(--areas-her-w-lg);
  margin: 0;
  color: var(--c-text-muted);
}

@media (min-width: 576px) {
  .home-areas__stage {
    translate: 18% 0;
  }

  .home-areas__product--1 {
    right: 112%;
    width: 16%;
  }

  .home-areas__product--2 {
    right: 96%;
    width: 19%;
  }
}

@media (min-width: 768px) {
  .home-areas {
    --areas-pad-top: var(--sp-16);
    --areas-pad-x: var(--sp-10);
    --areas-overlap: var(--areas-overlap-md);
  }

  .home-areas__title {
    font-size: var(--fs-h1);
  }

  .home-areas__stage {
    width: var(--areas-her-w-lg);
    translate: 24% 0;
  }

  .home-areas__product--1 {
    right: 116%;
  }

  .home-areas__product--2 {
    right: 100%;
  }

  .home-areas__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-areas__card--3 {
    grid-column: 1 / -1;
  }

  .home-areas__card--3 .home-areas__photo {
    width: min(100%, var(--areas-photo-w-wide));
  }

  .home-areas__name {
    font-size: var(--fs-h2);
  }
}

/* Tablets: the panel reaches to 12px from the screen's edges, the cards to 12px inside it. */
@media (min-width: 768px) and (max-width: 991.98px) {
  .home-areas {
    --areas-pad-x: var(--sp-3);
  }

  .home-areas__panel {
    margin-inline: calc(var(--sp-3) - var(--gutter));
  }

  .home-areas__list {
    gap: var(--sp-3);
  }
}

@media (min-width: 992px) {
  .home-areas {
    --areas-overlap: var(--areas-overlap-lg);
  }

  .home-areas__name {
    font-size: var(--fs-h1);
  }
}

/* --- Frequently asked questions (before What our clients say): the heading, then the questions with a line between
   each; from 992px the heading on the left (it stays in view while the list scrolls) and the questions on the right.
   Each question is a <details>: its + turns into a cross when open. --- */
.home-faq {
  margin-bottom: var(--sp-24);
}

.home-faq__intro {
  display: grid;
  justify-items: center;
  gap: var(--sp-4);
  margin-bottom: var(--sp-8);
  text-align: center;
}

.home-faq__intro .shop-hero__eyebrow {
  margin: 0;
}

.home-faq__title {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: var(--fs-h2);
  line-height: 1.1;
  color: var(--c-heading);
  text-wrap: balance;
}

.home-faq__more {
  margin: 0;
  color: var(--c-text-muted);
}

.home-faq__more a {
  color: var(--c-heading);
  white-space: nowrap; /* "Get in touch" stays on one line */
  text-underline-offset: 0.3em;
}

.home-faq__item {
  border-bottom: var(--border-1) solid var(--c-line);
}

.home-faq__item:first-child {
  border-top: var(--border-1) solid var(--c-line);
}

.home-faq__question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-4);
  padding-block: var(--sp-5);
  list-style: none; /* no triangle */
  font-family: var(--font-heading);
  font-size: var(--fs-lead);
  line-height: 1.3;
  color: var(--c-heading);
  cursor: pointer;
}

.home-faq__question::-webkit-details-marker {
  display: none; /* Safari: its own triangle ignores list-style */
}

.home-faq__icon {
  flex: none;
  color: var(--c-text-muted);
  transition: rotate var(--duration-base) var(--ease);
}

.home-faq__item[open] .home-faq__icon {
  rotate: 45deg;
}

.home-faq__answer {
  max-width: var(--faq-answer-w);
  margin: 0;
  padding-bottom: var(--sp-5);
  color: var(--c-text-muted);
}

@media (min-width: 992px) {
  .home-faq {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--sp-16);
    align-items: start;
  }

  .home-faq__intro {
    position: sticky;
    top: var(--sp-24); /* under the sticky header */
    justify-items: start;
    margin-bottom: 0;
    text-align: left;
  }
}

/* --- What our clients say (after Our areas of expertise): a dark band (the shop band's anthracite and faint
   crosshatch) across the full width of the screen; the words and the row of quote cards inside line up with the menu. The row scrolls sideways and stops at each card:
   one card and the edge of the next on phones, two from 768px, three from 1200px. The arrows under it move one card
   (site.js, data-slider); without JavaScript they stay hidden and the row still scrolls by swiping. --- */
.home-quotes {
  margin-bottom: 0; /* the band carries on into the footer, down to the bottom of the screen */
}

.home-quotes__panel {
  position: relative;
  isolation: isolate;
  padding-block: var(--sp-12);
  color: var(--c-page);
}

.home-quotes__panel::before,
.home .shop__foot::before {
  content: "";
  position: absolute;
  inset: 0 calc(50% - 50vw); /* to the screen's edges (.shop clips anything wider) */
  z-index: -1;
  pointer-events: none;
  background-color: var(--c-anthracite);
  background-image:
    repeating-linear-gradient(45deg, var(--c-linen) 0 var(--border-1), transparent var(--border-1) var(--sp-1)),
    repeating-linear-gradient(-45deg, var(--c-linen) 0 var(--border-1), transparent var(--border-1) var(--sp-1));
}

/* The footer on the home page: one row on the same dark band, with a faint line above it. (.home first: shop.css,
   loaded after this file, sets the footer's light look.) */
.home .shop__foot {
  position: relative;
  isolation: isolate;
  margin-top: 0;
  color: var(--c-on-dark-muted);
  border-top-color: var(--c-quotes-line);
}

.home .shop__foot::before {
  top: calc(-1 * var(--border-1)); /* under the line too, so no strip of the page shows beside it */
}

.home .shop__legal a {
  color: var(--c-on-dark-muted);
}

.home .shop__legal a:hover {
  color: var(--c-page);
}

.home-quotes .home-quotes__eyebrow, /* .home-quotes first: shop.css, loaded after this file, sets the eyebrow's deep blue */
.home-quotes__eyebrow .home-bullet {
  margin-top: 0;
  color: var(--c-chip-border);
}

.home-quotes__title {
  max-width: 14em;
  margin: var(--sp-4) 0 var(--sp-8);
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: var(--fs-h2);
  line-height: 1.15;
  color: var(--c-page);
  text-wrap: balance;
}

.home-quotes__list {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: var(--quotes-card-w);
  gap: var(--sp-3);
  margin: calc(-1 * var(--sp-2)); /* room for the focus ring, which the scrolling would cut off */
  padding: var(--sp-2);
  scroll-padding-inline: var(--sp-2);
  list-style: none;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

.home-quotes__list::-webkit-scrollbar { /* Chrome and Safari: no scroll bar (Firefox: scrollbar-width above) */
  display: none;
}

.home-quotes__list:focus-visible {
  outline: 0;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-2);
}

.home-quotes__card {
  position: relative;
  display: flex;
  flex-direction: column;
  scroll-snap-align: start;
  background-color: var(--c-quotes-card);
  border: var(--border-1) solid var(--c-quotes-line);
  border-radius: var(--radius-2);
}

.home-quotes__sample {
  position: absolute;
  top: var(--sp-3);
  right: var(--sp-4);
  font-size: var(--fs-xxs);
  font-weight: 600;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--c-on-dark-muted);
}

.home-quotes__text {
  flex: 1;
  margin: 0;
  padding: var(--sp-8) var(--sp-6);
  font-size: var(--fs-body);
  line-height: 1.6;
}

.home-quotes__text p {
  margin: 0;
}

.home-quotes__who {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin: 0;
  padding: var(--sp-4) var(--sp-6);
  border-top: var(--border-1) solid var(--c-quotes-line);
}

.home-quotes__avatar {
  display: grid;
  flex: none;
  place-items: center;
  width: var(--sp-12);
  height: var(--sp-12);
  font-size: var(--fs-small);
  font-weight: 600;
  background-color: var(--c-on-dark-hover);
  border-radius: var(--radius-pill);
}

.home-quotes__name {
  display: grid;
  font-size: var(--fs-small);
  font-weight: 600;
  line-height: 1.4;
}

.home-quotes__role {
  font-weight: 400;
  color: var(--c-on-dark-muted);
}

.home-quotes__arrows {
  display: flex;
  gap: var(--sp-2);
  margin-top: var(--sp-6);
}

.home-quotes__arrows[hidden] {
  display: none;
}

.home-quotes__arrow {
  display: grid;
  place-items: center;
  width: var(--button-h);
  height: var(--button-h);
  padding: 0;
  font-size: var(--fs-lead);
  color: var(--c-page);
  background-color: var(--c-on-dark-hover);
  border: 0;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: opacity var(--duration-fast) var(--ease);
}

.home-quotes__arrow:focus-visible {
  outline: 0;
  box-shadow: var(--focus-ring);
}

.home-quotes__arrow:disabled {
  opacity: 0.35;
  cursor: default;
}

@media (min-width: 768px) {
  .home-quotes__panel {
    padding-block: var(--sp-16);
  }

  .home-quotes__list {
    grid-auto-columns: calc((100% - var(--sp-4)) / 2);
    gap: var(--sp-4);
  }
}

@media (min-width: 992px) {
  .home-quotes__text {
    font-size: var(--fs-lead);
  }
}

@media (min-width: 1200px) {
  .home-quotes__list {
    grid-auto-columns: calc((100% - 2 * var(--sp-4)) / 3);
  }
}
