:root {
  --bg: #000000;
  --text: #e8e6e1;
  --muted: #8a877f;
  --accent: #d9c8a0;
  --rule: #26262a;
  --code-bg: #141416;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

.site-shell,
.post-shell {
  width: min(42rem, calc(100% - 3rem));
  margin-inline: auto;
  padding-block: 6rem 3rem;
}

h1,
h2,
h3 {
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.02em;
}

h1 {
  margin: 0 0 1.75rem;
  font-size: 1.5rem;
  line-height: 2rem;
  letter-spacing: -0.05em;
}

h2 {
  margin: 3.75rem 0 1rem;
  font-size: 1rem;
  line-height: 1.4;
}

h3 {
  margin: 2rem 0 0.6rem;
  font-size: 1rem;
  line-height: 1.45;
}

p {
  margin: 0 0 1rem;
}

a {
  color: var(--text);
  text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color 140ms ease, text-decoration-color 140ms ease;
}

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

a:focus-visible {
  border-radius: 2px;
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.bio {
  max-width: 40rem;
}

.social-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.social-links a {
  display: inline-flex;
  width: 1.125rem;
  height: 1.125rem;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  text-decoration: none;
}

.social-links a:hover {
  color: var(--accent);
}

.social-links svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.post-list {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
  list-style: none;
}

.post-list:empty {
  display: none;
}

.post-list li {
  display: grid;
  grid-template-columns: 7.2rem minmax(0, 1fr);
  gap: 1rem;
  align-items: baseline;
  padding-block: 0.72rem;
  border-bottom: 1px solid var(--rule);
}

.post-list time,
.post-date {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.post-list a {
  text-decoration-color: transparent;
}

.post-list a:hover {
  text-decoration-color: var(--accent);
}

.home-link {
  display: inline-block;
  margin-bottom: 3rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.post-header {
  margin-bottom: 3rem;
}

.post-header h1 {
  margin-bottom: 0.65rem;
}

article h2 {
  margin-top: 3rem;
  font-size: 1.35rem;
}

article h3 {
  margin-top: 2.1rem;
  font-size: 1.05rem;
}

blockquote {
  margin: 1.8rem 0;
  padding-left: 1.2rem;
  border-left: 1px solid var(--accent);
  color: color-mix(in srgb, var(--text) 82%, var(--muted));
}

blockquote p:last-child {
  margin-bottom: 0;
}

code {
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--code-bg);
  padding: 0.12rem 0.32rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.88em;
}

pre {
  overflow-x: auto;
  margin: 1.7rem 0;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--code-bg);
  padding: 1rem 1.1rem;
  line-height: 1.55;
}

pre code {
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 0.85rem;
}

figure {
  margin: 2rem 0;
}

.figure-placeholder {
  display: grid;
  min-height: 9rem;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

figcaption {
  margin-top: 0.65rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.katex-display {
  overflow-x: auto;
  overflow-y: hidden;
  padding-block: 0.3rem;
}

@media (max-width: 36rem) {
  .site-shell,
  .post-shell {
    padding-block: 3.5rem 2rem;
  }

  .post-list li {
    grid-template-columns: 6.7rem minmax(0, 1fr);
    gap: 0.75rem;
  }

}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
