/* ═══════════════════════════════════════════════════════════════════
   #features-grid "Get everyone there." 2026-10-29 rebuild.
   A night stage. The live map is real Jersey City streets
   (assets/tg/jc-night.svg, OpenStreetMap, credited), laid on a plane and
   tilted into depth with CSS 3D (no WebGL, so it stays crisp at any size
   and costs little). Friends stand on it as pins with shadows, their
   real street routes draw in behind them as they move, ETAs tick down,
   rings go from teal to the app's amber to its green, a toast says who's
   here, and the camera pushes in on Razza when the last one walks in.
   The rings, labels and toasts are the app's (VRRallyCrewFaces,
   VRRallyCrew, VRRallyTrackerHost). The ring on the ground is the 90 m
   that counts as "here".
   ⚠️ preserve-3d is undone by opacity, overflow, filter or mask on the
   plane or on a pin's box: fades go on the leaves (the face, the label),
   never on .tg-rl-plane, .tg-rl-who or .tg-rl-dest.
   ⚠️ Two ways of drawing it. Still (no JS, reduced motion): everything sits
   in the one 3D plane below, drawn once. Moving (.tg-rl-live, set by
   rally-film.js): the plane holds only the map bitmap and its transform is
   written directly; routes, ring and pins are drawn flat over it in screen
   space (.tg-rl-draw, .tg-rl-pins). Never animate CSS variables on the
   plane: that restyled and re-rasterised the whole map every frame
   (Mark, 10-29: "choppy, freezes at times").
   Shared language: together.css. Motion: rally-film.js.
   No JS or reduced motion: everyone's already at Razza.
   ═══════════════════════════════════════════════════════════════════ */

.tg-rl {
  --tg-rw: min(34vw, 470px);
  --tg-ink: #fff;
  --tg-ghost: rgba(255, 255, 255, .06);
  --tg-scr: #ffb84d;
  --tg-focus: #fff;
  --k: .6157;                          /* plane px per map unit: 2000 / 3248.3 */
  --pin-base: 1;                       /* pin size, read by rally-film.js */
  --fx: 59%; --fy: 45%;                /* where Razza sits on the stage */
  --tilt: 54deg; --spin: -16deg; --zoom: 1;
  color: #fff;
}
.tg-rl .tg-stat span { color: rgba(255, 255, 255, .8); }
.tg-rl .tg-prog [data-go] > i { background: rgba(255, 255, 255, .2); }
.tg-rl .tg-pause { background: rgba(255, 255, 255, .16); }
.tg-rl .tg-tag { background: #fff; color: #141b3d; }
.tg-rl .tg-tag::before { background: #141b3d; }
.tg-rl .tg-prog .tg-next { color: #141b3d; }

/* the words stay clear of the map on any width (2560 put "there." on Razza) */
.tg-rl .tg-line { max-width: 8.2em; }
@media (min-width: 1700px) { .tg-rl { --fx: 61%; } }

/* the sentence's objects */
.tg-rl-pill { gap: 0; padding: 0 .06em; }
.tg-rl-pill .tg-av { width: 2.3em; height: 2.3em; margin-left: -.62em; font-size: .27em; box-shadow: 0 0 0 .16em #141b3d; }
.tg-rl-pill .tg-av:first-child { margin-left: 0; }
.tg-rl-eta-pill { padding: 0 .26em; background: #ffb84d; color: #141b3d; }
.tg-rl-eta-pill b { font-size: .56em; font-weight: 800; letter-spacing: -.03em; white-space: nowrap; }
.tg-rl-here-pill { width: .84em; border-radius: 50%; background: #57c78c; color: #0b2a1a; }
.tg-rl-here-pill b { font-size: .5em; font-weight: 800; }

/* ── The map ─────────────────────────────────────────────────────── */
.tg-rl-map { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.tg-rl-cam { position: absolute; left: var(--fx); top: var(--fy); width: 0; height: 0; perspective: 1150px; }
.tg-rl-plane {
  --rx: calc(1681.4px * var(--k)); --ry: calc(1143.6px * var(--k));
  position: absolute; left: calc(var(--rx) * -1); top: calc(var(--ry) * -1);
  width: calc(3248.3px * var(--k)); height: calc(1882.2px * var(--k));
  transform-origin: var(--rx) var(--ry);
  transform: rotateX(var(--tilt)) rotateZ(var(--spin)) scale(var(--zoom));
  transform-style: preserve-3d;
}
/* the streets: a bitmap with the fade into the night baked into its alpha
   (assets/tg/jc-night.webp, made from jc-night.svg), so no mask layer */
.tg-rl-streets { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.tg-rl-routes { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.tg-rl-route { fill: none; stroke-width: 11; stroke-linecap: round; stroke-linejoin: round; }
.tg-rl-route.is-a { stroke: #3b8cf0; }
.tg-rl-route.is-m { stroke: #e8578f; }
.tg-rl-route.is-y { stroke: #8f84ff; }
.tg-rl-route.is-d { stroke: #f0893a; }
.tg-rl-plan { fill: none; stroke: rgba(255, 255, 255, .26); stroke-width: 5; stroke-dasharray: 2 16; stroke-linecap: round; }
/* the 90 m that counts as here, on the ground around Razza */
.tg-rl-ring { fill: rgba(87, 199, 140, .14); stroke: #57c78c; stroke-width: 4; transform-box: fill-box; transform-origin: center; }
.tg-rl-ring.is-2 { fill: none; opacity: 0; }

/* pins standing on the plane */
.tg-rl-who, .tg-rl-dest {
  position: absolute; left: 0; top: 0; width: 0; height: 0;
  transform: translate(calc(var(--x) * var(--k) * 1px), calc(var(--y) * var(--k) * 1px));
  transform-style: preserve-3d;
}
.tg-rl-shadow { position: absolute; left: -26px; top: -12px; width: 52px; height: 24px; border-radius: 50%; background: radial-gradient(closest-side, rgba(3, 6, 20, .7), rgba(3, 6, 20, 0)); }
.tg-rl-up {
  position: absolute; left: 0; bottom: 0; width: 0; height: 0;
  transform-origin: 0 0;
  transform: rotateZ(calc(var(--spin) * -1)) rotateX(calc(var(--tilt) * -1)) scale(var(--pin, 1));
  transform-style: preserve-3d;
}
.tg-rl-up > * { position: absolute; }
.tg-rl-face { left: -27px; bottom: 10px; width: 54px; height: 54px; }
.tg-rl-face svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.tg-rl-trk { fill: none; stroke: rgba(255, 255, 255, .22); stroke-width: 3.5; }
.tg-rl-arc { fill: none; stroke: var(--ring, #57c78c); stroke-width: 3.5; stroke-linecap: round; stroke-dasharray: 1 1; stroke-dashoffset: calc(1 - var(--p, 1)); transition: stroke .4s; }
.tg-rl-face .tg-av { position: absolute; left: 6px; top: 6px; width: 42px; height: 42px; font-size: 17px; box-shadow: 0 0 0 2.5px #fff, 0 10px 18px -6px rgba(0, 0, 0, .7); }
.tg-rl-face::after { content: ""; position: absolute; left: 50%; bottom: -9px; width: 12px; height: 10px; margin-left: -6px; background: #fff; clip-path: polygon(0 0, 100% 0, 50% 100%); }
.tg-rl-face i.tg-rl-tick { position: absolute; right: -3px; bottom: -1px; z-index: 2; display: grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; background: #57c78c; box-shadow: 0 0 0 2px #fff; }
.tg-rl-tick::before { content: ""; width: 8px; height: 4px; margin-top: -2px; border: solid #0b2a1a; border-width: 0 0 2.4px 2.4px; transform: rotate(-45deg); }
.tg-rl-eta {
  left: 34px; bottom: 30px; display: inline-flex; align-items: center; height: 28px; padding: 0 11px; border-radius: 14px;
  background: #fff; color: #141b3d; font: 800 14px/1 'Inter', sans-serif; font-variant-numeric: tabular-nums; white-space: nowrap;
  box-shadow: 0 10px 20px -10px rgba(0, 0, 0, .8);
}
.tg-rl-who.is-here .tg-rl-eta { background: #57c78c; color: #0b2a1a; }
.tg-rl-who.is-flip .tg-rl-eta { left: auto; right: 34px; }
.tg-rl-who.is-up .tg-rl-eta { left: -27px; bottom: 68px; }
/* everyone already there (the finished frame): labels tidy away */
.tg-rl:not(.gs) .tg-rl-who .tg-rl-eta { display: none; }

.tg-rl-dest { z-index: 2; }
.tg-rl-flag { left: -34px; bottom: 26px; display: flex; align-items: center; gap: 0; }
.tg-rl-flag img { position: relative; z-index: 1; width: 68px; height: 68px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 4px #fff, 0 16px 28px -10px rgba(0, 0, 0, .8); }
.tg-rl-flag b { margin-left: -14px; padding: 9px 14px 9px 22px; border-radius: 0 16px 16px 0; background: #111214; color: #fff; font: 800 19px/1 'Inter', sans-serif; letter-spacing: -.02em; white-space: nowrap; box-shadow: 0 12px 24px -10px rgba(0, 0, 0, .8); }
.tg-rl-stem { left: -2px; bottom: 0; width: 4px; height: 30px; border-radius: 2px; background: #fff; }

.tg-rl-osm { position: absolute; right: 16px; bottom: 12px; z-index: 2; color: rgba(255, 255, 255, .62); font: 500 11px/1 'Inter', sans-serif; }

/* ── Moving: the map alone on one GPU layer, the rest drawn flat ─── */
.tg-rl-draw, .tg-rl-pins { display: none; }
.tg-rl-live .tg-rl-plane { transform-style: flat; will-change: transform; }
.tg-rl-live .tg-rl-routes { display: none; }
.tg-rl-live .tg-rl-draw { position: absolute; inset: 0; display: block; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.tg-rl-live .tg-rl-pins { position: absolute; inset: 0; display: block; pointer-events: none; }
.tg-rl-live .tg-rl-pins .tg-rl-who,
.tg-rl-live .tg-rl-pins .tg-rl-dest { transform: none; transform-style: flat; will-change: transform; }
.tg-rl-live .tg-rl-pins .tg-rl-up { transform: none; transform-style: flat; }
.tg-rl-draw .tg-rl-route { stroke-width: var(--rw, 6.8px); }
.tg-rl-draw .tg-rl-plan { stroke-width: calc(var(--rw, 6.8px) * .45); stroke-dasharray: 1.5 9; }
.tg-rl-draw .tg-rl-ring { stroke-width: 2.5; }

/* legibility: the words sit on the night, the map comes in from the right */
.tg-rl-map::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg, #141b3d 0%, rgba(20, 27, 61, .92) 26%, rgba(20, 27, 61, 0) 50%);
}

/* ── The crew, as the app's people panel; the toast ──────────────── */
.tg-rl .tg-right { flex-direction: column; justify-content: flex-end; padding: clamp(24px, 4vh, 44px) 0; }
/* the toast lives on the map (top right here, top middle on phones) */
.tg-rl-toast {
  position: absolute; z-index: 3; top: clamp(24px, 4vh, 44px); right: clamp(32px, 5vw, 88px); display: flex; align-items: center; gap: 12px;
  width: min(calc(100% - 64px), 330px); margin: 0; padding: 11px 16px 11px 11px; border-radius: 22px;
  background: #fff; color: #141b3d; box-shadow: 0 26px 46px -22px rgba(0, 0, 0, .8);
}
.tg-rl-toast-ic { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; background: #141b3d; }
.tg-rl-toast-ic img { width: 26px; height: 26px; }
.tg-rl-toast b { display: block; font: 800 17px/1.15 'Inter', sans-serif; letter-spacing: -.02em; }
.tg-rl-toast span span { display: block; margin-top: 2px; color: #4b5170; font: 600 13.5px/1.2 'Inter', sans-serif; }
.tg-rl-crew {
  position: relative; z-index: 3; align-self: stretch; padding: 14px 16px 16px; border-radius: 24px;
  background: rgba(14, 19, 44, .94); box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 30px 60px -30px rgba(0, 0, 0, .9);
  margin-top: auto;
}
.tg-rl-crew-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 0 0 12px; font: 700 14px/1.2 'Inter', sans-serif; }
.tg-rl-crew-top b { color: #fff; font-weight: 700; }
.tg-rl-count { color: #57c78c; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tg-rl-crew ul { display: flex; justify-content: space-between; gap: 6px; margin: 0; padding: 0; list-style: none; }
.tg-rl-crew li { display: grid; justify-items: center; gap: 3px; min-width: 0; text-align: center; }
.tg-rl-crew .tg-rl-face { position: relative; left: auto; bottom: auto; width: 50px; height: 50px; margin-bottom: 4px; }
.tg-rl-crew .tg-rl-face::after { display: none; }
.tg-rl-crew .tg-rl-face .tg-av { left: 5px; top: 5px; width: 40px; height: 40px; font-size: 16px; box-shadow: none; }
.tg-rl-crew li > b { font: 700 13px/1.1 'Inter', sans-serif; }
.tg-rl-crew li > span { color: rgba(255, 255, 255, .8); font: 700 12.5px/1.1 'Inter', sans-serif; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tg-rl-crew li.is-here > span { color: #57c78c; }

/* ── Narrower screens: words, then the map, then the crew ────────── */
@media (max-width: 1099px) {
  .tg-rl { --fx: 50%; --fy: 54%; --k: .52; --tilt: 50deg; }
  .tg-rl.tg-stage { display: flex; flex-direction: column; }
  .tg-rl .tg-grid { display: contents; }
  .tg-rl .tg-left { order: 1; padding: 0 22px; }
  .tg-rl-map { order: 2; position: relative; inset: auto; height: clamp(380px, 62vw, 560px); margin-top: 22px; }
  .tg-rl-map::before { background: linear-gradient(#141b3d 0%, rgba(20, 27, 61, 0) 16%, rgba(20, 27, 61, 0) 84%, #141b3d 100%); }
  .tg-rl .tg-right { order: 3; margin-top: 0; padding: 0 16px; }
  .tg-rl-toast { top: 12px; left: 0; right: 0; width: min(calc(100% - 32px), 330px); margin: 0 auto; }
  .tg-rl-crew { margin-top: -10px; }
  .tg-rl .tg-ghost { top: auto; bottom: -.12em; }
}
@media (max-width: 600px) {
  .tg-rl { --k: .44; --tilt: 48deg; }
  .tg-rl .tg-left { padding: 0 18px; }
  .tg-rl-map { height: 400px; margin-top: 14px; }
  .tg-rl-toast { padding: 9px 13px 9px 9px; }
  .tg-rl-toast-ic { width: 34px; height: 34px; border-radius: 10px; }
  .tg-rl-toast-ic img { width: 22px; height: 22px; }
  .tg-rl-toast b { font-size: 15.5px; }
  .tg-rl .tg-right { padding: 0 10px; }
  .tg-rl-crew { padding: 12px 10px 14px; border-radius: 20px; }
  .tg-rl-crew ul { gap: 2px; }
  .tg-rl-crew .tg-rl-face { width: 44px; height: 44px; }
  .tg-rl-crew .tg-rl-face .tg-av { left: 4.5px; top: 4.5px; width: 35px; height: 35px; font-size: 14px; }
  .tg-rl-crew li > b { font-size: 12px; }
  .tg-rl-crew li > span { font-size: 11.5px; }
  .tg-rl-flag img { width: 54px; height: 54px; }
  .tg-rl-flag b { font-size: 16px; }
  .tg-rl-up { --pin: .86; }
  .tg-rl { --pin-base: .86; }
}

/* ── Phones and small tablets: one screen (see together.css). The map
   takes everything under the headline; the toast sits on its top edge,
   the crew on its bottom edge, and Razza a little above the middle so
   no one walks under the crew. ─────────────────────────────────────── */
@media (max-width: 899px) and (min-height: 480px) {
  .tg-rl { --fx: 42%; --fy: 47%; }
  .tg-rl .tg-left { padding: 0 16px; }
  .tg-rl-map { position: relative; inset: auto; flex: 1; min-height: 0; height: auto; margin-top: 14px; }
  .tg-rl-map::before { background: linear-gradient(#141b3d 0%, rgba(20, 27, 61, 0) 18%, rgba(20, 27, 61, 0) 70%, rgba(20, 27, 61, .7) 100%); }
  .tg-rl .tg-right { position: absolute; z-index: 2; left: 10px; right: 10px; bottom: 30px; margin: 0; padding: 0; }
  .tg-rl-crew { margin: 0; padding: 10px 10px 11px; border-radius: 20px; }
  .tg-rl-crew-top { margin-bottom: 8px; font-size: 13px; }
  .tg-rl-crew ul { gap: 2px; }
  .tg-rl-crew .tg-rl-face { width: 40px; height: 40px; margin-bottom: 2px; }
  .tg-rl-crew .tg-rl-face .tg-av { left: 4px; top: 4px; width: 32px; height: 32px; font-size: 13px; }
  .tg-rl-crew li > b { font-size: 12px; }
  .tg-rl-crew li > span { font-size: 11.5px; }
  .tg-rl-osm { top: auto; bottom: 3px; right: 14px; font-size: 9.5px; }
  /* the toast, moved here by rally-film.js: over the numbers, once they've counted */
  .tg-rl .tg-left > .tg-rl-toast { top: auto; bottom: -1px; left: 16px; right: auto; width: min(calc(100% - 32px), 400px); margin: 0; }
}
