/* Study notes (notes/md.html, dft.html, ml.html).
   Colours, fonts and spacing follow the inline styles of index.html. */
/* light and dark mode (theme.js sets data-theme on <html>) */
:root { color-scheme: light; --bg:#fff; --ink:#25282c; --ink-soft:#393e44; --heading:#202328; --muted:#62676e; --nav:#4d535b; --link:#315b86; --link-hover:#173a5e; --line:#e2e5e8; --soft:#f5f6f8; --field-border:#c9ced4; --error:#a33a2b; --error-line:#d9b4ae; --on-link:#fff; }
:root[data-theme="dark"] { color-scheme: dark; --bg:#15171a; --ink:#e2e4e7; --ink-soft:#c8ccd1; --heading:#eff1f3; --muted:#9da3aa; --nav:#b3b8be; --link:#8cb4de; --link-hover:#b8d2ee; --line:#2d3137; --soft:#1e2125; --field-border:#454b53; --error:#f08e80; --error-line:#7a3f37; --on-link:#10233a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) { color-scheme: dark; --bg:#15171a; --ink:#e2e4e7; --ink-soft:#c8ccd1; --heading:#eff1f3; --muted:#9da3aa; --nav:#b3b8be; --link:#8cb4de; --link-hover:#b8d2ee; --line:#2d3137; --soft:#1e2125; --field-border:#454b53; --error:#f08e80; --error-line:#7a3f37; --on-link:#10233a; } }
* { box-sizing:border-box; }
html { scroll-padding-top:30px; -webkit-text-size-adjust:100%; }
body { margin:0; background:var(--bg); color:var(--ink); font:17px/1.75 -apple-system,BlinkMacSystemFont,"Segoe UI",Arial,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","Noto Sans CJK SC",sans-serif; -webkit-font-smoothing:antialiased; }
a { color:var(--link); text-decoration-thickness:1px; text-underline-offset:3px; }
a:hover { color:var(--link-hover); }
a:focus-visible { outline:2px solid var(--link); outline-offset:5px; }
p { margin:0 0 17px; }
ul,ol { margin:0 0 17px; padding-left:22px; }
li { margin-bottom:6px; }
li > p { margin-bottom:6px; }
h1,h2 { font-family:Georgia,"Times New Roman",serif; color:var(--heading); }
.wrap { max-width:1024px; padding:0 32px; margin:auto; }

/* header and footer: same as the main page */
.site-header { border-bottom:1px solid var(--line); }
.header-inner { min-height:79px; display:flex; align-items:center; justify-content:space-between; gap:24px; }
.home { font:700 22px/1.4 Georgia,"Times New Roman",serif; text-decoration:none; color:var(--ink); white-space:nowrap; }
nav { display:flex; flex-wrap:wrap; gap:9px 23px; font-size:14px; line-height:1.5; }
nav { align-items:center; }
nav a { color:var(--nav); text-decoration:none; }
nav a:hover { text-decoration:underline; }
.theme-toggle { display:none; align-items:center; justify-content:center; width:28px; height:28px; margin:-4px -5px -3px 0; padding:0; border:0; border-radius:50%; background:none; color:var(--nav); cursor:pointer; }
html[data-theme] .theme-toggle { display:inline-flex; }
.theme-toggle:hover { color:var(--ink); background:var(--soft); }
.theme-toggle:focus-visible { outline:2px solid var(--link); outline-offset:2px; }
.theme-toggle svg { width:17px; height:17px; display:block; }
.theme-toggle .icon-sun, [data-theme="dark"] .theme-toggle .icon-moon { display:none; }
[data-theme="dark"] .theme-toggle .icon-sun { display:block; }
nav a[aria-current="page"] { color:var(--ink); font-weight:600; }
footer { display:flex; justify-content:space-between; gap:16px; padding:25px 0 31px; font-size:13px; color:var(--muted); border-top:1px solid var(--line); }
footer p { margin:0; }
footer a { color:var(--muted); }
.skip-link { position:absolute; left:16px; top:-100px; background:var(--bg); padding:8px 14px; z-index:2; }
.skip-link:focus { top:10px; }

/* the note */
main { padding:54px 0 48px; max-width:815px; }
h1 { font-size:34px; line-height:1.25; letter-spacing:-.5px; margin:0 0 14px; }
h2 { font-size:26px; line-height:1.3; letter-spacing:-.3px; margin:44px 0 18px; padding-top:32px; border-top:1px solid var(--line); }
h3 { font-family:Georgia,"Times New Roman",serif; color:var(--heading); font-size:21px; line-height:1.35; margin:34px 0 12px; }
h4 { font-size:17px; line-height:1.5; margin:26px 0 8px; }
code { font:.86em ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; background:var(--soft); padding:1px 5px; border-radius:3px; }
.note-meta { font-size:14px; line-height:1.6; color:var(--muted); margin-bottom:22px; }
.note-meta p { margin:0; }
.toc { font-size:15px; border:1px solid var(--line); border-radius:3px; padding:9px 16px; margin:0 0 8px; }
.toc summary { cursor:pointer; color:var(--muted); }
.toc ul { list-style:none; padding:0; margin:10px 0 4px; }
.toc li { margin-bottom:3px; }
.toc ul ul { padding-left:18px; margin:3px 0 6px; }
.toc a { text-decoration:none; }
.toc a:hover { text-decoration:underline; }

/* the two recurring lines of every chapter */
.thesis-line { font-size:15px; color:var(--muted); }
.thesis-line strong { color:var(--ink); font-weight:600; }
.mywork { margin:28px 0 0; padding:16px 20px 4px; background:var(--soft); border-left:3px solid var(--link); }
.mywork > p:first-child { margin-bottom:8px; }

/* formulas scroll sideways on a phone instead of widening the page */
.katex { font-size:1.06em; }
.katex-display { margin:20px 0; padding:3px 0; overflow-x:auto; overflow-y:hidden; }

/* figures and tables */
figure { margin:26px 0; }
figure img { display:block; width:100%; height:auto; margin:0 auto; }
/* the timelines and thesis figures are drawn on white: in dark mode they sit on a white card */
[data-theme="dark"] figure img { background:#fff; padding:10px; border-radius:4px; }
figcaption { font-size:13px; line-height:1.6; color:var(--muted); margin-top:10px; }
.table-wrap { overflow-x:auto; margin:22px 0 26px; }
table { border-collapse:collapse; width:100%; font-size:14.5px; line-height:1.55; }
th,td { text-align:left; vertical-align:top; padding:8px 12px 8px 0; border-bottom:1px solid var(--line); }
thead th { border-bottom:1px solid var(--ink); font-weight:600; white-space:nowrap; }
table code { white-space:nowrap; }

/* thesis chapter: numbered equations, figures and the reference list are link targets */
.eq:target, figure:target { background:var(--soft); }
/* keep the equation number clear of a formula that is wider than the screen */
.eq .katex-display > .katex > .katex-html { width:max-content; min-width:100%; box-sizing:border-box; padding-right:3.6em; }
.refs p { font-size:15px; line-height:1.6; padding-left:3.2em; text-indent:-3.2em; margin-bottom:9px; }
.refs p:has(span:target) { background:var(--soft); }

@media(max-width:760px) {
  .wrap { padding:0 24px; }
  .header-inner { align-items:flex-start; flex-direction:column; gap:13px; padding-top:20px; padding-bottom:20px; }
  nav { gap:8px 20px; }
  main { padding-top:38px; }
  h1 { font-size:29px; }
  h2 { font-size:23px; }
}
@media(max-width:570px) {
  body { font-size:16px; }
  .wrap { padding:0 22px; }
  main { padding-top:31px; }
  h1 { font-size:26px; }
  table { min-width:560px; }
  footer { font-size:12px; }
}
/* comment box (comments.js) */
[hidden] { display:none !important; }
.comments { max-width:815px; padding-bottom:48px; }
.comments h2 { margin-top:0; }
.comment-moderate { float:right; font:400 14px/2.6 -apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif; letter-spacing:0; }
.comment-form { display:grid; gap:6px; margin-bottom:34px; }
.comment-form label { font-size:14px; font-weight:600; margin-top:8px; }
.comment-form input, .comment-form textarea, .comment-form select { font:inherit; font-size:16px; line-height:1.6; color:var(--ink); background:var(--bg); border:1px solid var(--field-border); border-radius:3px; padding:8px 11px; width:100%; }
.comment-form input, .comment-form select { max-width:340px; }
.comment-form textarea { resize:vertical; min-height:130px; }
.comment-form input:focus-visible, .comment-form textarea:focus-visible { outline:2px solid var(--link); outline-offset:1px; }
.comment-trap { position:absolute; left:-9999px; width:1px; height:1px; overflow:hidden; }
.comment-check:not(:empty) { margin-top:8px; }
.comment-actions { display:flex; align-items:center; gap:18px; margin-top:10px; }
.comment-form button { font:inherit; font-size:15px; font-weight:600; color:var(--on-link); background:var(--link); border:0; border-radius:3px; padding:8px 18px; cursor:pointer; }
.comment-form button:hover { background:var(--link-hover); }
.comment-form button:disabled { opacity:.55; cursor:default; }
.comment-count { font-size:14px; color:var(--muted); font-variant-numeric:tabular-nums; }
.comment-status { font-size:15px; margin:8px 0 0; min-height:1.6em; }
.comment-count.error, .comment-status.error { color:var(--error); }
.comment-terms { font-size:13px; line-height:1.6; color:var(--muted); margin:0; }
.comment-empty { color:var(--muted); font-size:15px; }
.comment-list { list-style:none; padding:0; margin:0; }
.comment { border-top:1px solid var(--line); padding:18px 0 4px; margin:0; }
.comment:target { background:var(--soft); }
.comment-head { font-size:14px; color:var(--muted); margin-bottom:6px; }
.comment-head strong { color:var(--ink); font-size:15px; overflow-wrap:anywhere; }
.comment-author { font-size:11px; font-weight:600; letter-spacing:.4px; text-transform:uppercase; color:var(--link); border:1px solid var(--link); border-radius:3px; padding:1px 5px; }
.comment-body { white-space:pre-wrap; overflow-wrap:anywhere; font-size:16px; line-height:1.7; }
.comment button.approve { font:inherit; font-size:13px; font-weight:600; color:var(--on-link); background:var(--link); border:1px solid var(--link); border-radius:3px; padding:2px 12px; cursor:pointer; margin-bottom:12px; }
button.delete { font:inherit; font-size:13px; color:var(--error); background:none; border:1px solid var(--error-line); border-radius:3px; padding:2px 10px; cursor:pointer; margin-bottom:12px; }

@media print {
  :root, :root[data-theme="dark"] { color-scheme: light; --bg:#fff; --ink:#25282c; --ink-soft:#393e44; --heading:#202328; --muted:#62676e; --nav:#4d535b; --link:#315b86; --link-hover:#173a5e; --line:#e2e5e8; --soft:#f5f6f8; --field-border:#c9ced4; --error:#a33a2b; --error-line:#d9b4ae; --on-link:#fff; }
  [data-theme="dark"] figure img { padding:0; }
  .site-header,footer,.skip-link,.toc,.comments { display:none; }
  main { padding-top:0; }
  body { font-size:11pt; }
  .mywork { background:none; }
  a { color:inherit; }
}
