/* ============================================================ THE BODY MAP
   Homepage, 12 m, under "From the sea. For your cells." Tom's slides, Oct
   2026: figure on one side, Amber's eight infographic callouts on the other,
   a line from each callout to its region. Hovering a callout or the body lights that
   region and dims the rest; on a phone the figure stacks above the callouts
   and a tap does the lighting. Same feel as the dropper on the ingredients
   page: hover or focus previews, a click pins, a second click lets go.

   The figure sits straight on the water with no panel behind it. Nine images
   share one canvas: the default at the bottom, and each band layer clipped to
   its own strip of the viewer-right half (--t / --b, set per layer in the
   markup), so a lit band is only an opacity change. No text here is set at
   reduced opacity; only the figure dims. ---- */
.td-bmap-wrap { margin-top: clamp(72px, 9vw, 136px); }
.td-bmap-wrap > .td-body { margin-top: var(--st-6); }

.td-bmap {
  position: relative;
  display: grid;
  grid-template-columns: clamp(240px, 27vw, 400px) minmax(0, 1fr);
  gap: clamp(80px, 10vw, 168px);
  align-items: center;
  margin-top: clamp(36px, 4.4vw, 60px);
}

.td-bmap__fig { position: relative; z-index: 0; }
.td-bmap__stage {
  position: relative;
  aspect-ratio: 2 / 3;
  touch-action: manipulation;
}
.td-bmap__stage img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  max-width: none;
}
.td-bmap__base { transition: opacity 320ms var(--st-ease), filter 320ms var(--st-ease); }
.td-bmap__band {
  clip-path: inset(var(--t) 0 var(--b) 50%);
  opacity: 0;
  transition: opacity 320ms var(--st-ease);
}
.td-bmap.is-lensed .td-bmap__base { opacity: .3; filter: grayscale(.7); }
.td-bmap__band.is-lit { opacity: 1; }
.td-bmap.is-ready .td-bmap__stage { cursor: pointer; }

/* ---- the leaders. Absolutely over the whole grid; bodymap.js draws them in the
   grid's own coordinates, so they follow the layout at every width. ---- */
.td-bmap__leaders {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 1;
}
.td-bmap__line {
  fill: none;
  stroke: rgba(12, 31, 48, .22);
  stroke-width: 1;
  transition: stroke 220ms var(--st-ease), stroke-width 220ms var(--st-ease);
}
.td-bmap__dot {
  fill: var(--st-navy);
  stroke: rgba(244, 248, 249, .9);
  stroke-width: 1.5;
  transition: fill 220ms var(--st-ease);
}
.td-bmap__line.is-lit { stroke: var(--st-navy); stroke-width: 1.6; }
.td-bmap__dot.is-lit { fill: var(--st-deep-cyan); }

/* ---- the callouts. Each one is the control for its region. ---- */
.td-bmap__list { position: relative; z-index: 2; border-bottom: 1px solid var(--td-line-light); }
.td-bmap__item { border-top: 1px solid var(--td-line-light); }
.td-bmap__call {
  display: grid;
  grid-template-columns: clamp(44px, 4vw, 56px) minmax(0, 1fr);
  column-gap: var(--st-4);
  align-items: center;
  width: 100%;
  margin: 0; padding: clamp(10px, 1.1vw, 14px) var(--st-3);
  background: transparent; border: 0; border-radius: 0;
  text-align: left; cursor: pointer;
  color: var(--st-on-light);
  transition: background-color 220ms var(--st-ease);
}
.td-bmap__icon {
  width: 100%; height: auto;
  border-radius: 50%;
  transition: box-shadow 220ms var(--st-ease);
}
/* the infographic's line: the organ in caps, then its claim on the same run */
.td-bmap__txt {
  font-size: var(--st-size-body);
  line-height: 1.5;
  max-width: 46ch;
}
.td-bmap__l {
  margin-right: .35em;
  font-family: var(--st-font-ui);
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.td-bmap__call:hover,
.td-bmap__call.is-marked { background: rgba(255, 255, 255, .34); }
.td-bmap__call.is-marked .td-bmap__icon { box-shadow: 0 0 0 3px var(--st-deep-cyan); }
.td-bmap__call:focus-visible { outline: 2px solid var(--st-deep-cyan); outline-offset: -2px; }

/* ---- phones and narrow tablets: the figure stacks above the callouts and
   the leaders go, since a line from a list item up to a figure off screen
   points at nothing. A tap on a callout lights its region. ---- */
@media (max-width: 860px) {
  .td-bmap { grid-template-columns: minmax(0, 1fr); gap: var(--st-10); }
  .td-bmap__fig { width: min(58vw, 260px); margin-inline: auto; }
  .td-bmap__leaders { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .td-bmap__base, .td-bmap__band, .td-bmap__line, .td-bmap__dot,
  .td-bmap__call, .td-bmap__icon { transition: none; }
}

/* ---- benefits page: the outcome-first lead above "Nothing on this page
   comes from an isolate." (Tom's brief, 12 Oct 2026) ---- */
.td-outcomes { margin-bottom: clamp(64px, 8vw, 120px); }
.td-outcomes .td-body { margin-top: var(--st-6); }

/* ---- product page: the four-item strip before the formula. Four in a row
   on desktop, two by two on a phone; the same hairline entries as the
   benefits register, so it reads as part of the same system. ---- */
.td-benefits--four { grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: clamp(20px, 2.6vw, 40px); }
.td-benefits--four .td-benefit__p { max-width: 30ch; }
@media (max-width: 940px) {
  .td-benefits--four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  /* the register's one-column rule above would fold this to a list; the
     brief asks for two by two on a phone */
  .td-benefits.td-benefits--four { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--st-6); }
}
