/* The reading pages: about, author, resume and the articles. One typeface, one
   weight and the two colours the home page was showing when the visitor left it
   (see theme.js). */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  --paper: #1e4d3a;
  --ink: #f6d3ae;
  color-scheme: dark light;
}

* { box-sizing: border-box; }

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

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  font: 500 18px/1.55 "Bricolage Grotesque", "Helvetica Neue", Helvetica, Arial, sans-serif;
  letter-spacing: 0.005em;
  overflow-wrap: break-word;
}

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

.top, main, .more {
  width: 100%;
  max-width: calc(35rem + 48px);
  margin: 0 auto;
  padding-right: calc(24px + env(safe-area-inset-right));
  padding-left: calc(24px + env(safe-area-inset-left));
}

/* The triangle in the corner goes back to the home page. */
.top { padding-top: calc(26px + env(safe-area-inset-top)); }

.home {
  display: block;
  width: 44px;
  height: 44px;
  margin-left: -7px;
  border-radius: 10px;
  color: inherit;
}

.home svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 6.8;
  stroke-linecap: round;
}

main {
  flex: 1;
  padding-top: clamp(36px, 9vh, 88px);
  padding-bottom: 80px;
}

h1 {
  margin: 0 0 0.7em;
  font-size: clamp(30px, 6.4vw, 42px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.012em;
  text-wrap: balance;
}

h2 {
  margin: 2.3em 0 0.55em;
  font-size: 23px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.004em;
  text-wrap: balance;
}

p, ul { margin: 0 0 1.05em; }

a {
  color: inherit;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.22em;
  border-radius: 4px;
}

a:hover { text-decoration-thickness: 2.5px; }

a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

.quiet { opacity: 0.8; }

/* The typeface has one weight here, and a synthesized bold is muddy in it. A
   bold phrase in an article opens its paragraph, so its place carries it. */
strong { font-weight: 500; }

code {
  font: 0.86em/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: 0;
}

/* A list of things with a line about each: the articles, the jobs. */
.list {
  padding: 0;
  list-style: none;
}

.list li { margin: 0 0 1.15em; }

.list p {
  margin: 0.2em 0 0;
  opacity: 0.8;
}

.prose ul { padding-left: 1.2em; }
.prose li { margin: 0 0 0.45em; }

/* The foot of the page reads like the home page's: a short line of links. */
.more {
  padding-top: 20px;
  padding-bottom: calc(26px + env(safe-area-inset-bottom));
  letter-spacing: 0.01em;
}

.more a[aria-current] { text-decoration: none; }

@media (max-width: 420px) {
  body { font-size: 17px; }
  h2 { font-size: 21px; }
}

@media print {
  html { background: none; color: #000; }
  .top, .more { display: none; }
}
