:root {
  color-scheme: dark;
  --paper: #141715;
  --surface: #1d211e;
  --ink: #f0eee7;
  --muted: #b4b8b1;
  --line: #373d38;
  --accent: #8fd1bf;
  --accent-soft: #213f37;
  --code: #272c28;
  --measure: 74ch;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-size: 17px;
  line-height: 1.7;
}

a {
  color: var(--accent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.15em;
}

.site-header,
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem max(1.25rem, calc((100vw - 1180px) / 2));
  border-color: var(--line);
  border-style: solid;
  border-width: 0 0 1px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: 0.35rem;
  color: var(--surface);
  background: var(--accent);
  font-family: Georgia, serif;
  font-size: 1.3rem;
}

.status {
  padding: 0.18rem 0.65rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.page-shell {
  display: grid;
  grid-template-columns: minmax(12rem, 17rem) minmax(0, var(--measure));
  gap: clamp(2rem, 5vw, 5rem);
  justify-content: center;
  padding: clamp(2rem, 5vw, 5rem) 1.25rem;
}

.contents {
  position: sticky;
  top: 1.5rem;
  align-self: start;
  max-height: calc(100vh - 3rem);
  overflow: auto;
  color: var(--muted);
  font-size: 0.88rem;
}

.contents ul {
  padding-left: 1.1rem;
}

.contents a {
  color: inherit;
  text-decoration: none;
}

.contents a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.eyebrow,
.context {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lesson {
  min-width: 0;
}

h1,
h2,
h3 {
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.18;
  text-wrap: balance;
}

h1 {
  margin: 0 0 1.5rem;
  font-size: clamp(2.3rem, 6vw, 4.5rem);
  letter-spacing: -0.035em;
}

h2 {
  margin-top: 3.6rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--line);
  font-size: clamp(1.55rem, 3vw, 2.2rem);
}

h3 {
  margin-top: 2.2rem;
  font-size: 1.35rem;
}

p,
li {
  max-width: var(--measure);
}

li + li {
  margin-top: 0.35rem;
}

blockquote {
  margin: 2rem 0;
  padding: 0.2rem 0 0.2rem 1.25rem;
  border-left: 0.28rem solid var(--accent);
  color: var(--muted);
}

code {
  padding: 0.12em 0.32em;
  border-radius: 0.25rem;
  background: var(--code);
  font-size: 0.9em;
}

pre {
  overflow-x: auto;
  padding: 1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  background: var(--code);
}

pre code {
  padding: 0;
}

table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}

th,
td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

.study-time {
  margin-top: 4rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  background: var(--surface);
}

.site-footer {
  border-width: 1px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 820px) {
  .page-shell {
    grid-template-columns: minmax(0, var(--measure));
  }

  .contents {
    position: static;
    max-height: none;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 0.45rem;
    background: var(--surface);
  }

  .site-header,
  .site-footer {
    align-items: flex-start;
  }
}
