/* Artikel van de dag — personal Dutch reader.
   Calm, paper-like reading surface; one warm accent. */

:root {
  --bg: #f5f1e8;
  --card: #fffdf8;
  --ink: #2b2620;
  --muted: #8a8171;
  --accent: #c65a1e;        /* burnt orange */
  --accent-soft: #c65a1e22;
  --clause: #2e6e5e1c;      /* soft green tint for subordinate clauses */
  --clause-verb: #2e6e5e;
  --border: #e2dbcc;
  --good: #2e6e5e;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1a16;
    --card: #26231e;
    --ink: #ece5d8;
    --muted: #948b7a;
    --accent: #e8853f;
    --accent-soft: #e8853f26;
    --clause: #58b39a1f;
    --clause-verb: #6fc4ab;
    --border: #3a362e;
    --good: #6fc4ab;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.65 Charter, Georgia, 'Times New Roman', serif;
  padding-bottom: env(safe-area-inset-bottom);
}
header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  font: 600 0.8rem/1 system-ui, sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
#hdrStreak { color: var(--accent); margin-left: auto; }
main { max-width: 42rem; margin: 0 auto; padding: 0 1.1rem 3rem; }

/* --- warm-up gate --- */
.gate-label { font: 600 0.85rem system-ui, sans-serif; color: var(--muted); }
#gateCard {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem 1.4rem;
  min-height: 9rem;
  display: flex; flex-direction: column; justify-content: center; gap: 0.5rem;
  cursor: pointer;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.06);
}
#gateCard .front { font-size: 1.15rem; }
#gateCard .answer { color: var(--accent); font-weight: 700; font-size: 1.5rem; }
#gateCard .ctx { color: var(--muted); font-size: 0.95rem; }
#gateCard .tap-hint { font: 0.75rem system-ui, sans-serif; color: var(--muted); }
#gateProgress { color: var(--muted); font: 0.8rem system-ui, sans-serif; }

/* --- reader --- */
#artImage { width: 100%; border-radius: 12px; margin-top: 0.4rem; }
.toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin: 0.6rem 0 0.2rem;
  font: 0.78rem system-ui, sans-serif; color: var(--muted);
}
.clause-label { display: flex; gap: 0.35rem; align-items: center; cursor: pointer; user-select: none; }
#artBody h1 { font-size: 1.55rem; line-height: 1.25; margin: 0.5rem 0 0.8rem; text-wrap: balance; }
#artBody h2 { font-size: 1.15rem; margin: 1.3rem 0 0.2rem; }
#artBody p { margin: 0.8rem 0; }

.w { border-radius: 3px; }
.unk { cursor: pointer; }
.u { text-decoration: underline dotted var(--accent); text-underline-offset: 3px; }
.w.added { background: var(--accent-soft); }
.w.active { background: var(--accent-soft); outline: 1px solid var(--accent); }

.show-cl [data-cl] { background: var(--clause); }
.show-cl [data-clv] {
  font-weight: 700;
  color: var(--clause-verb);
  border-bottom: 2px solid var(--clause-verb);
}

/* --- popover --- */
#popover {
  position: fixed;
  z-index: 20;
  max-width: min(20rem, calc(100vw - 2rem));
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.8rem 0.95rem;
  font: 0.92rem/1.5 system-ui, sans-serif;
  box-shadow: 0 6px 24px rgb(0 0 0 / 0.16);
}
#popover .head { font: 700 1.05rem Charter, Georgia, serif; }
#popover .head .art { color: var(--accent); font-weight: 600; }
#popover .pos { color: var(--muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }
#popover ul { margin: 0.35rem 0; padding-left: 1.1rem; }
#popover .no-hint { color: var(--good); }
#popover .ff { color: #b3452c; font-weight: 600; }
#popover .addbtn {
  margin-top: 0.5rem; width: 100%;
  background: var(--accent); color: #fff; border: none;
  border-radius: 8px; padding: 0.55rem; font: 600 0.9rem system-ui, sans-serif;
  cursor: pointer;
}
#popover .addbtn[disabled] { background: var(--muted); }
#scrim { position: fixed; inset: 0; z-index: 10; }

/* --- buttons / done --- */
button.big {
  display: block; width: 100%;
  margin: 1.6rem 0 0.6rem;
  background: var(--accent); color: #fff;
  border: none; border-radius: 10px;
  padding: 0.85rem; font: 700 1rem system-ui, sans-serif;
  cursor: pointer;
}
button.ghost { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
button.small { width: auto; padding: 0.45rem 0.9rem; font-size: 0.8rem; margin: 0; border-radius: 8px; }
#done h1 { font-size: 1.5rem; margin-top: 2.2rem; }
#doneStats, #doneStreak { color: var(--muted); font-family: system-ui, sans-serif; font-size: 0.95rem; }
#pushRow { margin-top: 1.4rem; font-family: system-ui, sans-serif; }
.src { margin-top: 2rem; font: 0.78rem system-ui, sans-serif; }
.src a { color: var(--muted); }
