/* GK Riyaz: exercise-book look. Indigo ink, warm paper, a red margin rule. System fonts only. */
:root {
  --paper: #fbf8f1;
  --card: #ffffff;
  --ink: #1c2340;
  --muted: #4f5672;
  --line: #e4ddce;
  --line-strong: #857e6d;
  --brand: #24346e;
  --brand-ink: #ffffff;
  --brand-soft: #e8ebf7;
  --accent: #c2410c;
  --accent-soft: #fdeedd;
  --ok: #17663d;
  --ok-soft: #e2f3e8;
  --bad: #a3271b;
  --bad-soft: #fbe6e2;
  --focus: #c2410c;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(28, 35, 64, .06), 0 6px 18px rgba(28, 35, 64, .06);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #11152a;
    --card: #1a1f38;
    --ink: #eef0f8;
    --muted: #b7bdd6;
    --line: #2f365a;
    --line-strong: #727bb0;
    --brand: #a9b8f7;
    --brand-ink: #10152e;
    --brand-soft: #232b4f;
    --accent: #f5a067;
    --accent-soft: #3a2a22;
    --ok: #7dd8a3;
    --ok-soft: #173a29;
    --bad: #ff9a8c;
    --bad-soft: #43221f;
    --focus: #f5a067;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1.0625rem/1.6 var(--sans);
  overflow-wrap: break-word;
}
h1, h2, h3 { font-family: var(--serif); line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: clamp(1.75rem, 5vw, 2.6rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.3rem, 3.4vw, 1.65rem); }
h3 { font-size: 1.15rem; }
p, ul, ol { margin: 0 0 1em; }
a { color: var(--brand); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
code { font-size: .92em; background: var(--brand-soft); padding: .05em .35em; border-radius: 6px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--brand); color: var(--brand-ink); padding: 10px 14px; border-radius: 8px; z-index: 10; }
.skip:focus { top: 12px; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 980px; margin: 0 auto; padding: 0 16px; }
.site-header { background: var(--card); border-bottom: 1px solid var(--line); }
.header-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; padding-top: 10px; padding-bottom: 10px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-height: 44px; }
.brand-name { font-family: var(--serif); font-weight: 700; font-size: 1.3rem; }
.main-nav { display: flex; flex-wrap: wrap; gap: 2px 4px; }
.main-nav a, .footer-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; color: var(--ink); text-decoration: none; border-radius: 8px; }
.main-nav a:hover, .footer-nav a:hover { background: var(--brand-soft); }
.main-nav a[aria-current="page"] { color: var(--brand); font-weight: 650; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }

main { padding-top: 22px; padding-bottom: 40px; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 700; color: var(--accent); margin-bottom: .5em; }
.eyebrow a { color: inherit; }
.lede { font-size: 1.12rem; color: var(--muted); max-width: 60ch; }
.small { font-size: .92rem; color: var(--muted); }
.note { background: var(--accent-soft); padding: 10px 12px; border-radius: 10px; }

.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 18px 18px 28px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.card::before { content: ""; position: absolute; left: 14px; top: 14px; bottom: 14px; width: 2px; background: var(--accent); opacity: .55; border-radius: 2px; }
.card.plain::before { opacity: .25; }

.hero { padding: 6px 0 10px; }
.today-top { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.today-top h2 { margin: 0; }
.today-icon { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); flex: none; }
.today-date { margin: 0; color: var(--muted); font-size: .95rem; }
.today-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.streak { display: inline-flex; align-items: center; gap: 6px; margin: 0; color: var(--accent); font-weight: 650; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 18px;
  font: inherit; font-weight: 650; line-height: 1.2;
  color: var(--brand); background: var(--card);
  border: 2px solid var(--brand); border-radius: 12px; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--brand-soft); }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand); filter: brightness(1.12); }
.btn-big { min-height: 54px; font-size: 1.1rem; padding: 12px 24px; }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: none; }
.btn-link { font: inherit; color: var(--brand); background: none; border: 0; padding: 0 4px; min-height: 44px; text-decoration: underline; cursor: pointer; }

.modes { display: grid; gap: 0 18px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.mode h2 { display: flex; align-items: center; gap: 8px; font-size: 1.25rem; }
.mode .icon { color: var(--brand); }
.topic-form { display: grid; gap: 10px; }
.topic-form select { font: inherit; min-height: 46px; padding: 8px 10px; border: 1.5px solid var(--line-strong); border-radius: 10px; background: var(--card); color: var(--ink); width: 100%; }
.length { border: 0; padding: 0; margin: 0; display: grid; gap: 2px; }
.length legend { font-weight: 600; padding: 0; margin-bottom: 4px; }
.length label { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.length input { width: 20px; height: 20px; accent-color: var(--brand); }

.quiz-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.quiz-head .eyebrow { margin: 0; }
.quiz-meta { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: .95rem; margin: 4px 0 8px; }
.bar { height: 8px; background: var(--brand-soft); border-radius: 99px; overflow: hidden; margin-bottom: 16px; }
.bar span { display: block; height: 100%; width: 0; background: var(--brand); transition: width .25s ease; }
.topic-tag { display: inline-block; font-size: .85rem; font-weight: 650; color: var(--brand); background: var(--brand-soft); padding: 3px 10px; border-radius: 99px; margin-bottom: 10px; }
.q-text { font-size: clamp(1.2rem, 3.6vw, 1.5rem); outline: none; }
.options { display: grid; gap: 10px; margin: 14px 0 12px; }
.option {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 10px 14px;
  font: inherit; text-align: left; color: var(--ink); background: var(--card);
  border: 2px solid var(--line-strong); border-radius: 12px; cursor: pointer;
}
.option:hover:not(:disabled) { border-color: var(--brand); background: var(--brand-soft); }
.option .key { flex: none; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.option.selected { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.option.correct { border-color: var(--ok); background: var(--ok-soft); }
.option.correct .key { background: var(--ok); color: var(--card); }
.option.wrong { border-color: var(--bad); background: var(--bad-soft); }
.option.wrong .key { background: var(--bad); color: var(--card); }
.option:disabled { cursor: default; }
.hint { font-size: .9rem; color: var(--muted); }
.quiz-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.feedback { margin: 14px 0 14px; padding: 14px 16px; border-radius: 12px; border: 1.5px solid var(--line); }
.feedback.is-right { background: var(--ok-soft); border-color: var(--ok); }
.feedback.is-wrong { background: var(--bad-soft); border-color: var(--bad); }
.verdict { font-weight: 700; font-size: 1.08rem; }
.fb-source { font-size: .93rem; }
.fb-report a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }

.result .score { font-family: var(--serif); font-size: 3rem; font-weight: 700; color: var(--brand); margin: 0 0 .2em; }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.review { padding-left: 0; list-style: none; display: grid; gap: 8px; }
.review li { border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; }
.review li.wrong { border-left: 4px solid var(--bad); }
.review li.right { border-left: 4px solid var(--ok); }
.review summary { cursor: pointer; padding: 10px 0; min-height: 44px; display: flex; gap: 10px; flex-wrap: wrap; }
.review .mark { font-weight: 700; flex: none; }
.review li.right .mark { color: var(--ok); }
.review li.wrong .mark { color: var(--bad); }

.daily-strip .strip-title { font-weight: 650; margin-bottom: 6px; }
.strip { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.strip li { border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; display: grid; font-size: .85rem; }
.strip li.played { background: var(--ok-soft); border-color: var(--ok); }
.strip-score { font-weight: 700; }
.strip li.missed-day .strip-score { font-weight: 400; color: var(--muted); }
.topic-table, .data-table { width: 100%; border-collapse: collapse; margin: 6px 0 14px; font-size: .95rem; }
.topic-table caption { text-align: left; font-weight: 650; padding-bottom: 6px; }
.topic-table th, .topic-table td, .data-table th, .data-table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table code { white-space: nowrap; }

.topic-grid, .topic-list, .source-list, .source-groups, .free-list, .shelf-list { list-style: none; padding: 0; }
.topic-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.topic-card { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); }
.topic-card:hover { border-color: var(--brand); }
.topic-card strong { display: block; }
.topic-icon { display: inline-grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 10px; background: var(--brand-soft); color: var(--brand); }
.topic-meta { color: var(--muted); font-size: .9rem; }
.topic-row { display: flex; gap: 14px; align-items: flex-start; }
.topic-row h2 { font-size: 1.3rem; }
.ticks { padding-left: 1.2em; }
.ticks li { margin-bottom: .4em; }

.page-head { margin-bottom: 18px; max-width: 72ch; }
.cta-row { margin-top: 14px; }
.prose { max-width: 72ch; }
.prose h2 { margin-top: 1.4em; }
.study-list { padding-left: 0; list-style: none; display: grid; gap: 12px; }
.study { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.study-q { font-weight: 600; }
.qid { display: inline-block; font: 600 .78rem/1.6 var(--sans); color: var(--muted); border: 1px solid var(--line-strong); border-radius: 6px; padding: 0 6px; margin-right: 8px; }
.study-opts { margin: 0 0 8px; padding-left: 1.6em; }
.study details summary { cursor: pointer; color: var(--brand); font-weight: 650; min-height: 44px; display: flex; align-items: center; }
.study-a { margin-top: 4px; }
.src { font-size: .92rem; color: var(--muted); }
.report a { display: inline-flex; min-height: 44px; align-items: center; }
.source-list li, .source-groups > li { margin-bottom: .6em; }
.source-groups ul { padding-left: 1.2em; margin-top: .3em; }
.free-list, .shelf-list { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.disclosure { background: var(--accent-soft); border-radius: 10px; padding: 10px 14px; }
.shop-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 650; }
.report-context blockquote { margin: 0 0 1em; padding: 8px 12px; border-left: 4px solid var(--accent); background: var(--accent-soft); border-radius: 0 10px 10px 0; }
.clear-box { margin: 18px 0; }

.site-footer { border-top: 1px solid var(--line); background: var(--card); padding: 18px 0 26px; font-size: .92rem; color: var(--muted); }
.footer-nav { display: flex; flex-wrap: wrap; gap: 0 4px; margin-left: -10px; margin-bottom: 8px; }
.site-footer p { margin: 0 0 .4em; }

.icon { flex: none; }
@media (min-width: 720px) {
  .card { padding: 24px 24px 22px 36px; }
  .card::before { left: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* Larger tap areas for stand-alone links in lists and breadcrumbs */
.source-list a, .source-groups a, .free-list h3 a, .eyebrow a { display: inline-block; padding-block: 11px; }
.eyebrow a { padding-block: 13px; margin-block: -13px; }
@media (max-width: 480px) {
  .header-row { padding-top: 6px; padding-bottom: 4px; }
  .main-nav { margin-left: -6px; }
  .main-nav a { padding: 0 6px; font-size: .9rem; }
  .lede { font-size: 1.05rem; }
}
