:root {
  color-scheme: dark;
  --bg: #1a1b26;
  --bg-alt: #16161e;
  --text: #c0caf5;
  --muted: #565f89;
  --line: #292e42;
  --link: #7aa2f7;
  --link-hover: #7dcfff;
  --tag: #bb9af7;
  --max-width: 720px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
  font-size: 18px;
  line-height: 1.65;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

a:hover {
  color: var(--text);
}

.site-header,
.site-footer,
main {
  width: min(var(--max-width), calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--line);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.site-title {
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--text);
}

main {
  padding: 3rem 0 1rem;
}

.hero,
.page-heading {
  margin-bottom: 3rem;
}

.eyebrow,
.post-date {
  margin: 0 0 0.4rem;
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.82rem;
  line-height: 1.4;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--text);
  font-weight: 700;
  line-height: 1.18;
}

h1 {
  max-width: 14ch;
  font-size: clamp(2.5rem, 8vw, 4.25rem);
  letter-spacing: -0.04em;
}

h2 {
  font-size: 1rem;
}

h3 {
  font-size: 1.35rem;
}

.intro,
.page-heading p {
  max-width: 38rem;
  color: var(--muted);
  font-size: 1.08rem;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.section-heading a {
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: none;
}

.section-heading a:hover {
  color: var(--text);
}

.post-list {
  display: grid;
}

.post-card {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
}

.post-card h3 a {
  color: var(--text);
  text-decoration: none;
}

.post-card h3 a:hover {
  color: var(--link-hover);
}

.post-card p:not(.post-date) {
  margin: 0.5rem 0 0;
  color: var(--muted);
}

.post-header {
  margin-bottom: 2.25rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.post-header h1 {
  max-width: 15ch;
  font-size: clamp(2.25rem, 7vw, 3.75rem);
}

.content {
  max-width: 40rem;
}

.content p,
.content ul,
.content ol {
  color: var(--text);
}

.content img,
.content video {
  display: block;
  max-width: 100%;
  margin: 2rem 0;
}

.gif-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 2rem 0;
}

.gif-grid img {
  display: block;
  width: 100%;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
}

@media (max-width: 700px) {
  .gif-grid {
    grid-template-columns: 1fr;
  }
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.8rem 0 0;
  padding: 0;
  color: var(--tag);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.82rem;
  list-style: none;
}

.tags a {
  color: var(--tag);
  text-decoration: none;
}

.tags a:hover {
  color: var(--text);
}

.content pre {
  padding: 1rem 1.2rem;
  overflow-x: auto;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.88rem;
  line-height: 1.55;
}

.content code {
  padding: 0.15em 0.4em;
  background: var(--bg-alt);
  border-radius: 4px;
  font-size: 0.88em;
}

.content pre code {
  padding: 0;
  background: none;
}

.content code,
.content pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--text);
}

::selection {
  background: var(--tag);
  color: var(--bg);
}

.site-footer {
  padding: 3rem 0 2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.85rem;
}

@media (max-width: 560px) {
  body {
    font-size: 17px;
  }

  .site-header,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  main {
    padding-top: 2rem;
  }
}
