/* Idea Sizer: hand-rolled styles that Tailwind's CDN utilities don't cover:
   fonts, focus rings, and the enter/exit view transitions. */

body {
  font-family: 'Inter', sans-serif;
}

.mono {
  font-family: 'JetBrains Mono', monospace;
}

/* Visible, on-brand focus ring for keyboard users (buttons use their own hover state,
   this only shows on :focus-visible so mouse clicks stay clean). */
button:focus-visible,
a:focus-visible {
  outline: 2px solid #0045A5;
  outline-offset: 2px;
  border-radius: 4px;
}

/* The view container is given tabindex="-1" purely so focus can be moved to
   it after a transition (so screen readers/keyboard users land on the new
   question); it's never part of normal Tab order, so it shouldn't show the
   browser's default focus ring. */
.view:focus {
  outline: none;
}

/* ---- View transitions ---------------------------------------------------
   Toggled from app.js via classList. Two directions:
   - "forward" (answering a question, moving deeper into the tree)
   - "back" (the back button)
   Exit plays first (~200ms), then the new content is swapped in and the
   enter animation plays (~280ms, ease-out). */

#view-root > .view {
  will-change: opacity, transform;
}

.view-exit-forward {
  animation: viewExitForward 200ms ease-in forwards;
}

.view-exit-back {
  animation: viewExitBack 200ms ease-in forwards;
}

.view-enter-forward {
  animation: viewEnterForward 280ms ease-out forwards;
}

.view-enter-back {
  animation: viewEnterBack 280ms ease-out forwards;
}

@keyframes viewExitForward {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-14px); }
}

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

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

@keyframes viewEnterBack {
  from { opacity: 0; transform: translateY(-14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .view-exit-forward,
  .view-exit-back,
  .view-enter-forward,
  .view-enter-back {
    animation-duration: 1ms;
  }
}

/* Copy button "Copied" pulse */
@keyframes copiedPulse {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.04); }
  100% { transform: scale(1); }
}

.copied-pulse {
  animation: copiedPulse 260ms ease-out;
}
