:root {
  --md-primary-fg-color: #00ace1;
  --md-primary-fg-color--light: #33bde7;
  --md-primary-fg-color--dark: #0090bd;
  --md-accent-fg-color: #00ace1;
}

/* Light scheme: darken accent/links for readable contrast on white. */
[data-md-color-scheme="default"] {
  --md-accent-fg-color: #0090bd;
  --md-typeset-a-color: #0087b0;
}

/* Dark scheme: pure-black surfaces with the bright cyan brand accent. */
[data-md-color-scheme="slate"] {
  --md-default-bg-color: #000000;
  --md-default-bg-color--light: #0a0a0a;
  --md-default-bg-color--lighter: #121212;
  --md-default-bg-color--lightest: #1a1a1a;
  --md-accent-fg-color: #33bde7;
  --md-typeset-a-color: #33bde7;
}

/* ---------------------------------------------------------------------------
   Landing page (docs/index.md)
   The logo art sits on a near-black background, so the hero uses a dark band
   in both light and dark themes to let the logo blend seamlessly.
   --------------------------------------------------------------------------- */

.hero,
.hero-cta {
  text-align: center;
  border-radius: 1rem;
  background:
    radial-gradient(120% 140% at 50% 0%, rgba(0, 172, 225, 0.22), transparent 60%),
    linear-gradient(180deg, #05070a 0%, #0a0f14 100%);
  border: 1px solid rgba(0, 172, 225, 0.18);
  box-shadow: 0 24px 60px -30px rgba(0, 172, 225, 0.45);
}

.hero {
  padding: 3rem 1.5rem 2.5rem;
  margin: 0 0 2.5rem;
}

.hero-cta {
  padding: 2.25rem 1.5rem;
  margin: 3rem 0 0;
}

/* Logo + ASCII character smoke rising from the mark. */
.hero-logo-wrap {
  position: relative;
  width: 128px;
  max-width: 40vw;
  margin: 0.25rem auto 0.35rem;
  /* Reserve just enough room for the plume; the rest overlaps the logo. */
  padding-top: 2.25rem;
  overflow: visible;
  animation: hero-enter 0.9s ease-out both;
}

.hero-logo {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  /* Reserve the square before the PNG arrives; without this the hero
     collapses and everything below it jumps down on first load. */
  aspect-ratio: 1 / 1;
  /* Brighter, punchier mark with a stronger cyan bloom. */
  filter: brightness(1.12) saturate(1.1)
    drop-shadow(0 0 10px rgba(0, 172, 225, 0.55))
    drop-shadow(0 8px 26px rgba(0, 172, 225, 0.45));
  animation: hero-glow-breathe 5.5s ease-in-out infinite;
}

/* Div (not pre) so Material's .md-typeset pre rules cannot break layout. */
.md-typeset .hero-smoke-ascii,
.hero .hero-smoke-ascii {
  position: absolute;
  left: 50%;
  /* Rises into the hero's own top padding, so a taller plume costs no
     extra layout height. */
  top: -2rem;
  /* max-content (not Nch) so letter-spacing is included in the width;
     otherwise the row overflows right and the plume sits off-centre. */
  width: max-content;
  /* Exactly the rendered rows, so no dead space above the plume. */
  height: 13.2em;
  margin: 0;
  padding: 0;
  transform: translateX(-50%);
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
  background: transparent;
  border: 0;
  box-shadow: none;
  color: rgba(130, 212, 236, 0.62);
  font-family: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas,
    monospace;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0.08em;
  text-align: left;
  text-shadow: 0 0 7px rgba(0, 172, 225, 0.38);
  white-space: pre;
  user-select: none;
  /* landing.js fades this in once the first frame is rendered. */
  opacity: 0;
  transition: opacity 700ms ease;
  /* Dissolve the plume as it rises instead of clipping at the box edge. */
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0, 0, 0, 0.45) 22%,
    #000 55%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0, 0, 0, 0.45) 22%,
    #000 55%
  );
}

@keyframes hero-glow-breathe {
  0%,
  100% {
    filter: brightness(1.12) saturate(1.1)
      drop-shadow(0 0 10px rgba(0, 172, 225, 0.5))
      drop-shadow(0 8px 26px rgba(0, 172, 225, 0.4));
  }
  50% {
    filter: brightness(1.18) saturate(1.15)
      drop-shadow(0 0 18px rgba(0, 172, 225, 0.75))
      drop-shadow(0 10px 32px rgba(0, 172, 225, 0.55));
  }
}

@keyframes hero-enter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Clean typographic wordmark, replacing the baked-in logo text. */
.hero .hero-wordmark {
  max-width: none !important;
  margin: 0 auto 0.85rem !important;
  color: #eaf6fb;
  font-size: 2.9rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  text-shadow: 0 2px 18px rgba(0, 172, 225, 0.25);
  animation: hero-enter 0.9s ease-out 0.12s both;
}

@media (max-width: 44.9375em) {
  .hero-logo-wrap {
    padding-top: 2rem;
  }

  .md-typeset .hero-smoke-ascii,
  .hero .hero-smoke-ascii {
    font-size: 10px;
    top: -1.75rem;
    height: 13.2em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-logo-wrap,
  .hero .hero-wordmark {
    animation: none;
  }

  .hero-logo {
    animation: none;
  }

  .md-typeset .hero-smoke-ascii,
  .hero .hero-smoke-ascii {
    display: none;
  }
}

.hero h1,
.hero-cta h2 {
  color: #eaf6fb;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0.2rem 0 0.75rem;
}

.hero h1 {
  font-size: 2.4rem;
  line-height: 1.1;
}

.hero > p {
  color: #b7c6d0;
  max-width: 42rem;
  margin: 0 auto 1.25rem;
  font-size: 0.95rem;
}

/* Center and constrain the install command inside the hero bands. */
.hero .highlight,
.hero-cta .highlight {
  max-width: 22rem;
  margin: 1.25rem auto;
  text-align: left;
}

/* Button row spacing on the landing. */
.hero .md-button,
.hero-cta .md-button {
  margin: 0.35rem 0.3rem 0;
}

/* Credibility badges under the hero buttons. */
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  max-width: none !important;
  margin: 1.5rem auto 0 !important;
}

.hero-badges img {
  height: 20px;
}

/* One-line value / capability strip between hero and cards. */
.md-typeset .value-strip {
  text-align: center;
  color: var(--md-default-fg-color--light);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin: 0 0 2.5rem;
}

.md-typeset .value-strip .twemoji {
  color: var(--md-accent-fg-color);
  vertical-align: -0.15em;
  margin-right: 0.15rem;
}

/* Feature cards: equal height, subtle lift, and an arrow that nudges. */
.md-typeset .grid.cards > ul {
  grid-auto-rows: 1fr;
}

.md-typeset .grid.cards > ul > li {
  transition: border-color 125ms, box-shadow 125ms, transform 125ms;
}

.md-typeset .grid.cards > ul > li:hover {
  border-color: var(--md-accent-fg-color);
  box-shadow: 0 14px 34px -20px rgba(0, 172, 225, 0.55);
  transform: translateY(-2px);
}

.md-typeset .grid.cards > ul > li a .twemoji {
  transition: transform 125ms ease;
}

.md-typeset .grid.cards > ul > li:hover a .twemoji {
  transform: translateX(3px);
}

/* Landing screenshot as a product shot with faux window chrome. */
.md-typeset figure.shot {
  margin: 0 0 1.5rem;
  width: 100%;
}

.shot-frame {
  display: block;
  width: 100%;
  max-width: none;
  margin: 0;
  border: 1px solid rgba(0, 172, 225, 0.25);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 26px 60px -30px rgba(0, 0, 0, 0.85);
}

.shot-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.7rem;
  background: #0b0f14;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.shot-bar > span {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: #39424c;
}

.shot-bar > span:nth-child(1) { background: #ff5f57; }
.shot-bar > span:nth-child(2) { background: #febc2e; }
.shot-bar > span:nth-child(3) { background: #28c840; }

.landing-shot {
  display: block;
  width: 100%;
  height: auto;
  /* Matches the mp4 (1280×1416); wrong AR letterboxes inside the chrome. */
  aspect-ratio: 1280 / 1416;
  object-fit: cover;
  vertical-align: top;
}

/* ---------------------------------------------------------------------------
   Header chrome. No top tabs — peer pages live in the left sidebar.
   Dark mode: simple black banner (landing uses glass until scroll).
   Light mode: brand primary (landing included — dark glass muddies on white).
   `landing-home` / `landing-scrolled` sit on <html>: overrides/main.html sets
   the first one before paint so the banner never flashes, and landing.js keeps
   both current across instant navigation. The colour scheme attribute is on
   <body>, hence the html-then-body descendant chain below.
   --------------------------------------------------------------------------- */

[data-md-color-scheme="slate"] .md-header {
  background-color: #000000;
  box-shadow: none;
}

.landing-home [data-md-color-scheme="slate"] .md-header {
  background-color: rgba(5, 7, 10, 0.55);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: none;
  transition: background-color 250ms ease, box-shadow 250ms ease;
}

.landing-home.landing-scrolled [data-md-color-scheme="slate"] .md-header {
  background-color: #000000;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.landing-home [data-md-color-scheme="default"] .md-header {
  background-color: var(--md-primary-fg-color);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: 0 0 0.2rem rgba(0, 0, 0, 0.1), 0 0.2rem 0.4rem rgba(0, 0, 0, 0.2);
}

/* Primary left nav: make the active page obvious in both schemes. */
.md-nav--primary .md-nav__link--active {
  color: var(--md-accent-fg-color);
  font-weight: 700;
  border-left: 3px solid var(--md-primary-fg-color);
  padding-left: 0.6rem;
  margin-left: -3px;
  background-color: color-mix(in srgb, var(--md-primary-fg-color) 12%, transparent);
  border-radius: 0 0.2rem 0.2rem 0;
}

/* Render the brand mark as a crisp white silhouette (via brightness/invert)
   so it reads cleanly on the black or brand header, and give it a bit more
   presence than the default logo size. */
.md-header__button.md-logo img {
  height: 1.7rem;
  width: auto;
  filter: brightness(0) invert(1) drop-shadow(0 1px 1px rgba(0, 0, 0, 0.25));
}

/* ---------------------------------------------------------------------------
   Community Plugins page (docs/community.md) — "app store" card grid.
   Rendered client-side by javascripts/community.js.
   --------------------------------------------------------------------------- */

.plugin-store > h1 {
  display: none; /* page title lives in the hero band instead */
}

.store-hero {
  text-align: center;
  border-radius: 1rem;
  padding: 2.5rem 1.5rem 2rem;
  margin: 0 0 1.75rem;
  background:
    radial-gradient(120% 140% at 50% 0%, rgba(0, 172, 225, 0.22), transparent 60%),
    linear-gradient(180deg, #05070a 0%, #0a0f14 100%);
  border: 1px solid rgba(0, 172, 225, 0.18);
  box-shadow: 0 24px 60px -30px rgba(0, 172, 225, 0.45);
}

.md-typeset .store-hero h2 {
  color: #eaf6fb;
  font-weight: 800;
  font-size: 2rem;
  letter-spacing: -0.01em;
  margin: 0 0 0.75rem;
}

.store-hero > p {
  color: #b7c6d0;
  max-width: 42rem;
  margin: 0 auto 1.25rem;
  font-size: 0.85rem;
}

.store-hero a:not(.md-button) {
  color: #5fd0f3;
}

.store-hero .md-button {
  margin: 0.35rem 0.3rem 0;
}

.store-counters {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  margin: 0 0 1.4rem;
}

.store-counter {
  display: flex;
  flex-direction: column;
}

.store-counter-value {
  color: #eaf6fb;
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.15;
}

.store-counter-label {
  color: #7d8f9b;
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Toolbar: search + category chips + sort. */
.store-toolbar[hidden] {
  display: none;
}

.store-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1.25rem;
}

.store-search {
  flex: 1 1 14rem;
  min-width: 12rem;
  padding: 0.45rem 0.75rem;
  font: inherit;
  font-size: 0.75rem;
  color: var(--md-typeset-color);
  background: var(--md-default-bg-color);
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 2rem;
  outline: none;
  transition: border-color 125ms;
}

.store-search:focus {
  border-color: var(--md-accent-fg-color);
}

.store-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.store-sort-label {
  margin-left: auto;
  font-size: 0.7rem;
  color: var(--md-default-fg-color--light);
}

.store-sort {
  margin-left: 0.35rem;
  padding: 0.35rem 0.5rem;
  font: inherit;
  font-size: 0.7rem;
  color: var(--md-typeset-color);
  background: var(--md-default-bg-color);
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 0.35rem;
}

/* Chips: category tags on cards and filter buttons in the toolbar. */
.store-chip {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--md-accent-fg-color);
  background: color-mix(in srgb, var(--md-accent-fg-color) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--md-accent-fg-color) 30%, transparent);
  border-radius: 2rem;
  white-space: nowrap;
}

.store-chip--version {
  color: var(--md-default-fg-color--light);
  background: color-mix(in srgb, var(--md-default-fg-color) 6%, transparent);
  border-color: var(--md-default-fg-color--lightest);
}

.store-chip--filter {
  cursor: pointer;
  font: inherit;
  font-size: 0.62rem;
  font-weight: 600;
  transition: background 125ms, color 125ms;
}

.store-chip--filter:hover {
  background: color-mix(in srgb, var(--md-accent-fg-color) 22%, transparent);
}

.store-chip--filter.is-active {
  color: #fff;
  background: var(--md-accent-fg-color);
  border-color: var(--md-accent-fg-color);
}

/* Card grid. */
.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 0.9rem;
  margin: 0 0 2rem;
}

.md-typeset .store-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1rem 1.1rem;
  color: var(--md-typeset-color);
  background: var(--md-default-bg-color--light, var(--md-default-bg-color));
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 0.7rem;
  transition: border-color 125ms, box-shadow 125ms, transform 125ms;
}

.md-typeset .store-card:not(.store-card--skeleton):hover,
.md-typeset .store-card:focus-within {
  color: var(--md-typeset-color);
  border-color: var(--md-accent-fg-color);
  box-shadow: 0 14px 34px -20px rgba(0, 172, 225, 0.55);
  transform: translateY(-2px);
}

.store-card-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.store-card-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 1px solid var(--md-default-fg-color--lightest);
  flex: none;
}

.store-card-name {
  display: block;
  font-weight: 700;
  font-size: 0.8rem;
  line-height: 1.25;
  word-break: break-word;
}

.store-card-author {
  display: block;
  font-size: 0.65rem;
  color: var(--md-default-fg-color--light);
}

.store-card-desc {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--md-default-fg-color--light);
}

.store-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.store-card-notes {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  font-size: 0.62rem;
  line-height: 1.4;
  color: var(--md-default-fg-color--light);
  border-left: 2px solid color-mix(in srgb, var(--md-accent-fg-color) 45%, transparent);
  padding-left: 0.5rem;
}

.store-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--md-default-fg-color--lightest);
  font-size: 0.65rem;
  color: var(--md-default-fg-color--light);
}

.store-card-stats span {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.store-card-stats svg {
  opacity: 0.75;
}

/* Buttons and the stats footer form the pinned bottom block. */
.store-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: auto;
  padding-top: 0.2rem;
}

.md-typeset a.store-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.7rem;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.6;
  color: var(--md-accent-fg-color);
  border: 1px solid var(--md-accent-fg-color);
  border-radius: 1rem;
  transition: background-color 125ms, color 125ms;
}

.md-typeset a.store-btn:hover,
.md-typeset a.store-btn:focus {
  background: color-mix(in srgb, var(--md-accent-fg-color) 12%, transparent);
}

.md-typeset a.store-btn--primary {
  color: var(--md-primary-bg-color, #fff);
  background: var(--md-accent-fg-color);
}

.md-typeset a.store-btn--primary:hover,
.md-typeset a.store-btn--primary:focus {
  background: color-mix(in srgb, var(--md-accent-fg-color) 82%, #000);
}

/* Loading skeletons. */
.store-card--skeleton {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 0.7rem;
}

.store-skel {
  border-radius: 0.3rem;
  background: linear-gradient(
    90deg,
    var(--md-default-fg-color--lightest) 25%,
    color-mix(in srgb, var(--md-default-fg-color) 3%, transparent) 50%,
    var(--md-default-fg-color--lightest) 75%
  );
  background-size: 200% 100%;
  animation: store-shimmer 1.4s infinite;
}

.store-skel--title { height: 1rem; width: 55%; }
.store-skel--line { height: 0.6rem; width: 90%; }
.store-skel--line.short { width: 65%; }
.store-skel--chip { height: 0.9rem; width: 30%; border-radius: 2rem; }

@keyframes store-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.store-empty,
.store-fallback {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem 1rem;
  color: var(--md-default-fg-color--light);
  font-size: 0.75rem;
}

.store-install {
  border-radius: 0.7rem;
  border: 1px solid var(--md-default-fg-color--lightest);
  padding: 1rem 1.4rem 1.2rem;
  margin: 0 0 1rem;
}

@media screen and (max-width: 44.9375em) {
  .store-counters {
    gap: 1.5rem;
  }
  .store-sort-label {
    margin-left: 0;
  }
  .store-hero .md-button {
    display: block;
    margin: 0.5rem auto 0;
    max-width: 18rem;
  }
}

@media screen and (max-width: 44.9375em) {
  .hero .hero-wordmark {
    font-size: 2.2rem;
  }
  .hero h1 {
    font-size: 1.9rem;
  }
  .hero .md-button,
  .hero-cta .md-button {
    display: block;
    margin: 0.5rem auto 0;
    max-width: 18rem;
  }
  .md-typeset .value-strip {
    font-size: 0.7rem;
  }
  /* Keep the install snippet (incl. trailing comments) on screen. */
  .hero .highlight code,
  .hero-cta .highlight code {
    font-size: 11px;
  }
}
