/* Partners: "what's on the bike". The plan-view bike is pinned beside the partners and the part each one
   belongs to is picked out as it comes into focus (partners.js). Without JavaScript, or with reduced
   motion, the bike is still and labelled and the partners are a plain list. */

.pp { position: relative; }
.pp-grid { display: grid; grid-template-columns: minmax(0, 36rem) minmax(0, 1fr); column-gap: clamp(32px, 5vw, 88px); align-items: start; }
.pp-text { grid-column: 1; grid-row: 1; min-width: 0; }
.pp-stage { grid-column: 2; grid-row: 1; position: sticky; top: var(--bar-h); height: calc(100vh - var(--bar-h)); height: calc(100svh - var(--bar-h)); }

/* opening */
.pp-intro { padding-bottom: var(--s3); }
.pp-intro h1 { max-width: 15ch; }
.pp-skip { font-size: var(--step--1); }

/* the long cream sheet the partners sit on */
.pp-sheet { --sheet-px: clamp(22px, 3.2vw, 46px); background: var(--cream); color: var(--ink); border-radius: var(--radius); padding: clamp(24px, 3.4vw, 48px) var(--sheet-px); }
.pp-group + .pp-group { margin-top: var(--s3); padding-top: var(--s3); border-top: 1px solid var(--rule); }
.pp-group-h { font-size: var(--step-2); color: var(--ink); }

.pp-step { padding-block: var(--s3); }
.pp-step + .pp-step { border-top: 1px solid var(--rule); }
/* the name, then what they do on the same baseline in a lighter voice */
.pp-head { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 1rem; row-gap: .35rem; }
.pp-what { font-size: var(--step--1); font-weight: 600; color: #5a4520; letter-spacing: .01em; }
.pp-head .pp-what { font-size: var(--step-0); font-weight: 450; letter-spacing: 0; }
.pp-name { font-size: var(--step-4); line-height: 1; letter-spacing: -.012em; color: var(--ink-now, var(--ink)); }
.pp-name span { display: inline-block; }
.pp-words { margin-top: 1.15rem; max-width: 34em; }
.pp-words p { font-size: var(--step-1); line-height: 1.55; color: var(--ink-now, var(--ink)); }
.pp-words p + p { margin-top: .8em; }
/* British style: an opening mark on every paragraph, the closing mark on the last; neither hangs */
.pp-words blockquote p::before { content: '“'; }
.pp-words blockquote p:last-child::after { content: '”'; }
.pp-words figcaption { margin-top: .6rem; font: 600 var(--step--1)/1.3 var(--sans); color: #5a4520; }
.pp-words-ours p { color: var(--ink-now, #3d2e14); }
.pp-go { margin-top: 1.15rem; display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.4rem; }
.pp-step a, .pp-step { scroll-margin-top: calc(var(--bar-h) + 24px); }
.pp-url { font-weight: 600; font-size: var(--step-0); padding-block: .35rem; }
.pp-logo { height: auto; mix-blend-mode: multiply; opacity: .9; }

/* ------------------------------------------------------------------ the drawing */
.pp-figure { position: relative; height: 100%; }
.pb { position: absolute; left: 0; top: clamp(16px, 3vh, 36px); width: 100%; height: calc(100% - 2 * clamp(16px, 3vh, 36px)); overflow: visible; }
.pb-trail path { fill: none; stroke-linecap: round; }
.pb-trail-bed { stroke: rgba(58, 42, 18, .1); stroke-width: 70; }
.pb-trail-tread { stroke: rgba(58, 42, 18, .45); stroke-width: 3; stroke-dasharray: 2 11; }
.pb-trail { opacity: 0; }
.pp:not(.is-live) .pt-xray { display: none; }
.pb-labels path { fill: none; stroke: var(--teal-ink); stroke-width: 2; }
.pb-labels circle { fill: var(--cream); stroke: var(--teal-ink); stroke-width: 4; }
.pb-labels text { font: 650 30px/1 var(--sans); fill: var(--ink); text-anchor: end; }

/* live: JS has prepared the parts */
.pp.is-live .pb-labels { display: none; }
.pp.is-live .pb-trail { opacity: var(--rest, 0); }
.pp.is-live .pb-trail-bed { stroke-dasharray: 1 1; stroke-dashoffset: calc(1 - var(--rest, 0)); }
.pp.is-live .pb-bike, .pp.is-live .pb-hotspots { transform-box: view-box; transform-origin: 300px 520px;
  transform: rotate(calc(var(--rest, 0) * -7deg)) scale(calc(1 - var(--rest, 0) * .06)); }
/* steps out of focus soften but stay readable: the text eases from ink to a brown that still passes 4.5:1 on cream */
.pp.is-live .pp-step { --ink-now: color-mix(in srgb, var(--ink) calc(var(--on, 0) * 100%), #6b5a3e); }
.pp.is-live .pp-step:focus-within { --ink-now: var(--ink); }
.pp.is-live .pp-logo { opacity: calc(.45 + .45 * var(--on, 0)); }

/* the active partner's name, kept at the top of the column while its long words are still being read */
/* tucked 10px under the header, which rises 8px as it slims, so no sliver of page shows between them */
.pp-now { position: sticky; top: calc(var(--bar-h) - 10px); height: 0; z-index: 2; margin-inline: calc(var(--sheet-px) * -1); pointer-events: none; }
.pp-now-in { position: absolute; left: 0; right: 0; top: 0; padding: calc(.7rem + 10px) var(--sheet-px) .75rem; background: var(--cream);
  border-bottom: 1px solid var(--rule); font: 700 var(--step-2)/1.1 var(--display); color: var(--ink);
  opacity: var(--now, 0); transform: translateY(calc((1 - var(--now, 0)) * -8px)); }
.pp:not(.is-live) .pp-now { display: none; }

/* the leader from the picked-out part to the partner's name */
.pp-leader { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; overflow: visible; opacity: 0; }
.pp-leader path { fill: none; stroke: var(--teal-ink); stroke-width: 1.5; }
.pp-leader circle { fill: var(--cream); stroke: var(--teal-ink); stroke-width: 2.5; }
.pp-leader .pp-leader-end { fill: var(--teal-ink); stroke: none; }

/* ------------------------------------------------------------------ after the partners */
.pp-charities, .pp-index { margin-top: var(--s3); }
.pp-charities-in, .pp-index-in { max-width: 72rem; }
.pp-charities-lede, .pp-index-lede { margin-top: .7rem; max-width: 60ch; }
.pp-charity-list { margin-top: var(--s2); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s2) clamp(24px, 3vw, 48px); }
.pp-charity { border-top: 2px solid var(--ink); padding-top: 1rem; }
.pp-charity-name { font-size: var(--step-2); }
.pp-charity .pp-what { margin-top: .35rem; }
.pp-charity .pp-words { margin-top: .8rem; }
.pp-charity .pp-words p { font-size: var(--step-0); line-height: 1.6; }
.pp-charity .pp-go { margin-top: .8rem; }

.pp-index-cols { margin-top: var(--s2); display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--s2) clamp(24px, 3vw, 48px); align-items: start; }
.pp-index-h { font-size: var(--step-1); padding-bottom: .5rem; border-bottom: 2px solid var(--ink); }
.pp-index-list li { padding-block: .55rem; border-bottom: 1px solid var(--rule); display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .1rem 1rem; }
.pp-index-list a { font-weight: 600; }
.pp-index-what { font-size: var(--step--1); color: #5a4520; text-align: right; }
.pp-work { margin-top: var(--s2); padding-top: var(--s1); border-top: 1px solid var(--rule); max-width: 60ch; }

@media (max-width: 1100px) {
  .pp-index-cols { grid-template-columns: 1fr 1fr; }
  .pp-index-cols > :first-child { grid-column: 1 / -1; }
  .pp-charity-list { grid-template-columns: 1fr; max-width: 40rem; }
}

/* ------------------------------------------------------------------ phones and narrow tablets:
   the bike lies on its side in a band pinned under the header, and the partners scroll beneath it */
@media (max-width: 899px) {
  .pp.is-live { --band-h: calc((100vw - 28px) * .6 + 18px); --bike-long: calc(100vw - 28px); }
  /* flex, not grid: a sticky grid item only sticks inside its own row */
  .pp-grid { display: flex; flex-direction: column; align-items: stretch; }
  .pp-stage { order: -1; position: relative; top: auto; height: auto; }
  .pp-figure { padding-top: calc(var(--bar-h) + 24px); }
  .pp:not(.is-live) .pb { position: static; width: 100%; height: auto; max-height: 76svh; }
  .pp-intro { padding-top: var(--s2); }

  .pp.is-live .pp-stage { position: sticky; top: var(--bar-h); margin-top: var(--bar-h); z-index: 2; height: var(--band-h); margin-inline: calc(var(--gutter) * -1);
    background: var(--cream); border-bottom: 1px solid var(--rule); }
  /* cover the strip above the band, so nothing shows between it and the header as the header slims */
  .pp.is-live .pp-stage::before { content: ''; position: absolute; left: 0; right: 0; bottom: 100%; height: var(--bar-h); background: var(--cream); }
  .pp.is-live .pp-figure { position: absolute; inset: 0; padding: 0; display: block; overflow: hidden; }
  .pp.is-live .pp-zoom { position: absolute; inset: 0; transform-origin: 50% 50%; will-change: transform; }
  .pp.is-live .pp-now { display: block; top: calc(var(--bar-h) + var(--band-h)); z-index: 3; }
  .pp-now-in { padding: .65rem var(--sheet-px); padding-left: max(var(--sheet-px), env(safe-area-inset-left)); padding-right: max(var(--sheet-px), env(safe-area-inset-right)); font-size: 22px; transform: none; }
  .pp.is-live .pb { position: absolute; left: 50%; top: 50%; width: auto; height: var(--bike-long); max-width: none;
    transform: translate(-50%, -50%) rotate(90deg); }
  .pp.is-live .pp-intro { padding-top: var(--s2); }
  .pp.is-live .pp-sheet { border-radius: 0; margin-inline: calc(var(--gutter) * -1); padding-inline: max(var(--sheet-px), env(safe-area-inset-left), env(safe-area-inset-right)); }
  .pp-step { padding-block: var(--s2); }
  .pp.is-live .pp-step, .pp.is-live .pp-step a { scroll-margin-top: calc(var(--bar-h) + var(--band-h) + 56px); }
  .pp-name { font-size: var(--step-3); }
  .pp-words p { font-size: var(--step-0); line-height: 1.6; }
  .pp-index-cols { grid-template-columns: 1fr; }
  .pp-index-cols > :first-child { grid-column: auto; }
  .pp-url, .pp-index-list a, .pp-skip { display: inline-flex; align-items: center; min-height: 44px; }
}

/* A landscape phone must leave room below the pinned artwork to read the partner. */
@media (max-width: 899px) and (max-height: 500px) and (orientation: landscape) {
  .pp.is-live { --band-h: min(128px, 32svh); --bike-long: calc((var(--band-h) - 18px) / .6); }
}

/* Real product cutouts sit in their own space beside the illustrated kit. */
.pp-products { display: none; }
.pp-product-static { width: min(260px, 75%); margin: 24px auto 12px; }
.pp-product-static img { width: 100%; max-height: 240px; object-fit: contain; }
.pp-product-static figcaption, .pp-product-float figcaption { margin-top: 12px; font-size: 16px; line-height: 1.35; color: var(--ink); text-align: center; }
.pp.is-live .pp-product-static { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); margin: 0; }
.pp.is-live .has-products .pp-figure { width: 62%; margin-left: auto; }
.pp.is-live .pp-products { display: block; position: absolute; left: 0; top: 28%; width: 37%; height: 44%; pointer-events: none; z-index: 4; }
.pp-product-float { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 0; opacity: 0; visibility: hidden; }
.pp-product-float img { display: block; width: 100%; height: 0; min-height: 0; flex: 1 1 0; max-height: 290px; object-fit: contain; }
.pp-product-float figcaption { width: 100%; flex: none; font-weight: 600; }
@media (max-width: 899px) {
  .pp.is-live:has(.has-products) { --band-h: calc((100vw - 28px) * .42 + 18px); --bike-long: calc((100vw - 28px) * .6); }
  .pp.is-live .has-products .pp-figure { inset: 0 auto 0 0; width: 61%; margin-left: 0; }
  .pp.is-live .pp-products { left: auto; right: 12px; top: 12px; bottom: 12px; width: 34%; height: auto; }
  .pp-product-float figcaption { font-size: 16px; margin-top: 6px; }
}
@media (max-width: 899px) and (max-height: 500px) and (orientation: landscape) {
  .pp.is-live:has(.has-products) { --band-h: min(128px, 32svh); --bike-long: calc((var(--band-h) - 18px) / .6); }
  .pp.is-live .pp-products { width: 30%; right: 8%; }
  .pp-product-float img { height: 100%; }
  .pp-product-float figcaption { display: none; }
}
@media print { .pp-products { display: none !important; } .pp.is-live .pp-product-static { position: static; width: min(260px, 75%); height: auto; overflow: visible; clip-path: none; margin: 24px auto 12px; } }


/* The photograph shares the SVG coordinate space; old part geometry remains an invisible map. */
.pp .pb-art { opacity: 0; pointer-events: none; }
.pp .pb-shadow, .pp .pb-trail { display: none; }
.pb-real { opacity: var(--rider-base, 1); pointer-events: none; }
.pb-focus-mask { mask-type: alpha; }
.pb-real-focus { opacity: 0; pointer-events: none; }
.pb-hotspot .pb-hit { fill: transparent; stroke: transparent; stroke-width: 8px; vector-effect: non-scaling-stroke; }
.pb-hotspot:focus-visible { outline: none; }
.pb-hotspot-ring { fill: none; stroke: transparent; stroke-width: 3px; vector-effect: non-scaling-stroke; pointer-events: none; }
.pb-hotspot:focus-visible .pb-hotspot-ring { stroke: var(--focus); stroke-width: 3px; fill: color-mix(in srgb, var(--teal) 15%, transparent); }
@media (hover: hover) and (pointer: fine) {
  .pb-hotspot:hover .pb-hotspot-ring { stroke: var(--teal-ink); stroke-width: 2px; }
}
.pp-product-note { margin-top: .75rem; max-width: 38em; color: var(--ink); font-size: var(--step--1); line-height: 1.45; }

@media (prefers-reduced-motion: reduce) {
  .pp.is-live .pb-bike, .pp.is-live .pb-hotspots { transform: none; }
}
