/* The blog's look (docs/implementation-plan.md, step 10): the landing page's
black and grey monospace, made readable, with blue links. Headings, the
navigation, dates and code are monospace; the text is the system font. Light or
dark follows the reader's system, with no toggle. Colours are only set here, as
tokens. */

:root {
  color-scheme: light dark;
  --bg: #fafaf8;
  --text: #1c1c1c;
  --muted: #666;
  --line: #ddd;
  --link: #1a5fb4;
  --code-bg: #f0f0ee;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Menlo, Consolas,
    monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000;
    --text: #d4d4d4;
    --muted: #888;
    --line: #333;
    --link: #78aeed;
    --code-bg: #111;
  }
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--text);
}

body {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 1rem;
  font: 1.0625rem/1.65 var(--sans);
  -webkit-text-size-adjust: 100%;
}

/* Navigation and footer: only the page's own, as the CV page has headers of
its own. */

body > header {
  padding: 1.5rem 0 1rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 2rem;
  font-family: var(--mono);
  font-size: .875rem;
}

body > footer {
  margin: 3rem 0 0;
  padding: 1rem 0 2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .8125rem;
}

body > footer p {
  margin: .25rem 0;
}

/* Text */

h1,
h2,
h3,
h4 {
  font-family: var(--mono);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -.01em;
}

h1 {
  font-size: 2rem;
  margin: 0 0 .5rem;
}

h2 {
  font-size: 1.5rem;
  margin: 2.25rem 0 .75rem;
}

h3 {
  font-size: 1.0625rem;
  margin: 1.75rem 0 .5rem;
}

/* Links, the navigation's and the index titles' included: blue, with a firm
underline; on hover, a block of the link's colour with the page's colour on
it, like a terminal selection. */
a {
  color: var(--link);
  text-decoration-thickness: .08em;
  text-decoration-color: color-mix(in srgb, currentColor 50%, transparent);
  text-underline-offset: .2em;
  border-radius: 2px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

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

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

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

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

/* Code: highlight.js colours the blocks (fragments/highlight.html). */

code,
pre {
  font-family: var(--mono);
  font-size: .875em;
}

:not(pre) > code {
  background: var(--code-bg);
  padding: .1em .3em;
  border-radius: 3px;
}

pre {
  overflow-x: auto;
  line-height: 1.5;
}

pre > code.hljs,
pre > code {
  display: block;
  padding: 1rem;
  border-radius: 4px;
  background: var(--code-bg);
}

/* Mermaid draws dark lines and text: on a dark page, a light card. */
pre.mermaid {
  padding: 1rem;
  border-radius: 4px;
  background: #fff;
  text-align: center;
}

/* Tables */

table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: .9375rem;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: .4rem .75rem .4rem 0;
  text-align: left;
  vertical-align: top;
}

th {
  font-family: var(--mono);
  font-weight: 600;
  font-size: .875rem;
}

/* Entries */

.dates {
  margin: 0 0 2rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: .8125rem;
}

.takeaways {
  margin: 0 0 2rem;
  padding: .25rem 1.25rem;
  border-left: 3px solid var(--text);
  background: var(--code-bg);
}

.takeaways h2 {
  margin: .75rem 0 .25rem;
  font-size: .875rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.read-next {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.read-next h2 {
  margin-top: 0;
}

/* The CV's photo on the about page, round, to the right of the text. */
.portrait {
  float: right;
  width: 8rem;
  margin: 0 0 1rem 1.5rem;
  border-radius: 100%;
}

/* The CV's photo, round, to the left of the text. */
.author {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  font-size: .9375rem;
}

.author img {
  flex: none;
  width: 6rem;
  border-radius: 100%;
}

.author p:first-child {
  margin-top: 0;
}
