/* System sans-serif, near-black on white, a dark scheme via
   prefers-color-scheme, a 64rem page and a 34em text measure,
   underlined links that dim on hover. */

:root {
  --bg: #fff;
  --fg: #111;
  --fg-dark-gray: #333;
  --fg-muted: #777;
  --surface: #eee;
  --border: #eee;
  --highlight: #fbf1a9;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1a1a;
    --fg: #e8e8e8;
    --fg-dark-gray: #c4c4c4;
    --fg-muted: #8f8f8f;
    --surface: #262626;
    --border: #333;
    --highlight: #574d10;
  }
}

html {
  -webkit-text-size-adjust: 100%;
  line-height: 1.15;
}

body {
  margin: 0;
  -webkit-font-smoothing: antialiased;
  background-color: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Avenir Next", Avenir,
    "Helvetica Neue", Helvetica, Ubuntu, Roboto, Noto, "Segoe UI", Arial,
    sans-serif;
}

.page {
  max-width: 64rem;
  min-height: 100vh;
  margin: 2rem auto;
  padding: 0 1rem;
  overflow: hidden;
}

/* Header and nav */

header h1 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
}

nav ol {
  list-style-type: none;
  padding-left: 0;
  margin: 0.75rem 0 0;
}

nav li {
  display: inline;
  margin-right: 0.5rem;
}

a {
  color: var(--fg);
  text-decoration: none;
  scroll-margin-top: 1rem;
}

a:focus {
  outline: 1px dotted currentColor;
}

a span {
  text-decoration: underline;
}

a:hover span {
  opacity: 0.5;
}

/* In the header only the active page is underlined; the name and the other
   nav entries are plain. */

header h1 a span,
nav a span {
  text-decoration: none;
}

nav a[aria-current="page"] span {
  text-decoration: underline;
}

/* Body copy */

main {
  margin-top: 4rem;
}

h2 {
  font-size: 1rem;
  font-weight: 700;
  margin: 2rem 0 1rem;
}

p,
ul {
  max-width: 34em;
  line-height: 1.5;
  margin: 0 0 1rem;
}

ul {
  padding-left: 1.25rem;
}

li {
  margin-bottom: 0.25rem;
}

.muted {
  color: var(--fg-muted);
}

.small {
  font-size: 0.875rem;
}

code {
  font-family: Consolas, Monaco, monospace;
  font-size: 0.9375em;
}

/* Figures sit flush with the text measure; clicking opens the full-size
   image in an overlay. */

figure {
  max-width: 34em;
  margin: 0 0 1rem;
}

figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  box-sizing: border-box;
}

a.zoom {
  display: block;
  cursor: zoom-in;
}

a.zoom:hover span {
  opacity: 1;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background-color: rgba(0, 0, 0, 0.85);
  cursor: zoom-out;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Contact form */

form {
  max-width: 34em;
}

label {
  display: block;
  line-height: 1.5;
  margin-bottom: 1rem;
}

label > span {
  display: block;
  margin-bottom: 0.25rem;
}

input,
textarea {
  box-sizing: border-box;
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--fg);
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 0.5rem;
  outline: none;
}

input:focus,
textarea:focus {
  border-color: var(--fg-muted);
}

textarea {
  min-height: 10rem;
  resize: vertical;
}

button {
  -webkit-appearance: none;
  appearance: none;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--bg);
  background-color: var(--fg);
  border: 1px solid var(--fg);
  border-radius: 0;
  padding: 0.5rem 1rem;
  cursor: pointer;
}

button:hover {
  opacity: 0.7;
}

button:focus-visible {
  outline: 1px dotted currentColor;
  outline-offset: 2px;
}

.hidden {
  display: none;
}

/* Footer */

footer {
  margin-top: 4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
