/* ============================================================
   CUSTOM COSMIC PALETTE
   ============================================================ */
[data-md-color-scheme="cosmic"] {
  --md-primary-fg-color:        #7b5cff;
  --md-primary-fg-color--light: #b39bff;
  --md-primary-fg-color--dark:  #4b34b5;
  --md-default-fg-color--lightest: rgba(255, 255, 255, 0.15);

  --md-accent-fg-color:         #a67cff;
  --md-accent-fg-color--light:  #d0b9ff;
  --md-accent-fg-color--dark:   #6f4bb4;

  --md-default-bg-color:        rgba(15, 13, 26, 0.90);
  --md-typeset-color:           #d3cfe9;
  --md-default-fg-color:        #d3cfe9;
  --md-default-fg-color--light: #d3cfe9;

  --md-admonition-fg-color:     #d3cfe9;
  --md-admonition-bg-color:     rgba(15, 13, 26, 0.90);

  --md-mermaid-label-fg-color:  var(--md-default-fg-color);
  --md-mermaid-node-bg-color:   var(--md-accent-fg-color--dark);
  --md-mermaid-edge-color:      var(--md-default-fg-color);

}


/* ============================================================
   BACKGROUND
   ============================================================ */
#tsparticles {
  position: fixed;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: #000;
}


/* ============================================================
   HEADER
   ============================================================ */


@media (min-width: 76.1875em) {
  .md-header {
    background: rgba(122, 92, 255, 0.10) !important;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }
}

@media (max-width: 76.1875em) {
  .md-header {
    background: rgba(11, 10, 25, 0.95) !important;
    backdrop-filter: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }
}


/* ============================================================
   SIDEBAR
   ============================================================ */
.md-sidebar__scrollwrap {
  background: transparent !important;
}

.md-nav--primary .md-nav__title {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;

  color: #bfb6ff !important;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  opacity: 0.75;
  margin-top: 1rem;
  margin-bottom: 0.35rem;
  padding: 0 0.25rem;
}


/* ============================================================
   MAIN CONTENT PANEL
   ============================================================ */
@media (min-width: 76.1875em) {
  .md-main__inner {
    background: rgba(15, 13, 26, 0.70);
    backdrop-filter: blur(6px);
    border-radius: 18px;
    padding: 2rem;
    margin-top: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.55);
  }
}

@media (max-width: 76.1875em) {
  .md-main__inner {
    background: rgba(15, 13, 26, 0.85);
    backdrop-filter: none;
    border-radius: 0;
    padding: 2rem;
    margin-top: 0;
    margin-bottom: 0;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.55);
  }
}

.md-grid {
  max-width: 1700px;
}

.md-typeset {
  color: #d3cfe9 !important;
}


/* ============================================================
   HEADINGS
   ============================================================ */
.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset h4,
.md-typeset h5,
.md-typeset h6 {
  color: #d3cfe9 !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em;
}

.md-typeset h1 {
  font-size: 2.0rem !important;
  text-shadow: 0 0 12px rgba(123, 92, 255, 0.25);
}

.md-typeset h2 {
  font-size: 1.6rem !important;
  border-bottom: 1px solid rgba(164, 140, 255, 0.15);
  padding-bottom: 0.3rem;
  margin-top: 0.2rem !important;
}

.md-typeset h3 { font-size: 1.25rem !important; }
.md-typeset h4 { font-size: 1.1rem !important; opacity: 0.9; }
.md-typeset h5 { font-size: 1.0rem !important; opacity: 0.8; }
.md-typeset h6 { font-size: 0.9rem !important; opacity: 0.7; }


/* ============================================================
   GLOBAL LINKS
   ============================================================ */
a,
.md-nav__link,
.md-tabs__link,
.md-footer .md-social__link {
  color: #aa9dff !important;
  transition: color 0.18s ease-out,
              background 0.18s ease-out,
              box-shadow 0.18s ease-out,
              text-shadow 0.18s ease-out,
              transform 0.18s ease-out;
}

a:hover,
.md-nav__link:hover,
.md-tabs__link:hover,
.md-footer .md-social__link:hover {
  color: #f5f0ff !important;
  text-shadow: 0 0 6px rgba(123, 92, 255, 0.6);
}

.md-typeset a:hover {
  color: #f5ecff !important;
  text-decoration: underline;
}


/* ============================================================
   SIDEBAR LINKS
   ============================================================ */
.md-nav__item .md-nav__link {
  padding: 0.25rem 0.75rem;
  margin-inline: -0.25rem;
  margin: 2px 0;
  border-radius: 4px;
  position: relative;
  background: transparent;
  color: inherit;
  transition:
    color 0.16s ease-out,
    background 0.16s ease-out;
}

.md-nav__item .md-nav__link::before {
  content: "";
  position: absolute;
  left: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 0%;
  background: transparent;
  border-radius: 999px;
  transition:
    height 0.2s ease-out,
    background 0.2s ease-out,
    box-shadow 0.2s ease-out;
}

.md-nav__item .md-nav__link:hover {
  color: var(--md-accent-fg-color);
  background: rgba(255, 255, 255, 0.015);
}

.md-nav__item .md-nav__link:hover::before {
  height: 60%;
  background: var(--md-accent-fg-color);
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.45);
}

.md-nav__link--active,
.md-nav__item--active > .md-nav__link {
  color: var(--md-primary-fg-color);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.04);
}

.md-nav__link--active::before,
.md-nav__item--active > .md-nav__link::before {
  height: 70%;
  background: var(--md-primary-fg-color);
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.55);
}

.md-nav__item > label.md-nav__link:hover {
  background: transparent !important;
  color: var(--md-accent-fg-color);
}

.md-nav__item--active > label.md-nav__link {
  background: transparent !important;
  font-weight: 700;
  color: var(--md-default-fg-color) !important;
  box-shadow: none !important;
}

.md-nav__item > label.md-nav__link::before {
  display: none !important;
}

/* ============================================================
   RIGHT-SIDE TOC
   ============================================================ */
.md-nav__title {
    background: transparent !important;
    box-shadow: none !important;
   }

.md-nav--secondary .md-nav__link {
  color: var(--md-default-fg-color--light);
  padding: 0.25rem 0.75rem;
  margin-inline: -0.25rem;
  border-radius: 4px;
}

.md-nav--secondary .md-nav__link:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--md-accent-fg-color);
}


/* ============================================================
   MOBILE NAVBAR
   ============================================================ */
.md-overlay {
  background: transparent !important;
  background-color: transparent !important;
  pointer-events: none !important;
  z-index: 1 !important;
}

.md-sidebar--primary .md-nav__list,
.md-sidebar--primary .md-nav__item,
.md-sidebar--primary .md-nav__link,
.md-sidebar--primary .md-nav__title {
  border: none !important;
  box-shadow: none !important;
}

.md-sidebar--primary .md-nav__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-inline: 0.75rem;
}

.md-sidebar--primary .md-nav__title .md-nav__icon,
.md-sidebar--primary .md-nav__title .md-logo {
  flex-shrink: 0;
  margin: 0;
  position: unset !important;
}

.md-sidebar--primary .md-nav__title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


/* ============================================================
   TABS
   ============================================================ */
.md-tabs {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.md-tabs__item--active > .md-tabs__link {
  color: #ffffff !important;
  font-weight: 600;
  background: rgba(123, 92, 255, 0.25) !important;
  border-radius: 6px;
}

.md-tabs__link:hover {
  background: rgba(123, 92, 255, 0.15) !important;
}


/* ============================================================
   BUTTONS
   ============================================================ */
.md-button {
  border-radius: 30px !important;
  padding: 0.55rem 1.8rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: 0.18s ease-out;
}

.md-button--primary {
  background: #a48cff !important;
  color: #05040b !important;
  border: none !important;
  box-shadow: 0 0 10px rgba(151,130,255,0.55);
}

.md-button--primary:hover {
  background: #b29aff !important;
  box-shadow: 0 0 10px rgba(173,148,255,0.7);
  transform: translateY(-1px);
  text-decoration: none !important;
}

.md-button--primary:active {
  background: #9a82ff !important;
  box-shadow: 0 0 10px rgba(120,96,219,0.6);
  transform: translateY(0);
}

.md-button:not(.md-button--primary) {
  background: transparent !important;
  color: #c4a3ff !important;
  border: 1px solid rgba(196,163,255,0.5);
}

.md-button:not(.md-button--primary):hover {
  background: transparent !important;
  border: 1px solid rgba(196,163,255,0.5);
  transform: translateY(-1px);
  text-decoration: none !important;
}


/* ============================================================
   FOOTER
   ============================================================ */
.md-footer {
  background: rgba(5, 4, 12, 0.65) !important;
  backdrop-filter: blur(8px);
  border-top: 1px solid rgba(123, 92, 255, 0.05);
}

.md-footer-meta {
  background: transparent !important;
}

.md-footer .md-social__link:hover {
  text-shadow: 0 0 10px #7b5cff;
}


/* ============================================================
   REMOVE CONTENT NAV BACKGROUNDS
   ============================================================ */
.md-content .md-nav,
.md-content .md-nav__item,
.md-content .md-nav__title,
.md-content .md-nav__link {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
}


/* ============================================================
   COSMIC SCROLLBAR
   ============================================================ */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-thumb {
  background: rgba(164, 140, 255, 0.38);
  border-radius: 10px;
  transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(164, 140, 255, 0.65);
}


/* ============================================================
   EXTRAS
   ============================================================ */
html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

@keyframes cv-page-fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cv-reveal {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 320ms ease-out,
    transform 320ms ease-out;
  transition-delay: var(--cv-reveal-delay, 0ms);
}

.cv-reveal.cv-reveal-visible {
  opacity: 1;
  transform: translateY(0);
}

.md-typeset hr {
  border: none;
  height: 1px;
  margin: 2.2rem 0;
  background: linear-gradient(
    to right,
    rgba(10, 8, 20, 0),
    rgba(164, 140, 255, 0.5),
    rgba(10, 8, 20, 0)
  );
  box-shadow: 0 0 12px rgba(123, 92, 255, 0.35);
}


/* ============================================================
   HOMEPAGE HERO
   ============================================================ */
.cs-hero {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  margin-bottom: 1.1rem;
  min-height: 260px;
  display: flex;
  align-items: stretch;
}

.cs-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      circle at 20% 20%,
      rgba(123, 92, 255, 0.65),
      transparent 55%
    ),
    linear-gradient(
      to bottom right,
      rgba(5, 4, 12, 0.85),
      rgba(5, 4, 12, 0.98)
    );
}

.cs-hero__content {
  position: relative;
  z-index: 1;
  padding: 2.4rem 2.6rem;
  max-width: 720px;
}

@media (max-width: 768px) {
  .cs-hero__content {
    padding: 1.8rem 1.4rem;
  }
}

.cs-hero__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  opacity: 0.85;
  margin: 0 0 0.6rem 0;
  color: #d3c9ff;
}

.cs-hero__content h1 {
  margin: 0 0 0.7rem 0;
}

.cs-hero__subtitle {
  margin: 0 0 1.3rem 0;
  max-width: 40rem;
  color: #e7e1ff;
}

.cs-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.8rem;
}

.cs-hero__meta {
  font-size: 0.85rem;
  opacity: 0.8;
}


/* ============================================================
   SECTIONS
   ============================================================ */
.cs-section {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 2.2rem;
  align-items: stretch;
  margin-bottom: 2.4rem;
}

.cs-section--alt {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
}

.cs-section--faq {
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
}

@media (max-width: 900px) {
  .cs-section,
  .cs-section--alt,
  .cs-section--faq {
    grid-template-columns: minmax(0, 1fr);
  }
}

.cs-section__col--text p {
  margin-bottom: 0.6rem;
}

.cs-section__links {
  margin-top: 0.4rem;
  font-size: 0.9rem;
  opacity: 0.9;
}

.cs-section__links a {
  color: #c4a3ff !important;
}

/* ============================================================
   CARDS
   ============================================================ */
.cs-card {
  height: 100%;
  border-radius: 14px;
  padding: 1.3rem 1.4rem;
  background: linear-gradient(
    145deg,
    rgba(22, 20, 33, 0.82),
    rgba(12, 10, 20, 0.92)
  );
  border: 1px solid rgba(164, 140, 255, 0.02);
  backdrop-filter: blur(6px);
}

.cs-card--compact {
  padding: 1.1rem 1.2rem;
}

.cs-card h3 {
  margin-top: 0;
  margin-bottom: 0.6rem;
}

.cs-card ul {
  margin: 0.3rem 0 0 1.1rem;
}

/* ============================================================
   UPDATE BAR
   ============================================================ */
.cs-update-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.6rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  background: radial-gradient(circle at left,
              rgba(123, 92, 255, 0.45),
              rgba(5, 4, 12, 0.95));
  box-shadow: 0 0 18px rgba(0, 0, 0, 0.65);
  font-size: 0.82rem;
}

.cs-update-strip__left {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem;
}

.cs-update-strip__label {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.7rem;
  opacity: 0.85;
  color: #e8e1ff;
}

.cs-update-strip__text strong {
  color: #ffffff;
}

.cs-update-strip__right {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.cs-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  border: 1.5px solid transparent;
  background:
    linear-gradient(rgba(10, 8, 20, 0.90), rgba(10, 8, 20, 0.90)) padding-box,
    var(--tag-border) border-box;
}

.cs-tag--zen {
  --tag-border: linear-gradient(135deg, #5cff8b, #00d5ff);
  color: #e6fff4; /* soft minty-white text */
}

.cs-tag--vision {
  --tag-border: linear-gradient(135deg, #4567fd, #e3d5fd);
  color: #f4ecff; /* soft cosmic-lavender text */
}

@media (max-width: 720px) {
  .cs-update-strip {
    flex-direction: column;
    align-items: flex-start;
    border-radius: 14px;
  }
}


/* ============================================================
   QUICK LINKS BAR
   ============================================================ */
.cs-quicklinks-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin: 0.3rem 0 2.4rem 0;
  padding: 0.85rem 1.0rem;
  border-radius: 20px;
  background:
    radial-gradient(
      circle at -15% 0%,
      rgba(123, 92, 255, 0.55),
      transparent 55%
    ),
    radial-gradient(
      circle at 115% 100%,
      rgba(70, 50, 140, 0.35),
      transparent 65%
    ),
    linear-gradient(
      130deg,
      rgba(5, 4, 12, 0.92),
      rgba(5, 4, 12, 0.99)
    );
  font-size: 0.85rem;
}

.cs-quicklinks-bar__left {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem;
}

.cs-quicklinks-bar__label {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.7rem;
  opacity: 0.85;
  color: #e8e1ff;
}

.cs-quicklinks-bar__text {
  opacity: 0.9;
  color: #f0ecff;
}

.cs-quicklinks-bar__right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
}

.cs-quicklinks-bar__right a {
  color: #d0c5ff !important;
  text-decoration: none;
  transition: color 0.18s ease-out, text-shadow 0.18s ease-out;
}

.cs-quicklinks-bar__right a:hover {
  color: #ffffff !important;
  text-shadow: 0 0 6px rgba(123, 92, 255, 0.65);
}

.cs-quicklinks-sep {
  opacity: 0.5;
  color: #c4b6ff;
}

@media (max-width: 720px) {
  .cs-quicklinks-bar {
    flex-direction: column;
    align-items: flex-start;
    border-radius: 14px;
  }

  .cs-quicklinks-bar__right {
    gap: 0.6rem;
  }
}


/* ============================================================
   SCRIPTS PAGE
   ============================================================ */
.cs-scripts-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

.cs-script-card {
  display: block;
  padding: 1.1rem 1.3rem;
  border-radius: 14px;
  background: rgba(10, 8, 20, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-decoration: none;
  color: inherit;
  transition:
    transform 0.12s ease-out,
    box-shadow 0.12s ease-out,
    border-color 0.12s ease-out,
    background 0.12s ease-out;
}

.cs-script-card:hover {
  transform: translateY(-1px);
  background: rgba(16, 13, 30, 0.95);
  border-color: rgba(124, 119, 255, 0.7);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
  text-decoration: none !important;
}

.cs-script-card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.3rem;
}

.cs-script-card h2 {
  font-size: 1.2rem;
  margin: 0;
}

.cs-script-card__tag {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.7;
}

.cs-script-card p {
  margin: 0.1rem 0;
}

.cs-script-card__meta {
  margin-top: 0.45rem;
  font-size: 0.85rem;
  opacity: 0.8;
}