/* Motion contract: semantic state and hit areas change immediately.
   Entrances never hide server-rendered content; pointer/focus and Off cancel
   transient animations. Native details closes immediately, without an exit queue. */
:root {
  --site-motion-fast: 220ms;
  --site-motion-enter: 640ms;
  --site-motion-media: 1000ms;
  --site-motion-headline: 880ms;
  --site-motion-menu: 180ms;
  --site-motion-detail: 120ms;
  --site-motion-ease: cubic-bezier(.22, 1, .36, 1);
}
.site-header { transition: box-shadow var(--site-motion-fast), border-color var(--site-motion-fast); }
.site-header[data-scrolled="true"] { box-shadow: 0 8px 24px #0003; border-color: var(--site-control-border); }
.site-reading-progress { position: absolute; height: 2px; bottom: -1px; left: 0; right: 0; pointer-events: none; background: var(--site-accent); transform: scaleX(var(--reading-progress, 0)); transform-origin: left; }
.site-scroll-origin { position: absolute; top: 0; left: 0; width: 1px; height: 12px; pointer-events: none; }
.desktop-nav a { position: relative; }
.desktop-nav a:not([aria-current])::after {
  content: ""; position: absolute; bottom: -2px; left: 0; right: 0; height: 2px;
  background: var(--site-accent); transform: scaleX(0); transform-origin: left;
  transition: transform var(--site-motion-fast) var(--site-motion-ease);
}
.desktop-nav a:not([aria-current]):is(:hover, :focus-visible)::after { transform: scaleX(1); }
.app-card, .news-card { transition: border-color var(--site-motion-fast), background-color var(--site-motion-fast); }
.app-card:is(:hover, :focus-within), .news-card:is(:hover, :focus-within) { border-color: var(--site-control-border); }
.app-card:focus-within, .news-card:focus-within { border-color: var(--site-accent); }
.feature-card, .app-card, .news-card, .platform-card { position: relative; isolation: isolate; }
:is(.feature-card, .app-card, .news-card, .platform-card)::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; border-radius: inherit; opacity: 0; background: radial-gradient(350px circle at var(--spotlight-x, 50%) var(--spotlight-y, 50%), #8abfff1f, transparent 72%); transition: opacity 350ms; }
html[data-site-motion="on"] .is-spotlit::before { opacity: 1; }
.button.primary { position: relative; isolation: isolate; overflow: hidden; }
.button.primary::before { content: ""; position: absolute; inset: -20% -50%; z-index: -1; pointer-events: none; background: linear-gradient(110deg, transparent 35%, #ffffff66 50%, transparent 65%); transform: translateX(-100%); }
.app-symbol > .ui-icon, .feature-symbol > .ui-icon { transition: transform 400ms var(--site-motion-ease); }
:is(.button, .text-link, .platform-arrow) > .ui-icon { transition: transform var(--site-motion-fast) var(--site-motion-ease); }
.faq-list summary > .ui-icon { transition: transform var(--site-motion-fast) var(--site-motion-ease); }
.feedback-form :is(input, select, textarea) { transition: border-color var(--site-motion-fast), background-color var(--site-motion-fast); }
.motion-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--site-control-border); border-radius: 8px; background: transparent; color: var(--muted); font-size: 14px; line-height: 1.5; cursor: pointer; transition: color var(--site-motion-fast), border-color var(--site-motion-fast); }
.motion-toggle:hover { color: var(--text); border-color: var(--site-accent); }
.motion-toggle[aria-pressed="true"] { color: var(--site-accent); }
.motion-toggle:disabled, .stellar-motion:disabled { cursor: default; }
.stellar-motion:disabled { color: var(--muted); border-color: var(--site-control-border); }

/* The sheen and icon respond without moving button hit targets. */
@media (prefers-reduced-motion: no-preference) {
  html[data-site-motion="on"] .button.primary:is(:hover, :focus-visible)::before { transform: translateX(100%); transition: transform 700ms var(--site-motion-ease); }
  html[data-site-motion="on"] :is(.app-card, .feature-card):is(:hover, :focus-within) :is(.app-symbol, .feature-symbol) > .ui-icon { transform: translateY(-3px) rotate(-7deg) scale(1.08); }
  html[data-site-motion="on"] :is(.button, .text-link):not(.back-link):is(:hover, :focus-visible) > [data-icon="arrow-right"],
  html[data-site-motion="on"] .platform-card:is(:hover, :focus-visible) .platform-arrow > .ui-icon { transform: translateX(3px); }
  html[data-site-motion="on"] .back-link:is(:hover, :focus-visible) > .ui-icon { transform: translateX(-3px) rotate(180deg); }
  html[data-site-motion="on"] :is(.button, .text-link):is(:hover, :focus-visible) > [data-icon="download"],
  html[data-site-motion="on"] :is(.button, .text-link):is(:hover, :focus-visible) > [data-icon="arrow-down"] { transform: translateY(2px); }
}
html[data-site-motion="off"],
html[data-site-motion="off"] *,
html[data-site-motion="off"] *::before,
html[data-site-motion="off"] *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .site-reading-progress, .button.primary::before, :is(.feature-card, .app-card, .news-card, .platform-card)::before { display: none; }
}
