/* ══════════════════════════════════════════════════════════════════════
   NameRoot — shared name-search modal (powers search.js)
   Loaded by the homepage + every /names/ page. Namespaced .nrs-* so it
   never collides with page styles. Uses the shared design tokens, with
   hard fallbacks so it renders even if a page omits a variable.
   ══════════════════════════════════════════════════════════════════════ */

/* Nav trigger button (sits beside "Get the app") */
.nav-search {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(31, 27, 46, 0.14);
  border-radius: 999px;
  padding: 8px 15px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft, #3D3751);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.nav-search:hover { border-color: var(--rose, #B83A58); color: var(--rose, #B83A58); }
.nav-search svg { opacity: 0.8; }

/* Overlay + modal */
.nrs-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  background: rgba(31, 27, 46, 0.55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  padding: 8vh 16px 16px;
}
.nrs-overlay.is-open { display: flex; }
.nrs-modal {
  width: 100%;
  max-width: 600px;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  background: var(--cream, #FAF3E8);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 64px -16px rgba(31, 27, 46, 0.55);
  animation: nrs-pop 0.16s ease-out;
}
@keyframes nrs-pop { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .nrs-modal { animation: none; } }

/* Search input row */
.nrs-search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--cream-edge, #E8D9BE);
}
.nrs-search-row > svg { flex-shrink: 0; color: var(--ink-mute, #7A7388); }
.nrs-input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  outline: 0;
  font: inherit;
  font-size: 18px;
  color: var(--ink, #1F1B2E);
}
.nrs-input::placeholder { color: var(--ink-mute, #7A7388); }
.nrs-close {
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--ink-mute, #7A7388);
  font-size: 24px;
  line-height: 1;
  padding: 2px 8px;
  border-radius: 8px;
}
.nrs-close:hover { background: rgba(31, 27, 46, 0.06); color: var(--ink, #1F1B2E); }

/* Results */
.nrs-results { flex: 1; overflow-y: auto; padding: 6px; }
.nrs-result {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  text-decoration: none;
}
.nrs-result:hover, .nrs-result:focus { background: rgba(184, 58, 88, 0.07); outline: none; }
.nrs-result .nm {
  font-family: var(--serif, 'Fraunces', Georgia, serif);
  font-size: 18px;
  font-weight: 500;
  color: var(--ink, #1F1B2E);
  flex-shrink: 0;
}
.nrs-result .mn {
  font-size: 13px;
  color: var(--ink-mute, #7A7388);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nrs-result .tg {
  font-size: 11px;
  color: var(--rose, #B83A58);
  font-weight: 600;
  letter-spacing: 0.03em;
  flex-shrink: 0;
  white-space: nowrap;
}
.nrs-empty { padding: 36px 18px; text-align: center; color: var(--ink-mute, #7A7388); font-size: 15px; }

/* CTA footer — app download + Android waitlist */
.nrs-cta {
  padding: 16px 18px;
  border-top: 1px solid var(--cream-edge, #E8D9BE);
  background: var(--cream-deep, #F3E8D5);
}
.nrs-cta-row { display: flex; gap: 10px 14px; flex-wrap: wrap; align-items: center; }
.nrs-app {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ink, #1F1B2E);
  color: var(--cream, #FAF3E8);
  padding: 11px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s;
}
.nrs-app:hover { background: var(--rose, #B83A58); }
.nrs-or { font-size: 13px; color: var(--ink-mute, #7A7388); }
.nrs-wait { display: flex; gap: 8px; flex: 1; min-width: 220px; }
.nrs-wait input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--cream-edge, #E8D9BE);
  border-radius: 999px;
  padding: 10px 14px;
  font: inherit;
  font-size: 14px;
  background: #fff;
  color: var(--ink, #1F1B2E);
}
.nrs-wait button {
  border: 0;
  background: var(--rose, #B83A58);
  color: var(--cream, #FAF3E8);
  border-radius: 999px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}
.nrs-wait button:hover { background: var(--rose-deep, #8A2340); }
.nrs-wait button:disabled { opacity: 0.6; cursor: progress; }
.nrs-wait-msg { font-size: 13px; color: var(--rose, #B83A58); font-weight: 600; min-height: 18px; margin-top: 8px; }
