/* Biodex home page clip layer: sizes the five clips on the pixel lattice. Each clip is 9:16, shown
   uncut, in a well; its width is --clw (u) and its height follows from it, on whole u.
   The slots are named by PLACE (.clip-hero, -how, -together, -learn, -last), not by clip: which
   picture fills each one is Clip.astro's `media` prop. */
:root[data-k] .clip { max-width: none; }
:root[data-k] .clip-pic { aspect-ratio: auto; height: calc(round(calc((var(--clw) - 8) * 16 / 9), 1) * var(--u)); }
.clip-pic img { background: var(--sheet); }

/* widths: a phone gets up to 200u (never wider than the column), a tablet 176u, a desktop 200u */
.clip { --clw: 200; }
:root[data-k]:not([data-tier="M"]):not([data-tier="L"]) .clip { --clw: min(200, var(--col)); }
:root[data-tier="M"] .clip { --clw: 176; }
:root[data-tier="M"] .clip-hero { --clw: 152; }   /* room for the hero title beside it (landing.css) */
:root[data-tier="L"] .clip { --clw: 200; }
:root[data-tier="L"] .clip-hero { --clw: 192; }

/* a full-bleed backdrop on a phone (the last call): the clip fills the page width and the panel
   rides up over its lower third */
:root[data-k]:not([data-tier="M"]):not([data-tier="L"]) .last-stage { display: grid; grid-template-columns: 100%; }
:root[data-k]:not([data-tier="M"]):not([data-tier="L"]) .last-stage > * { grid-area: 1 / 1; }
:root[data-k]:not([data-tier="M"]):not([data-tier="L"]) .clip-bleed {
  width: var(--page-w); margin-left: calc(-1 * var(--col-x) * var(--u)); padding: 0; align-self: start; }
:root[data-k]:not([data-tier="M"]):not([data-tier="L"]) .clip-bleed > .fx { display: none; }
:root[data-k]:not([data-tier="M"]):not([data-tier="L"]) .clip-bleed .clip-pic {
  height: round(calc(var(--page-w) * 16 / 9), var(--u)); }
:root[data-k]:not([data-tier="M"]):not([data-tier="L"]) .on-bleed {
  align-self: start; margin-top: round(calc(var(--page-w) * 16 / 9 * 0.62), var(--u)); }
:root[data-k]:not([data-tier="M"]):not([data-tier="L"]) .clip-bleed .clip-key {
  right: auto; left: calc((var(--cols) - 24) * var(--u)); }
:root[data-k]:not([data-tier="M"]):not([data-tier="L"]) .clip-bleed .clip-key::before {
  left: auto; right: 0; transform: translateY(-50%); }
:root[data-k]:not([data-tier="M"]):not([data-tier="L"]) .last-band { padding-top: 0; }

.on-picture { position: relative; z-index: 1;
              --f-cast: var(--cast-picture); --ground-cast: var(--cast-paper); --ground-ring: var(--ink); }

.last-band { padding: calc(32 * var(--u)) 0; }
.last-panel { padding: calc(12 * var(--u)); text-align: center; }
.last-panel > * + * { margin-top: calc(12 * var(--u)); }
.last-panel > .fx + * { margin-top: 0; }
/* a tablet or a laptop: the clip and the panel side by side, a clear gap between them, the panel as
   tall as the clip (top and bottom edges in line) with its words centred in it */
:root:is([data-tier="M"], [data-tier="L"]) .last-stage {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: stretch; gap: calc(16 * var(--u)); }
:root:is([data-tier="M"], [data-tier="L"]) .last-stage > .clip-last { grid-column: 1; grid-row: 1; }
:root:is([data-tier="M"], [data-tier="L"]) .last-panel {
  grid-column: 2; grid-row: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }

