:root {
  --bg: #1a1a1a;
  --text: #eeeeee;
  --muted: #999999;
  --link: #8ab4f8;
  --visited: #c58af9;
  --max-width: 680px;
}

html {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  padding: 1.5rem 1rem;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
}

header,
main,
footer {
  max-width: var(--max-width);
  margin: 0 auto;
}

header {
  margin-bottom: 2rem;
}

header h1 {
  margin: 0 0 0.25rem;
  font-size: 1.75rem;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: normal;
  letter-spacing: 0.01em;
}

header p {
  margin: 0;
  color: var(--muted);
}

nav {
  margin-top: 1rem;
}

nav a {
  margin-right: 1rem;
  text-decoration: none;
}

nav a:hover {
  text-decoration: underline;
}

a {
  color: var(--link);
}

a:visited {
  color: var(--visited);
}

h1,
h2,
h3 {
  line-height: 1.2;
}

article h1 {
  font-size: 1.75rem;
  margin-top: 0;
}

article img,
article video,
article canvas,
article iframe {
  max-width: 100%;
}

article img,
article video {
  height: auto;
}

time {
  color: var(--muted);
  font-size: 0.9rem;
}

.tags {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.tags span,
.tags a {
  margin-right: 0.5rem;
}

.tags a {
  text-decoration: none;
}

.post-list {
  list-style: none;
  padding: 0;
}

.home-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.home-nav > a {
  margin-right: 0;
}

.nav-sort {
  position: relative;
  display: inline-flex;
}

.sort-toggle {
  display: inline-grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  margin: -0.15rem 0;
  padding: 0;
  border: 0;
  border-radius: 0.35rem;
  background: transparent;
  color: var(--link);
  cursor: pointer;
}

.sort-toggle:hover,
.sort-toggle:focus-visible,
.sort-toggle[aria-expanded="true"] {
  background: rgba(128, 128, 128, 0.16);
  color: var(--text);
}

.sort-menu {
  position: absolute;
  z-index: 10;
  top: calc(100% + 0.45rem);
  right: 0;
  min-width: 10.5rem;
  padding: 0.3rem;
  border: 1px solid rgba(128, 128, 128, 0.4);
  border-radius: 0.55rem;
  background: #242424;
  box-shadow: 0 0.7rem 1.8rem rgba(0, 0, 0, 0.35);
}

.sort-menu[hidden] {
  display: none;
}

.sort-menu button {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 0.45rem 0.6rem;
  border: 0;
  border-radius: 0.35rem;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  text-align: left;
  cursor: pointer;
}

.sort-menu button:hover,
.sort-menu button:focus-visible {
  background: rgba(128, 128, 128, 0.18);
  outline: none;
}

.sort-menu button[aria-checked="true"]::after {
  content: "✓";
  margin-left: 0.8rem;
  color: var(--link);
}

.post-list li {
  margin-bottom: 1.75rem;
}

.post-list h2 {
  margin: 0 0 0.25rem;
  font-size: 1.35rem;
}

.post-list p {
  margin: 0.25rem 0 0;
  color: var(--muted);
}

hr {
  border: 0;
  border-top: 1px solid var(--muted);
  margin: 2rem 0;
}

pre,
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

pre {
  overflow-x: auto;
  padding: 1rem;
  background: rgba(128, 128, 128, 0.1);
  border-radius: 0.25rem;
}

code {
  font-size: 0.9em;
}

blockquote {
  border-left: 3px solid var(--muted);
  margin: 0;
  padding-left: 1rem;
  color: var(--muted);
}

footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--muted);
  color: var(--muted);
  font-size: 0.9rem;
}
