/* colemacdonald.net
   A personal homepage in the early-web manner, kept well.
   Young Serif (2023, after early-1900s book lettering) for the name and headings,
   Georgia (Matthew Carter, 1996) for reading, the system sans for small print.
   One small web font and no JavaScript, so the page arrives at once. */

@font-face {
  font-family: "Young Serif";
  src: url("/assets/fonts/young-serif-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #ffffff;
  --ink: #1b1b1a;
  --muted: #5f5e5a;
  --line: #d9d8d3;
  --groove-dark: #bdbcb6;
  --groove-light: #e6e5e0;
  --link: #1d4ab8;
  --visited: #6a2f9e;
  --mark: #fff3b0;

  --display: "Young Serif", Georgia, "Noto Serif", serif;
  --serif: Georgia, "Noto Serif", "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --measure: 34em;
  --step: 1.6rem;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #151514;
    --ink: #e9e7e1;
    --muted: #a9a69e;
    --line: #34332f;
    --groove-dark: #050505;
    --groove-light: #2e2d29;
    --link: #8db0ff;
    --visited: #c9a2f2;
    --mark: #4a4224;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--paper);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.6;
  font-kerning: normal;
}

h1, h2, h3, p, ol, ul, dl, dd, figure, blockquote, table { margin: 0; }

::selection { background: var(--mark); color: var(--ink); }

/* Links: blue, purple once visited, always underlined */

a {
  color: var(--link);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: text-decoration-thickness 120ms ease-out;
}
a:visited { color: var(--visited); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 2px; }

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  padding: 8px 12px;
  background: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
}
.skip:focus { top: 12px; }

/* The classic grooved rule */

hr {
  height: 0;
  margin: calc(var(--step) * 1.5) 0;
  border: 0;
  border-top: 1px solid var(--groove-dark);
  border-bottom: 1px solid var(--groove-light);
}

/* One reading column, centred in the window */

.page {
  max-width: calc(var(--measure) + 32px);
  margin: 0 auto;
  padding: clamp(40px, 7vw, 80px) 16px clamp(32px, 5vw, 56px);
}

.masthead {
  display: inline-block;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--muted);
  text-decoration: none;
}
.site-head { margin-bottom: calc(var(--step) * 1.5); }

/* Inner pages: "Home / Writing" at the top, so nobody has to scroll down to get back */
.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin: -10px 0;
  padding: 0;
  list-style: none;
  font-family: var(--sans);
  font-size: 17px;
}
.crumbs li { display: flex; align-items: center; }
.crumbs a { display: inline-flex; align-items: center; min-height: 44px; }
.crumbs span { padding: 0 12px; color: var(--muted); }

/* Home: who, what and how to reach him */

.intro h1 {
  margin-top: 6px;
  font-family: var(--display);
  font-size: clamp(36px, 5.6vw, 46px);
  line-height: 1.1;
  font-weight: 400;
  letter-spacing: -0.015em;
}
.headline { margin-top: 14px; text-wrap: pretty; }
.tagline { margin-top: 10px; font-style: italic; color: var(--muted); text-wrap: pretty; }
.status { margin-top: 10px; text-wrap: pretty; }

.links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 12px;
  margin-top: 14px;
  font-family: var(--sans);
  font-size: 17px;
}
.links a { display: inline-flex; align-items: center; min-height: 44px; }
.links span { color: var(--line); }
@media (prefers-color-scheme: dark) { .links span { color: var(--muted); } }

/* Sections */

section + section { margin-top: calc(var(--step) * 2); }

h2 {
  margin-bottom: 12px;
  font-family: var(--display);
  font-size: 25px;
  line-height: 1.3;
  font-weight: 400;
}

.prose > * + * { margin-top: 1em; }
.prose p, .prose li { text-wrap: pretty; }

.highlights { padding-left: 1.2em; }
.highlights li { text-wrap: pretty; }
.highlights li + li { margin-top: 6px; }
.highlights li::marker { color: var(--muted); }


/* Records: a real table, the honest way to line up years and roles */

.record {
  width: 100%;
  border-collapse: collapse;
  font-size: 19px;
  line-height: 1.5;
}
.record th {
  padding: 0 0 6px;
  text-align: left;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  border-bottom: 1px solid var(--ink);
}
.record td, .record tbody th { padding: 12px 0; vertical-align: top; border-bottom: 1px solid var(--line); }
.record tr > :first-child { width: 9.5em; padding-right: 1em; }
.record strong { font-weight: 700; }
.record .when {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.8;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.record tbody th.when { font-weight: 400; text-align: left; }
.record .date { width: 4.5em; padding-left: 1em; text-align: right; font-family: var(--sans); font-size: 16px; color: var(--muted); white-space: nowrap; }
.archive .when { width: 4.5em; }

.more { margin-top: 12px; font-family: var(--sans); font-size: 17px; }
.more a { display: inline-flex; align-items: center; min-height: 44px; }

/* Blog post */

.post-head h1 {
  font-family: var(--display);
  font-size: clamp(30px, 4.6vw, 40px);
  line-height: 1.18;
  font-weight: 400;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.meta {
  font-family: var(--sans);
  font-size: 16px;
  color: var(--muted);
}
.post-head .meta { margin-top: 12px; }
.post-head + .prose, .post-head + .record, .post-head + p { margin-top: calc(var(--step) * 1.5); }

.prose h2 { margin: 1.8em 0 0.5em; font-size: 25px; }
.prose h3 { margin: 1.6em 0 0.4em; font-size: 20px; }
.prose h2 + *, .prose h3 + * { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 0.35em; }
.prose img { display: block; max-width: 100%; height: auto; }
.prose figcaption { margin-top: 8px; font-family: var(--sans); font-size: 15px; color: var(--muted); }
.prose blockquote { padding-left: 1em; border-left: 3px solid var(--line); color: var(--muted); font-style: italic; }
.prose blockquote > * + * { margin-top: 1em; }
.prose code { font-size: 0.85em; padding: 1px 4px; background: color-mix(in srgb, var(--line) 45%, transparent); border-radius: 3px; }
.prose pre { overflow-x: auto; padding: 14px 16px; background: color-mix(in srgb, var(--line) 35%, transparent); font-size: 15px; line-height: 1.6; }
.prose pre code { padding: 0; background: none; }
.prose hr { margin: 2em 0; }
.table-wrap { overflow-x: auto; }
.prose table { width: 100%; border-collapse: collapse; font-size: 19px; line-height: 1.45; }
.prose th { padding: 0 1em 6px 0; text-align: left; font-family: var(--sans); font-size: 15px; font-weight: 500; color: var(--muted); border-bottom: 1px solid var(--ink); }
.prose td { padding: 10px 1em 10px 0; vertical-align: top; border-bottom: 1px solid var(--line); }
.prose th:last-child, .prose td:last-child { padding-right: 0; }

.signoff { font-style: italic; }
.post-nav { margin-top: var(--step); }
.post-nav p + p { margin-top: 4px; }
.post-nav a { display: inline-flex; align-items: center; min-height: 44px; }
.post-nav .meta { display: inline-block; width: 4em; }

/* Footer */

.site-foot { margin-top: calc(var(--step) * 2.5); }
.site-foot hr { margin-bottom: 16px; }
.site-foot p {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
}
.site-foot a { display: inline-block; padding: 10px 0; margin: -10px 0; }

/* Phones: tables become simple stacked entries */

@media (max-width: 600px) {
  body { font-size: 19px; }
  .record thead { display: none; }
  .record, .record tbody, .record tr, .record td, .record tbody th { display: block; width: auto; }
  .record tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .record td, .record tbody th { padding: 0; border: 0; }
  .record tr > :first-child { width: auto; padding: 0; }
  .record .when:empty { display: none; }
  .record .date { padding-top: 2px; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  a { transition: none; }
}

/* Printing gives a clean CV */

@media print {
  :root { --paper: #fff; --ink: #000; --muted: #444; --link: #000; --visited: #000; }
  body { font-size: 11pt; }
  .page { margin: 0; padding: 0; max-width: none; }
  .skip, .more, .post-nav, .links span { display: none; }
  a { text-decoration: none; }
}
