/* ============================================================
   Public pages (landing, auth, docs, legal, marketing, errors)
   Plain CSS on tokens: loaded with asset() by the public templates.
   Utilities come from app.css; this file only holds what utilities can't.
   ============================================================ */

/* --- Hero load: one orchestrated entrance, short stagger ---------------- */
.hero-in > * {
  animation: pub-fade-up var(--duration-slow) var(--ease-out-expo) both;
}
.hero-in > :nth-child(2) { animation-delay: 60ms; }
.hero-in > :nth-child(3) { animation-delay: 120ms; }
.hero-in > :nth-child(4) { animation-delay: 180ms; }
.hero-in > :nth-child(5) { animation-delay: 220ms; }
.hero-in-late { animation: pub-fade-up 600ms var(--ease-out-expo) 200ms both; }

@keyframes pub-fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- Reveal on scroll ----------------------------------------------------
   Content is visible by default. static/js/pages/public/reveal.js adds
   .is-revealed as an element enters the viewport, which plays a short
   rise that starts from a visible (dimmed) state, never from hidden.   */
[data-reveal-on-scroll].is-revealed:not(:has(> [data-reveal-item])) {
  animation: pub-reveal 520ms var(--ease-out-expo) both;
}
[data-reveal-on-scroll].is-revealed > [data-reveal-item] {
  animation: pub-reveal 520ms var(--ease-out-expo) both;
}
[data-reveal-on-scroll].is-revealed > [data-reveal-item]:nth-child(2) { animation-delay: 70ms; }
[data-reveal-on-scroll].is-revealed > [data-reveal-item]:nth-child(3) { animation-delay: 140ms; }
[data-reveal-on-scroll].is-revealed > [data-reveal-item]:nth-child(4) { animation-delay: 210ms; }
@keyframes pub-reveal {
  from { opacity: 0.35; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Number that just changed: brief accent flash, no movement */
.num-tick { animation: pub-tick 900ms var(--ease-out-expo); }
@keyframes pub-tick {
  from { color: rgb(var(--accent-400)); }
  to   { color: inherit; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-in > *, .hero-in-late, [data-reveal-on-scroll].is-revealed,
  [data-reveal-on-scroll].is-revealed > [data-reveal-item], .num-tick { animation: none !important; }
}

/* --- Auth pages ----------------------------------------------------------- */
.auth-rules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.25rem 0.75rem; margin-top: 0.5rem; }
.auth-rules li { display: flex; align-items: center; gap: 0.375rem; font-size: 0.75rem; color: rgb(var(--fg-subtle)); }
.auth-rules li[data-ok="true"] { color: rgb(var(--fg-muted)); }
.auth-rules[data-show-errors="true"] li[data-ok="false"] { color: rgb(var(--danger)); }
.input[aria-invalid="true"], .input-group:has(.input[aria-invalid="true"]) { border-color: rgb(var(--danger) / 0.6); }
.password-group > .input-group-btn { width: 2.75rem; justify-content: center; padding: 0; }
