/* Defining the main dark theme variables */
.theme-dark,
.published-container.theme-dark {
  --background-primary: #0b0b12;
  --background-primary-alt: #11111c;
  --background-secondary: #141421;
  --background-secondary-alt: #1a1a2b;

  --text-normal: #e7e4f2;
  --text-muted: #aaa3c2;
  --text-faint: #746d8a;

  --text-accent: #b48cff;
  --text-accent-hover: #d6c2ff;

  --interactive-accent: #8f5cff;
  --interactive-accent-hover: #a875ff;

  --background-modifier-border: rgba(180, 140, 255, 0.18);
  --background-modifier-hover: rgba(180, 140, 255, 0.08);
  --text-selection: rgba(180, 140, 255, 0.28);

  --h1-color: #f2ecff;
  --h2-color: #d8c3ff;
  --h3-color: #bda2ff;

  --code-background: rgba(19, 19, 31, 0.92);
  --code-normal: #d8d1ff;

  --page-width: 860px;
  --page-side-padding: 42px;
}

/* Setting the site-wide feel */
body {
  background: #0b0b12;
  color: var(--text-normal);
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
}

/* Creating a slow animated nebula background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 18%, rgba(143, 92, 255, 0.23), transparent 28%),
    radial-gradient(circle at 82% 22%, rgba(71, 181, 255, 0.13), transparent 26%),
    radial-gradient(circle at 50% 82%, rgba(191, 83, 255, 0.12), transparent 34%),
    linear-gradient(135deg, #07070c 0%, #0b0b12 45%, #12111d 100%);
  background-size: 140% 140%;
  animation: driftingNebula 18s ease-in-out infinite alternate;
}

/* Adding a subtle grid texture without making it loud */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.16;
  background-image:
    linear-gradient(rgba(180, 140, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(180, 140, 255, 0.08) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at center, black, transparent 78%);
}

/* Moving the background very slowly */
@keyframes driftingNebula {
  from {
    background-position: 0% 0%;
  }

  to {
    background-position: 100% 100%;
  }
}

/* Respecting users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  body::before {
    animation: none;
  }

  * {
    scroll-behavior: auto !important;
  }
}

/* Making the main reading pane feel like frosted charcoal glass */
.markdown-preview-view,
.markdown-rendered,
.publish-renderer {
  background: rgba(11, 11, 18, 0.72);
}

/* Styling note content as a calm readable card */
.markdown-preview-sizer,
.markdown-rendered .markdown-preview-sizer {
  backdrop-filter: blur(10px);
}

/* Making headings feel more premium */
.markdown-rendered h1,
.markdown-rendered h2,
.markdown-rendered h3 {
  letter-spacing: -0.03em;
  text-shadow: 0 0 24px rgba(180, 140, 255, 0.22);
}

/* Creating a glowing title treatment */
.markdown-rendered h1 {
  font-size: 2.35rem;
  border-bottom: 1px solid rgba(180, 140, 255, 0.22);
  padding-bottom: 0.35em;
}

/* Making links feel reactive without using JavaScript */
.markdown-rendered a {
  color: var(--text-accent);
  text-decoration: none;
  background-image: linear-gradient(90deg, #8f5cff, #47b5ff);
  background-size: 0% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition:
    color 180ms ease,
    background-size 220ms ease,
    text-shadow 220ms ease;
}

/* Animating links on hover */
.markdown-rendered a:hover {
  color: var(--text-accent-hover);
  background-size: 100% 1px;
  text-shadow: 0 0 14px rgba(180, 140, 255, 0.55);
}

/* Giving callouts a glassy neon-card style */
.callout {
  border: 1px solid rgba(var(--callout-color), 0.35);
  border-left: 4px solid rgb(var(--callout-color));
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(var(--callout-color), 0.12), rgba(255, 255, 255, 0.025));
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* Styling inline code */
.markdown-rendered code {
  border: 1px solid rgba(180, 140, 255, 0.18);
  border-radius: 7px;
  padding: 0.12em 0.35em;
  background: rgba(20, 20, 33, 0.9);
  color: #d8d1ff;
}

/* Styling code blocks */
.markdown-rendered pre {
  border: 1px solid rgba(180, 140, 255, 0.18);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(20, 20, 33, 0.96), rgba(10, 10, 18, 0.96));
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.32);
}

/* Making blockquotes feel like lore notes */
.markdown-rendered blockquote {
  border-left: 3px solid #8f5cff;
  border-radius: 0 12px 12px 0;
  background: rgba(143, 92, 255, 0.08);
  color: var(--text-muted);
}

/* Styling tables so they do not look default */
.markdown-rendered table {
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid rgba(180, 140, 255, 0.16);
  border-radius: 14px;
}

/* Highlighting table headers */
.markdown-rendered th {
  background: rgba(143, 92, 255, 0.16);
  color: #efe8ff;
}

/* Softening table cells */
.markdown-rendered td,
.markdown-rendered th {
  border-color: rgba(180, 140, 255, 0.12);
}

/* Making tags look like small violet capsules */
.tag {
  border: 1px solid rgba(180, 140, 255, 0.25);
  border-radius: 999px;
  padding: 0.12em 0.55em;
  background: rgba(143, 92, 255, 0.12);
  color: #d8c3ff;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

/* Adding tiny hover movement to tags */
.tag:hover {
  background: rgba(143, 92, 255, 0.2);
  border-color: rgba(180, 140, 255, 0.45);
  transform: translateY(-1px);
}

/* Making sidebars/header feel integrated with the theme */
.site-header,
.site-body-left-column,
.site-body-right-column {
  background: rgba(11, 11, 18, 0.68);
  backdrop-filter: blur(14px);
  border-color: rgba(180, 140, 255, 0.14);
}

/* Styling navigation hover states */
.nav-view-outer .tree-item-self:hover,
.site-body-left-column a:hover,
.site-body-right-column a:hover {
  background: rgba(143, 92, 255, 0.1);
  color: #d8c3ff;
}

/* Making horizontal rules look like a glow line */
.markdown-rendered hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(180, 140, 255, 0.5), transparent);
}