
:root {
  --paper: #fbfcfd; --grid: #e4ecf3; --margin: #e08a8a; --ink: #18263a; --soft: #55667a; --line: #d5dee8;
  --blue: #2b5c9e; --blue-tint: #e7effa; --red: #c0392b; --red-tint: #fbeceb; --hl: #fff2a8; --green: #23734f; --green-tint: #e5f4ec;
  --head: "Familjen Grotesk", "Helvetica Neue", Arial, sans-serif; --body: "Literata", Georgia, serif; --mono: "JetBrains Mono", Menlo, monospace;
}
* { box-sizing: border-box; }
html { background: var(--paper); }
body { margin: 0; color: var(--ink); font: 400 18px/1.7 var(--body);
  background-color: var(--paper);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px; }
a { color: var(--blue); text-underline-offset: 3px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.margin { border-left: 2px solid var(--margin); padding-left: clamp(16px, 4vw, 44px); }
header.site { padding: 26px 0 10px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
header.site a.brand { font: 700 1.15rem var(--head); color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
header.site span { font: 400 .9rem var(--head); color: var(--soft); }
h1, h2, h3, h4 { font-family: var(--head); line-height: 1.2; letter-spacing: -.015em; }
h1 { font-size: clamp(2rem, 5vw, 3rem); margin: .2em 0 .3em; font-weight: 700; }
h2 { font-size: 1.55rem; margin: 2em 0 .5em; padding-top: .3em; border-top: 2px solid var(--ink); }
h3 { font-size: 1.2rem; margin: 1.6em 0 .4em; }
.headerlink { color: var(--line); text-decoration: none; margin-left: .3em; font-size: .8em; }
h2:hover .headerlink, h3:hover .headerlink { color: var(--soft); }
p, li { max-width: 68ch; }
strong { font-weight: 700; }
mark { background: var(--hl); padding: 0 .15em; }
code { font: 400 .86em var(--mono); background: #eef2f6; border-radius: 4px; padding: .1em .35em; }
.code { background: #16202c; color: #e6edf3; border-radius: 10px; padding: 14px 16px; overflow-x: auto; margin: 1em 0; max-width: 100%; }
.code pre { margin: 0; font: 400 .82rem/1.6 var(--mono); }
.code code { background: none; padding: 0; color: inherit; font-size: inherit; }
table { border-collapse: collapse; margin: 1em 0; font: 400 .95rem/1.5 var(--body); display: block; overflow-x: auto; max-width: 100%; }
th, td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; background: var(--paper); }
th { font-family: var(--head); background: #eef2f6; }
blockquote { margin: 1em 0; padding: .4em 1em; border-left: 4px solid var(--line); color: var(--soft); }
.admonition { border-radius: 10px; padding: 12px 16px; margin: 1.3em 0; max-width: 72ch; border: 1.5px solid; }
.admonition-title { font: 700 .95rem var(--head); margin: 0 0 4px; }
.admonition p:last-child { margin-bottom: 0; }
.admonition.concept { background: var(--blue-tint); border-color: #b9cde8; }
.admonition.concept .admonition-title { color: var(--blue); }
.admonition.mistake { background: var(--red-tint); border-color: #efc3bf; border-left: 6px solid var(--red); }
.admonition.mistake .admonition-title { color: var(--red); font-style: italic; }
.admonition.takeaway { background: var(--hl); border-color: #e8d870; }
.admonition.try { background: var(--green-tint); border-color: #bfe0cd; }
.admonition.try .admonition-title { color: var(--green); }
details { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin: .6em 0; max-width: 68ch; }
details summary { cursor: pointer; font: 600 .98rem var(--head); }
details[open] summary { margin-bottom: 6px; }
.lesson { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 40px; padding: 10px 0 70px; }
.lesson aside { position: sticky; top: 16px; align-self: start; font: 400 .88rem/1.45 var(--head); max-height: 92vh; overflow: auto; }
.lesson aside ul { list-style: none; padding-left: 0; margin: 0; }
.lesson aside ul ul { padding-left: 12px; }
.lesson aside a { color: var(--soft); text-decoration: none; display: block; padding: 3px 0; }
.lesson aside a:hover { color: var(--ink); }
.kicker { font: 600 .95rem var(--head); color: var(--margin); }
.meta { font: 400 .92rem var(--head); color: var(--soft); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.tags span { font: 500 .78rem var(--head); border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 2px 9px; color: var(--soft); }
.pager { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 48px; padding-top: 18px; border-top: 2px solid var(--ink); font-family: var(--head); }
.pager a { text-decoration: none; max-width: 48%; }
.pager small { display: block; color: var(--soft); }
/* course map */
.hero { padding: 26px 0 8px; }
.hero h1 { font-size: clamp(2.6rem, 8vw, 4.6rem); line-height: 1; margin-bottom: .25em; }
.hero p { font-size: 1.15rem; color: var(--soft); max-width: 58ch; }
.map { list-style: none; padding: 0; margin: 26px 0 70px; counter-reset: none; }
.map li { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 4px 16px; padding: 18px 0; border-top: 1px solid var(--line); max-width: none; }
.map .num { font: 700 2.2rem/1 var(--head); color: var(--margin); }
.map h2 { border: 0; margin: 0; padding: 0; font-size: 1.3rem; }
.map h2 a { color: var(--ink); text-decoration: none; }
.map h2 a:hover { text-decoration: underline; text-decoration-color: var(--margin); }
.map p { margin: 4px 0 0; color: var(--soft); }
footer { font: 400 .85rem var(--head); color: var(--soft); padding: 20px 0 40px; }
@media (max-width: 900px) { .lesson { grid-template-columns: 1fr; } .lesson aside { position: static; order: -1; max-height: none;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 10px 14px; } }
@media (max-width: 560px) { body { font-size: 17px; } .map li { grid-template-columns: 44px minmax(0, 1fr); } .map .num { font-size: 1.6rem; } }
pre { line-height: 125%; }
td.linenos .normal { color: #6e7681; background-color: #0d1117; padding-left: 5px; padding-right: 5px; }
span.linenos { color: #6e7681; background-color: #0d1117; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #e6edf3; background-color: #6e7681; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #e6edf3; background-color: #6e7681; padding-left: 5px; padding-right: 5px; }
.code .hll { background-color: #6e7681 }
.code { background: #0d1117; color: #E6EDF3 }
.code .c { color: #8B949E; font-style: italic } /* Comment */
.code .err { color: #F85149 } /* Error */
.code .esc { color: #E6EDF3 } /* Escape */
.code .g { color: #E6EDF3 } /* Generic */
.code .k { color: #FF7B72 } /* Keyword */
.code .l { color: #A5D6FF } /* Literal */
.code .n { color: #E6EDF3 } /* Name */
.code .o { color: #FF7B72; font-weight: bold } /* Operator */
.code .x { color: #E6EDF3 } /* Other */
.code .p { color: #E6EDF3 } /* Punctuation */
.code .ch { color: #8B949E; font-style: italic } /* Comment.Hashbang */
.code .cm { color: #8B949E; font-style: italic } /* Comment.Multiline */
.code .cp { color: #8B949E; font-weight: bold; font-style: italic } /* Comment.Preproc */
.code .cpf { color: #8B949E; font-style: italic } /* Comment.PreprocFile */
.code .c1 { color: #8B949E; font-style: italic } /* Comment.Single */
.code .cs { color: #8B949E; font-weight: bold; font-style: italic } /* Comment.Special */
.code .gd { color: #FFA198; background-color: #490202 } /* Generic.Deleted */
.code .ge { color: #E6EDF3; font-style: italic } /* Generic.Emph */
.code .ges { color: #E6EDF3; font-weight: bold; font-style: italic } /* Generic.EmphStrong */
.code .gr { color: #FFA198 } /* Generic.Error */
.code .gh { color: #79C0FF; font-weight: bold } /* Generic.Heading */
.code .gi { color: #56D364; background-color: #0F5323 } /* Generic.Inserted */
.code .go { color: #8B949E } /* Generic.Output */
.code .gp { color: #8B949E } /* Generic.Prompt */
.code .gs { color: #E6EDF3; font-weight: bold } /* Generic.Strong */
.code .gu { color: #79C0FF } /* Generic.Subheading */
.code .gt { color: #FF7B72 } /* Generic.Traceback */
.code .g-Underline { color: #E6EDF3; text-decoration: underline } /* Generic.Underline */
.code .kc { color: #79C0FF } /* Keyword.Constant */
.code .kd { color: #FF7B72 } /* Keyword.Declaration */
.code .kn { color: #FF7B72 } /* Keyword.Namespace */
.code .kp { color: #79C0FF } /* Keyword.Pseudo */
.code .kr { color: #FF7B72 } /* Keyword.Reserved */
.code .kt { color: #FF7B72 } /* Keyword.Type */
.code .ld { color: #79C0FF } /* Literal.Date */
.code .m { color: #A5D6FF } /* Literal.Number */
.code .s { color: #A5D6FF } /* Literal.String */
.code .na { color: #E6EDF3 } /* Name.Attribute */
.code .nb { color: #E6EDF3 } /* Name.Builtin */
.code .nc { color: #F0883E; font-weight: bold } /* Name.Class */
.code .no { color: #79C0FF; font-weight: bold } /* Name.Constant */
.code .nd { color: #D2A8FF; font-weight: bold } /* Name.Decorator */
.code .ni { color: #FFA657 } /* Name.Entity */
.code .ne { color: #F0883E; font-weight: bold } /* Name.Exception */
.code .nf { color: #D2A8FF; font-weight: bold } /* Name.Function */
.code .nl { color: #79C0FF; font-weight: bold } /* Name.Label */
.code .nn { color: #FF7B72 } /* Name.Namespace */
.code .nx { color: #E6EDF3 } /* Name.Other */
.code .py { color: #79C0FF } /* Name.Property */
.code .nt { color: #7EE787 } /* Name.Tag */
.code .nv { color: #79C0FF } /* Name.Variable */
.code .ow { color: #FF7B72; font-weight: bold } /* Operator.Word */
.code .pm { color: #E6EDF3 } /* Punctuation.Marker */
.code .w { color: #6E7681 } /* Text.Whitespace */
.code .mb { color: #A5D6FF } /* Literal.Number.Bin */
.code .mf { color: #A5D6FF } /* Literal.Number.Float */
.code .mh { color: #A5D6FF } /* Literal.Number.Hex */
.code .mi { color: #A5D6FF } /* Literal.Number.Integer */
.code .mo { color: #A5D6FF } /* Literal.Number.Oct */
.code .sa { color: #79C0FF } /* Literal.String.Affix */
.code .sb { color: #A5D6FF } /* Literal.String.Backtick */
.code .sc { color: #A5D6FF } /* Literal.String.Char */
.code .dl { color: #79C0FF } /* Literal.String.Delimiter */
.code .sd { color: #A5D6FF } /* Literal.String.Doc */
.code .s2 { color: #A5D6FF } /* Literal.String.Double */
.code .se { color: #79C0FF } /* Literal.String.Escape */
.code .sh { color: #79C0FF } /* Literal.String.Heredoc */
.code .si { color: #A5D6FF } /* Literal.String.Interpol */
.code .sx { color: #A5D6FF } /* Literal.String.Other */
.code .sr { color: #79C0FF } /* Literal.String.Regex */
.code .s1 { color: #A5D6FF } /* Literal.String.Single */
.code .ss { color: #A5D6FF } /* Literal.String.Symbol */
.code .bp { color: #E6EDF3 } /* Name.Builtin.Pseudo */
.code .fm { color: #D2A8FF; font-weight: bold } /* Name.Function.Magic */
.code .vc { color: #79C0FF } /* Name.Variable.Class */
.code .vg { color: #79C0FF } /* Name.Variable.Global */
.code .vi { color: #79C0FF } /* Name.Variable.Instance */
.code .vm { color: #79C0FF } /* Name.Variable.Magic */
.code .il { color: #A5D6FF } /* Literal.Number.Integer.Long */