@font-face {
  font-family: "IBM Plex Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/font/IBMPlexSerif-Regular.ttf") format("truetype");
}

@font-face {
  font-family: "IBM Plex Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/font/IBMPlexSerif-Italic.ttf") format("truetype");
}

@font-face {
  font-family: "IBM Plex Serif";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/font/IBMPlexSerif-Medium.ttf") format("truetype");
}

@font-face {
  font-family: "IBM Plex Serif";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/font/IBMPlexSerif-Bold.ttf") format("truetype");
}

@font-face {
  font-family: "Gabarito";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/font/Gabarito-Regular.ttf") format("truetype");
}

@font-face {
  font-family: "Gabarito";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/font/Gabarito-Medium.ttf") format("truetype");
}

@font-face {
  font-family: "Gabarito";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/font/Gabarito-Bold.ttf") format("truetype");
}

:root,
[data-theme="light"] {
  color-scheme: light;
  --background-color: #fafafa;
  --foreground-color: #0c0c0c;
  --faded-color: #4b4b4b;
  --secondary-color: #8e8e8e;
  --selection-color: #d9d9d9;
  --font-family-main: "IBM Plex Serif", Georgia, serif;
  --font-family-head: "Gabarito", Arial, sans-serif;
  --page-width: 45.6rem;
}

[data-theme="dark"] {
  color-scheme: dark;
  --background-color: #0c0c0c;
  --foreground-color: #fafafa;
  --faded-color: #d6d6d6;
  --secondary-color: #919191;
  --selection-color: #3a3a3a;
}

[data-theme="solarized"] {
  color-scheme: light;
  --background-color: #fdf6e3;
  --foreground-color: #073642;
  --faded-color: #586e75;
  --secondary-color: #839496;
  --selection-color: #eee8d5;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 18rem;
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--background-color);
  color: var(--foreground-color);
  font-family: var(--font-family-main);
  font-weight: 400;
  transition: background-color 160ms ease, color 160ms ease;
}

.intro-screen {
  position: fixed;
  z-index: 9999;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: var(--background-color);
  color: var(--foreground-color);
  opacity: 0;
  pointer-events: none;
  text-align: center;
  visibility: hidden;
}

.intro-screen__text {
  font-size: 3rem;
  font-weight: 500;
  line-height: 1.33;
  opacity: 0;
}

.intro-screen--initial {
  animation: intro-screen-load 1.8s both;
}

.intro-screen--initial .intro-screen__text {
  animation: intro-text-load 1.8s both;
}

.skip-intro-once .intro-screen--initial {
  display: none;
}

.force-intro-once .intro-screen {
  animation: intro-screen-load 1.8s both;
}

.force-intro-once .intro-screen__text {
  animation: intro-text-load 1.8s both;
}

@keyframes intro-screen-load {
  0%,
  82% {
    opacity: 1;
    visibility: visible;
  }

  100% {
    opacity: 0;
    visibility: hidden;
  }
}

@keyframes intro-text-load {
  0%,
  12% {
    opacity: 0;
  }

  38%,
  68% {
    opacity: 1;
  }

  86%,
  100% {
    opacity: 0;
  }
}

::selection {
  background: var(--selection-color);
}

a {
  color: inherit;
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.12em;
}

a:hover {
  color: var(--faded-color);
}

a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 0.25rem;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.divider {
  width: 100%;
  height: 1px;
  background: var(--foreground-color);
}

.site-shell {
  width: min(var(--page-width), calc(100% - 2rem));
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.site-header {
  padding-top: 0.75rem;
  background: var(--background-color);
  z-index: 10;
}

.page--reader .site-header,
.page--post .site-header {
  position: sticky;
  top: 0;
}

.site-header__row {
  height: 6rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
}

.site-header__title {
  grid-column: 2;
  font-size: 1.5rem;
  font-weight: 400;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}

.site-header__back {
  justify-self: start;
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  text-decoration: none;
}

.site-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.toc-page {
  width: 100%;
  padding: 4rem 0 7rem;
}

.toc-page--home {
  margin: auto 0;
  padding-top: 8rem;
}

.toc-page__title {
  margin: 2rem 0 6.625rem;
  font-family: var(--font-family-head);
  font-size: 3rem;
  font-weight: 400;
  line-height: 1.1;
}

.toc-page__sections {
  display: flex;
  flex-direction: column;
  gap: 4rem;
}

.toc-section__heading {
  margin: 0 0 0.5rem;
  padding: 0 0 0.625rem;
  border-bottom: 3px solid var(--foreground-color);
  font-family: var(--font-family-head);
  font-size: 1.625rem;
  font-weight: 400;
  line-height: 1.15;
  text-transform: uppercase;
}

.toc-section__heading a {
  text-decoration: none;
}

.toc-entry {
  padding-top: 1rem;
}

.toc-row {
  display: flex;
  min-width: 0;
  align-items: baseline;
  color: var(--foreground-color);
  font-size: 1.5rem;
  line-height: 1.25;
  text-decoration: none;
}

.toc-row__title {
  min-width: 0;
  overflow-wrap: anywhere;
}

.toc-row__leader {
  min-width: 1.5rem;
  height: 1.5em;
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  overflow: hidden;
  margin: 0 0.5rem;
}

.toc-row__leader-dot {
  width: 0.375em;
  flex: 0 0 0.375em;
  text-align: center;
}

.toc-row--completed {
  color: var(--secondary-color);
}

.toc-row--in-progress .reading-character--read {
  color: var(--secondary-color);
}

.toc-row--in-progress:hover .reading-character--read {
  color: var(--faded-color);
}

.toc-row__page {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
}

.draft-label {
  margin-left: 0.35em;
  color: var(--secondary-color);
  font-family: var(--font-family-head);
  font-size: 0.55em;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.more-link {
  display: block;
  width: fit-content;
  margin: 1.5rem 0 0 auto;
  font-size: 1.05rem;
}

.empty-state {
  margin: 1rem 0 0;
  color: var(--secondary-color);
  font-size: 1.1rem;
  font-style: italic;
}

.empty-state--page {
  margin-top: -2rem;
}

.reader {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.reader__content,
.post__content {
  padding: 3rem 0;
}

.entry-content {
  font-size: 1.5rem;
  line-height: 1.5;
  text-align: justify;
  hyphens: auto;
}

.entry-content p {
  margin: 0;
  text-indent: 2em;
}

.entry-content--continued > p:first-child {
  text-indent: 0;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
  margin: 2.5em 0 1em;
  font-family: var(--font-family-head);
  text-align: left;
}

.entry-content blockquote {
  margin: 2rem 1.5rem;
  padding-left: 1.25rem;
  border-left: 2px solid var(--secondary-color);
  color: var(--faded-color);
}

.entry-content blockquote p,
.entry-content li p {
  text-indent: 0;
}

.entry-content pre {
  max-width: 100%;
  overflow-x: auto;
  padding: 1rem;
  border: 1px solid var(--secondary-color);
  font-size: 0.7em;
  text-align: left;
}

.entry-content code {
  overflow-wrap: anywhere;
}

.scene-break {
  padding: 1.75rem 0;
  text-align: center;
  text-indent: 0;
}

.reader__finish {
  padding: 5rem 0 1.5rem;
  font-family: var(--font-family-head);
  font-size: 1.25rem;
  letter-spacing: 0.25em;
  text-align: center;
}

.entry-meta {
  color: var(--secondary-color);
  font-size: 0.9rem;
  font-style: italic;
  text-align: center;
}

.reader-navigation {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  background: var(--background-color);
}

.page--reader .site-shell {
  min-height: auto;
}

.page--reader .site-main,
.page--reader .reader {
  flex: none;
}

.page--reader .reader-navigation {
  position: static;
  margin-top: 0;
}

.page--reader .site-footer {
  margin-top: 0;
}

.reader-navigation__controls {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.reader-navigation__button {
  display: flex;
  min-height: 5rem;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.reader-navigation__button--disabled {
  color: var(--secondary-color);
}

.reader-navigation__index {
  min-height: 5rem;
  display: flex;
  align-items: center;
  padding: 0 1rem;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  list-style: none;
}

.reader-navigation__index::-webkit-details-marker {
  display: none;
}

.reader-page-picker {
  position: relative;
  justify-self: center;
}

.reader-page-picker[open] .reader-navigation__index,
.reader-navigation__index:hover {
  color: var(--faded-color);
}

.reader-page-picker__menu {
  position: absolute;
  z-index: 20;
  bottom: calc(100% + 0.75rem);
  left: 50%;
  width: min(22rem, calc(100vw - 2rem));
  max-height: min(22rem, 60vh);
  overflow-y: auto;
  padding: 1rem;
  transform: translateX(-50%);
  border: 1px solid var(--foreground-color);
  background: var(--background-color);
  box-shadow: 0 0.75rem 2rem rgb(0 0 0 / 12%);
}

.reader-page-picker__title {
  display: block;
  margin-bottom: 0.75rem;
  font-family: var(--font-family-head);
  font-size: 0.95rem;
  text-align: center;
  text-transform: uppercase;
}

.reader-page-picker__pages {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(2.5rem, 1fr));
  gap: 0.35rem;
}

.reader-page-picker__page {
  min-height: 2.5rem;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
}

.reader-page-picker__page:hover {
  border-color: var(--secondary-color);
}

.reader-page-picker__page--current {
  background: var(--foreground-color);
  color: var(--background-color);
}

.reader-side {
  position: fixed;
  top: 6.75rem;
  bottom: 0;
  z-index: 1;
  width: max(0rem, calc((100vw - var(--page-width)) / 2));
}

.reader-side--previous {
  left: 0;
}

.reader-side--next {
  right: 0;
}

.post {
  padding: 5rem 0 3rem;
}

.post__header {
  padding: 2rem 0 5rem;
}

.post__header h1,
.guest-book h1 {
  margin: 0;
  font-family: var(--font-family-head);
  font-size: 3rem;
  font-weight: 500;
  line-height: 1.1;
}

.post__date {
  margin: 1rem 0 0;
  color: var(--secondary-color);
  font-style: italic;
}

.discussion {
  margin: 7rem 0 5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--foreground-color);
}

.discussion__title {
  margin: 0 0 2rem;
  font-family: var(--font-family-head);
  font-size: 1.625rem;
  font-weight: 400;
  text-transform: uppercase;
}

.discussion__preview-note {
  color: var(--secondary-color);
  font-style: italic;
}

.guest-book {
  padding: 8rem 0 4rem;
}

.not-found {
  margin: auto;
  padding: 5rem 1rem;
  text-align: center;
}

.not-found__mark {
  font-size: 5rem;
}

.not-found h1 {
  font-family: var(--font-family-head);
  font-size: 1.5rem;
  font-weight: 400;
}

.site-footer {
  margin-top: auto;
}

.site-footer__navigation {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  justify-content: center;
  padding-top: 2rem;
  text-align: center;
}

.site-footer__copyright {
  padding: 3.75rem 0;
  color: var(--secondary-color);
  font-style: italic;
  text-align: center;
}

.site-footer__copyright p {
  margin: 0 0 0.5rem;
}

::-webkit-scrollbar {
  width: 0.5rem;
}

::-webkit-scrollbar-track {
  background: var(--background-color);
}

::-webkit-scrollbar-thumb {
  background: var(--secondary-color);
}

@media (max-width: 47.6rem) {
  .reader-side {
    display: none;
  }
}

@media (max-width: 42.5rem) {
  .toc-page--home {
    padding-top: 4rem;
  }

  .toc-page__title {
    margin-bottom: 4.5rem;
    font-size: 2.5rem;
  }

  .toc-section__heading {
    font-size: 1.35rem;
  }

  .toc-row {
    font-size: 1.25rem;
  }

  .entry-content {
    font-size: 1.375rem;
  }
}

@media (max-width: 30rem) {
  .site-shell {
    width: min(var(--page-width), calc(100% - 1.5rem));
  }

  .site-header__row {
    height: 5rem;
  }

  .site-header__title {
    max-width: 12rem;
    overflow: hidden;
    font-size: 1.05rem;
    text-overflow: ellipsis;
  }

  .page--home .site-header__title {
    max-width: none;
    font-size: 1rem;
  }

  .site-header__back {
    font-size: 1.5rem;
  }

  .site-header__back-label {
    display: none;
  }

  .toc-page {
    padding-bottom: 5rem;
  }

  .toc-page__title,
  .post__header h1,
  .guest-book h1 {
    font-size: 2.25rem;
  }

  .toc-row {
    font-size: 1.08rem;
  }

  .toc-row__leader {
    margin-inline: 0.35rem;
  }

  .entry-content {
    font-size: 1.125rem;
    line-height: 1.6;
  }

  .entry-content p {
    text-indent: 1.5em;
  }
}

@media (max-width: 31.25rem) {
  .intro-screen__text {
    font-size: 2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .intro-screen--initial,
  .force-intro-once .intro-screen {
    display: none;
  }
}

@media print {
  .site-header,
  .site-footer,
  .reader-navigation,
  .reader-side,
  .discussion {
    display: none !important;
  }

  .site-shell {
    width: 100%;
  }

  .entry-content {
    font-size: 11pt;
  }
}
