/* learniit.org. Fonts are served from /fonts (SIL OFL; licences alongside). */
@font-face {
  font-family: 'Literata';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url(/fonts/literata-normal-greek.woff2) format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: 'Literata';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url(/fonts/literata-normal-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Literata';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url(/fonts/literata-normal-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Source Serif 4';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url(/fonts/sourceserif4-italic-greek.woff2) format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: 'Source Serif 4';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url(/fonts/sourceserif4-italic-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Source Serif 4';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url(/fonts/sourceserif4-italic-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/fonts/sourceserif4-normal-greek.woff2) format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/fonts/sourceserif4-normal-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/fonts/sourceserif4-normal-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}@font-face {
  font-family: "STIX Two Math";
  font-display: swap;
  src: local("STIX Two Math"), local("STIXTwoMath-Regular"), url(/fonts/stixtwomath-regular.woff2) format("woff2");
}

:root {
  --bg: #fbf8f1; --ink: #1d1b17; --ink-soft: #3b372f; --muted: #6b6357; --rule: #ddd4c3;
  --link: #8a2c1c; --link-hover: #5e1c11; --accent: #8a2c1c;
  --code-bg: #f1ebdf; --flag: #a4671a; --flag-bg: #f7eedb;
  --text: "Source Serif 4", Charter, Georgia, serif;
  --display: Literata, "Source Serif 4", Georgia, serif;
  --measure: 40rem; --sidebar: 13rem; --lean: calc(var(--sidebar) / 4);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161412; --ink: #ebe5d9; --ink-soft: #d2cabb; --muted: #a39a8c; --rule: #3a342d;
    --link: #e79a83; --link-hover: #f5bfae; --accent: #e08a70;
    --code-bg: #221f1b; --flag: #d6a24a; --flag-bg: #2a2114;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; padding: 0 1rem; background: var(--bg); color: var(--ink);
  font: 400 1.125rem/1.62 var(--text); font-optical-sizing: auto;
}
a { color: var(--link); text-underline-offset: .15em; text-decoration-thickness: from-font; }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
img, svg, video { max-width: 100%; height: auto; }
/* Figures are drawn for white paper; keep them on it in dark mode too. */
main img { display: block; margin: 1.5rem auto; background: #fff; border-radius: 2px; }

/* Masthead: a bar across the top, or a sidebar on wide screens. */
header.site, main, footer.site { max-width: var(--measure); margin: 0 auto; }
header.site {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1.5rem;
  padding: 1.25rem 0 .9rem; border-bottom: 1px solid var(--rule);
}
header.site a { text-decoration: none; }
.mark { color: var(--ink); font: 600 1.15rem/1.2 var(--display); }
.mark .phi { color: var(--accent); font-size: 1.5rem; font-weight: 400; margin-right: .2rem; }
header.site nav { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; font-size: 1rem; }
header.site nav a { color: var(--muted); }
header.site nav a:hover { color: var(--accent); }

@media (min-width: 68rem) {
  header.site {
    position: fixed; inset: 0 auto 0 0; width: var(--sidebar); max-width: none; margin: 0;
    flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 1.75rem;
    padding: 2.25rem 1.5rem; border-bottom: 0; border-right: 1px solid var(--rule);
  }
  .mark { display: flex; flex-direction: column; gap: .5rem; }
  .mark .phi { font-size: 3.4rem; line-height: 1; margin: 0; }
  header.site nav { flex-direction: column; gap: .5rem; font-size: 1.0625rem; }
  /* Centred in the window (body padding adds 1rem), nudged right by --lean to
     offset the sidebar's visual weight, and kept clear of the sidebar. */
  main, footer.site { margin-left: max(var(--sidebar) + 2rem, (100% - var(--measure)) / 2 + var(--lean)); }
}

/* Text */
main { padding: 2.75rem 0 1rem; overflow-wrap: break-word; }
.kind { margin: 0 0 .4rem; font-variant-caps: all-small-caps; letter-spacing: .12em; color: var(--accent); }
.kind:empty { display: none; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; text-wrap: balance; }
h1 { font-size: 2.3rem; line-height: 1.15; margin: 0 0 2rem; letter-spacing: -.01em; }
h2 { font-size: 1.45rem; line-height: 1.25; margin: 2.75rem 0 .75rem; }
h3 { font-size: 1.15rem; line-height: 1.3; margin: 2rem 0 .5rem; }
h4, h5, h6 { font-size: 1rem; font-weight: 600; font-style: italic; margin: 1.5rem 0 .4rem; }
p, ul, ol, dl { margin: 0 0 1rem; }
li + li { margin-top: .25rem; }
sup, sub { line-height: 0; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; }

blockquote { margin: 1.5rem 0; padding: .1rem 0 .1rem 1.25rem; border-left: 3px solid var(--rule); color: var(--ink-soft); }
blockquote p { margin: .35rem 0; }
blockquote.draft { border-left-color: var(--flag); background: var(--flag-bg); color: var(--ink); padding: .6rem 1rem; }
.wip { border-left: 3px solid var(--flag); padding-left: 1rem; font-style: italic; }

code, pre, kbd { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .84em; }
pre { overflow-x: auto; padding: .8rem 1rem; line-height: 1.45; background: var(--code-bg); border-radius: 3px; }
:not(pre) > code { background: var(--code-bg); padding: .08em .3em; border-radius: 3px; }

table {
  display: block; overflow-x: auto; max-width: 100%; margin: 1.5rem 0;
  border-collapse: collapse; font-size: .92rem; line-height: 1.5; font-variant-numeric: tabular-nums;
}
th, td { padding: .45rem .75rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
th { font-weight: 600; border-bottom-color: var(--ink); }
td code { overflow-wrap: anywhere; }
/* Field tables (a reference's type, a result's formalism) are written with an
   empty header row; hide it and set the field names apart. */
thead:not(:has(th:not(:empty))) { display: none; }
table:has(thead:not(:has(th:not(:empty)))) td:first-child {
  color: var(--muted); white-space: nowrap;
}

/* Citations link to the numbered reference list; footnotes follow the text. */
a.cite, .footnote-ref a { text-decoration: none; }
a.cite:hover, .footnote-ref a:hover { text-decoration: underline; }
[id^="ref-"], [id^="fn"] { scroll-margin-top: 1.5rem; }
li:target { background: var(--flag-bg); outline: 6px solid var(--flag-bg); }
.footnotes-sep { margin: 3rem 0 1rem; width: 8rem; }
.footnotes { font-size: .9rem; color: var(--ink-soft); }
.footnote-backref { text-decoration: none; }
.footnotes-list { list-style: none; padding-left: 2.5rem; }
.footnote-item::before { content: attr(data-label) "."; float: left; width: 2.25rem; margin-left: -2.5rem; text-align: right; }

math { font-family: "STIX Two Math", math; font-size: 1.05em; }
math[display="block"] { margin: 1rem 0; padding: .2rem 0; overflow-x: auto; overflow-y: hidden; }
code.tex { white-space: pre-wrap; }

footer.site { margin-top: 4rem; padding: 1rem 0 3rem; border-top: 1px solid var(--rule); color: var(--muted); font-size: .85rem; }
footer.site a { color: inherit; }

@media (max-width: 40rem) {
  body { font-size: 1.0625rem; }
  h1 { font-size: 1.7rem; }
  main { padding-top: 2rem; }
}
@media print {
  header.site nav, footer.site p:first-child { display: none; }
  header.site { position: static; }
  main, footer.site { margin: 0 auto; }
}
