@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,400;0,500;0,600;1,400&display=swap');

:root {
  --bg: #ffffff;
  --fg: #353535;
  --fg-muted: #606060;
  --link: #353535;
  --border: #353535;
  --code-bg: #f5f5f5;
  --mark-bg: #fff3cd;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1e1e1e;
    --fg: #d4d4d4;
    --fg-muted: #9a9a9a;
    --link: #d4d4d4;
    --border: #404040;
    --code-bg: #2a2a2a;
    --mark-bg: #4a4000;
  }
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica, helvetica neue, ubuntu, roboto, noto, segoe ui, arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  text-rendering: optimizeSpeed;
  color: var(--fg);
  background-color: var(--bg);
  margin: 0;
  padding: 0;
}

.container {
  max-width: 70ch;
  margin: 0 auto;
  padding: 2ch;
}

/* Nav */
nav {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
}

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

nav a:first-child {
  color: var(--fg);
  font-weight: 600;
  margin-right: auto;
}

nav a:hover,
nav a:focus {
  color: var(--bg);
  background-color: var(--fg);
}

nav a:first-child:hover {
  background: none;
  color: var(--fg);
}

/* Main content */
main {
  min-height: 60vh;
}

.site-description {
  margin-top: 0;
  margin-bottom: 3rem;
}

h1, h2, h3 {
  font-weight: 600;
  line-height: 1.3;
  margin-top: 2rem;
}

h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

h2 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

p {
  margin: 1rem 0;
}

a {
  color: var(--link);
  text-decoration: underline;
}

a:hover,
a:focus {
  color: var(--bg);
  background-color: var(--fg);
  text-decoration: none;
}

/* Post list */
.post-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

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

.post-list a {
  text-decoration: none;
}

.post-list a:hover {
  text-decoration: underline;
  background: none;
  color: var(--fg);
}

.post-date {
  color: var(--fg-muted);
  margin-right: 2rem;
}

.post-title {
}

/* Single post */
.post-header {
  margin-bottom: 2rem;
  text-align: center;
}

.post-header h1 {
  margin-top: 0;
  font-size: 2rem;
  font-weight: 600;
}

.post-meta {
  color: var(--fg-muted);
  font-size: 1.125rem;
  font-weight: 400;
  font-style: italic;
  margin-top: 0.5rem;
}

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

.post-content p {
  margin: 1rem 0;
}

/* Inline code */
code {
  font-family: "JetBrains Mono", "San Francisco Mono", Monaco, Consolas, "Lucida Console", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", monospace;
  font-size: small;
  padding: 0.1rem;
}

/* Code blocks */
pre {
  font-family: "JetBrains Mono", "San Francisco Mono", Monaco, Consolas, "Lucida Console", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", monospace;
  font-size: small;
  border: 1px solid var(--border);
  padding: 0.5rem;
  overflow-x: auto;
  line-height: 1.4;
}

pre code {
  padding: 0;
  border: none;
}

/* Images */
img {
  max-width: 100%;
  height: auto;
}

figure {
  margin: 1.5rem 0;
}

figcaption {
  font-size: 0.9rem;
  font-style: italic;
  color: var(--fg-muted);
  margin-top: 0.5rem;
}

/* Blockquotes */
blockquote {
  border-left: 5px solid var(--border);
  margin: 1rem 0;
  padding-left: 1rem;
}

blockquote p {
  margin: 0.5rem 0;
}

/* Lists */
ul, ol {
  margin: 1rem 0;
  padding-left: 1.2rem;
}

ul {
  list-style: square;
}

li {
  margin-bottom: 0.25rem;
}

li > ul, li > ol {
  margin: 0.25rem 0;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

th, td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  text-align: left;
}

th {
  font-weight: 600;
}

/* Task lists */
.task-list-item {
  list-style: none;
  margin-left: -1.2rem;
}

.task-list-item input {
  margin-right: 0.5rem;
}

/* Footnotes */
.footnotes {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}

.footnotes ol {
  padding-left: 1.2rem;
}

/* Mark/highlight */
mark {
  background: var(--mark-bg);
  padding: 0.1rem 0.2rem;
}

/* Subscript/superscript */
sub, sup {
  font-size: 0.75em;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sup {
  top: -0.5em;
}

sub {
  bottom: -0.25em;
}

/* Horizontal rule */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* Definition lists */
dl {
  margin: 1rem 0;
}

dt {
  font-weight: 600;
  margin-top: 1rem;
}

dd {
  margin-left: 1.2rem;
  margin-top: 0.25rem;
}

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

footer a {
  color: var(--fg-muted);
}

footer a:hover {
  color: var(--bg);
  background-color: var(--fg);
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .container {
    padding: 1rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.25rem;
  }
}
