@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/IBMPlexMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: fallback;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/IBMPlexMono-SemiBold.woff2") format("woff2");
  font-weight: 700;
  font-display: fallback;
}

:root {
  --color-gray: #7c7c7a;
  --color-gray-medium: #e1e1e0;
  --color-gray-light: #f9f7f4;
  --color-black-light: #1f1f1f;
  --color-red: #e77728;
  --color-white: #fff;
  --color-white-light: #cccccc;
}

:root {
  --theme-bg: var(--color-gray-light);
  --theme-text: var(--color-black-light);
  --theme-sub-text: var(--color-gray);
  --theme-link: var(--color-red);
  --theme-link-hover: var(--color-white);
  --theme-code-block: var(--color-gray-medium);

  color-scheme: light dark;
  color: var(--theme-text);
  font-family: "IBM Plex Mono", monospace;
  line-height: 1.7;
  hyphens: auto;
}

* {
  box-sizing: border-box;
  margin: 0;
}

@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.1s;
  animation-timing-function: ease;
}

body {
  background: var(--theme-bg);
  font-size: 13px;
  max-width: 60em;
  padding: 7em;
}

@media only screen and (max-width: 480px) {
  body {
    max-width: 100%;
    padding: 1em;
    font-size: 14px;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --theme-bg: var(--color-black-light);
    --theme-text: var(--color-white-light);
    --theme-code-block: var(--color-gray);
  }
}

main {
  margin: 3em 0;
}

p,
span {
  font-size: 1em;
  color: var(--theme-text);
}

small {
  font-size: 0.833rem;
}

a {
  color: var(--theme-link);
  font-weight: 400;
}

a:hover {
  background-color: var(--color-red);
  color: var(--theme-link-hover);
  text-decoration: none !important;
}

hr {
  background-color: var(--theme-sub-text);
  border-color: transparent;
  border-bottom: none;
}

header h1 {
  font-size: 1em;
}

header a {
  color: var(--theme-sub-text);
  text-decoration: none;
}

header a:hover {
  background: none;
  color: var(--theme-sub-text);
}

.intro {
  margin-bottom: 3em;
}

.intro p {
  margin-bottom: 1em;
}

.notes-list h2 {
  margin-bottom: 0.5em;
  color: var(--theme-sub-text);
  font-size: 1em;
  font-weight: 400;
}

.note-preview {
  display: flex;
  justify-content: space-between;
}

.note-preview:not(:first-of-type) {
  margin-top: 0.5em;
}

.note-preview h3 {
  margin: 0 1em 0 0;
  min-width: 0;
  display: flex;
  font-size: 1em;
  font-weight: 400;
}

.note-preview h3 a {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-preview span {
  color: var(--theme-sub-text);
  white-space: nowrap;
}

.note-header {
  margin: 0 0 2em 0;
}

.note-header h2 {
  margin: 1em 0 0.5em;
  font-size: 1.1em;
}

.note-header span {
  color: var(--theme-sub-text);
}

.note-content p,
.note-content h2,
.note-content h3 {
  margin: 1em 0;
}

.note-content h2 {
  font-size: 1.3em;
}

.note-content h3 {
  font-size: 1.1em;
}

.note-content img {
  width: 100%;
  height: auto;
}

.note-content figure > figcaption {
  color: var(--theme-sub-text);
  font-size: 0.9em;
  line-height: 1.4;
}

.note-content blockquote {
  display: flex;
  flex-direction: column;
  padding-left: 1em;
  background: transparent;
  border-left: 4px solid var(--theme-code-block);
}

.note-content code {
  padding: 0.2rem 0.33rem;
  margin: -0.2rem -0.125em;
  border-radius: 3px;
  background-color: var(--theme-code-block);
  color: inherit;
  font-size: 0.85em;
  word-break: break-word;
}

.note-content pre {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 1rem 2rem;
  background: var(--theme-code-block);
}

@media (min-width: 37.75em) {
  .note-content pre {
    padding: 1rem 1.25rem;
    border-radius: 8px;
  }
}

.note-content pre code {
  padding: 0;
  margin: 0;
  background: transparent;
}

footer {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.3em;
  margin-top: 3em;
  padding-top: 1em;
}

footer::before {
  content: "";
  position: absolute;
  top: 0;
  width: 25%;
  border-top: 1px solid var(--theme-sub-text);
}

footer span {
  color: var(--theme-sub-text);
}

.footer-updated {
  opacity: 0.7;
  font-size: 0.9em;
}
