/* Revolution study guide. Parchment, navy ink, one red accent.
   Built phone-first: she will mostly use this on a phone. */
:root {
  --paper: #f6efe0;
  --card: #fffaf0;
  --ink: #1c2b4a;
  --soft: #5a6580;
  --line: #dccfb4;
  --red: #b3392f;
  --red-ink: #fff;
  --gold: #b9862b;
  --ok: #2f7a4d;
  --ok-bg: #e2f1e4;
  --no-bg: #f8e1dc;
  --shadow: 0 2px 0 rgba(28, 43, 74, .12);
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141b2b;
    --card: #1d2740;
    --ink: #f1e9d6;
    --soft: #a9b2c8;
    --line: #34405c;
    --red: #e0675b;
    --red-ink: #1a1010;
    --gold: #e0b45c;
    --ok: #7ccf9a;
    --ok-bg: #1d3a2b;
    --no-bg: #44231f;
    --shadow: 0 2px 0 rgba(0, 0, 0, .35);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 500 17px/1.5 Nunito, system-ui, -apple-system, 'Segoe UI', sans-serif;
}
h1, h2, h3, .question, blockquote, .face { font-family: Fraunces, Georgia, serif; text-wrap: balance; }
h1 { font-size: clamp(1.8rem, 6vw, 2.6rem); line-height: 1.1; margin: 0 0 .3em; }
h2 { font-size: 1.25rem; margin: 2em 0 .6em; }
h3 { font-size: 1.15rem; margin: 0; }
p { margin: 0 0 1em; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; background: #1c2b4a; color: #f3ead7;
  position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 800; letter-spacing: .01em; }
.home-link { font-size: .9rem; font-weight: 700; text-underline-offset: 3px; }
main { max-width: 760px; margin: 0 auto; padding: 20px 16px 64px; outline: none; }

/* home */
.hero { padding: 12px 0 4px; }
.eyebrow, .kicker, .step, .tag {
  font-size: .78rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--red);
}
.eyebrow { margin: 0 0 .4em; }
.progress { display: grid; gap: 6px; margin-top: 14px; color: var(--soft); font-size: .95rem; }
.progress b { color: var(--ink); }
.bar { height: 12px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--red); border-radius: 99px; transition: width .3s; }
.bar.thin { height: 6px; margin-bottom: 14px; }

.fmts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.fmt {
  display: grid; gap: 2px; padding: 12px 14px; border: 2px solid var(--ink); border-radius: 12px;
  text-decoration: none; background: var(--card);
}
.fmt b { font: 700 1.9rem/1 Fraunces, Georgia, serif; color: var(--red); }
.fmt span { font-size: .9rem; font-weight: 700; line-height: 1.25; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.tile {
  display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
  text-decoration: none; transition: transform .12s, border-color .12s;
}
.tile:hover { transform: translateY(-2px); border-color: var(--ink); }
.tile p { margin: 0; color: var(--soft); font-size: .95rem; }
.tile .meta { margin-top: 8px; font-size: .85rem; font-weight: 800; color: var(--gold); }
.foot { margin-top: 40px; text-align: center; }
.link { background: none; border: 0; padding: 8px; color: var(--soft); text-decoration: underline; font-size: .9rem; }

/* shared page furniture */
.page-head { margin-bottom: 16px; }
.back { display: inline-block; margin-bottom: 10px; font-size: .9rem; font-weight: 700; color: var(--soft); text-decoration: none; }
.back:hover { color: var(--ink); }
.sub { color: var(--soft); margin: 0; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; justify-content: space-between; margin-bottom: 14px; color: var(--soft); font-size: .95rem; }
.count b { color: var(--ink); font-variant-numeric: tabular-nums; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: 20px; height: 20px; accent-color: var(--red); }
.step { margin: 0 0 8px; color: var(--soft); }
.note { color: var(--soft); font-size: .95rem; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.row { display: flex; gap: 10px; margin-top: 16px; }
.row.two { flex-wrap: wrap; }
.row .btn { flex: 1 1 180px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 12px 20px;
  border-radius: 12px; border: 2px solid var(--ink); background: var(--card);
  font-weight: 800; text-decoration: none; text-align: center;
}
.btn.primary { background: var(--red); border-color: var(--red); color: var(--red-ink); }
.btn.again { border-color: var(--line); }
.btn:active { transform: translateY(1px); }
.done { text-align: center; padding: 36px 16px; background: var(--card); border: 1px dashed var(--line); border-radius: 16px; }
.done h2 { margin-top: 0; }
.done p { color: var(--soft); }

/* flashcards */
.card {
  width: 100%; min-height: 250px; padding: 20px; border-radius: 18px;
  background: var(--card); border: 2px solid var(--ink); box-shadow: 0 6px 0 var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center;
}
.card .tag { position: static; }
.card .face { font-size: clamp(1.3rem, 5vw, 1.8rem); line-height: 1.25; font-weight: 500; }
.card .face.answer { color: var(--red); font-weight: 700; font-size: clamp(1.6rem, 6.5vw, 2.3rem); }
.card .hint { color: var(--soft); font-size: .92rem; max-width: 42ch; }
.card.flipped { background: var(--paper); }

/* quiz */
.question { font-size: clamp(1.3rem, 5vw, 1.7rem); line-height: 1.25; margin: 0 0 16px; font-weight: 500; }
.opts { display: grid; gap: 10px; }
.opt {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 12px 14px; text-align: left;
  background: var(--card); border: 2px solid var(--line); border-radius: 12px; font-weight: 700;
}
.opt:hover:not(:disabled) { border-color: var(--ink); }
.opt i {
  flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%;
  background: var(--ink); color: var(--paper); font-style: normal; font-size: .85rem; font-weight: 800;
}
.opt:disabled { cursor: default; color: var(--ink); }
.opt.right { border-color: var(--ok); background: var(--ok-bg); }
.opt.right i { background: var(--ok); }
.opt.wrong { border-color: var(--red); background: var(--no-bg); }
.opt.wrong i { background: var(--red); }
.opt.dim { opacity: .55; }
.feedback { margin-top: 14px; padding: 12px 14px; border-radius: 12px; }
.feedback.ok { background: var(--ok-bg); }
.feedback.no { background: var(--no-bg); }
.feedback em { font-style: normal; font-weight: 800; }
.score { text-align: center; padding: 28px 16px; background: var(--card); border: 2px solid var(--ink); border-radius: 18px; }
.score b { display: block; font: 700 4rem/1 Fraunces, Georgia, serif; color: var(--red); }
.score span { color: var(--soft); font-weight: 700; }
.score p { margin: 12px 0 0; font-weight: 700; }
.review { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.review li { display: grid; gap: 2px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.review .q { color: var(--soft); font-size: .95rem; }
.review .a { font-weight: 800; }

/* match */
.match { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 10px; }
.col { display: grid; gap: 8px; align-content: start; }
.chip {
  min-height: 64px; padding: 8px 10px; border-radius: 12px; border: 2px solid var(--line); background: var(--card);
  font-weight: 700; font-size: .92rem; line-height: 1.25; text-align: left; overflow-wrap: anywhere;
}
.words .chip { font-family: Fraunces, Georgia, serif; font-size: 1.02rem; }
.chip.picked { border-color: var(--ink); box-shadow: 0 3px 0 var(--ink); }
.chip.solved { border-color: var(--ok); background: var(--ok-bg); opacity: .6; cursor: default; }
.chip.shake { border-color: var(--red); animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* memorize */
.seg { display: flex; border: 2px solid var(--ink); border-radius: 12px; overflow: hidden; margin-bottom: 14px; }
.seg button { flex: 1; min-height: 46px; padding: 8px; border: 0; background: var(--card); font-weight: 800; font-size: .92rem; }
.seg button.on { background: var(--ink); color: var(--paper); }
.steps { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.steps button {
  display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 12px 6px 6px;
  border-radius: 99px; border: 1px solid var(--line); background: var(--card); font-size: .88rem; font-weight: 700;
}
.steps i { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--line); font-style: normal; font-weight: 800; }
.steps button.on { border-color: var(--red); }
.steps button.on i { background: var(--red); color: var(--red-ink); }
.sentence { font: 500 clamp(1.3rem, 5vw, 1.7rem)/1.7 Fraunces, Georgia, serif; margin: 0 0 .6em; }
.blank { background: none; border: 0; padding: 0 2px; font: inherit; color: var(--red); }
.blank u { text-decoration: none; letter-spacing: .08em; }
.sentence.checked { font-size: 1.15rem; margin-top: 14px; }
.hit { color: var(--ok); }
.miss { color: var(--red); text-decoration: underline wavy; text-underline-offset: 4px; }
textarea {
  width: 100%; padding: 12px; border-radius: 12px; border: 2px solid var(--line); background: var(--card);
  color: var(--ink); font: inherit; resize: vertical;
}
textarea:focus { border-color: var(--ink); outline: none; }

/* essay */
.quote { margin: 0 0 12px; padding: 22px 18px; background: #1c2b4a; color: #f3ead7; border-radius: 18px; }
.quote blockquote { margin: 0 0 12px; font-size: clamp(1.4rem, 5.5vw, 2rem); line-height: 1.25; }
.quote figcaption { font-size: .95rem; opacity: .85; }
.pieces { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pieces li { display: grid; gap: 4px; padding: 12px 14px; background: var(--card); border-left: 5px solid var(--red); border-radius: 0 12px 12px 0; }
.pieces b { font-family: Fraunces, Georgia, serif; font-size: 1.1rem; }
.planner { display: grid; gap: 6px; }
.planner label { font-weight: 800; font-size: .92rem; margin-top: 8px; }
#para { white-space: pre-wrap; min-height: 3em; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* quote analysis */
.quote blockquote.long { font-size: clamp(1.05rem, 4vw, 1.25rem); line-height: 1.5; }
.ask { display: grid; gap: 6px; margin-bottom: 16px; }
.ask label b { color: var(--red); }
.ask q { font-family: Fraunces, Georgia, serif; font-size: 1.08rem; }
details { background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
summary { padding: 10px 14px; font-weight: 800; cursor: pointer; min-height: 44px; display: flex; align-items: center; }
details p { margin: 0; padding: 0 14px 12px; }
.words-help { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; align-items: start; }
.words-help summary { font-family: Fraunces, Georgia, serif; }
