/* Nevermind Runtime v2 - nm-focus.css
   Styles for the isolation acts (focus, detail, lens, pins, slice).
   Everything here lives in the overlay layer; theme comes from contract section 6. */

/* authoring carriers: never rendered */
.nm-detail, .nm-pin { display: none !important; }
template[data-detail-for] { display: none; }
.slide [data-act="focus"], .slide [data-act="detail"], .slide [data-act="lens"],
.slide [data-act="pins"]:not(.nm-pin), .slide [data-act="slice"] { cursor: zoom-in; }

.nmf {
  --nmf-paper: var(--nm-paper, var(--slide-bg, #f6f3ec));
  --nmf-ink: var(--nm-ink, #1b1e24);
  --nmf-muted: var(--nm-muted, color-mix(in srgb, var(--nmf-ink) 64%, var(--nmf-paper)));
  --nmf-line: var(--nm-line, color-mix(in srgb, var(--nmf-ink) 14%, transparent));
  --nmf-accent: var(--nm-accent, var(--lp-accent, #1f6feb));
  --nmf-accent-2: var(--nm-accent-2, color-mix(in srgb, var(--nmf-accent) 55%, #f5a524));
  --nmf-surface: var(--nm-surface, color-mix(in srgb, var(--nmf-paper) 55%, #fff));
  --nmf-radius: var(--nm-radius, 24px);
  --nmf-body: var(--nm-font-body, "Noto Naskh Arabic", "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif);
  --nmf-display: var(--nm-font-display, var(--nmf-body));
  --nmf-shadow: 0 1px 1px rgba(12, 16, 28, .05), 0 6px 14px -4px rgba(12, 16, 28, .12),
                0 30px 70px -18px rgba(12, 16, 28, .38);
  --nmf-dim: rgba(10, 13, 22, .46);
  position: absolute; left: 0; top: 0; width: 1920px; height: 1080px;
  pointer-events: none; contain: layout style;
  color: var(--nmf-ink); font-family: var(--nmf-body);
  -webkit-font-smoothing: antialiased;
}
.nmf * { box-sizing: border-box; }
.nmf svg { max-width: none; max-height: none; overflow: visible; }
.nmf-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.nmf-svg { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; }

/* clones (ghost subject, lens view, slice halves): frozen, never interactive */
.nmf-clone, .nmf-clone * { animation: none !important; transition: none !important; }
.nmf-clone { pointer-events: none !important; }
.nmf-ghost, .nmf-half { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; transform-origin: 0 0; }

/* ---------- veil: dim + blur + desaturate, soft hole drawn by an SVG mask ---------- */
.nmf-veil {
  position: absolute; inset: 0;
  background: var(--nmf-dim);
  -webkit-backdrop-filter: blur(5px) saturate(.35) brightness(.92);
  backdrop-filter: blur(5px) saturate(.35) brightness(.92);
  mask-size: 1920px 1080px; mask-repeat: no-repeat;
}
.nmf-veil-soft { background: rgba(10, 13, 22, .26); -webkit-backdrop-filter: blur(2.5px) saturate(.55); backdrop-filter: blur(2.5px) saturate(.55); }

/* ---------- ring ---------- */
.nmf-ring, .nmf-ring-glow { fill: none; stroke-dasharray: 1 1; }
.nmf-ring { stroke: var(--nmf-accent); stroke-width: 3; stroke-dashoffset: 1; stroke-linecap: round; }
.nmf-ring-glow { stroke: var(--nmf-accent); stroke-width: 14; stroke-dasharray: none; opacity: 0;
  stroke-opacity: .22; filter: blur(6px); }
.nmf-ring.nmf-rtl { transform-box: fill-box; transform-origin: center; transform: scaleX(-1); }

/* ---------- caption chip (data-focus-note) ---------- */
.nmf-note {
  position: absolute; left: 0; top: 0; max-width: 640px;
  padding: 14px 26px; border-radius: 999px;
  background: var(--nmf-surface); color: var(--nmf-ink);
  font: 600 26px/1.4 var(--nmf-display); box-shadow: var(--nmf-shadow);
  border: 1px solid var(--nmf-line); white-space: nowrap;
}
.nmf-note::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  background: var(--nmf-accent); margin-inline-end: 12px; vertical-align: middle; transform: translateY(-2px); }

/* ---------- leaders, sockets ---------- */
.nmf-leader-line, .nmf-pin-line { fill: none; stroke: var(--nmf-accent); stroke-width: 2.5; stroke-dasharray: 1 1;
  stroke-dashoffset: 1; stroke-linecap: round; stroke-linejoin: round; }
.nmf-leader-dot { fill: var(--nmf-accent); stroke: var(--nmf-surface); stroke-width: 3;
  transform-box: fill-box; transform-origin: center; }
.nmf-leader-dot.nmf-end { stroke-width: 0; }
.nmf-socket { fill: color-mix(in srgb, var(--nmf-paper) 30%, transparent); stroke: var(--nmf-surface);
  stroke-width: 2.5; stroke-dasharray: 8 9; opacity: 0; }

/* ---------- detail panels ---------- */
.nmf-panel {
  position: absolute; left: 0; top: 0; pointer-events: auto;
  background: var(--nmf-surface); color: var(--nmf-ink);
  border-radius: var(--nmf-radius); box-shadow: var(--nmf-shadow);
  border: 1px solid color-mix(in srgb, var(--nmf-line) 70%, transparent);
  padding: 52px 60px 48px; font-size: 27px; line-height: 1.7;
  text-align: start; cursor: auto;
}
.nmf-panel.nmf-clip { overflow: hidden; }
/* detail content taller than the stage: scroll inside, fade the bottom edge (see measure() in nm-focus.js) */
.nmf-panel.nmf-scroll .nmf-pages { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
  padding-block-end: 48px; -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 96px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 96px), transparent); }
.nmf-panel::before { /* accent hairline on the leading edge */
  content: ""; position: absolute; inset-block: 40px; inset-inline-start: -1px; width: 4px;
  border-radius: 0 6px 6px 0; background: var(--nmf-accent);
}
.nmf-panel[dir="rtl"]::before { border-radius: 6px 0 0 6px; }
.nmf-pages { display: grid; }
.nmf-page { grid-area: 1 / 1; min-width: 0; }
.nmf-page.nmf-off { visibility: hidden; }
.nmf-hero { --nmf-surface-h: var(--nmf-hero-bg, var(--nmf-surface)); background: var(--nmf-surface-h);
  display: flex; flex-direction: column; justify-content: center; padding: 64px 84px; }
.nmf-hero::before { display: none; }
.nmf-hero .nmf-page h2, .nmf-hero .nmf-page h3 { font-size: 54px; }
.nmf-sheet { border-radius: var(--nmf-radius) var(--nmf-radius) 0 0; border-bottom: 0; padding: 44px 72px 40px;
  box-shadow: 0 -2px 0 color-mix(in srgb, var(--nmf-accent) 80%, transparent), 0 -30px 80px -20px rgba(12, 16, 28, .45); }
.nmf-sheet::before { display: none; }
.nmf-sheet .nmf-page { column-width: 520px; column-gap: 64px; column-fill: balance; }
.nmf-sheet .nmf-page > :first-child { column-span: all; }
.nmf-pop { padding: 36px 42px 34px; font-size: 24px; }
.nmf-pop .nmf-pages { padding-inline-end: 44px; }
.nmf-pop::before { inset-block: 28px; }

.nmf-page > * { margin: 0 0 .55em; }
.nmf-page > :last-child { margin-bottom: 0; }
.nmf-page h1, .nmf-page h2, .nmf-page h3, .nmf-page h4 {
  font-family: var(--nmf-display); font-weight: 800; line-height: 1.25; color: var(--nmf-ink); letter-spacing: 0;
}
.nmf-page h1, .nmf-page h2 { font-size: 48px; }
.nmf-page h3 { font-size: 40px; }
.nmf-page h4 { font-size: 30px; }
.nmf-pop .nmf-page h3, .nmf-pop .nmf-page h2 { font-size: 32px; }
.nmf-page p { color: var(--nmf-muted); }
.nmf-page .nm-kicker, .nmf-page small {
  display: block; font-size: 20px; font-weight: 700; color: var(--nmf-accent);
}
/* tracking opens gaps in the joins of Arabic letters: Latin only */
.nmf-page .nm-kicker:dir(ltr), .nmf-page small:dir(ltr) { letter-spacing: .02em; }
.nmf-page ul, .nmf-page ol { list-style: none; padding: 0; }
.nmf-page li { position: relative; padding-inline-start: 34px; margin: .32em 0; break-inside: avoid; }
.nmf-page li::before { content: ""; position: absolute; inset-inline-start: 4px; top: .72em; width: 12px; height: 12px;
  border-radius: 4px; background: var(--nmf-accent); transform: rotate(45deg) scale(.8); }
.nmf-page ol { counter-reset: nmf; }
.nmf-page ol li { counter-increment: nmf; padding-inline-start: 50px; }
.nmf-page ol li::before { content: counter(nmf, arabic-indic); width: 34px; height: 34px; top: .18em; inset-inline-start: 0;
  transform: none; border-radius: 50%; color: #fff; font: 700 20px/34px var(--nmf-display); text-align: center; }
.nmf-page[dir="ltr"] ol li::before, .nmf[dir="ltr"] .nmf-page ol li::before { content: counter(nmf); }
.nmf-page .nm-stats { display: flex; gap: 20px; flex-wrap: wrap; }
.nmf-page .nm-stat { flex: 1 1 160px; padding: 18px 22px; border-radius: 16px;
  background: color-mix(in srgb, var(--nmf-accent) 8%, transparent); border: 1px solid color-mix(in srgb, var(--nmf-accent) 22%, transparent); }
.nmf-page .nm-stat b { display: block; font: 800 44px/1.15 var(--nmf-display); color: var(--nmf-accent); }
.nmf-page .nm-stat span { display: block; font-size: 21px; color: var(--nmf-muted); }
.nmf-page table { border-collapse: collapse; width: 100%; font-size: .85em; }
.nmf-page th, .nmf-page td { padding: 10px 14px; border-bottom: 1px solid var(--nmf-line); text-align: start; }
.nmf-page th { color: var(--nmf-muted); font-weight: 700; }
.nmf-page img { max-width: 100%; border-radius: 14px; display: block; }

/* close + pager buttons */
.nmf-close, .nmf-pg {
  all: unset; box-sizing: border-box; display: grid; place-items: center; cursor: pointer;
  width: 44px; height: 44px; border-radius: 50%; color: var(--nmf-muted);
  background: color-mix(in srgb, var(--nmf-ink) 6%, transparent); transition: background .2s, color .2s;
}
.nmf-close:hover, .nmf-pg:hover { background: var(--nmf-accent); color: #fff; }
.nmf-close { position: absolute; top: 18px; inset-inline-end: 18px; width: 40px; height: 40px; }
.nmf-pager { display: flex; align-items: center; gap: 18px; margin-top: 28px; padding-top: 22px;
  border-top: 1px solid var(--nmf-line); }
.nmf-dots { display: flex; gap: 10px; flex: 1; justify-content: center; }
.nmf-dots i { width: 10px; height: 10px; border-radius: 6px; background: var(--nmf-line); transition: width .35s cubic-bezier(.3,0,0,1), background .35s; }
.nmf-dots i.on { width: 34px; background: var(--nmf-accent); }

/* ---------- lens ---------- */
.nmf-lensbox {
  position: absolute; left: 0; top: 0; transform-origin: 0 0; border-radius: 50%;
  background: var(--nmf-paper);
  box-shadow: 0 0 0 7px var(--nmf-surface), 0 0 0 8.5px color-mix(in srgb, var(--nmf-ink) 22%, transparent),
              0 34px 80px -12px rgba(8, 12, 22, .55), 0 10px 22px -6px rgba(8, 12, 22, .3);
}
.nmf-lens-rect { border-radius: calc(var(--nmf-radius) + 6px); }
.nmf-lens-view { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; isolation: isolate; }
.nmf-lens-view > .nmf-clone { transform-origin: 0 0; }
.nmf-lens-gloss { position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background:
    radial-gradient(120% 80% at 30% 6%, rgba(255, 255, 255, .42), rgba(255, 255, 255, 0) 42%),
    radial-gradient(90% 90% at 50% 50%, rgba(0, 0, 0, 0) 62%, rgba(0, 0, 0, .16) 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .6), inset 3px 0 6px -2px rgba(255, 40, 120, .32),
              inset -3px 0 6px -2px rgba(0, 170, 255, .32), inset 0 -18px 30px -12px rgba(0, 0, 0, .18);
}
.nmf-lens-badge { position: absolute; bottom: 6%; inset-inline-start: 50%; translate: 50% 0;
  padding: 6px 16px; border-radius: 999px; background: var(--nmf-ink); color: var(--nmf-paper);
  font: 700 22px/1.2 var(--nmf-display); box-shadow: 0 6px 16px rgba(0, 0, 0, .25); }
.nmf[dir="ltr"] .nmf-lens-badge { translate: -50% 0; }
.nmf-cone-fill { fill: var(--nmf-accent); fill-opacity: .1; }
.nmf-cone-edge { stroke: color-mix(in srgb, var(--nmf-surface) 85%, transparent); stroke-width: 2; }
.nmf-origin { fill: none; stroke: var(--nmf-accent); stroke-width: 3; }

/* ---------- pins ---------- */
.nmf-pin { position: absolute; width: 0; height: 0; }
.nmf-pin-dot { position: absolute; left: -24px; top: -24px; width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center; background: var(--nmf-accent); color: #fff;
  box-shadow: 0 0 0 4px var(--nmf-surface), 0 10px 22px -4px rgba(8, 12, 22, .5);
  font: 800 24px/1 var(--nmf-display); }
.nmf-pin-dot b { font-weight: 800; }
.nmf-pin-ripple { position: absolute; left: -24px; top: -24px; width: 48px; height: 48px; border-radius: 50%;
  border: 3px solid var(--nmf-accent); opacity: 0; }
.nmf-card {
  position: absolute; left: 0; top: 0; display: flex; gap: 16px; align-items: flex-start;
  padding: 20px 24px 22px; border-radius: 18px; background: var(--nmf-surface);
  box-shadow: var(--nmf-shadow); border: 1px solid var(--nmf-line); text-align: start;
}
/* the number badge sits on the edge the leader arrives at */
.nmf[dir="rtl"] .nmf-card-left, .nmf[dir="ltr"] .nmf-card-right { flex-direction: row-reverse; }
.nmf-card-n { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in srgb, var(--nmf-accent) 14%, transparent); color: var(--nmf-accent);
  font: 800 21px/1 var(--nmf-display); margin-top: 2px; }
.nmf-card-t { flex: 1; min-width: 0; }
.nmf-card-title { font: 800 26px/1.35 var(--nmf-display); color: var(--nmf-ink); }
.nmf-card-body { margin-top: 6px; font-size: 21px; line-height: 1.6; color: var(--nmf-muted); }

/* ---------- slice ---------- */
.nmf-half-t { filter: drop-shadow(0 16px 18px rgba(8, 12, 22, .26)); }
.nmf-half-b { filter: drop-shadow(0 -14px 16px rgba(8, 12, 22, .2)); }
.nmf-half-l { filter: drop-shadow(16px 0 18px rgba(8, 12, 22, .24)); }
.nmf-half-r { filter: drop-shadow(-16px 0 18px rgba(8, 12, 22, .24)); }
.nmf-strip {
  position: absolute; left: 0; top: 0; display: grid; place-items: center; pointer-events: auto;
  background:
    repeating-linear-gradient(135deg, transparent 0 22px, color-mix(in srgb, var(--nmf-ink) 2.5%, transparent) 22px 23px),
    color-mix(in srgb, var(--nmf-paper) 88%, var(--nmf-ink));
  box-shadow: inset 0 18px 30px -18px rgba(8, 12, 22, .45), inset 0 -18px 30px -18px rgba(8, 12, 22, .35);
}
.nmf-strip-v { box-shadow: inset 18px 0 30px -18px rgba(8, 12, 22, .45), inset -18px 0 30px -18px rgba(8, 12, 22, .35); }
.nmf-strip-inner { padding: 0; font-size: 27px; line-height: 1.7; }
.nmf-strip-h .nmf-page { display: flex; flex-wrap: wrap; gap: 20px 48px; align-items: flex-start; }
.nmf-strip-h .nmf-page > :first-child { flex: 1 0 100%; }
.nmf-strip-h .nmf-page > * { margin: 0; }
.nmf-strip-h .nmf-page > p { flex: 1 1 500px; }
.nmf-strip-h .nmf-page > .nm-stats { flex: 1 1 100%; }
.nmf-cut { position: absolute; left: 0; top: 0; background: var(--nmf-accent); border-radius: 2px;
  box-shadow: 0 0 12px color-mix(in srgb, var(--nmf-accent) 70%, transparent); }
.nmf-cut-h { width: 1824px; height: 3px; }
.nmf-cut-v { width: 3px; height: 984px; }

@media (prefers-reduced-motion: reduce) {
  .nmf-dots i, .nmf-close, .nmf-pg { transition: none; }
}
/* core sets body.nm-instant for ?nm-speed=0, ?nm-print and reduced motion */
body.nm-instant :is(.nmf-dots i, .nmf-close, .nmf-pg) { transition: none !important; }
.nmf-strip .nm-stat { background: var(--nmf-surface); }
.nmf-strip-mark { position: absolute; background: var(--nmf-accent); border-radius: 3px; }
.nmf-strip-h .nmf-strip-mark { top: 0; height: 4px; }
.nmf-strip-v .nmf-strip-mark { left: 0; width: 4px; }
