/* ===========================================================================
   Nelanor concept-site banner + free-mockup modal
   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, Marisol) and dark demos
   (Forge, Zelvor, Atlas). Signature: the Nelanor gradient diamond mark.

   All rules are scoped under the widget's two root ids (#nlnr-cb-root /
   #nlnr-cb-modal-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,
#nlnr-cb-modal-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 *,
#nlnr-cb-modal-root,
#nlnr-cb-modal-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
   modal 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 *,
#nlnr-cb-modal-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,
#nlnr-cb-modal-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,
#nlnr-cb-modal-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,
#nlnr-cb-modal-root .nlnr-cb-btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.07);
}
#nlnr-cb-root .nlnr-cb-btn-primary:active,
#nlnr-cb-modal-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,
#nlnr-cb-modal-root .nlnr-cb-btn:focus-visible,
#nlnr-cb-modal-root .nlnr-cb-close:focus-visible,
#nlnr-cb-modal-root .nlnr-cb-field:focus-visible {
  outline: 2px solid var(--nlnr-cb-focus);
  outline-offset: 2px;
}

/* ============================================================ modal ========= */
#nlnr-cb-modal-root {
  position: fixed;
  inset: 0;
  z-index: 2147483646;
  display: none;
}
#nlnr-cb-modal-root.nlnr-cb-open {
  display: block;
}

#nlnr-cb-modal-root .nlnr-cb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(3, 4, 8, 0.8);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  animation: nlnr-cb-fade 0.26s ease both;
}

#nlnr-cb-modal-root .nlnr-cb-modal {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(480px, calc(100vw - 28px));
  max-height: calc(100vh - 28px); /* fallback first … */
  max-height: calc(100dvh - 28px); /* … dynamic viewport wins where supported */
  overflow-y: auto;
  padding: 26px 24px 24px;
  background: var(--nlnr-cb-panel);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.85);
  color: var(--nlnr-cb-text);
  animation: nlnr-cb-modal-in 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#nlnr-cb-modal-root .nlnr-cb-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 10px;
  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-modal-root .nlnr-cb-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--nlnr-cb-white);
}
#nlnr-cb-modal-root .nlnr-cb-close svg {
  width: 18px;
  height: 18px;
  display: block;
}

#nlnr-cb-modal-root .nlnr-cb-modal-title {
  margin: 0;
  padding-right: 32px;
  font-family: inherit;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--nlnr-cb-white);
}
#nlnr-cb-modal-root .nlnr-cb-modal-sub {
  margin: 7px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--nlnr-cb-dim);
}

#nlnr-cb-modal-root .nlnr-cb-form {
  margin: 18px 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* form controls (mirror the main-site LeadForm's dark inputs) */
#nlnr-cb-modal-root .nlnr-cb-field {
  width: 100%;
  margin: 0;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.3;
  color: var(--nlnr-cb-white);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.18s ease;
}
#nlnr-cb-modal-root .nlnr-cb-field::placeholder {
  color: #8b93a7;
  opacity: 1;
}
#nlnr-cb-modal-root .nlnr-cb-field:focus {
  border-color: rgba(124, 139, 255, 0.6);
}
#nlnr-cb-modal-root textarea.nlnr-cb-field {
  resize: none;
  min-height: 58px;
}
#nlnr-cb-modal-root select.nlnr-cb-field {
  padding-right: 38px;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2399a0b4' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 13px center;
  background-size: 16px 16px;
}
#nlnr-cb-modal-root select.nlnr-cb-field option {
  background: var(--nlnr-cb-panel);
  color: var(--nlnr-cb-white);
}
#nlnr-cb-modal-root .nlnr-cb-field-dim {
  color: #8b93a7; /* unselected placeholder-state <select> */
}

#nlnr-cb-modal-root .nlnr-cb-form .nlnr-cb-btn {
  margin-top: 2px;
}
#nlnr-cb-modal-root .nlnr-cb-help {
  margin: 2px 0 0;
  text-align: center;
  font-size: 11px;
  line-height: 1.4;
  color: var(--nlnr-cb-dim);
}
#nlnr-cb-modal-root .nlnr-cb-error {
  margin: 0;
  text-align: center;
  font-size: 12px;
  color: #fb7185;
}

/* ---------------------------------------------------------------- success */
#nlnr-cb-modal-root .nlnr-cb-success {
  padding: 12px 0 6px;
  text-align: center;
}
#nlnr-cb-modal-root .nlnr-cb-success-badge {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background-image: var(--nlnr-cb-grad);
}
#nlnr-cb-modal-root .nlnr-cb-success-badge svg {
  width: 28px;
  height: 28px;
  display: block;
}
#nlnr-cb-modal-root .nlnr-cb-success h3 {
  margin: 0;
  font-family: inherit;
  font-size: 22px;
  font-weight: 800;
  color: var(--nlnr-cb-white);
}
#nlnr-cb-modal-root .nlnr-cb-success p {
  margin: 8px auto 0;
  max-width: 34ch;
  font-size: 14px;
  line-height: 1.5;
  color: #cbd5e1;
}
#nlnr-cb-modal-root .nlnr-cb-success .nlnr-cb-btn {
  width: auto;
  margin: 22px auto 0;
  padding-left: 22px;
  padding-right: 22px;
}

/* ---------------------------------------------------------------- motion */
@keyframes nlnr-cb-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes nlnr-cb-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes nlnr-cb-modal-in {
  from {
    opacity: 0;
    transform: translate(-50%, -46%) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

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