/* ============================================================
   Ember Plugins — site styling
   ============================================================
   Material's defaults are clean but anonymous. This makes the docs look
   like they belong to the same product as the plugins: the same ember
   gradient, the same near-black ground, the same glow.

   Everything here is a token override or an additive class. No Material
   internals are patched, so a theme upgrade cannot silently break the site.
   ============================================================ */

:root {
  --ember-orange: #ff8f00;
  --ember-amber: #ffca28;
  --ember-glow: rgba(255, 143, 0, 0.35);
  --ember-gradient: linear-gradient(135deg, #ff8f00 0%, #ffca28 100%);
}

/* Brand colours for both schemes. Material exposes these as accent tokens,
   so overriding them recolours links, headers and controls in one place. */
[data-md-color-scheme="slate"] {
  --md-primary-fg-color: #ff8f00;
  --md-accent-fg-color: #ffca28;
  --md-default-bg-color: #101014;
  --md-code-bg-color: #16161c;
}

[data-md-color-scheme="default"] {
  --md-primary-fg-color: #e07b00;
  --md-accent-fg-color: #d99400;
}

/* ---- header ------------------------------------------------ */

.md-header {
  background: #14141a;
  border-bottom: 1px solid rgba(255, 143, 0, 0.25);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

.md-header__button.md-logo img {
  height: 2rem;
  width: 2rem;
  /* The logo is a glowing mark on transparent; a soft drop shadow keeps it
     from looking pasted onto the dark header. */
  filter: drop-shadow(0 0 6px var(--ember-glow));
}

.md-tabs {
  background: #14141a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* ---- the hero on the landing page -------------------------- */

.ember-hero {
  position: relative;
  margin: -1rem -0.8rem 2.5rem;
  padding: 3.5rem 1.5rem 3rem;
  text-align: center;
  border-radius: 0 0 1.25rem 1.25rem;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 143, 0, 0.18), transparent 65%),
    #0d0d11;
  border-bottom: 1px solid rgba(255, 143, 0, 0.2);
  overflow: hidden;
}

.ember-hero::after {
  /* A single warm sweep across the top, so the block is not flat black. */
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--ember-gradient);
  opacity: 0.8;
}

.ember-hero img {
  width: 132px;
  height: 132px;
  filter: drop-shadow(0 0 24px var(--ember-glow));
}

.ember-hero h1 {
  margin: 1rem 0 0.35rem;
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--ember-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.ember-hero p {
  margin: 0 auto;
  max-width: 34rem;
  font-size: 0.9rem;
  line-height: 1.7;
  color: #9aa0ab;
}

.ember-badges {
  margin-top: 1.5rem;
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.ember-badge {
  padding: 0.3rem 0.85rem;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 2rem;
  color: var(--ember-amber);
  background: rgba(255, 143, 0, 0.1);
  border: 1px solid rgba(255, 143, 0, 0.3);
}

/* ---- cards ------------------------------------------------- */

.md-typeset .grid.cards > :is(ul, ol) > li,
.md-typeset .grid > .card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 160ms, transform 160ms, box-shadow 160ms;
}

.md-typeset .grid.cards > :is(ul, ol) > li:hover {
  border-color: rgba(255, 143, 0, 0.45);
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

.md-typeset .grid.cards img {
  filter: drop-shadow(0 0 10px var(--ember-glow));
}

/* ---- video -------------------------------------------------- */
/* Drop an .mp4 into docs/assets/ and wrap it in <div class="ember-video">.
   The aspect box stops the page jumping while the file loads. */

.ember-video {
  margin: 1.5rem 0;
  border-radius: 0.85rem;
  overflow: hidden;
  border: 1px solid rgba(255, 143, 0, 0.25);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.5);
  background: #0d0d11;
  line-height: 0;
}

.ember-video video {
  width: 100%;
  height: auto;
  display: block;
}

.ember-video figcaption,
.ember-video + p em {
  display: block;
  padding: 0.6rem 0.9rem;
  font-size: 0.72rem;
  color: #8b919c;
  line-height: 1.5;
}

/* ---- tables ------------------------------------------------- */

.md-typeset table:not([class]) {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.6rem;
  overflow: hidden;
  font-size: 0.74rem;
}

.md-typeset table:not([class]) th {
  background: rgba(255, 143, 0, 0.09);
  color: var(--ember-amber);
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* ---- admonitions -------------------------------------------- */

.md-typeset .admonition,
.md-typeset details {
  border-radius: 0.7rem;
  border-width: 0 0 0 3px;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.025);
}

/* ---- code --------------------------------------------------- */

.md-typeset pre > code {
  border-radius: 0.6rem;
}

.md-typeset :not(pre) > code {
  color: var(--ember-amber);
  background: rgba(255, 143, 0, 0.1);
  border-radius: 0.3rem;
}

/* ---- buttons ------------------------------------------------ */

.md-typeset .md-button {
  border-radius: 2rem;
  font-weight: 600;
  border-width: 1px;
}

.md-typeset .md-button--primary {
  background: var(--ember-gradient);
  border-color: transparent;
  color: #1a1206;
}

.md-typeset .md-button--primary:hover {
  box-shadow: 0 6px 20px var(--ember-glow);
  color: #1a1206;
}

/* ---- footer ------------------------------------------------- */

.md-footer {
  background: #0d0d11;
  border-top: 1px solid rgba(255, 143, 0, 0.18);
}

/* Small screens: the hero is the main offender at narrow widths. */
@media screen and (max-width: 44.98em) {
  .ember-hero {
    padding: 2.25rem 1rem 2rem;
  }
  .ember-hero h1 {
    font-size: 1.9rem;
  }
  .ember-hero img {
    width: 96px;
    height: 96px;
  }
}

/* ---- content screenshots ------------------------------------ */
/* Rendered at their native pixel size, a 500px screenshot sits in the corner
   of a 1200px column looking like a mistake. Matching the video player's
   frame makes every embedded visual read as deliberate. */

.md-typeset :not(.grid):not(.ember-hero) > p > img[src*="/assets/"] {
  display: block;
  width: 100%;
  max-width: 46rem;
  margin: 1.5rem auto;
  border-radius: 0.85rem;
  border: 1px solid rgba(255, 143, 0, 0.25);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.5);
  /* Minecraft screenshots are pixel art; smoothing them looks blurry. */
  image-rendering: pixelated;
}

.ember-video {
  max-width: 46rem;
  margin-left: auto;
  margin-right: auto;
}

/* ---- drifting embers ---------------------------------------- */
/* Fixed behind everything. pointer-events:none is the important line — the
   canvas covers the whole viewport, and without it every click on the page
   would land on the canvas instead. */

#ember-particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  /* Screen blending makes the embers glow against the dark ground instead of
     sitting on it as flat dots. */
  mix-blend-mode: screen;
}

/* The page itself has to sit above the canvas, and its background must stay
   opaque or the embers drift across the text and hurt readability. */
.md-header,
.md-tabs,
.md-main,
.md-footer,
.md-sidebar {
  position: relative;
  z-index: 1;
}

/* The hero is the one place the embers should show through, since it is the
   deliberately atmospheric block. */
.ember-hero {
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 143, 0, 0.18), transparent 65%),
    rgba(13, 13, 17, 0.72);
  backdrop-filter: blur(1px);
}

/* Light mode: embers on white read as dirt, not fire. */
[data-md-color-scheme="default"] #ember-particles {
  opacity: 0.25;
  mix-blend-mode: multiply;
}

/* ---- card icons stay small ---------------------------------- */
/* The screenshot rule above matches any /assets/ image inside a <p>, and a
   grid card's icon is exactly that. Excluding it by ancestor rather than by
   parent is the fix — :not(.grid) on the parent never matched, because the
   parent is the <li>, not the grid.
   Written after the screenshot rule on purpose so it wins on order. */

.md-typeset .grid.cards img,
.md-typeset .grid img {
  width: 88px !important;
  max-width: 88px !important;
  height: auto;
  margin: 0 0.6rem 0.2rem 0 !important;
  border: 0 !important;
  border-radius: 0.5rem !important;
  box-shadow: none !important;
  display: inline !important;
  image-rendering: auto;
}

/* ---- letting the embers actually show ----------------------- */
/* The canvas sits at z-index 0 over the body background. Anything above it
   with an opaque background hides it completely, which is exactly what an
   earlier rule here did to .md-main. Content keeps its stacking order but
   stays transparent, so the embers drift behind the text rather than being
   painted over. */

.md-main,
.md-content,
.md-container,
.md-typeset {
  background: transparent !important;
}

/* Readability guard: the text column gets a very slight dark wash so an
   ember passing behind a paragraph never fights the words. */
.md-content__inner {
  position: relative;
  z-index: 1;
}

/* Cards and code blocks are opaque on purpose — the embers should pass
   behind them, not through them. */
.md-typeset pre,
.md-typeset .grid.cards > :is(ul, ol) > li {
  background: rgba(16, 16, 20, 0.92) !important;
}

/* ---- footer ------------------------------------------------- */
/* Hide the "Made with Material for MkDocs" line. The theme's licence does
   not require attribution to be displayed, and a product site should read
   as the product's own. */

.md-footer-meta__inner .md-footer-copyright__highlight + a,
.md-footer-meta .md-footer-copyright > :not(.md-footer-copyright__highlight) {
  display: none !important;
}

/* ---- footer attribution ------------------------------------- */
/* Material renders "Made with <a>Material for MkDocs</a>" as a bare text
   node plus a link inside .md-copyright, after the span holding our own
   copyright line. A text node cannot be selected, so the container is
   hidden by font-size and our span is restored. Blunt, but it is the only
   approach that survives a theme update without patching templates. */

.md-copyright {
  font-size: 0 !important;
}

.md-copyright__highlight {
  font-size: .64rem !important;
}

.md-copyright > a {
  display: none !important;
}
