@charset "UTF-8";

/*
 * Purpose-driven design showcase (web design page): a light, pinned stage with the
 * heading at the top and a phone dead centre whose screen scrolls through five sites.
 * One point is visible at a time, the one that belongs to the screen on show: left and
 * right of the phone in turn on wide screens, above it on phones. purpose.js pins the
 * stage, scrubs the strip and toggles `is-active`; the crossfades are CSS transitions.
 * With reduced motion (the script adds `is-static`) it is a plain stack with every
 * point shown.
 *
 * Colours are the theme's tokens, which the theme engine flips for this light section.
 */

.purpose {
  position: relative;
  overflow: clip;
}

/* The pinned stage carries its own header-height padding; the section's would pin with it
   and push the head a whole band down the screen. */
.bh-section.purpose {
  padding-block-start: 0;
}

.purpose__sticky {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: clamp(0.75rem, 2vh, 1.5rem);
  box-sizing: border-box;
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(var(--bh-header-height) + 0.25rem) var(--bh-gutter) clamp(1rem, 2.5vh, 2rem);
}

/* Two soft bubbles behind the stage, like the page's depth field. */
.purpose__orb {
  position: absolute;
  z-index: 0;
  width: clamp(16rem, 34vw, 30rem);
  aspect-ratio: 1;
  opacity: 0.55;
  pointer-events: none;
  mix-blend-mode: multiply;
}

.purpose__orb img {
  display: block;
  width: 100%;
  height: 100%;
}

.purpose__orb--1 {
  inset-block-start: 8%;
  inset-inline-start: -8%;
}

.purpose__orb--2 {
  inset-block-end: -10%;
  inset-inline-end: -6%;
  opacity: 0.4;
}

.purpose__head {
  position: relative;
  z-index: 1;
  max-width: 60rem;
  margin-inline: auto;
  text-align: center;
}

/* Two lines, high on the stage, so the phone beneath shows whole. */
.purpose__title {
  max-width: 17em;
  margin-inline: auto;
  font-size: clamp(2rem, 4.1vw, 3.4rem);
  line-height: var(--bh-leading-tight);
  text-wrap: balance;
}

/* The stage: a point's column, the phone, a point's column. The columns are equal so the
   phone is exactly centred whatever the copy's length. */
.purpose__stage {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 6rem);
  align-items: center;
  align-content: start;
  width: min(100%, var(--bh-container));
  margin-inline: auto;
}

/* Each column holds its points stacked on the same spot; only the active one shows. */
.purpose__captions {
  position: relative;
  width: 100%;
  max-width: 22rem;
  min-height: 14rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.purpose__captions--left {
  justify-self: end;
}

.purpose__captions--right {
  justify-self: start;
}

/* A point: a numbered block with a magenta rule on its edge. Hidden ones sit a touch low
   and clear of the accessibility tree until they are on stage. */
.purpose__feature {
  position: absolute;
  inset-inline: 0;
  inset-block-start: 50%;
  padding-inline-start: 1.4rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-50%) translateY(0.75rem);
  transition: opacity 0.5s var(--bh-ease-out), transform 0.7s var(--bh-ease-out), visibility 0s 0.5s;
}

.purpose__feature::before {
  content: "";
  position: absolute;
  inset-block: 0.3rem;
  inset-inline-start: 0;
  width: 2px;
  border-radius: 1px;
  background: var(--bh-magenta);
}

.purpose__feature.is-active {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%);
  transition: opacity 0.55s var(--bh-ease-out) 0.1s, transform 0.7s var(--bh-ease-out) 0.1s, visibility 0s;
}

.purpose__index {
  display: block;
  margin-block-end: 0.45rem;
  color: var(--bh-cyan);
  font-size: var(--bh-step-label);
  letter-spacing: var(--bh-tracking-label);
}

.purpose__feature-title {
  margin: 0 0 0.45rem;
  font-size: var(--bh-step-h4);
  font-weight: var(--bh-weight-heading);
  line-height: var(--bh-leading-tight, 1.2);
  letter-spacing: var(--bh-tracking-heading);
  text-wrap: balance;
}

.purpose__feature-copy {
  margin: 0;
  color: var(--bh-muted);
  font-size: var(--bh-step-small);
  line-height: var(--bh-leading-body, 1.55);
  text-wrap: pretty;
}

/* The phone: an ink-coloured frame with a notch and the strip of screens inside, which
   purpose.js scrolls. Sized from the viewport height so the stage never overflows the pin. */
/* Sized so the whole phone shows beneath the two-line head: as tall as the stage
   allows, capped so it never dwarfs the copy. The outer wrapper floats gently; the
   frame inside is what purpose.js tips and dips on a flick. */
.purpose__phone {
  --purpose-phone-height: calc(100svh - var(--bh-header-height) - 13.5rem);
  justify-self: center;
  width: min(19rem, max(12rem, calc(var(--purpose-phone-height) / 2.128)));
  animation: purpose-hover 7s ease-in-out infinite alternate;
}

.purpose__frame {
  position: relative;
  aspect-ratio: 640 / 1362;
  overflow: hidden;
  border: 0.45rem solid var(--bh-white);
  border-radius: 2.4rem;
  background: var(--bh-white);
  box-shadow:
    0 2rem 4rem color-mix(in srgb, var(--bh-white) 22%, transparent),
    inset 0 0 0 1px color-mix(in srgb, var(--bh-black) 40%, transparent);
  -webkit-mask-image: radial-gradient(#fff, #000);
  mask-image: radial-gradient(#fff, #000);
  will-change: transform;
}

@keyframes purpose-hover {
  from {
    translate: 0 0;
  }

  to {
    translate: 0 -0.5rem;
  }
}

.purpose__strip {
  display: grid;
  will-change: transform;
}

.purpose__screen {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 640 / 1362;
  object-fit: cover;
  object-position: top;
  border-radius: 1.95rem;
}

.purpose__notch {
  position: absolute;
  inset-block-start: 0.55rem;
  inset-inline-start: 50%;
  width: 34%;
  height: 0.8rem;
  border-radius: 999px;
  background: var(--bh-white);
  translate: -50% 0;
}

/* Phones: the point above the phone, centred, one at a time, as on the live site. -------- */

@media (max-width: 63.99rem) {
  .purpose__sticky {
    gap: 0.75rem;
    padding-block-start: calc(var(--bh-header-height) + 0.25rem);
  }

  .purpose__stage {
    grid-template-columns: 1fr;
    grid-template-areas: "captions" "phone";
    gap: 1rem;
    align-content: start;
  }

  .purpose__captions {
    grid-area: captions;
    max-width: 24rem;
    min-height: 8rem;
    margin-inline: auto;
    text-align: center;
  }

  .purpose__feature {
    padding-inline-start: 0;
  }

  .purpose__feature::before {
    inset-block: auto -0.6rem;
    inset-inline: calc(50% - 1rem);
    width: 2rem;
    height: 2px;
  }

  /* Sized so the title, the caption and the whole phone fit one phone screen while pinned. */
  .purpose__phone {
    --purpose-phone-height: calc(100svh - var(--bh-header-height) - 16rem);
    grid-area: phone;
    width: min(13rem, 60vw, max(8.5rem, calc(var(--purpose-phone-height) / 2.128)));
  }
}

/* Reduced motion (or no script): a stack, every point shown, the phone on its first screen. */

.purpose.is-static .purpose__captions {
  display: grid;
  gap: 1.5rem;
  min-height: 0;
}

.purpose.is-static .purpose__feature {
  position: relative;
  inset: auto;
  transform: none;
  opacity: 1;
  visibility: visible;
  transition: none;
}

.purpose.is-static .purpose__sticky {
  min-height: 0;
}

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

  .purpose__phone {
    animation: none;
  }
}

@media (forced-colors: active) {
  .purpose__orb {
    display: none;
  }

  .purpose__feature::before {
    background: CanvasText;
  }
}
