/* The marketing layer shared by the public pages (site/pages) and the SEO pages (site/seo).
   Linked after components.css and before seo.css / pages.css. Rhythm, the section title and lede,
   prose, dark bands, lift, the enter animation and the looping motion live here (tasks M0b, F-3).
   Tokens only: no colour, radius or spacing value is invented here. Animation only under
   prefers-reduced-motion: no-preference and with a --dur-* token (test PAGES-8). A loop (infinite) is
   allowed only on .marquee, .float, .float-b and .sweep, only under html.motion-ready (which
   site/ui/motion.js sets once it has run, so there is never motion without a working pause), and
   it stops under html.motion-paused or while its .motion-toggle is hovered or focused (decision D14). */

/* — vertical rhythm —
   A marketing page is a column of sections; the gap between them is the rhythm. .container already sets
   the column and --space-8, and a public page opens it up in pages.css. The utility below stacks the
   inside of one section. */
.stack { display: flex; flex-direction: column; gap: var(--space-4); }
.stack > * { margin-block: 0; }

/* — section title and lede — */
.section-title {
  margin: 0; color: inherit; text-wrap: balance;
  font-family: var(--font-display); font-weight: var(--weight-heavy);
  font-size: clamp(36px, 4.6vw, 64px); line-height: 1; letter-spacing: -0.03em;
}
.lede { max-width: 56ch; margin: 0; font-size: 18px; line-height: 1.55; color: var(--color-text-muted); text-wrap: pretty; }

/* — prose — */
.prose { max-width: 68ch; line-height: 1.6; text-wrap: pretty; }
.prose p, .prose ul { margin: 0 0 var(--space-4); }
.prose ul { padding-inline-start: var(--space-6); }
.prose li + li { margin-top: var(--space-2); }

/* — dark band on a page —
   .panel-dark itself is in tokens.css. As a page section (.panel-dark--section) it is a column with room,
   a title that keeps the band's ink, and a lede in the band's muted tone. */
.panel-dark--section { display: flex; flex-direction: column; gap: var(--space-8); padding: clamp(var(--space-8), 6vw, var(--space-12)); }
.panel-dark .section-title, .panel-dark h3 { color: var(--color-on-band); }
.panel-dark .lede { color: var(--color-band-muted); }
.panel-dark p { margin-block: 0; }

/* — full-width dark band (a page section that bleeds, e.g. the lifecycle) —
   The same ink as .panel-dark, without the panel's radius or padding: the section sets those. */
.band { background: var(--color-band); color: var(--color-on-band); }
.band .section-title { color: var(--color-on-band); }
.band .lede, .band .text-muted { color: var(--color-band-muted); }
.band :focus-visible { outline-color: var(--color-on-band); }

/* — closing band on the highlighter —
   The board fills the closing call to action with the highlighter and sets ink on it (rule R1). Any
   plate or art inside is positioned by the page's own stylesheet. */
.cta-band--highlight {
  position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; gap: 28px;
  padding: clamp(48px, 7vw, 96px) clamp(24px, 5vw, 72px); border-radius: var(--radius-panel);
  background: var(--color-highlight); color: var(--color-on-highlight);
}
.cta-band--highlight .section-title { position: relative; max-width: 12ch; color: inherit; font-size: clamp(36px, 5.4vw, 76px); line-height: 0.96; letter-spacing: -0.035em; }
.cta-band--highlight :focus-visible { outline-color: var(--color-on-highlight); }

/* — motion toggle —
   A real <button> that fills the ticker bar or the hero art. No glyph: the cue is the cursor and the
   focus ring. site/ui/motion.js keeps aria-pressed and the label on every one of them in step. */
.motion-toggle {
  display: block; margin: 0; padding: 0; border: 0; background: transparent;
  cursor: pointer; font: inherit; color: inherit; text-align: inherit;
  -webkit-appearance: none; appearance: none;
}
.motion-toggle:focus-visible { outline: 2px solid var(--color-text); outline-offset: 2px; }

/* — ticker: a static wrapped row unless motion is ready and welcome — */
.marquee { display: flex; flex-wrap: wrap; row-gap: var(--space-2); padding: 14px clamp(16px, 4vw, 40px); }
.ticker-dup { display: none; }

/* — dark edges (D34): a 1px ring, because a dark drop shadow does not show — */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .lift { box-shadow: 0 0 0 1px rgb(255 255 255 / .08); }
}
:root[data-theme="dark"] .lift { box-shadow: 0 0 0 1px rgb(255 255 255 / .08); }

/* — hover lift and enter animation —
   Both move things, so both live only where motion is welcome. The travel and the durations are tokens
   (they are 0 under reduce as well) and delays are the --delay-N tokens. Only the loops
   below repeat, and only once motion.js has said the pause control works. */
@media (prefers-reduced-motion: no-preference) {
  .lift { transition: transform var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-in-out), box-shadow var(--dur-base) var(--ease-out); }
  .lift:hover { transform: translateY(calc(var(--lift-card) * -1)); box-shadow: 0 24px 48px -24px rgb(15 15 14 / .35); }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .lift:hover { box-shadow: 0 0 0 1px rgb(255 255 255 / .08), 0 24px 48px -24px rgb(0 0 0 / .6); }
  }
  :root[data-theme="dark"] .lift:hover { box-shadow: 0 0 0 1px rgb(255 255 255 / .08), 0 24px 48px -24px rgb(0 0 0 / .6); }

  @keyframes rise {
    from { opacity: 0; transform: translateY(var(--rise)); }
    to { opacity: 1; transform: translateY(0); }
  }
  .rise { animation: rise var(--dur-enter) var(--ease-enter) both; }
  .rise.d1 { animation-delay: var(--delay-1); }
  .rise.d2 { animation-delay: var(--delay-2); }
  .rise.d3 { animation-delay: var(--delay-3); }
  .rise.d4 { animation-delay: var(--delay-4); }

  /* The hero art assembles once (not a loop). */
  @keyframes assemble {
    from { opacity: 0; transform: scale(0.92) rotate(-2deg); }
    to { opacity: 1; transform: none; }
  }
  .assemble { animation: assemble var(--dur-assemble) var(--ease-enter) var(--delay-assemble) both; }

  /* The loops. Their periods (--dur-ticker, --dur-float, --dur-float-b, --dur-sweep, --delay-sweep), the sweep
     easing and the chip travel (--float) are tokens.css's, all zeroed under reduced motion. */
  @keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(calc(var(--float) * -1)); }
  }
  @keyframes sweep {
    0% { top: 6%; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 94%; opacity: 0; }
  }
  @keyframes marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
  }
  html.motion-ready .float { animation: float var(--dur-float) ease-in-out infinite; }
  html.motion-ready .float-b { animation: float var(--dur-float-b) ease-in-out infinite reverse; }
  html.motion-ready .sweep { animation: sweep var(--dur-sweep) var(--ease-sweep) var(--delay-sweep) infinite; }
  html.motion-ready .marquee {
    flex-wrap: nowrap; width: max-content; row-gap: 0; padding: 18px 0; white-space: nowrap;
    animation: marquee var(--dur-ticker) linear infinite;
  }
  html.motion-ready .ticker-dup { display: inline-flex; }

  /* Paused: by the toggle (html.motion-paused), and while a toggle is hovered or has focus. */
  html.motion-paused .float, html.motion-paused .float-b, html.motion-paused .sweep, html.motion-paused .marquee,
  .motion-toggle:hover .float, .motion-toggle:hover .float-b, .motion-toggle:hover .sweep, .motion-toggle:hover .marquee,
  .motion-toggle:focus-visible .float, .motion-toggle:focus-visible .float-b, .motion-toggle:focus-visible .sweep, .motion-toggle:focus-visible .marquee {
    animation-play-state: paused;
  }
}
