/* Floodlit site: motion layer, loaded on every page after site.css.
   Nothing here hides content unless motion.js has put .mo on <html>; the opening sequence
   additionally needs .mo-load (set only when the page has not painted yet, so nothing on screen blinks).
   Screen only and prefers-reduced-motion: no-preference only, so print and reduced motion get the static page.
   Transform and opacity only, except the field focus colour. Hooks: data-motion attributes in the markup. */
@media screen and (prefers-reduced-motion: no-preference) {
  :root { --m-ease: cubic-bezier(.2, .7, .2, 1); }
  html.mo { scroll-behavior: smooth; }

  @keyframes m-rise { from { opacity: 0; transform: translate3d(0, var(--m-y, 18px), 0); } to { opacity: 1; transform: none; } }
  @keyframes m-lift { from { transform: translate3d(0, var(--m-y, 14px), 0); } to { transform: none; } }
  @keyframes m-fade { from { opacity: 0; } to { opacity: 1; } }
  @keyframes m-draw-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
  @keyframes m-draw-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }
  @keyframes m-uncover { from { transform: translateY(0); } to { transform: translateY(-101%); } }
  @keyframes m-settle { from { transform: scale(1.06); } to { transform: none; } }
  @keyframes m-row { from { opacity: 0; transform: translate3d(-14px, 0, 0); } to { opacity: 1; transform: none; } }
  @keyframes m-drawer { from { transform: translate3d(-100%, 0, 0); } to { transform: none; } }
  @keyframes m-pop { from { transform: scale(.94); } to { transform: none; } }

  /* ---------- home: opening sequence (the h1 is the LCP text, so it only rises, at full opacity) ---------- */
  .mo-load .intro [data-motion="hero-line"] { animation: m-rise 760ms var(--m-ease) both; }
  .mo-load .intro h1[data-motion="hero-line"] { animation-name: m-lift; }
  .mo-load .intro .intro__lead[data-motion="hero-line"] { animation-delay: 90ms; }
  .mo-load .intro .intro__act[data-motion="hero-line"] { animation-delay: 180ms; }
  .mo-load .intro .row-dl[data-motion="hero-line"] { animation-delay: 270ms; }
  .mo-load .intro__act > .btn:first-child { position: relative; }
  .mo-load .intro__act > .btn:first-child::after {
    content: ""; position: absolute; left: 0; bottom: -10px; width: 56px; height: 3px; background: var(--accent);
    transform-origin: left center; pointer-events: none; animation: m-draw-x 560ms var(--m-ease) 620ms both;
  }

  /* ---------- home: reveals on scroll (motion.js adds .m-wait, then .m-in with --md as the stagger) ---------- */
  .mo .m-wait[data-motion="feature-card"],
  .mo .m-wait[data-motion="docs-group"],
  .mo .m-wait[data-motion="preset-card"] > .preset__body { opacity: 0; transform: translate3d(0, 16px, 0); }
  .mo .m-in[data-motion="feature-card"],
  .mo .m-in[data-motion="docs-group"] { --m-y: 16px; animation: m-rise 720ms var(--m-ease) var(--md, 0ms) both; }
  .mo .m-in[data-motion="preset-card"] > .preset__body { --m-y: 16px; animation: m-rise 720ms var(--m-ease) calc(var(--md, 0ms) + 120ms) both; }

  /* preset browser frames: a cover slides up off the screenshot while the image settles */
  .mo [data-motion="preset-frame"]:is(.m-wait, .m-in) .frame__shot::after {
    content: ""; position: absolute; inset: 0; z-index: 1; background: var(--bg2);
    box-shadow: inset 0 -2px 0 var(--accent); pointer-events: none;
  }
  .mo .m-wait[data-motion="preset-frame"] .frame__shot img { transform: scale(1.06); }
  .mo .m-in[data-motion="preset-frame"] .frame__shot::after { animation: m-uncover 720ms var(--m-ease) var(--md, 0ms) both; }
  .mo .m-in[data-motion="preset-frame"] .frame__shot img { animation: m-settle 900ms var(--m-ease) var(--md, 0ms) both; }

  /* "Name and number printing": price rows slide in (motion.js rolls the digits at the same time) */
  .mo .m-in[data-motion="feature-card"] .table-wrap tbody tr { animation: m-row 560ms var(--m-ease) calc(var(--md, 0ms) + 220ms) both; }
  .mo .m-in[data-motion="feature-card"] .table-wrap tbody tr:nth-child(2) { animation-delay: calc(var(--md, 0ms) + 310ms); }
  .mo .m-in[data-motion="feature-card"] .table-wrap tbody tr:nth-child(3) { animation-delay: calc(var(--md, 0ms) + 400ms); }

  /* ---------- docs: the article settles once on load; heading and lead stay opaque (LCP), the rest fades in ---------- */
  .mo-load [data-motion="docs-content"] { --m-y: 12px; animation: m-lift 620ms var(--m-ease) both; }
  .mo-load [data-motion="docs-content"] .prose > :nth-child(n+4):nth-child(-n+18) { animation: m-fade 560ms var(--m-ease) 140ms both; }

  /* current item indicators draw in once: header tab underline, docs sidebar item, phone menu item */
  .mo-load .hnav a[aria-current] { position: relative; box-shadow: none; }
  .mo-load .hnav a[aria-current]::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--accent);
    transform-origin: left center; animation: m-draw-x 520ms var(--m-ease) 120ms both;
  }
  .mo-load .dnav a[aria-current],
  .mo .drawer__nav a[aria-current] { position: relative; isolation: isolate; background: transparent; }
  .mo-load .dnav a[aria-current]::before,
  .mo .drawer__nav a[aria-current]::before {
    content: ""; position: absolute; inset: 0; z-index: -1; border-radius: 2px; background: var(--bg2);
    transform-origin: left center; animation: m-draw-x 560ms var(--m-ease) 160ms both;
  }
  .mo .mpanel .mlink[aria-current] { position: relative; box-shadow: none; }
  .mo .mpanel .mlink[aria-current]::before {
    content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent);
    transform-origin: center top; animation: m-draw-y 360ms var(--m-ease) 120ms both;
  }

  /* on-page contents: the active marker draws in each time the scroll spy (site.js) moves it */
  .mo .dtoc a { position: relative; }
  .mo .dtoc a.is-active { border-inline-start-color: transparent; }
  .mo .dtoc a.is-active::before {
    content: ""; position: absolute; top: 0; bottom: 0; left: -2px; width: 2px; background: var(--accent);
    transform-origin: center top; animation: m-draw-y 300ms var(--m-ease) both;
  }

  /* drawer (docs on phones), menu panel, search results, contents on phones */
  .mo .drawer:not([hidden]) .drawer__panel { animation: m-drawer 340ms var(--m-ease) both; }
  .mo .drawer:not([hidden]) .drawer__veil { animation: m-fade 300ms ease-out both; }
  .mo .mpanel:not([hidden]) nav { --m-y: -8px; animation: m-rise 260ms var(--m-ease) both; }
  .mo .sr-panel:not([hidden]) { --m-y: -4px; animation: m-rise 200ms var(--m-ease) both; }
  .mo .tocm[open] .tocm__l { --m-y: -6px; animation: m-rise 260ms var(--m-ease) both; }
  .tocm summary svg { transition: transform 240ms var(--m-ease); }

  /* copy button: a small press and an accent line while it reads "Copied" (class set by motion.js) */
  .mo [data-copy] { position: relative; }
  .mo [data-copy].m-copied { animation: m-pop 260ms var(--m-ease); }
  .mo [data-copy].m-copied::after {
    content: ""; position: absolute; left: -1px; right: -1px; bottom: -1px; height: 2px; background: var(--accent);
    transform-origin: left center; animation: m-draw-x 320ms var(--m-ease) both;
  }

  /* ---------- support: sent and error states rise in; field focus warms to the accent ---------- */
  .mo-load .sup__card :is(.sent, .alert) { --m-y: 10px; animation: m-rise 520ms var(--m-ease) 100ms both; }
  .mo-load .ferr:not([hidden]) { --m-y: 4px; animation: m-rise 320ms var(--m-ease) both; }
  .field :is(input[type="text"], input[type="email"], select, textarea) { transition: border-color 200ms var(--m-ease); }
  .field :is(input[type="text"], input[type="email"], select, textarea):focus:not([aria-invalid="true"]) { border-color: var(--accent); }

  /* ---------- hover: arrows nudge 3 px, link cards lift 2 px ---------- */
  a svg:has(> path[d^="M5 12h14"]), a svg:has(> path[d^="M19 12H5"]), a svg:has(> path[d^="M8 16l8-8"]) { transition: transform 220ms var(--m-ease); }
  .pn { transition: transform 240ms var(--m-ease); }
}
@media screen and (prefers-reduced-motion: no-preference) and (hover: hover) {
  a:hover svg:has(> path[d^="M5 12h14"]) { transform: translateX(3px); }
  a:hover svg:has(> path[d^="M19 12H5"]) { transform: translateX(-3px); }
  a:hover svg:has(> path[d^="M8 16l8-8"]) { transform: translate(2px, -2px); }
  .pn:hover { transform: translateY(-2px); }
}
