:root {
  --bg: #ffffff;
  --fg: #111111;
  --muted: #555555;
  --rule: #d8d8d8;
  --accent: #000000;
  --selection-bg: #111111;
  --selection-fg: #ffffff;

  --measure: 68ch;
  --display: "Playfair Display", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --serif: "Source Serif 4", "Charter", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

[data-theme="dark"] {
  --bg: #0b0b0b;
  --fg: #f2f2f2;
  --muted: #a5a5a5;
  --rule: #333333;
  --accent: #ffffff;
  --selection-bg: #f2f2f2;
  --selection-fg: #0b0b0b;
}

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

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

body {
  margin: 0;
  padding: 1.5rem 1.25rem 4rem;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.7;
  max-width: var(--measure);
  margin-inline: auto;
}

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

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 2.5rem 0 0.75rem;
  text-wrap: balance;
}

h1 {
  font-size: 2.75rem;
  margin-top: 0;
}

h2 {
  font-size: 1.625rem;
}

h3 {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

p,
ul,
ol {
  margin: 0 0 1.25rem;
}

a {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  text-decoration-thickness: 1px;
}

a:hover,
a:focus-visible {
  text-decoration-thickness: 2px;
}

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

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

small,
.muted {
  color: var(--muted);
}

/* Masthead */

.masthead {
  margin-bottom: 2.5rem;
  text-align: center;
}

.masthead__utility {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding-bottom: 0.75rem;
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.nameplate {
  display: block;
  margin: 0;
  padding: 0.5rem 0 0.35rem;
  border-top: 3px solid var(--fg);
  border-bottom: 1px solid var(--fg);
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(3rem, 17vw, 8rem);
  line-height: 0.95;
  letter-spacing: -0.035em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--fg);
}

.folio {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 1rem;
  margin: 0;
  padding: 0.4rem 0;
  border-bottom: 3px double var(--fg);
  font-family: var(--sans);
  font-size: 0.6875rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Theme toggle */

.theme-toggle {
  font: inherit;
  font-family: var(--sans);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg);
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
  min-height: 32px;
}

.theme-toggle:hover {
  border-color: var(--accent);
}

/* Lede */

.hero {
  margin-bottom: 2.5rem;
}

.lede {
  font-size: 1.25em;
  line-height: 1.5;
}

.lede::first-letter {
  float: left;
  margin: 0.08em 0.08em 0 0;
  font-family: var(--display);
  font-weight: 900;
  font-size: 3.4em;
  line-height: 0.78;
}

/* Post list */

.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-list li {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--rule);
}

.post-list h2 {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
}

.post-list p {
  margin: 0.35rem 0 0;
}

.post-meta {
  display: block;
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Article */

article > header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
  text-align: center;
}

article h1 {
  margin-bottom: 0.35rem;
}

blockquote {
  margin: 2rem 0;
  padding-left: 1.25rem;
  border-left: 2px solid var(--rule);
  color: var(--muted);
  font-style: italic;
}

/* Figures */

.figure {
  margin: 2.5rem 0;
}

.figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  filter: grayscale(1) contrast(1.05);
}

.figure--portrait img {
  max-height: 62vh;
  width: auto;
  margin: 0 auto;
}

.figure figcaption {
  margin-top: 0.5rem;
  font-family: var(--sans);
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--muted);
}

/* Code */

code,
pre {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

code {
  font-size: 0.875em;
  padding: 0.1em 0.3em;
  border: 1px solid var(--rule);
}

pre {
  margin: 1.75rem 0;
  padding: 1rem;
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--fg);
  font-size: 0.8125rem;
  line-height: 1.5;
}

pre code {
  padding: 0;
  border: 0;
  font-size: inherit;
}

table {
  width: 100%;
  margin: 1.75rem 0;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

th,
td {
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--rule);
  text-align: left;
}

th {
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Footer */

.site-footer {
  margin-top: 3.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--muted);
}

@media (min-width: 40em) {
  body {
    padding: 2.5rem 2rem 5rem;
    font-size: 1.1875rem;
  }

  h1 {
    font-size: 3.5rem;
  }

  h2 {
    font-size: 1.875rem;
  }

  .folio {
    justify-content: space-between;
  }
}

@media (min-width: 64em) {
  body {
    padding-top: 4rem;
  }
}

@media print {
  .masthead__utility,
  .theme-toggle {
    display: none;
  }
}
