/**
 * theme.css
 * Design tokens shared with TypedUp (github.com/ahfos/typedup), so COLOR
 * reads as part of the same family: minimal black/white with a single red
 * accent, Helvetica Neue, fast/subtle transitions.
 */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Author rules elsewhere set `display: flex` etc. on elements that are also
   toggled via the `hidden` attribute (overlays, format-toggle fields, mode-
   only sections). Author stylesheets beat the UA's [hidden]{display:none},
   so without this the attribute silently does nothing. Keep it first and
   let it win outright. */
[hidden] {
  display: none !important;
}

:root {
  --bg: #ffffff;
  --fg: #000000;
  --border: #cccccc;
  --border-subtle: #e5e5e5;
  --accent: #c41e24;
  --muted: #888888;

  --ui-font: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono-font: "SF Mono", "Menlo", "Consolas", monospace;

  --transition-fast: 180ms ease-out;
  --transition-route: 200ms ease-out;

  --radius-sm: 4px;
  --radius-md: 10px;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;

  --bp-sm: 480px;
  --bp-md: 768px;
}

html,
body,
#root {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--ui-font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button {
  font-family: inherit;
  cursor: pointer;
  background: none;
  border: none;
  color: inherit;
}

input {
  font-family: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* Shared button styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.75rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  border: 1px solid var(--fg);
  border-radius: var(--radius-sm);
  color: var(--fg);
  background: var(--bg);
  transition: background var(--transition-fast), color var(--transition-fast),
    border-color var(--transition-fast), transform var(--transition-fast);
}

.btn:hover {
  background: var(--fg);
  color: var(--bg);
}

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

.btn--primary {
  background: var(--fg);
  color: var(--bg);
}

.btn--primary:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.btn--accent {
  border-color: var(--accent);
  color: var(--accent);
}

.btn--accent:hover {
  background: var(--accent);
  color: var(--bg);
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

/* Shared page-enter animation */
.page-enter {
  animation: pageEnter var(--transition-route) both;
}

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

.shake {
  animation: shake 320ms ease-out;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-6px);
  }
  40% {
    transform: translateX(6px);
  }
  60% {
    transform: translateX(-4px);
  }
  80% {
    transform: translateX(4px);
  }
}

.pop {
  animation: pop 220ms ease-out;
}

@keyframes pop {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
