/* The Network Map in the homepage order (#network-map; js/gr-home-map.js, js/gr-network-map.js) and
   the invoice that assembles. Shared marketing tokens only (Brand Book §5); labels and counters at
   16 px or more (§6); dark text on solid light panels over the map (§21). Layout of the live map
   and its rendered still is the same box, so the still never shifts the page. */
.nmap { position: relative; }
.gr-public .nmap { margin: 0 0 2.5rem; }
.nmap-stage { position: relative; aspect-ratio: 20 / 9; overflow: hidden; border-radius: var(--gr-operator-radius-xl); background: var(--gr-cloud-surface); box-shadow: var(--gr-cloud-elevation-1); isolation: isolate; }
.nmap-still, .nmap-thread { position: absolute; inset: 0; display: block; }
.nmap-still img, .nmap-thread img { display: block; width: 100%; height: 100%; }
.nmap-thread { opacity: 0; transition: opacity .5s var(--home-ease); }
.nmap-thread.is-on { opacity: 1; }
.nmap-canvas { position: absolute; inset: 0; z-index: 1; display: block; width: 100%; height: 100%; opacity: 0; transition: opacity .6s var(--home-ease); }
.nmap.is-live .nmap-canvas { opacity: 1; }
.nmap.is-live .nmap-still, .nmap.is-live .nmap-thread { visibility: hidden; transition: visibility 0s .6s; }

/* Labels: placed by fractions of the box on the still, by the scene (transform) when live. */
.nmap-labels { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
/* --x/--y (wide) and --px/--py (phone) are written on each label by the build; these are only defaults. */
.nmap-label, .nmap-place { --x: 50%; --y: 50%; --px: 50%; --py: 50%; position: absolute; left: var(--x); top: var(--y); }
.nmap.is-live .nmap-label, .nmap.is-live .nmap-place { left: 0; top: 0; will-change: transform; }
.nmap-box { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; padding: .35rem .75rem .4rem; white-space: nowrap; border-radius: var(--gr-operator-radius-md); background: var(--gr-cloud-surface); color: var(--text-light); font-size: 1rem; line-height: 1.3; box-shadow: var(--gr-cloud-elevation-1); }
.nmap-box strong { color: var(--gr-cloud-text); font-size: 1.0625rem; font-weight: 650; }
.nmap-load { color: var(--gr-cloud-primary); font-weight: 600; }
.nmap-load:empty { display: none; }
.nmap-label.is-active .nmap-box { box-shadow: inset 4px 0 0 var(--home-rail, var(--accent)), var(--gr-cloud-elevation-1); padding-left: 1rem; }
.nmap-label--kitchen .nmap-box { box-shadow: inset 4px 0 0 var(--accent), var(--gr-cloud-elevation-1); padding-left: 1rem; }
.nmap-label[data-side="right"] .nmap-box { transform: translate(16px, -50%); }
.nmap-label[data-side="left"] .nmap-box { transform: translate(calc(-100% - 16px), -50%); }
.nmap-label[data-side="below"] .nmap-box { transform: translate(-50%, 20px); }
.nmap-place { width: 8em; margin: -.7em 0 0 -4em; text-align: center; font-size: 1rem; font-weight: 500; letter-spacing: .04em; color: var(--gr-cloud-text); }
.nmap-place[data-kind="water"] { letter-spacing: .12em; }
[data-light="night"] .nmap-place { color: var(--gr-cloud-surface); }

/* Counters: over the lake at the bottom right on wide screens, under the map on phones. */
.nmap-count { position: absolute; right: 1.25rem; bottom: 1.25rem; z-index: 3; display: grid; grid-template-columns: auto auto; gap: .1rem 2rem; max-width: 24rem; margin: 0; padding: 1rem 1.25rem .9rem; border-radius: var(--gr-operator-radius-lg); background: var(--gr-cloud-surface); box-shadow: var(--gr-cloud-elevation-2); }
.gr-public .nmap-count p { margin: 0; }
.nmap-figure { color: var(--text-light); font-size: 1rem; }
.nmap-figure strong { display: block; color: var(--gr-cloud-primary); font-size: 2.5rem; line-height: 1.05; letter-spacing: -.02em; font-weight: 700; font-variant-numeric: tabular-nums; }
.gr-public .nmap-count .nmap-note { grid-column: 1 / -1; margin: .5rem 0 0; color: var(--text-light); font-size: 1rem; line-height: 1.4; }
.gr-public .nmap-count .nmap-note + .nmap-note { margin-top: .15rem; }
.nmap-note a { color: inherit; }

@media (max-width: 699px) {
  .gr-public .nmap { margin-bottom: 2rem; }
  .nmap-stage { aspect-ratio: 9 / 10; border-radius: var(--gr-operator-radius-lg); }
  .nmap-label, .nmap-place { left: var(--px); top: var(--py); }
  .nmap-label[data-pside="right"] .nmap-box { transform: translate(12px, -50%); }
  .nmap-label[data-pside="left"] .nmap-box { transform: translate(calc(-100% - 12px), -50%); }
  .nmap-label[data-pside="below"] .nmap-box { transform: translate(-50%, 16px); }
  .nmap-label[data-pside="above"] .nmap-box { transform: translate(-50%, calc(-100% - 16px)); }
  .nmap-label[data-pside="belowleft"] .nmap-box { transform: translate(calc(-100% + 28px), 16px); }
  .nmap-town, .nmap-load, .nmap-place[data-kind="town"] { display: none; }
  .nmap-box { padding: .3rem .65rem .35rem; }
  .nmap-box strong { font-size: 1rem; }
  .nmap-label.is-active .nmap-box, .nmap-label--kitchen .nmap-box { padding-left: .85rem; }
  .nmap-count { position: relative; right: auto; bottom: auto; max-width: none; margin: -1.5rem .75rem 0; gap: .1rem 1.5rem; padding: .9rem 1rem .8rem; }
  .nmap-figure strong { font-size: 2.125rem; }
}
@media (max-width: 359px) {
  .nmap-count { margin-inline: .25rem; grid-template-columns: 1fr; }
  .nmap-figure strong { display: inline; margin-right: .35rem; font-size: 1.75rem; }
}

/* The invoice that assembles (GSAP sets --inv-thread and --inv-rail while it runs, then reverts). */
.nmap-assembling .gr-inv-scroll { perspective: 1400px; }
.nmap-assembling .gr-inv-farm { --inv-rail: var(--gr-cloud-primary); --inv-thread: 1; --inv-rail-o: 1; position: relative; backface-visibility: hidden; }
.nmap-assembling .gr-inv-farm::before { content: ""; position: absolute; left: 0; right: 0; top: 0; z-index: 1; height: 3px; background: var(--inv-rail); transform: scaleX(var(--inv-thread)); transform-origin: left; opacity: var(--inv-rail-o); }
/* The sheet grows from the kitchen (or Check out), or rises on a phone; GSAP sets only these properties. */
.gr-inv-dialog.nmap-assembling { --nmap-s: 1; --nmap-y: 0px; --nmap-o: 1; --nmap-ox: 50%; --nmap-oy: 50%; transform: translateY(var(--nmap-y)) scale(var(--nmap-s)); transform-origin: var(--nmap-ox) var(--nmap-oy); opacity: var(--nmap-o); }
/* The backdrop fades in rather than appearing at full strength in one frame (the class is set in the same task
   as showModal and removed after the assembly, when the backdrop is already at full strength). */
.gr-inv-dialog.nmap-assembling::backdrop { animation: nmap-backdrop-in .7s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes nmap-backdrop-in { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .nmap-thread, .nmap-canvas { transition: none; }
}
