/* ───────── Apps — one conversation across many apps ─────────
   Calm (no JS / reduced motion): the beat statements, the example request
   with its three results, then the two groups (built in, add-ons) as tile
   grids. Pinned: one stage, three beats. apps.js gives every tile, label,
   result and the chain line its place per beat (--x/--y in em from the stage
   centre, --s scale, --o opacity) and CSS glides between them; within the
   middle beat it types the request and lands the results one by one.
   App marks are the makers' own, unmodified, on light icon tiles. */
.act--cx .act__stage { padding-bottom: 140px; }
.cx__say h3 { font-size: clamp(26px, 2.4vw, 34px); letter-spacing: -.035em; line-height: 1.05; }
.cx__say p { margin-top: 10px; max-width: 54ch; color: var(--text-2); font-size: 16px; line-height: 1.5; }
.cx__says { display: grid; gap: 28px; margin-bottom: 56px; }

/* Tiles */
.cx__wall { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 22px 18px; }
.cx__tile { display: grid; justify-items: center; gap: 8px; width: 76px; }
.cx__icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 16px; background: #F4F4F6; box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 10px 24px -12px rgba(0, 0, 0, .8); }
.cx__icon img { width: 58%; height: 58%; object-fit: contain; }
.cx__tile--sen .cx__icon { background: none; box-shadow: none; }
.cx__tile--sen .om { width: 100%; height: 100%; }
.cx__name { font-size: 12px; line-height: 1.2; color: var(--text-2); text-align: center; }
.cx__tile--sen { display: none; }
.cx__label { flex: 0 0 100%; display: grid; gap: 4px; margin-top: 18px; }
.cx__label:first-of-type { margin-top: 0; }
.cx__label b { font-size: 18px; letter-spacing: -.02em; }
.cx__label span { max-width: 52ch; font-size: 14.5px; line-height: 1.5; color: var(--text-2); }

/* The request and what Sen did */
.cx__ask { display: flex; align-items: center; gap: 12px; max-width: 620px; min-height: 48px; padding: 10px 8px 10px 18px; border-radius: var(--r-pill); background: var(--composer); border: 1px solid var(--composer-edge); font-size: 15px; line-height: 1.4; }
.cx__typed { flex: 1; min-width: 0; }
.cx__ask i { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--on-accent); }
.cx__ask .ic { width: 13px; height: 13px; transform: rotate(-90deg); }
.cx__steps { list-style: none; margin: 18px 0 64px; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.cx__step { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-card); background: var(--bg-surface); border: 1px solid var(--border-default); }
.cx__step img { flex: none; width: 18px; height: 18px; }
.cx__step > span { display: grid; line-height: 1.3; }
.cx__step b { font-size: 14px; }
.cx__step > span > span { font-size: 12.5px; color: var(--text-2); }
.cx__ok { flex: none; display: grid; place-items: center; width: 18px; height: 18px; margin-left: auto; border-radius: 50%; background: var(--ok); color: #fff; }
.cx__ok .ic { width: 11px; height: 11px; }
.cx__line { display: none; }

/* ── Pinned ── */
html.js:not(.reduce-motion) .act--cx { height: calc(100svh + 300vh); }
html.js:not(.reduce-motion) .act--cx .act__stage { padding-bottom: 44px; }
html.js:not(.reduce-motion) .cx { position: absolute; inset: 0; --u: clamp(7px, min(calc((100vw - 2 * var(--gutter)) / 66), calc((100svh - 300px) / 37)), 15px); }
html.js:not(.reduce-motion) .cx__says { position: absolute; left: var(--pad-x); right: var(--pad-x); top: clamp(84px, 12svh, 120px); margin: 0; display: block; text-align: center; }
html.js:not(.reduce-motion) .cx__say { position: absolute; left: 0; right: 0; top: 0; opacity: 0; visibility: hidden; translate: 0 36px; transition: opacity 320ms var(--e-out), translate 600ms var(--e-io), visibility 0s linear 600ms; }
html.js:not(.reduce-motion) .cx__say h3 { font-size: clamp(34px, min(4.6vw, 7svh), 68px); letter-spacing: -.045em; line-height: 1; }
html.js:not(.reduce-motion) .cx__say p { max-width: 46ch; margin: 12px auto 0; font-size: clamp(15px, 1.25vw, 18px); }
html.js:not(.reduce-motion) .act--cx[data-phase="0"] .cx__say[data-beat="0"],
html.js:not(.reduce-motion) .act--cx[data-phase="1"] .cx__say[data-beat="1"],
html.js:not(.reduce-motion) .act--cx[data-phase="2"] .cx__say[data-beat="2"] { opacity: 1; visibility: visible; translate: 0 0; transition: opacity 500ms var(--e-out) 120ms, translate 650ms var(--e-io) 120ms, visibility 0s; }
html.js:not(.reduce-motion) .act--cx[data-phase="1"] .cx__say[data-beat="0"],
html.js:not(.reduce-motion) .act--cx[data-phase="2"] .cx__say:not([data-beat="2"]) { translate: 0 -36px; }

/* The stage: a zero-size point at its centre; everything hangs off it in em. */
html.js:not(.reduce-motion) .cx__stage { position: absolute; left: 50%; top: calc(50% + clamp(60px, 8svh, 90px)); width: 0; height: 0; font-size: var(--u); }
html.js:not(.reduce-motion) .cx__wall { display: block; }
html.js:not(.reduce-motion) :is(.cx__tile, .cx__label, .cx__step, .cx__ask, .cx__line) {
    position: absolute; left: 0; top: 0; margin: 0;
    transform: translate(calc(var(--x, 0) * 1em), calc(var(--y, 0) * 1em)) translate(var(--ax, -50%), var(--ay, -50%)) scale(var(--s, 1));
    opacity: var(--o, 0);
    transition: transform 950ms var(--e-io) var(--d, 0ms), opacity 500ms var(--e-out) var(--d, 0ms);
}
html.js:not(.reduce-motion) .cx__tile { width: 4.6em; gap: .5em; }
html.js:not(.reduce-motion) .cx__tile--sen { display: grid; z-index: 2; }
html.js:not(.reduce-motion) .cx__icon { width: 4.6em; height: 4.6em; border-radius: 1.1em; box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 .9em 1.8em -.9em rgba(0, 0, 0, .85); }
html.js:not(.reduce-motion) .cx__name { position: absolute; top: 100%; left: 50%; width: 9em; margin: .45em 0 0 -4.5em; font-size: .72em; opacity: 0; transition: opacity 400ms var(--e-out); }
html.js:not(.reduce-motion) .act--cx[data-phase="2"] .cx__tile:not(.cx__tile--sen) .cx__name { opacity: 1; transition-delay: 700ms; }
html.js:not(.reduce-motion) .cx__label { width: var(--lw, 14em); --ay: -100%; }
html.js:not(.reduce-motion) .cx__label b { font-size: 1.35em; }
html.js:not(.reduce-motion) .cx__label span { font-size: .95em; }

html.js:not(.reduce-motion) .cx__ask { width: 46em; max-width: none; min-height: 0; height: 3.4em; padding: 0 .5em 0 1.3em; font-size: 1em; white-space: nowrap; overflow: hidden; }
html.js:not(.reduce-motion) .cx__typed { overflow: hidden; text-overflow: clip; }
html.js:not(.reduce-motion) .cx__ask i { width: 2.3em; height: 2.3em; }
html.js:not(.reduce-motion) .cx__ask .ic { width: 1em; height: 1em; }
html.js:not(.reduce-motion) .cx__caret { display: inline-block; width: 1.5px; height: 1.05em; margin-left: 1px; background: var(--text-1); vertical-align: -.18em; animation: blink 1.1s steps(1) infinite; }

html.js:not(.reduce-motion) .cx__steps { display: block; margin: 0; }
html.js:not(.reduce-motion) .cx__step { width: 12.5em; gap: .7em; padding: .8em .9em; border-radius: 1em; font-size: 1em; --ay: 0%; box-shadow: var(--float-shadow); }
html.js:not(.reduce-motion) .cx__step img { width: 1.3em; height: 1.3em; }
html.js:not(.reduce-motion) .cx__step b { font-size: .95em; white-space: nowrap; }
html.js:not(.reduce-motion) .cx__step > span > span { font-size: .82em; }
html.js:not(.reduce-motion) .cx__ok { width: 1.3em; height: 1.3em; scale: 0; transition: scale 300ms var(--e-out) 250ms; }
html.js:not(.reduce-motion) .cx__ok .ic { width: .8em; height: .8em; }
html.js:not(.reduce-motion) .cx__step.is-on .cx__ok { scale: 1; }

/* The chain: a hairline from Sen through the three apps, filled as each step lands */
html.js:not(.reduce-motion) .cx__line { display: block; z-index: 0; width: var(--lw, 42em); height: 2px; --ax: 0%; border-radius: 2px; background: var(--border-default); overflow: hidden; }
html.js:not(.reduce-motion) .cx__line i { position: absolute; inset: 0; background: var(--text-1); transform-origin: left; transform: scaleX(var(--lp, 0)); }
html.js:not(.reduce-motion) .cx__stage[data-layout="narrow"] .cx__line { width: 2px; height: var(--lw, 27em); --ax: -50%; --ay: 0%; }
html.js:not(.reduce-motion) .cx__stage[data-layout="narrow"] .cx__line i { transform-origin: top; transform: scaleY(var(--lp, 0)); }
html.js:not(.reduce-motion) .cx__stage[data-layout="narrow"] .cx__step { width: 19em; --ax: 0%; --ay: -50%; }

@media (max-width: 767px) {
    .cx__tile { width: 68px; }
    .cx__icon { width: 56px; height: 56px; border-radius: 14px; }
    html.js:not(.reduce-motion) .cx__says { top: 76px; }
    html.js:not(.reduce-motion) .cx__say h3 { font-size: 34px; }
    html.js:not(.reduce-motion) .cx__say p { font-size: 15px; }
}
/* The tall layout (apps.js: phones and portrait tablets) */
html.js:not(.reduce-motion) .act--cx[data-layout="narrow"] .cx { --u: clamp(6.5px, min(calc((100vw - 28px) / 37), calc((100svh - 330px) / 56)), 14px); }
html.js:not(.reduce-motion) .act--cx[data-layout="narrow"] .cx__stage { top: calc(50% + clamp(70px, 8svh, 110px)); }
html.js:not(.reduce-motion) .act--cx[data-layout="narrow"] .cx__ask { width: 34em; height: 4.4em; white-space: normal; line-height: 1.3; font-size: .95em; }
