/* kevops.com -- black on white, white on black, nothing else. */

:root {
  --bg: #ffffff;
  --fg: #111111;
  --muted: #6b6b6b;
  --rule: #e2e2e2;
  --code-bg: #f6f6f6;
  --link-underline: #bdbdbd;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --fg: #e6e6e6;
    --muted: #8a8a8a;
    --rule: #262626;
    --code-bg: #101010;
    --link-underline: #4a4a4a;
  }
}

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

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

body {
  margin: 0 auto;
  padding: 3rem 1.25rem 4rem;
  max-width: 42rem;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------- masthead ---------- */

.masthead { margin-bottom: 3rem; }

.brand {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
               "Liberation Mono", monospace;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.tagline {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.masthead nav {
  margin-top: 1.1rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule);
  font-size: 0.9rem;
}

.masthead nav a {
  margin-right: 1.1rem;
  color: var(--muted);
  text-decoration: none;
}

.masthead nav a:hover { color: var(--fg); }

/* ---------- type ---------- */

h1, h2, h3, h4 {
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin: 2.4rem 0 0.8rem;
}

h1 { font-size: 1.85rem; margin-top: 0; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; }

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

a {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: var(--link-underline);
  text-underline-offset: 3px;
}

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

strong { font-weight: 650; }

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

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

ul, ol { padding-left: 1.4rem; }
li { margin-bottom: 0.35rem; }

/* ---------- code ---------- */

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

code {
  background: var(--code-bg);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.1em 0.35em;
}

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

pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: 1em;
}

/* ---------- media ---------- */

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

@media (prefers-color-scheme: dark) {
  /* Logos saved as transparent PNGs are dark artwork on nothing, which on a
     black page is dark artwork on black. Backing them with white restores the
     background the designer assumed. Opaque images are unaffected -- the
     background only shows through where the image is actually transparent. */
  p.fig img { background: #fff; }
}

p.fig {
  margin: 1.75rem 0;
  text-align: center;
}

p.fig em {
  display: inline-block;
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.88rem;
}

/* ---------- post list ---------- */

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

ul.posts li {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--rule);
}

ul.posts time {
  flex: 0 0 auto;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
}

ul.posts a { text-decoration: none; }
ul.posts a:hover { text-decoration: underline; text-underline-offset: 3px; }

ul.taglist {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}

ul.taglist .count { color: var(--muted); font-size: 0.8rem; }

/* ---------- post chrome ---------- */

.meta {
  margin-top: -0.4rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.tags {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-size: 0.85rem;
}

.tags a {
  margin-right: 0.75rem;
  color: var(--muted);
  text-decoration: none;
}

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

/* ---------- archived comments ---------- */

.comments {
  margin-top: 3rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.95rem;
}

.comments h2 {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 1.75rem;
}

.comments h3 {
  margin: 2rem 0 0.4rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
}

.comments h3 a { color: inherit; }

.comments .closed {
  margin-top: 2.5rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.back {
  margin-top: 3rem;
  font-size: 0.9rem;
}

.back a { color: var(--muted); text-decoration: none; }
.back a:hover { color: var(--fg); }

footer {
  margin-top: 4rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.82rem;
}

@media (max-width: 34rem) {
  body { padding: 2rem 1rem 3rem; font-size: 16px; }
  ul.posts li { flex-direction: column; gap: 0.15rem; }
}
