/* Static lesson pages (courses, learn/*, glossary, practice, about, legal) - written by tools/build_pages.py.
   Light, plain and readable; no web fonts, no frameworks. The live classroom (index.html) uses css/style.css. */
:root {
  --text: #1b1f27;
  --muted: #59616e;
  --soft: #f5f6f8;
  --line: #e4e7ec;
  --brand: #2f6fe4; /* the live classroom accent #4c8dff, one step darker so links on white stay readable */
  --brand-dark: #1f56c0;
  --ok: #166534;
  --bad: #b42318;
  --code: #f3f4f6;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Inter", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans Devanagari", "Nirmala UI", sans-serif;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  line-height: 1.65;
  color: var(--text);
  background: #fff;
}
[lang="hi"] { font-family: "Noto Sans Devanagari", "Nirmala UI", Mangal, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; line-height: 1.8; }
a { color: var(--brand); text-underline-offset: 2px; }
a:hover { color: var(--brand-dark); }
img { max-width: 100%; height: auto; }
.wrap { max-width: 860px; margin: 0 auto; padding: 0 18px; }
.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: 10px; top: 10px; z-index: 10; background: #fff; padding: 8px 12px; border: 2px solid var(--brand); }

/* header */
.site-header { border-bottom: 1px solid var(--line); background: #fff; }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 16px; padding-top: 6px; padding-bottom: 6px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17px; letter-spacing: -0.01em; color: var(--text); text-decoration: none; padding: 10px 0; }
.brand span { color: var(--muted); font-weight: 500; }
.brand .logo { flex: none; width: 26px; height: 26px; }
.nav { display: flex; flex-wrap: wrap; align-items: center; margin: 0 -8px; font-size: 15px; }
.nav a { padding: 10px 8px; color: var(--muted); text-decoration: none; }
.nav a:hover { color: var(--text); }
a:focus-visible, .btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* text */
main { padding-bottom: 48px; }
h1 { font-size: 29px; line-height: 1.25; margin: 8px 0 6px; letter-spacing: -0.01em; }
h2 { font-size: 22px; line-height: 1.3; margin: 40px 0 10px; padding-top: 18px; border-top: 1px solid var(--line); }
h3 { font-size: 18.5px; line-height: 1.35; margin: 26px 0 8px; }
h4 { font-size: 17px; line-height: 1.4; margin: 0 0 4px; }
p, ul, ol, dl { margin: 10px 0; }
li { margin: 4px 0; }
.lead { font-size: 18.5px; color: #323f4b; }
.kicker { margin: 18px 0 0; font-size: 14.5px; color: var(--muted); }
.hi-title { margin: 0 0 12px; font-size: 19px; color: var(--muted); }
.hi { margin: 10px 0; padding: 10px 14px; background: var(--soft); border-left: 3px solid #9fb3c8; border-radius: 0 6px 6px 0; color: #243b53; }
.hi p, .hi ul, .hi ol { margin: 4px 0; }
.meta { font-size: 14.5px; color: var(--muted); }
.note { padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfd; font-size: 16px; }

/* code */
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; }
code { font-size: 0.9em; background: var(--code); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }
pre { margin: 10px 0; padding: 12px 14px; background: var(--code); border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; font-size: 14.5px; line-height: 1.55; }
pre code { padding: 0; background: none; font-size: inherit; overflow-wrap: normal; }
.wrong pre { background: #fdf3f2; border-color: #f5c2bd; }
.right pre { background: #f1f8f3; border-color: #b7dfc3; }
.label-wrong { color: var(--bad); font-weight: 700; margin-bottom: 0; }
.label-right { color: var(--ok); font-weight: 700; margin-bottom: 0; }

/* lists of words, notes, chapters */
dl.words dt { margin-top: 14px; font-weight: 600; }
dl.words dd { margin: 2px 0 0; }
dl.words dd[lang="hi"] { color: #3e4c59; }
ol.steps li { margin: 8px 0; }
.chapters { list-style: none; padding: 0; margin: 8px 0; }
.chapters li { padding: 12px 0; border-bottom: 1px solid var(--line); margin: 0; }
.chapters a { font-weight: 600; }
.chapters .num { display: inline-block; min-width: 2.7em; color: var(--muted); font-weight: 600; }
.chapters p { margin: 2px 0 0; }
.card { margin: 16px 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: 10px; }
.card h2 { margin: 0 0 4px; padding: 0; border: 0; font-size: 21px; }
.problem { margin: 14px 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; }
.options { padding-left: 28px; }

/* buttons, quiz, pager */
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.btn { display: inline-block; padding: 11px 18px; border-radius: 8px; background: var(--brand); color: #fff; font-weight: 600; text-decoration: none; line-height: 1.35; }
.btn:hover { background: var(--brand-dark); color: #fff; }
.btn-plain { background: #fff; color: var(--brand); border: 1px solid #b6c6ef; }
.btn-plain:hover { background: #f3f6fd; color: var(--brand-dark); }
details { margin: 12px 0; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; }
summary { cursor: pointer; font-weight: 600; color: var(--brand); padding: 4px 0; }
details[open] summary { margin-bottom: 6px; }
.crumbs ol { display: flex; flex-wrap: wrap; list-style: none; margin: 14px 0 4px; padding: 0; font-size: 14.5px; color: var(--muted); }
.crumbs li { margin: 0; }
.crumbs li + li::before { content: "\203A"; margin: 0 8px; color: #9aa5b1; }
.crumbs a { color: var(--muted); }
.pager { display: flex; justify-content: space-between; gap: 14px; margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line); }
.pager a { display: block; max-width: 48%; padding: 8px 0; }
.pager .next { margin-left: auto; text-align: right; }

/* footer */
.site-footer { margin-top: 24px; padding: 26px 0 34px; background: var(--soft); border-top: 1px solid var(--line); font-size: 15.5px; color: var(--muted); }
.site-footer .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px 24px; }
.site-footer .col-title { margin: 0 0 2px; font-weight: 700; color: var(--text); }
.site-footer a { display: block; padding: 9px 0; color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--brand); text-decoration: underline; }
.site-footer .small { margin-top: 18px; font-size: 14px; }

@media (min-width: 720px) {
  h1 { font-size: 34px; }
  .site-header .wrap { padding-top: 8px; padding-bottom: 8px; }
}
@media print {
  .site-header, .site-footer, .cta, .pager { display: none; }
}
