/* =========================================================
   Ahau Theme — Inspired by OMORI & Minimalist Cyber-Terminal Aesthetic
   Base Palette: #16172c with subtle Perlin noise, neon accents
   Accent Pill: #bef264 / #a3e635 (lime green badge)
   Cyan Accent: #38bdf8 / #22d3ee (retro terminal cyan)
   Text: #d1d5db / #e2e8f0
   ========================================================= */

:root,
html[data-theme="ahau"] {
  --bg-main:       #16172c;
  --bg-panel:      rgba(22, 23, 44, 0.7);
  --bg-card:       #1c1e36;
  --bg-hover:      #232644;
  --border-color:  #282b4c;
  --border-subtle: #21243e;

  /* Pill badge */
  --pill-bg:       #bef264;
  --pill-text:     #111827;

  /* Text & Links */
  --text-main:     #d5daf0;
  --text-muted:    #8b93b8;
  --text-dim:      #585e80;
  --link:          #38bdf8;
  --link-hover:    #7dd3fc;
  --accent-cyan:   #38bdf8;
  --accent-pink:   #f472b6;
  --accent-purple: #c084fc;
  --accent-green:  #4ade80;
  --accent-yellow: #fde047;
  --accent-red:    #f87171;

  /* Fonts */
  --font-mono: "IBM Plex Mono", "JetBrains Mono", Consolas, Menlo, Monaco, monospace;

  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  background-color: var(--bg-main);
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  position: relative;
}

/* Perlin noise background canvas / texture overlay */
.perlin-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  opacity: 0.18;
  background-repeat: repeat;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.086  0 0 0 0 0.090  0 0 0 0 0.172  0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

::selection {
  background: var(--accent-cyan);
  color: #0b0f19;
}

/* =========================================================
   Layout
   ========================================================= */
.wrap {
  width: 100%;
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

.site-main {
  padding: 2.5rem 0 4rem;
  min-height: 70vh;
}

/* Two-column layout matching reference screenshot */
.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 3.5rem;
  align-items: start;
}

@media (max-width: 820px) {
  .content-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

.main-column {
  min-width: 0;
}

.side-column {
  min-width: 0;
  font-size: 0.82rem;
  position: sticky;
  top: 4.5rem;
}

/* =========================================================
   Header (Top Nav Bar)
   ========================================================= */
.site-header {
  padding: 1.5rem 0 1rem;
  position: relative;
  z-index: 10;
}

.site-header__inner {
  display: flex;
  align-items: center;
}

.nav-pills {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  flex-wrap: wrap;
}

.nav-pill {
  color: var(--link);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.nav-pill:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

/* First active pill styling like [Claw] in reference */
.nav-pill--active {
  background-color: var(--pill-bg);
  color: var(--pill-text) !important;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  text-decoration: none !important;
  display: inline-block;
  line-height: 1.2;
}

.nav-pill--active:hover {
  filter: brightness(1.05);
}

/* =========================================================
   Typography & Headings
   ========================================================= */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-main);
  margin: 1.6em 0 0.6em;
  line-height: 1.35;
}

.page-title {
  margin-top: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.title-prefix {
  color: var(--text-dim);
  font-weight: normal;
  margin-right: 0.2em;
}

.lead-text {
  color: var(--text-main);
  font-size: 0.88rem;
  line-height: 1.65;
  margin-bottom: 2rem;
}

.lead-text p {
  margin: 0 0 1rem;
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

/* =========================================================
   Tree / Nested Lists (matching reference)
   ========================================================= */
.category-heading {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 1.2rem 0 0.4rem;
}

.nested-tree {
  list-style: none;
  padding-left: 1rem;
  margin: 0.4rem 0 1.2rem;
}

.nested-tree li {
  position: relative;
  margin: 0.35rem 0;
  color: var(--text-main);
  font-size: 0.86rem;
}

.nested-tree li::before {
  content: "·";
  position: absolute;
  left: -0.85rem;
  color: var(--text-dim);
}

.nested-tree a {
  color: var(--link);
}

/* =========================================================
   Section Block & Card Style (Last update box)
   ========================================================= */
.section-block {
  margin-bottom: 2.2rem;
}

.update-card {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
}

.update-card__title {
  font-size: 1.05rem;
  margin: 0 0 0.6rem;
}

.update-card__text {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.55;
}

/* =========================================================
   Feed List (for /posts/ and lists)
   ========================================================= */
.feed-list {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  margin-top: 1.5rem;
}

.feed-entry {
  margin-bottom: 0.5rem;
}

.feed-entry__title {
  font-size: 1.05rem;
  margin: 0 0 0.3rem;
  font-weight: 600;
}

.feed-entry__prefix {
  color: var(--text-dim);
}

.feed-entry__title a {
  color: var(--link);
}

.feed-entry__desc {
  color: var(--text-muted);
  font-size: 0.86rem;
  margin: 0;
  line-height: 1.5;
}

.feed-empty {
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* =========================================================
   Sidebar Widgets (matching reference right column)
   ========================================================= */
.side-widget {
  margin-bottom: 1rem;
}

.side-meta__heading {
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.2rem;
  font-size: 0.86rem;
}

.side-meta__sub {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 0.8rem;
}

.side-meta__stats {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.meta-icon {
  color: var(--text-dim);
  margin-right: 0.3rem;
}

.side-divider {
  color: var(--border-color);
  letter-spacing: 0.1em;
  margin: 1.2rem 0;
  user-select: none;
}

.side-brand__title {
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.2rem;
  font-size: 0.86rem;
}

.side-brand__sub {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 0.8rem;
}

.side-brand__icons {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.side-brand__icons a {
  color: var(--link);
  display: inline-flex;
  align-items: center;
  opacity: 0.85;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.side-brand__icons a:hover {
  opacity: 1;
  transform: translateY(-1px);
}

/* Sidebar TOC */
.side-toc {
  font-size: 0.8rem;
}

.toc__title {
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.toc ul {
  list-style: none;
  padding-left: 0.8rem;
  margin: 0;
  border-left: 1px solid var(--border-subtle);
}

.toc li {
  margin: 0.35rem 0;
}

.toc a {
  color: var(--link);
}

.toc a:hover {
  color: var(--link-hover);
}

/* =========================================================
   Article / Single Post Content
   ========================================================= */
.single-header {
  margin-bottom: 1.8rem;
}

.single-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.4rem;
}

.article-body,
.content {
  font-size: 0.88rem;
  line-height: 1.7;
}

.article-body p,
.content p {
  margin: 0 0 1.2em;
}

/* Headings in content */
.article-body h1, .content h1 {
  font-size: 1.45rem;
  font-weight: 700;
  margin: 2.2em 0 0.8em;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
}
.article-body h1::before, .content h1::before {
  content: "# ";
  color: var(--text-dim);
  font-weight: normal;
}

.article-body h2, .content h2 {
  font-size: 1.22rem;
  font-weight: 600;
  margin: 2em 0 0.7em;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
}
.article-body h2::before, .content h2::before {
  content: "## ";
  color: var(--text-dim);
  font-weight: normal;
}

.article-body h3, .content h3 {
  font-size: 1.08rem;
  font-weight: 600;
  margin: 1.7em 0 0.6em;
  color: var(--text-main);
}
.article-body h3::before, .content h3::before {
  content: "### ";
  color: var(--text-dim);
  font-weight: normal;
}

.article-body h4, .content h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 1.5em 0 0.5em;
  color: var(--text-main);
}
.article-body h4::before, .content h4::before {
  content: "#### ";
  color: var(--text-dim);
  font-weight: normal;
}

.article-body h5, .content h5 {
  font-size: 0.88rem;
  font-weight: 600;
  margin: 1.3em 0 0.4em;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.article-body h5::before, .content h5::before {
  content: "##### ";
  color: var(--text-dim);
  font-weight: normal;
}

.article-body h6, .content h6 {
  font-size: 0.82rem;
  font-weight: 600;
  margin: 1.2em 0 0.4em;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.article-body h6::before, .content h6::before {
  content: "###### ";
  color: var(--text-dim);
  font-weight: normal;
}

.article-body h1 a, .content h1 a,
.article-body h2 a, .content h2 a,
.article-body h3 a, .content h3 a,
.article-body h4 a, .content h4 a {
  color: inherit;
  text-decoration: none;
}
.article-body h1 a:hover, .content h1 a:hover,
.article-body h2 a:hover, .content h2 a:hover,
.article-body h3 a:hover, .content h3 a:hover,
.article-body h4 a:hover, .content h4 a:hover {
  color: var(--link);
  text-decoration: underline;
}

/* Inline text formatting */
.article-body strong, .content strong,
.article-body b, .content b {
  font-weight: 700;
  color: #f8fafc;
}

.article-body em, .content em,
.article-body i, .content i {
  font-style: italic;
  color: #e2e8f0;
}

.article-body del, .content del,
.article-body s, .content s,
.article-body strike, .content strike {
  text-decoration: line-through;
  color: var(--text-dim);
}

.article-body u, .content u {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--text-dim);
}

.article-body mark, .content mark {
  background: rgba(253, 224, 71, 0.16);
  color: var(--accent-yellow);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  border: 1px solid rgba(253, 224, 71, 0.3);
}

.article-body kbd, .content kbd {
  font-family: var(--font-mono);
  font-size: 0.8em;
  background: #0f1020;
  color: var(--accent-cyan);
  padding: 0.18em 0.48em;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  border-bottom: 2px solid var(--border-color);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  white-space: nowrap;
}

.article-body sub, .content sub,
.article-body sup, .content sup {
  font-size: 0.75em;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

.article-body sub, .content sub {
  bottom: -0.25em;
}

.article-body sup, .content sup {
  top: -0.5em;
}

.article-body abbr[title], .content abbr[title] {
  border-bottom: 1px dotted var(--link);
  text-decoration: none;
  cursor: help;
}

/* Lists */
.article-body ul, .content ul,
.article-body ol, .content ol {
  padding-left: 1.5rem;
  margin: 0.8em 0 1.3em;
}

.article-body li, .content li {
  margin: 0.35em 0;
  line-height: 1.65;
}

.article-body ul, .content ul {
  list-style-type: square;
}

.article-body ol, .content ol {
  list-style-type: decimal;
}

.article-body ul ul, .content ul ul {
  list-style-type: circle;
}

.article-body ul ul ul, .content ul ul ul {
  list-style-type: disc;
}

.article-body ul ul, .content ul ul,
.article-body ol ol, .content ol ol,
.article-body ul ol, .content ul ol,
.article-body ol ul, .content ol ul {
  margin: 0.25em 0 0.25em 0.5em;
}

/* Task lists (GFM) */
.article-body li:has(> input[type="checkbox"]),
.content li:has(> input[type="checkbox"]),
li.task-list-item {
  list-style: none !important;
  position: relative;
  padding-left: 0.1rem;
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
}

.article-body input[type="checkbox"],
.content input[type="checkbox"] {
  appearance: auto;
  accent-color: var(--pill-bg);
  cursor: pointer;
  margin: 0;
  transform: translateY(2px);
}

/* Definition lists */
.article-body dl, .content dl {
  margin: 1.2em 0;
  padding-left: 0.8rem;
  border-left: 2px solid var(--border-color);
}

.article-body dt, .content dt {
  font-weight: 600;
  color: var(--accent-cyan);
  margin-top: 0.8em;
}

.article-body dt:first-child, .content dt:first-child {
  margin-top: 0;
}

.article-body dt::before, .content dt::before {
  content: "▶ ";
  color: var(--pill-bg);
  font-size: 0.75em;
  margin-right: 0.25rem;
}

.article-body dd, .content dd {
  margin-left: 0.8rem;
  margin-bottom: 0.6em;
  color: var(--text-muted);
}

/* Blockquotes */
.article-body blockquote, .content blockquote {
  margin: 1.6em 0;
  padding: 0.8em 1.25em;
  border-left: 3px solid var(--link);
  background: rgba(28, 30, 54, 0.65);
  border-radius: 0 4px 4px 0;
  color: var(--text-muted);
}

.article-body blockquote p, .content blockquote p {
  margin: 0 0 0.8em;
}

.article-body blockquote p:last-child, .content blockquote p:last-child {
  margin-bottom: 0;
}

.article-body blockquote blockquote, .content blockquote blockquote {
  margin-top: 0.8em;
  border-left-color: var(--accent-purple);
  background: rgba(22, 23, 44, 0.65);
}

.article-body blockquote cite, .content blockquote cite,
.article-body blockquote footer, .content blockquote footer {
  display: block;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 0.6em;
  font-style: normal;
  text-align: right;
}

/* Tables & Responsive Wrapper */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  margin: 1.6em 0;
  border-radius: 4px;
  -webkit-overflow-scrolling: touch;
}

.article-body table, .content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.6em 0;
  font-size: 0.84rem;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  border-radius: 4px;
  overflow: hidden;
}

.table-wrapper table {
  margin: 0;
}

.article-body th, .content th {
  background: #121324;
  color: var(--text-main);
  font-weight: 600;
  text-align: left;
  padding: 0.65rem 0.95rem;
  border-bottom: 2px solid var(--border-color);
  border-right: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.article-body td, .content td {
  padding: 0.55rem 0.95rem;
  border-bottom: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.article-body th:last-child, .content th:last-child,
.article-body td:last-child, .content td:last-child {
  border-right: none;
}

.article-body tr:last-child td, .content tr:last-child td {
  border-bottom: none;
}

.article-body tbody tr:nth-child(even), .content tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.article-body tbody tr:hover, .content tbody tr:hover {
  background: rgba(56, 189, 248, 0.05);
}

/* Horizontal Rule */
.article-body hr, .content hr {
  border: none;
  border-top: 1px dashed var(--border-color);
  margin: 2.4em 0;
  position: relative;
  overflow: visible;
  height: 0;
}

/* Images & Figures */
.article-body img, .content img {
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 1.5em auto;
  display: block;
}

.article-body figure, .content figure {
  margin: 1.8em 0;
  text-align: center;
}

.article-body figure img, .content figure img {
  margin: 0 auto 0.5em;
}

.article-body figcaption, .content figcaption {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-style: italic;
  margin-top: 0.4em;
}

/* Details & Summary */
.article-body details, .content details {
  margin: 1.3em 0;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--bg-card);
}

.article-body summary, .content summary {
  font-weight: 600;
  cursor: pointer;
  color: var(--accent-cyan);
  user-select: none;
  outline: none;
}

.article-body summary:hover, .content summary:hover {
  color: var(--link-hover);
}

.article-body details[open] summary, .content details[open] summary {
  margin-bottom: 0.65rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

/* Footnotes */
.article-body .footnotes, .content .footnotes {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px dashed var(--border-color);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.article-body .footnotes hr, .content .footnotes hr {
  display: none;
}

.article-body .footnotes ol, .content .footnotes ol {
  padding-left: 1.25rem;
  margin: 0;
}

.article-body .footnote-ref, .content .footnote-ref {
  font-size: 0.75em;
  padding: 0 0.25em;
  color: var(--accent-cyan);
  text-decoration: none;
  font-weight: 600;
}

.article-body .footnote-ref:hover, .content .footnote-ref:hover {
  text-decoration: underline;
}

.article-body .footnote-backref, .content .footnote-backref {
  color: var(--pill-bg);
  text-decoration: none;
  margin-left: 0.35em;
}

.article-body .footnote-backref:hover, .content .footnote-backref:hover {
  filter: brightness(1.2);
}

/* Badges */
.badge {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  line-height: 1.3;
  vertical-align: middle;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
}
.badge--pill   { background: var(--pill-bg); color: var(--pill-text); border-color: var(--pill-bg); }
.badge--cyan   { background: rgba(56, 189, 248, 0.15); color: var(--accent-cyan); border-color: rgba(56, 189, 248, 0.4); }
.badge--green  { background: rgba(74, 222, 128, 0.15); color: var(--accent-green); border-color: rgba(74, 222, 128, 0.4); }
.badge--yellow { background: rgba(253, 224, 71, 0.15); color: var(--accent-yellow); border-color: rgba(253, 224, 71, 0.4); }
.badge--pink   { background: rgba(244, 114, 182, 0.15); color: var(--accent-pink); border-color: rgba(244, 114, 182, 0.4); }
.badge--red    { background: rgba(248, 113, 113, 0.15); color: var(--accent-red); border-color: rgba(248, 113, 113, 0.4); }

/* =========================================================
   Code Blocks & Inline Code
   ========================================================= */
code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--bg-card);
  color: var(--accent-yellow);
  padding: 0.15em 0.35em;
  border-radius: 3px;
  border: 1px solid var(--border-subtle);
}

.highlight {
  position: relative;
  margin: 1.6em 0;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: #111222;
}

.highlight pre {
  margin: 0;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.55;
  background: transparent !important;
}

.highlight pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: var(--text-main);
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0.8rem;
  background: #0d0e1c;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.75rem;
  color: var(--text-dim);
}

.code-block-header .dots {
  display: inline-flex;
  gap: 5px;
}

.code-block-header .dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.code-block-header .dots span:nth-child(1) { background: #f87171; }
.code-block-header .dots span:nth-child(2) { background: #facc15; }
.code-block-header .dots span:nth-child(3) { background: #4ade80; }

.copy-btn {
  border: 1px solid var(--border-color);
  background: #16172c;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.copy-btn:hover {
  color: var(--text-main);
  border-color: var(--link);
}

.copy-btn.copied {
  color: var(--accent-green);
  border-color: var(--accent-green);
}

/* =========================================================
   Admonitions
   ========================================================= */
.admonition {
  margin: 1.5em 0;
  padding: 0.8rem 1rem;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--link);
  background: var(--bg-card);
}

.admonition-title {
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
  color: var(--link);
}

.admonition p:last-child {
  margin-bottom: 0;
}

.admonition--note { border-left-color: var(--link); }
.admonition--note .admonition-title { color: var(--link); }
.admonition--tip { border-left-color: var(--accent-green); }
.admonition--tip .admonition-title { color: var(--accent-green); }
.admonition--warning { border-left-color: var(--accent-yellow); }
.admonition--warning .admonition-title { color: var(--accent-yellow); }
.admonition--danger { border-left-color: var(--accent-red); }
.admonition--danger .admonition-title { color: var(--accent-red); }

/* =========================================================
   Reading Progress Bar
   ========================================================= */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: var(--link);
  z-index: 100;
  transition: width 0.1s ease-out;
}

/* =========================================================
   Pagination
   ========================================================= */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  font-size: 0.82rem;
}

.pagination a {
  border: 1px solid var(--border-color);
  padding: 0.3rem 0.7rem;
  border-radius: 4px;
}

.pagination .disabled {
  color: var(--text-dim);
}

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 2rem 0;
  color: var(--text-dim);
  font-size: 0.8rem;
  position: relative;
  z-index: 1;
}

.site-footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.kisto-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font-family: inherit;
  font-size: inherit;
  color: var(--link);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s ease;
}

.kisto-btn:hover {
  color: var(--pill-bg);
}

.kisto-counter {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--pill-bg);
  background: rgba(190, 242, 100, 0.12);
  border: 1px solid rgba(190, 242, 100, 0.35);
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.footer-links {
  display: flex;
  gap: 1rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links a {
  color: var(--text-muted);
}

.footer-links a:hover {
  color: var(--link);
}

/* =========================================================
   404
   ========================================================= */
.error-page {
  padding: 3rem 0;
}

.error-page__code {
  font-size: 3rem;
  color: var(--text-dim);
  margin: 0 0 0.5rem;
  font-weight: 700;
}

.error-page__code span {
  color: var(--accent-red);
}

/* Utility */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
