/* ── Site Motion ─────────────────────────────────────────────────────────────
   Terminal hero + scroll reveals + micro-interactions.
   Theme-aware (uses design tokens), respects prefers-reduced-motion. */

/* ---------- Terminal Hero ------------------------------------------------ */
.hero__path {
  font-family: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 18px;
  opacity: 0;
  animation: motionFadeUp 700ms cubic-bezier(0.22, 1, 0.36, 1) 60ms forwards;
}

.hero--terminal .hero__title {
  opacity: 0;
  animation: motionFadeUp 700ms cubic-bezier(0.22, 1, 0.36, 1) 180ms forwards;
}

.hero__typed {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  margin: 24px auto 0;
  min-height: 1.7em; /* reserve space while typing */
  font-family: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(0.98rem, 1.5vw, 1.15rem);
  color: var(--text-secondary);
  max-width: 60ch;
  flex-wrap: wrap;
  opacity: 0;
  animation: motionFadeUp 700ms cubic-bezier(0.22, 1, 0.36, 1) 320ms forwards;
}

.hero__prompt {
  color: var(--accent);
  font-weight: 700;
  margin-right: 10px;
}

.hero__caret {
  display: inline-block;
  width: 9px;
  height: 1.15em;
  margin-left: 5px;
  background: var(--accent);
  border-radius: 1px;
  animation: motionCaretBlink 1.1s steps(1) infinite;
}

@keyframes motionCaretBlink {
  0%, 45%  { opacity: 1; }
  50%, 95% { opacity: 0; }
  100%     { opacity: 1; }
}

@keyframes motionFadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Scroll Reveals ------------------------------------------------ */
/* .reveal is added by JS only — no-JS and prerendered pages stay visible. */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 550ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 550ms cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal--in {
  opacity: 1;
  transform: none;
}

/* ---------- Page Enter ---------------------------------------------------- */
.page-enter {
  animation: motionPageIn 420ms ease both;
}
@keyframes motionPageIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Micro-interactions -------------------------------------------- */
.app-card__icon {
  transition: transform 200ms ease;
}
.app-card:hover .app-card__icon {
  transform: scale(1.05) rotate(-1.5deg);
}

.header__logo {
  transition: transform 200ms ease;
}
.header__brand:hover .header__logo {
  transform: rotate(-6deg) scale(1.06);
}

.btn:active {
  transform: scale(0.98);
}

/* ---------- Reduced Motion ------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .hero__path,
  .hero--terminal .hero__title,
  .hero__typed {
    opacity: 1;
    animation: none;
  }
  .hero__caret { animation: none; }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .page-enter { animation: none; }
}
