.banner { color: var(--ink); }
.banner .stack { opacity: 1; }
.banner-graph {
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: center;
  min-width: 0;
}
.banner-node {
  min-width: 0;
  max-width: 100%;
  padding: 14px 22px;
  border-radius: 999px;
  background: var(--card);
  font: 600 clamp(15px, 1.25vw, 20px)/1.2 var(--display);
  text-align: center;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.banner-node.waypoint {
  flex: none;
  width: 14px;
  height: 14px;
  padding: 0;
  background: var(--ink);
}
.banner-edge {
  position: relative;
  width: 2px;
  height: clamp(26px, 4svh, 42px);
  border-left: 2px solid;
  font: 600 16px/1.2 var(--display);
}
.banner-edge::after {
  content: "";
  position: absolute;
  inset: auto auto 1px -5px;
  width: 8px;
  height: 8px;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.banner-edge > span {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
}
@media (min-width: 1100px) {
  .banner-graph { flex-direction: row; }
  .banner-edge {
    flex: 1 0 96px;
    height: 2px;
    border: 0;
    border-top: 2px solid;
  }
  .banner-edge::after {
    inset: -5px 1px auto auto;
    transform: rotate(-45deg);
  }
  .banner-edge > span {
    inset: auto auto 7px 50%;
    transform: translateX(-50%);
  }
}

.services-stage { display: contents; }
.services-window { min-width: 0; }

.proof-card {
  position: relative;
  isolation: isolate;
  padding: clamp(28px, 5vw, 64px);
  border-radius: var(--r);
  background: var(--ink);
  color: white;
}
.proof-figures {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px;
  margin-top: clamp(32px, 5vw, 64px);
}
.proof-figures li { border-top: 1px solid #777; padding-top: 16px; }
.proof-figures strong {
  display: block;
  font: 600 clamp(34px, 4vw, 58px)/1.1 var(--display);
  letter-spacing: -.045em;
  font-variant-numeric: tabular-nums;
}
.proof-figures p { margin: 10px 0 4px; }
.proof-figures small { font-size: 14px; color: #ddd; }
.sr-only,
.proof-final {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Keep the existing work header and book readable even if only scroll.js fails. */
#work[data-sc-act] > [data-rv] { opacity: 1; }

.sc-on [data-sc-progress] {
  position: fixed;
  inset: 0 0 auto;
  height: 3px;
  z-index: 60;
  background: var(--teal);
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
}
.sc-on [data-sc-stage] {
  position: sticky;
  top: 0;
  height: 100svh;
  z-index: 1;
  overflow: clip;
}
.sc-on .banner {
  top: 20px;
  min-height: calc(100svh - 40px);
  height: auto;
  grid-template-rows: 1fr auto;
}
.sc-on [data-sc-cue] { opacity: 0; }

.sc-on .services { display: block; padding-top: 0; }
.sc-on .services-stage {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.6fr);
  align-content: center;
  align-items: center;
  gap: 28px;
}
.sc-on .services-window {
  container-type: inline-size;
  overflow: clip;
}
.sc-on .service-grid {
  --card-width: 340px;
  display: flex;
  gap: 16px;
  width: max-content;
  /* The engine measures against innerWidth. Include the space outside the
     window, then offset its 10% overtravel so the last card lands flush. */
  padding-right: calc(100vw - 100cqw);
  position: relative;
  left: calc((4 * var(--card-width) + 48px - 100cqw) * .1 * var(--sc-p, 0));
}
.sc-on .service { flex: 0 0 var(--card-width); width: var(--card-width); }

.sc-on [data-sc-stagger] > * {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .5s, transform .5s var(--ease);
}
.sc-on [data-sc-stagger] > .sc-in { opacity: 1; transform: none; }

@media (hover: hover) and (pointer: fine) {
  .sc-on .proof-card:hover::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    pointer-events: none;
    background: radial-gradient(22rem at calc(var(--sc-mx, .5) * 100%) calc(var(--sc-my, .5) * 100%),
      color-mix(in srgb, var(--teal) 22%, transparent), transparent);
  }
}

/* With no fill after the halfway point, the book's own transform is none. Open-book layout only: the phone strip
   measures its pages with getBoundingClientRect, and a scale on an ancestor would skew that arithmetic. */
.sc-on #work > .table[data-mode="book"] {
  animation: book-entry 1s linear calc(-2s * var(--sc-p, 0)) paused;
}
@keyframes book-entry {
  from { transform: perspective(1100px) rotateX(12deg) scale(.94); }
  to { transform: none; }
}

@media (max-width: 860px) {
  .proof-figures { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; }
  /* The engine writes the desktop span inline, then measures the used height. */
  .sc-on [data-sc-act="pin"] { height: 220vh !important; }
  .sc-on [data-sc-act="pan"] { height: 240vh !important; }
  .sc-on .services-stage { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .sc-on .services-stage .section-title br { display: none; }
  .sc-on .service-grid { --card-width: 82vw; }
}

@media print {
  .banner { print-color-adjust: exact; }
  .proof-card { color: var(--ink); background: white; }
  .proof-figures small { color: var(--ink-2); }
  .proof-figures li, .service { break-inside: avoid; }
}
