/* Layout: one left-aligned reading column, about 68 characters wide.
   Dark is the default. A device set to light gets light, and the toggle
   (data-theme on <html>) overrides both. */
:root {
  color-scheme: dark;
  --bg: #15181c;
  --surface: #1e2227;
  --text: #dde1e6;
  --muted: #9ba4af;
  --rule: #313740;
  --link: #8fb8ee;
  --visited: #b9a6e8;
  --code-key: #e0a577;
  --code-str: #a3c98f;
  --code-num: #d7b96e;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}
/* Light values appear twice: once for a device set to light, once for the toggle. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #fbfcfd;
    --surface: #eff1f4;
    --text: #1b1e23;
    --muted: #59626e;
    --rule: #d5dae0;
    --link: #0a4fb0;
    --visited: #6a3d9a;
    --code-key: #9a4a12;
    --code-str: #2f6b1f;
    --code-num: #7a5a00;
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #fbfcfd;
  --surface: #eff1f4;
  --text: #1b1e23;
  --muted: #59626e;
  --rule: #d5dae0;
  --link: #0a4fb0;
  --visited: #6a3d9a;
  --code-key: #9a4a12;
  --code-str: #2f6b1f;
  --code-num: #7a5a00;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1.0625rem/1.6 var(--sans);
}
[hidden] { display: none !important; }

.page {
  /* About 80 characters per line at the body text size (measured: 71-82,
     average 76, in Chromium with Helvetica metrics). WCAG 2.2 criterion 1.4.8,
     Visual Presentation (level AAA), advises no more than 80:
     https://www.w3.org/WAI/WCAG22/Understanding/visual-presentation.html */
  max-width: 45rem;
  margin-inline: auto;
  padding-inline: 1.25rem;
  padding-block: 1.5rem 3rem;
}

a { color: var(--link); text-underline-offset: 0.15em; text-decoration-thickness: 0.06em; }
a:visited { color: var(--visited); }
a:hover { text-decoration-thickness: 0.12em; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 2px; }

.skip { position: absolute; left: -999rem; }
.skip:focus { left: 1rem; top: 1rem; background: var(--bg); padding: 0.25rem 0.5rem; }

/* Header and footer */
header.site {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-bottom: 1rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--rule);
}
header.site .name { font-weight: 700; color: var(--text); text-decoration: none; }
header.site nav { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem 1.25rem; }
header.site nav a { color: var(--text); text-decoration: none; }
header.site nav a:hover, header.site .name:hover { text-decoration: underline; }
header.site nav a.here { text-decoration: underline; text-decoration-thickness: 0.12em; }
#theme-toggle {
  font: inherit;
  font-size: 0.875rem;
  color: var(--muted);
  background: none;
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.1rem 0.6rem;
  cursor: pointer;
}
#theme-toggle:hover { color: var(--text); border-color: var(--muted); }

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

/* Text */
h1, h2, h3 { line-height: 1.25; text-wrap: balance; letter-spacing: -0.01em; }
h1 { font-size: 2rem; margin: 0 0 1rem; }
h2 { font-size: 1.3rem; margin: 2.75rem 0 0.75rem; }
h3 { font-size: 1.0625rem; margin: 1.75rem 0 0.25rem; }
p, ul, ol, dl, blockquote, pre, table, figure { margin: 0 0 1.1rem; }
ul, ol { padding-left: 1.3rem; }
li { margin-bottom: 0.3rem; }
li > ul, li > ol { margin: 0.3rem 0 0; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; }
img { max-width: 100%; height: auto; }
blockquote {
  margin-left: 0;
  padding-left: 1rem;
  border-left: 3px solid var(--rule);
  color: var(--muted);
}
.muted, .meta { color: var(--muted); }
.meta { font-size: 0.9375rem; margin-top: -0.5rem; margin-bottom: 2rem; }
.tag {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0 0.35rem;
}

/* Code */
code, pre, kbd { font-family: var(--mono); font-size: 0.875em; }
:not(pre) > code { background: var(--surface); padding: 0.1em 0.3em; border-radius: 3px; }
pre {
  background: var(--surface);
  padding: 0.9rem 1rem;
  border-radius: 4px;
  overflow-x: auto;
  line-height: 1.5;
  tab-size: 4;
}
.hl .k, .hl .kd, .hl .kn, .hl .kc, .hl .kr, .hl .kt, .hl .nt, .hl .ow { color: var(--code-key); }
.hl .s, .hl .s1, .hl .s2, .hl .sb, .hl .sd, .hl .se, .hl .si, .hl .sa, .hl .na { color: var(--code-str); }
.hl .m, .hl .mi, .hl .mf, .hl .mh, .hl .nb, .hl .bp { color: var(--code-num); }
.hl .c, .hl .c1, .hl .cm, .hl .ch, .hl .cp { color: var(--muted); font-style: italic; }

/* Tables */
.table, table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
th, td {
  text-align: left;
  padding: 0.35rem 1rem 0.35rem 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
  font-variant-numeric: tabular-nums;
}
th { font-size: 0.875rem; color: var(--muted); font-weight: 400; }
td.right, th.right { text-align: right; }
td.center, th.center { text-align: center; }
/* Opt-in: wrap a table in <div class="nowrap-first" markdown="1"> ... </div>
   to keep its first column on one line (dates, ranges, short labels). */
.nowrap-first th:first-child, .nowrap-first td:first-child { white-space: nowrap; }

/* Footnotes */
.footnote { font-size: 0.9375rem; color: var(--muted); }
.footnote hr { margin: 2.5rem 0 1rem; }

/* Post lists: date in the first column; title, then tags, in the second */
.posts { list-style: none; padding: 0; }
.posts > li { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0 1rem; margin-bottom: 0.6rem; }
.posts time { color: var(--muted); font-variant-numeric: tabular-nums; }
.posts .tags { grid-column: 2; margin: 0; }

/* Tags: a post's tags, and the list of all tags */
.tags { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0 0.9rem;
        margin: -1.25rem 0 2rem; font-size: 0.875rem; }
.tags li { margin: 0; }
.tags a { color: var(--muted); }
.tags a:hover { color: var(--link); }
.tag-list { list-style: none; padding: 0; columns: 14rem auto; column-gap: 2rem; }
.tag-list li { break-inside: avoid; }
.pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-size: 0.9375rem;
}

/* Contact form */
.contact p { margin-bottom: 1rem; }
.contact label { display: block; margin-bottom: 0.25rem; font-size: 0.9375rem; color: var(--muted); }
.contact input, .contact textarea {
  display: block;
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.5rem 0.6rem;
}
.contact textarea { resize: vertical; }
.contact button {
  font: inherit;
  font-weight: 700;
  color: var(--bg);
  background: var(--text);
  border: 0;
  border-radius: 3px;
  padding: 0.5rem 1.1rem;
  cursor: pointer;
}
.contact button:disabled { opacity: 0.5; cursor: not-allowed; }
.contact .hp { position: absolute; left: -999rem; }
.reason { display: none; }
.reason:target { display: block; }

/* Projects: the label above a project's own post list */
.related { margin: 0 0 0.3rem; font-size: 0.9375rem; color: var(--muted); }
.projects h3 { font-size: 1.125rem; margin-top: 2.25rem; }

/* Home */
.home h1 + p { font-size: 1.1875rem; line-height: 1.5; }

/* Resume: the line under each job title carries dates and employer */
.resume h3 + p { color: var(--muted); font-size: 0.9375rem; margin-bottom: 0.5rem; }
.resume h3 + p + p { margin-bottom: 0.5rem; }

@media (max-width: 30rem) {
  h1 { font-size: 1.65rem; }
  header.site { margin-bottom: 2rem; }
}

/* Paper: the resume prints as a clean black-on-white document */
@media print {
  :root:root:root {
    color-scheme: light;
    --bg: #fff; --surface: #f2f2f2; --text: #000; --muted: #333;
    --rule: #999; --link: #000; --visited: #000;
    --code-key: #000; --code-str: #000; --code-num: #000;
  }
  body { font-size: 10.5pt; line-height: 1.4; }
  .page { max-width: none; padding: 0; }
  header.site nav, footer.site, .skip, .pager, .noprint { display: none; }
  header.site { margin-bottom: 1rem; padding-bottom: 0.5rem; }
  header.site .name { font-size: 18pt; }
  h1 { font-size: 18pt; }
  .resume > h1 { display: none; }
  h2 { font-size: 12pt; margin-top: 1.25rem; break-after: avoid; }
  h3 { font-size: 10.5pt; margin-top: 0.9rem; break-after: avoid; }
  a { text-decoration: none; }
  li, h3 + p { break-inside: avoid; }
}
