/* Alex Novak — notes. Single stylesheet, light + dark via prefers-color-scheme. */

:root {
  --bg: #fcfcfa;
  --fg: #1f2328;
  --muted: #5c6670;
  --link: #0b63c4;
  --link-hover: #084a94;
  --border: #e3e3df;
  --code-bg: #f4f4f1;
  --code-fg: #24292f;
  --tag-bg: #ecece8;
  --tag-fg: #44474b;
  --accent: #0b63c4;
  --maxw: 44rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a;
    --fg: #d6dadf;
    --muted: #8a949e;
    --link: #6cb0f5;
    --link-hover: #9ccbfb;
    --border: #2b2f34;
    --code-bg: #1d2024;
    --code-fg: #d6dadf;
    --tag-bg: #23272c;
    --tag-fg: #a9b1b9;
    --accent: #6cb0f5;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  padding: 0 1.1rem;
}

.wrap { max-width: var(--maxw); margin: 0 auto; }

/* Header */
header.site {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 1.8rem 0 1.4rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}
header.site .brand {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--fg);
}
header.site nav a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 1.1rem;
  font-size: 0.95rem;
}
header.site nav a:hover { color: var(--link); }
header.site nav a:first-child { margin-left: 0; }

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

h1, h2, h3 { line-height: 1.25; letter-spacing: -0.015em; }
h1 { font-size: 1.9rem; margin: 0 0 0.3rem; }
h2 { font-size: 1.35rem; margin: 2rem 0 0.6rem; }
h3 { font-size: 1.1rem; margin: 1.6rem 0 0.4rem; }

p { margin: 0.9rem 0; }

/* Post list on home / archive */
ul.posts { list-style: none; padding: 0; margin: 0; }
ul.posts li { padding: 1.1rem 0; border-bottom: 1px solid var(--border); }
ul.posts li:last-child { border-bottom: none; }
ul.posts .title { font-size: 1.2rem; font-weight: 600; }
ul.posts .meta { color: var(--muted); font-size: 0.88rem; margin-top: 0.25rem; }
ul.posts p.excerpt { margin: 0.45rem 0 0; color: var(--fg); }

time { color: var(--muted); font-variant-numeric: tabular-nums; }

/* Tags */
.tags { margin-top: 0.3rem; }
.tag {
  display: inline-block;
  background: var(--tag-bg);
  color: var(--tag-fg);
  font-size: 0.78rem;
  padding: 0.08rem 0.5rem;
  border-radius: 0.6rem;
  margin: 0.15rem 0.3rem 0.15rem 0;
  text-decoration: none;
}
.tag:hover { color: var(--accent); text-decoration: none; }

/* Article */
article .meta { color: var(--muted); font-size: 0.9rem; margin-bottom: 1.6rem; }
article p, article li { overflow-wrap: break-word; }
article ul, article ol { padding-left: 1.4rem; }
article li { margin: 0.35rem 0; }

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

/* Code */
code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.86em;
  background: var(--code-bg);
  color: var(--code-fg);
  padding: 0.12em 0.36em;
  border-radius: 0.3rem;
}
pre {
  background: var(--code-bg);
  color: var(--code-fg);
  padding: 0.95rem 1.05rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  line-height: 1.5;
}
pre code { background: none; padding: 0; font-size: 0.82rem; border-radius: 0; }

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

/* Footer */
footer.site {
  margin: 3.5rem 0 2.5rem;
  padding-top: 1.3rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.86rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
footer.site a { color: var(--muted); }
footer.site a:hover { color: var(--link); }

.lead { font-size: 1.05rem; color: var(--muted); }

.notfound { text-align: center; padding: 3rem 0; }
.notfound h1 { font-size: 4rem; margin-bottom: 0.2rem; }

@media (max-width: 480px) {
  body { font-size: 16px; }
  h1 { font-size: 1.6rem; }
  header.site { padding-top: 1.3rem; }
}
