/* ===== Fonts ===== */
@font-face {
  font-family: "Literata";
  src: url("/fonts/literata.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "CommitMono";
  src: url("/fonts/commit-mono.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* --color-bg: #efefef; */
  --color-bg: #fdfdfd;
  --color-surface: #ffffff;
  --color-text: #1a1a2e;
  --color-text-muted: #555;
  --color-accent: #8b5cf6;
  --color-accent-hover: #7c3aed;
  --color-border: #e5e7eb;
  --color-code-bg: #f3f4f6;
  --color-tag-bg: #f5f3ff;
  --color-tag-text: #6d28d9;
  --font-sans: Literata, "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Literata", "Georgia", serif;
  --font-mono: "CommitMono", "Monaspace Neon Var", monospace;
  --max-width: 800px;
  --header-height: 64px;
  color-scheme: light;
}

/* ===== Dark Mode ===== */
[data-theme="dark"] {
  --color-bg: #0d0d14;
  --color-surface: #161625;
  --color-text: #e2e8f0;
  --color-text-muted: #94a3b8;
  --color-accent: #a78bfa;
  --color-accent-hover: #c4b5fd;
  --color-border: #252540;
  --color-code-bg: #1a1a2e;
  --color-tag-bg: #2d1b69;
  --color-tag-text: #c4b5fd;
  color-scheme: dark;
}

html {
  font-size: 17px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== Layout ===== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

main.container {
  padding-top: 2.5rem;
  padding-bottom: 4rem;
  min-height: calc(100vh - var(--header-height) - 100px);
}

/* ===== Header ===== */
.site-header {
  height: var(--header-height);
  background: var(--color-surface);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.site-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.site-title:hover {
  color: var(--color-accent);
}

/* ===== Theme Toggle ===== */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.55rem 1rem;
  background: none;
  border: none;
  border-top: 1px solid var(--color-border);
  cursor: pointer;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  font-family: inherit;
  transition: background 0.12s, color 0.12s;
}

.theme-toggle:hover {
  background: var(--color-code-bg);
  color: var(--color-accent);
}

.theme-toggle svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.icon-sun {
  display: none;
}

[data-theme="dark"] .icon-sun {
  display: block;
}

[data-theme="dark"] .icon-moon {
  display: none;
}

[data-theme="dark"] .theme-toggle .theme-toggle-label::after {
  content: " (on)";
}

.theme-toggle-label {
  white-space: nowrap;
}

/* ===== Nav Dropdown ===== */
.nav-dropdown {
  position: relative;
  margin-left: auto;
}

.nav-dropdown-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0.4rem;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: color 0.15s;
}

.nav-dropdown-toggle:hover {
  color: var(--color-text);
  border-color: var(--color-text-muted);
}

.menu-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  display: block;
}

.nav-dropdown-menu {
  display: none;
  flex-direction: column;
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  min-width: 160px;
  padding: 0.4rem 0;
  z-index: 200;
}

.nav-dropdown-menu.open {
  display: flex;
}

.nav-dropdown-menu {
  a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 1rem;
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.12s, color 0.12s;
  }

  .nav-item-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;

    svg {
      width: 1.1rem;
      height: 1.1rem;
      color: inherit;
    }
  }
}

.nav-dropdown-menu a:hover,
.nav-dropdown-menu a.active {
  background: var(--color-code-bg);
  color: var(--color-accent);
  font-weight: bold;
}

/* ===== Hero (Landing Page) ===== */
.hero {
  padding: 3rem 0 2.5rem;
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 2.5rem;
  transition: transform 0.3s ease-in-out;
  text-shadow: 0 15px 5px rgba(0, 0, 0, 0.1), 10px 20px 5px rgba(0, 0, 0, 0.05), -10px 20px 5px rgba(0, 0, 0, 0.05);

  &:hover {
    transform: scale(1.2);
  }
}

.hero-tagline {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  /* max-width: 540px; */

  span:hover {
    font-weight: bold;
    font-size: 110%;
    color: var(--color-accent);
  }
}

/* ===== Section Titles ===== */
.section-title {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
}

/* ===== Post Cards ===== */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.post-card {
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  transition: box-shadow 0.3s ease, border-color 0.3s ease, transform 0.3s ease;

  &:hover {
    border-color: var(--color-accent);
    transform: translateY(-2px);
    box-shadow:
      0 0 8px rgba(139, 92, 246, 0.2),
      0 0 24px rgba(139, 92, 246, 0.15),
      0 0 48px rgba(139, 92, 246, 0.08);
  }

  a {
    text-decoration: none;
    color: inherit;

    &:hover .post-card-title {
      color: var(--color-accent);
    }
  }
}

.post-card-title {
  font-size: 1.8rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin-bottom: 0.35rem;
  transition: color 0.15s;
}

.post-card-meta {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.post-card-tags {
  display: flex;
  gap: 0.4rem;
}

.tag {
  display: inline-block;
  background: var(--color-tag-bg);
  color: var(--color-tag-text);
  padding: 0.1rem 0.5rem;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s;
}

a.tag:hover {
  background: #ede9fe;
}

.post-card-summary {
  color: var(--color-text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

.read-more {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-accent);
  text-decoration: none;
}

.read-more:hover {
  text-decoration: underline;
}

.view-all {
  display: inline-block;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-accent);
  text-decoration: none;
}

.view-all:hover {
  text-decoration: underline;
}

/* ===== Page List (Articles) ===== */
.pages-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
}

.page-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.page-link {
  display: block;
  padding: 1rem 1.25rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.page-link:hover {
  border-color: var(--color-accent);
  box-shadow: 0 1px 4px rgba(139, 92, 246, 0.08);
}

.page-link h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.page-link p {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin: 0;
}

/* ===== Page Header (List Pages) ===== */
.page-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.page-header h1 {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.page-description {
  margin-top: 0.5rem;
  color: var(--color-text-muted);
  font-size: 1rem;
}

/* ===== Post Hero Image ===== */
.post-hero {
  width: 100vw;
  max-height: 500px;
  object-fit: cover;
  margin-left: calc(-50vw + 50%);
  margin-bottom: 2rem;
  border-radius: 0;
}

.section-authors .post-hero {
  object-fit: contain;
  width: 100%;
  margin-left: 0;
}

.post-card-hero-link {
  display: block;
  margin-bottom: 0.75rem;
}

.post-card-hero {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 6px;
}

/* ===== Single Post ===== */
.post-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.post-title {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.post-meta {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.post-author {
  a {
    color: var(--color-accent);
    text-decoration: none;
    padding-inline: 0.25em;

    &:hover {
      text-decoration: underline;
    }
  }
}

.post-views {
  display: none;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.post-tags {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* ===== Post/Page Content ===== */
.post-content,
.page-content {
  font-size: 1.2rem;
  line-height: 1.8;
}

.post-content h2,
.page-content h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.post-content h3,
.page-content h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.post-content p,
.page-content p {
  margin-bottom: 1.2rem;
}

.post-content a,
.page-content a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.post-content a:hover,
.page-content a:hover {
  color: var(--color-accent-hover);
}

.post-content img,
.page-content img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 1.5rem 0;
}

.post-content blockquote,
.page-content blockquote {
  border-left: 4px solid var(--color-accent);
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  color: var(--color-text);
  background: var(--color-code-bg);
  border-radius: 0 8px 8px 0;
  /* font-family: "Lora", "Georgia", serif; */
  font-size: 1.08rem;
  font-weight: bold;
  line-height: 1.9;
  position: relative;

  p {
    margin-bottom: unset;
  }

  cite {
    display: block;
    text-align: right;
    font-size: 0.92rem;
    color: var(--color-text-muted);
    margin-top: 0.5rem;
  }
}

.post-content blockquote p:first-child::before {
  content: "\201C";
  font-size: 2.5rem;
  color: var(--color-accent);
  font-family: var(--font-serif);
  line-height: 0;
  vertical-align: -0.5rem;
  margin-right: 0.15rem;
}

.post-content code,
.page-content code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  font-weight: bold;
  color: var(--color-accent);
  padding: 0.15em 0.35em;
  border-radius: 3px;

  &:hover {
    box-shadow: 2px 2px silver;
  }
}

.post-content .highlight,
.page-content .highlight {
  overflow-x: auto;
  border-radius: 6px;
  margin: 1.5rem 0;
  scrollbar-width: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.08);
}

.post-content .highlight::-webkit-scrollbar,
.page-content .highlight::-webkit-scrollbar {
  display: none;
}

.post-content .highlight::-webkit-scrollbar-track,
.page-content .highlight::-webkit-scrollbar-track {
  background: transparent;
}

.post-content pre,
.page-content pre {
  background: var(--color-code-bg);
  color: var(--color-text);
  padding: 1.25rem 1.5rem;
  border-radius: 6px;
  overflow: visible;
  width: fit-content;
  min-width: 100%;
  margin: 0;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.8;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.post-content pre code,
.page-content pre code {
  background: none;
  padding: 0;
  font-size: inherit;
  font-weight: normal;
  color: inherit;
}

.post-content ul,
.post-content ol,
.page-content ul,
.page-content ol {
  margin-bottom: 1.2rem;
  padding-left: 1.5rem;
}

.post-content li,
.page-content li {
  margin-bottom: 0.3rem;
}

.post-content hr,
.page-content hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2rem 0;
}

.post-content table,
.page-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.92rem;
}

.post-content th,
.page-content th {
  text-align: left;
  font-weight: 600;
  padding: 0.6rem 0.75rem;
  border-bottom: 2px solid var(--color-border);
}

.post-content td,
.page-content td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--color-border);
}

/* ===== Post Navigation ===== */
.post-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.9rem;
}

.post-nav a {
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 500;
  max-width: 45%;
}

.post-nav a:hover {
  text-decoration: underline;
}

.post-nav-next {
  margin-left: auto;
  text-align: right;
}

/* ===== Page Article ===== */
.page-article-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.page-article-header h1 {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.page-date {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  display: block;
  margin-top: 0.5rem;
}

/* ===== Pagination ===== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

.pagination li {
  list-style: none;
}

.pagination a,
.pagination .active a {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  border-radius: 4px;
  text-decoration: none;
  color: var(--color-text-muted);
  transition: all 0.15s;
}

.pagination a:hover {
  background: var(--color-code-bg);
  color: var(--color-text);
}

.pagination .active a {
  background: var(--color-accent);
  color: #fff;
}

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 2rem 0;
  text-align: center;
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  transition: color 0.15s;
}

.social-links a:hover {
  color: var(--color-accent);
}

.social-links svg {
  width: 20px;
  height: 20px;
}

/* ===== Author List ===== */
.author-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.author-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;

  &:hover {
    border-color: var(--color-accent);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.1);
  }
}

.author-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.author-info {
  h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
  }

  p {
    font-size: 0.88rem;
    color: var(--color-text-muted);
    margin: 0;
    line-height: 1.5;
  }
}

.slashes table {
  font-size: unset;

  th {
    border-bottom: none;
  }

  tbody tr:hover {
    text-shadow: 0.015em 0 0 currentColor, -0.015em 0 0 currentColor;
  }
}

/* ===== Dark Mode Overrides ===== */
[data-theme="dark"] .site-header {
  border-bottom: 1px solid var(--color-border);
}

[data-theme="dark"] a.tag:hover {
  background: #3b2d6e;
}

[data-theme="dark"] .nav-dropdown-menu {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .post-card:hover {
  box-shadow:
    0 0 8px rgba(167, 139, 250, 0.25),
    0 0 24px rgba(167, 139, 250, 0.15),
    0 0 48px rgba(167, 139, 250, 0.08);
}

[data-theme="dark"] .page-link:hover {
  box-shadow: 0 1px 4px rgba(167, 139, 250, 0.12);
}

[data-theme="dark"] .post-content .highlight,
[data-theme="dark"] .page-content .highlight {
  border: 1px solid var(--color-border);
  box-shadow: none;
}

/* ===== Ad Chit (Info Box) ===== */
.ad-chit {
  display: flex;
  gap: 0.75rem;
  background: var(--color-code-bg);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-accent);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-size: 0.92rem;
  line-height: 1.6;
}

.ad-chit-icon {
  flex-shrink: 0;
  color: var(--color-accent);
  margin-top: 0.1rem;
}

.ad-chit-icon svg {
  width: 18px;
  height: 18px;
}

.ad-chit-content p:last-child {
  margin-bottom: 0;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
  html {
    font-size: 16px;
  }

  .hero h1 {
    font-size: 1.7rem;
  }

  .post-title,
  .page-article-header h1 {
    font-size: 1.6rem;
  }

  .site-nav {
    gap: 1rem;
  }

  .site-nav a {
    font-size: 0.85rem;
  }

  .post-nav {
    flex-direction: column;
    gap: 0.75rem;
  }

  .post-nav a {
    max-width: 100%;
    text-align: left;
  }
}

/* ===== Syntax Highlighting (Light — Catppuccin Latte) ===== */
.chroma {
  color: #4c4f69;
  background-color: #eff1f5;
}

.chroma .lnlinks {
  outline: none;
  text-decoration: none;
  color: inherit
}

.chroma .lntd {
  vertical-align: top;
  padding: 0;
  margin: 0;
  border: 0;
}

.chroma .lntable {
  border-spacing: 0;
  padding: 0;
  margin: 0;
  border: 0;
}

.chroma .hl {
  background-color: #bcc0cc
}

.chroma .lnt {
  white-space: pre;
  -webkit-user-select: none;
  user-select: none;
  margin-right: 0.4em;
  padding: 0 0.4em 0 0.4em;
  color: #8c8fa1
}

.chroma .ln {
  white-space: pre;
  -webkit-user-select: none;
  user-select: none;
  margin-right: 0.4em;
  padding: 0 0.4em 0 0.4em;
  color: #8c8fa1
}

.chroma .line {
  display: flex;
}

.chroma .k {
  color: #8839ef
}

.chroma .kc {
  color: #fe640b
}

.chroma .kd {
  color: #d20f39
}

.chroma .kn {
  color: #179299
}

.chroma .kp {
  color: #8839ef
}

.chroma .kr {
  color: #8839ef
}

.chroma .kt {
  color: #d20f39
}

.chroma .na {
  color: #1e66f5
}

.chroma .nc {
  color: #df8e1d
}

.chroma .no {
  color: #df8e1d
}

.chroma .nd {
  color: #1e66f5;
  font-weight: bold
}

.chroma .ni {
  color: #179299
}

.chroma .ne {
  color: #fe640b
}

.chroma .nl {
  color: #04a5e5
}

.chroma .nn {
  color: #fe640b
}

.chroma .py {
  color: #fe640b
}

.chroma .nt {
  color: #8839ef
}

.chroma .nb {
  color: #04a5e5
}

.chroma .bp {
  color: #04a5e5
}

.chroma .nv {
  color: #dc8a78
}

.chroma .vc {
  color: #dc8a78
}

.chroma .vg {
  color: #dc8a78
}

.chroma .vi {
  color: #dc8a78
}

.chroma .vm {
  color: #dc8a78
}

.chroma .nf {
  color: #1e66f5
}

.chroma .fm {
  color: #1e66f5
}

.chroma .s {
  color: #40a02b
}

.chroma .sa {
  color: #d20f39
}

.chroma .sb {
  color: #40a02b
}

.chroma .sc {
  color: #40a02b
}

.chroma .dl {
  color: #1e66f5
}

.chroma .sd {
  color: #9ca0b0
}

.chroma .s2 {
  color: #40a02b
}

.chroma .se {
  color: #1e66f5
}

.chroma .sh {
  color: #9ca0b0
}

.chroma .si {
  color: #40a02b
}

.chroma .sx {
  color: #40a02b
}

.chroma .sr {
  color: #179299
}

.chroma .s1 {
  color: #40a02b
}

.chroma .ss {
  color: #40a02b
}

.chroma .m {
  color: #fe640b
}

.chroma .mb {
  color: #fe640b
}

.chroma .mf {
  color: #fe640b
}

.chroma .mh {
  color: #fe640b
}

.chroma .mi {
  color: #fe640b
}

.chroma .il {
  color: #fe640b
}

.chroma .mo {
  color: #fe640b
}

.chroma .o {
  color: #04a5e5;
  font-weight: bold
}

.chroma .ow {
  color: #04a5e5;
  font-weight: bold
}

.chroma .c {
  color: #9ca0b0;
  font-style: italic
}

.chroma .ch {
  color: #acb0be;
  font-style: italic
}

.chroma .cm {
  color: #9ca0b0;
  font-style: italic
}

.chroma .c1 {
  color: #9ca0b0;
  font-style: italic
}

.chroma .cs {
  color: #9ca0b0;
  font-style: italic
}

.chroma .cp {
  color: #9ca0b0;
  font-style: italic
}

.chroma .cpf {
  color: #9ca0b0;
  font-weight: bold;
  font-style: italic
}

.chroma .gd {
  color: #d20f39;
  background-color: #ccd0da
}

.chroma .ge {
  font-style: italic
}

.chroma .gr {
  color: #d20f39
}

.chroma .gh {
  color: #fe640b;
  font-weight: bold
}

.chroma .gi {
  color: #40a02b;
  background-color: #ccd0da
}

.chroma .gs {
  font-weight: bold
}

.chroma .gu {
  color: #fe640b;
  font-weight: bold
}

.chroma .gt {
  color: #d20f39
}

.chroma .gl {
  text-decoration: underline
}

.chroma .err {
  color: #d20f39
}

/* ===== Syntax Highlighting (Dark — Catppuccin Mocha) ===== */
[data-theme="dark"] .chroma {
  color: #cdd6f4;
  background-color: #1e1e2e;
}

[data-theme="dark"] .chroma .hl {
  background-color: #45475a
}

[data-theme="dark"] .chroma .lnt {
  color: #7f849c
}

[data-theme="dark"] .chroma .ln {
  color: #7f849c
}

[data-theme="dark"] .chroma .k {
  color: #cba6f7
}

[data-theme="dark"] .chroma .kc {
  color: #fab387
}

[data-theme="dark"] .chroma .kd {
  color: #f38ba8
}

[data-theme="dark"] .chroma .kn {
  color: #94e2d5
}

[data-theme="dark"] .chroma .kp {
  color: #cba6f7
}

[data-theme="dark"] .chroma .kr {
  color: #cba6f7
}

[data-theme="dark"] .chroma .kt {
  color: #f38ba8
}

[data-theme="dark"] .chroma .na {
  color: #89b4fa
}

[data-theme="dark"] .chroma .nc {
  color: #f9e2af
}

[data-theme="dark"] .chroma .no {
  color: #f9e2af
}

[data-theme="dark"] .chroma .nd {
  color: #89b4fa
}

[data-theme="dark"] .chroma .ni {
  color: #94e2d5
}

[data-theme="dark"] .chroma .ne {
  color: #fab387
}

[data-theme="dark"] .chroma .nl {
  color: #89dceb
}

[data-theme="dark"] .chroma .nn {
  color: #fab387
}

[data-theme="dark"] .chroma .py {
  color: #fab387
}

[data-theme="dark"] .chroma .nt {
  color: #cba6f7
}

[data-theme="dark"] .chroma .nb {
  color: #89dceb
}

[data-theme="dark"] .chroma .bp {
  color: #89dceb
}

[data-theme="dark"] .chroma .nv {
  color: #f5e0dc
}

[data-theme="dark"] .chroma .vc {
  color: #f5e0dc
}

[data-theme="dark"] .chroma .vg {
  color: #f5e0dc
}

[data-theme="dark"] .chroma .vi {
  color: #f5e0dc
}

[data-theme="dark"] .chroma .vm {
  color: #f5e0dc
}

[data-theme="dark"] .chroma .nf {
  color: #89b4fa
}

[data-theme="dark"] .chroma .fm {
  color: #89b4fa
}

[data-theme="dark"] .chroma .s {
  color: #a6e3a1
}

[data-theme="dark"] .chroma .sa {
  color: #f38ba8
}

[data-theme="dark"] .chroma .sb {
  color: #a6e3a1
}

[data-theme="dark"] .chroma .sc {
  color: #a6e3a1
}

[data-theme="dark"] .chroma .dl {
  color: #89b4fa
}

[data-theme="dark"] .chroma .sd {
  color: #6c7086
}

[data-theme="dark"] .chroma .s2 {
  color: #a6e3a1
}

[data-theme="dark"] .chroma .se {
  color: #89b4fa
}

[data-theme="dark"] .chroma .sh {
  color: #6c7086
}

[data-theme="dark"] .chroma .si {
  color: #a6e3a1
}

[data-theme="dark"] .chroma .sx {
  color: #a6e3a1
}

[data-theme="dark"] .chroma .sr {
  color: #94e2d5
}

[data-theme="dark"] .chroma .s1 {
  color: #a6e3a1
}

[data-theme="dark"] .chroma .ss {
  color: #a6e3a1
}

[data-theme="dark"] .chroma .m {
  color: #fab387
}

[data-theme="dark"] .chroma .mb {
  color: #fab387
}

[data-theme="dark"] .chroma .mf {
  color: #fab387
}

[data-theme="dark"] .chroma .mh {
  color: #fab387
}

[data-theme="dark"] .chroma .mi {
  color: #fab387
}

[data-theme="dark"] .chroma .il {
  color: #fab387
}

[data-theme="dark"] .chroma .mo {
  color: #fab387
}

[data-theme="dark"] .chroma .o {
  color: #89dceb
}

[data-theme="dark"] .chroma .ow {
  color: #89dceb
}

[data-theme="dark"] .chroma .c {
  color: #6c7086;
  font-style: italic
}

[data-theme="dark"] .chroma .ch {
  color: #585b70;
  font-style: italic
}

[data-theme="dark"] .chroma .cm {
  color: #6c7086;
  font-style: italic
}

[data-theme="dark"] .chroma .c1 {
  color: #6c7086;
  font-style: italic
}

[data-theme="dark"] .chroma .cs {
  color: #6c7086;
  font-style: italic
}

[data-theme="dark"] .chroma .cp {
  color: #6c7086;
  font-style: italic
}

[data-theme="dark"] .chroma .cpf {
  color: #6c7086;
  font-style: italic
}

[data-theme="dark"] .chroma .gd {
  color: #f38ba8;
  background-color: #313244
}

[data-theme="dark"] .chroma .ge {
  font-style: italic
}

[data-theme="dark"] .chroma .gr {
  color: #f38ba8
}

[data-theme="dark"] .chroma .gh {
  color: #fab387;
  font-weight: bold
}

[data-theme="dark"] .chroma .gi {
  color: #a6e3a1;
  background-color: #313244
}

[data-theme="dark"] .chroma .gs {
  font-weight: bold
}

[data-theme="dark"] .chroma .gu {
  color: #fab387;
  font-weight: bold
}

[data-theme="dark"] .chroma .gt {
  color: #f38ba8
}

[data-theme="dark"] .chroma .gl {
  text-decoration: underline
}

[data-theme="dark"] .chroma .err {
  color: #f38ba8
}

/* ========================================
   Pagefind Search UI
   ======================================== */

.search-page .pagefind-ui {
  --pagefind-ui-scale: 1;
  --pagefind-ui-primary: var(--color-accent);
  --pagefind-ui-text: var(--color-text);
  --pagefind-ui-background: var(--color-bg);
  --pagefind-ui-border: var(--color-border);
  --pagefind-ui-tag: var(--color-surface);
  --pagefind-ui-border-width: 1px;
  --pagefind-ui-border-radius: 8px;
  --pagefind-ui-font: var(--font-sans);
}

.search-page .pagefind-ui .pagefind-ui__search-input {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  font-size: 1.05rem;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-page .pagefind-ui .pagefind-ui__search-input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.search-page .pagefind-ui .pagefind-ui__search-clear {
  color: var(--color-text-muted);
  background: none;
}

.search-page .pagefind-ui .pagefind-ui__result {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--color-border);
}

.search-page .pagefind-ui .pagefind-ui__result-link {
  color: var(--color-accent);
  font-weight: 600;
  font-size: 1.1rem;
  text-decoration: none;
  font-family: var(--font-sans);
}

.search-page .pagefind-ui .pagefind-ui__result-link:hover {
  text-decoration: underline;
}

.search-page .pagefind-ui .pagefind-ui__result-excerpt {
  color: var(--color-text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
  margin-top: 0.35rem;
}

.search-page .pagefind-ui mark {
  background: rgba(99, 102, 241, 0.18);
  color: var(--color-text);
  padding: 0.1em 0.25em;
  border-radius: 3px;
}

[data-theme="dark"] .search-page .pagefind-ui mark {
  background: rgba(167, 139, 250, 0.28);
}

.search-page .pagefind-ui .pagefind-ui__message {
  color: var(--color-text-muted);
  font-family: var(--font-sans);
}

.search-page .pagefind-ui .pagefind-ui__button {
  background: var(--color-accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1.25rem;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.search-page .pagefind-ui .pagefind-ui__button:hover {
  opacity: 0.85;
}