/* =========================================================================
   BeWell Studio and the gateway at /  (loaded only on those pages, build.js LAYOUTS)
   Same brand tokens as the rest of the site (main.css :root), so Studio reads
   as a sibling of BeWell Medical, not as another company.
   ========================================================================= */
:root {
  --slate: #4e5c66;          /* body text on white: 6.9:1 */
  --green-light: #8ed8cc;    /* decorative only, never text */
  --sk: #e6eaee;             /* skeleton lines */
}

/* ======================================================================
   GATEWAY  /
   ====================================================================== */
/* White ground with the same aurora as BeWell Medical (enhance.css body::before). */
body.page-gateway { background: #fff; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.page-gateway main { flex: 1 0 auto; display: flex; flex-direction: column; justify-content: center; }

.gw-header { padding-block: 40px 8px; }
.gw-header-inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; }
.gw-logo { grid-column: 2; display: block; border-radius: 8px; transform-origin: 50% 50%; }
.gw-logo img { display: block; height: clamp(52px, 4.4vw, 68px); width: auto; }
.gw-logo:focus-visible { outline: 2px solid var(--primary-dark); outline-offset: 6px; }
.gw-header .lang-switch { grid-column: 3; justify-self: end; }

/* the two units: an icon on a white tile, the name, one line. Nothing else. */
.gw { padding-block: 40px 96px; }
.gw-title { margin: 0 0 clamp(36px, 5vw, 64px); text-align: center; }
.gw-welcome { display: block; font-size: clamp(36px, 3.4vw, 56px); font-weight: 500; line-height: 1.1; letter-spacing: -.025em; color: var(--neutral-800); }
/* Two picture cards. The whole card is the link (the tile marks the unit, the button says what a click does). */
.gw-tiles { display: flex; justify-content: center; align-items: stretch; gap: clamp(20px, 2.4vw, 40px); width: min(100%, 1080px); margin-inline: auto; }
.gw-choice { display: flex; flex: 1 1 0; min-width: 0; }
.gw-tile {
  position: relative; isolation: isolate; flex: 1; display: flex; flex-direction: column; justify-content: flex-end;
  min-height: clamp(360px, 29vw, 440px); border-radius: 28px; overflow: hidden;
  background: var(--neutral-800); color: #fff; text-align: left; text-decoration: none; cursor: pointer;
  transition: transform .45s var(--ease-out), box-shadow .45s var(--ease-out);
}
.gw-tile:hover, .gw-tile:focus-visible { text-decoration: none; transform: translateY(-8px); box-shadow: 0 30px 60px -26px rgba(47, 52, 64, .6); }
.gw-tile:active { transform: translateY(-3px); transition-duration: .1s; }
.gw-tile:focus-visible { outline: 3px solid var(--primary-dark); outline-offset: 5px; }
/* the picture is the card's background; a neutral scrim keeps the white type readable on any part of it */
.gw-bg { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--ease-out); }
.gw-tile--medical .gw-bg { object-position: 50% 18%; }
.gw-tile::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgba(47, 52, 64, .92) 0%, rgba(47, 52, 64, .78) 34%, rgba(47, 52, 64, .12) 66%, rgba(47, 52, 64, 0) 100%); }
.gw-tile:hover .gw-bg, .gw-tile:focus-visible .gw-bg { transform: scale(1.05); }
.gw-front { display: flex; flex-direction: column; align-items: flex-start; padding: clamp(24px, 2.4vw, 40px); }
/* Material Symbols icon on a white tile in the bottom-right corner, level with the button; it keeps its colours on hover */
.gw-icon {
  --gw-ic: clamp(64px, 4.6vw, 84px);
  position: absolute; right: clamp(24px, 2.4vw, 40px); bottom: clamp(24px, 2.4vw, 40px);
  display: grid; place-items: center; width: var(--gw-ic); height: var(--gw-ic); border-radius: calc(var(--gw-ic) * .27);
  background: #fff; color: var(--neutral-800);
  transition: transform .4s var(--ease-out);
}
.gw-icon .unit-ic { width: calc(var(--gw-ic) * .5); height: calc(var(--gw-ic) * .5); }
.gw-tile:hover .gw-icon, .gw-tile:focus-visible .gw-icon { transform: translateY(-4px); }
.gw-name { margin: 0; font-size: clamp(30px, 2.5vw, 42px); font-weight: 500; line-height: 1.1; letter-spacing: -.02em; color: #fff; }
.gw-text { margin: 8px 0 0; font-size: clamp(17px, 1.2vw, 20px); color: #fff; }
/* the button face: only this inverts when the card is pointed at */
.gw-go {
  display: inline-flex; align-items: center; gap: 12px; min-height: 52px; margin-top: 14px; padding: 0 22px 0 26px;
  border-radius: 999px; background: var(--primary-medium); color: var(--neutral-800); font-size: 17px; font-weight: 500;
  transition: background-color .25s ease, color .25s ease;
}
.gw-arrow { flex: none; transition: transform .35s var(--ease-out); }
.gw-tile:hover .gw-go, .gw-tile:focus-visible .gw-go { background: #fff; color: var(--primary-dark); }
.gw-tile:hover .gw-arrow, .gw-tile:focus-visible .gw-arrow { transform: translateX(6px); }
/* the unit chosen last time (main.js "units"): a small chip on the picture, never a redirect */
.gw-last { display: none; }
.gw-tile.is-last .gw-last { display: block; position: absolute; top: 18px; right: 18px; padding: 6px 14px; border-radius: 999px; background: #fff; font-size: 14px; font-weight: 600; color: var(--primary-dark); }

/* ---- gateway intro: gateway-header.html sets html.gw-intro on every load ----
   The logo draws itself in the middle of the screen, rises into the header, the
   aurora comes up behind it and the two units follow. The logo's resting centre is
   60px from the top (40px padding + half its 40px height), so it starts 50vh - 60px lower. */
html.gw-intro .gw-logo { animation: gw-logo-rise 1.1s cubic-bezier(.76, 0, .24, 1) 1s both; }
html.gw-intro .gw-logo img { animation: gw-logo-draw .9s cubic-bezier(.65, 0, .35, 1) .15s both; }
html.gw-intro body.page-gateway::before { animation: gw-fade 1.6s ease 1.15s both; }
html.gw-intro .gw-welcome { animation: gw-rise 1s cubic-bezier(.16, 1, .3, 1) 1.5s both; }
html.gw-intro .gw-choice { animation: gw-rise 1s cubic-bezier(.16, 1, .3, 1) 1.6s both; }
html.gw-intro .gw-choice + .gw-choice { animation-delay: 1.72s; }
html.gw-intro .gw-header .lang-switch { animation: gw-fade .8s ease 1.9s both; }
@keyframes gw-logo-rise {
  from { transform: translateY(calc(50vh - 60px)) scale(var(--gw-logo-scale, 2)); transform: translateY(calc(50dvh - 60px)) scale(var(--gw-logo-scale, 2)); }
}
@keyframes gw-logo-draw { from { clip-path: inset(-10% 100% -10% 0); } to { clip-path: inset(-10% 0 -10% 0); } }
@keyframes gw-fade { from { opacity: 0; } }
@keyframes gw-rise { from { opacity: 0; transform: translateY(32px); } }

/* Tablet and phone: below 900px two cards side by side are too narrow for the button and the icon tile together,
   so the cards stack (a card side by side needs about 400px). */
@media (max-width: 900px) {
  .gw-tiles { flex-direction: column; align-items: stretch; width: min(100%, 640px); gap: 20px; }
  .gw-tile { min-height: 360px; }
}
/* Phone: shorter cards, so both unit names stay above the cookie banner on a 390x844 screen */
@media (max-width: 760px) {
  .gw { padding-block: 32px 56px; }
  .gw-title { margin-bottom: 24px; }
  .gw-tiles { gap: 16px; }
  .gw-tile { min-height: 280px; }
  .gw-icon { --gw-ic: 56px; right: 24px; bottom: 24px; }
  .gw-go { font-size: 16px; padding: 0 18px 0 20px; gap: 10px; }
  html.gw-intro .gw-logo { --gw-logo-scale: 1.6; }
}

/* ======================================================================
   STUDIO HEADER  (src/partials/studio-header.html; the rest is the site header)
   ====================================================================== */
/* the logo and the unit toggle (enhance.css "BeWell units") sit exactly as on BeWell Medical */
.logo--studio { display: inline-flex; align-items: center; text-decoration: none; }
.logo--studio:hover { text-decoration: none; }
.logo--studio:focus-visible { outline: 2px solid var(--primary-dark); outline-offset: 4px; border-radius: 8px; }

/* ======================================================================
   STUDIO PAGES
   ====================================================================== */
.studio-hero .display { max-width: 18ch; }

/* ---- product grid: product cards, placeholder cards, the CTA card ---- */
.sp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.sp-card {
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border: 1px solid rgba(47, 52, 64, .1); border-radius: var(--radius);
}
.sp-scene { background: var(--neutral-50); border-bottom: 1px solid rgba(47, 52, 64, .06); }
.sp-scene .agent { display: block; width: 100%; height: auto; }
.sp-body { display: flex; flex-direction: column; align-items: flex-start; padding: 24px 28px 28px; }
/* the launch tag under the hero text on /studio */
.studio-soon {
  display: inline-block; margin-top: 28px; padding: 6px 16px; border-radius: 999px;
  background: var(--primary-light); color: var(--primary-dark);
  font-size: var(--fs-small); font-weight: 600; line-height: 1.5;
}
.sp-status {
  display: inline-block; padding: 3px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 600; line-height: 1.6; white-space: nowrap;
}
.sp-status--in-development { background: var(--neutral-50); color: var(--slate); }
.sp-status--pilot { background: #fff1d6; color: #8a5a00; }
.sp-status--live { background: var(--primary-light); color: var(--primary-dark); }

/* skeleton text of a product in development */
.sp-skel { align-self: stretch; }
.sk {
  display: block; height: 12px; margin-top: 12px; border-radius: 6px;
  background: linear-gradient(90deg, var(--sk) 0%, #f3f5f7 50%, var(--sk) 100%) 0 0 / 200% 100%;
}
.sk-title { height: 22px; width: 62%; margin-top: 20px; margin-bottom: 4px; }
.sk-short { width: 45%; }

/* a live or pilot product: the whole card is the link */
.sp-link {
  display: flex; flex-direction: column; flex: 1; color: var(--neutral-800); text-decoration: none;
  border: 2px solid transparent; border-radius: inherit; margin: -1px;
  transition: transform .3s var(--ease-out), border-color .2s ease;
}
.sp-card:has(.sp-link) { transition: transform .3s var(--ease-out); }
.sp-link:hover, .sp-link:focus-visible { text-decoration: none; border-color: var(--primary); }
.sp-card:has(.sp-link:hover), .sp-card:has(.sp-link:focus-visible) { transform: translateY(-4px); }
.sp-link:focus-visible { outline: 3px solid var(--primary-dark); outline-offset: 4px; }
.sp-icon {
  display: grid; place-items: center; width: 56px; height: 56px; margin: 28px 28px 0;
  border-radius: 16px; background: var(--primary-light); color: var(--primary-dark);
}
.sp-icon .ic { width: 30px; height: 30px; }
.sp-name { margin-top: 16px; font-size: var(--fs-h4); font-weight: 500; }
.sp-tagline { display: block; margin-top: 6px; font-weight: 600; font-size: var(--fs-small); }
.sp-summary { display: block; margin-top: 10px; font-size: var(--fs-small); color: var(--slate); }

/* "Got an idea?": Dark Blue with white text (12:1), so it never reads as a product */
.sp-cta {
  grid-column: span var(--span-lg, 1); container-type: inline-size;
  position: relative; overflow: hidden; isolation: isolate;
  border-radius: var(--radius); background: var(--neutral-800); color: #fff;
}
.sp-cta::before {
  content: ""; position: absolute; z-index: -1; inset: 0;
  background:
    radial-gradient(45% 120% at 100% 0%, rgba(46, 178, 157, .42), transparent 70%),
    radial-gradient(35% 90% at 0% 100%, rgba(109, 201, 186, .18), transparent 70%);
}
.sp-cta-in { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 28px; height: 100%; padding: 40px 44px; }
.sp-cta-ic {
  display: grid; place-items: center; width: 80px; height: 80px; border-radius: 22px;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14);
}
.sp-cta-ic .unit-ic { width: 52px; height: 52px; }
.sp-cta-ic { color: #fff; }
.sp-cta h3 { font-size: clamp(24px, 2.4vw, 30px); font-weight: 500; line-height: 1.2; }
.sp-cta p { margin-top: 8px; color: #cfd6db; }
@container (max-width: 640px) {
  .sp-cta-in { grid-template-columns: minmax(0, 1fr); justify-items: start; gap: 20px; padding: 32px 28px; }
}

@media (max-width: 1000px) {
  .sp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sp-cta { grid-column: span var(--span-md, 1); }
}
@media (max-width: 640px) {
  .sp-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .sp-cta { grid-column: auto; }
}

/* ---- the agent (build.js agentScene): a robot building the placeholder card ---- */
.agent .ag-l { fill: none; stroke: var(--neutral-800); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.agent .ag-a { fill: none; stroke: var(--primary); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.agent .ag-w { fill: #fff; }
.agent .ag-m { fill: var(--primary-light); }
.agent .ag-eyes { stroke-width: 3.5; transform-box: fill-box; transform-origin: center; }
.agent .ag-ground { stroke: #d5dce1; stroke-width: 2; stroke-linecap: round; stroke-dasharray: 2 7; }
.agent .ag-skel { fill: none; stroke: var(--sk); stroke-width: 10; stroke-linecap: round; }
.agent .ag-fill { fill: none; stroke: var(--green-light); stroke-width: 10; stroke-linecap: round; stroke-dasharray: 100 120; }
.agent .ag-track { fill: var(--sk); }
.agent .ag-bar { fill: var(--primary); transform-box: fill-box; transform-origin: 0 50%; }
.agent .ag-arm { transform-box: fill-box; transform-origin: 0 100%; }

/* still pose (also what prefers-reduced-motion shows): mid-task */
.ag-bot--blocks { transform: translate(170px, 8px); }
.agent .ag-carry { transform: translate(150px, 0); }
.ag-bot--type { transform: translate(24px, 48px); }
.agent .ag-fill--1 { stroke-dashoffset: 0; }
.agent .ag-fill--2 { stroke-dashoffset: 45; }
.agent .ag-fill--3 { stroke-dashoffset: 100; opacity: 0; }
.ag-bot--bar { transform: translate(128px, 30px); }
.agent .ag-bar { transform: scaleX(.55); }

@media (prefers-reduced-motion: no-preference) {
  .sp-card--dev { --ease: cubic-bezier(.45, 0, .25, 1); }
  .sk { animation: sk-shimmer 1.8s linear var(--delay, 0s) infinite; }
  .agent .ag-bob { animation: ag-bob 1.7s ease-in-out var(--delay, 0s) infinite alternate; }
  .agent .ag-eyes { animation: ag-blink 4.2s linear var(--delay, 0s) infinite; }

  .ag-bot--blocks { animation: ag-carry-bot var(--dur, 6.4s) var(--ease) var(--delay, 0s) infinite; }
  .agent .ag-carry { animation: ag-carry-block var(--dur, 6.4s) var(--ease) var(--delay, 0s) infinite; }

  .ag-bot--type { animation: ag-rows var(--dur, 6.4s) var(--ease) var(--delay, 0s) infinite; }
  .agent .ag-fill--1 { animation: ag-fill-1 var(--dur, 6.4s) linear var(--delay, 0s) infinite; }
  .agent .ag-fill--2 { animation: ag-fill-2 var(--dur, 6.4s) linear var(--delay, 0s) infinite; }
  .agent .ag-fill--3 { animation: ag-fill-3 var(--dur, 6.4s) linear var(--delay, 0s) infinite; }
  .agent .ag-arm { animation: ag-tap .32s ease-in-out infinite alternate; }

  .ag-bot--bar { animation: ag-drag-bot var(--dur, 6.4s) var(--ease) var(--delay, 0s) infinite; }
  .agent .ag-bar { animation: ag-drag-bar var(--dur, 6.4s) var(--ease) var(--delay, 0s) infinite; }
}
@keyframes sk-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@keyframes ag-bob { from { transform: translateY(0); } to { transform: translateY(-3px); } }
@keyframes ag-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.15); } }
@keyframes ag-tap { from { transform: rotate(-9deg); } to { transform: rotate(5deg); } }
/* blocks: fly over with a block, lower it onto the stack, let go, fly back */
@keyframes ag-carry-bot {
  0%, 4% { transform: translate(20px, 8px); }
  32% { transform: translate(210px, 8px); }
  40%, 48% { transform: translate(210px, 26px); }
  56% { transform: translate(210px, 8px); }
  86%, 100% { transform: translate(20px, 8px); }
}
@keyframes ag-carry-block {
  0% { transform: translate(0, 0); opacity: 0; }
  4% { transform: translate(0, 0); opacity: 1; }
  32% { transform: translate(190px, 0); }
  40% { transform: translate(190px, 18px); }
  88% { transform: translate(190px, 18px); opacity: 1; }
  96% { transform: translate(190px, 18px); opacity: 0; }
  100% { transform: translate(0, 0); opacity: 0; }
}
/* type: fill the three lines one by one, moving down with each */
@keyframes ag-rows {
  0%, 24% { transform: translate(24px, 18px); }
  28%, 49% { transform: translate(24px, 48px); }
  53%, 76% { transform: translate(24px, 78px); }
  84%, 100% { transform: translate(24px, 18px); }
}
@keyframes ag-fill-1 {
  0% { stroke-dashoffset: 100; opacity: 0; } 1% { opacity: 1; }
  24% { stroke-dashoffset: 0; } 88% { stroke-dashoffset: 0; opacity: 1; }
  96% { stroke-dashoffset: 0; opacity: 0; } 100% { stroke-dashoffset: 100; opacity: 0; }
}
@keyframes ag-fill-2 {
  0%, 28% { stroke-dashoffset: 100; opacity: 0; } 29% { stroke-dashoffset: 96; opacity: 1; }
  49% { stroke-dashoffset: 0; } 88% { stroke-dashoffset: 0; opacity: 1; }
  96% { stroke-dashoffset: 0; opacity: 0; } 100% { stroke-dashoffset: 100; opacity: 0; }
}
@keyframes ag-fill-3 {
  0%, 53% { stroke-dashoffset: 100; opacity: 0; } 54% { stroke-dashoffset: 96; opacity: 1; }
  76% { stroke-dashoffset: 0; } 88% { stroke-dashoffset: 0; opacity: 1; }
  96% { stroke-dashoffset: 0; opacity: 0; } 100% { stroke-dashoffset: 100; opacity: 0; }
}
/* bar: drag the progress forward in three tugs, then start over */
@keyframes ag-drag-bot {
  0% { transform: translate(42px, 30px); }
  15%, 22% { transform: translate(78px, 30px); }
  40%, 48% { transform: translate(128px, 30px); }
  70%, 88% { transform: translate(190px, 30px); }
  100% { transform: translate(42px, 30px); }
}
@keyframes ag-drag-bar {
  0% { transform: scaleX(.12); }
  15%, 22% { transform: scaleX(.30); }
  40%, 48% { transform: scaleX(.55); }
  70%, 88% { transform: scaleX(.86); }
  100% { transform: scaleX(.12); }
}

/* ======================================================================
   STUDIO PAGE, BELOW THE HERO (src/pages/studio.html)
   Five compositions, none of them a card row: a staircase (how it works),
   a wall of unequal tiles with BeWell's own pictures (what the factory is built on),
   poster lines that open (who it's for), an inset dark-teal panel (rooted in
   healthcare) and a band per question (FAQ). Flat fills only: no shadows at rest,
   no gradients, no outlines. Motion only under prefers-reduced-motion: no-preference.
   ====================================================================== */
.studio-how h2, .studio-base h2, .studio-who h2 { font-size: var(--fs-h2); font-weight: 500; line-height: 1.1; letter-spacing: -.025em; }
/* the centred section heads use the site's .section-head (enhance.css); the second half of each heading is .tone */
.studio-how .section-head p, .studio-base .section-head p, .studio-who .section-head p { color: var(--neutral-800); }

/* ---- how it works: a centred light-teal head, then one numbered step per line, each starting further right ---- */
.how-head {
  max-width: 880px; margin-bottom: clamp(56px, 6vw, 88px);
  padding: clamp(18px, 2vw, 28px) clamp(20px, 3vw, 40px); border-radius: var(--radius); background: var(--primary-light);
}
.how-head h2 { margin-bottom: 12px; }
/* the staircase is one block, as wide as its widest step plus the offsets, centred on the page */
.how-stairs {
  --stair: clamp(64px, 9vw, 164px);
  list-style: none; margin: 0 auto; padding: 0; display: grid; gap: 48px; counter-reset: step; width: fit-content;
}
.how-stairs li {
  display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: clamp(16px, 1.6vw, 24px); align-items: start;
  max-width: 600px; counter-increment: step;
}
/* the step number: plain text in the page's typeface, set large in teal; the sign-off's in dark teal */
.how-stairs li::before {
  content: counter(step); grid-row: 1 / span 2;
  font-size: clamp(64px, 6vw, 96px); font-weight: 500; line-height: .78; letter-spacing: -.06em;
  font-variant-numeric: tabular-nums; color: var(--primary); min-width: .62em; text-align: right;
}
.how-stairs li.how-last::before { color: var(--primary-dark); }
.how-stairs li:nth-child(2) { margin-left: var(--stair); }
.how-stairs li:nth-child(3) { margin-left: calc(var(--stair) * 2); }
.how-stairs li:nth-child(4) { margin-left: calc(var(--stair) * 3); }
.how-stairs h3 {
  font-size: clamp(26px, 2.8vw, 40px); font-weight: 500; line-height: 1.1; letter-spacing: -.025em;
  color: var(--neutral-800); max-width: none;
}
.how-stairs p { margin-top: 10px; max-width: 44ch; font-size: var(--fs-body); color: var(--neutral-600); }
.how-stairs .how-last h3 { color: var(--primary-dark); }
@media (max-width: 1000px) {
  .how-stairs { gap: 36px; width: auto; }
  .how-stairs li { max-width: none; }
  .how-stairs li:nth-child(2) { margin-left: 5vw; }
  .how-stairs li:nth-child(3) { margin-left: 10vw; }
  .how-stairs li:nth-child(4) { margin-left: 15vw; }
}
@media (max-width: 640px) {
  .how-stairs li { column-gap: 14px; }
  .how-stairs li::before { font-size: 56px; }
  .how-stairs h3 { font-size: 24px; }
  .how-stairs p { font-size: var(--fs-small); }
}

/* ---- what the factory is built on: unequal tiles, each with a real picture or interface ---- */
.studio-base { background: var(--neutral-50); }
.studio-base .section-head { max-width: none; }
.studio-base .section-head p { max-width: none; }
.base-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; }
.base-tile { position: relative; overflow: hidden; border-radius: var(--radius); padding: clamp(28px, 3vw, 44px); background: #fff; }
.base-tile h3 { font-size: var(--fs-h4); font-weight: 500; line-height: 1.2; letter-spacing: -.01em; margin-bottom: 10px; }
.base-tile p { color: var(--neutral-800); }

.base-code { grid-column: 1 / 9; grid-row: 1 / 3; display: flex; flex-direction: column; background: var(--primary-light); padding-bottom: 0; padding-right: 0; }
.base-badge {
  position: absolute; top: clamp(28px, 3vw, 44px); right: clamp(28px, 3vw, 44px);
  width: clamp(88px, 8.5vw, 128px); aspect-ratio: 52.435 / 59.051; background: var(--primary-dark);
  -webkit-mask: url("/static/icons/certified-badge.svg") center / contain no-repeat;
  mask: url("/static/icons/certified-badge.svg") center / contain no-repeat;
}
.base-code .base-text { max-width: 54ch; padding-right: clamp(28px, 3vw, 44px); }
.base-shot { margin: 28px 0 0; display: flex; flex-direction: column; justify-content: flex-end; flex: 1; }
.base-shot figcaption { order: -1; margin-bottom: 14px; font-size: var(--fs-xs); color: var(--neutral-600); }
.base-shot img { display: block; width: 108%; max-width: none; height: auto; }

.base-years { grid-column: 9 / 13; grid-row: 1; background: var(--neutral-800); color: #fff; display: flex; flex-direction: column; justify-content: flex-end; }
.base-figure { font-size: clamp(96px, 10vw, 168px); font-weight: 500; line-height: .85; letter-spacing: -.05em; color: var(--primary); margin-bottom: 18px; font-variant-numeric: tabular-nums; }
.base-tile.base-years h3 { color: #fff; }
.base-tile.base-years p { color: #dfe4e8; }

.base-signoff { grid-column: 9 / 13; grid-row: 2; }
.signoff-ticket { display: grid; gap: 8px; margin-top: 24px; padding: 16px 18px; border-radius: 14px; background: var(--neutral-50); font-size: var(--fs-xs); color: var(--neutral-600); }
.signoff-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.signoff-top b { font-size: var(--fs-small); font-weight: 600; color: var(--neutral-800); }
.signoff-row { display: flex; align-items: center; gap: 10px; }
.signoff-check { display: grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--primary-light); color: var(--primary-dark); }
.signoff-check .ic { width: 14px; height: 14px; }
.signoff-row--ok { font-weight: 600; color: var(--primary-dark); }
.signoff-row--ok .signoff-check { background: var(--primary-dark); color: #fff; }

.base-products { grid-column: 1 / 13; display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(28px, 4vw, 56px); align-items: center; }
.base-products .link-arrow { display: inline-block; margin-top: 16px; font-weight: 600; }
.base-pics { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1.7fr .62fr 1.25fr; gap: 16px; align-items: end; }
.base-pics li { overflow: hidden; border-radius: 16px; background: var(--neutral-50); height: clamp(200px, 19vw, 300px); }
.base-pics img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease-out); }
.base-pics .pic-dash img, .base-pics .pic-app img { object-position: 0 0; }
.base-pics li:hover img { transform: scale(1.04); }

@media (max-width: 1000px) {
  .base-code { grid-column: 1 / -1; grid-row: auto; }
  .base-years { grid-column: 1 / 7; grid-row: auto; }
  .base-signoff { grid-column: 7 / 13; grid-row: auto; }
  .base-products { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .base-grid { gap: 16px; }
  .base-badge { position: static; width: 64px; margin-bottom: 16px; }
  .base-years, .base-signoff { grid-column: 1 / -1; }
  .base-pics { grid-template-columns: 1.1fr 1fr; }
  .base-pics .pic-dash { grid-column: 1 / -1; height: 220px; }
  .base-pics li { height: 200px; }
}

/* ---- who it's for: one group per poster line; a line opens to an example and the action ---- */
.who-lines { display: grid; gap: 4px; }
.who-line { border-radius: var(--radius); transition: background-color .3s ease; }
.who-line[open] { background: var(--primary-light); }
.who-line[open] + .who-line { margin-top: 40px; }
.who-line summary {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 26ch) auto; align-items: center; gap: 12px 32px;
  padding: 14px 24px; border-radius: var(--radius); list-style: none; cursor: pointer;
}
.who-line summary::-webkit-details-marker { display: none; }
.who-line summary:focus-visible { outline: 3px solid var(--primary-dark); outline-offset: 2px; }
.who-line:not([open]) summary:hover { background: var(--neutral-50); }
.who-line h3 {
  font-size: clamp(26px, 2.8vw, 40px); font-weight: 500; line-height: 1; letter-spacing: -.035em; color: var(--neutral-800);
  transition: color .25s ease;
}
.who-line summary:hover h3, .who-line[open] h3 { color: var(--primary-dark); }
.who-detail { font-size: var(--fs-body); color: var(--neutral-600); text-align: right; }
.who-toggle { position: relative; display: block; width: 48px; height: 48px; border-radius: 50%; background: var(--neutral-50); transition: background-color .25s ease, transform .35s var(--ease-out); }
.who-toggle::before, .who-toggle::after { content: ""; position: absolute; left: 50%; top: 50%; width: 18px; height: 2.5px; margin: -1.25px 0 0 -9px; border-radius: 2px; background: var(--neutral-800); }
.who-toggle::after { transform: rotate(90deg); }
.who-line summary:hover .who-toggle { background: var(--primary-light); }
.who-line[open] .who-toggle { background: var(--primary-dark); transform: rotate(45deg); }
.who-line[open] .who-toggle::before, .who-line[open] .who-toggle::after { background: #fff; }
.who-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 20px 40px; padding: 4px 24px 0; overflow: hidden; border-radius: 0 0 var(--radius) var(--radius); }
.who-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; padding-bottom: 28px; }
.who-copy p { max-width: 62ch; font-size: var(--fs-body); color: var(--neutral-800); }
/* the characters: the sheets' white ground is multiplied into the light-teal of the open line */
.who-mascots { display: flex; align-items: flex-end; justify-content: flex-end; }
.who-mascots img { display: block; width: auto; height: clamp(120px, 11vw, 170px); mix-blend-mode: multiply; }
.who-mascots--4 img { height: clamp(108px, 9.5vw, 150px); }
.who-mascots--4 img + img { margin-left: -14px; }
.who-body b { font-weight: 600; }
/* group names are never split inside a word; below 1000px the name gets the full width */
.who-line h3 { overflow-wrap: normal; hyphens: manual; }
@media (max-width: 1000px) {
  .who-line summary { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 16px; padding: 16px 20px; }
  .who-line h3 { grid-column: 1 / -1; font-size: clamp(24px, 5vw, 34px); line-height: 1.1; }
  .who-toggle { grid-column: 2; grid-row: 2; width: 44px; height: 44px; }
  .who-detail { grid-column: 1; text-align: left; font-size: var(--fs-small); }
  .who-body { padding: 0 20px 0; }
}
@media (max-width: 560px) {
  .who-line summary { padding: 16px; }
  .who-body { grid-template-columns: minmax(0, 1fr); padding: 0 16px 0; gap: 0; }
  .who-mascots { justify-content: center; }
  .who-mascots img, .who-mascots--4 img { height: 112px; }
  .who-mascots--4 img { height: 92px; }
}

/* ---- rooted in healthcare: an inset dark-teal panel, the team in an arch cropped by its bottom edge ---- */
.roots-panel {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); grid-template-areas: "title side" "photo side";
  column-gap: clamp(32px, 5vw, 80px);
  padding: clamp(32px, 4.5vw, 64px) clamp(28px, 4.5vw, 64px) 0; border-radius: var(--radius);
  background: var(--primary-dark); color: #fff; overflow: hidden;
}
.roots-title { grid-area: title; font-size: var(--fs-h2); font-weight: 500; line-height: 1.1; letter-spacing: -.025em; color: #fff; }
.roots-photo { grid-area: photo; align-self: end; margin: clamp(32px, 4vw, 56px) 0 0; aspect-ratio: 4 / 3; border-radius: 999px 999px 0 0; overflow: hidden; background: #065f57; }
.roots-photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 62%; }
.roots-side { grid-area: side; display: flex; flex-direction: column; align-items: flex-start; gap: 36px; padding: 8px 0 clamp(32px, 4.5vw, 64px); }
.roots-side h3 { font-size: var(--fs-h4); font-weight: 500; line-height: 1.2; color: #fff; margin-bottom: 10px; }
.roots-side p { color: #fff; }
.roots-side .btn { background: #fff; color: var(--primary-dark); }
.roots-side .btn:hover, .roots-side .btn:focus-visible { background: var(--primary-medium); color: var(--neutral-800); }
.roots-side .btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
@media (max-width: 900px) {
  .roots-panel { grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "side" "photo"; row-gap: 28px; }
  .roots-side { padding-bottom: 0; gap: 28px; }
  .roots-photo { margin-top: 8px; }
}

/* ---- motion: the one shutter (the certified-code picture), and a slow settle on the team photo ---- */
@media (prefers-reduced-motion: no-preference) {
  html.js .base-code .shutter { clip-path: inset(0 0 0 100%); transform: scale(1.12); transform-origin: 0 100%; transition: clip-path .9s var(--ease-out) .1s, transform 1.2s var(--ease-out) .1s; }
  html.js .base-code.is-in .shutter { clip-path: inset(0 0 0 0); transform: none; }
  html.js .roots-photo img { transform: scale(1.08); transition: transform 1.8s var(--ease-out) .2s; }
  html.js .roots-photo.is-in img { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .who-line, .who-line h3, .who-toggle, .base-pics img { transition: none; }
  .base-pics li:hover img { transform: none; }
}

/* ---- submit your idea (the site's contact card and form) ---- */
.contact-copy .contact-title { font-size: var(--fs-h3); margin-bottom: 16px; }
.field-optional { font-weight: 400; font-size: var(--fs-xs); color: var(--slate); }

/* ---- product page template (/studio/<slug>) ---- */
.sp-hero .sp-hero-icon {
  display: grid; place-items: center; width: 80px; height: 80px; margin: 0 auto 20px;
  border-radius: 22px; background: var(--primary-light); color: var(--primary-dark);
}
.sp-hero .sp-hero-icon .ic { width: 44px; height: 44px; }
.sp-hero .sp-status { margin-bottom: 16px; }
.sp-detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.sp-detail-grid > div { padding: 32px; border-radius: var(--radius); background: var(--neutral-50); }
.sp-detail-grid h2 { font-size: var(--fs-h4); margin-bottom: 12px; }
.sp-detail-grid p { color: var(--neutral-600); font-size: var(--fs-small); }
.sp-detail-grid p + p { margin-top: 12px; }
.sp-list { list-style: disc; padding-left: 20px; color: var(--neutral-600); font-size: var(--fs-small); }
.sp-list li + li { margin-top: 6px; }
@media (max-width: 1000px) { .sp-detail-grid { grid-template-columns: minmax(0, 1fr); } }

@media (prefers-reduced-motion: reduce) {
  .gw-tile, .gw-bg, .gw-icon, .gw-arrow, .sp-link, .sp-card { transition: none; }
  .gw-tile:hover, .gw-tile:focus-visible, .gw-tile:hover .gw-bg, .gw-tile:focus-visible .gw-bg, .gw-tile:hover .gw-arrow, .gw-tile:focus-visible .gw-arrow,
  .gw-tile:hover .gw-icon, .gw-tile:focus-visible .gw-icon,
  .sp-card:has(.sp-link:hover), .sp-card:has(.sp-link:focus-visible) { transform: none; }
  /* the gateway intro keeps its order but loses the travel: everything simply fades in */
  html.gw-intro .gw-logo, html.gw-intro .gw-logo img { animation: none; }
  html.gw-intro .gw-welcome, html.gw-intro .gw-choice, html.gw-intro .gw-choice + .gw-choice { animation: gw-fade .5s ease .1s both; }
  html.gw-intro body.page-gateway::before, html.gw-intro .gw-header .lang-switch { animation-delay: 0s; animation-duration: .5s; }
}

/* ======================================================================
   STUDIO HERO: the blueprint with the factory's steps as tickets
   ====================================================================== */
.studio-hero .eyebrow { display: inline-block; margin-bottom: 20px; }
.studio-hero { padding-bottom: clamp(56px, 7vw, 96px); }
.studio-hero .studio-soon { margin-top: 24px; }
.studio-stage { margin-top: 56px; }
.studio-stage .hero-shape-2 { background: var(--neutral-800); }
.studio-stage .hero-photo { object-position: 50% 50%; }

/* the dotted line the work follows, from ticket to ticket */
.flow-lines { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; overflow: visible; }
.flow-lines path {
  fill: none; stroke: #fff; stroke-width: 4.5; stroke-linecap: round; stroke-dasharray: .1 13;
  vector-effect: non-scaling-stroke; animation: flow-dash 1.6s linear infinite;
}
@keyframes flow-dash { to { stroke-dashoffset: -13.1; } }

.agent-flow { list-style: none; margin: 0; padding: 0; }
.ticket {
  position: absolute; z-index: 2; left: var(--x); top: var(--y); translate: -50% -50%;
  width: clamp(150px, 17%, 210px); padding: 12px 14px 14px; border-radius: 14px;
  background: rgba(255, 255, 255, .96); box-shadow: 0 14px 34px rgba(47, 52, 64, .22);
  font-size: var(--fs-xs); line-height: 1.4; color: var(--neutral-600);
}
.ticket b { display: block; margin-bottom: 2px; font-size: var(--fs-small); font-weight: 600; color: var(--neutral-800); }
.ticket-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.ticket-id { font-size: 11px; font-weight: 600; letter-spacing: .06em; color: var(--neutral-500, #6d7683); font-variant-numeric: tabular-nums; }
.ticket-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600; background: var(--primary-light); color: var(--primary-dark);
}
.ticket-chip--you { background: transparent; box-shadow: inset 0 0 0 1px var(--primary-medium); }
.ticket-chip--human { background: var(--neutral-800); color: #fff; }
.ticket-chip--agent::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--primary);
  animation: agent-pulse 1.8s ease-in-out infinite;
}
@keyframes agent-pulse { 50% { opacity: .25; } }
html.js .ticket { animation: ticket-in .7s var(--ease-out) both; animation-delay: calc(.5s + var(--i) * .18s); }
@keyframes ticket-in { from { opacity: 0; transform: translateY(14px); } }

/* narrow screens: the picture stays whole, the tickets become a dotted list below it */
@media (max-width: 900px) {
  .studio-stage { aspect-ratio: auto; margin-top: 40px; }
  .studio-stage .hero-shape, .flow-lines { display: none; }
  .studio-stage .hero-frame { position: relative; inset: auto; left: auto; aspect-ratio: 16 / 9; border-radius: 64px 0; }
  .agent-flow { position: relative; display: grid; gap: 12px; margin: 24px 0 0 14px; padding-left: 24px; border-left: 3px dotted var(--primary-medium); }
  .ticket {
    position: relative; left: auto; top: auto; translate: none; width: auto;
    background: #fff; box-shadow: none; border: 1px solid rgba(47, 52, 64, .1);
  }
  .ticket::before {
    content: ""; position: absolute; left: -33px; top: 18px; width: 11px; height: 11px;
    border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 4px #fff;
  }
}
@media (prefers-reduced-motion: reduce) {
  .flow-lines path, .ticket-chip--agent::before, html.js .ticket { animation: none; }
}

/* ======================================================================
   GATEWAY BACKGROUND PATHS (static/js/paths.js)
   A fixed layer behind the tiles. Faded at the top and bottom, and quieter in the middle
   so the two units stay easy to read. The lines take the canvas's colour.
   ====================================================================== */
.bg-paths {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; color: var(--primary); opacity: .6;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 15%, #000 85%, transparent),
                      radial-gradient(ellipse 42% 36% at 50% 50%, rgba(0, 0, 0, .12), #000);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to bottom, transparent, #000 15%, #000 85%, transparent),
              radial-gradient(ellipse 42% 36% at 50% 50%, rgba(0, 0, 0, .12), #000);
  mask-composite: intersect;
}
.bg-paths canvas { display: block; width: 100%; height: 100%; opacity: 0; transition: opacity .5s var(--ease-out); }
.bg-paths canvas.is-ready { opacity: 1; }
.page-gateway .gw-header, .page-gateway main { position: relative; z-index: 1; }
/* the layer lives inside main, so the content must be raised above it (a positioned layer paints over plain content) */
.page-gateway .gw { position: relative; z-index: 1; }

/* ======================================================================
   STUDIO PORTFOLIO (/studio/portfolio)
   Photo cards in the customer-story style (enhance.css ".case-card--story", ".cs-*"),
   three to a row as on /customers: the products our team built, which open the story
   pop-up (".story-preview"), then a placeholder for the next product with the agent at
   work. The "Got an idea?" banner closes the section.
   ====================================================================== */
.pf-built { padding-top: 24px; }
.pf-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.pf-card { --pc: var(--primary-dark); }
.cs-logo--word { gap: 12px; }
.cs-logo--word img { height: 100%; }
.cs-logo--word .case-wordmark { font-size: 20px; font-weight: 600; letter-spacing: -.01em; color: #0f1f5c; }
.cs-pill--wrap { white-space: normal; text-align: center; }
.pf-preview .sp-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.pf-preview .sp-body { overflow-x: hidden; }

/* the closing card, "Your idea next?": the site's light-teal ".case-card--next" with an "In construction" badge */
.pf-grid .case-card--next { grid-column: auto; }
.pf-next .case-body { padding: 36px 32px 32px; }
.pf-next h3 { font-size: clamp(26px, 2.4vw, 34px); line-height: 1.15; letter-spacing: -.02em; }
.pf-badge { padding: 6px 14px; }
.pf-badge::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--primary-medium); flex: none; }

/* ZORALCS pop-up: three figures from its customer story */
.pf-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 20px; margin: 0; padding: 18px 20px; border-radius: 16px; background: var(--primary-light); }
.pf-metrics dd { order: -1; margin: 0; font-size: clamp(26px, 2.4vw, 32px); font-weight: 500; letter-spacing: -.03em; line-height: 1.1; color: var(--primary-dark); font-variant-numeric: tabular-nums; }
.pf-metrics div { display: flex; flex-direction: column; gap: 4px; }
.pf-metrics dt { font-size: 14px; line-height: 1.35; color: var(--neutral-800); }

/* the portfolio hero sits closer to its cards */
.page-hero.studio-hero { padding-bottom: 8px; }

.pf-cta { margin-top: 24px; }
@media (max-width: 1000px) {
  .pf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .pf-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .pf-cta { margin-top: 16px; }
  .pf-next .case-body { padding: 32px 28px 28px; }
  .pf-metrics { grid-template-columns: minmax(0, 1fr); }
}

/* "Your idea next?": Bewi waves from the bottom right; the text keeps to the left */
.pf-next h3, .pf-next p { max-width: 58%; }
.pf-bewi { position: absolute; right: 12px; bottom: -6px; height: clamp(150px, 12.5vw, 196px); width: auto; transform-origin: 50% 100%; transition: transform .45s var(--ease-out); }
.pf-next:hover .pf-bewi, .pf-next:focus-visible .pf-bewi { transform: translateY(-6px) rotate(-3deg); }
@media (prefers-reduced-motion: no-preference) { .pf-bewi { animation: bewi-sway 3.6s ease-in-out infinite alternate; } }
@keyframes bewi-sway { from { rotate: -1.5deg; } to { rotate: 1.5deg; } }
@media (prefers-reduced-motion: reduce) { .pf-bewi { transition: none; } .pf-next:hover .pf-bewi { transform: none; } }
@media (max-width: 640px) { .pf-bewi { height: 150px; } }

/* the studio hero: Bewi sits on the top edge of the blueprint picture, on the right. The sitting figure's paws end
   about 77% down its picture, so that is where the ledge goes: the paws lean on the picture, the legs hang over it. "translate" places it. */
.hero-bewi { position: absolute; right: 8%; top: 0; translate: 0 -78%; z-index: 3; display: block; height: clamp(120px, 12.5vw, 188px); width: auto; transform-origin: 50% 100%; pointer-events: none; }
/* Bewi comes in as part of the blueprint picture: the very same animation, delay and easing as the picture
   (enhance.css "photo-in", 1.2s from .1s), so the two fade in and rise together; then he stays still */
@media (prefers-reduced-motion: no-preference) {
  html.js .hero-bewi { animation: photo-in 1.2s var(--ease-out) .1s both; }
}
@media (max-width: 900px) { .hero-bewi { right: 6%; height: 112px; } }

/* the name "Bewi" on its page: a tag opens above it on hover or focus (a tap on a phone), showing where the name comes from:
   BeWell Innovations, with Be, W and I highlighted */
.bewi-name { position: relative; cursor: help; border-radius: 12px; }
.bewi-name:focus-visible { outline: 3px solid var(--primary-dark); outline-offset: 6px; }
.bewi-tag {
  display: none; position: absolute; left: 50%; bottom: calc(100% + 4px); translate: -50% 0; z-index: 4; white-space: nowrap; pointer-events: none;
  padding: 8px 16px; border-radius: 999px; background: #fff; color: var(--neutral-600); font-size: var(--fs-small); font-weight: 500; line-height: 1.3; letter-spacing: 0;
  opacity: 0; clip-path: inset(0 50% 0 50% round 999px);
}
.bewi-tag mark { padding: 0 2px; margin: 0; border-radius: 5px; background: var(--primary-light); color: var(--primary-dark); font-weight: 600; }
.bewi-name:hover .bewi-tag, .bewi-name:focus .bewi-tag { display: block; opacity: 1; clip-path: inset(0 0 0 0 round 999px); }
/* not in the layout until it opens, so it never counts as a line of the heading; it opens (and closes) with a transition where display can be animated */
@media (prefers-reduced-motion: no-preference) {
  .bewi-tag { transition: clip-path .5s var(--ease-out), opacity .2s ease, display .5s allow-discrete; }
  @starting-style { .bewi-name:hover .bewi-tag, .bewi-name:focus .bewi-tag { opacity: 0; clip-path: inset(0 50% 0 50% round 999px); } }
}

/* ======================================================================
   MEET THE AGENTS: a staggered line-up of free-standing figures on a light-teal band.
   No cards: the sheets' white ground is multiplied away, so each figure stands on the field.
   ====================================================================== */
/* the band fades in from the hero's gradient: no hard edge (the figures stand on its flat part, further down) */
.studio-agents { background: linear-gradient(180deg, rgba(224, 243, 240, 0) 0, var(--primary-light) 260px, var(--primary-light) calc(100% - 220px), rgba(224, 243, 240, 0) 100%); overflow: hidden; padding-top: 32px; }
.agent-crew { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 24px 16px; }
.agent-crew li:nth-child(even) { margin-top: 44px; }
.agent-crew figure { position: relative; top: 0; margin: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; transition: top .45s var(--ease-out); }
.agent-crew img { display: block; width: 100%; max-width: 230px; height: auto; mix-blend-mode: multiply; }
.agent-crew figcaption { font-size: var(--fs-small); font-weight: 500; line-height: 1.3; color: var(--neutral-800); }
.agent-crew li:hover figure { top: -10px; }
@media (prefers-reduced-motion: no-preference) {
  /* a slow idle bob, each figure out of step with the next */
  .agent-crew li:nth-child(odd) img { animation: crew-bob 4.8s ease-in-out infinite alternate; }
  .agent-crew li:nth-child(even) img { animation: crew-bob 5.6s ease-in-out -1.4s infinite alternate; }
  .agent-crew li:nth-child(3n) img { animation-duration: 6.2s; animation-delay: -3s; }
}
@keyframes crew-bob { from { transform: translateY(0); } to { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .agent-crew figure { transition: none; } .agent-crew li:hover figure { top: 0; } }
@media (max-width: 1000px) {
  .agent-crew { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 12px; }
  .agent-crew li:nth-child(even) { margin-top: 0; }
  .agent-crew li:nth-child(3n+2) { margin-top: 36px; }
}
@media (max-width: 640px) {
  .agent-crew { gap: 20px 8px; }
  .agent-crew li:nth-child(3n+2) { margin-top: 28px; }
}

/* the Bewi page: the hero sits close to the line-up; the closing banner needs no extra room */
.bewi-cta { padding-top: 0; }
/* the Bewi page heading: two lines, "Specialized for every role." at the same size as "Meet Bewi." */
.bewi-hero .display { max-width: none; font-size: clamp(24px, 6.3vw, 72px); }

/* ======================================================================
   HOW IT WORKS: as the section scrolls past, a ball drops down the staircase and pings each step
   it lands on (a ripple on the number, the number and the step's title flash). enhance.js moves
   the ball with the scroll; under reduced motion there is no ball and nothing flashes.
   ====================================================================== */
.how-stairs { position: relative; }
.how-ripple { position: absolute; z-index: 1; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; background: rgba(46, 178, 157, .38); pointer-events: none; animation: how-ripple .9s var(--ease-out) both; }
.how-ball { position: absolute; left: 0; top: 0; z-index: 2; width: 24px; height: 24px; margin: -12px 0 0 -12px; border-radius: 50%; background: var(--primary); opacity: 0; pointer-events: none; will-change: transform; }
.how-stairs li { position: relative; }
.how-stairs li.is-ping h3 { animation: how-flash 1.1s ease-out both; }
.how-stairs li.is-ping::before { animation: how-num 1s var(--ease-out) both; }
@keyframes how-ripple { from { opacity: .9; transform: scale(.2); } to { opacity: 0; transform: scale(1.4); } }
@keyframes how-flash { 0% { color: var(--primary-dark); } 100% { color: inherit; } }
@keyframes how-num { 0% { color: var(--primary-dark); transform: scale(1.18); } 100% { transform: scale(1); } }
@media (max-width: 640px) { .how-ball { width: 20px; height: 20px; margin: -10px 0 0 -10px; } .how-ripple { width: 48px; height: 48px; margin: -24px 0 0 -24px; } }
