:root {
  --vellum: #f8f0dd; --vellum-hi: #fdf8ec;
  --ink: #1d2340; --ink-soft: #4a4a58;
  --lapis: #1b3a8a; --lapis-deep: #142c6b; --lapis-tint: #e6e9f3;
  --gold: #7a5a10; --gold-leaf: #f2d58a; --gold-hair: #c3a04f;
  --right: #1d5a3a; --right-tint: #e4efdf;
  --wrong: #8a2420; --wrong-tint: #f7e4dc;
  --serif: "Iowan Old Style", "New York", ui-serif, Palatino, Georgia, serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: 21px; line-height: 1.5; -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100dvh; display: flex; flex-direction: column; font-family: var(--serif); color: var(--ink); background: var(--vellum); }
h2, h3, p, dl, dd { margin: 0; }
:focus-visible { outline: 3px solid var(--lapis); outline-offset: 3px; }
[tabindex="-1"]:focus { outline: none; }

#masthead { display: flex; align-items: center; justify-content: center; gap: .55rem; padding: .55rem 16px .6rem; border-bottom: 1px solid var(--gold-hair); box-shadow: 0 3px 0 -2px var(--vellum), 0 3px 0 -1px var(--gold-hair); }
.mark { width: 48px; height: 48px; display: block; }
#site-title { margin: 0; font-size: 1.5rem; line-height: 1.1; font-weight: 600; color: var(--lapis-deep); }

main { flex: 1; width: 100%; max-width: 40rem; margin: 0 auto; padding: 1.1rem 16px 1.5rem; }
#screen-loading { padding: 2rem 0; text-align: center; color: var(--ink-soft); font-style: italic; }

button { display: block; width: 100%; min-height: 60px; font: inherit; color: var(--ink); cursor: pointer; }
.lapis { background: var(--lapis); color: var(--vellum-hi); border: 1px solid var(--lapis-deep); border-radius: 3px; padding: .5rem 1rem; font-weight: 600; box-shadow: inset 0 0 0 2px var(--lapis), inset 0 0 0 3px var(--gold-hair); }
.outline { background: none; border: 1.5px solid var(--lapis); border-radius: 3px; color: var(--lapis-deep); font-weight: 600; padding: .5rem 1rem; }
.quiet { background: none; border: 0; color: var(--ink-soft); text-decoration: underline; text-underline-offset: 4px; font-size: .9rem; margin-top: .5rem; }
@media (hover: hover) { .lapis:hover { background: var(--lapis-deep); box-shadow: inset 0 0 0 2px var(--lapis-deep), inset 0 0 0 3px var(--gold-hair); } .outline:hover { background: var(--lapis-tint); } }

/* Home */
#screen-home h2 { font-size: 1.5rem; line-height: 1.2; font-weight: 600; color: var(--lapis-deep); }
#daily-status { margin: .25rem 0 .75rem; }
.col-a h2 + #daily-status + button + h2 { margin-top: 1.75rem; }
#stats { margin-top: .3rem; }
#stats > div { display: flex; justify-content: space-between; align-items: baseline; padding: .4rem 0; border-bottom: 1px solid var(--gold-hair); }
#stats dd { font-weight: 600; color: var(--lapis-deep); }
.col-b { margin-top: 2rem; }
#screen-home h3 { margin: 1.25rem 0 0; font-size: .82rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.modes button { display: flex; justify-content: space-between; align-items: center; min-height: 58px; padding: .3rem .1rem; background: none; border: 0; border-bottom: 1px solid var(--gold-hair); text-align: left; color: var(--lapis-deep); }
.modes button::after { content: "›"; font-size: 1.4rem; line-height: 1; color: var(--gold); margin-left: .5rem; }
@media (hover: hover) { .modes button:hover { background: var(--lapis-tint); } }
details { margin-top: 1rem; }
summary { min-height: 58px; display: flex; align-items: center; font-weight: 600; color: var(--lapis-deep); cursor: pointer; border-bottom: 1px solid var(--gold-hair); }

/* Quiz */
.quiz-meta { display: flex; justify-content: space-between; gap: 1rem; font-size: .82rem; color: var(--ink-soft); padding-bottom: .4rem; border-bottom: 1px solid var(--gold-hair); }
#quiz-progress { white-space: nowrap; font-weight: 600; color: var(--lapis-deep); }
#question-text { margin: 1.05rem 0 1.05rem; font-size: 1.5rem; line-height: 1.28; font-weight: 600; color: var(--lapis-deep); }
#question-text::first-letter {
  float: left; font-size: 2.15em; line-height: 1; font-weight: 600;
  color: var(--gold-leaf); background: var(--lapis); border: 2px solid var(--gold-hair);
  padding: .1em .16em .12em; margin: .06em .16em 0 0;
}
#options { counter-reset: opt; display: grid; gap: .5rem; }
#options button {
  counter-increment: opt; display: flex; align-items: center; gap: .65rem; min-height: 64px; padding: .5rem .75rem;
  background: var(--vellum-hi); border: 1.5px solid var(--gold); border-radius: 3px; text-align: left; line-height: 1.3;
}
#options button::before { content: counter(opt, upper-alpha); flex: none; font-size: .85rem; font-weight: 600; color: var(--lapis-deep); width: 1.1rem; }
@media (hover: hover) { #options button:enabled:hover { background: var(--lapis-tint); border-color: var(--lapis); } }
#options button:disabled { cursor: default; color: var(--ink-soft); border-color: var(--gold-hair); }
#options button[data-state="correct"] { color: var(--right); background: var(--right-tint); border: 3px solid var(--right); font-weight: 600; }
#options button[data-state="incorrect"] { color: var(--wrong); background: var(--wrong-tint); border: 3px dashed var(--wrong); }
#options button[data-state]::before { color: inherit; }
#feedback { margin-top: 1.1rem; }
#feedback-result { font-size: 1.25rem; font-weight: 600; line-height: 1.3; color: var(--lapis-deep); }
#feedback strong { display: block; margin-top: .4rem; color: var(--gold); font-size: .95rem; }
#feedback-explanation { margin: .2rem 0 1rem; }

/* Results */
#screen-results { text-align: center; }
#screen-results h2 { font-size: 1.1rem; font-weight: 400; font-style: italic; color: var(--ink-soft); margin-top: .75rem; }
#result-score { font-size: 2.6rem; line-height: 1.15; font-weight: 600; color: var(--lapis-deep); }
#result-streak { margin-bottom: .25rem; }
#result-note { margin-bottom: .75rem; color: var(--ink-soft); font-size: .9rem; }
#share-status { min-height: 1.5em; margin: .35rem 0; font-style: italic; }
#screen-results label { display: block; text-align: left; font-size: .85rem; color: var(--ink-soft); }
textarea { display: block; width: 100%; font: .9rem/1.4 var(--serif); color: var(--ink); padding: .5rem; margin-bottom: .75rem; background: var(--vellum-hi); border: 1px solid var(--gold); border-radius: 3px; resize: vertical; }

footer { padding: .6rem 16px 1rem; border-top: 1px solid var(--gold-hair); font-size: .78rem; color: var(--ink-soft); text-align: center; }

@media (min-width: 760px) {
  #site-title { font-size: 1.8rem; }
  .mark { width: 60px; height: 60px; }
  #question-text { font-size: 1.8rem; }
  #options { grid-template-columns: 1fr 1fr; }
  #screen-quiz, #screen-results, #screen-loading, #screen-error { max-width: 38rem; margin-inline: auto; }
}
/* Marginal vines only where the column has room to itself. */
@media (min-width: 1120px) {
  body { background: url(../assets/vine.svg) left 28px top 0 repeat-y, url(../assets/vine.svg) right 28px top 0 repeat-y, var(--vellum); }
  main { max-width: 44rem; }
  #masthead, footer { background: var(--vellum); }
  #screen-home { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: start; }
  .col-b { margin-top: 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
