:root {
  color-scheme: light dark;
  --bg: light-dark(#fdfdfc, #161618);
  --fg: light-dark(#1c1c1e, #e6e6e8);
  --muted: light-dark(#6a6a70, #9b9ba3);
  --accent: light-dark(#2a66ff, #76a2ff);
  --rule: light-dark(#e3e3e6, #2e2e33);
  --code-bg: light-dark(#f3f3f5, #1f1f23);
  --measure: 40rem;
}

@media (color-gamut: p3) {
  :root {
    --accent: light-dark(color(display-p3 0.215 0.385 0.989), color(display-p3 0.488 0.626 0.993));
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0 auto;
  padding: 0 1rem;
  max-width: calc(var(--measure) + 2rem);
  background: var(--bg);
  color: var(--fg);
  font: 1.0625rem/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  text-rendering: optimizeLegibility;
}

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

a:hover {
  text-decoration-thickness: 2px;
}

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

h1,
h2,
h3 {
  line-height: 1.25;
  font-weight: 650;
  text-wrap: balance;
}

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

h2 {
  font-size: 1.25rem;
  margin: 2.5rem 0 0.75rem;
}

h3 {
  font-size: 1.0625rem;
  margin: 2rem 0 0.5rem;
}

p,
ul,
ol,
pre,
blockquote,
figure,
table {
  margin: 0 0 1.25rem;
}

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

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

address {
  font-style: normal;
  margin: 0 0 1.25rem;
}

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

code,
pre {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.875em;
}

code {
  padding: 0.1em 0.3em;
  border-radius: 4px;
  background: var(--code-bg);
}

pre {
  padding: 1rem;
  overflow-x: auto;
  border-radius: 6px;
  background: var(--code-bg);
  line-height: 1.5;
}

pre code {
  padding: 0;
  background: none;
  font-size: inherit;
}

table {
  border-collapse: collapse;
  width: 100%;
}

th,
td {
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--rule);
  text-align: left;
}

/* Layout */

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg);
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding: 2rem 0;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--rule);
}

.site-header a {
  text-decoration: none;
}

.site-header a:hover,
.site-header a[aria-current="page"] {
  text-decoration: underline;
}

.site-title {
  font-weight: 650;
  color: var(--fg);
}

.site-header nav {
  display: flex;
  gap: 1.25rem;
}

main {
  min-height: 50vh;
}

.site-footer {
  margin-top: 4rem;
  padding: 1.5rem 0 3rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.875rem;
}

.meta {
  color: var(--muted);
  font-size: 0.9375rem;
}

article > header {
  margin-bottom: 2rem;
}

article > header .meta {
  margin: 0;
}

/* Lists */

.links {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

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

.post-list li {
  display: flex;
  gap: 1rem;
  padding: 0.25rem 0;
}

.post-list time {
  flex: none;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.post-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
}

.post-nav [rel="next"] {
  margin-left: auto;
  text-align: right;
}

/* Syntax highlighting (Rouge) */

.highlight {
  --hl-comment: light-dark(#6e7781, #8b949e);
  --hl-keyword: light-dark(#cf222e, #ff7b72);
  --hl-string: light-dark(#0a3069, #a5d6ff);
  --hl-number: light-dark(#0550ae, #79c0ff);
  --hl-name: light-dark(#8250df, #d2a8ff);
  --hl-type: light-dark(#953800, #ffa657);
}

.highlight :is(.c, .c1, .cm, .cs, .cd, .cp, .cpf) { color: var(--hl-comment); font-style: italic; }
.highlight :is(.k, .kc, .kd, .kn, .kp, .kr, .ow) { color: var(--hl-keyword); }
.highlight :is(.s, .s1, .s2, .sa, .sb, .sc, .sd, .se, .sh, .si, .sr, .ss, .sx, .dl) { color: var(--hl-string); }
.highlight :is(.m, .mb, .mf, .mh, .mi, .mo, .il) { color: var(--hl-number); }
.highlight :is(.nf, .fm, .na, .nd, .nt) { color: var(--hl-name); }
.highlight :is(.kt, .nc, .nb, .bp, .ne, .nn) { color: var(--hl-type); }
.highlight .err { color: inherit; }
