/* ==========================================================================
   NR-BOS interactive overview — launcher card + tabbed modal.
   Loaded only where the launcher appears (currently /work/nr-bos/ — see
   base.njk, pageKey == "nrBos"). Namespaced under .nrb2- (distinct from the
   .nrb- prefix already used by product-overview.css on the same page) so
   the two features can't collide.

   Uses the site's real brand tokens (--navy/--gold/--paper/--charcoal/
   --muted/--border/--font-serif from styles.css) plus a small set of new
   semantic status tokens this feature needs. Logical properties throughout
   so the whole thing mirrors correctly under dir="rtl" without a separate
   RTL stylesheet — the one exception is the before/after slider's
   clip-path, which has no logical form and is overridden explicitly for
   [dir="rtl"] below.
   ========================================================================== */

.nrb2-scope {
  --nrb2-ok: #3f7d5c;
  --nrb2-warn: #c4863a;
  --nrb2-risk: #a8423f;
  --nrb2-info: #3f6c9e;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

.nrb2-vh {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------------------------------------------------------------- launcher card */

.nrb2-launcher {
  width: 100%;
  background: var(--navy);
  border: 1px solid var(--gold);
  border-radius: 10px;
  padding: 0;
  text-align: start;
  cursor: pointer;
  font: inherit;
  color: inherit;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1.5rem;
  transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.3, 1), box-shadow 0.25s ease;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06), 0 20px 45px -28px rgba(0, 0, 0, 0.55);
}
.nrb2-launcher:hover,
.nrb2-launcher:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 24px 50px -26px rgba(0, 0, 0, 0.6);
}
.nrb2-launcher:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.nrb2-launcher__text { padding: 1.75rem 2rem; }
.nrb2-launcher__eyebrow {
  display: flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--gold); margin: 0 0 0.5rem;
}
.nrb2-launcher__eyebrow .nrb2-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--nrb2-ok); flex: none;
}
.nrb2-launcher__title {
  font-family: var(--font-serif); font-weight: 700; font-size: 1.4rem; color: #fff;
  margin: 0 0 0.4rem;
}
.nrb2-launcher__body { font-size: 0.9rem; color: #b7c2d6; margin: 0; max-width: 46ch; line-height: 1.55; }
.nrb2-launcher__cta {
  flex: none; margin-inline-end: 2rem;
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--gold); color: var(--navy);
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0.7rem 1.15rem; border-radius: 999px;
}
.nrb2-launcher__cta span { transition: transform 0.2s ease; }
.nrb2-launcher:hover .nrb2-launcher__cta span,
.nrb2-launcher:focus-visible .nrb2-launcher__cta span { transform: translateX(3px); }
[dir="rtl"] .nrb2-launcher__cta span { transform: scaleX(-1); }
[dir="rtl"] .nrb2-launcher:hover .nrb2-launcher__cta span,
[dir="rtl"] .nrb2-launcher:focus-visible .nrb2-launcher__cta span { transform: scaleX(-1) translateX(3px); }

@media (max-width: 640px) {
  .nrb2-launcher { grid-template-columns: 1fr; }
  .nrb2-launcher__cta { margin: 0 2rem 1.75rem; justify-content: center; }
}

/* ---------------------------------------------------------------- overlay + dialog */

.nrb2-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(6, 11, 20, 0.8);
  backdrop-filter: blur(6px);
  display: grid; place-items: center;
  padding: 28px;
  opacity: 0;
  animation: nrb2-fade 0.22s ease forwards;
}
.nrb2-overlay[hidden] { display: none; }
@keyframes nrb2-fade { to { opacity: 1; } }

html.nrb2-lock { overflow: hidden; }

.nrb2-modal {
  width: min(1180px, 100%);
  max-height: calc(100vh - 56px);
  background: var(--navy);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex; flex-direction: column;
  overflow: hidden;
  transform: translateY(10px);
  animation: nrb2-rise 0.28s cubic-bezier(0.2, 0.7, 0.3, 1) 0.03s forwards;
}
@keyframes nrb2-rise { to { transform: translateY(0); } }

.nrb2-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 20px; border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: #0a1830;
}
.nrb2-head__id {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--gold); margin: 0 0 4px;
}
.nrb2-head__title { font-family: var(--font-serif); font-weight: 700; font-size: 18px; color: #fff; margin: 0; }
.nrb2-close {
  flex: none; width: 36px; height: 36px;
  background: transparent; border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 4px;
  color: #9fadc6; cursor: pointer; display: grid; place-items: center;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.nrb2-close svg { width: 18px; height: 18px; }
.nrb2-close:hover { color: #fff; border-color: var(--gold); background: rgba(201, 169, 110, 0.12); }
.nrb2-close:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.nrb2-layout { display: grid; grid-template-columns: 220px 1fr; min-height: 0; flex: 1; }

.nrb2-rail {
  border-inline-end: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 0; overflow-y: auto; background: #0a1830;
}
.nrb2-tab {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 11px 16px; background: none; border: 0;
  border-inline-start: 2px solid transparent;
  text-align: start; cursor: pointer; font: inherit;
  color: #93a2bc; transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.nrb2-tab svg { width: 17px; height: 17px; flex: none; }
.nrb2-tab:hover { color: #dde5f2; background: rgba(255, 255, 255, 0.04); }
.nrb2-tab:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.nrb2-tab__label { font-size: 13.5px; font-weight: 500; }
.nrb2-tab[aria-selected="true"] {
  color: #fff; background: rgba(201, 169, 110, 0.1); border-inline-start-color: var(--gold);
}

.nrb2-stage { overflow-y: auto; padding: 26px 28px 32px; min-width: 0; background: var(--paper); }
.nrb2-panel { display: none; }
.nrb2-panel.is-active { display: block; }

.nrb2-panel__eyebrow {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.14em;
  text-transform: uppercase; color: #8a5f28; margin: 0 0 8px; /* 5.23:1 on --paper, WCAG AA */
}
.nrb2-panel__title {
  font-family: var(--font-serif); font-weight: 700; font-size: 22px; color: var(--navy);
  margin: 0 0 10px; line-height: 1.2;
}
.nrb2-panel__body { font-size: 14px; line-height: 1.6; color: var(--muted); margin: 0 0 18px; max-width: 62ch; }

.nrb2-feat { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 9px; max-width: 62ch; }
.nrb2-feat li { display: grid; grid-template-columns: 14px 1fr; gap: 9px; font-size: 13px; line-height: 1.5; color: var(--charcoal); }
.nrb2-feat li::before { content: ''; width: 6px; height: 6px; margin-top: 6px; background: var(--gold); border-radius: 1px; }

.nrb2-shots { display: grid; gap: 18px; }
.nrb2-shots.n2 { grid-template-columns: 1fr 1fr; }
.nrb2-shots.n3 { grid-template-columns: 1fr 1fr 1fr; }

.nrb2-frame {
  margin: 0; background: var(--navy); border: 1px solid var(--border); border-radius: 6px;
  overflow: hidden; box-shadow: 0 14px 30px -20px rgba(0, 0, 0, 0.4);
}
.nrb2-frame-bar { display: flex; gap: 5px; padding: 7px 10px; }
.nrb2-frame-bar i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, 0.22); display: inline-block; }
.nrb2-frame img { display: block; width: 100%; height: auto; background: #fff; }
.nrb2-frame figcaption { padding: 8px 11px 10px; font-size: 10.5px; color: rgba(255, 255, 255, 0.62); }

/* --------------------------------------------------------- before/after slider */

.nrb2-slider { background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 12px; }
.nrb2-slider__stage {
  position: relative; aspect-ratio: 4 / 3; border-radius: 4px; overflow: hidden;
  touch-action: pan-y;
}
.nrb2-slider__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.nrb2-slider__img::after { content: ''; }
.nrb2-slider__tag {
  position: absolute; top: 8px; inset-inline-start: 8px;
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase;
  background: rgba(10, 24, 48, 0.82); color: #fff; padding: 3px 7px; border-radius: 3px;
}
.nrb2-slider__after {
  clip-path: inset(0 0 0 var(--nrb2-split, 50%));
}
/* Scoped to the slider's OWN dir, not any ancestor's — the slider is
   rendered with an explicit dir="ltr" (photo comparisons aren't mirrored
   just because the page reads RTL), so this only fires if a future caller
   omits that override and lets the slider inherit dir="rtl" instead. */
.nrb2-slider[dir="rtl"] .nrb2-slider__after { clip-path: inset(0 var(--nrb2-split, 50%) 0 0); }
.nrb2-slider__handle {
  position: absolute; top: 0; bottom: 0; inset-inline-start: var(--nrb2-split, 50%);
  width: 3px; background: var(--gold); pointer-events: none; margin-inline-start: -1.5px;
}
.nrb2-slider__handle::after {
  content: ''; position: absolute; top: 50%; inset-inline-start: 50%;
  width: 30px; height: 30px; margin: -15px 0 0 -15px;
  border: 2px solid var(--gold); border-radius: 50%; background: rgba(10, 24, 48, 0.55);
}
.nrb2-slider input[type="range"] { width: 100%; margin-top: 12px; accent-color: var(--navy); }
.nrb2-slider__meta {
  display: flex; justify-content: space-between; margin-top: 6px;
  font-family: var(--font-mono); font-size: 9.5px; color: var(--muted);
}
.nrb2-slider__meta bdi { unicode-bidi: isolate; }

@media (max-width: 900px) {
  .nrb2-layout { grid-template-columns: 1fr; }
  .nrb2-rail { display: flex; overflow-x: auto; border-inline-end: 0; border-bottom: 1px solid rgba(255, 255, 255, 0.1); padding: 8px; }
  .nrb2-tab { width: auto; flex: none; border-inline-start: 0; border-bottom: 2px solid transparent; padding: 9px 13px; }
  .nrb2-tab[aria-selected="true"] { border-inline-start-color: transparent; border-bottom-color: var(--gold); }
  .nrb2-shots.n2, .nrb2-shots.n3 { grid-template-columns: 1fr; }
  .nrb2-overlay { padding: 0; }
  .nrb2-modal { max-height: 100vh; height: 100vh; border-radius: 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .nrb2-overlay, .nrb2-modal, .nrb2-launcher, .nrb2-launcher__cta span, .nrb2-close {
    animation: none !important; transition: none !important;
  }
}
