/* styles.css — Revision flashcards */
/* Soft, calm, notebook-like. No gradients, no dark mode, no glow. */

/* ── Tokens ─────────────────────────────────────────── */
:root {
  --bg:           #FAF6EF;   /* warm cream background */
  --surface:      #FFFDF8;   /* card surface, slightly brighter than bg */
  --surface-alt:  #F2ECE0;   /* subtle secondary surface */
  --ink:          #2E2A24;   /* primary text, warm near-black */
  --ink-soft:     #6B6258;   /* secondary text */
  --ink-faint:    #A79C8C;   /* tertiary text, hints */
  --sage:         #8FA68E;   /* soft sage green */
  --sage-soft:    #E4EBE0;   /* sage tint for backgrounds */
  --terracotta:   #C97B5A;   /* soft terracotta */
  --terracotta-soft: #F4E2D8;
  --dusty-blue:   #7E96A8;   /* dusty blue */
  --dusty-blue-soft: #E1E8ED;
  --border:       #E5DCCB;   /* hairline border */
  --shadow:       0 1px 2px rgba(46,42,36,0.04), 0 8px 24px rgba(46,42,36,0.06);

  --radius-card: 14px;
  --radius-btn:  10px;
  --radius-pill: 999px;
}

/* ── Reset ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

h1, h2, h3 {
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  font-weight: 500;
  line-height: 1.2;
}

:focus-visible {
  outline: 2px solid var(--dusty-blue);
  outline-offset: 3px;
}

/* ── Layout ─────────────────────────────────────────── */
#app {
  max-width: 640px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

/* ── Home screen ────────────────────────────────────── */
.home-header h1 {
  font-size: 2.25rem;
  letter-spacing: -0.01em;
}

.home-header .subtitle {
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.subject-list {
  margin-top: 36px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.subject-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  min-height: 44px;
  transition: border-color 180ms ease;
}

.subject-card:hover,
.subject-card:active {
  border-color: var(--ink-faint);
}

.subject-name {
  font-family: Fraunces, Georgia, serif;
  font-weight: 500;
  font-size: 1.15rem;
}

.subject-meta {
  color: var(--ink-soft);
  font-size: 0.875rem;
}

/* ── Session screen ─────────────────────────────────── */
.session-top {
  margin-bottom: 16px;
}

.back-btn {
  color: var(--ink-soft);
  font-size: 0.95rem;
  min-height: 44px;
  padding: 12px 8px 12px 0;
  transition: color 180ms ease;
}

.back-btn:hover {
  color: var(--ink);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  padding: 28px 24px;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 18px;
  text-align: center;
  cursor: pointer;
  animation: card-in 180ms ease;
}

.card-subject {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
}

.card-question {
  font-family: Fraunces, Georgia, serif;
  font-weight: 500;
  font-size: 1.6rem;
  line-height: 1.3;
}

.tap-hint {
  color: var(--ink-faint);
  font-size: 0.9rem;
}

.answer-block {
  width: 100%;
  border-top: 1px solid var(--border);
  padding-top: 18px;
  text-align: left;
}

.card-answer {
  font-size: 1.1rem;
  line-height: 1.55;
}

/* ── Rating buttons ─────────────────────────────────── */
.ratings {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rating {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  border-radius: var(--radius-pill);
  color: var(--bg);
  font-weight: 500;
  font-size: 1rem;
  transition: opacity 180ms ease;
}

.rating:hover  { opacity: 0.92; }
.rating:active { opacity: 0.85; }

.rating-know  { background: var(--sage); }
.rating-kinda { background: var(--dusty-blue); }
.rating-dont  { background: var(--terracotta); }

.rating .key {
  font-size: 0.75rem;
  font-weight: 400;
  opacity: 0.8;
}

/* ── Summary screen ─────────────────────────────────── */
.summary-title {
  font-size: 2.25rem;
}

.summary-subject {
  margin-top: 8px;
  color: var(--ink-soft);
}

.summary-stats {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.stat {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.05rem;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-pill);
  flex: none;
}

.dot-know  { background: var(--sage); }
.dot-kinda { background: var(--dusty-blue); }
.dot-dont  { background: var(--terracotta); }

.summary-total {
  margin-top: 24px;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.summary-actions {
  margin-top: 36px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn {
  min-height: 48px;
  border-radius: var(--radius-btn);
  font-weight: 500;
  transition: opacity 180ms ease;
}

.btn:hover { opacity: 0.92; }

.btn-primary {
  background: var(--ink);
  color: var(--bg);
}

.btn-secondary {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink);
}

/* ── Motion ─────────────────────────────────────────── */
@keyframes card-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Wider screens ──────────────────────────────────── */
@media (min-width: 640px) {
  #app {
    padding: 64px 24px 96px;
  }

  .home-header h1 {
    font-size: 2.75rem;
  }

  .subject-card {
    padding: 24px 26px;
  }

  .card {
    padding: 40px;
    min-height: 340px;
  }

  .card-question {
    font-size: 2.05rem;
  }

  .card-answer {
    font-size: 1.2rem;
  }

  .ratings {
    flex-direction: row;
  }

  .rating {
    flex: 1;
  }

  .summary-title {
    font-size: 2.75rem;
  }

  .summary-actions {
    flex-direction: row;
  }

  .summary-actions .btn {
    flex: 1;
  }
}

/* ── Reduced motion ─────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .card { animation: none; }
  .subject-card,
  .rating,
  .back-btn,
  .btn { transition: none; }
}


/* ── Auth screen ─────────────────────────────────────── */
.auth-screen {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 0 20px;
}

.auth-screen h1 {
  font-size: 2.25rem;
  letter-spacing: -0.01em;
}

.auth-subtitle {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.auth-muted {
  color: var(--ink-faint);
  font-size: 0.95rem;
}

.auth-btn {
  margin-top: 16px;
  padding: 0 28px;
  width: auto;
}

/* ── Sign-out button (home only) ─────────────────────── */
.home {
  position: relative;
}

.sign-out-btn {
  position: absolute;
  top: 0;
  right: 0;
  color: var(--ink-soft);
  font-size: 0.875rem;
  min-height: 44px;
  padding: 12px 4px 12px 12px;
  transition: color 180ms ease;
}

.sign-out-btn:hover {
  color: var(--ink);
}

@media (prefers-reduced-motion: reduce) {
  .sign-out-btn { transition: none; }
}

