/* Shared page components (registry: team/COMPONENTS.md). Pages add pg-common.css (+ pg-common.js) to their meta.
   Components here:
   - .hero-mob       hero whose copy column unfolds on phones so the demo sits right under the CTA row (.h-home, .ph, .v-hero)
   - .bfa            "the problem today": the old way struck through, the new way as a chip
   - .fork-band      a dark divider band that changes audience ("Hosting a room?") with a button
   - .close-chips    one-line chips above the closing band buttons
   - .snap-m         a list that becomes a sideways snap carousel on phones
   - .stat-band      a dark stage band: a real screen + a small inset + the Tier-1 .nums row
   - .sloop          real product screens, fast-forwarded, with step buttons and a pause button (pg-common.js)
   - [data-rail]     a list that becomes a sideways snap rail with dots on phones (pg-common.js)
   Shared components that live elsewhere: .crop, .sec-cta, .vpp, closing .cta-band (system.css);
   .hook, .role-chip, .round, .mm, .drop, .htabs (home.css). */

/* ---------- Hero that puts the demo high on phones ---------- */
@media (max-width: 1020px) {
  .hero-mob > .h-home__copy, .hero-mob > .ph__copy, .hero-mob > .v-hero__copy { display: contents; }
  .hero-mob { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; justify-items: start; }
  .hero-mob > * { min-width: 0; }
  .hero-mob > .hero-mob__demo { width: 100%; order: 10; margin-top: 6px; }
  .hero-mob .facts, .hero-mob .kf-after, .hero-mob .v-for { order: 20; }
}

/* ---------- The problem today: old way struck, new way as a chip ---------- */
.bfa { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.bfa__head { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.3fr) 28px minmax(0, 1.3fr); gap: 16px; padding: 0 22px 2px; font-size: var(--t-xs); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
[lang="ar"] .bfa__head { text-transform: none; letter-spacing: 0; }
.bfa__head span:nth-child(2) { color: var(--c-live); }
.bfa__head span:last-child { grid-column: 4; color: var(--violet-ink); }
.bfa li { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.3fr) 28px minmax(0, 1.3fr); align-items: center; gap: 16px; padding: 18px 22px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.bfa__k { display: flex; align-items: center; gap: 12px; font-family: var(--f-display); font-weight: 700; font-size: 1.18rem; line-height: 1.2; color: var(--ink); }
.bfa__k .icon-tile { flex: none; }
.bfa__old { display: grid; gap: 2px; color: var(--ink-3); }
.bfa__old s { font-weight: 650; color: var(--ink-2); text-decoration-color: var(--c-live); text-decoration-thickness: 2px; }
.bfa__old small { font-size: var(--t-xs); }
.bfa__go { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-2); color: var(--ink-3); }
.bfa__go svg { width: 14px; height: 14px; }
[dir="rtl"] .bfa__go svg { transform: scaleX(-1); }
.bfa__new { justify-self: start; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 10px; border-radius: 999px; background: var(--violet-soft); color: var(--violet-ink); font-weight: 650; font-size: .93rem; line-height: 1.3; }
[dir="rtl"] .bfa__new { padding: 8px 10px 8px 14px; }
.bfa__new svg { flex: none; width: 16px; height: 16px; }
@media (max-width: 820px) {
  .bfa__head { display: none; }
  .bfa li { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 16px; }
  .bfa__k { font-size: 1.08rem; }
  .bfa__go { display: none; }
  .bfa__new { font-size: .88rem; }
}

/* ---------- A dark band that switches audience ---------- */
.fork-band { border: 1px solid var(--stage-line); display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 18px 32px; padding: clamp(26px, 3.4vw, 44px) clamp(22px, 4vw, 56px); border-radius: var(--r-xl); background: var(--stage); color: var(--stage-ink); }
.fork-band .role-chip { margin-bottom: 10px; }
.fork-band h2 { margin: 0; font-family: var(--f-display); font-weight: 800; font-size: clamp(1.7rem, 1.2rem + 1.8vw, 2.6rem); line-height: 1.08; letter-spacing: -.02em; color: var(--stage-ink); }
.fork-band p { margin: 10px 0 0; color: var(--stage-ink-2); max-width: 54ch; }
.fork-band :focus-visible { outline-color: #c9b8ff; }
@media (max-width: 760px) { .fork-band { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Chips in the closing band ---------- */
.close-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.close-chips li { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 8px; border-radius: 999px; border: 1px solid var(--stage-line); background: rgba(255,255,255,.05); color: var(--stage-ink-2); font-size: .88rem; font-weight: 600; }
[dir="rtl"] .close-chips li { padding: 7px 8px 7px 14px; }
.close-chips b { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 255, 198, .14); color: var(--mint-bright); font-family: var(--f-mono); font-size: 11px; }

/* ---------- Sideways snap list on phones ---------- */
@media (max-width: 700px) {
  .snap-m { display: grid; grid-auto-flow: column; grid-auto-columns: 82%; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; scrollbar-width: thin; }
  .snap-m > li { scroll-snap-align: start; }
}

/* ---------- Stat band: a real screen with a small inset, then the Tier-1 numbers, on a dark stage ---------- */
.stat-band__shot { position: relative; margin: clamp(24px, 3vw, 40px) auto 0; max-width: 1000px; padding-bottom: 7%; }
.stat-band__call { width: 88%; }
.stat-band__inset { position: absolute; inset-inline-end: 0; bottom: 0; width: 34%; display: grid; gap: 8px; }
.stat-band__inset .frame { box-shadow: 0 24px 60px -20px rgba(0,0,0,.8); border-radius: 14px; overflow: hidden; }
.stat-band__inset p { margin: 0; font-size: var(--t-xs); font-weight: 600; color: var(--stage-ink-2); }
.stat-band .crop-cap { color: var(--stage-ink-3); max-width: 52%; }
.stat-band .nums { margin-top: clamp(32px, 4vw, 52px); border-color: var(--stage-line); }
.stat-band .nums > div { border-color: var(--stage-line); }
.stat-band .nums b { color: var(--stage-ink); }
.stat-band .nums span { color: var(--stage-ink-2); }
.stat-band .nums-note { color: var(--stage-ink-3); }
@media (max-width: 600px) {
  .stat-band__shot { padding-bottom: 0; display: grid; gap: 12px; }
  .stat-band__call { width: 100%; }
  .stat-band__inset { position: relative; inset: auto; width: 84%; justify-self: center; }
  .stat-band .crop-cap { max-width: none; }
}
@media (max-width: 760px) {
  .stat-band .nums > div:nth-child(2n) { border-inline-end: 0; }
  .stat-band .nums > div:nth-child(n+3) { border-top: 1px solid var(--stage-line); }
}

/* ---------- Shot loop: real screens, fast-forwarded (pg-common.js) ----------
   <figure class="sloop" data-sloop data-every="3200" data-text='{"pause":..,"play":..}'> .sloop__frame > .sloop__shots > .sloop__shot (.crop)…,
   .sloop__foot > ol.sloop__steps (buttons) + button.sloop__pp[data-sloop-pp]. Options: .sloop--light; .sloop--badge-top (badge top-right, over empty space). */
.sloop { margin: 0; display: grid; gap: 12px; min-width: 0; }
.sloop__frame { box-shadow: var(--shadow-lg); }
.sloop__shots { position: relative; aspect-ratio: 16 / 10; background: #0b0a14; }
.sloop--light .sloop__shots { background: var(--surface-2); }
.sloop__shot { position: absolute; inset: 0; aspect-ratio: auto; opacity: 0; transition: opacity .45s var(--ease); }
.sloop__shot.is-on { opacity: 1; }
/* No JS: the first screen stands still; the others stay out of the way instead of sitting invisible. */
html:not(.js) .sloop__shot:not(:first-child), html:not(.js) .sloop__pp { display: none; }
html:not(.js) .sloop__shot:first-child { opacity: 1; }
.sloop__shot .crop { position: absolute; inset: 0; aspect-ratio: auto; }
/* A .crop--fit shot keeps the panel's buttons clear of the step badge at the bottom */
.sloop__shot .crop--fit > img { padding: 3% 6% 10%; }
@media (max-width: 600px) { .sloop__shot .crop--fit > img { padding: 2% 4% 15%; } }
.sloop__badge { position: absolute; z-index: 2; inset-inline-start: 14px; bottom: 14px; display: inline-flex; align-items: center; gap: 8px; max-width: calc(100% - 28px); padding: 8px 14px 8px 10px; border-radius: 12px; background: rgba(9, 8, 15, .84); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: #fff; font-size: var(--t-xs); font-weight: 650; box-shadow: 0 14px 30px -14px rgba(0,0,0,.6); }
.sloop--badge-top .sloop__badge { top: 14px; bottom: auto; left: auto; right: 14px; inset-inline-start: auto; }
.sloop__badge i { font-style: normal; font-family: var(--f-mono); font-size: 10.5px; color: var(--mint-bright); }
.sloop__foot { display: flex; align-items: center; gap: 12px; }
.sloop__steps { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 10px; }
.sloop__steps li { position: relative; display: grid; }
.sloop__steps button { display: grid; gap: 8px; align-content: start; min-height: 44px; padding: 0 0 6px; border: 0; background: none; color: var(--ink-3); font: inherit; font-size: var(--t-xs); font-weight: 600; text-align: start; cursor: pointer; line-height: 1.3; }
.sloop__steps button::before { content: ""; height: 3px; border-radius: 3px; background: var(--line-2); }
.sloop__steps li.is-on button { color: var(--ink); }
.sloop__steps li.is-on button::before { background: var(--violet); }
.sloop__steps li.is-timing::after { content: ""; position: absolute; inset-inline-start: 0; top: 0; height: 3px; width: 100%; border-radius: 3px; background: var(--violet); transform-origin: left center; animation: sloopTime var(--auto, 3200ms) linear both; }
[dir="rtl"] .sloop__steps li.is-timing::after { transform-origin: right center; }
.sloop__steps li.is-timing button::before { background: var(--line-2); }
@keyframes sloopTime { from { transform: scaleX(0); } to { transform: scaleX(1); } }
/* Option: a <small> sub-label under a step's name (hidden on phones) */
.sloop__steps button small { display: block; font-size: .72rem; font-weight: 500; color: var(--ink-3); }
.sloop__steps button:focus-visible { outline: 2px solid var(--violet); outline-offset: 4px; border-radius: 4px; }
.sloop__pp { flex: none; width: 44px; height: 44px; border-radius: 50%; display: inline-grid; place-items: center; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); cursor: pointer; }
.sloop__pp:hover { color: var(--ink); border-color: var(--ink-3); }
.sloop__pp svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; }
.sloop__pp .i-play { fill: currentColor; stroke: none; }
.sloop:not(.is-auto) .sloop__pp .i-pause, .sloop.is-auto .sloop__pp .i-play { display: none; }
.sloop__note { margin: 0; font-size: var(--t-xs); color: var(--ink-3); }
.stage .sloop__steps button { color: var(--stage-ink-3); }
.stage .sloop__steps li.is-on button { color: var(--stage-ink); }
.stage .sloop__steps button small { color: var(--stage-ink-3); }
.stage .sloop__steps button::before, .stage .sloop__steps li.is-timing button::before { background: var(--stage-line); }
.stage .sloop__pp { background: rgba(255,255,255,.06); border-color: var(--stage-line); color: var(--stage-ink-2); }
@media (max-width: 600px) {
  .sloop__shots { aspect-ratio: 4 / 3; }
  .sloop__badge { inset-inline-start: 8px; bottom: 8px; padding: 6px 10px 6px 8px; border-radius: 10px; }
  .sloop--badge-top .sloop__badge { top: 8px; right: 8px; bottom: auto; inset-inline-start: auto; }
  .sloop__steps { gap: 6px; }
  .sloop__steps button { font-size: .72rem; }
  .sloop__steps button small { display: none; }
}

/* ---------- Step rail on phones (pg-common.js adds the dots) ---------- */
.rail-dots { display: none; }
@media (max-width: 600px) {
  [data-rail] { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; margin-inline: calc(-1 * var(--gut, 16px)); padding-inline: var(--gut, 16px); padding-bottom: 4px; scroll-padding-inline: var(--gut, 16px); }
  [data-rail]::-webkit-scrollbar { display: none; }
  [data-rail] > li { flex: 0 0 85%; scroll-snap-align: start; }
  .rail-dots { display: flex; justify-content: center; gap: 8px; margin-top: 16px; }
  .rail-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); transition: background .2s, width .2s; }
  .rail-dots i.is-on { width: 22px; border-radius: 4px; background: var(--violet); }
}
