@charset "UTF-8";
/* ===== DragomirSec brand tokens ===== */
:root {
  --purple: #5D3FD3;
  --ember: #FF7A1A;
  --bg: #0F1115;
  --surface:#161A21;
  --text: #EDEEF2;
  --dim: #9AA0AC;
  --border: #22262e;
  --nav-bg: rgba(15,17,21,0.9);
  --code-bg:#1c212a;
  --body-text:#c6cad3;
  --placeholder:#5a6170;
}

/* ===== Light mode — surfaces and ink flip, brand anchors hold ===== */
[data-theme=light] {
  --ember: #E06300;
  --bg: #EDEEF2;
  --surface:#FFFFFF;
  --text: #161A21;
  --dim: #6a7180;
  --border: #d4d7de;
  --nav-bg: rgba(237,238,242,0.92);
  --code-bg:#e3e6ec;
  --body-text:#3c414c;
  --placeholder:#9aa0ac;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
.mono {
  font-family: "JetBrains Mono", monospace;
}

pre, code {
  line-height: 1.4rem;
}

.accent {
  color: var(--ember);
}

.nav {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 1rem;
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 60px;
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  order: 0;
  white-space: nowrap;
}

.brand, .search-bar, .nav-actions {
  flex-shrink: 0;
}

.nav-logo {
  width: 34px;
  height: 34px;
}

.brand-name {
  font-family: "JetBrains Mono", monospace;
  color: var(--text);
  font-size: 1.0625rem;
}

.nav-links {
  display: contents;
  list-style: none;
}

.nav-links > li {
  display: flex;
  align-items: center;
  list-style: none;
  order: 1;
}

.nav-actions {
  display: none;
  align-items: center;
  gap: 0.5rem;
  order: 4;
}

.nav-theme-row {
  order: 3 !important;
}

.nav-theme-label {
  display: none;
}

.nav-links a {
  color: var(--dim);
  text-decoration: none;
  font-size: 1.0625rem;
  padding: 0.4rem 0.8rem;
  transition: color 0.2s;
  position: relative;
}

.nav-links a:hover {
  color: var(--ember);
}

.nav-links a.active {
  color: var(--ember);
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: var(--ember);
  transition: width 0.25s;
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-links a.nav-cta {
  border: 1px solid var(--purple);
  border-radius: 8px;
  padding: 0.4rem 1.2rem;
  color: var(--purple);
}

.nav-links a.nav-cta:hover {
  background: var(--purple);
  color: #fff;
}

.nav-links a.nav-cta::after {
  display: none;
}

.theme-toggle {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--dim);
  width: 38px;
  height: 38px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, border-color 0.2s;
}

.theme-toggle:hover {
  color: var(--ember);
  border-color: var(--ember);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

/* sun shows in dark (offer light), moon shows in light (offer dark) */
[data-theme=light] .icon-moon {
  display: none;
}

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

html:not([data-theme=light]) .icon-sun {
  display: none;
}

html:not([data-theme=light]) .icon-moon {
  display: block;
}

.nav-burger {
  display: none;
}

.nav-burger,
.theme-toggle {
  flex-shrink: 0;
}

.icon-burger {
  display: block;
}

.icon-x {
  display: none;
}

body.nav-open .icon-burger {
  display: none;
}

body.nav-open .icon-x {
  display: block;
}

.hero {
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4rem 8vw;
  gap: 2rem;
  flex-wrap: wrap;
}

.hero-text h1 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 800;
}

.hero-text h2 {
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  color: var(--purple);
  font-weight: 600;
}

.tagline {
  color: var(--dim);
  margin: 1rem 0 2rem;
}

.cta-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  padding: 0.75rem 1.6rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--purple);
  color: #fff;
  box-shadow: 0 4px 24px rgba(93, 63, 211, 0.35);
}

.btn-ghost {
  border: 1px solid var(--purple);
  color: var(--purple);
}

.hero-dragon img {
  width: clamp(220px, 34vw, 420px);
  filter: drop-shadow(0 0 42px rgba(93, 63, 211, 0.55));
  animation: pulse 5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    filter: drop-shadow(0 0 42px rgba(93, 63, 211, 0.55));
  }
  50% {
    filter: drop-shadow(0 0 68px rgba(93, 63, 211, 0.8));
  }
}
section {
  padding: 4rem 8vw;
  max-width: 1200px;
  margin: 0 auto;
}

.section-title {
  font-family: "JetBrains Mono", monospace;
  color: var(--ember);
  font-size: 1.3rem;
  margin-bottom: 2rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: border-color 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  position: relative;
  text-decoration: none;
  color: inherit;
}

.card:hover {
  border-color: var(--purple);
  transform: translateY(-4px);
}

.tag-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tag {
  background: rgba(93, 63, 211, 0.15);
  color: var(--purple);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
}

.card p {
  color: var(--dim);
  font-size: 0.92rem;
  flex-grow: 1;
}

.card .card-link {
  color: var(--ember);
  text-decoration: none;
  font-size: 0.88rem;
}

.card h3 {
  transition: color 0.2s;
}

.card:hover h3 {
  color: var(--ember);
}

.post-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.post-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.2rem 1.5rem;
  text-decoration: none;
  transition: border-color 0.2s;
}

.post-item:hover {
  border-color: var(--ember);
}

.post-item h3 {
  font-size: 1.05rem;
  color: var(--text);
}

.post-item .excerpt {
  color: var(--dim);
  font-size: 0.9rem;
}

.post-item .date {
  font-family: "JetBrains Mono", monospace;
  color: var(--dim);
  font-size: 0.8rem;
  white-space: nowrap;
}

.md h1, .md h2, .md h3 {
  margin: 1.4em 0 0.5em;
  color: var(--text);
}

.md h1 {
  font-size: 2.25rem;
  line-height: 1.2;
}

.md h2 {
  font-size: 1.65rem;
  line-height: 1.3;
}

.md h3 {
  font-size: 1.3rem;
  line-height: 1.35;
}

.md p {
  margin: 0.8em 0;
  color: var(--body-text);
}

.md code {
  font-family: "JetBrains Mono", monospace;
  background: var(--code-bg);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.88em;
  color: var(--ember);
}

.md pre {
  background: var(--code-bg);
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1em 0;
}

.md pre code {
  color: var(--text);
}

.md a {
  color: var(--purple);
}

.md blockquote {
  border-left: 3px solid var(--purple);
  padding-left: 1rem;
  color: var(--dim);
}

/* --- Markdown lists --- */
.md ul, .md ol {
  margin: 1em 0;
  padding-left: 1.6rem;
}

.md li {
  margin: 0.35em 0;
  padding-left: 0.25rem;
  color: var(--body-text);
}

.md li::marker {
  color: var(--ember);
}

.md li > code {
  color: var(--ember);
}

footer {
  text-align: center;
  padding: 2rem;
  color: var(--dim);
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}

/* --- Standalone pages --- */
.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 4rem 6vw;
}

.projects-page {
  max-width: 1160px;
  padding: 4rem clamp(1.25rem, 3.65vw, 3.5rem);
}

.projects-page > .section-title {
  font-size: 1.5rem;
}

.projects-page #project-grid {
  column-gap: 1.6rem;
}

.projects-page #project-grid .card {
  min-height: 18.5rem;
}

.projects-page #project-grid .card h3 {
  font-size: 1.25rem;
}

.projects-page #project-grid .card p {
  font-size: 1rem;
  line-height: 1.5;
}

.projects-page .tag {
  font-size: 0.78rem;
}

.projects-page .post-item {
  padding: 1.4rem 1.65rem;
}

.projects-page .post-item h3 {
  font-size: 1.15rem;
}

.projects-page .post-item .date {
  font-size: 0.95rem;
}

@media (min-width: 721px) {
  .curriculum-page,
  .contact-page {
    max-width: 1010px;
    padding: 4.75rem clamp(1.25rem, 3.5vw, 3.5rem);
  }
  .curriculum-page > .section-title,
  .contact-page > .section-title {
    font-size: 1.5rem;
  }
  .cv-hero .dim {
    font-size: 1rem;
  }
  .contact-page .contact-info p,
  .contact-page .contact-info a {
    font-size: 1rem;
  }
}
.curriculum-page .cv-block h3 {
  font-size: 1.15rem;
}

.curriculum-page .cv-block p,
.curriculum-page .cv-block li {
  font-size: 1.0625rem;
}

.cv-block {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.cv-block h2 {
  color: var(--text);
}

.cv-block h3 {
  color: var(--purple);
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
}

.dim {
  color: var(--dim);
  font-size: 0.9rem;
}

/* --- About --- */
.about-wrap {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.about-wrap img.about-dragon {
  width: 160px;
  filter: drop-shadow(0 0 20px rgba(93, 63, 211, 0.45));
}

.about-wrap p {
  color: var(--body-text);
  margin-bottom: 0.8rem;
  max-width: 640px;
}

/* ---- doc page layout — three columns ---- */
.doc-page {
  display: flex;
  flex-direction: row; /* columns resume inside the article row */
  gap: 1.75rem;
  max-width: 1320px;
  margin: 0 auto;
  padding: 3rem 4vw;
  align-items: flex-start;
  clear: both; /* defends against any floated ancestors */
}

/* CENTER: article — takes all remaining space */
.doc-page article {
  flex: 1 1 auto;
  min-width: 0; /* prevents flex overflow with long words */
  max-width: 800px; /* comfortable reading line length */
}

.toc {
  width: 200px;
  flex-shrink: 0;
  position: sticky;
  top: 80px;
  border-left: 2px solid var(--border);
  padding-left: 1.2rem;
}

.toc-title {
  font-family: "JetBrains Mono", monospace;
  color: var(--ember);
  font-size: 0.8rem;
  margin-bottom: 0.8rem;
}

.toc ul {
  list-style: none;
}

.toc a {
  display: block;
  color: var(--dim);
  text-decoration: none;
  font-size: 0.85rem;
  padding: 0.25rem 0;
}

.toc .toc-sub a {
  padding-left: 1rem;
  font-size: 0.8rem;
}

.toc a:hover, .toc a.active {
  color: var(--ember);
}

/* --- Hoard search bar --- */
.search-bar {
  position: relative;
  width: 240px;
  max-width: 100%;
  margin: 0;
  order: 2;
}

.search-toggle {
  display: none;
}

.search-panel {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--dim);
  pointer-events: none;
  transition: color 0.2s;
}

.search-input {
  width: 100%;
  padding: 0.45rem 2.6rem 0.55rem 2.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input::placeholder {
  color: var(--placeholder);
}

.search-input:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(93, 63, 211, 0.18);
}

.search-bar:focus-within .search-icon {
  color: var(--ember);
}

.search-kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.65rem;
  color: var(--dim);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.1rem 0.45rem;
  background: var(--bg);
  display: block;
}

/* --- CV hero card --- */
.cv-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem 2.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.cv-avatar {
  width: 96px;
  height: auto;
  border: none;
  border-radius: 0;
  filter: drop-shadow(0 0 18px rgba(93, 63, 211, 0.5));
}

/* --- Contact page --- */
.contact-card {
  display: flex;
  gap: 2rem;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem;
  flex-wrap: wrap;
}

.contact-dragon {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 16px;
  filter: drop-shadow(0 0 24px rgba(93, 63, 211, 0.5));
}

.contact-info h2 {
  color: var(--text);
}

.contact-info p {
  color: var(--dim);
  margin-bottom: 0.6rem;
}

.contact-info a {
  display: inline-block;
  color: var(--ember);
  text-decoration: none;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 1.1rem;
  margin-top: 0.6rem;
  margin-right: 0.6rem;
  transition: border-color 0.2s, transform 0.15s;
}

.contact-info a:hover {
  border-color: var(--ember);
  transform: translateY(-2px);
}

/* --- Post column (pulled left) --- */
.doc-page article {
  max-width: 800px;
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
  padding: 1rem 1rem 1rem 0;
}
@media (min-width: 721px) {
  .doc-page article {
    margin-inline: auto;
  }
}

.doc-page {
  margin: 0;
  padding-left: 4vw;
  padding-right: 6vw;
}

/* ---- 404 chibi page ---- */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  text-align: center;
  padding: 2rem 1rem;
}
.error-page .chibi-dragon {
  width: 200px;
  height: auto;
  margin-bottom: 1.5rem;
}
.error-page h1 {
  color: var(--text);
  margin-bottom: 0.75rem;
}
.error-page p {
  color: var(--dim);
  margin-bottom: 1.75rem;
  max-width: 420px;
}

/* ---- Wiki docs nav ---- */
.wiki-nav {
  margin-top: 3rem;
  margin-bottom: 2.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.wiki-nav ul {
  list-style: none;
  padding-left: 0;
}
.wiki-nav .toc-title {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  color: var(--dim);
  margin-bottom: 0.5rem;
}

.wiki-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wiki-nav-link {
  display: block;
  padding: 0.45rem 0.75rem;
  border-left: 2px solid var(--border);
  border-radius: 0 6px 6px 0;
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.wiki-nav-link:hover {
  color: var(--ember);
  border-left-color: var(--ember);
  background: var(--surface);
}
.wiki-nav-link.active {
  color: var(--text);
  font-weight: 600;
  border-left-color: var(--purple);
  background: rgba(93, 63, 211, 0.12);
}

/* Prev / next pager at the end of a doc page (also used by posts) */
.wiki-pager {
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.wiki-pager .wiki-pager-link {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  text-decoration: none;
  max-width: 48%;
  min-width: 0;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.15s ease;
}
.wiki-pager .wiki-pager-link:hover {
  border-color: var(--purple);
}
.wiki-pager .wiki-pager-link.next {
  text-align: right;
  margin-left: auto;
}
.wiki-pager .wiki-pager-link .wiki-pager-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  color: var(--dim);
}
.wiki-pager .wiki-pager-link .wiki-pager-title {
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* "On this page" nested under the active doc link */
.wiki-nav-list .toc-page-list {
  list-style: none;
  margin: 0.15rem 0 0.35rem;
  padding: 0 0 0 1.1rem;
  border-left: 1px solid var(--border);
  margin-left: 0.75rem;
}
.wiki-nav-list .toc-page-list .toc-item a, .wiki-nav-list .toc-page-list .toc-sub a {
  display: block;
  padding: 0.2rem 0.5rem;
  font-size: 0.82rem;
  color: var(--dim);
  text-decoration: none;
  border-radius: 4px;
}
.wiki-nav-list .toc-page-list .toc-item a:hover, .wiki-nav-list .toc-page-list .toc-sub a:hover {
  color: var(--ember);
}
.wiki-nav-list .toc-page-list .toc-item a.active, .wiki-nav-list .toc-page-list .toc-sub a.active {
  color: var(--ember);
}
.wiki-nav-list .toc-page-list .toc-sub a {
  padding-left: 1.1rem;
  font-size: 0.78rem;
}

/* ---- Project status badges ---- */
.tag.status {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border-color: var(--ember);
  color: var(--ember);
}

.tag.st-planned {
  color: var(--dim);
  border: 1px solid var(--dim);
  background: transparent;
}

.tag.st-in-progress {
  color: var(--ember);
  border: 1px solid var(--ember);
  background: rgba(255, 122, 26, 0.08);
}

.tag.st-done {
  color: var(--text);
  border: 1px solid var(--purple);
  background: rgba(93, 63, 211, 0.15);
}

/* ---- Chibi empty search state ---- */
#search-empty-block {
  display: none;
  text-align: center;
  padding: 2rem 0;
}
#search-empty-block img.chibi {
  width: 96px;
  opacity: 0.9;
  display: block;
  margin: 0 auto 0.5rem;
}
#search-empty-block p {
  font-family: "JetBrains Mono", monospace;
  color: var(--dim);
  margin: 0;
}

/* ---- Responsive ---- */
/* ---------- search result cards ---------- */
.search-result-card {
  display: block;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.search-result-card:hover {
  border-color: var(--purple);
  transform: translateY(-2px);
}

.sr-title {
  display: block;
  font-family: "JetBrains Mono", monospace;
  color: var(--text);
  margin-bottom: 0.35rem;
}
.sr-title .sr-section {
  color: var(--dim);
  font-size: 0.85em;
}

.sr-snippet {
  color: var(--dim);
  font-size: 0.9rem;
}
.sr-snippet mark {
  background: rgba(255, 122, 26, 0.25);
  color: var(--ember);
  border-radius: 3px;
  padding: 0 2px;
}

/* breathing room between search entity cards and section results */
#search-results .search-entity {
  margin-bottom: 2.5rem;
}

/* ---- download CV button ---- */
.cv-download {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--purple);
  border-radius: 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85rem;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.cv-download:hover {
  background: rgba(93, 63, 211, 0.15);
  border-color: var(--ember);
}

/* pin the CV download button to the right edge of the hero card */
.cv-hero > div {
  flex: 1;
  min-width: 0;
}
.cv-hero .cv-download {
  margin-left: auto;
}

/* ---- coming soon page ---- */
.coming-soon {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1rem;
  padding: 3rem 1.5rem;
}
.coming-soon h1 {
  font-family: "JetBrains Mono", monospace;
  font-size: 1.25rem;
  color: var(--ember);
}
.coming-soon p {
  color: var(--dim);
  max-width: 40ch;
}
.coming-soon .chibi-lg {
  width: 140px;
  height: auto;
}
.coming-soon .cs-back {
  margin-top: 0.5rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.9rem;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--purple);
  transition: color 0.15s ease;
}
.coming-soon .cs-back:hover {
  color: var(--ember);
}

/* --- Markdown images: fit column, don't blow out layout --- */
.md img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.5rem auto;
  border-radius: 8px;
  border: 1px solid var(--border);
}

/* optional: smaller class for full-window screenshots */
.md img.shot {
  width: 75%;
  max-width: 720px;
}

.doc-page h2,
.doc-page h3 {
  scroll-margin-top: 80px; /* nav height + a little padding */
}

pre {
  position: relative;
}
pre .copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.2rem 0.6rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  color: var(--dim);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease;
}
pre .copy-btn:hover {
  background: rgba(93, 63, 211, 0.25);
  color: var(--text);
}
pre:hover .copy-btn {
  opacity: 1;
}
@media (hover: none) {
  pre .copy-btn {
    opacity: 1;
  }
  pre { /* touch devices: always show */ }
}

/* ---- breadcrumbs (posts + wiki pages) ---- */
.crumb-sep {
  margin: 0 0.5rem;
}

.nav-search-results {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(420px, 90vw);
  max-height: 70vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  padding: 0.5rem;
  z-index: 20;
}

/* ---- nav search: chips + dropdown polish ---- */
.search-chips {
  position: absolute;
  top: 100%;
  left: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.4rem;
  z-index: 25;
}

.search-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(93, 63, 211, 0.18);
  color: var(--purple);
  border: 1px solid var(--purple);
  border-radius: 999px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  line-height: 1;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.search-chip:hover {
  background: rgba(255, 122, 26, 0.12);
  border-color: var(--ember);
  color: var(--ember);
}

.search-chip .chip-x {
  font-size: 0.6rem;
  opacity: 0.55;
  transition: opacity 0.15s ease;
}

.search-chip:hover .chip-x {
  opacity: 1;
}

.nav-search-results .grid { /* single-column card list, no cramped grid */
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-search-results .card {
  padding: 0.75rem 0.9rem;
  gap: 0.4rem;
}

.nav-search-results .card p {
  font-size: 0.85rem;
}

.nav-search-results .post-item {
  padding: 0.75rem 0.9rem;
}

.nav-search-results .search-empty {
  padding: 0.75rem;
}

.sr-results-head {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.4rem 0.75rem 0.5rem;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid var(--border);
}

/* ---- tag autocomplete suggestions ---- */
.tag-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
}

.tag-suggestion {
  display: inline-block;
  background: rgba(93, 63, 211, 0.12);
  color: var(--purple);
  border: 1px solid var(--purple);
  border-radius: 6px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
}

.tag-suggestion:hover {
  background: rgba(93, 63, 211, 0.25);
}

/* ---- image lightbox ---- */
#lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(10, 11, 14, 0.92);
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  padding: 2rem;
}

#lightbox-overlay.open {
  display: flex;
}

#lightbox-overlay img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}

#lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, color 0.15s ease;
  z-index: 1;
}

#lightbox-close:hover {
  border-color: var(--ember);
  color: var(--ember);
}

/* ---- responsive video embeds ---- */
.video-embed {
  position: relative;
  width: 100%;
  max-width: 720px;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  margin: 1.5rem auto;
  border-radius: 8px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

@media (min-width: 721px) {
  .nav-links > li:first-child {
    margin-left: auto;
  }
  .nav-links > li:not(.nav-theme-row) + li:not(.nav-theme-row) {
    margin-left: 0.25rem;
  }
  .nav-theme-row {
    margin-left: -0.5rem;
  }
  .nav-links a.nav-cta {
    padding: 0.4rem 0.8rem;
  }
}
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

table th,
table td {
  padding: 0.65rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

table th:last-child,
table td:last-child {
  border-right: none;
}

table tr:last-child td {
  border-bottom: none;
}

table th {
  font-weight: 600;
  color: #fff;
  background: rgba(93, 63, 211, 0.45);
  border-bottom: 1px solid var(--border);
}

table td:first-child {
  font-family: "JetBrains Mono", monospace;
  color: var(--ember);
  text-align: center;
  white-space: nowrap;
  width: 3rem;
}

table th:first-child {
  font-family: "JetBrains Mono", monospace;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  width: 3rem;
}

table tr:nth-child(even) {
  background-color: rgba(93, 63, 211, 0.05);
}

table code {
  font-size: 0.85em;
  line-height: 1.4rem;
  background: var(--code-bg);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

/* ---- Light mode: purple band sits on white, needs more opacity
       to keep white header text readable ---- */
[data-theme=light] table th {
  background: rgba(93, 63, 211, 0.85);
}

/* ================= doc subnav ================= */
.doc-subnav {
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 68px;
  z-index: 9;
  padding: 0.5rem 2rem;
  background: var(--nav-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  flex-shrink: 0;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--dim);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.sidebar-toggle:hover {
  color: var(--ember);
  background: rgba(93, 63, 211, 0.12);
}

.sidebar-toggle:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
}

.sidebar-toggle svg {
  width: 18px;
  height: 18px;
}

.crumbs {
  display: flex;
  align-items: center;
  flex-wrap: nowrap; /* ← never wrap */
  gap: 0.25rem;
  min-width: 0; /* ← lets the flex child shrink inside .doc-subnav */
  flex: 1; /* ← eats remaining bar space so it's the scroll area */
  overflow-x: auto; /* ← the scroller */
  white-space: nowrap; /* ← belt-and-suspenders on text nodes */
  scrollbar-width: none; /* Firefox: hide scrollbar, swipe/scroll only */
  -ms-overflow-style: none; /* old Edge */
  font-family: "JetBrains Mono", monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--dim);
}

.crumbs::-webkit-scrollbar {
  display: none; /* Chrome/Safari: hide the bar */
}

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

.crumbs a:hover {
  color: var(--text);
}

.crumbs > span:last-of-type {
  color: var(--text);
  font-weight: 600;
}

.crumb-sep {
  color: var(--dim);
  margin: 0 0.5rem;
  opacity: 0.5;
}

/* "In this article" button — desktop hidden, mobile visible */
.article-toc-toggle {
  display: none;
}

/* mobile-only elements parked on desktop */
.mobile-docs-nav,
.mobile-toc-panel {
  display: none;
}

/* LEFT: "In these docs" nav — sticky rail */
.doc-sidebar {
  width: 190px;
  min-width: 170px;
  max-width: 190px;
  flex: 0 1 190px;
  box-sizing: border-box;
  position: sticky;
  top: 7.5rem;
  align-self: flex-start;
  max-height: calc(100vh - 8.5rem);
  overflow-y: auto;
  border-left: 1px solid var(--border);
  padding-left: 0.75rem;
  transition: flex-basis 0.22s ease, width 0.22s ease, margin-right 0.22s ease, padding-left 0.22s ease, border-color 0.22s ease, opacity 0.22s ease, visibility 0s linear 0s;
}

/* RIGHT: "On this page" — sticky rail */
.page-toc {
  width: 170px;
  min-width: 170px;
  max-width: 170px;
  flex: 0 0 170px;
  margin-left: auto;
  flex-grow: 0;
  position: sticky;
  top: 7.5rem;
  align-self: flex-start;
  max-height: calc(100vh - 8.5rem);
  overflow-y: auto;
  border-left: 2px solid var(--border);
  padding-left: 1rem;
}

.page-toc .toc-block {
  padding-top: 1.5rem;
}

.page-toc .toc-title {
  font-family: "JetBrains Mono", monospace;
  color: var(--ember);
  font-size: 1rem;
  margin-bottom: 0.8rem;
}

.page-toc .toc-page-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.page-toc .toc-page-list .toc-item a,
.page-toc .toc-page-list .toc-sub a {
  display: block;
  color: var(--dim);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 0.25rem 0;
  transition: color 0.15s ease;
}

.page-toc .toc-page-list .toc-sub a {
  padding-left: 1rem;
  font-size: 0.875rem;
}

.page-toc .toc-page-list a:hover,
.page-toc .toc-page-list a.active {
  color: var(--ember);
}

/* ---- tables ---- */
.table-scroll {
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  -webkit-overflow-scrolling: touch;
}

.table-scroll table {
  margin: 0;
  border: none;
  border-radius: 0;
}

.table-scroll::-webkit-scrollbar {
  height: 8px;
}

.table-scroll::-webkit-scrollbar-track {
  background: var(--surface);
}

.table-scroll::-webkit-scrollbar-thumb {
  background: var(--dim);
  border-radius: 4px;
}

.table-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--ember);
}

@media (min-width: 721px) {
  .nav {
    min-height: 72px;
    padding-block: 1rem;
  }
  .brand-name,
  .nav-links a {
    font-size: 1.125rem;
  }
  .theme-toggle {
    width: 38px;
    height: 38px;
  }
  .theme-toggle svg {
    width: 18px;
    height: 18px;
  }
  .search-input {
    font-size: 1rem;
  }
  .doc-subnav {
    top: 72px;
    padding-block: 0.375rem;
  }
  .crumbs {
    font-size: 0.95rem;
  }
  .doc-page {
    display: grid;
    grid-template-columns: minmax(260px, 22%) minmax(0, 58%) minmax(240px, 20%);
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    gap: 0;
    transition: grid-template-columns 0.22s ease;
  }
  .doc-sidebar {
    width: auto;
    min-width: 0;
    max-width: none;
    flex: none;
    padding: 1.5rem 1.25rem;
    border-left: 0;
    border-right: 1px solid var(--border);
  }
  .page-toc {
    width: auto;
    min-width: 0;
    max-width: none;
    flex: none;
    padding: 1.75rem 2rem;
    border-left: 1px solid var(--border);
  }
  .doc-page article {
    width: auto;
    max-width: none;
    flex: none;
    margin-inline: 0;
    padding: 1.75rem;
    border-right: 1px solid var(--border);
  }
  html.docs-sidebar-hidden .doc-page article {
    max-width: 880px;
    margin-inline: auto;
  }
  html.docs-sidebar-hidden .doc-sidebar,
  .doc-sidebar.hidden {
    width: 0;
    min-width: 0;
    max-width: 0;
    flex-basis: 0;
    margin-right: 0;
    padding-left: 0;
    border-right-color: transparent;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: flex-basis 0.22s ease, width 0.22s ease, margin-right 0.22s ease, padding-left 0.22s ease, border-color 0.22s ease, opacity 0.22s ease, visibility 0s linear 0.22s;
  }
  html.docs-sidebar-hidden .doc-page {
    grid-template-columns: 0 minmax(0, 80%) minmax(240px, 20%);
  }
  .sidebar-toggle[aria-expanded=false] svg polyline {
    transform-box: fill-box;
    transform: rotate(180deg);
    transform-origin: center;
  }
}
/* ================= mobile ================= */
@media (max-width: 720px) {
  .hero {
    flex-direction: column-reverse;
    text-align: center;
  }
  .nav {
    justify-content: flex-start;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
  }
  .brand {
    margin-right: auto;
  }
  .nav-links {
    display: none;
  }
  .nav-actions {
    display: inline-flex;
    gap: 0.25rem;
  }
  .nav-burger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 8px;
  }
  .nav-burger {
    order: 2;
  }
  .nav-burger {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--dim);
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
  }
  .nav-burger:hover {
    color: var(--ember);
    border-color: var(--ember);
  }
  .nav-burger svg {
    width: 24px;
    height: 24px;
  }
  .search-bar {
    position: static;
    width: 44px;
    max-width: 44px;
    order: 1;
  }
  .search-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    color: var(--dim);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
  }
  .search-toggle:hover {
    color: var(--ember);
    border-color: var(--ember);
  }
  .search-toggle-icon {
    width: 24px;
    height: 24px;
  }
  .search-panel {
    display: none;
  }
  .search-bar.is-open .search-panel {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    padding: 0.75rem;
    background: var(--nav-bg);
    border-bottom: 1px solid var(--border);
    z-index: 15;
  }
  .search-bar.is-open .search-input {
    padding-right: 0.75rem;
    font-size: 0.9rem;
  }
  .search-kbd {
    display: none;
  }
  .nav-search-results {
    left: 0;
    right: auto;
    width: 100%;
  }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    margin: 0;
    padding: 0.75rem 1rem 1.25rem;
    background: var(--nav-bg);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    z-index: 14;
  }
  .nav-links.open {
    display: flex;
  }
  .nav-links a::after {
    display: none;
  }
  .nav-links a {
    display: block;
    padding: 1rem;
    font-size: 1rem;
  }
  .nav-links > li {
    order: initial;
  }
  .nav-links li:last-child:not(.nav-theme-row) {
    margin-top: 0.1rem;
    padding-top: 0.4rem;
    border-top: 1px solid var(--border);
  }
  .nav-links a.nav-cta {
    display: inline-block;
    text-align: center;
  }
  .nav-theme-row {
    align-items: center;
    justify-content: space-between;
    min-height: 52px;
    margin-top: 0.25rem;
    padding: 0.25rem 0 0 1rem;
    border-top: 1px solid var(--border);
  }
  .nav-theme-label {
    display: block;
    color: var(--text);
    font-size: 1rem;
  }
  .nav-theme-row .theme-toggle {
    width: 44px;
    height: 44px;
  }
  .nav-theme-row .theme-toggle svg {
    width: 22px;
    height: 22px;
  }
  .cta-row {
    justify-content: center;
  }
  .post-item {
    flex-direction: column;
  }
  .toc {
    display: none;
  }
  .cv-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem 1.25rem;
  }
  .cv-hero > div {
    flex: none;
    width: 100%;
  }
  .cv-hero h2 {
    font-size: 1.35rem;
  }
  .cv-hero .cv-download {
    margin-left: 0;
    width: 100%;
    justify-content: center;
  }
  .doc-subnav {
    top: 56px;
    padding: 0.5rem 1rem;
    flex-wrap: wrap;
    row-gap: 0.35rem;
  }
  /* hide desktop rails on mobile */
  .doc-sidebar {
    display: none !important;
  }
  .page-toc {
    display: none !important;
  }
  /* hamburger button replaces the toggle icon */
  .sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    flex-shrink: 0;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--dim);
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
  }
  .sidebar-toggle:hover {
    color: var(--ember);
    background: rgba(93, 63, 211, 0.12);
  }
  .sidebar-toggle svg {
    width: 22px;
    height: 22px;
    stroke-width: 2.5;
  }
  /* "In this article" button — second row, full-width */
  .article-toc-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.4rem 0.85rem;
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.9rem;
    cursor: pointer;
    max-height: 44px;
    overflow: hidden;
  }
  .article-toc-toggle svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-left: 0.5rem;
    transition: transform 0.2s ease;
  }
  .article-toc-toggle[aria-expanded=true] svg {
    transform: rotate(180deg);
  }
  /* ==== dropdown overlays from the top ==== */
  /* docs drawer — drops under the subnav */
  .mobile-docs-nav {
    position: fixed;
    top: 104px; /* 56px nav + 44px subnav + 4px cushion */
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
    padding: 1rem 1rem 1.5rem;
    z-index: 40;
    animation: slideDown 0.2s ease;
  }
  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-8px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  .mobile-docs-nav .wiki-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
  }
  .mobile-docs-nav .wiki-nav-list a {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    color: var(--dim);
    text-decoration: none;
    border-left: 2px solid var(--border);
    margin-bottom: 0.25rem;
    border-radius: 0 6px 6px 0;
  }
  .mobile-docs-nav .wiki-nav-list a.active,
  .mobile-docs-nav .wiki-nav-list a:hover {
    color: var(--ember);
    border-left-color: var(--ember);
    background: rgba(93, 63, 211, 0.12);
  }
  /* "In this article" dropdown — same anchoring */
  .mobile-toc-panel {
    position: fixed;
    top: 104px;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
    padding: 1rem 1rem 1.5rem;
    z-index: 40;
    animation: slideDown 0.2s ease;
  }
  .mobile-toc-panel .toc-page-list {
    list-style: none;
    margin: 0;
    padding: 0;
  }
  .mobile-toc-panel .toc-item a,
  .mobile-toc-panel .toc-sub a {
    display: block;
    padding: 0.5rem 0;
    font-size: 1rem;
    color: var(--dim);
    text-decoration: none;
    border-left: 2px solid var(--border);
    padding-left: 1rem;
    margin-bottom: 0.25rem;
  }
  .mobile-toc-panel .toc-sub a {
    padding-left: 1.5rem;
    font-size: 0.9rem;
  }
  .mobile-toc-panel a:hover,
  .mobile-toc-panel a.active {
    color: var(--ember);
    border-left-color: var(--ember);
  }
  /* [hidden] must always win */
  .mobile-docs-nav[hidden],
  .mobile-toc-panel[hidden] {
    display: none !important;
  }
  /* mobile: drawers visible when JS removes [hidden] */
  .mobile-docs-nav:not([hidden]),
  .mobile-toc-panel:not([hidden]) {
    display: block !important;
  }
}
@media (min-width: 721px) {
  .cv-hero {
    padding-block: 2rem;
  }
  .cv-avatar {
    width: 96px;
  }
  .curriculum-page .cv-download {
    padding: 0.75rem 1.2rem;
    font-size: 0.9rem;
  }
  .contact-dragon {
    width: 140px;
    height: 140px;
  }
}

/*# sourceMappingURL=main.css.map */