@font-face {
  font-family: "Valkyrie B";
  font-style: normal;
  font-weight: normal;
  font-display: swap;
  src: url("fonts/valkyrie_b_regular.woff2") format("woff2");
}

@font-face {
  font-family: "Valkyrie B";
  font-style: italic;
  font-weight: normal;
  font-display: swap;
  src: url("fonts/valkyrie_b_italic.woff2") format("woff2");
}

@font-face {
  font-family: "Valkyrie B";
  font-style: normal;
  font-weight: bold;
  font-display: swap;
  src: url("fonts/valkyrie_b_bold.woff2") format("woff2");
}

@font-face {
  font-family: "Valkyrie B";
  font-style: italic;
  font-weight: bold;
  font-display: swap;
  src: url("fonts/valkyrie_b_bold_italic.woff2") format("woff2");
}

:root {
  --text: #e4e4e0;
  --muted: #9a9a94;
  --bg: #191917;
  --accent: #7cb3f0;
  --rule: #33332f;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --text: #1a1a1a;
  --muted: #6b6b6b;
  --bg: #fdfdfa;
  --accent: #1a5fb4;
  --rule: #e2e2dc;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 4rem 1.25rem 6rem;
  background: var(--bg);
  color: var(--text);
  font-family: "Valkyrie B", Georgia, "Times New Roman", serif;
  font-size: 1.125rem;
  line-height: 1.65;
}

main {
  max-width: 40rem;
  margin: 0 auto;
}

/* Light / dark toggle */
.theme-toggle {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  width: 0.75rem;
  height: 0.75rem;
  padding: 0;
  border: 1px solid var(--muted);
  border-radius: 50%;
  background: linear-gradient(90deg, var(--muted) 50%, transparent 50%);
  cursor: pointer;
  opacity: 0.45;
  transition: opacity 0.2s;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  opacity: 1;
  outline: none;
}

h1 {
  font-size: 1.75rem;
  line-height: 1.25;
  margin: 0 0 0.5rem;
}

h2 {
  font-size: 1.25rem;
  margin: 2.5rem 0 0.75rem;
}

a {
  color: var(--accent);
}

a:hover {
  text-decoration: none;
}

.byline {
  color: var(--muted);
  font-size: 0.9375rem;
  margin: 0 0 2.5rem;
}

/* Essay list on the homepage */
#essays h2 {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  font-weight: normal;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

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

.essays li {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.35rem 0;
}

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

.essays a:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.essays .date {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Essay pages */
.home-link {
  display: inline-block;
  color: var(--muted);
  font-size: 0.8125rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  margin-bottom: 3rem;
}

.home-link:hover {
  color: var(--text);
}

.essay-header {
  margin-bottom: 1.5rem;
}

.essay-header h1 {
  font-size: 2rem;
  font-weight: normal;
  letter-spacing: -0.01em;
  margin-bottom: 0.35rem;
}

.essay-header .byline {
  margin: 0;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.essay-header .byline a {
  color: var(--text);
  text-decoration: none;
}

.essay-header .byline a:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.essay-header .sep {
  margin: 0 0.35rem;
}

article p {
  margin: 0 0 1.25rem;
}

article h2 {
  font-size: 1.25rem;
  font-weight: bold;
  margin: 2.75rem 0 0.75rem;
}

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

blockquote p {
  margin: 0 0 0.5rem;
}

blockquote footer {
  max-width: none;
  margin: 0;
  font-size: 0.875rem;
  font-style: normal;
}

article a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 0.2em;
}

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

.fn-ref {
  font-size: 0.7em;
  line-height: 0;
  margin-left: 0.1em;
}

.fn-ref a {
  text-decoration: none;
  color: var(--accent);
}

.footnotes {
  color: var(--muted);
  font-size: 0.875rem;
}

.footnotes ol {
  padding-left: 1.25rem;
  margin: 0;
}

.footnotes li {
  margin-bottom: 0.75rem;
}

.footnotes li:target {
  color: var(--text);
}

.fn-back {
  text-decoration: none;
  margin-left: 0.25rem;
}

hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 3rem auto;
  width: 40%;
}

footer {
  max-width: 40rem;
  margin: 4rem auto 0;
  color: var(--muted);
  font-size: 0.875rem;
}
