/* Motion site: shared base. Every page loads this first, then its own stylesheet.
   Holds only what must be identical everywhere: brand tokens, the logo lockup, focus and
   motion rules, and the structure of the shared form and clip player. Designs restyle freely
   through the custom properties below; they never change the logo markup. */

:root {
  --motion-orange-400: #fb923c;
  --motion-orange-500: #f97316;
  --motion-orange-600: #ea580c;
  --motion-orange-700: #c2410c;

  /* The real app's surfaces (dark mode). Used for frames around real screenshots. */
  --app-bg: #141414;
  --app-card: #1e1e1e;
  --app-border: #2a2a2a;

  /* The logo reads these two. Pages set them to suit their background. */
  --motion-accent: var(--motion-orange-500);
  --motion-ink: #141414;

  --font-display: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;

  --focus-ring: var(--motion-orange-500);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img,
svg,
video {
  display: block;
  max-width: 100%;
}
img {
  height: auto;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

/* ---------- Logo: Wordmark Run-Up (locked; mirrors the app's MotionLogo) ---------- */
.motion-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.17em;
  font-size: 1.35rem;
  line-height: 1;
  color: var(--motion-accent);
  text-decoration: none;
  white-space: nowrap;
}
.motion-logo__lines {
  flex: none;
  width: 0.667em;
  height: 0.667em;
  margin-top: 0.06em;
}
.motion-logo__word {
  font-family: var(--font-body);
  font-weight: 800;
  font-style: italic;
  letter-spacing: -0.025em;
  color: var(--motion-ink);
}
.motion-logo__m {
  color: var(--motion-accent);
}

/* ---------- Accessibility helpers ---------- */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 1000;
  padding: 10px 16px;
  border-radius: 8px;
  background: #141414;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: 12px;
}
:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}

/* ---------- Reveal on scroll (core.js adds .is-in) ---------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1),
    transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: var(--reveal-delay, 0s);
}
.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
  .js [data-reveal] {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Demo form: structure only; designs style the look ---------- */
.demo-form__trap {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.demo-form__error {
  margin: 6px 0 0;
  font-size: 0.875rem;
  color: var(--form-error, #dc2626);
}
.demo-form [aria-invalid='true'] {
  border-color: var(--form-error, #dc2626) !important;
}
[data-form-status]:empty {
  display: none;
}
[data-form-status] a {
  color: inherit;
  font-weight: 600;
}
.demo-form button[aria-busy='true'] {
  cursor: progress;
  opacity: 0.75;
}
.form-done:focus {
  outline: none;
}

/* ---------- Click-through clip player ---------- */
.clip {
  --clip-radius: 12px;
  --clip-accent: var(--motion-orange-500);
  --clip-bar-bg: #1e1e1e;
  --clip-bar-ink: #f0f0f0;
  --clip-bar-muted: #888;
  margin: 0;
}
.clip__stage {
  position: relative;
  overflow: hidden;
  border-radius: var(--clip-radius) var(--clip-radius) 0 0;
  background: var(--app-bg);
}
/* a clip playing its light frames (light page + light frames listed in clip.json) */
.clip[data-clip-theme='light'] .clip__stage {
  background: #f3f3f3;
}
.clip__frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
  /* No fade: the app changes screens instantly, so the clip does too. */
  opacity: 0;
}
.clip__frame.is-active {
  opacity: 1;
}
.clip__cursor {
  position: absolute;
  z-index: 2;
  width: calc(clamp(14px, 2.2%, 24px) / var(--s, 1));
  left: 50%;
  top: 60%;
  pointer-events: none;
  transform-origin: 0 0;
  filter: drop-shadow(0 2px 3px rgb(0 0 0 / 0.45));
  transition:
    left 0.75s cubic-bezier(0.2, 0.7, 0.2, 1),
    top 0.75s cubic-bezier(0.2, 0.7, 0.2, 1),
    opacity 0.3s ease;
}
.clip__cursor[hidden] {
  display: block;
  opacity: 0;
}
.clip__cursor.is-down {
  animation: clip-press 0.2s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.stack-cam .clip__cursor {
  transition: none;
}
@keyframes clip-press {
  0%,
  45% {
    transform: translate(1px, 1px) scale(0.9);
  }
}
.clip__ripple {
  position: absolute;
  z-index: 1;
  width: calc(clamp(26px, 4%, 44px) / var(--s, 1));
  aspect-ratio: 1;
  translate: -50% -50%;
  border: calc(2px / var(--s, 1)) solid var(--clip-accent, #f97316);
  border-radius: 50%;
  box-shadow: 0 0 0 calc(1px / var(--s, 1)) rgb(30 30 30 / 0.5);
  opacity: 0;
  pointer-events: none;
}
.clip__ripple.is-clicking {
  animation: clip-ripple 0.55s ease-out;
}
@media (prefers-reduced-motion: reduce) {
  .clip__ripple.is-clicking {
    animation-duration: 0.5s !important;
    transform: none !important;
  }
}
@keyframes clip-ripple {
  from {
    opacity: 0.9;
    transform: scale(0.3);
  }
  to {
    opacity: 0;
    transform: scale(1.4);
  }
}
.clip__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 0 0 var(--clip-radius) var(--clip-radius);
  background: var(--clip-bar-bg);
  color: var(--clip-bar-ink);
  font-size: 0.9rem;
}
.clip__btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--clip-bar-ink) 22%, transparent);
  border-radius: 50%;
  background: transparent;
  color: var(--clip-bar-ink);
  cursor: pointer;
}
.clip__btn:hover {
  border-color: var(--clip-accent);
  color: var(--clip-accent);
}
.clip__btn svg {
  width: 14px;
  height: 14px;
}
.clip__caption {
  flex: 1;
  min-width: 0;
  margin: 0;
  line-height: 1.35;
}
.clip__count {
  flex: none;
  color: var(--clip-bar-muted);
  font-variant-numeric: tabular-nums;
}
.clip__steps {
  display: flex;
  gap: 2px;
}
.clip__step {
  width: 22px;
  height: 28px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.clip__step::before {
  content: '';
  display: block;
  width: 8px;
  height: 8px;
  margin: auto;
  border-radius: 50%;
  background: color-mix(in srgb, var(--clip-bar-ink) 30%, transparent);
}
.clip__step[aria-current='step']::before {
  background: var(--clip-accent);
}
@media (max-width: 560px) {
  .clip__steps {
    display: none;
  }
  .clip__bar {
    gap: 8px;
    font-size: 0.82rem;
  }
}

/* ---------- Honest empty slots (testimonials etc. to be filled later) ---------- */
.slot-empty {
  display: grid;
  place-items: center;
  min-height: 140px;
  padding: 20px;
  border: 1.5px dashed currentColor;
  border-radius: 14px;
  opacity: 0.55;
  font-size: 0.9rem;
  text-align: center;
}
