/* ==========================================================================
   B2B Collaboration Platform case study: pieces on top of case-study.css
   ========================================================================== */

/* ---------- Hero: one photo of the laptop + phone under the title ---------- */
.b2b-hero {
  /* the photo starts high enough that its empty sky sits behind the title, but
     the laptop never rises above 290px; then 90% of the photo's height (the
     rest stays hidden below the hero so the parallax lift never shows its edge) */
  --photo-top: max(0px, calc(290px - 100cqw * 350 / 2000));
  height: calc(var(--photo-top) + 100cqw * 1017 / 2000 * 0.9);
  background: #fff;
}
.b2b-hero__bg {
  top: 0;
  height: 100%;
  /* matches the photo's top edge, so the sky continues up behind the title */
  background: linear-gradient(90deg, #edf4ff 0%, #e8f3fe 10%, #e7f3ff 15%, #ebf5ff 20%, #f2f8ff 25%, #fff 30%, #fff 100%);
}
.b2b-hero .cs2-hero__title-row,
.b2b-hero .cs2-hero__meta { z-index: 1; }
.b2b-hero__devices {
  position: absolute;
  left: 0;
  top: var(--photo-top);
  width: 100%;
  max-width: none;
  height: auto;
  will-change: transform;
}

.b2b-note,
.cs2-block--what .b2b-note {
  margin-top: 14px;
  font-style: italic;
  /* each page's accent text colour (B2B purple, Clinical green); both pass
     WCAG AA on the light background behind the note */
  color: var(--blue);
}
.cs2-block--what p + p { margin-top: 14px; }

/* ---------- Achievements graphic ---------- */
.b2b-wins {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 20px;
}
.b2b-win {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 236px;
  padding: 32px;
  border-radius: 20px;
  background: #f1f5f9;
}
.b2b-win__label {
  position: relative;
  font-weight: 600;
  font-size: 11.2px;
  line-height: 12px;
  letter-spacing: 0.896px;
  text-transform: uppercase;
  color: var(--muted);
}
.b2b-win__value {
  position: relative;
  margin-top: 18px;
  font-weight: 800;
  font-size: 64px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.b2b-win__note {
  position: relative;
  margin-top: auto;
  padding-top: 16px;
  font-size: 16px;
  line-height: 22px;
  color: var(--muted);
}

/* valuation: accent card with a rising chart drawn behind the number */
.b2b-win--value {
  background: linear-gradient(135deg, #3a05aa 0%, var(--blue) 55%, #7a45f0 100%);
}
.b2b-win--value .b2b-win__label,
.b2b-win--value .b2b-win__note { color: rgba(255, 255, 255, 0.82); }
.b2b-win--value .b2b-win__value { color: #fff; }
.b2b-win__chart {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 62%;
  height: 70%;
  pointer-events: none;
}

/* funding: two bars growing from $14M+ to $25M */
.b2b-raise {
  margin-top: auto !important;
  padding-top: 20px !important;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.b2b-raise li { display: flex; flex-direction: column; gap: 6px; }
.b2b-raise__bar {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: rgba(17, 17, 16, 0.08);
  overflow: hidden;
}
.b2b-raise__bar::after {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--fill);
  border-radius: inherit;
  background: var(--blue);
  transform-origin: left;
  transition: transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.b2b-raise li:first-child .b2b-raise__bar::after { background: color-mix(in srgb, var(--blue) 45%, #fff); }
.b2b-raise li:last-child .b2b-raise__bar::after { transition-delay: 0.25s; }
/* bars start empty and grow once scrolled into view (case-study.js) */
.cs2-grow:not(.is-in) .b2b-raise__bar::after { transform: scaleX(0); }
.b2b-raise__text {
  font-size: 15px;
  line-height: 20px;
  color: var(--muted);
}
.b2b-raise__text strong { font-weight: 700; color: var(--ink); }

/* ---------- The Task at Hand: soft purple glows fading to white ---------- */
.b2b-task { padding-bottom: 160px; }
.b2b-task::before {
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  margin-left: 0;
  background:
    radial-gradient(55% 38% at 12% 8%, rgba(78, 7, 227, 0.14), transparent 70%),
    radial-gradient(45% 32% at 92% 22%, rgba(122, 69, 240, 0.14), transparent 70%),
    radial-gradient(60% 40% at 55% 62%, rgba(78, 7, 227, 0.06), transparent 72%),
    radial-gradient(50% 30% at 8% 88%, rgba(255, 194, 137, 0.16), transparent 70%),
    #fff;
}

/* images with a near-white background baked in get a card edge */
.b2b-card {
  border-radius: 20px;
  box-shadow: 0 0 0 1px rgba(17, 17, 16, 0.06), 0 24px 48px -28px rgba(20, 24, 29, 0.25);
}

/* ---------- Research: themes ---------- */
.b2b-subhead {
  font-weight: 700;
  font-size: 24px;
  line-height: 26px;
  color: var(--ink);
}
.b2b-steps { display: flex; flex-direction: column; gap: 40px; }
.b2b-steps > li,
.b2b-story {
  display: grid;
  grid-template-columns: 53px minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}
.b2b-num {
  display: grid;
  place-items: center;
  width: 53px;
  height: 53px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: #fff;
  font-weight: 500;
  font-size: 26px;
  line-height: 1;
  color: var(--ink);
}
.b2b-num--accent {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
  box-shadow: 0 10px 22px -10px color-mix(in srgb, var(--blue) 70%, transparent);
}
.b2b-steps__title {
  margin: 12px 0 12px;
  font-weight: 700;
  font-size: 22.4px;
  line-height: 28px;
  color: var(--ink);
}

/* ---------- How I shaped the product ---------- */
.b2b-quote {
  padding-left: 28px;
  border-left: 5px solid var(--blue);
}
.b2b-quote p {
  font-size: 26px;
  line-height: 34px;
  color: var(--ink);
}

/* whiteboard photo on a soft blob with a dot grid, like the mockup */
.b2b-board {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 0 0;
}
.b2b-board::before,
.b2b-board::after {
  content: '';
  position: absolute;
  pointer-events: none;
}
.b2b-board::before {
  left: 0;
  top: 0;
  width: 78%;
  height: 92%;
  border-radius: 46% 54% 38% 62% / 52% 40% 60% 48%;
  background: #f1f1f3;
  transform: rotate(-8deg);
}
.b2b-board::after {
  right: 0;
  top: 22%;
  width: 26%;
  height: 52%;
  background: radial-gradient(circle, color-mix(in srgb, var(--blue) 35%, #c9c9c9) 1.6px, transparent 2px) 0 0 / 27px 27px;
  -webkit-mask-image: radial-gradient(closest-side, #000 55%, transparent);
  mask-image: radial-gradient(closest-side, #000 55%, transparent);
}
.b2b-board__photo {
  position: relative;
  z-index: 1;
  width: min(594px, 100%);
  aspect-ratio: 594 / 451;
  border-radius: 23px;
  box-shadow: 0 24px 48px -24px rgba(20, 24, 29, 0.3);
}
.b2b-board figcaption {
  position: relative;
  z-index: 1;
  width: min(594px, 100%);
  margin-top: 18px;
}

.b2b-caption,
.b2b-board figcaption {
  font-size: 16px;
  line-height: 22px;
  color: #595959;
}

.cs2 .b2b-list { display: flex; flex-direction: column; gap: 6px; padding-left: 24px; list-style: disc; }
.b2b-list--italic li { font-style: italic; }

/* ---------- Selected design stories (white, like the mockup) ---------- */
.b2b-stories {
  margin-top: 200px;
  padding: 140px 0 160px;
  background: #fff;
}
.b2b-lede {
  font-size: 18px;
  line-height: 27px;
  color: var(--ink);
}
.b2b-figure { display: flex; flex-direction: column; gap: 18px; }
.b2b-figure .cs2-shot img { object-fit: contain; }

/* the two popups sit side by side; each export includes ~70px of shadow
   around the card, so widths are their export widths (560 + 740 = 1300) */
.b2b-popups__row { display: flex; align-items: flex-start; }
.b2b-popups__row img {
  width: calc(var(--w) / 1300 * 100%);
  height: auto;
  max-width: none;
}
/* an exception: this caption ends at the profile card's right edge
   (the export has 70px of shadow past the card) */
.b2b-popups .b2b-caption { padding-right: calc(70 / 1300 * 100%); text-align: right; }

.b2b-bleed { position: relative; }
.b2b-bleed .cs2-shot { width: 100%; }
/* an exception: this caption sits on the photo itself, in white */
.b2b-bleed .b2b-caption {
  position: absolute;
  left: 0;
  bottom: clamp(16px, 3vw, 40px);
  color: #fff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}

.b2b-invites > img { object-fit: contain; object-position: top; }
/* same "drop shadow mockups" effect as the Figma frame */
.b2b-invites__page { box-shadow: 0 30px 70px 0 rgba(20, 24, 29, 0.26); }

.cs2-badge--svg svg { position: absolute; left: 7px; top: 7px; width: 20px; height: 20px; }

/* ---------- Closing dark-mode mockup (full width, under the learnings) ---------- */
.b2b-closing img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3840 / 1300;
  object-fit: cover;
}

/* ---------- Narrower screens ---------- */
@media (max-width: 1199px) {
  /* the title no longer fits on one line, so the hero becomes a simple stack */
  .b2b-hero {
    height: auto;
    padding: 130px var(--gut) 0;
  }
  .b2b-hero .cs2-hero__title-row,
  .b2b-hero .cs2-hero__meta { position: relative; top: auto; left: auto; right: auto; }
  .b2b-hero .cs2-hero__title-row { flex-wrap: wrap; align-items: center; gap: 10px 16px; }
  .b2b-hero .cs2-hero__title { font-size: clamp(32px, 4.6vw, 55px); line-height: 1.1; white-space: normal; text-align: center; }
  .b2b-hero .cs2-chip { margin-top: 0; }
  .b2b-hero .cs2-hero__meta { margin-top: 16px; flex-wrap: wrap; }
  .b2b-hero__devices {
    position: relative;
    top: auto;
    left: calc(-1 * var(--gut));
    width: calc(100% + 2 * var(--gut));
    /* the photo's empty sky tucks up behind the title */
    margin: -10% 0 -4%;
  }
}
@media (max-width: 1100px) {
  .b2b-wins { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .b2b-hero { border-radius: 0 0 48px 48px; }
  .b2b-hero .cs2-hero__title { font-size: 34px; }
  .b2b-hero .cs2-hero__meta { font-size: 14px; flex-direction: column; gap: 6px; }
  .b2b-hero .cs2-hero__dot { display: none; }
  .b2b-win__value { font-size: 52px; }
  .b2b-quote p { font-size: 22px; line-height: 29px; }
  .b2b-steps > li,
  .b2b-story { grid-template-columns: 1fr; gap: 4px; }
  .b2b-num { width: 44px; height: 44px; font-size: 22px; }
  .b2b-popups__row { flex-direction: column; align-items: center; }
  .b2b-popups__row img { width: 100%; max-width: calc(var(--w) * 1px); }
  .b2b-popups .b2b-caption { padding-right: 0; text-align: left; }
  .b2b-invites { aspect-ratio: auto; display: flex; flex-direction: column; gap: 16px; }
  .b2b-invites > img { position: static; width: 100%; height: auto; }
  .b2b-invites > img:last-child { width: 80%; margin: 0 auto; }
  .b2b-stories { margin-top: 120px; padding: 96px 0 112px; }
}
