/* Mory — minimal base + review surface. Stage 0 — looks crappy on purpose. */

:root {
  --bg: #0c0f0a;
  --bg-card: #15181f;
  --fg: #e8ebe4;
  --fg-dim: #9a9d96;
  --accent: #84cc16;
  --error: #ef4444;
  --grade-again: #ef4444;
  --grade-hard: #f59e0b;
  --grade-good: #10b981;
  --grade-easy: #84cc16;
  --touch-min: 44px;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

/* Light-mode override. Keeps the colour palette small — only swap the
   surfaces; accent + grade colours stay legible against either bg. */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #fafaf9;
    --bg-card: #ffffff;
    --fg: #1c1d1a;
    --fg-dim: #6b6f68;
  }
}

.wordmark {
  display: block;
  width: 200px;
  height: auto;
  margin: 24px 0 16px;
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 20px;
}

.heading {
  font-size: 24px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
}

.body {
  color: var(--fg-dim);
}

.error {
  color: var(--error);
  font-family: ui-monospace, monospace;
  background: rgba(239, 68, 68, 0.08);
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.review-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 24px;
}

.review-progress {
  color: var(--fg-dim);
  font-family: ui-monospace, monospace;
  font-size: 14px;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  min-height: 200px;
}

.card-kind {
  color: var(--fg-dim);
  font-family: ui-monospace, monospace;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

.dev-due {
  text-transform: none;
  letter-spacing: 0;
  opacity: 0.6;
}

.card-front {
  font-size: 18px;
  white-space: pre-wrap;
}

.card-back {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 16px;
  color: var(--fg);
  white-space: pre-wrap;
}

.reveal {
  width: 100%;
  min-height: var(--touch-min);
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  background: transparent;
  color: var(--fg);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 80ms ease;
}

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

.grades {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.grade {
  min-height: var(--touch-min);
  padding: 12px 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  background: transparent;
  color: var(--fg);
  border: 1px solid currentColor;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 80ms ease;
}

.grade-again {
  color: var(--grade-again);
}
.grade-hard {
  color: var(--grade-hard);
}
.grade-good {
  color: var(--grade-good);
}
.grade-easy {
  color: var(--grade-easy);
}

.grade:hover {
  background-color: color-mix(in srgb, currentColor 12%, transparent);
}

.ingest-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.ingest-title,
.ingest-text {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  background: var(--bg-card);
  color: var(--fg);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
}

.ingest-text {
  font-family: ui-monospace, monospace;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  min-height: 240px;
}

.ingest-title:focus,
.ingest-text:focus {
  outline: none;
  border-color: var(--accent);
}

.ingest-title:disabled,
.ingest-text:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.button-primary {
  min-height: var(--touch-min);
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  background: var(--accent);
  color: #0c0f0a;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  cursor: pointer;
  transition: filter 80ms ease;
}

.button-primary:hover:not(:disabled) {
  filter: brightness(1.08);
}

.button-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.helper {
  margin: 0;
  color: var(--fg-dim);
  font-size: 13px;
}
