/* Service pages kit, Apple-style: Container Scroll (#1081), Sticky Scroll Reveal (#952), stacking cards,
   rolling numbers, reading reveal and in-view mini visuals. Light surfaces, ink type, one accent. */

/* ─── Container Scroll: the hero device tilts flat as you scroll ─── */
.x-cs { position: relative; padding: clamp(4rem, 8vw, 6.5rem) 0 var(--s-4); overflow: hidden; --p: 0; }
.x-cs-head { position: relative; z-index: 1; max-width: 900px; margin: 0 auto; padding: 0 1.5rem; text-align: center; transform: translateY(calc(var(--p) * -60px)); }
.x-cs-head .crumbs { justify-content: center; }
.x-cs-stage { position: relative; z-index: 1; perspective: 1000px; margin-top: var(--s-6); padding: 0 1.5rem; }
.x-cs-card { max-width: 1040px; margin: 0 auto; border-radius: 30px; padding: 10px; background: var(--ink);
  transform-origin: center top; transform: rotateX(calc((1 - var(--p)) * 18deg)) scale(calc(1.04 - var(--p) * .04)) translateY(calc(var(--p) * -36px));
  box-shadow: 0 1px 2px rgba(40, 12, 60, .1), 0 24px 48px -16px rgba(40, 12, 60, .22), 0 64px 120px -40px rgba(40, 12, 60, .28); }
.x-cs-screen { position: relative; overflow: hidden; border-radius: 21px; aspect-ratio: 16 / 9.4; background: var(--night); }
@media (max-width: 768px) {
  .x-cs-stage { padding: 0 .75rem; margin-top: var(--s-5); }
  .x-cs-card { padding: 6px; border-radius: 20px; transform: rotateX(calc((1 - var(--p)) * 18deg)) scale(calc(.92 + var(--p) * .08)); }
  .x-cs-screen { border-radius: 15px; aspect-ratio: 4 / 5; }
}

/* ─── Reading reveal: words go from light grey to ink as they pass ─── */
.x-read .xw { transition: color 300ms ease; }
html.x-on .x-read .xw { color: #c7c7cc; }
html.x-on .x-read .xw.lit { color: var(--ink); }
.x-read em { font-style: normal; }

/* ─── Rolling numbers ─── */
.x-odo { display: inline-flex; overflow: hidden; vertical-align: bottom; height: 1.2em; line-height: 1.2em; font-variant-numeric: proportional-nums; }
.x-odo .od { display: inline-block; height: 1.2em; overflow: hidden; }
.x-odo .od > span { display: flex; flex-direction: column; align-items: flex-start; transition: transform 1.4s var(--ease); }
.x-odo .od > span > span { height: 1.2em; }

/* The old cursor glow is retired; the class stays harmless */
.x-glow { position: relative; }

/* ─── Stats: four numbers, hairlines between ─── */
.x-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--hair); }
.x-stats > div { padding: var(--s-4) var(--s-3) 0 0; }
.x-stats > div + div { padding-left: var(--s-3); border-left: 1px solid var(--hair); }
.x-stats b { display: block; font-size: clamp(2.5rem, 1.8rem + 2.4vw, 3.5rem); line-height: 1.2; letter-spacing: -.04em; font-weight: 700; color: var(--ink); }
.x-stats > div > span { display: block; margin-top: .375rem; font-size: .9375rem; line-height: 1.45; color: var(--ink-2); }
@media (max-width: 860px) {
  .x-stats { grid-template-columns: 1fr 1fr; row-gap: var(--s-4); }
  .x-stats > div:nth-child(3) { padding-left: 0; border-left: 0; }
}

/* ─── Feature tiles with small, calm visuals ─── */
.x-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.x-tile { display: flex; flex-direction: column; min-width: 0; padding: var(--s-3); border-radius: var(--r-3); background: var(--canvas); }
.sec:not(.tint) .x-tile { background: var(--mist); }
.x-tile.wide { grid-column: span 2; }
.x-tile h3 { margin-top: var(--s-3); font-size: 1.1875rem; line-height: 1.25; letter-spacing: -.018em; font-weight: 600; }
.x-tile p { margin-top: .5rem; font-size: .9375rem; line-height: 1.5; letter-spacing: -.01em; color: var(--ink-2); }
.x-tile p a { color: var(--accent); }
.x-tile p a:hover { text-decoration: underline; text-underline-offset: .18em; }
.x-vis { position: relative; height: 128px; border-radius: var(--r-2); overflow: hidden; display: grid; place-items: center; background: var(--mist); }
.sec:not(.tint) .x-vis { background: var(--canvas); }
@media (max-width: 1000px) { .x-tiles { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .x-tiles { grid-template-columns: 1fr; } .x-tile.wide { grid-column: auto; } }

.v-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; padding: 0 14px; }
.v-chips span { padding: .4375rem .75rem; border-radius: var(--r-pill); background: var(--canvas); box-shadow: var(--lift-1); font-size: .8125rem; font-weight: 500; color: var(--ink-2); }
.v-chips span.on { background: var(--ink); color: #fff; box-shadow: none; }
.in .v-chips span { animation: v-pop 500ms var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }
@keyframes v-pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.v-bars { display: flex; align-items: flex-end; gap: 8px; height: 84px; }
.v-bars i { width: 16px; height: 84px; border-radius: 5px 5px 2px 2px; background: rgba(29, 29, 31, .14); transform-origin: bottom; transform: scaleY(.08); transition: transform 900ms var(--ease); transition-delay: calc(var(--i, 0) * 60ms); }
.v-bars i:last-child { background: var(--ink); }
.in .v-bars i { transform: scaleY(var(--h)); }
.v-lines { width: 72%; display: grid; gap: 9px; }
.v-lines i { display: block; height: 8px; border-radius: 4px; background: rgba(29, 29, 31, .12); transform-origin: left; transform: scaleX(0); transition: transform 800ms var(--ease); transition-delay: calc(var(--i, 0) * 90ms); }
.v-lines i:first-child { height: 12px; background: var(--ink); }
.in .v-lines i { transform: scaleX(var(--w, 1)); }
.v-ring { position: relative; width: 92px; height: 92px; display: grid; place-items: center; }
.v-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.v-ring circle { fill: none; stroke-width: 8; }
.v-ring .trk { stroke: rgba(29, 29, 31, .08); }
.v-ring .arc { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 251; stroke-dashoffset: 0; }
.v-ring b { font-size: 1.25rem; font-weight: 700; letter-spacing: -.03em; }
/* A still target: three rings and a centre, no looping pulse */
.v-pulse { position: relative; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 18px rgba(29, 29, 31, .04), 0 0 0 19.5px rgba(29, 29, 31, .1), 0 0 0 38px rgba(29, 29, 31, .03), 0 0 0 39.5px rgba(29, 29, 31, .08); }
.v-logos { display: flex; gap: 10px; align-items: center; }
.v-logos img { width: 44px; height: 44px; padding: 10px; border-radius: 13px; background: var(--canvas); box-shadow: var(--lift-1); object-fit: contain; }

/* ─── Sticky Scroll Reveal: steps beside a pinned panel ─── */
.x-ss { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: var(--s-6); align-items: start; }
.x-ss-list { display: grid; padding: 6vh 0 22vh; }
.x-ss-item { position: relative; padding: var(--s-4) 0 var(--s-4) var(--s-3); border-left: 2px solid var(--hair); opacity: .35; transition: opacity 400ms ease; }
.x-ss-item::before { content: ""; position: absolute; left: -2px; top: var(--s-4); bottom: var(--s-4); width: 2px; background: var(--ink); transform: scaleY(0); transform-origin: top; transition: transform 500ms var(--ease); }
.x-ss-item.on { opacity: 1; }
.x-ss-item.on::before { transform: scaleY(1); }
.x-ss-item .k { display: inline-grid; place-items: center; width: 28px; height: 28px; margin-bottom: .875rem; border-radius: 50%; background: rgba(118, 118, 128, .12); font-size: .8125rem; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.x-ss-item h3 { font-size: clamp(1.375rem, 1.1rem + 1vw, 1.75rem); line-height: 1.17; letter-spacing: -.022em; font-weight: 700; margin-bottom: .5rem; }
.x-ss-item p { font-size: 1.0625rem; line-height: 1.5; color: var(--ink-2); max-width: 30em; }
.x-ss-panel { position: sticky; top: 92px; height: min(72vh, 600px); border-radius: var(--r-3); overflow: hidden; background: var(--mist); isolation: isolate; }
.x-ss-pane { position: absolute; inset: 0; opacity: 0; transform: translateY(14px) scale(.985); transition: opacity 400ms ease, transform 600ms var(--ease); pointer-events: none; }
.x-ss-pane.on { opacity: 1; transform: none; pointer-events: auto; }
.x-ss-mobile-vis { display: none; }
@media (max-width: 960px) {
  .x-ss { grid-template-columns: 1fr; gap: 0; }
  .x-ss-panel { display: none; }
  .x-ss-list { padding: var(--s-2) 0 0; }
  .x-ss-item { opacity: 1; }
  .x-ss-item::before { transform: scaleY(1); }
  .x-ss-mobile-vis { display: block; position: relative; height: 300px; margin-top: var(--s-3); border-radius: var(--r-2); overflow: hidden; background: var(--mist); }
  .x-ss-mobile-vis .x-ss-pane { opacity: 1; transform: none; }
}

/* ─── Stacking cards: process steps stack as you scroll ─── */
.x-stack { display: grid; gap: 1.25rem; margin-top: var(--s-6); padding-bottom: var(--s-4); }
.x-stack li { position: sticky; top: calc(84px + var(--i) * 16px); }
.x-stack .card { display: grid; grid-template-columns: 120px minmax(0, 1fr) minmax(0, .9fr); gap: var(--s-4); align-items: center; min-height: 200px; padding: var(--s-4) var(--s-5);
  border-radius: var(--r-3); background: var(--mist); transform-origin: center top; transform: scale(var(--s, 1)); transition: transform .1s linear;
  box-shadow: 0 -1px 0 rgba(255, 255, 255, .9), 0 -12px 32px -20px rgba(40, 12, 60, .18); }
.sec.tint .x-stack .card { background: var(--canvas); }
.x-stack .num { font-size: 4rem; line-height: 1; letter-spacing: -.05em; font-weight: 700; color: var(--hair); font-variant-numeric: tabular-nums; }
.x-stack h3 { font-size: clamp(1.375rem, 1.1rem + 1vw, 1.75rem); line-height: 1.17; letter-spacing: -.022em; font-weight: 700; }
.x-stack p { font-size: 1.0625rem; line-height: 1.5; color: var(--ink-2); }
@media (max-width: 860px) {
  .x-stack li { top: calc(68px + var(--i) * 12px); }
  .x-stack .card { grid-template-columns: 1fr; gap: .5rem; min-height: 0; padding: var(--s-4) var(--s-3); }
  .x-stack .num { font-size: 2.5rem; }
}

/* ─── Proof cards: a client quote beside the result ─── */
.x-proof { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.x-proof article { display: flex; flex-direction: column; gap: var(--s-3); padding: var(--s-4); border-radius: var(--r-3); background: var(--canvas); }
.x-proof .res { display: flex; align-items: baseline; gap: .75rem; flex-wrap: wrap; }
.x-proof .res b { font-size: 3.5rem; line-height: 1.2; letter-spacing: -.045em; font-weight: 700; }
.x-proof .res > span { font-size: 1rem; color: var(--ink-2); }
.x-proof blockquote { font-size: 1.0625rem; line-height: 1.55; color: var(--ink); }
.x-proof .who { display: flex; align-items: center; gap: .75rem; margin-top: auto; }
.x-proof .who img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.x-proof .who b { display: block; font-size: 1rem; font-weight: 600; letter-spacing: -.015em; }
.x-proof .who small { font-size: .875rem; color: var(--ink-2); }
@media (max-width: 860px) { .x-proof { grid-template-columns: 1fr; } }

/* Shared pane furniture for the sticky panels */
.pane-c { position: absolute; inset: 0; display: grid; place-items: center; padding: var(--s-4); }
.ex { position: absolute; left: 1.25rem; bottom: 1.25rem; padding: .375rem .75rem; border-radius: var(--r-pill); background: rgba(255, 255, 255, .85); box-shadow: var(--lift-1); font-size: .75rem; font-weight: 500; color: var(--ink-2); }

@media (prefers-reduced-motion: reduce) {
  .x-cs-head, .x-cs-card { transform: none !important; }
  .x-odo .od > span, .x-ss-item, .x-ss-item::before, .x-ss-pane, .v-bars i, .v-lines i, .x-stack .card { transition: none; }
  .in .v-chips span { animation: none; }
}
