:root {
  color-scheme: light dark;
  --gap: 1rem;
}

* {
  box-sizing: border-box;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  margin: 0;
  padding: 2rem 1rem;
  display: flex;
  justify-content: center;
}

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

header h1 {
  font-size: 1.25rem;
  margin: 0 0 1.5rem;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 1.125rem;
  margin: 0 0 0.5rem;
}

p {
  margin: 0.5rem 0;
  line-height: 1.5;
}

form {
  display: grid;
  gap: 0.75rem;
  margin-top: var(--gap);
}

label {
  display: grid;
  gap: 0.25rem;
  font-size: 0.875rem;
}

input[type='email'] {
  font: inherit;
  padding: 0.5rem 0.625rem;
  border: 1px solid color-mix(in srgb, currentColor 30%, transparent);
  border-radius: 0.375rem;
  background: transparent;
  color: inherit;
}

button {
  font: inherit;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  border: 0;
  background: #1f6feb;
  color: white;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.1);
}

.error {
  color: #d04848;
  font-size: 0.875rem;
}

.banner {
  margin-top: 1.5rem;
  padding: 0.75rem;
  border-radius: 0.375rem;
  background: color-mix(in srgb, #d04848 12%, transparent);
}

.cards {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: grid;
  gap: 0.75rem;
}

.card {
  border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
  border-radius: 0.5rem;
  padding: 0.875rem 1rem;
  display: grid;
  gap: 0.375rem;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.card-meta {
  margin: 0;
  font-size: 0.8125rem;
  color: color-mix(in srgb, currentColor 60%, transparent);
}

.card-hint {
  margin: 0;
  font-size: 0.8125rem;
  color: color-mix(in srgb, currentColor 55%, transparent);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-hint-building::before {
  content: '';
  width: 0.875rem;
  height: 0.875rem;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, #d97706 60%, transparent);
  border-right-color: transparent;
  animation: cms-spin 0.8s linear infinite;
}

@keyframes cms-spin {
  to { transform: rotate(360deg); }
}

.pill {
  font-size: 0.6875rem;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.pill-idle {
  background: color-mix(in srgb, currentColor 10%, transparent);
  color: color-mix(in srgb, currentColor 70%, transparent);
}

.pill-building {
  background: color-mix(in srgb, #d97706 18%, transparent);
  color: #b45309;
}

.pill-ready {
  background: color-mix(in srgb, #10b981 22%, transparent);
  color: #047857;
}

.pill-publishing {
  background: color-mix(in srgb, #2563eb 22%, transparent);
  color: #1d4ed8;
}

.pill-failed {
  background: color-mix(in srgb, #dc2626 22%, transparent);
  color: #b91c1c;
}

.pill-drafts {
  background: color-mix(in srgb, #eab308 22%, transparent);
  color: #a16207;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.card-actions .secondary {
  background: transparent;
  border: 1px solid color-mix(in srgb, currentColor 25%, transparent);
  color: inherit;
  padding: 0.375rem 0.625rem;
  font-size: 0.8125rem;
}

.card-actions .secondary:hover {
  background: color-mix(in srgb, currentColor 6%, transparent);
  filter: none;
}

.card-actions button[disabled] {
  opacity: 0.5;
  cursor: progress;
}

.card-actions a {
  font-size: 0.8125rem;
  color: inherit;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
}
