/* Match the site's JetBrains Mono navigation and Libre Baskerville essays.
   Font files are the same Latin subsets used by next/font in the main site. */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/jetbrains-mono-latin.woff2') format('woff2');
}

@font-face {
  font-family: 'Libre Baskerville';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/libre-baskerville-latin.woff2') format('woff2');
}

:root {
  --serif: 'Libre Baskerville', Georgia, serif;
  --sans: 'JetBrains Mono', monospace;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font: 1.1rem/1.85 var(--serif);
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

a {
  color: var(--link);
  text-decoration-color: var(--border);
  text-underline-offset: 3px;
}

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

main {
  max-width: 672px;
  margin: 0 auto;
  padding: 64px 24px;
}

.wide-writing main {
  max-width: 1240px;
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 16px;
  max-width: 624px;
  margin: 0 auto;
  padding: 0;
  font: 15px/1.7 var(--sans);
}

.masthead a {
  color: var(--text-muted);
  text-decoration: none;
}

.masthead .site-name {
  color: var(--text);
  font-size: 20px;
  font-weight: 500;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  gap: 16px;
}

.site-nav a:hover,
.site-nav a[aria-current='page'] {
  color: var(--text);
}

.masthead .site-name:hover {
  color: var(--accent);
}

article > header,
main > header,
.article-header {
  max-width: 624px;
  margin: 0 auto 32px;
  padding: 64px 0 0;
}

h1,
.article-header h1 {
  margin: 0 0 16px;
  color: var(--text);
  font: 700 24px/1.35 var(--serif);
  letter-spacing: normal;
  text-wrap: pretty;
}

h2,
h3 {
  color: var(--text);
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.45;
}

h2 {
  font-size: 22px;
}

h3 {
  font-size: 20px;
}

p {
  margin-bottom: 1.5em;
}

.byline,
.notes,
footer {
  font-family: var(--sans);
}

.byline {
  color: var(--text-muted);
  font-size: 13px;
}

.prose {
  max-width: 624px;
}

.article-copy {
  font: 1.1rem/1.85 var(--serif);
}

.article-copy p + p {
  margin-top: 0;
}

button,
input {
  color: var(--text);
}

button,
.count,
.figure-label,
.caption {
  font-family: var(--sans);
}

.controls {
  flex-wrap: wrap;
}

footer {
  margin-top: 48px;
  padding-top: 24px;
  border-color: var(--border);
  font-size: 14px;
}

@media (max-width: 767px) {
  main,
  .wide-writing main {
    padding: 48px 24px;
  }
}

@media (max-width: 360px) {
  .masthead .site-name {
    font-size: 18px;
  }

  .site-nav {
    gap: 12px;
    font-size: 12px;
  }
}

@media print {
  .dark-warm {
    color-scheme: light;
    --bg: white;
    --bg-surface: #f3f3f3;
    --text: black;
    --text-muted: #444;
    --border: #ccc;
    --accent: #444;
    --link: #333;
  }

  main,
  .wide-writing main {
    max-width: none;
    padding: 0;
  }

  .masthead {
    display: none;
  }

  article > header,
  main > header,
  .article-header {
    padding-top: 0;
  }
}
