@font-face {
  font-family: "DAYROM";
  src: url("DAYROM.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root,
:root[data-theme="light"] {
  color-scheme: light;
  --paper: #eeeeee;
  --surface: rgba(248, 248, 248, 0.68);
  --ink: #171717;
  --muted: #4a4a4a;
  --rule: #bcbcbc;
  --accent: #555555;
  --link: #333333;
  --attractor: #444444;
  --attractor-alpha: 0.9;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --paper: #111111;
    --surface: rgba(22, 22, 22, 0.68);
    --ink: #e8e8e8;
    --muted: #cccccc;
    --rule: #444444;
    --accent: #cccccc;
    --link: #dddddd;
    --attractor: #dddddd;
    --attractor-alpha: 0.9;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #111111;
  --surface: rgba(22, 22, 22, 0.68);
  --ink: #e8e8e8;
  --muted: #cccccc;
  --rule: #444444;
  --accent: #cccccc;
  --link: #dddddd;
  --attractor: #dddddd;
  --attractor-alpha: 0.9;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 6rem;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Georgia, "Iowan Old Style", Palatino, "Palatino Linotype", "Times New Roman", serif;
  font-size: 1.0625rem;
  line-height: 1.65;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem 1.5rem;
  padding: 0.85rem 1.25rem;
  position: sticky;
  top: 0;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  z-index: 20;
}

.site-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--rule);
  color: var(--ink);
  font: inherit;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  min-height: 2.75rem;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
}

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

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.2rem;
  position: static;
  width: auto;
  height: auto;
  background: none;
  border: 0;
  margin: 0;
}

nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}

nav a:hover {
  color: var(--ink);
}

nav a[aria-current="page"] {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--accent);
}

main {
  width: min(46rem, calc(100% - 2rem));
  margin: 2rem auto 3rem;
  padding: 2rem 2rem 2.5rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  box-shadow: 0 1rem 4rem rgba(0, 0, 0, 0.08);
  overflow-wrap: break-word;
}

main.wide {
  width: min(74rem, calc(100% - 2rem));
}

main:focus {
  outline: none;
}

.skip-link {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 30;
  transform: translateY(-200%);
  padding: 0.6rem 1rem;
  background: var(--paper);
  border: 1px solid var(--ink);
}

.skip-link:focus {
  transform: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

h1,
h2,
h3 {
  font-weight: normal;
  line-height: 1.22;
  text-wrap: balance;
  letter-spacing: -0.015em;
}

h1 {
  font-size: clamp(1.6rem, 4.6vw, 2.35rem);
  margin: 0 0 0.7rem;
}

h2 {
  font-size: 1.12rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.35rem;
  margin: 1.75rem 0 0.75rem;
}

h3 {
  font-size: 1.22rem;
  margin: 1.85rem 0 0.55rem;
}

p {
  margin: 0 0 1em;
}

ul,
ol {
  padding-left: 1.2rem;
}

li {
  margin-bottom: 0.35em;
}

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

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

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

.note {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 1.35rem;
}

blockquote {
  margin: 0 0 1.15rem;
  padding: 0 0 0 0.9rem;
  border-left: 2px solid var(--accent);
}

blockquote p {
  margin: 0 0 0.2rem;
  font-style: italic;
}

blockquote footer {
  color: var(--muted);
  font-size: 0.9rem;
  font-style: normal;
}

.lede {
  display: grid;
  grid-template-columns: 7.2rem minmax(0, 1fr);
  gap: 1.25rem 1.75rem;
  align-items: start;
  margin-bottom: 2rem;
}

.angel {
  width: 100%;
  height: auto;
  display: block;
  filter: invert(1);
  mix-blend-mode: multiply;
}

:root[data-theme="dark"] .angel {
  filter: none;
  mix-blend-mode: normal;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .angel {
    filter: none;
    mix-blend-mode: normal;
  }
}

.site-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

body > main {
  position: relative;
  z-index: 1;
}

.interests {
  margin: 0.4rem 0 0;
}

article > header {
  margin-bottom: 1.25rem;
}

article > header p,
article > header em {
  color: var(--muted);
}

.blob-list {
  margin-top: 1.5rem;
}

.blob {
  margin: 0 0 1.1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}

.blob-title {
  display: inline;
  font-size: 1.05rem;
}

.blob-note {
  display: block;
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.pdf-fallback {
  margin-bottom: 1rem;
}

.pdf-frame {
  display: block;
  width: 100%;
  height: min(80vh, 56rem);
  border: 1px solid var(--rule);
  background: #fff;
}

img,
svg,
video,
iframe,
embed,
object {
  max-width: 100%;
}

iframe.pdf-frame,
embed.pdf-frame,
object.pdf-frame {
  max-width: 100%;
}

main mjx-container:not([display="true"]) {
  display: inline-block;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  vertical-align: middle;
  padding: 0.15em 0;
}

mjx-container[display="true"] {
  display: block;
  min-width: 0 !important;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 0.4rem;
}

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

@media (max-width: 640px) {
  html {
    scroll-padding-top: 9rem;
  }

  body {
    font-size: 1rem;
  }

  .site-header {
    padding: 0.75rem 1rem;
  }

  main {
    width: calc(100% - 1.5rem);
    margin: 1rem auto 2rem;
    padding: 1.4rem 1.1rem 2rem;
  }

  main.wide {
    width: calc(100% - 1.5rem);
  }

  .site-controls {
    margin-left: 0;
  }

  .lede {
    grid-template-columns: 1fr;
  }

  .angel {
    width: 6.4rem;
  }
}
