@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&display=swap");

:root {
  --space-xs: 0.8rem;
  --space-sm: 1rem;
  --space-md: 1.25rem;
  --space-lg: 1.5625rem;
  --space-xl: 1.953125rem;
  --space-2xl: 2.44140625rem;
  --space-3xl: 3.0517578125rem;
  --space-4xl: 3.814697265625rem;
}

html {
  scroll-behavior: smooth;
}

.site-body {
  background-color: white;
  color: black;
  font-family:
    "JetBrains Mono", "SF Mono", Monaco, "Cascadia Code", "Roboto Mono",
    Consolas, "Courier New", monospace;
  background-image: radial-gradient(circle, #e5e7eb 1px, transparent 1px);
  background-size: 20px 20px;
  background-position: 0 0;
}

.site-container {
  width: 100%;
  max-width: 56rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-sm);
  padding-right: var(--space-sm);
  padding-bottom: var(--space-xl);
  flex: 1;
}

.site-header {
  padding-top: var(--space-sm);
  padding-bottom: var(--space-sm);
}

.site-header hr {
  margin-top: var(--space-xl);
  margin-bottom: var(--space-xl);
  border-top-width: 2px;
  border-color: black;
}

.site-nav {
  max-width: 56rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-sm);
  padding-right: var(--space-sm);
  text-align: center;
  font-size: 1.125rem;
  line-height: 1.5;
}

.nav-menu {
  display: flex;
  gap: var(--space-sm);
  list-style-type: none;
  padding: 0;
  margin: 0;
  justify-content: center;
}

.nav-menu li {
  display: flex;
}

.nav-link {
  color: black;
  text-decoration: none;
}

.nav-link:hover {
  color: #4b5563;
}

.social-links {
  display: flex;
  gap: var(--space-lg);
  margin-top: var(--space-3xl);
  padding-top: var(--space-xl);
  border-top: 1px solid black;
}

.social-link {
  color: black;
}

.social-link:hover {
  color: #4b5563;
}

.main-content,
.note-content {
  color: #374151;
  line-height: 1.75;
}

.main-content a,
.note-content a,
.blog-post-link {
  color: black;
  text-decoration: underline;
}

.main-content a:hover,
.note-content a:hover,
.blog-post-link:hover {
  text-decoration: none;
}

.main-content h1,
.note-content h1 {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.111;
  margin: 0 0 var(--space-xl);
}

.main-content h2,
.note-content h2 {
  font-size: 1.875rem;
  font-weight: 700;
  line-height: 1.333;
  margin: var(--space-xl) 0 var(--space-sm);
}

.main-content h3,
.note-content h3 {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.333;
  margin: var(--space-lg) 0 var(--space-xs);
}

.main-content p,
.note-content p {
  margin: var(--space-md) 0;
}

.main-content ul,
.note-content ul {
  list-style: none;
  margin: var(--space-md) 0;
  padding-left: var(--space-lg);
}

.main-content ul li,
.note-content ul li {
  position: relative;
  margin: var(--space-xs) 0;
}

.main-content ul li::before,
.note-content ul li::before {
  content: "⊙";
  position: absolute;
  left: -1.625em;
  color: #6b7280;
  font-weight: bold;
}

.main-content ol,
.note-content ol {
  margin: 1.25em 0;
  padding-left: 1.625em;
}

.main-content li,
.note-content li {
  margin: 0.5em 0;
}

.main-content blockquote,
.note-content blockquote {
  font-weight: 500;
  font-style: italic;
  color: #374151;
  border-left: 0.25rem solid #d1d5db;
  margin: 1.6em 0;
  padding-left: 1em;
}

.ascii-header {
  text-align: center;
  margin-bottom: 1rem;
  overflow-x: auto;
  width: 100%;
}

.ascii-header pre {
  font-size: 0.8rem;
  line-height: 1.1;
  margin-left: auto;
  margin-right: auto;
  font-family:
    "JetBrains Mono", "SF Mono", Monaco, "Cascadia Code", "Roboto Mono",
    Consolas, "Courier New", monospace;
  white-space: pre;
  overflow-x: visible;
  display: inline-block;
  min-width: max-content;
}

.blog-listing {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.blog-listing p {
  margin: 0;
  padding: 0.5rem 0;
}

.blog-post-date {
  display: inline;
  color: black;
  font-size: 1rem;
  line-height: 1.5;
}

.lists-index {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.notes-feed {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.note-item {
  padding-bottom: 2rem;
}

.note-date {
  color: black;
  text-decoration: none;
}

.note-date:hover {
  color: #4b5563;
}

.note-block,
.warning-block,
.algorithm-block {
  margin: 1.5rem 0;
}

.note-block,
.warning-block {
  padding: 1rem;
  border-top-right-radius: 0.25rem;
  border-bottom-right-radius: 0.25rem;
}

.note-block {
  border-left: 4px solid #2563eb;
  background-color: #eff6ff;
}

.note-title,
.warning-title {
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1.25;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.note-title {
  color: #1d4ed8;
}

.warning-block {
  border-left: 4px solid #d97706;
  background-color: #fffbeb;
}

.warning-title {
  color: #b45309;
}

.algorithm-block {
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
  overflow: hidden;
}

.algorithm-header {
  background-color: #f3f4f6;
  padding: 0.375rem 0.75rem;
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1.25;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #d1d5db;
}

.algorithm-content {
  padding: 0.5rem;
  font-family:
    "JetBrains Mono", "SF Mono", Monaco, "Cascadia Code", "Roboto Mono",
    Consolas, "Courier New", monospace;
  font-size: 0.875rem;
  line-height: 1.25;
}

.algorithm-content ol {
  list-style-type: decimal;
  list-style-position: inside;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  margin: 0;
}

.algorithm-content ol ol {
  margin-left: 1.5rem;
  margin-top: 0.125rem;
}

.figure-block {
  margin: 2rem 0;
  text-align: center;
}

.figure-block img {
  max-width: 100%;
  height: auto;
  border-radius: 0.375rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.figure-caption {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: #6b7280;
  font-style: italic;
}

.highlight {
  border-radius: 0.375rem;
  border: 1px solid #d1d5db;
  margin: 1.5rem 0;
  overflow-x: auto;
  background-color: #fafafa;
}

.highlight .chroma {
  border: none;
  margin: 0;
  background: transparent;
}

.highlight .chroma pre,
.chroma pre {
  font-family:
    "JetBrains Mono", "SF Mono", Monaco, "Cascadia Code", "Roboto Mono",
    Consolas, "Courier New", monospace;
}

.highlight .line,
.chroma .line {
  margin-left: 0.75rem;
}

.highlight .line:first-child,
.chroma .line:first-child {
  margin-top: 0.75rem;
}

.highlight .line:last-child,
.chroma .line:last-child {
  margin-bottom: 0.75rem;
}

.chroma .cl,
.chroma span[style*="display:flex"] {
  display: block;
  min-width: 100%;
  box-sizing: border-box;
  padding: 0.1rem 0;
}

.chroma .lnt,
.chroma .ln {
  margin-right: 1rem;
}

.chroma .hl {
  background-color: rgba(255, 255, 0, 0.1);
  padding: 0.2rem 0;
  margin: 0.1rem 0;
}

code:not(.chroma code) {
  background-color: #f3f4f6;
  color: #2563eb;
  padding-left: 0.375rem;
  padding-right: 0.375rem;
  padding-top: 0.125rem;
  padding-bottom: 0.125rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  line-height: 1.25;
  font-weight: 500;
  border: 1px solid #d1d5db;
  font-family:
    "JetBrains Mono", "SF Mono", Monaco, "Cascadia Code", "Roboto Mono",
    Consolas, "Courier New", monospace;
}

@media (prefers-color-scheme: dark) {
  .site-body {
    background-color: #1c1917;
    color: #fef3c7;
    background-image: radial-gradient(circle, #2a2725 1px, transparent 1px);
    background-size: 20px 20px;
    background-position: 0 0;
  }

  .site-header hr {
    border-color: #fef3c7;
  }

  .nav-link {
    color: #fef3c7;
  }

  .nav-link:hover {
    color: #fde68a;
  }

  .social-links {
    border-color: #fef3c7;
  }

  .social-link {
    color: #fef3c7;
  }

  .social-link:hover {
    color: #fde68a;
  }

  .main-content a,
  .note-content a,
  .blog-post-link {
    color: #fef3c7;
  }

  .main-content a:hover,
  .note-content a:hover,
  .blog-post-link:hover {
    color: #fde68a;
  }

  .blog-post-date {
    color: #fef3c7;
  }

  .main-content,
  .note-content {
    color: #fef3c7;
  }

  .note-date {
    color: #fef3c7;
  }

  .note-date:hover {
    color: #fde68a;
  }

  .note-block {
    border-color: #60a5fa;
    background-color: rgba(30, 58, 138, 0.2);
  }

  .note-title {
    color: #93c5fd;
  }

  .warning-block {
    border-color: #fbbf24;
    background-color: rgba(146, 64, 14, 0.2);
  }

  .warning-title {
    color: #fcd34d;
  }

  .algorithm-block {
    border-color: #374151;
  }

  .algorithm-header {
    background-color: #1f2937;
    border-color: #374151;
    color: #fef3c7;
  }

  code:not(.chroma code) {
    background-color: #292524;
    color: #fcd34d;
    border-color: #57534e;
  }

  .highlight,
  .chroma {
    border-color: #374151;
    background-color: #1f2937 !important;
  }

  .chroma .hl {
    background-color: rgba(255, 255, 255, 0.05);
  }
}

.error-button {
  display: inline-block;
  padding: var(--space-xs) var(--space-md);
  background-color: black;
  color: white;
  text-decoration: none;
  border-radius: 0.25rem;
  font-weight: 500;
  transition: all 0.2s ease;
  border: 2px solid black;
}

.error-button:hover {
  background-color: white;
  color: black;
}

@media (prefers-color-scheme: dark) {
  .error-button {
    background-color: #fef3c7;
    color: #1c1917;
    border-color: #fef3c7;
  }

  .error-button:hover {
    background-color: #1c1917;
    color: #fef3c7;
  }
}

@media (max-width: 768px) {
  .site-body {
    font-family:
      -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
      Arial, sans-serif;
  }

  .ascii-header pre,
  .algorithm-content,
  code,
  .highlight .chroma pre,
  .chroma pre {
    font-family:
      "JetBrains Mono", "SF Mono", Monaco, "Cascadia Code", "Roboto Mono",
      Consolas, "Courier New", monospace;
  }

  .ascii-header {
    display: none;
  }

  .site-container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    max-width: 100%;
    box-sizing: border-box;
  }

  .site-header {
    padding-top: 0.5rem;
  }

  .site-header hr {
    margin-top: 1rem;
    margin-bottom: 1rem;
  }

  .site-nav {
    font-size: 1.25rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .nav-menu {
    gap: 1.25rem;
  }

  .main-content,
  .note-content {
    font-size: 1rem;
    line-height: 1.5;
    padding: 0;
  }

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

  .main-content h1,
  .note-content h1 {
    margin: 0 0 1.5rem;
  }

  .main-content h2,
  .note-content h2 {
    margin: 1.5rem 0 0.75rem;
  }

  .main-content h3,
  .note-content h3 {
    margin: 1.25rem 0 0.5rem;
  }

  .main-content ul,
  .note-content ul,
  .main-content ol,
  .note-content ol {
    margin: 1em 0;
  }

  .main-content li,
  .note-content li {
    margin: 0.25em 0;
  }

  .main-content blockquote,
  .note-content blockquote {
    margin: 1.25em 0;
  }

  .main-content *,
  .note-content * {
    max-width: 100%;
    box-sizing: border-box;
  }

  .blog-listing {
    gap: 0.5rem;
  }

  .blog-listing p {
    padding: 0.25rem 0;
  }

  .notes-feed {
    gap: 1.5rem;
  }

  .note-item {
    padding-bottom: 1.5rem;
  }

  .lists-index {
    gap: 0.75rem;
  }

  .highlight {
    margin-left: -0.75rem;
    margin-right: -0.75rem;
    border-radius: 0;
    border-left: none;
    border-right: none;
    margin-top: 1rem;
    margin-bottom: 1rem;
  }

  .highlight .chroma pre,
  .chroma pre {
    padding: 0;
    font-size: 0.85rem;
    line-height: 1.6;
    overflow-x: auto;
  }

  .highlight .line,
  .chroma .line {
    margin: 0 1rem;
    white-space: pre;
  }

  .highlight .line:first-child,
  .chroma .line:first-child {
    margin-top: 0.75rem;
  }

  .highlight .line:last-child,
  .chroma .line:last-child {
    margin-bottom: 0.75rem;
  }

  .algorithm-header {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
  }

  .algorithm-content {
    padding: 0.375rem;
    font-size: 0.8rem;
  }

  .note-block,
  .warning-block,
  .algorithm-block {
    margin: 1rem 0;
  }

  .note-block,
  .warning-block {
    padding: 0.75rem;
    margin-left: -0.75rem;
    margin-right: -0.75rem;
    border-radius: 0;
  }

  .figure-block {
    margin: 1.5rem 0;
  }

  .figure-block img {
    max-width: calc(100vw - 1.5rem);
    height: auto;
  }

  .social-links {
    margin-top: 2rem;
    padding-top: 1.5rem;
  }

  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}
