/* codeofrob.com, 2026. One file, no framework. */

:root {
  --bg: #fbfaf6;
  --text: #24221e;
  --muted: #6d685e;
  --rule: #e3dfd3;
  --link: #3a6b1c;
  --link-hover: #24470f;
  --accent: #8fbf3f;
  --code-bg: #f4efdf;
  --code-text: #3c3836;
  --quote-bg: #f2efe6;

  /* gruvbox light, which the site has used for code since 2021 */
  --hl-keyword: #9d0006;
  --hl-title: #076678;
  --hl-type: #b57614;
  --hl-number: #8f3f71;
  --hl-meta: #af3a03;
  --hl-string: #79740e;
  --hl-tag: #427b58;
  --hl-comment: #928374;

  --serif: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --mono: "Source Code Pro", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --measure: 42rem;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1d2021;
    --text: #e6dfcb;
    --muted: #a39b88;
    --rule: #3a3633;
    --link: #a9cf6a;
    --link-hover: #cbe69a;
    --accent: #8fbf3f;
    --code-bg: #282828;
    --code-text: #ebdbb2;
    --quote-bg: #262626;

    --hl-keyword: #fb4934;
    --hl-title: #83a598;
    --hl-type: #fabd2f;
    --hl-number: #d3869b;
    --hl-meta: #fe8019;
    --hl-string: #b8bb26;
    --hl-tag: #8ec07c;
    --hl-comment: #928374;
  }
}

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

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

body {
  margin: 0;
  padding: 0 1rem;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.6;
  font-optical-sizing: auto;
  border-top: 4px solid var(--accent);
}

header.site, main, footer.site {
  max-width: var(--measure);
  margin: 0 auto;
}

/* Header */

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

header.site .name {
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

header.site nav {
  display: flex;
  gap: 1.25rem;
  font-family: var(--mono);
  font-size: 0.85rem;
}

header.site nav a { color: var(--muted); text-decoration: none; }
header.site nav a:hover { color: var(--link); }

/* Footer */

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

footer.site p { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; margin: 0; }
footer.site a { color: var(--muted); }
footer.site a:hover { color: var(--link); }

/* Type */

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

h1, h2, h3, h4, h5, h6 {
  line-height: 1.25;
  font-weight: 700;
  margin: 2.2em 0 0.6em;
  letter-spacing: -0.01em;
}

h1 { font-size: 2.1rem; margin-top: 0; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.2rem; }
h4, h5, h6 { font-size: 1rem; }

p, ul, ol, dl, table, figure, pre, blockquote { margin: 0 0 1.1em; }
ul, ol { padding-left: 1.4em; }
li { margin: 0.2em 0; }
li > ul, li > ol { margin-bottom: 0; }

strong, b { font-weight: 700; }
em, i { font-style: italic; }

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

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

blockquote {
  margin-left: 0;
  margin-right: 0;
  padding: 0 0 0 1.1em;
  border-left: 1px solid var(--muted);
  color: var(--muted);
}
blockquote > :last-child { margin-bottom: 0; }

table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 0.95rem;
}
th, td { border: 1px solid var(--rule); padding: 0.35em 0.7em; text-align: left; vertical-align: top; }
th { font-weight: 600; }

/* Code */

code, kbd, samp, pre { font-family: var(--mono); }

code {
  font-size: 0.85em;
  background: var(--code-bg);
  padding: 0.1em 0.3em;
  border-radius: 3px;
}

pre {
  font-size: 0.85rem;
  line-height: 1.5;
  background: var(--code-bg);
  color: var(--code-text);
  padding: 0.9rem 1rem;
  overflow-x: auto;
  border-radius: 4px;
  tab-size: 2;
}

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

.hljs { color: var(--code-text); background: none; }
.hljs-keyword, .hljs-selector-tag, .hljs-deletion, .hljs-formula, .hljs-link { color: var(--hl-keyword); }
.hljs-built_in, .hljs-name, .hljs-title, .hljs-variable, .hljs-quote { color: var(--hl-title); }
.hljs-attr, .hljs-params, .hljs-template-tag, .hljs-type { color: var(--hl-type); }
.hljs-builtin-name, .hljs-doctag, .hljs-literal, .hljs-number, .hljs-link_label { color: var(--hl-number); }
.hljs-code, .hljs-meta, .hljs-regexp, .hljs-selector-id, .hljs-template-variable { color: var(--hl-meta); }
.hljs-addition, .hljs-meta-string, .hljs-section, .hljs-selector-attr, .hljs-selector-class, .hljs-string, .hljs-symbol { color: var(--hl-string); }
.hljs-attribute, .hljs-bullet, .hljs-class, .hljs-function, .hljs-meta-keyword, .hljs-selector-pseudo, .hljs-tag { color: var(--hl-tag); }
.hljs-comment { color: var(--hl-comment); font-style: italic; }
.hljs-section, .hljs-strong, .hljs-tag { font-weight: 600; }
.hljs-emphasis { font-style: italic; }

/* 2009-2011 posts came out of Windows Live Writer: one <pre> per line, colours as classes,
   and inline styles insisting on 8pt Courier on a white background */
.post-body .csharpcode, .post-body #codeSnippetWrapper {
  background: var(--code-bg) !important;
  color: var(--code-text) !important;
  font-family: var(--mono);
  font-size: 0.85rem !important;
  padding: 0.9rem 1rem !important;
  margin: 0 0 1.1em !important;
  overflow-x: auto;
  border: 0 !important;
  border-radius: 4px;
  width: auto !important;
}
.post-body .csharpcode pre, .post-body #codeSnippetWrapper pre, .post-body #codeSnippet,
.post-body pre[style] {
  background: transparent !important;
  color: inherit !important;
  font-family: var(--mono) !important;
  font-size: inherit !important;
  line-height: 1.5 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0;
  overflow: visible !important;
  width: auto !important;
}
.post-body pre[style]:only-child, .post-body div > pre[style] { white-space: pre; }
.csharpcode .lnum, .csharpcode .rem, #codeSnippet span[style*="#606060"] { color: var(--hl-comment) !important; }
.csharpcode .kwrd, #codeSnippet span[style*="#0000ff"] { color: var(--hl-keyword) !important; }
.csharpcode .str, #codeSnippet span[style*="#006080"] { color: var(--hl-string) !important; }
.csharpcode .op { color: var(--code-text); }
.csharpcode .preproc { color: var(--hl-meta); }
.csharpcode .html, .csharpcode .attr { color: var(--hl-title); }
.csharpcode .asp { background: none; }
.post-body #codeSnippet span[style*="color: #008000"] { color: var(--hl-comment) !important; }

/* Posts */

.post header h1 { margin-bottom: 0.3rem; }

.meta {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 2rem;
}

.post-body h1 { font-size: 1.6rem; margin-top: 2em; }
.post-body h2 { font-size: 1.35rem; }
.post-body h3 { font-size: 1.15rem; }
.post-body > :first-child { margin-top: 0; }
.post-body img[style*="float: left"], .post-body img[align="left"] { margin: 0.3em 1.2em 0.6em 0; }
.post-body img[style*="float: right"], .post-body img[align="right"] { margin: 0.3em 0 0.6em 1.2em; }
.post-body .twitter-tweet { font-size: 0.95rem; }

.post > footer {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}

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

.older-newer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 2rem;
  font-size: 0.95rem;
  line-height: 1.35;
}
.older-newer a { text-decoration: none; }
.older-newer a:hover { text-decoration: underline; }
.older-newer a[rel="next"] { text-align: right; }
.older-newer a span {
  display: block;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.comments {
  margin-top: 1.5rem;
  font-size: 0.92rem;
}
.comments summary {
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
}
.comments ol { list-style: none; padding: 0; margin: 1rem 0 0; }
.comments li { padding: 0.8rem 0; border-top: 1px solid var(--rule); margin: 0; }
.comment-author { font-weight: 600; margin: 0 0 0.3rem; }
.comment-author span { font-weight: 400; font-family: var(--mono); font-size: 0.75rem; color: var(--muted); margin-left: 0.4rem; }
.comment-body { overflow-wrap: anywhere; }

/* Lists of posts */

ul.posts { list-style: none; padding: 0; }
ul.posts li {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 0 1rem;
  margin: 0.35rem 0;
  line-height: 1.4;
}
ul.posts time {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  padding-top: 0.2rem;
}

.more { font-size: 0.95rem; }
.aside { margin-top: 3rem; font-size: 0.9rem; color: var(--muted); }
.aside a { color: var(--muted); }

.series-list { display: grid; gap: 0 2.5rem; }
.series h3 { margin: 1.6em 0 0.3em; font-size: 1.1rem; }
.series p { color: var(--muted); font-size: 0.95rem; margin-bottom: 0.4em; }
.series ol { font-size: 0.95rem; margin-bottom: 0; }
.year h3 { font-family: var(--mono); font-size: 0.95rem; color: var(--muted); font-weight: 600; margin: 2em 0 0.5em; }

/* Pages */

.page h2 { padding-top: 0.5rem; }

.project h3 { margin-top: 1.6em; }
.project img { display: block; margin: 0 0 1em; border: 1px solid var(--rule); border-radius: 4px; }
ul.projects li { margin: 0.5em 0; }

ul.talks { list-style: none; padding: 0; }
ul.talks li { margin: 0 0 1.6rem; }
ul.talks h3 { margin: 0 0 0.1rem; font-size: 1.1rem; }
ul.talks .where { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); margin: 0 0 0.3rem; }
ul.talks p { margin-bottom: 0; }

ul.quotes { list-style: none; padding: 0; }
ul.quotes li { margin: 0 0 1.4rem; }
ul.quotes blockquote { font-size: 1.2rem; font-style: italic; margin-bottom: 0.3rem; }
ul.quotes p { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); margin: 0; }

figure.statement { margin: 0 0 2rem; }
figure.statement blockquote { margin-bottom: 0.4rem; }
figure.statement figcaption { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); }

@media (max-width: 34rem) {
  body { font-size: 1.05rem; }
  h1 { font-size: 1.75rem; }
  header.site { padding-top: 1.25rem; margin-bottom: 1.75rem; }
  ul.posts li { grid-template-columns: 1fr; }
  ul.posts time { padding-top: 0; }
  .older-newer { grid-template-columns: 1fr; }
  .older-newer a[rel="next"] { text-align: left; }
  pre, .post-body .csharpcode { margin-left: -1rem !important; margin-right: -1rem !important; border-radius: 0; }
}

/* Community Server-era <font face="Arial"> tags */
.post-body font { font-family: inherit; font-size: inherit; color: inherit; }
