:root {
  color-scheme: dark;
  --notes-bg: #050609;
  --notes-text: #eef2f8;
  --notes-muted: #a5afbe;
  --notes-line: rgb(255 255 255 / 8.5%);
  --notes-link: #90baff;
  --notes-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --notes-page-padding: clamp(1rem, 3vw, 2.5rem);
  background: var(--notes-bg);
  color: var(--notes-text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--notes-link); text-underline-offset: .2em; }
a:hover { color: white; }
:focus-visible { outline: 2px solid var(--notes-link); outline-offset: 3px; }
::selection { background: rgb(37 99 235 / 40%); color: white; }

.notes-header {
  position: sticky;
  inset-block-start: 0;
  z-index: 1;
  border-bottom: 1px solid var(--notes-line);
  background: rgb(5 6 9 / 85%);
  backdrop-filter: blur(12px);
  font-family: var(--notes-mono);
}

.notes-header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  max-width: 1480px;
  min-height: 4rem;
  margin-inline: auto;
  padding-inline: var(--notes-page-padding);
}

.notes-header a { text-decoration: none; }
.notes-brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: .625rem;
  color: white;
  font-size: .875rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.025em;
  white-space: nowrap;
}
.notes-brand:hover { opacity: .9; }
.notes-brand img { flex: none; border-radius: .375rem; object-fit: cover; box-shadow: 0 0 0 1px rgb(255 255 255 / 10%); }
.notes-brand small {
  display: block;
  color: rgb(255 255 255 / 45%);
  font-size: .625rem;
  font-weight: 400;
  letter-spacing: .16em;
}

.notes-nav { display: flex; align-items: center; gap: 1.75rem; font-size: .75rem; }
.notes-nav a { color: rgb(255 255 255 / 60%); }
.notes-nav a:hover { color: white; }

.notes-vault {
  --corner: linear-gradient(rgb(255 255 255 / 65%), rgb(255 255 255 / 65%));
  position: relative;
  justify-self: end;
  padding: .5rem .875rem;
  border: 1px solid rgb(255 255 255 / 9%);
  background: rgb(12 15 23 / 72%);
  color: white;
  font-size: .75rem;
  white-space: nowrap;
}
.notes-vault::before {
  position: absolute;
  inset: -1px;
  pointer-events: none;
  content: "";
  background:
    var(--corner) top left / 10px 1px,
    var(--corner) top left / 1px 10px,
    var(--corner) top right / 10px 1px,
    var(--corner) top right / 1px 10px,
    var(--corner) bottom left / 10px 1px,
    var(--corner) bottom left / 1px 10px,
    var(--corner) bottom right / 10px 1px,
    var(--corner) bottom right / 1px 10px;
  background-repeat: no-repeat;
}
.notes-vault:hover { border-color: rgb(255 255 255 / 22%); background: rgb(20 25 38 / 85%); }

.notes-main {
  max-width: calc(70ch + 2 * var(--notes-page-padding));
  margin-inline: auto;
  padding: clamp(2rem, 5vw, 4.5rem) var(--notes-page-padding) 5rem;
  font-size: 1.0625rem;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.notes-main h1 {
  margin: 0 0 1.5rem;
  color: white;
  font-family: "Doto", var(--notes-mono);
  font-optical-sizing: auto;
  font-variation-settings: "ROND" 0;
  font-size: clamp(2.5rem, 4.4vw, 3.625rem);
  font-weight: 600;
  line-height: 1.03;
  letter-spacing: -.02em;
}
.notes-main h2, .notes-main h3 { color: white; line-height: 1.3; }
.notes-main h2 { margin: 2.5rem 0 .75rem; font-size: 1.5rem; }
.notes-main h3 { margin: 1.75rem 0 .5rem; font-size: 1.125rem; }
.notes-main p { margin: 0 0 1.15em; }
.notes-main code, .notes-main time { font-family: var(--notes-mono); }
.notes-main img { max-width: 100%; height: auto; }
.notes-main pre {
  overflow: auto;
  padding: .75rem;
  background: #0a0c12;
  border: 1px solid var(--notes-line);
}
.notes-main blockquote {
  margin: 1.5rem 0;
  padding: .3rem 0 .3rem 1rem;
  border-inline-start: 2px solid var(--notes-link);
  color: var(--notes-muted);
}
.notes-main blockquote > :last-child { margin-bottom: 0; }
.notes-meta, .notes-list time {
  color: var(--notes-muted);
  font: .75rem/1.5 var(--notes-mono);
}
.notes-meta { display: flex; flex-wrap: wrap; gap: .5rem 1rem; }

.notes-table {
  max-width: 100%;
  overflow-x: auto;
  margin: 1rem 0 1.5rem;
  scroll-margin-block-start: 7rem;
  border: 1px solid var(--notes-line);
}
.notes-table table {
  width: 100%;
  min-width: 40rem;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: .875rem;
}
.notes-table th:first-child { width: 25%; }
.notes-table th, .notes-table td {
  padding: .75rem;
  border-right: 1px solid var(--notes-line);
  border-bottom: 1px solid var(--notes-line);
  text-align: left;
  vertical-align: top;
}
.notes-table th { background: #10141f; color: white; }
.notes-table tr > :last-child { border-right: 0; }
.notes-table tbody tr:last-child td { border-bottom: 0; }

.notes-list { margin: 2rem 0 0; padding: 0; list-style: none; }
.notes-list li { padding-block: 1.25rem; border-block-start: 1px solid var(--notes-line); }
.notes-list li:last-child { border-block-end: 1px solid var(--notes-line); }
.notes-list h2 { margin: .45rem 0 .5rem; }
.notes-list p { margin: 0; color: var(--notes-muted); }

@media (max-width: 767px) {
  .notes-header-inner { grid-template-columns: 1fr auto; }
  .notes-brand { min-height: 4rem; font-size: .75rem; }
  .notes-brand small { font-size: .5625rem; }
  .notes-nav {
    grid-row: 2;
    grid-column: 1 / -1;
    flex-wrap: wrap;
    gap: 0 clamp(.625rem, 4vw, 1.75rem);
    border-top: 1px solid var(--notes-line);
  }
  .notes-nav a { padding-block: .625rem; }
  .notes-main { font-size: 1rem; }
}
