:root {
  color-scheme: light dark;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --acento: #1565c0;
  --grabando: #c62828;
  --suave: #888;
}

body {
  margin: 0;
  display: flex;
  justify-content: center;
  padding: 2rem 1rem;
}

main {
  max-width: 40rem;
  width: 100%;
}

h1 {
  margin-bottom: 0.25rem;
}

.intro {
  color: var(--suave);
  margin-top: 0;
}

#boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-width: 12rem;
  margin: 1.5rem 0 0.5rem;
  padding: 0.9rem 1.75rem;
  font-family: inherit;
  font-size: 1.15rem;
  font-weight: 600;
  color: #fff;
  background: var(--acento);
  border: none;
  border-radius: 999px;
  cursor: pointer;
}

#boton[data-estado="grabando"] {
  background: var(--grabando);
}

#boton:disabled {
  cursor: progress;
  opacity: 0.7;
}

#boton:focus-visible {
  outline: 3px solid var(--acento);
  outline-offset: 3px;
}

.punto {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: currentColor;
}

#boton[data-estado="grabando"] .punto {
  animation: latido 1s ease-in-out infinite;
}

@keyframes latido {
  50% { opacity: 0.25; }
}

@media (prefers-reduced-motion: reduce) {
  #boton[data-estado="grabando"] .punto { animation: none; }
}

#estado {
  min-height: 1.5rem;
  color: var(--suave);
}

#texto {
  font-size: 1.5rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

#texto:not(:empty) {
  border: 1px solid #8884;
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
}

#texto.vacio {
  color: var(--suave);
  font-size: 1rem;
}

footer {
  margin-top: 2.5rem;
  font-size: 0.75rem;
  color: var(--suave);
  text-align: center;
}

footer a {
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

footer img {
  border-radius: 3px;
  vertical-align: middle;
}
