:root {
  color-scheme: light dark;
  --bg: #fff;
  --fg: #000;
  --text: #262626;
  --muted: #525252;
  --faint: #a3a3a3;
  --line: #d4d4d4;
  --code-bg: #fafafa;
  --code-line: #e5e5e5;
  --inline-bg: #f0f0f0;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000;
    --fg: #fff;
    --text: #e5e5e5;
    --muted: #a3a3a3;
    --faint: #525252;
    --line: #525252;
    --code-bg: #171717;
    --code-line: #171717;
    --inline-bg: #262626;
  }
}

* {
  box-sizing: border-box;
}

html {
  min-width: 360px;
  background: var(--bg);
  color: var(--fg);
  font-family: ui-monospace, Menlo, Monaco, "Cascadia Mono", "Segoe UI Mono", "Roboto Mono", "Oxygen Mono", "Ubuntu Mono", "Source Code Pro", "Fira Mono", "Droid Sans Mono", Consolas, "Courier New", monospace;
  -webkit-font-smoothing: antialiased;
}

body {
  max-width: 48rem;
  margin: 2rem auto;
  padding: 0 1rem;
  line-height: 1.5;
}

::selection {
  background: #47a3f3;
  color: #fefefe;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--faint);
  text-decoration-thickness: 0.1em;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: currentColor;
}

nav {
  display: flex;
  gap: 1rem;
  margin: 1.5rem 0 4rem;
  letter-spacing: -0.025em;
}

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

nav a:hover {
  color: var(--muted);
}

h1, h2, h3, h4 {
  font-weight: 500;
  letter-spacing: -0.05em;
  margin: 1.5rem 0 0.5rem;
}

h1.title {
  font-size: 1.5rem;
  margin-top: 0;
  text-wrap: balance;
}

h1.name {
  font-size: 1.5rem;
  font-weight: 300;
  margin-top: 2.5rem;
}

main > h2 {
  font-size: 1.25rem;
  font-weight: 300;
  margin-top: 2.5rem;
}

h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

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

p + hr {
  margin-top: 2.5rem;
}

.muted,
.date {
  color: var(--muted);
}

h1.title + .date {
  margin: 0.5rem 0 2rem;
  font-size: 0.875rem;
}

.posts {
  margin: 2rem 0;
}

a.post {
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem;
  text-decoration: none;
}

a.post .date {
  font-variant-numeric: tabular-nums;
}

@media (min-width: 768px) {
  a.post {
    flex-direction: row;
    gap: 0.5rem;
  }

  a.post .date {
    width: 12rem;
    flex-shrink: 0;
  }
}

article p,
article li {
  color: var(--text);
}

article p {
  margin: 1rem 0;
}

article h1 { font-size: 2.25rem; margin-top: 1.5rem; }
article h2 { font-size: 1.25rem; }

article ul { list-style: disc; padding-left: 1.5rem; }
article ol { list-style: decimal; padding-left: 1.5rem; }
article strong { font-weight: 500; }
article img { max-width: 100%; height: auto; border-radius: 0.5rem; }

code {
  padding: 0.125rem 0.25rem;
  border-radius: 0.5rem;
}

:not(pre) > code {
  font-family: inherit;
  font-size: 0.9em;
  padding: 0.1rem 0.35rem;
  border-radius: 0.375rem;
  background: var(--inline-bg);
  color: var(--fg);
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--code-line);
  border-radius: 0.5rem;
  overflow-x: auto;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  scrollbar-width: none;
}

pre::-webkit-scrollbar {
  display: none;
}

pre code {
  padding: 0;
  line-height: 1.5;
}

table {
  display: block;
  max-width: fit-content;
  overflow-x: auto;
  white-space: nowrap;
  border-collapse: collapse;
}

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

footer {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 2rem 0 4rem;
  color: var(--muted);
}

footer a {
  text-decoration: none;
}

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

@media (min-width: 768px) {
  footer {
    flex-direction: row;
    gap: 1rem;
  }
}

figure {
  margin: 2rem 0;
}

figure svg {
  display: block;
  width: 100%;
  height: auto;
}

figcaption {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.875rem;
}

svg text {
  fill: currentColor;
  font-family: inherit;
  font-size: 11px;
}

svg .f-val,
svg .f-tick {
  fill: var(--muted);
  font-size: 9px;
}

svg .f-axis,
svg .f-frame {
  stroke: var(--line);
  fill: none;
}

svg .f-bar {
  fill: var(--fg);
}

svg .f-line {
  stroke: var(--fg);
  stroke-width: 1.5;
  fill: none;
}

svg .f-dash {
  stroke-dasharray: 3 3;
}

svg .f-dot {
  fill: var(--fg);
}
