/* ==========================================================================
   case-study.css — case study template (case-study.html)
   Load order: tokens.css → base.css → layout.css → home.css → case-study.css
   home.css supplies the shared header, footer, skip link and cursor.
   Tokens only; no new tokens. Breakpoints: 40em (640px) · 64em (1024px) ·
   90em (1440px). Type is Manrope throughout (no mono labels on this page).
   ========================================================================== */

/* ---- Hero: title on the image's own pink ground, devices below ----
   The band uses the image's flat background colour, and the image is
   pulled up under the title into its empty top area (the devices start
   27% down), so title and photo read as one picture. Margin percentages
   resolve against the band's width, which is the image's width:
   12% of the height = 0.12 × 1500/3400 of the width ≈ 5.3%, which leaves
   room for the live-site button above the devices. */
.cs-hero {
  padding-block-start: var(--space-8);
  background-color: var(--color-hero-topnatur);
  color: var(--color-hero-ink);
  text-align: center;
}

.cs-hero-text {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}

.cs-title {
  max-inline-size: 20ch;
  font-size: var(--step-4);
}

.cs-subtitle {
  max-inline-size: none;
  font-size: var(--step-1);
  line-height: var(--leading-snug);
  color: var(--color-hero-ink-muted);
}

.cs-hero-media {
  display: block;
  margin-block-start: -5.3%;
}

.cs-hero-media img {
  inline-size: 100%;
}

/* Phones: the devices sit in the middle 56% of the image, so show it at
   140% width and crop the empty pink sides; everything stays in frame
   and the devices are 40% larger. No pull-up here: the title block is
   tall enough on its own, and the button must stay clear of the devices. */
@media (max-width: 39.99em) {
  .cs-hero {
    overflow: hidden;
  }

  .cs-hero-media {
    margin-block-start: 0;
  }

  .cs-hero-media img {
    inline-size: 140%;
    max-inline-size: none;
    margin-inline: -20%;
  }
}

@media (min-width: 64em) {
  .cs-hero {
    padding-block-start: var(--space-12);
  }
}

/* Live-site link: outlined pill in hero ink (stays dark on pink in both themes) */
.cs-live {
  margin-block-start: var(--space-2);
  color: var(--color-hero-ink);
  border-color: var(--color-hero-ink);
}

.cs-live:hover {
  border-color: var(--color-hero-ink);
  background-color: var(--color-hero-ink);
  color: var(--color-hero-topnatur);
}

.cs-live:focus-visible,
.cs-hero-note a:focus-visible {
  outline-color: var(--color-hero-ink);
}

/* Attribution: small note on the same pink band, under the image */
.cs-hero-note {
  padding-block: 0 var(--space-4);
  text-align: center;
}

.cs-hero-note .attribution {
  margin-inline: auto;
  max-inline-size: 80ch;
  color: var(--color-hero-ink-muted);
}

.cs-hero-note a {
  color: var(--color-hero-ink);
  text-decoration-color: currentColor;
}

/* ---- Meta row + attribution ---- */
.cs-meta {
  padding-block: var(--space-6);
  border-block-start: var(--border-hairline);
  border-block-end: var(--border-hairline);
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4) var(--space-3);
}

@media (min-width: 64em) {
  .meta-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: var(--space-4);
  }
}

.meta-grid dt {
  margin-block-end: var(--space-1);
  font-weight: var(--weight-bold);
}

.meta-grid dd {
  line-height: var(--leading-snug);
}

.attribution {
  font-size: var(--step--1);
  color: var(--color-text-muted);
}

.attribution a {
  white-space: nowrap;
}

/* ---- Layout: sticky contents nav left, sections right (from 64em) ---- */
.cs-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

/* Below 64em: a full-bleed bar that sticks to the top of the window and
   scrolls sideways; js/case-study.js keeps the current item in view. */
.cs-toc {
  position: sticky;
  inset-block-start: var(--header-h, var(--size-header)); /* just under the sticky site header */
  z-index: 2;
  align-self: start;
  margin-inline: calc(var(--gutter) * -1);
  background-color: var(--color-bg);
  border-block-end: var(--border-hairline);
}

.cs-toc ol {
  display: flex;
  gap: var(--space-1);
  padding-inline: var(--gutter);
  overflow-x: auto;
  scrollbar-width: none;
}

.cs-toc ol::-webkit-scrollbar {
  display: none;
}

.cs-toc li {
  flex: none;
}

.cs-toc a {
  display: block;
  padding: var(--space-2) var(--space-1);
  border-block-end: 2px solid transparent;
  white-space: nowrap;
  font-size: var(--step--1);
  font-weight: var(--weight-medium);
  line-height: var(--leading-snug);
  color: var(--color-text-muted);
  text-decoration: none;
  transition:
    color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out);
}

.cs-toc a:hover {
  color: var(--color-text);
}

.cs-toc a[aria-current="true"] {
  border-color: var(--color-accent-ink);
  color: var(--color-text);
  font-weight: var(--weight-bold);
}

/* From 64em: a vertical list in the left column */
@media (min-width: 64em) {
  .cs-layout {
    grid-template-columns: minmax(0, 14rem) minmax(0, 1fr);
    gap: var(--space-8);
  }

  .cs-toc {
    margin-inline: 0;
    padding-block: var(--space-12) var(--space-4);
    border-block-end: 0;
    background-color: transparent;
  }

  .cs-toc ol {
    flex-direction: column;
    padding-inline: 0;
    overflow: visible;
    border-inline-start: var(--border-hairline);
  }

  .cs-toc a {
    margin-inline-start: -1px;
    padding: var(--space-1) var(--space-2);
    border-block-end: 0;
    border-inline-start: 2px solid transparent;
    white-space: normal;
  }
}

.cs-sections {
  min-inline-size: 0;
}

/* ---- Sections ---- */
.cs-section {
  padding-block: var(--space-8);
  /* Clears the sticky section bar on narrow screens (html scroll-padding
     already clears the site header) */
  scroll-margin-block-start: var(--space-6);
}

.cs-section + .cs-section {
  border-block-start: var(--border-hairline);
}

@media (min-width: 64em) {
  .cs-section {
    padding-block: var(--space-12);
    scroll-margin-block-start: 0;
  }
}

.cs-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-inline-size: 0;
}

/* Prose stays at the 62ch measure; diagrams, tables and screens may use
   the full column (marked below). */
.cs-body > * {
  max-inline-size: var(--measure);
}

.cs-body > h2 {
  max-inline-size: 24ch;
  font-size: var(--step-3);
}

.cs-body > :is(.metrics, .fixes, .shot, .compare, .tour, .habits, .gallery, .timeline) {
  max-inline-size: none;
}

/* Small shared label: sans, semibold, muted */
.cs-kicker,
.flow-title,
.pairs thead th,
.pairs td::before,
.tl-when {
  font-size: var(--step--1);
  font-weight: var(--weight-semibold);
  letter-spacing: 0;
  color: var(--color-text-muted);
}

/* ---- Results: large figures, label underneath (no boxes) ---- */
.metrics {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-2);
}

@media (min-width: 40em) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Each number sits in a filled box, same as the habit cards */
.metric {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
  padding: var(--space-3);
  background-color: var(--color-surface);
  border-radius: var(--radius-md);
}

/* SUS grade tiles: pastel olive for a pass, pastel coral for a fail */
.metric--good { background-color: var(--color-grade-good-bg); }
.metric--bad  { background-color: var(--color-grade-bad-bg); }
:is(.metric--good, .metric--bad) .metric-label { color: var(--color-grade-label); }

.metric-value {
  font-size: var(--step-3);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-display);
  white-space: nowrap;
}

.metric-label {
  font-size: var(--step--1);
  line-height: var(--leading-snug);
  color: var(--color-text-muted);
}

.tag-turn {
  padding: var(--space-1);
  border-radius: var(--radius-1);
  background-color: var(--color-accent-tint);
  color: var(--color-accent-ink);
  font-size: var(--step--2);
  font-weight: var(--weight-bold);
  line-height: 1;
}

/* Footnote sits directly under the figures */
.footnote {
  color: var(--color-text-muted);
}

/* ---- Problems ↔ Solutions ---- */
.pairs {
  inline-size: 100%;
  font-size: var(--step--1);
  line-height: var(--leading-snug);
}

.pairs th,
.pairs td {
  padding: var(--space-2);
  text-align: start;
  vertical-align: top;
  border-block-end: var(--border-hairline);
}

.pairs thead th {
  border-block-end: var(--border-strong);
}

.pairs tbody th {
  inline-size: var(--space-6);
  font-weight: var(--weight-bold);
  color: var(--color-accent-ink);
}

.pairs td:first-of-type {
  color: var(--color-text-muted);
}

/* Narrow screens: each row becomes a stacked problem → solution pair */
@media (max-width: 39.99em) {
  .pairs,
  .pairs tbody,
  .pairs tr,
  .pairs th,
  .pairs td {
    display: block;
  }

  .pairs thead {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .pairs tr {
    padding-block: var(--space-2);
    border-block-end: var(--border-hairline);
  }

  .pairs th,
  .pairs td {
    padding: 0;
    border: 0;
  }

  .pairs tbody th {
    inline-size: auto;
    margin-block-end: var(--space-1);
  }

  .pairs td + td {
    margin-block-start: var(--space-1);
  }

  .pairs td::before {
    content: attr(data-label);
    display: block;
  }
}


/* ---- Who shops here: habit cards, each linking to its page-tour block ---- */
.habits {
  display: grid;
  gap: var(--space-2);
}

@media (min-width: 40em) {
  .habits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .habit--b2b { grid-column: 1 / -1; }
}

.habit {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
  background-color: var(--color-surface);
  border-radius: var(--radius-md);
  line-height: var(--leading-snug);
}

.habit-title {
  font-size: var(--step-1);
  line-height: var(--leading-snug);
}

/* B2B: secondary — outline only, no fill */
.habit--b2b {
  background-color: transparent;
  border: var(--border-hairline);
}

.habit--b2b .habit-title {
  font-size: var(--step-0);
}

.seen-in {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
  margin-block-start: auto;
  font-size: var(--step--1);
  color: var(--color-text-muted);
}

.seen-in a {
  padding: var(--space-1) var(--space-2);
  border: var(--border-hairline);
  border-radius: var(--radius-pill);
  background-color: var(--color-bg);
  color: var(--color-text);
  font-weight: var(--weight-semibold);
  line-height: 1;
  text-decoration: none;
  transition: border-color var(--duration-fast) var(--ease-out);
}

.seen-in a:hover {
  border-color: var(--color-border-strong);
}

/* ---- Turning point: v1 → v2 flow pills ---- */
.flow {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
}

.pills li {
  position: relative;
  padding: var(--space-1) var(--space-2);
  border: 1px dashed var(--color-grey);
  border-radius: var(--radius-pill);
  font-size: var(--step--1);
  line-height: var(--leading-snug);
  color: var(--color-text-muted);
}

.pills li:not(:last-child)::after {
  content: "→";
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: calc(100% + var(--space-1));
  transform: translateY(-50%);
  color: var(--color-grey);
}

.flow--v2 .pills li {
  border: var(--border-strong);
  color: var(--color-text);
}

.flow--v2 .pills li.is-key {
  background-color: var(--color-accent-tint);
  border-color: var(--color-accent-ink);
  font-weight: var(--weight-semibold);
}

.trigger {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
  padding-inline-start: var(--space-3);
  border-inline-start: 2px solid var(--color-accent);
}

.pullquote {
  padding-inline-start: 0;
  border: 0;
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-snug);
}

/* ---- Principles ---- */
.principles {
  display: grid;
  gap: var(--space-2);
}

@media (min-width: 40em) {
  .principles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.principles li {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
  background-color: var(--color-surface);
  border-radius: var(--radius-md);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
}

.principle-num {
  font-size: var(--step-1);
  font-weight: var(--weight-bold);
  color: var(--color-accent-ink);
}

/* ---- Shared media components ----
   .shot          figure: caption label above a 1px framed image/video
   .scroll-frame  .shot whose frame scrolls (full-page captures); focusable
   .compare       two .shots side by side from 48em (768px), stacked below
   .annotated     .shot with numbered .marker spans (--x / --y in percent of
                  the image); the matching ol.callouts follows the figure
   .shopper-note  aside: "What this meant for the shopper"               */
.shot {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-inline-size: 0;
}

.shot > figcaption {
  font-size: var(--step--1);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
  color: var(--color-text-muted);
}

.shot-frame {
  position: relative;
  border: var(--border-hairline);
  border-radius: var(--radius-md);
  background-color: var(--color-surface);
}

.shot-frame > :is(img, video) {
  inline-size: 100%;
  border-radius: calc(var(--radius-md) - 1px);
}

.shot-frame:focus-visible {
  outline: 2px solid var(--color-accent-ink);
  outline-offset: 2px;
}

/* Scrolling frames: the frame clips its own corners, so the image is square */
.scroll-frame .shot-frame {
  block-size: 70vh;
  block-size: 70svh;
  overflow-y: auto;
}

.scroll-frame img {
  inline-size: 100%;
}

.shot-media {
  position: relative;
}

/* Phone frames: 280 × 560. .phone-row holds 2–3 phones side by side from
   48em (768px), each column at most 280px and shrinking to fit. */
.phone-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 17.5rem);
  justify-content: start;
  gap: var(--space-3);
}

.cs-body > .phone-row { max-inline-size: none; }

.scroll-frame--phone .shot-frame {
  block-size: 35rem;
}

/* Under 768px: a sideways scroll-snap row, bleeding to the screen edges.
   Focusable (tabindex="0" in the HTML) so keyboard users can scroll it. */
.phone-row:focus-visible {
  outline: 2px solid var(--color-accent-ink);
  outline-offset: 2px;
}

@media (max-width: 47.99em) {
  .phone-row {
    display: flex;
    gap: var(--space-2);
    margin-inline: calc(var(--gutter) * -1);
    padding-inline: var(--gutter);
    padding-block-end: var(--space-1);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gutter);
  }

  .phone-row > .shot {
    flex: 0 0 min(17.5rem, 80%);
    scroll-snap-align: start;
  }
}

.compare {
  display: grid;
  gap: var(--space-3);
}

@media (min-width: 48em) {
  .compare {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}

/* Numbered markers, placed in percent of the image box */
.marker,
.callout-num {
  display: inline-grid;
  place-items: center;
  inline-size: var(--space-4);
  block-size: var(--space-4);
  border-radius: var(--radius-pill);
  background-color: var(--color-text);
  color: var(--color-bg);
  font-size: var(--step--1);
  font-weight: var(--weight-bold);
  line-height: 1;
}

.marker {
  position: absolute;
  z-index: 1;
  inset-inline-start: var(--x);
  inset-block-start: var(--y);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 2px var(--color-bg);
  transition: transform var(--duration-fast) var(--ease-out),
    background-color var(--duration-fast) var(--ease-out);
}

/* Hover a marker: js/marker-peek.js shows its callout in .marker-card */
@media (hover: hover) {
  .marker { cursor: help; }
  .marker:hover,
  .marker.is-on {
    background-color: var(--color-accent-ink);
    transform: translate(-50%, -50%) scale(1.15);
  }
}

.callouts li { transition: opacity var(--duration-fast) var(--ease-out); }
.callouts:has(.is-peeked) li:not(.is-peeked) { opacity: 0.45; }

/* ---- Marker peek card (one shared element, driven by js/marker-peek.js)
   Same mechanics as the homepage .peek-card: fixed, `translate` places it,
   `transform` runs the enter animation, --dx follows the pointer. ---- */
.marker-card {
  position: fixed;
  inset-block-start: 0;
  inset-inline-start: 0;
  z-index: 95; /* above the lightbox (90), below the cursor dot (100) */
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  inline-size: min(22rem, 100vw - 2 * var(--space-2));
  padding: var(--space-2);
  border: var(--border-hairline);
  border-radius: var(--radius-md);
  background-color: var(--color-bg);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.06), 0 8px 24px rgb(0 0 0 / 0.08);
  font-size: var(--step--1);
  line-height: var(--leading-snug);
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  transform: translateX(var(--dx, 0px)) translateY(8px) scale(0.96);
  transition:
    opacity 180ms var(--ease-out),
    transform 180ms var(--ease-out),
    visibility 0s 180ms;
}

.marker-card.is-below { transform: translateX(var(--dx, 0px)) translateY(-8px) scale(0.96); }

.marker-card.is-on {
  visibility: visible;
  opacity: 1;
  transform: translateX(var(--dx, 0px));
  transition:
    opacity 180ms var(--ease-out),
    transform 400ms var(--ease-out),
    visibility 0s 0s;
}

.marker-card-num {
  flex: none;
  display: inline-grid;
  place-items: center;
  inline-size: var(--space-4);
  block-size: var(--space-4);
  border-radius: var(--radius-pill);
  background-color: var(--color-text);
  color: var(--color-bg);
  font-weight: var(--weight-bold);
  line-height: 1;
}

@media (prefers-reduced-motion: reduce) {
  .marker,
  .marker-card,
  .marker-card.is-below,
  .marker-card.is-on { transition-property: opacity, visibility; }
  .marker-card,
  .marker-card.is-below,
  .marker-card.is-on { transform: none; }
}

@media (hover: none) {
  .marker-card { display: none; }
}

/* ---- Lightbox (js/lightbox.js): click a screenshot to enlarge ----
   Each .shot gets a small enlarge button in the frame's bottom corner
   (shown on hover/focus with a mouse, always on touch). The overlay sits
   below the sage cursor dot (z-index 100) so the dot stays visible. */
.is-zoomable { cursor: zoom-in; }

.shot.has-lb { position: relative; }

.lb-open-btn {
  position: absolute;
  inset-block-end: var(--space-1);
  inset-inline-end: var(--space-1);
  z-index: 2;
  display: grid;
  place-items: center;
  inline-size: var(--space-4);
  block-size: var(--space-4);
  padding: 0;
  border: var(--border-hairline);
  border-radius: var(--radius-pill);
  background-color: var(--color-bg);
  color: var(--color-text);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.08);
  cursor: zoom-in;
  transition: opacity var(--duration-fast) var(--ease-out);
}

/* Scrolling frames: keep clear of the scrollbar */
.scroll-frame .lb-open-btn { inset-inline-end: calc(var(--space-1) + 12px); }

@media (hover: hover) {
  .lb-open-btn { opacity: 0; }
  .shot.has-lb:hover .lb-open-btn,
  .lb-open-btn:focus-visible { opacity: 1; }
}

.lb-open-btn:focus-visible {
  outline: 2px solid var(--color-accent-ink);
  outline-offset: 2px;
}

html.lb-open { overflow: hidden; }

.lb {
  position: fixed;
  inset: 0;
  z-index: 90;
  overflow: auto;
  overscroll-behavior: contain;
  background-color: rgb(20 21 18 / 0.95);
  opacity: 0;
  transition: opacity 200ms var(--ease-out);
}

.lb.is-on { opacity: 1; }

.lb-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-block-size: 100%;
  padding: var(--space-6) var(--space-2);
}

.lb.is-tall .lb-stage,
.lb.is-zoomed .lb-stage { justify-content: flex-start; }

/* Zoomed: 95% of the window, so no side padding to push it off-centre */
.lb.is-zoomed .lb-stage {
  padding-inline: 0;
  padding-block-start: var(--space-10);
}

.lb-media {
  position: relative;
  flex: none;
  transform: scale(0.97);
  transition: transform 260ms var(--ease-out);
}

.lb.is-on .lb-media { transform: none; }

.lb-media img {
  display: block;
  inline-size: 100%;
  block-size: auto;
  border-radius: var(--radius-md);
  background-color: var(--color-surface);
  cursor: zoom-in;
}

.lb.is-zoomed .lb-media img { cursor: zoom-out; }

.lb-cap {
  max-inline-size: 60ch;
  margin: 0;
  color: rgb(245 243 238 / 0.85);
  font-size: var(--step--1);
  font-weight: var(--weight-semibold);
  text-align: center;
}

/* Controls: counter · zoom · close top right; arrows at the sides.
   Fixed light-on-dark colours: the overlay is dark in both themes. */
.lb-bar {
  position: fixed;
  inset-block-start: var(--space-2);
  inset-inline-end: var(--space-2);
  z-index: 1;
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.lb-count {
  margin: 0 var(--space-1) 0 0;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-pill);
  background-color: rgb(20 21 18 / 0.6);
  color: rgb(245 243 238 / 0.9);
  font-size: var(--step--1);
  font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.lb-btn {
  display: grid;
  place-items: center;
  inline-size: var(--space-5);
  block-size: var(--space-5);
  padding: 0;
  border: 0;
  border-radius: var(--radius-pill);
  background-color: #f5f3ee;
  color: #242521;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.25);
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
}

.lb-btn:hover { background-color: #ffffff; }
.lb-btn:active { transform: scale(0.94); }

.lb-btn:focus-visible {
  outline: 2px solid #f5f3ee;
  outline-offset: 3px;
}

.lb-btn[hidden],
.lb-count[hidden] { display: none; }

.lb-zoom[aria-pressed="true"] .lb-vbar { display: none; }

.lb-nav {
  position: fixed;
  inset-block-start: 50%;
  z-index: 1;
  translate: 0 -50%;
}

.lb-prev { inset-inline-start: var(--space-2); }
.lb-next { inset-inline-end: var(--space-2); }

.lb-nav:active { transform: scale(0.94); }

@media (prefers-reduced-motion: reduce) {
  .lb, .lb-media { transition: none; }
  .lb-media { transform: none; }
}

/* Callouts: number · decision (bold) · why · UX-law pill */
.callouts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
  gap: var(--space-3);
}

.callouts li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: var(--step--1);
  line-height: var(--leading-snug);
}

.callout-num {
  flex: none;
}

.callout-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
  color: var(--color-text-muted);
}

.callout-body strong {
  font-size: var(--step-0);
  color: var(--color-text);
}

.law {
  padding: var(--space-1);
  border-radius: var(--radius-pill);
  background-color: var(--color-accent-tint);
  color: var(--color-accent-ink);
  font-size: var(--step--2);
  font-weight: var(--weight-bold);
  line-height: 1;
}

.shopper-note {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  max-inline-size: var(--measure);
  padding: var(--space-2) var(--space-3);
  border-inline-start: 2px solid var(--color-accent);
  border-radius: 0 var(--radius-2) var(--radius-2) 0;
  background-color: var(--color-accent-tint);
}

.shopper-note-title {
  font-size: var(--step--1);
  font-weight: var(--weight-bold);
  color: var(--color-accent-ink);
}

/* ---- Page tour blocks ---- */
.tour {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding-block-start: var(--space-6);
  /* Skip layout and paint until a block is near the screen (most of the
     page's elements are here). This clips to the block, so 8px of side
     room keeps focus rings visible. */
  content-visibility: auto;
  contain-intrinsic-size: auto 1600px;
  margin-inline: calc(var(--space-1) * -1);
  padding-inline: var(--space-1);
  /* Clears the sticky section bar when a "Seen in" link jumps here */
  scroll-margin-block-start: var(--space-6);
}

@media (min-width: 64em) {
  .tour {
    padding-block-start: var(--space-8);
    scroll-margin-block-start: 0;
  }
}

.tour-head {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.tour-label {
  font-size: var(--step--1);
  font-weight: var(--weight-semibold);
  color: var(--color-accent-ink);
}

.tour h3 {
  max-inline-size: 30ch;
  font-size: var(--step-2);
}

/* Card video beside its callouts from 48em */
.tour-split {
  display: grid;
  gap: var(--space-4);
}

.shot--card {
  max-inline-size: 20rem;
}

@media (min-width: 48em) {
  .tour-split {
    grid-template-columns: minmax(0, 20rem) minmax(0, 1fr);
    align-items: center;
  }

  .tour-split .callouts {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---- Video: play button over the poster ----
   Card: once playing, the button shrinks to a pause button in the corner.
   Cart: js/media.js hides it after the first play (native controls stay). */
/* js/media.js sets poster from data-poster when the video is near, so the
   posters do not download with the page. */
.vid {
  overflow: hidden;
}

.vid-btn {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: 50%;
  display: grid;
  place-items: center;
  inline-size: var(--space-8);
  block-size: var(--space-8);
  border: 0;
  border-radius: var(--radius-pill);
  background-color: var(--color-text);
  color: var(--color-bg);
  transform: translate(-50%, -50%);
  cursor: pointer;
}

.vid-btn[hidden],
.vid-btn .i-pause,
.is-playing .vid-btn .i-play {
  display: none;
}

.is-playing .vid-btn .i-pause {
  display: block;
}

.is-playing .vid-btn {
  inset-block-start: var(--space-1);
  inset-inline-start: auto;
  inset-inline-end: var(--space-1);
  inline-size: var(--space-5);
  block-size: var(--space-5);
  transform: none;
}

.vid-btn:focus-visible {
  outline: 2px solid var(--color-accent-ink);
  outline-offset: 2px;
}


/* ---- More pages: gallery of full-length captures ---- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr));
  gap: var(--space-3) var(--space-2);
}

/* Tiles show the top of each full-length capture; the lightbox shows all */
.gallery .shot-frame > img {
  display: block;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: top;
}

/* ---- Timeline ---- */
.timeline {
  display: grid;
  gap: var(--space-1);
}

.timeline li {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-2);
  border-inline-start: 2px solid var(--color-border);
  line-height: var(--leading-snug);
}

.tl-step {
  font-weight: var(--weight-semibold);
  font-size: var(--step--1);
}

.tl-mine {
  font-size: var(--step--2);
  font-weight: var(--weight-bold);
  color: var(--color-accent-ink);
}

.timeline li.is-mine {
  background-color: var(--color-accent-tint);
  border-color: var(--color-accent-ink);
  border-radius: 0 var(--radius-2) var(--radius-2) 0;
}

@media (min-width: 64em) {
  .timeline {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .timeline li {
    border-inline-start: 0;
    border-block-start: 2px solid var(--color-border);
  }

  .timeline li.is-mine {
    border-radius: 0 0 var(--radius-2) var(--radius-2);
  }
}

/* ---- Reflection ---- */
.measure-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.measure-list li {
  padding: var(--space-1) var(--space-2);
  border: var(--border-hairline);
  border-radius: var(--radius-pill);
  font-size: var(--step--1);
}

/* ---- Next project ---- */
.cs-next {
  padding-block: var(--space-8);
  border-block-start: var(--border-hairline);
}

.cs-next-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--space-6);
}

.cs-next-link {
  font-size: var(--step-3);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
  text-decoration: none;
}

/* Two more projects under the next-project link: the home work tiles
   (css/home.css), full row, side by side without the home stagger. */
.cs-more {
  flex-basis: 100%;
  margin-block-start: calc(var(--space-3) - var(--space-6));
}

.cs-more > li:nth-child(even) {
  transform: none;
}

.cs-more > li:nth-child(even):last-child {
  margin-block-end: 0;
}

/* ==========================================================================
   Migration Info Hub additions (case-study-migration.html)
   Tokens only: no gradients. The one page-specific colour is the hero band,
   --color-hero-migration, sampled from the hero image (like Topnatur's).
   ========================================================================== */

/* Hero: same build as Topnatur (.cs-hero / .cs-hero-media above), on the
   image's own salmon ground. The laptop starts 32% down the image (= 18%
   of its width); pulling the image up by 12% of its width tucks the flat
   top band under the title and leaves ~6% clear above the laptop.
   Phones keep the shared 140% crop and no pull-up. */
.cs-hero--migration {
  background-color: var(--color-hero-migration);
}

.cs-hero--migration .cs-subtitle {
  max-inline-size: 48ch;
  text-wrap: balance;
  /* 80% ink: 5.3:1 on the salmon (the shared 72% is 4.3:1 here) */
  color: color-mix(in srgb, var(--color-hero-ink) 80%, transparent);
}

@media (min-width: 40em) {
  .cs-hero--migration .cs-hero-media {
    margin-block-start: -12%;
  }
}

/* Screenshot slots: a grey box at the screenshot's intrinsic size (the SVG
   carries width/height, so the box is sized before anything loads) */
.ph {
  display: grid;
  overflow: hidden;
}

.ph > svg,
.ph > .ph-label { grid-area: 1 / 1; }

.ph > svg {
  display: block;
  inline-size: 100%;
  block-size: auto;
  fill: var(--color-surface);
}

.ph-label {
  place-self: center;
  font-size: var(--step--1);
  font-weight: var(--weight-semibold);
  color: var(--color-text-muted);
}

.cs-body > :is(.testimonial, .matrix) {
  max-inline-size: none;
}

/* Testimonial block: css/testimonial.css */

/* Insight card quote */
.insight-quote {
  margin: 0;
  padding-inline-start: var(--space-2);
  border-inline-start: 2px solid var(--color-accent);
  font-family: var(--font-display);
  font-weight: var(--weight-medium);
}

/* Portal friction list */
.friction {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding-inline-start: var(--space-3);
  list-style: disc;
}

/* Recommendations table: recommendation text in full ink, not muted */
.recs td:first-of-type { color: var(--color-text); }
.recs td:not(:first-of-type) { color: var(--color-text-muted); }

/* ---- 2×2 effort / impact grid ----
   Columns: y-axis label · low effort · high effort
   Rows:    high impact · low impact · x-axis label */
.matrix {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: 0;
}

.matrix-grid {
  display: grid;
  grid-template-columns: auto repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, auto) auto;
  gap: var(--space-1);
}

.matrix p { max-inline-size: none; }

.matrix-axis {
  align-self: center;
  justify-self: center;
  font-size: var(--step--1);
  font-weight: var(--weight-semibold);
  color: var(--color-text-muted);
}

.matrix-axis--y {
  grid-column: 1;
  grid-row: 1 / 3;
  writing-mode: vertical-rl;
  rotate: 180deg;
  text-align: start;
}

.matrix-axis--x {
  grid-column: 2 / 4;
  grid-row: 3;
  justify-self: end;
}

.quad {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-inline-size: 0;
  padding: var(--space-2);
  border: var(--border-hairline);
  border-radius: var(--radius-md);
  line-height: var(--leading-snug);
}

.quad--win {
  grid-column: 2;
  grid-row: 1;
  background-color: var(--color-accent-tint);
  border-color: var(--color-accent-ink);
}

.quad--big {
  grid-column: 3;
  grid-row: 1;
  background-color: var(--color-surface);
}

.quad--empty:nth-of-type(3) { grid-column: 2; grid-row: 2; }
.quad--empty:nth-of-type(4) { grid-column: 3; grid-row: 2; }

.quad-title {
  font-size: var(--step-0);
  font-weight: var(--weight-bold);
}

.quad-note,
.quad-none {
  font-size: var(--step--2);
  color: var(--color-text-muted);
}

.quad-items {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-block-start: var(--space-1);
  font-size: var(--step--1);
}

.quad-items li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-1);
  overflow-wrap: anywhere;
}

@media (min-width: 40em) {
  .quad { padding: var(--space-3); }
}

.quad-items .callout-num {
  flex: none;
  inline-size: var(--space-3);
  block-size: var(--space-3);
  font-size: var(--step--2);
}

/* Phones: two quadrants share ~270px, so tighten padding and type so
   words like "Breadcrumbs" never break mid-word */
@media (max-width: 39.99em) {
  .quad { padding: var(--space-1); }
  .quad-title { font-size: var(--step--1); }
  .quad-items { font-size: var(--step--2); }
  .quad-items li { gap: var(--space-1); overflow-wrap: normal; hyphens: auto; }
  .quad-items .callout-num { inline-size: var(--space-2); block-size: var(--space-2); }
}

/* ==========================================================================
   Stamp Social additions (case-study-stamp.html)
   Tokens only. New components: .phone-shot, .decision (+ .verdict);
   .phone-row is shared with Topnatur (above).
   ========================================================================== */

/* Hero: same build as Topnatur / Migration (.cs-hero / .cs-hero-media),
   on the image's own sand ground. The phone starts 23% down the image
   (= 10% of its width); pulling the image up by 5% of its width tucks the
   flat top band under the title and leaves ~5% clear above the phone.
   Phones keep the shared 140% crop and no pull-up. */
.cs-hero--stamp {
  background-color: var(--color-hero-stamp);
}

.cs-hero--stamp .cs-subtitle {
  max-inline-size: 48ch;
  text-wrap: balance;
  /* 80% ink, as on Migration */
  color: color-mix(in srgb, var(--color-hero-ink) 80%, transparent);
}

/* Live-site button: hover fills with ink, text takes the sand ground */
.cs-hero--stamp .cs-live:hover {
  color: var(--color-hero-stamp);
}

@media (min-width: 40em) {
  .cs-hero--stamp .cs-hero-media {
    margin-block-start: -5%;
  }
}

/* Demo band: the 16:9 demo video and the prototype link, on the page
   ground right under the hero */
.cs-demo-band {
  padding-block-start: var(--space-8);
}

.cs-demo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}

.cs-demo > .shot {
  inline-size: 100%;
  max-inline-size: 60rem;
  text-align: start;
}

.cs-demo .ph > svg { aspect-ratio: 16 / 9; }

.cs-demo-link a {
  font-weight: var(--weight-semibold);
  text-underline-offset: 0.2em;
}

/* Stamp intro: the Topnatur hero note, set on the page ground under the
   hero (so the photo keeps its clean bottom edge), kept to 62ch */
.cs-intro {
  padding-block-start: var(--space-6);
}

.cs-intro .attribution {
  max-inline-size: 62ch;
  color: var(--color-text-muted);
}


/* .phone-shot: a .shot for tall phone screens, max 280px (240px < 480px).
   The frame keeps the shared 1px border + token radius; no shadow. */
.phone-shot {
  inline-size: 100%;
  max-inline-size: 17.5rem;
}

.phone-shot .shot-frame {
  overflow: hidden;
  border-radius: var(--radius-md);
}

@media (max-width: 47.99em) {
  .phone-row > .phone-shot { flex-basis: min(17.5rem, 80%); }
}

@media (max-width: 29.99em) {
  .phone-shot { max-inline-size: 15rem; }
  .phone-row > .phone-shot { flex-basis: min(15rem, 80%); }
}

/* Per-screen callout lists under each phone row */
.cs-body > .callout-groups { max-inline-size: none; }

.callout-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: var(--space-4) var(--space-3);
}

.callout-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.callout-group .callouts { grid-template-columns: minmax(0, 1fr); }

/* Why search: three cards; 2 + 1 (full width) from 40em, 3 across from 64em */
@media (min-width: 40em) {
  .habits--3 > :last-child { grid-column: 1 / -1; }
}

@media (min-width: 64em) {
  .habits--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .habits--3 > :last-child { grid-column: auto; }
}

.habit .friction { font-size: var(--step--1); }

/* Why search: "before" phone shot + the three cards. Under 64em the phone
   sits centered on top and the cards keep their 1 / 2+1 grid below; from
   64em the phone is a 280px column on the left, cards stacked on the right.
   Each card ends with the image marker that points at it. */
.cs-body > .why-split { max-inline-size: none; }

.why-split {
  display: grid;
  gap: var(--space-4);
}

.why-split > .phone-shot { justify-self: center; }

@media (min-width: 64em) {
  .why-split {
    grid-template-columns: 17.5rem minmax(0, 1fr);
    align-items: start;
  }

  /* The cards run taller than the phone: the phone sticks just under the
     site header while they scroll, and stops at the end of the last card */
  .why-split > .phone-shot {
    justify-self: start;
    position: sticky;
    inset-block-start: calc(var(--header-h, var(--size-header)) + var(--space-3));
  }

  .why-split .habits--3 { grid-template-columns: minmax(0, 1fr); }
}

.habit-marker {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin-block-start: auto;
  padding-block-start: var(--space-2);
  border-block-start: var(--border-hairline);
  font-size: var(--step--1);
  line-height: var(--leading-snug);
}

.habit-marker .callout-body strong { font-size: var(--step--1); }

/* .shot--wide: a wide diagram (journey map) that would shrink past reading
   size on phones. Under 48em the frame scrolls sideways and the image keeps
   a 50rem width (labels ≈ 11px); from 48em it fits the column as usual. */
.wide-hint { display: none; }

@media (max-width: 47.99em) {
  .wide-hint { display: inline; }

  .shot--wide .shot-frame {
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }

  .shot--wide .shot-frame > img {
    inline-size: 50rem;
    max-inline-size: none;
    border-radius: 0;
  }
}

/* Bets table: parked rows muted */
.bets .is-parked :is(th, td) { color: var(--color-text-muted); }

.criteria {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  font-size: var(--step--1);
  line-height: var(--leading-snug);
  color: var(--color-text-muted);
}

/* ---- Decision block: dt/dd-style rows (label | content from 40em) ---- */
.cs-body > .decision { max-inline-size: none; }

.decision {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding-block-start: var(--space-4);
  border-block-start: var(--border-hairline);
  /* "Decision 3" links: clear the sticky section bar on narrow screens */
  scroll-margin-block-start: var(--space-8);
}

.decision-title {
  font-size: var(--step-1);
  line-height: var(--leading-snug);
}

.decision-num {
  display: block;
  font-size: var(--step--1);
  font-weight: var(--weight-semibold);
  color: var(--color-text-muted);
}

.decision-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.decision-list > div {
  display: grid;
  gap: var(--space-1);
}

@media (min-width: 40em) {
  .decision-list > div {
    grid-template-columns: 9rem minmax(0, 62ch);
    gap: var(--space-3);
  }
}

.decision-list dt {
  font-size: var(--step--1);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
  color: var(--color-text-muted);
  padding-block-start: 0.15em;
}

.decision-list dd {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  margin: 0;
  line-height: var(--leading-snug);
}

/* Result row: verdict pill leads the sentence inline; the UX-law pill
   drops to its own line below, like the law pills in the other rows */
.decision-list > div:last-child dd {
  display: block;
}

.decision-list > div:last-child dd > .verdict {
  display: inline-block;
  vertical-align: 0.1em;
  margin-inline-end: var(--space-1);
}

.decision-list > div:last-child dd > .law {
  display: block;
  inline-size: fit-content;
  margin-block-start: var(--space-2);
}

/* "What I learned": the turn of Decision 3, marked like .trigger */
.decision-learned dd {
  padding-inline-start: var(--space-2);
  border-inline-start: 2px solid var(--color-accent);
  font-weight: var(--weight-semibold);
}

/* Verdict pill: same shape as .law. Supported = sage; Not supported =
   neutral surface (never red) */
.verdict {
  padding: var(--space-1);
  border-radius: var(--radius-pill);
  background-color: var(--color-accent-tint);
  color: var(--color-accent-ink);
  font-size: var(--step--2);
  font-weight: var(--weight-bold);
  line-height: 1;
}

.verdict--no {
  background-color: var(--color-surface);
  color: var(--color-text);
  box-shadow: inset 0 0 0 1px var(--color-border);
}

/* Outcome targets: outlined, unfilled tiles with a "Target" tag, so they
   never read as results */
.cs-body > .metrics--target { max-inline-size: none; }

@media (min-width: 64em) {
  .metrics--target { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.metric--target {
  background-color: transparent;
  border: 1px dashed var(--color-grey);
}

.metric--target .metric-value { color: var(--color-text-muted); }

/* ==========================================================================
   Atlas (case-study-atlas.html): modifiers of the shared components only
   ========================================================================== */

/* Hero: same build as Topnatur / Migration / Stamp, on the image's own
   grey-green ground (--color-hero-atlas, sampled at the top centre). The
   studio backdrop isn't perfectly flat (a touch darker in the top corners),
   so the image's top edge fades into the band instead of meeting it in a
   line. The laptop starts 18% down the image (= 7.6% of its width); pulling
   the image up by 4% of its width leaves ~3.6% clear above the laptop.
   Phones keep the shared 140% crop and no pull-up. */
.cs-hero--atlas {
  background-color: var(--color-hero-atlas);
}

.cs-hero--atlas .cs-subtitle {
  max-inline-size: 48ch;
  text-wrap: balance;
  /* 80% ink, as on Migration and Stamp */
  color: color-mix(in srgb, var(--color-hero-ink) 80%, transparent);
}

/* The backdrop is darker at the top (band colour) and lighter at the
   bottom (--color-hero-atlas-base), and uneven at the corners. Both edges
   of the image fade out; behind it, the top half shows the band and the
   bottom half the base colour (a hard split, not a visible gradient), so
   each edge melts into the ground it meets. */
.cs-hero--atlas .cs-hero-media {
  background-image: linear-gradient(transparent 50%, var(--color-hero-atlas-base) 50%);
}

.cs-hero--atlas .cs-hero-media img {
  mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 90%, transparent);
}

/* Intro under the image, on the image's bottom ground, full width */
.cs-hero-foot {
  background-color: var(--color-hero-atlas-base);
}

.cs-hero--atlas .cs-hero-note {
  padding-block: var(--space-2) var(--space-6);
}

.cs-hero--atlas .cs-hero-note .attribution {
  max-inline-size: var(--measure);
  color: color-mix(in srgb, var(--color-hero-ink) 80%, transparent);
}

.cs-hero--atlas .cs-live:hover {
  color: var(--color-hero-atlas);
}

@media (min-width: 40em) {
  .cs-hero--atlas .cs-hero-media {
    margin-block-start: -4%;
  }
}

/* Results: three tiles, 1 → 3 columns (2 + 1 would leave a hole) */
@media (min-width: 40em) {
  .metrics--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.metrics--3 > li { display: flex; }
.metrics--3 > li > .metric { flex: 1; }

/* A result tile that links out: whole tile clickable, same fill, accent on
   hover, visible focus ring */
.metric--link {
  color: var(--color-text);
  text-decoration: none;
  transition: background-color var(--duration-fast) var(--ease-out);
}

.metric--link:hover {
  background-color: var(--color-accent-tint);
}

.metric--link:hover .metric-value { color: var(--color-accent-ink); }

.metric--link:focus-visible {
  outline: 2px solid var(--color-accent-ink);
  outline-offset: 2px;
}

/* Design question: the .trigger rule, filled with the sage tint */
.trigger--question {
  padding: var(--space-3);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background-color: var(--color-accent-tint);
}

.trigger--question p:last-child {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-snug);
}

/* Research table: what people said, in italics */
.pillars td:first-of-type { font-style: italic; }

/* ==========================================================================
   Rituals (case-study-rituals.html): modifiers of the shared components only
   ========================================================================== */

/* Hero: same build as the others. The image's edges are flat
   --color-hero-rituals, so band and image meet without a seam. The devices
   leave 8% of the image's width clear above and below, which the pull-up
   and the intro use. */
.cs-hero--rituals {
  background-color: var(--color-hero-rituals);
}

.cs-hero--rituals .cs-subtitle {
  max-inline-size: 48ch;
  text-wrap: balance;
  color: color-mix(in srgb, var(--color-hero-ink) 80%, transparent);
}

.cs-hero--rituals .cs-hero-foot {
  position: relative;
  margin-block-start: -5%;
  background-color: transparent;
}

.cs-hero--rituals .cs-hero-note {
  padding-block: 0 var(--space-6);
}

.cs-hero--rituals .cs-hero-note .attribution {
  max-inline-size: var(--measure);
  color: color-mix(in srgb, var(--color-hero-ink) 80%, transparent);
}

.cs-hero--rituals .cs-live:hover {
  color: var(--color-hero-rituals);
}

@media (min-width: 40em) {
  .cs-hero--rituals .cs-hero-media {
    margin-block-start: -5%;
  }
}

/* Long phone captures, cropped from the top at a fixed size (no layout
   shift); the lightbox shows the whole screen.
   --cap: 640px tall · --fit: one phone screen tall, to even out a .phone-row */
.phone-shot--cap .shot-frame > img,
.phone-shot--fit .shot-frame > img {
  object-fit: cover;
  object-position: top;
}

.phone-shot--cap .shot-frame > img { block-size: 40rem; }

.phone-shot--fit .shot-frame > img {
  block-size: auto;
  aspect-ratio: 375 / 812;
}

/* Five phones: never narrower than 160px, so the markers stay on scale. From
   768px the row fits at wide windows and keeps its sideways scroll otherwise. */
@media (min-width: 48em) {
  .phone-row--5 {
    grid-auto-columns: minmax(10rem, 17.5rem);
    padding-block-end: var(--space-1);
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }

  .phone-row--5 > .shot { scroll-snap-align: start; }
}

/* Cart: callouts stay next to the screenshots they explain; from 64em the
   phone takes the left column beside them */
@media (max-width: 63.99em) {
  .why-split--cart .callouts { order: -1; }
}

/* Impact table: "Projected" reads as the pill in both layouts. Stacked, the
   cell's label takes over from the hidden header. */
@media (max-width: 39.99em) {
  .impact td[data-label="Projected"]::before {
    inline-size: fit-content;
    margin-block-end: var(--space-1);
    padding: var(--space-1);
    border-radius: var(--radius-1);
    background-color: var(--color-accent-tint);
    color: var(--color-accent-ink);
    font-size: var(--step--2);
    font-weight: var(--weight-bold);
    line-height: 1;
  }
}

@media (min-width: 40em) {
  .impact td:nth-of-type(2) { white-space: nowrap; }
}

