/* D9Commerce front page — 9th build (inc/pages/home.php, Nov 22 2026). Prefix `f9-`. Owner: "page scroll animations and
   very nice and premium". The 8th build's page, moved by the scroll (js/pages/front-scroll.js sets --hp / --p / --tp and the
   .act / .lit classes). RULE: every scroll value has its END state as the default — var(--p, 1), var(--hp, 0) — so the page
   is finished with no JS; and everything that moves sits inside (prefers-reduced-motion: no-preference). */

/* The colour behind the two bands that open out (#live, #cta): the same paper as the sections around them. */
body.f9 { background: #F5F6FB; }

/* ── Page progress (the element is made by front-scroll.js) ───────────── */
.f9-bar { position: fixed; inset: 0 0 auto; height: 3px; z-index: 70; pointer-events: none; }
.f9-bar i { display: block; height: 100%; background: linear-gradient(90deg, #22D3EE, #6366F1 50%, #A855F7); transform: scaleX(0); transform-origin: 0 50%; will-change: transform; }

/* ── Hero: the dashboard leans back at the top of the page and stands up as you scroll. Only while the script runs
   (html.f9-go): with no script or reduced motion it keeps the 8th build's resting look. ── */
.f9 .f8-shot { position: relative; }
.f9-go .f8-shot { perspective: 1700px; }
.f9-go .f8-win, .f9-go .f8-shot:hover .f8-win { transition: none; will-change: transform;
  transform: rotateX(calc((1 - var(--hp, 0)) * var(--f9-tilt, 9deg))) scale(calc(.96 + var(--hp, 0) * .04)); }
@media (min-width: 900px) { .f9-go .f8-shot { --f9-tilt: 13deg; perspective: 2000px; } }
.f9-ln { display: block; overflow: hidden; padding: .06em 0 .17em; margin: -.06em 0 -.17em; }
.f9-ln > span { display: inline-block; }

/* Soft colour behind the hero that drifts with the scroll */
.f9-orbs { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.f9-orbs i { position: absolute; border-radius: 50%; will-change: transform; }
.f9-orbs i:nth-child(1) { width: min(620px, 110vw); aspect-ratio: 1; left: max(-180px, -30vw); top: 14%; background: radial-gradient(closest-side, rgba(34, 211, 238, .22), rgba(34, 211, 238, 0));
  transform: translate3d(0, calc(var(--hp, 0) * 130px), 0); }
.f9-orbs i:nth-child(2) { width: min(680px, 120vw); aspect-ratio: 1; right: max(-200px, -34vw); top: 4%; background: radial-gradient(closest-side, rgba(168, 85, 247, .2), rgba(168, 85, 247, 0));
  transform: translate3d(0, calc(var(--hp, 0) * 210px), 0); }
.f9-orbs i:nth-child(3) { width: min(760px, 130vw); aspect-ratio: 1; left: 50%; margin-left: max(-380px, -65vw); top: 46%; background: radial-gradient(closest-side, rgba(99, 102, 241, .2), rgba(99, 102, 241, 0));
  transform: translate3d(0, calc(var(--hp, 0) * -90px), 0); }

/* Three sample alerts beside the window (illustration; wide screens only) */
.f9-chip { display: none; }
@media (min-width: 1280px) {
  .f9-chip { position: absolute; z-index: 2; display: flex; align-items: center; gap: 12px; padding: 11px 18px 11px 11px; border-radius: 16px; text-align: left; white-space: nowrap;
    font-size: 13px; line-height: 1.35; color: var(--muted); background: rgba(255, 255, 255, .84); border: 1px solid #fff;
    -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%);
    box-shadow: 0 26px 50px -22px rgba(30, 27, 75, .5), 0 0 0 1px rgba(16, 24, 64, .06); will-change: transform; }
  .f9-chip > i { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; font-size: 15px; color: #fff; background: var(--aurora); }
  .f9-chip b { display: block; font-size: 14.5px; font-weight: 750; color: var(--ink); }
  .f9-chip.c1 { left: -72px; top: 23%; transform: translate3d(0, calc(var(--hp, 0) * -80px), 0); }
  .f9-chip.c1 > i { background: linear-gradient(135deg, #34D399, #059669); }
  .f9-chip.c2 { right: -80px; top: 9%; transform: translate3d(0, calc(var(--hp, 0) * -140px), 0); }
  .f9-chip.c3 { right: -56px; top: 47%; transform: translate3d(0, calc(var(--hp, 0) * -40px), 0); }
  .f9-chip.c3 > i { background: linear-gradient(135deg, #FBBF24, #F97316); }
}

/* ── #tools on small screens: a link to a desk lands on the card's top ── */
.f9 .f8-card-t { scroll-margin-top: 12px; }

/* ── #see: the player grows into place ───────────────────────────────── */
.f9 .f7-screen { transform: scale(calc(.9 + .1 * var(--p, 1))); transform-origin: 50% 0; }

/* ── How it works on a phone: the numbers sit on a line down the left ── */
@media (max-width: 679px) {
  .f9 .f8-how .f5-steps { position: relative; gap: 30px; }
  .f9 .f8-how .f5-step { padding: 0 0 0 66px; min-height: 46px; }
  .f9 .f8-how .f5-step .n { position: absolute; left: 0; top: 0; margin: 0; }
  /* one strip: the pale track with the fill drawn over it as far as --p; the last step's own background ends the line at its number */
  .f9 .f8-how .f5-steps::before { content: ""; position: absolute; left: 22px; top: 23px; bottom: 0; width: 2px;
    background: linear-gradient(#6366F1, #A855F7) no-repeat 0 0 / 100% calc(var(--p, 1) * 100%), var(--line-2); }
  .f9 .f8-how .f5-step:last-child { background: var(--bg-alt); }
}
/* …and on a wide screen the line between the numbers has a pale track under it */
@media (min-width: 1100px) {
  .f9 .f8-how .f5-step:not(:last-child)::before { content: ""; position: absolute; top: 23px; left: 52px; right: -22px; height: 2px; background: var(--line-2); }
  .f9 .f8-how .f5-step:not(:last-child)::after { background: linear-gradient(90deg, #6366F1, #A855F7); transform-origin: 0 50%; transform: scaleX(clamp(0, calc(var(--p, 1) * 3.4 - var(--i, 0)), 1)); }
}

/* ── #live and the final band open out from a rounded card to the full width ── */
.f9 .f6-live { clip-path: inset(0 calc((1 - var(--p, 1)) * min(3vw, 56px)) round calc((1 - var(--p, 1)) * 40px)); }
.f9 .f8-final { clip-path: inset(0 calc((1 - var(--p, 1)) * min(3vw, 56px)) round calc((1 - var(--p, 1)) * 40px) calc((1 - var(--p, 1)) * 40px) 0 0); }
.f9 .f5-final-in { transform: scale(calc(.9 + .1 * var(--p, 1))); }

/* ═══ Everything below moves: only when motion is allowed ═════════════ */
@media (prefers-reduced-motion: no-preference) {
  /* Hero entrance (CSS only, short). The headline, the lead and the screenshot START part-visible and settle into place:
     they are the page's largest paint, and one that starts hidden is counted only when its animation ends (measured:
     +1.1 s on the largest-paint time). Never start those three from opacity 0 or fully clipped. */
  @keyframes f9In { from { opacity: 0; transform: translateY(20px); } }
  @keyframes f9Txt { from { opacity: .3; transform: translateY(20px); } }
  @keyframes f9Line { from { opacity: .3; transform: translateY(46%); } }
  @keyframes f9Shot { from { opacity: .3; transform: translateY(64px) scale(.96); } }
  @keyframes f9Chip { from { opacity: 0; transform: translateY(26px) scale(.86); } }
  .f9 .f8-pill { animation: f9In .7s var(--ease) backwards; }
  .f9-ln > span { animation: f9Line .9s var(--ease) backwards; }
  .f9-ln + .f9-ln > span { animation-delay: .09s; }
  .f9 .f8-lead { animation: f9Txt .8s var(--ease) .16s backwards; }
  .f9 .f8-cta { animation: f9In .7s var(--ease) .24s backwards; }
  .f9 .f8-ticks { animation: f9In .7s var(--ease) .32s backwards; }
  .f9 .f8-shot { animation: f9Shot 1.15s var(--ease) .12s backwards; }
  .f9-chip.c1 { animation: f9Chip .8s var(--ease) .85s backwards; }
  .f9-chip.c2 { animation: f9Chip .8s var(--ease) 1.02s backwards; }
  .f9-chip.c3 { animation: f9Chip .8s var(--ease) 1.19s backwards; }

  /* Section headings come up out of a blur (home.css' [data-reveal] does the timing; this is only another keyframe) */
  @keyframes f9Rise { from { opacity: 0; transform: translateY(38px); filter: blur(12px); } }
  .js .f9 .f8-head[data-reveal].is-in, .js .f9 .f5-head[data-reveal].is-in, .js .f9 .sec-head[data-reveal].is-in, .js .f9 .f6-live-copy[data-reveal].is-in {
    animation-name: f9Rise; animation-duration: 1.1s; }

  /* How it works: a number fills in and its words come up as the line reaches it (only while front-scroll.js runs) */
  .f9-go .f8-how .f5-step .n { transition: transform .55s cubic-bezier(.34, 1.56, .64, 1), box-shadow .5s, color .35s;
    box-shadow: 0 10px 22px -10px rgba(79, 70, 229, .8), 0 0 0 6px var(--bg-alt), inset 0 0 0 0 var(--line-2), inset 0 0 0 0 #fff; }
  .f9-go .f8-how .f5-step:not(.lit) .n { transform: scale(.84); color: var(--faint);
    box-shadow: 0 10px 22px -10px rgba(79, 70, 229, 0), 0 0 0 6px var(--bg-alt), inset 0 0 0 2px var(--line-2), inset 0 0 0 24px #fff; }
  .f9-go .f8-how .f5-step > :not(.n) { transition: opacity .6s; }
  .f9-go .f8-how .f5-step:not(.lit) > :not(.n) { opacity: .4; }
}

/* ═══ #tools as a sticky tour: the words scroll, the screen beside them holds and swaps ═══
   Wide, tall enough, motion allowed, and landing.js ran (html.js, set before first paint — so no layout jump).
   front-scroll.js uses the same width/height gate. The <li> has no box here; its two parts sit straight in the grid. */
@media (min-width: 1024px) and (min-height: 620px) and (prefers-reduced-motion: no-preference) {
  .js .f9 .f8-grid[data-tour] { --sh: clamp(300px, 46vh, 430px); --fh: 480px; position: relative; grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr);
    column-gap: clamp(40px, 5vw, 76px); row-gap: 0; counter-reset: f9step 0 f9all var(--n, 7); }
  .js .f9 .f8-grid[data-tour] > .f8-card { display: contents; }

  /* the rail down the left: a pale track and a fill that follows the scroll */
  .js .f9 .f8-grid[data-tour]::before, .js .f9 .f8-grid[data-tour]::after { content: ""; position: absolute; left: 0; top: calc(var(--sh) / 2); bottom: calc(var(--sh) / 2); width: 2px; border-radius: 2px; }
  .js .f9 .f8-grid[data-tour]::before { background: var(--line-2); }
  .js .f9 .f8-grid[data-tour]::after { background: linear-gradient(#22D3EE, #6366F1 45%, #A855F7); transform-origin: 50% 0; transform: scaleY(var(--tp, 0)); }

  /* the words */
  .js .f9 .f8-grid[data-tour] .f8-card-t { grid-column: 1; position: relative; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; min-height: var(--sh);
    padding: 0 0 0 46px; counter-increment: f9step; scroll-margin-top: calc(50vh - var(--sh) / 2 - 52px); }
  .js .f9 .f8-grid[data-tour] .f8-card-t > * { transition: opacity .45s; }
  .js .f9 .f8-grid[data-tour] .f8-card-t::after { content: ""; position: absolute; z-index: 1; left: -6px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%; background: #fff;
    border: 2px solid var(--line-2); box-shadow: 0 0 0 5px var(--bg-alt); transition: background .3s, border-color .3s, transform .45s cubic-bezier(.34, 1.56, .64, 1); }
  .js .f9 .f8-grid[data-tour] .f8-card.done .f8-card-t::after { background: #6366F1; border-color: #6366F1; }
  .js .f9 .f8-grid[data-tour] .f8-card.act .f8-card-t::after { background: var(--c); border-color: var(--c); transform: scale(1.3); }
  .js .f9 .f8-grid[data-tour] h3 { flex-direction: column; align-items: flex-start; gap: 12px; margin-bottom: 12px; font-size: clamp(1.5rem, 1rem + 1.4vw, 2.1rem); line-height: 1.12; letter-spacing: -.035em; }
  .js .f9 .f8-grid[data-tour] h3 .ic { position: relative; width: 46px; height: 46px; margin-bottom: 6px; border-radius: 14px; font-size: 19px; }
  .js .f9 .f8-grid[data-tour] h3 .ic::after { content: counter(f9step, decimal-leading-zero) " / " counter(f9all, decimal-leading-zero); position: absolute; left: calc(100% + 14px); top: 50%; transform: translateY(-50%);
    white-space: nowrap; font: 800 13px/1 var(--font, inherit); letter-spacing: .14em; color: var(--c); }
  .js .f9 .f8-grid[data-tour] h3 .tag { font-size: 12.5px; letter-spacing: 0; }
  .js .f9 .f8-grid[data-tour] .f8-card-t p { max-width: 42ch; font-size: 17px; line-height: 1.65; }
  .js .f9 .f8-grid[data-tour] .f8-watch { margin-top: 16px; font-size: 15px; }
  .js .f9 .f8-grid[data-act] .f8-card:not(.act) .f8-card-t > * { opacity: .3; }
  .js .f9 .f8-grid[data-act] .f8-card:not(.act) .f8-card-t:focus-within > * { opacity: 1; }

  /* the screens: all seven share one held cell, one shows */
  .js .f9 .f8-grid[data-tour] .f8-card-img { grid-column: 2; grid-row: 1 / span var(--n, 7); align-self: start; position: sticky; top: calc(50vh - var(--fh) / 2 + var(--head-h, 64px) / 2);
    display: flex; flex-direction: column; justify-content: center; height: var(--fh); margin: 0; padding: 0; overflow: visible; background: none; border: 0; pointer-events: none;
    opacity: 0; transform: translateY(34px) scale(.96); transition: opacity .5s, transform .75s var(--ease); }
  .js .f9 .f8-grid[data-tour] .f8-card.done .f8-card-img { transform: translateY(-34px) scale(.96); }
  .js .f9 .f8-grid[data-tour] .f8-card.act .f8-card-img,
  .js .f9 .f8-grid[data-tour]:not([data-act]) .f8-card:first-child .f8-card-img { opacity: 1; transform: none; }   /* no script: the first screen simply shows */
  .js .f9 .f8-grid[data-tour] .f8-card-img::before { content: ""; flex: none; height: 34px; border-radius: 16px 16px 0 0; border: 1px solid var(--line-2); border-bottom: 0;
    background: radial-gradient(circle at 20px 50%, #F87171 5px, transparent 5.6px), radial-gradient(circle at 38px 50%, #FBBF24 5px, transparent 5.6px),
      radial-gradient(circle at 56px 50%, #34D399 5px, transparent 5.6px), #F1F3F9; }
  .js .f9 .f8-grid[data-tour] .f8-card-img img, .js .f9 .f8-grid[data-tour] .f8-card:hover .f8-card-img img { flex: none; width: 100%; height: auto; min-height: 0; max-height: calc(var(--fh) - 34px);
    object-fit: cover; object-position: left top; margin: 0; border: 1px solid var(--line-2); border-radius: 0 0 16px 16px; transform: none; transition: none;
    box-shadow: 0 60px 100px -46px color-mix(in srgb, var(--c) 60%, #1E1B4B), 0 26px 50px -30px rgba(30, 27, 75, .45); }
  .js .f9 .f8-grid[data-tour] + .f8-mini { margin-top: 40px; }

  /* #workday: the photos drift inside their frames as the page moves */
  .f9 .f7-bento img, .f9 .f7-bento a:hover img { transform: none; scale: 1.12; translate: 0 calc((var(--p, .5) - .5) * -8%); transition: scale .6s cubic-bezier(.2, .8, .2, 1); }
  .f9 .f7-bento a:hover img { scale: 1.17; }
}

@media (prefers-reduced-motion: reduce) {
  .f9-bar { display: none; }
}
@media print {
  .f9-bar, .f9-chip, .f9-orbs { display: none !important; }
  .f9 .f8-win, .f9 .f7-screen, .f9 .f5-final-in { transform: none !important; }
  .f9 .f6-live, .f9 .f8-final { clip-path: none !important; }
  .f9-go .f8-how .f5-step > * { opacity: 1 !important; }
}
