/* Muve — shared effects for the inner pages (see fx.js). Everything here is transform / opacity, and has a still. */

/* ---------- mesh: the living background (fx.js). The canvas is transparent where the ribbon isn't, so the paper shows
   through. Under it sits a CSS picture of the same band in the same four colours: that is what shows with no WebGL and no
   JS. It steps aside once the canvas has drawn a frame. Never put text straight on the ribbon: copy sits on paper or a card. */
.mesh { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.mesh::before { content: ""; position: absolute; right: -8%; top: -30%; width: 46%; height: 170%; border-radius: 46% 54% 50% 50% / 30% 30% 70% 70%; rotate: var(--mesh-rot, 26deg); filter: blur(1px);
  background: linear-gradient(100deg, var(--m0, var(--blue)) 0%, var(--m1, var(--violet)) 34%, var(--m2, var(--cyan)) 66%, var(--m3, var(--pink)) 100%);
  box-shadow: 0 0 80px 10px color-mix(in srgb, var(--m2, var(--cyan)) 30%, transparent); opacity: 1; transition: opacity 700ms var(--ease-io); }
.mesh.is-live::before, .mesh.is-still::before { opacity: 0; }
.mesh.is-still { background-size: 100% 100%; background-repeat: no-repeat; }
.mesh canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 900ms var(--ease-io); }
.mesh canvas.is-live { opacity: 1; }
.mesh:has(canvas[data-flip])::before { right: auto; left: -8%; rotate: calc(var(--mesh-rot, 26deg) * -1); }
/* the hero's lower edge, cut on the diagonal (the Stripe edge) */
.mesh--skew { --skew: clamp(40px, 9vw, 150px); clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--skew)), 0 100%); }
/* a scrim that keeps the copy side on paper however the ribbon moves */
.mesh--fade::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--ground) 0%, color-mix(in srgb, var(--ground) 88%, transparent) 36%, transparent 70%); }
.mesh:has(canvas[data-flip]).mesh--fade::after { background: linear-gradient(270deg, var(--ground) 0%, color-mix(in srgb, var(--ground) 88%, transparent) 36%, transparent 70%); }
/* field: the whole box is a soft colour field (bands and cards lower down, never a hero) */
.mesh--field::before { inset: 0; width: auto; height: auto; border-radius: 0; rotate: none; filter: none; box-shadow: none;
  background: radial-gradient(60% 80% at 78% 18%, var(--m3, var(--pink)) 0%, transparent 62%), radial-gradient(70% 90% at 18% 82%, var(--m2, var(--cyan)) 0%, transparent 60%), linear-gradient(120deg, var(--m0, var(--blue)), var(--m1, var(--violet))); }
/* glow: a field softened to a halo behind a feature block */
.mesh--glow { inset: -8% -4%; opacity: .5; filter: blur(48px) saturate(1.2); -webkit-mask-image: radial-gradient(60% 60% at 50% 50%, #000 30%, transparent 75%); mask-image: radial-gradient(60% 60% at 50% 50%, #000 30%, transparent 75%); }
@media (max-width: 760px) { .mesh--glow { filter: blur(32px) saturate(1.2); } }

/* ---------- diagonal section edges ---------- */
.skew { --skew: clamp(28px, 6vw, 96px); position: relative; isolation: isolate; }
.skew::before { content: ""; position: absolute; inset: calc(var(--skew) * -1) 0 calc(var(--skew) * -1) 0; z-index: -1; background: var(--skew-bg, var(--white)); clip-path: polygon(0 var(--skew), 100% 0, 100% calc(100% - var(--skew)), 0 100%); }
.skew--navy { --skew-bg: var(--navy); color: var(--paper); }
.skew--navy .t-lede, .skew--navy .t-body, .skew--navy .soft { color: var(--navy-muted); }
.skew--navy :focus-visible { outline-color: var(--paper); }

/* ---------- .hl: the accent phrase in a headline (X 11/19: "Change it any month is in grey and is dull, I want a cool
   stripe.com text effect when highlighting those phrases across the site"). The phrase is filled with a gradient of the
   page's own hues (fx.js reads them from the page's hero ribbon), which drifts slowly; on scroll-in it sweeps from ink to
   the gradient. Every stop is an -ink colour: each passes 4.5:1 on paper and on white (see muve.css), so the text passes
   at every point along the gradient. On navy the stops are the light hues. `color` stays a real ink colour (the fill is
   made transparent with -webkit-text-fill-color), so the text is still there if background-clip is unsupported.
   `.t-duo > span` (the old stepped-back second sentence) is the same component. */
.hl, .t-duo > span { --hl-ink: var(--ink); color: var(--hl-a, var(--blue-ink)); -webkit-text-fill-color: transparent;
  background-image: linear-gradient(var(--hl-ink), var(--hl-ink)), linear-gradient(100deg, var(--hl-a, var(--blue-ink)) 0%, var(--hl-b, var(--violet-ink)) 25%, var(--hl-c, var(--pink-ink)) 50%, var(--hl-d, var(--orange-ink)) 75%, var(--hl-a, var(--blue-ink)) 100%);
  background-size: var(--hl-wipe, 0%) 100%, 200% 100%; background-position: 100% 0, var(--hl-x, 0%) 0; background-repeat: no-repeat, repeat;
  -webkit-background-clip: text; background-clip: text; -webkit-box-decoration-break: slice; box-decoration-break: slice; padding-bottom: .08em;
  animation: hl-drift 14s linear infinite; }
.js .hl, .js .t-duo > span { --hl-wipe: 100%; transition: background-size 1100ms var(--ease-out) 150ms; }
.js .hl.is-in, .js .t-duo > span.is-in { --hl-wipe: 0%; }
.hl.is-off, .t-duo > span.is-off { animation-play-state: paused; }
@keyframes hl-drift { to { background-position: 100% 0, -200% 0; } }
.band-navy .hl, .skew--navy .hl, .band-navy .t-duo > span, .skew--navy .t-duo > span, .hl--light { --hl-ink: var(--paper); color: var(--m-cyan);
  background-image: linear-gradient(var(--hl-ink), var(--hl-ink)), linear-gradient(100deg, var(--m-cyan) 0%, #9db4ff 25%, #ff9be2 50%, #ffc46b 75%, var(--m-cyan) 100%); }
@supports not ((-webkit-background-clip: text) or (background-clip: text)) { .hl, .t-duo > span { -webkit-text-fill-color: currentColor; background: none; } }

/* ---------- tilt ---------- */
[data-tilt] { transform: perspective(1100px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform 700ms var(--ease-out); }   /* flat on purpose: with preserve-3d the half that leans away drops behind the page and its buttons stop taking clicks */
[data-tilt].is-tilt { transition: transform 120ms linear; will-change: transform; }

/* ---------- gcard: a card whose border lights up under the pointer ---------- */
.gcard { position: relative; border-radius: var(--r); background: var(--white); box-shadow: inset 0 0 0 1px rgba(11, 27, 51, .08), var(--sh-1); isolation: isolate; transition: box-shadow var(--t-panel) var(--ease-out); }
.gcard::before { content: ""; position: absolute; inset: -1px; z-index: -1; border-radius: inherit; padding: 1.5px; opacity: 0; pointer-events: none;
  background: radial-gradient(260px circle at var(--gx, 50%) var(--gy, 0%), var(--hue), var(--pink) 38%, transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  transition: opacity var(--t-panel) var(--ease-out); }
.gcard::after { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; opacity: 0; pointer-events: none; background: radial-gradient(340px circle at var(--gx, 50%) var(--gy, 0%), color-mix(in srgb, var(--hue) 12%, transparent), transparent 70%); transition: opacity var(--t-panel) var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .gcard:hover { box-shadow: inset 0 0 0 1px rgba(11, 27, 51, .08), var(--sh-2); } .gcard:hover::before, .gcard:hover::after { opacity: 1; } }
:where(a.gcard) { display: block; }   /* zero specificity: a page's own layout for a linked card (grid, flex) always wins */
a.gcard { text-decoration: none; color: var(--ink); }
a.gcard:focus-visible { box-shadow: inset 0 0 0 1px rgba(11, 27, 51, .08), var(--sh-2); color: var(--ink); }

/* ---------- a wash of colour inside a card, under a UI mock-up (Stripe's bento backgrounds) ---------- */
.wash { position: absolute; inset: 0; z-index: -1; border-radius: inherit; overflow: hidden; pointer-events: none; }
.wash::before { content: ""; position: absolute; inset: 35% -20% -40% -20%; background: radial-gradient(50% 60% at 30% 60%, var(--hue) 0%, transparent 70%), radial-gradient(50% 60% at 75% 70%, var(--wash-2, var(--pink)) 0%, transparent 70%); filter: blur(28px); opacity: .5; animation: wash-drift 14s var(--ease-io) infinite alternate; }
@keyframes wash-drift { to { translate: 6% -8%; scale: 1.12; } }
.gridpaper { background-image: linear-gradient(rgba(11, 27, 51, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(11, 27, 51, .06) 1px, transparent 1px); background-size: 28px 28px; }

/* ---------- odometer ---------- */
.odo { font-variant-numeric: normal; }
.odo__vis { display: inline-flex; align-items: baseline; }
/* X 11/20: copying a rolled number gave the 0-9 strips; the rolling copy is not selectable, so a copy picks up the real value (the .sr-only span) */
.odo__vis, .cost-range__vis { -webkit-user-select: none; user-select: none; }   /* .cost-range__vis: the calculator's own ticker (calc/cost.js) */
.odo__col { display: inline-block; height: 1em; line-height: 1; overflow: hidden; vertical-align: baseline; text-align: center; }
.odo__strip { display: block; white-space: pre; line-height: 1; translate: 0 0; transition: translate 1400ms var(--ease-out); transition-delay: calc(var(--n, 0) * 90ms); }
.odo.is-in .odo__strip { translate: 0 calc(var(--to) * -1em); }
.odo__sep { line-height: 1; }

/* ---------- marquee ---------- */
[data-marquee] { display: flex; overflow: hidden; gap: var(--mq-gap, 56px); -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
[data-marquee] > * { display: flex; align-items: center; gap: var(--mq-gap, 56px); flex: none; min-width: 100%; justify-content: space-around; }
[data-marquee].is-run > * { animation: mq var(--mq-t, 38s) linear infinite; }
[data-marquee].is-off > *, [data-marquee]:hover > *, [data-marquee]:focus-within > * { animation-play-state: paused; }
@keyframes mq { to { translate: calc(-100% - var(--mq-gap, 56px)) 0; } }

/* ---------- story: copy steps on one side, a pinned visual on the other ---------- */
.story { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(24px, 5vw, 80px); align-items: start; }
.story__pin { position: sticky; top: calc(var(--nav-h) + var(--nav-inset) + 32px); align-self: start; min-width: 0; }
.story__steps { display: grid; gap: clamp(48px, 16vh, 180px); padding-block: clamp(24px, 10vh, 120px); }
.story__step { opacity: .38; transition: opacity var(--t-panel) var(--ease-out); }
.story__step.is-on { opacity: 1; }
html:not(.js) .story__step { opacity: 1; }
@media (max-width: 900px) { .story { grid-template-columns: 1fr; } .story__pin { position: sticky; top: calc(var(--nav-h) + var(--nav-inset) + 8px); z-index: 2; order: -1; } .story__steps { gap: 40px; padding-block: 16px 0; } .story__step { opacity: 1; } }

/* ---------- typing caret ---------- */
[data-type].is-typing::after { content: ""; display: inline-block; width: .5em; height: 1em; margin-left: 2px; vertical-align: -.12em; background: currentColor; animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }

/* ---------- a next step under a section: one plain link with the growing arrow ---------- */
.next { position: relative; display: inline-block; max-width: 100%; min-height: 44px; padding: 10px 36px 10px 0; line-height: 1.4; font-size: var(--text-lg); font-weight: 400; color: var(--hue-ink); text-decoration: none; transition: color var(--t-hover) var(--ease-out); }
/* X 11/20 ("text overlapping … fix across whole website"): as inline-flex, a wrapped label left its arrow floating beside the
   two-line block (or, on phones, alone on its own line). The arrow now takes its static position right after the last word
   (absolute, no offsets) so it can never wrap alone; the 36px end padding keeps room for it, hover width included. */
.next > .arrow { position: absolute; margin: calc(.7em - 5px) 0 0 10px; }
.next { text-wrap: wrap; }   /* balance/pretty (inherited from headings and ledes) lay the zero-width arrow out on a line of its own in Chrome */
.next > span { text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 5px; transition: text-decoration-color var(--t-hover) var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .next:hover { color: var(--ink); } .next:hover > span { text-decoration-color: currentColor; } }
.next:focus-visible { color: var(--ink); }
.next:focus-visible > span { text-decoration-color: currentColor; }
.skew--navy .next, .band-navy .next { color: var(--m-cyan); }
@media (hover: hover) and (pointer: fine) { .skew--navy .next:hover, .band-navy .next:hover { color: #ffffff; } }
.skew--navy .next:focus-visible, .band-navy .next:focus-visible { color: #ffffff; }

@media (prefers-reduced-motion: reduce) {
  .hl, .t-duo > span { animation: none; }
  .js .hl, .js .t-duo > span { --hl-wipe: 0%; transition: none; }
  .mesh canvas, .mesh::before, [data-tilt], .gcard, .gcard::before, .gcard::after, .odo__strip, .story__step, .next, .next > span { transition: none; }
  .wash::before, [data-marquee].is-run > *, [data-type].is-typing::after { animation: none; }
  [data-tilt] { transform: none; }
  .story__step { opacity: 1; }
  [data-marquee] { flex-wrap: wrap; -webkit-mask-image: none; mask-image: none; }
  [data-marquee] > * { flex-wrap: wrap; min-width: 0; justify-content: flex-start; }
}
/* phone/tablet home hero: the mesh box starts mid-hero (below the copy), and its top edge sliced the ribbon flat.
   Fade the box in from the top so the ribbon arrives softly instead of being cut. */
@media (max-width: 999px) { .phero.hh > .mesh { -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 28%); mask-image: linear-gradient(to bottom, transparent 0, #000 28%); } }
/* phones: the pinned story card sat under the sticky header and together they held ~half the screen while copy slid
   beneath it. On a phone the card scrolls with its section; each step still reads on its own. */
@media (max-width: 760px) { .story__pin { position: relative; top: auto; } }
/* a wrapped "next" link kept its arrow pinned to the far edge; the label shrinks to its own text so the arrow follows it */
.next > span { display: inline; }
/* home hero rhythm (X 11/19 "check spacing and padding for home hero"): the gaps were height-based (2vh) and collapsed on
   shorter screens (eyebrow 6px under the nav and tabs 12px under the buttons at 1024x768) while ~94px sat empty below
   the tabs at 1440. One width-based scale with floors: air under the nav, a clear break before the tabs, a tighter end. */
.phero.hh .hs { padding-top: clamp(36px, 4.4vw, 64px); gap: clamp(32px, 3.4vw, 52px); }
.phero.hh { padding-bottom: clamp(40px, 4.6vw, 72px); }
.phero.hh .hs__dek { margin-top: clamp(16px, 1.6vw, 24px); }
.phero.hh .hs__cta { margin-top: clamp(24px, 2.4vw, 36px); }
.phero.hh .hs__k { margin-bottom: clamp(14px, 1.4vw, 20px); }
@media (max-width: 999px) {
  .phero.hh .hs { padding-top: 20px; gap: 24px; }
  /* the tab strip scrolls sideways on phones: fade its far edge so it reads as "more this way", not cut off */
  .phero.hh .hs__tabs { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent); }
}

/* ---------- accordions: X 11/20. Motion is fx.js (accToggle); the calculator's two kinds turn their +/− back at the start of a
   close (they carry .is-closing until the height has run down). The .qa look is in site.css. */
.cost .cost-fine.is-closing > summary .cost-ic::after, .cost .cost-rcp.is-closing .cost-rcp__sw::after { rotate: 90deg; }

/* ---------- the ribbon as a band on a stacked hero: X 11/20 ("the stripe wave background thing doesnt show up enough on
   mobile"). fx.js adds .is-band once the hero stacks and fits the box to the art: colour fades in over the gap above the
   art (--lead-in), runs full strength and full bleed behind it, and fades out before any text below (--lead-out) or runs
   on to the hero's diagonal foot. Copy is never on it. Beats the older phone masks (mobile.css 2c, fx.css .hh). */
.phero > .mesh.is-band:not(.mesh--glow) { height: auto; opacity: 1;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 var(--lead-in, 72px), #000 calc(100% - var(--lead-out, 0px)), transparent 100%); mask-image: linear-gradient(to bottom, transparent 0, #000 var(--lead-in, 72px), #000 calc(100% - var(--lead-out, 0px)), transparent 100%);
  /* no transition on top/bottom here: animating them moved the ribbon ~700px on load = a layout shift (blog-ai CLS 0.54, perf-gate 11/20).
     Only a hero with slides glides the band from slide to slide (rule below). */
  /* a soft wash of the same four hues under the ribbon, so the whole band is colour (full bleed), not a stripe on paper */
  background: radial-gradient(90% 55% at 88% 22%, color-mix(in srgb, var(--m1, var(--violet)) 34%, transparent), transparent 72%),
    radial-gradient(80% 50% at 8% 78%, color-mix(in srgb, var(--m2, var(--cyan)) 30%, transparent), transparent 72%),
    radial-gradient(70% 45% at 60% 100%, color-mix(in srgb, var(--m3, var(--pink)) 26%, transparent), transparent 70%),
    linear-gradient(180deg, color-mix(in srgb, var(--m0, var(--blue)) 10%, var(--ground)), color-mix(in srgb, var(--m0, var(--blue)) 16%, var(--ground))); }
@media (prefers-reduced-motion: no-preference) { .phero:has([data-slide]) > .mesh.is-band:not(.mesh--glow) { transition: translate 620ms var(--ease-io), height 620ms var(--ease-io); } }
/* the band paints its own wash + ribbon/still, so the CSS blob is not drawn in it: otherwise placing the band (top: 0 → N px)
   moves the blob = a layout shift on every stacked phone hero (perf-gate CLS 0.11, 11/20) */
.phero > .mesh.is-band::before { display: none; }
/* no WebGL: the build-time still was made at desktop shape; in a tall box it is cropped, not stretched */
.phero > .mesh.is-band.is-still { background-size: cover; background-position: 62% 50%; }
@media (prefers-reduced-motion: reduce) { .phero > .mesh.is-band { transition: none; } }

/* ---------- the dark close band on phones: X 11/20. The ribbon was a 55% wash under the headline. It is now a full-strength
   strip of colour above the headline: the band gains that room at the top, and the colour fades out before the first line,
   so the headline sits on flat navy (and the card under it is solid navy as before). */
@media (max-width: 900px) {
  .foot .band-navy:has(> .close__mesh) { padding-top: calc(var(--sp-section) + clamp(72px, 20vw, 130px)); }
  .foot .band-navy > .close__mesh { --mesh-zoom: 1.9; inset: 0 0 auto 0; height: calc(var(--sp-section) + clamp(72px, 20vw, 130px) - 8px); opacity: 1;
    -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 64%, transparent 100%); mask-image: linear-gradient(180deg, #000 0%, #000 64%, transparent 100%); }
  .foot .band-navy > .close__mesh.is-still { background-size: cover; background-position: 50% 40%; }
}
