:root {
  --bg: #ffffff;
  --text: #12151a;
  --soft: #565d68;
  --line: #d5d9df;
  --hover: #1f4fd8;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #13161b; --text: #eef0f3; --soft: #a3abb7; --line: #343a44; --hover: #8fb0ff; color-scheme: dark; }
}
:root[data-theme="dark"] { --bg: #13161b; --text: #eef0f3; --soft: #a3abb7; --line: #343a44; --hover: #8fb0ff; color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  padding: clamp(3rem, 11vw, 8.5rem) 1.5rem 4.5rem;
  background: var(--bg);
  color: var(--text);
  font-family: Literata, Georgia, serif;
}
main { max-width: 37.5rem; margin: 0 auto; }
a { color: inherit; }
a:hover { color: var(--hover); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--hover); outline-offset: 4px; border-radius: 2px; }
h1 {
  margin: 0;
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.015em;
}
hr { margin: 0; border: 0; border-top: 1px solid var(--line); }
time { font-style: italic; color: var(--soft); font-size: 1rem; line-height: 1.5; }

.theme {
  position: absolute;
  top: clamp(0.25rem, 2vw, 1.5rem);
  right: clamp(0.75rem, 2vw, 1.5rem);
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--soft);
  cursor: pointer;
}
.theme:hover { color: var(--hover); }

/* Home */
.intro {
  margin: 1.25rem 0 clamp(2rem, 3.2vw, 2.5rem);
  font-size: clamp(1.125rem, 1.6vw, 1.25rem);
  line-height: 1.6;
  color: var(--soft);
  text-wrap: pretty;
}
.topics { list-style: none; margin: 0.625rem 0 0; padding: 0; }
.topics a {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.375rem 1.5rem;
  padding: 0.875rem 0;
  text-decoration: none;
}
.topics .title { flex: 1 1 300px; min-width: 0; font-size: clamp(1.375rem, 1.9vw, 1.5rem); line-height: 1.35; }
.topics .about { flex: 1 1 100%; font-size: 1.0625rem; line-height: 1.6; color: var(--soft); }

/* Topic page */
.home { display: inline-block; margin: 0 0 1.25rem; padding: 0.5rem 0; font-size: 1.0625rem; color: var(--soft); text-decoration: none; }
.home:hover { color: var(--hover); }
article time { display: block; margin: 1rem 0 clamp(2rem, 3.2vw, 2.5rem); }
article hr { margin-bottom: clamp(1.75rem, 3vw, 2.25rem); }
article p { margin: 0 0 1.25rem; font-size: clamp(1.125rem, 1.5vw, 1.1875rem); line-height: 1.7; text-wrap: pretty; }
article h2 { margin: 2.75rem 0 1rem; font-size: 1.5rem; font-weight: 400; line-height: 1.35; }
article p a { text-decoration-thickness: 1px; text-underline-offset: 0.25em; }
article h3 { margin: 2rem 0 0.75rem; font-size: 1.1875rem; font-weight: 400; font-style: italic; line-height: 1.4; }
article ul, article ol { margin: 0 0 1.25rem; padding-left: 1.4rem; font-size: clamp(1.125rem, 1.5vw, 1.1875rem); line-height: 1.7; }
article li p { margin: 0 0 0.5rem; }
article li a { text-decoration-thickness: 1px; text-underline-offset: 0.25em; }
article blockquote { margin: 0 0 1.25rem; padding: 0 0 0 1.25rem; color: var(--soft); font-style: italic; }
article p, article li { overflow-wrap: break-word; }
article p + hr { margin: 2.5rem 0; }
article pre { overflow-x: auto; margin: 0 0 1.25rem; font-size: 0.9375rem; line-height: 1.6; }
article figure { margin: 2rem 0; }
article img { display: block; max-width: 100%; height: auto; border-radius: 4px; }
article figure img { margin: 0 auto; }
article figcaption { margin-top: 0.625rem; font-size: 1rem; font-style: italic; line-height: 1.5; color: var(--soft); }
.video { aspect-ratio: 16 / 9; margin: 2rem 0; border-radius: 4px; overflow: hidden; background: var(--line); }
.video.tall { aspect-ratio: 9 / 16; max-width: 22rem; margin-inline: auto; }
.video iframe { display: block; width: 100%; height: 100%; border: 0; }
