/* ===========================================================================
   Nelanor concept-site banner
   Self-contained, fully namespaced (nlnr-cb-*) so it never clashes with a demo's
   own styles. Injected on every page of every demo under /work/<slug>/ via:
     <link rel="stylesheet" href="/work-assets/concept-banner.css">
     <script defer src="/work-assets/concept-banner.js"></script>

   Design: dark Nelanor brand chrome. Deliberately a SOLID dark surface (not the
   near-transparent glass the main site uses over its own dark body) so it reads
   clearly over BOTH light demos (Lumen, Fern & Oak, Solace) and dark demos
   (Forge, Zelvor, Atlas). Signature: the Nelanor gradient diamond mark.

   All rules are scoped under the widget's root id (#nlnr-cb-root) for high
   specificity — this isolates the widget from a
   demo's global element selectors (a { }, button { }, input { } …) without
   leaking any styles back out onto the demo.
   ========================================================================== */

#nlnr-cb-root {
  /* Brand tokens (mirrors web/tailwind.config.js + src/index.css). Kept on the
     widget roots, never on :root, so nothing bleeds into the host demo. */
  --nlnr-cb-ink: rgba(11, 12, 22, 0.94);
  --nlnr-cb-panel: #0e1020;
  --nlnr-cb-line: rgba(255, 255, 255, 0.12);
  --nlnr-cb-white: #ffffff;
  --nlnr-cb-text: #e6e9f2;
  --nlnr-cb-dim: #99a0b4;
  --nlnr-cb-grad: linear-gradient(120deg, #6e8cff 0%, #a85ff0 42%, #ff8cc8 74%, #4fe3b0 100%);
  --nlnr-cb-focus: #7c8bff;
  --nlnr-cb-font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;

  font-family: var(--nlnr-cb-font);
  font-size: 16px;
  line-height: 1.45;
  letter-spacing: normal;
  text-align: left;
  color: var(--nlnr-cb-text);
  -webkit-font-smoothing: antialiased;
}

#nlnr-cb-root,
#nlnr-cb-root * {
  box-sizing: border-box;
}

/* Defensive reset. Demos style BARE elements (h2{}, h3{}, p{}, a{}, button{},
   input{}…) with element selectors that would otherwise bleed into the widget's
   same-tag nodes — e.g. Forge's `h2{text-transform:uppercase}` would uppercase the
   card title, and a demo's display font on h2{} would restyle it. The id-scoped
   `#root *` (id specificity) neutralises those, while the widget's own class rules
   (higher specificity) still win for the values it intends. Nothing leaks outward. */
#nlnr-cb-root * {
  font-family: inherit;
  text-transform: none;
  text-align: inherit;
  letter-spacing: normal;
  font-style: normal;
  text-shadow: none;
}

/* ---------------------------------------------------------------- banner shell */
#nlnr-cb-root {
  position: fixed;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: max(16px, env(safe-area-inset-bottom, 0px));
  z-index: 2147483000; /* above demo chrome; below the modal */
  margin: 0;
  padding: 0;
  width: auto;
}

/* card ⇄ pill visibility toggle (state class lives on the root) */
#nlnr-cb-root .nlnr-cb-pill {
  display: none;
}
#nlnr-cb-root.nlnr-cb-is-collapsed .nlnr-cb-card {
  display: none;
}
#nlnr-cb-root.nlnr-cb-is-collapsed .nlnr-cb-pill {
  display: inline-flex;
}

/* ---------------------------------------------------------------- expanded card */
#nlnr-cb-root .nlnr-cb-card {
  position: relative;
  width: min(320px, calc(100vw - 32px));
  padding: 15px 16px 15px;
  background: var(--nlnr-cb-ink);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid var(--nlnr-cb-line);
  border-radius: 16px;
  box-shadow: 0 24px 60px -22px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(124, 139, 255, 0.07);
  animation: nlnr-cb-rise 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#nlnr-cb-root .nlnr-cb-head {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding-right: 22px; /* clear of the collapse button */
}

#nlnr-cb-root .nlnr-cb-mark {
  flex: none;
  width: 26px;
  height: 26px;
  display: block;
}
#nlnr-cb-root .nlnr-cb-text {
  margin: 1px 0 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--nlnr-cb-white);
  letter-spacing: -0.005em;
}
#nlnr-cb-root .nlnr-cb-text b {
  font-weight: 700;
}

#nlnr-cb-root .nlnr-cb-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 13px;
}

/* ---------------------------------------------------------------- collapse btn */
#nlnr-cb-root .nlnr-cb-collapse {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--nlnr-cb-dim);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: background-color 0.18s ease, color 0.18s ease;
}
#nlnr-cb-root .nlnr-cb-collapse:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--nlnr-cb-white);
}
#nlnr-cb-root .nlnr-cb-collapse svg {
  width: 14px;
  height: 14px;
  display: block;
}

/* ---------------------------------------------------------------- collapsed pill */
#nlnr-cb-root .nlnr-cb-pill {
  align-items: center;
  gap: 8px;
  padding: 8px 13px 8px 10px;
  border-radius: 999px;
  background: var(--nlnr-cb-ink);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid var(--nlnr-cb-line);
  box-shadow: 0 14px 34px -16px rgba(0, 0, 0, 0.72);
  color: var(--nlnr-cb-text);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  animation: nlnr-cb-rise 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
  transition: border-color 0.18s ease, transform 0.18s ease;
}
#nlnr-cb-root .nlnr-cb-pill:hover {
  border-color: rgba(255, 255, 255, 0.26);
  transform: translateY(-1px);
}
#nlnr-cb-root .nlnr-cb-pill .nlnr-cb-mark {
  width: 18px;
  height: 18px;
}

/* ---------------------------------------------------------------- buttons */
#nlnr-cb-root .nlnr-cb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin: 0;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid transparent;
  border-radius: 11px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: transform 0.18s ease, filter 0.18s ease, background-color 0.18s ease,
    border-color 0.18s ease;
}
#nlnr-cb-root .nlnr-cb-btn-primary {
  color: #fff;
  background-image: var(--nlnr-cb-grad);
  box-shadow: 0 8px 24px -10px rgba(124, 139, 255, 0.6);
}
#nlnr-cb-root .nlnr-cb-btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.07);
}
#nlnr-cb-root .nlnr-cb-btn-primary:active {
  transform: translateY(0) scale(0.98);
}
#nlnr-cb-root .nlnr-cb-btn-ghost {
  color: var(--nlnr-cb-text);
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.16);
}
#nlnr-cb-root .nlnr-cb-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.28);
  transform: translateY(-1px);
}

/* shared visible focus ring */
#nlnr-cb-root .nlnr-cb-btn:focus-visible,
#nlnr-cb-root .nlnr-cb-pill:focus-visible,
#nlnr-cb-root .nlnr-cb-collapse:focus-visible {
  outline: 2px solid var(--nlnr-cb-focus);
  outline-offset: 2px;
}

/* The free-mockup modal that used to live here was removed with the lead modal on the
   main site; its rules were dead weight on every build page and are gone (Roadmap 2). */

/* ---------------------------------------------------------------- motion */
@keyframes nlnr-cb-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  #nlnr-cb-root .nlnr-cb-card,
  #nlnr-cb-root .nlnr-cb-pill {
    animation: none;
  }
  #nlnr-cb-root .nlnr-cb-btn,
  #nlnr-cb-root .nlnr-cb-pill,
  #nlnr-cb-root .nlnr-cb-collapse {
    transition: none;
  }
}

/* ---------------------------------------------------------------- phones: a slim bar
   Roadmap 2, Release A. On a 390px screen the card was a 320px by roughly 150px block
   in the bottom right, on top of the build a visitor came to look at. The builds are
   the portfolio, so on phones the notice is one line across the bottom: mark, the
   sentence, one link, the collapse control. "All six builds" waits for the pill: a
   thumb has the Nelanor link, and /work is one tap behind it. Desktop is unchanged. */
@media (max-width: 640px) {
  #nlnr-cb-root {
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
  }
  #nlnr-cb-root .nlnr-cb-card {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 44px 8px 12px;
    padding-bottom: max(8px, env(safe-area-inset-bottom, 0px));
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    box-shadow: 0 -12px 30px -18px rgba(0, 0, 0, 0.7);
  }
  #nlnr-cb-root.nlnr-cb-is-collapsed .nlnr-cb-card {
    display: none;
  }
  #nlnr-cb-root .nlnr-cb-head {
    flex: 1 1 auto;
    min-width: 0;
    align-items: center;
    gap: 8px;
    padding-right: 0;
  }
  #nlnr-cb-root .nlnr-cb-mark {
    width: 20px;
    height: 20px;
  }
  #nlnr-cb-root .nlnr-cb-text {
    margin: 0;
    font-size: 12px;
    line-height: 1.25;
  }
  #nlnr-cb-root .nlnr-cb-actions {
    flex: none;
    flex-direction: row;
    margin-top: 0;
  }
  #nlnr-cb-root .nlnr-cb-btn {
    width: auto;
    padding: 8px 11px;
    font-size: 12px;
    border-radius: 9px;
  }
  #nlnr-cb-root .nlnr-cb-btn-ghost {
    display: none;
  }
  #nlnr-cb-root .nlnr-cb-collapse {
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    margin-top: calc(-0.5 * max(0px, env(safe-area-inset-bottom, 0px)));
  }
  #nlnr-cb-root .nlnr-cb-pill {
    position: fixed;
    right: max(12px, env(safe-area-inset-right, 0px));
    bottom: max(12px, env(safe-area-inset-bottom, 0px));
  }
}
