/* ---------------------------------------------------------------------------
   Fonts: Newsreader (SIL Open Font License), self-hosted from fonts/.
   Upright file covers weights 400–600; latin-ext subsets exist for "ś" etc.
   --------------------------------------------------------------------------- */
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/newsreader-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/newsreader-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/newsreader-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/newsreader-italic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------------------------------------------------------------------------
   Theme
   --------------------------------------------------------------------------- */
:root {
  color-scheme: light dark;
  --bg: #fdfcf9;
  --fg: #1f1e1b;
  --muted: #6f6c66;
  --link: #2a5db0;
  --rule: #e4e0d8;
  --code-bg: #f3f1ec;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161513;
    --fg: #e6e2da;
    --muted: #9c978e;
    --link: #8fb3ee;
    --rule: #2f2d29;
    --code-bg: #22211e;
  }
}

/* ---------------------------------------------------------------------------
   Base
   --------------------------------------------------------------------------- */
html {
  font-size: 112.5%; /* 18px */
}

body {
  max-width: 36rem;
  margin: 0 auto;
  padding: 3.5rem 1.25rem 5rem;
  font-family: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  line-height: 1.55;
  color: var(--fg);
  background: var(--bg);
}

h1 {
  font-size: 2rem;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.5rem;
}

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

h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 2rem 0 0.5rem;
}

p,
ul,
ol,
blockquote,
pre {
  margin: 0 0 1rem;
}

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

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

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

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

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

/* ---------------------------------------------------------------------------
   Home page
   --------------------------------------------------------------------------- */
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin: 1.25rem 0 2.5rem;
}

.links a,
.top-nav a {
  text-decoration: none;
}

.links a:hover,
.top-nav a:hover {
  text-decoration: underline;
}

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

.posts li {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.posts time {
  flex: 0 0 5.5rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------------------
   Blog posts
   --------------------------------------------------------------------------- */
.top-nav {
  margin-bottom: 2.5rem;
  font-size: 0.95rem;
}

article .meta {
  margin-bottom: 2rem;
}

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

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

pre code {
  font-size: inherit;
}

blockquote {
  padding-left: 1rem;
  border-left: 2px solid var(--rule);
  color: var(--muted);
}

footer {
  margin-top: 4rem;
  color: var(--muted);
  font-size: 0.9rem;
}
