@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("./newsreader.woff2") format("woff2");
}

@font-face {
  font-family: "Newsreader Fallback";
  src: local("Times New Roman");
  ascent-override: 69.68%;
  descent-override: 25.12%;
  line-gap-override: 0%;
  size-adjust: 105.48%;
}

:root {
  color-scheme: light dark;
  --background: #fafafa;
  --foreground: #171717;
  --muted: #858585;
  --note-background: rgb(0 0 0 / 5%);
  --note-text: rgb(23 23 23 / 65%);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--background);
  overscroll-behavior-y: none;
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: "Newsreader", "Newsreader Fallback", serif;
  font-optical-sizing: auto;
  font-size: 16px;
  line-height: 1.45;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

main {
  width: min(100%, 36rem);
  margin: 0 auto;
  padding: 3rem 1rem;
}

.identity {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 0.75rem;
  row-gap: 0.6rem;
}

h1,
.site-name {
  flex: none;
  margin: 0;
  color: var(--foreground);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.015em;
}

.site-name {
  text-decoration-color: transparent;
}

nav {
  display: flex;
  flex: 1 0 auto;
  flex-wrap: nowrap;
  gap: 0.45rem;
  min-width: max-content;
  overflow-x: visible;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

nav::-webkit-scrollbar {
  display: none;
}

a {
  color: var(--muted);
  text-decoration-color: currentColor;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  transition: color 140ms ease, text-decoration-color 140ms ease;
}

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

a.no-default-underline {
  text-decoration-color: transparent;
}

a.no-default-underline:hover {
  text-decoration-color: currentColor;
}

a:focus-visible {
  color: var(--foreground);
  border-radius: 2px;
  outline: 2px solid var(--foreground);
  outline-offset: 3px;
}

nav a {
  flex: none;
  font-size: 0.88rem;
}

nav a:first-child {
  margin-left: auto;
}

.about {
  margin-top: 2.5rem;
}

.writings {
  margin-top: 2rem;
}

.article {
  margin-top: 3rem;
}

.section-title {
  margin: 0 0 0.75rem;
  color: var(--foreground);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.article h1 {
  margin-bottom: 1rem;
}

ul {
  display: grid;
  gap: 0.42rem;
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 0.98rem;
  list-style: none;
}

li {
  display: grid;
  grid-template-columns: 0.8rem minmax(0, 1fr);
}

li::before {
  content: "•";
}

.writing-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.writing-list li::before {
  content: none;
}

.writing-date {
  flex: none;
  font-size: 0.88rem;
  white-space: nowrap;
}

.book-list li {
  display: block;
}

.book-list li::before {
  content: none;
}

.book-list {
  gap: 0.35rem;
}

.book-title {
  margin: 0;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 400;
  line-height: 1.45;
}

.book-notes {
  width: 100%;
  margin: 0.18rem 0 0.25rem;
  padding: 0.5rem 0.7rem;
  background: var(--note-background);
  color: var(--note-text);
  font-family: inherit;
  font-size: 0.98rem;
  line-height: 1.45;
}

.book-notes p {
  margin: 0;
}

.book-notes p + p {
  margin-top: 0.35rem;
}

@media (max-width: 22rem) {
  nav {
    flex-basis: 100%;
  }

  nav a:first-child {
    margin-left: 0;
  }
}

@media (min-width: 40rem) {
  main {
    padding-top: 4rem;
    padding-right: 1.5rem;
    padding-bottom: 4rem;
    padding-left: 1.5rem;
  }

  .identity {
    column-gap: 1.5rem;
  }

  nav {
    gap: 0.6rem;
    overflow-x: visible;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #0a0a0a;
    --foreground: #ededed;
    --muted: #b8b8b8;
    --note-background: rgb(255 255 255 / 7%);
    --note-text: rgb(255 255 255 / 66%);
  }
}

@media (prefers-reduced-motion: reduce) {
  a {
    transition: none;
  }
}
