/* home page styles. Prefix: hm-
   1. the index: seven words over a photograph that fills the first screen
   2. the quote stack: three panels, each in its occasion's field, each rising over the last */

/* ---------- 1. index ---------- */
/* The photograph of the occasion in use fills the whole first screen, header included. The seven words stand on its left,
   on a veil of that occasion's colour that fades out towards the middle, so the right half of the picture stays clear. */
.hm-index { position: relative; isolation: isolate; overflow: clip; display: flex; margin-top: calc(-1 * var(--top-h)); min-height: 100svh; }
.hm-bg { position: absolute; inset: 0; z-index: -1; background: var(--ink); }
/* the photographs lie stacked; the one in use fades in over the last one in a quarter of a second, the other then drops out under it */
.hm-bg .ph { position: absolute; inset: 0; display: block; opacity: 0; transition: opacity 0s 0.26s; }
.hm-bg .ph.is-on { opacity: 1; z-index: 1; transition: opacity 0.26s var(--out); }
.hm-bg .ph img { transform: scale(1.04); transition: opacity 0.3s var(--out), transform 1.4s var(--out); }
.hm-bg .ph.is-on img { transform: none; }
.hm-pic--t { display: none !important; }
.hm-bg::after { content: ""; position: absolute; inset: 0; z-index: 2;
  background:
    linear-gradient(90deg, color-mix(in oklab, var(--field) 90%, transparent) 0%, color-mix(in oklab, var(--field) 62%, transparent) 34%, transparent 68%),
    linear-gradient(180deg, color-mix(in oklab, var(--ink) 50%, transparent) 0%, transparent 24%),
    linear-gradient(0deg, color-mix(in oklab, var(--ink) 45%, transparent) 0%, transparent 30%); }

.hm-index__in {
  --pad: clamp(1.5rem, 4svh, 3rem);
  --fs: min(7.4vw, (100svh - var(--top-h) - 2 * var(--pad) - 6.5rem) / 7.34);
  display: flex; flex-direction: column; justify-content: center; gap: clamp(1.5rem, 4.5svh, 3rem);
  padding-block: calc(var(--top-h) + var(--pad)) var(--pad);
}
.hm-words { position: relative; font-size: var(--fs); }
/* optical edges: the capitals' stems meet the left edge the tagline and logo use */
.hm-words ul { margin: 0 0 0 -0.065em; }
.hm-word { display: flow-root; width: fit-content; max-width: 100%; color: color-mix(in oklab, var(--fog) 58%, transparent); text-decoration: none; transition: color 0.15s var(--out); }
.hm-word.is-on { color: var(--fog); }
.hm-word__mask { display: block; overflow: clip; padding-block: 0.18em; margin-block: -0.18em; pointer-events: none; }
.hm-word__in { display: block; transform-origin: 0 55%; }
.hm.is-ready .hm-word__mask { overflow: visible; }
.hm.is-ready .hm-word__in { transition: transform 0.14s var(--out); }
.hm.is-ready .hm-word:active .hm-word__in { transform: scale(0.97); }
/* the word that was just chosen answers with one short split of its colours */
@keyframes hm-hit { 0% { text-shadow: -0.035em 0 var(--rgb-a), 0.035em 0 var(--rgb-b); translate: 0.012em 0; } 50% { text-shadow: 0.02em 0 var(--rgb-a), -0.02em 0 var(--rgb-b); translate: -0.012em 0; } 100% { text-shadow: none; translate: none; } }
.hm-word__in.is-hit { animation: hm-hit 0.22s steps(2, end); }

.hm-dot { --dot: clamp(0.5625rem, 0.14em, 0.8125rem); position: absolute; left: calc(var(--gut) / -2); top: 0; width: var(--dot); height: var(--dot); margin: calc(var(--dot) / -2) 0 0 calc(var(--dot) / -2); }
.hm-dot.is-auto { animation: rec 1.8s var(--inout) infinite; }
.hm-say__h { max-width: 36ch; }

@media (max-width: 52rem), (max-width: 64rem) and (max-aspect-ratio: 1/1) {
  /* phone (and a tablet held upright): the upright photograph, the words at the foot of the screen on a veil rising from below */
  .hm-index { min-height: calc(100svh - var(--dock-h)); }
  .hm-pic--w { display: none !important; }
  .hm-pic--t { display: block !important; }
  .hm-bg::after { background:
    linear-gradient(0deg, color-mix(in oklab, var(--field) 94%, transparent) 0%, color-mix(in oklab, var(--field) 80%, transparent) 42%, transparent 78%),
    linear-gradient(180deg, color-mix(in oklab, var(--ink) 50%, transparent) 0%, transparent 22%); }
  .hm-index__in { --fs: min(9.6vw, 4rem); --row: max(2.75rem, var(--fs) * 0.95); justify-content: flex-end; gap: 0.75rem; padding-bottom: 1.5rem; }
  .hm-word { display: flex; align-items: center; min-height: var(--row); }
}

/* ---------- 2. reviews: a deck of three cards on ink ---------- */
.hm-mark { display: block; height: 0; }
.hm-rev { background: var(--ink); padding-block: var(--sec) calc(var(--sec) * 0.75); }
.hm-rev__h { margin-bottom: clamp(2rem, 6svh, 4rem); }
.hm-deck { display: grid; gap: 1.5rem; }

/* one card: the photograph fills its left side edge to edge, the words have room on the right.
   Each card wears the colour of the occasion it talks about. */
.hm-card { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); background: var(--field); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.hm-card[data-field="ink"] { background: var(--ink-2); }
.hm-card__pic { position: relative; min-height: 20rem; }
.hm-card__pic .ph { position: absolute; inset: 0; }
.hm-card__body { display: flex; flex-direction: column; gap: 1.75rem; min-width: 0; padding: clamp(1.5rem, 3.6vw, 3.25rem); }
.hm-stars { display: flex; gap: 0.3rem; color: var(--gold); }
.hm-stars svg { display: block; fill: currentColor; }
.hm-card__q { margin-block: auto; }
.hm-card__q p { font-weight: 380; font-size: clamp(1.25rem, 2.05vw, 1.9375rem); line-height: 1.3; letter-spacing: -0.008em; text-wrap: pretty; }
.hm-card--xl .hm-card__q p { font-weight: 420; font-size: clamp(1.75rem, 3.3vw, 3.125rem); line-height: 1.12; letter-spacing: -0.02em; text-wrap: balance; }
.hm-nb { white-space: nowrap; }
.hm-card__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.hm-card__by strong { display: block; font-weight: 620; font-size: var(--t-lg); line-height: 1.25; }
.hm-card__by span { display: block; margin-top: 0.125rem; font-size: var(--t-xs); font-weight: 500; color: var(--fog-2); }
.hm-card__go { min-height: 3rem; }

/* where a whole card fits the screen the three stack like a deck: each sticks a little lower than the one before */
@media (min-width: 52.01rem) and (min-height: 34rem) and (min-aspect-ratio: 1/1) {
  /* A card rises past the middle of the screen and stops a little above centre. The next one is half a screen behind it,
     so the words can be read to the end before anything slides over them. */
  .hm-deck { gap: 52svh; padding-bottom: 14svh; }
  .hm-card {
    --ch: min(34rem, 100svh - var(--top-h) - 6.5rem);
    position: sticky; height: var(--ch); will-change: transform;
    top: calc(max(var(--top-h) + 0.75rem, (100svh - var(--ch)) / 2 - 7svh) + var(--i) * 1.125rem);
  }
  .hm-card__pic { min-height: 0; }
}
@media (max-width: 52rem) {
  .hm-card { grid-template-columns: minmax(0, 1fr); }
  .hm-card__pic { min-height: 0; aspect-ratio: 4 / 3; }
  .hm-card--xl .hm-card__pic { aspect-ratio: 16 / 9; }
  .hm-card__body { gap: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .hm-word, .hm-word__in, .hm-bg .ph, .hm-bg .ph img { transition: none !important; }
  .hm-word__in.is-hit { animation: none; }
  .hm-dot.is-auto { animation: none; }
}
