/* ==========================================================================
   The Global Circle (index.html, .cw-stop--global; assets/js/global-circle.js)

   A map that plays on scroll. By default this is an ordinary stop: the copy,
   the numbers and (once the script has drawn it) the finished world map.
   The script adds .gc-live when it can drive the map, and only then does the
   stop grow several screens tall with a sticky frame, so the map stands
   still while the scroll plays it. Without the script, or under reduced
   motion, nothing here depends on scrolling.

   This stop is not a .cw-card, so dive.js leaves it where it is. When it
   plays, the map and its ground move to .gc-under, a fixed layer beneath
   the crowd's canvas, so the faces pass over the map rather than behind it.
   ========================================================================== */
.cw-stop--global, .gc-under {
  --gc-ground: #E9EFF3;
  --gc-land: #FFFFFF;
  --gc-border: #D8E1E7;
  --gc-tint: #C9D9E5;
  --gc-ink: var(--circle-ink, #1C3E55);
}

.gc-frame {
  position: relative; box-sizing: border-box;
  display: grid; grid-template-columns: minmax(280px, 34%) 1fr; grid-template-rows: 1fr auto;
  gap: 0 4vw; min-height: 100vh; min-height: 100svh;
  padding: 120px 6vw 40px 190px;            /* clear of the brand top-left and of the rail's labels at the left edge */
  background: var(--gc-ground); color: var(--gc-ink);
}
/* Soft edges, so the sheet arrives over the crowd rather than cutting in. */
.gc-frame::before, .gc-frame::after {
  content: ""; position: absolute; left: 0; right: 0; height: 18vh; pointer-events: none;
}
.gc-frame::before { bottom: 100%; background: linear-gradient(to bottom, rgba(233,239,243,0), var(--gc-ground)); }
.gc-frame::after  { top: 100%;    background: linear-gradient(to top,    rgba(233,239,243,0), var(--gc-ground)); }

.gc-copy { grid-column: 1; grid-row: 1; align-self: start; position: relative; z-index: 1; }
.gc-mark { display: block; width: 40px; height: 40px; margin-bottom: 22px; color: var(--gc-ink); }
.gc-mark svg { display: block; width: 40px; height: 40px; }
.gc-title {
  margin: 0; font-weight: 400; text-transform: uppercase; color: var(--gc-ink);
  font-size: clamp(24px, 2.6vw, 40px); letter-spacing: .14em; line-height: 1.15;
}
.gc-steps { display: grid; margin-top: 18px; }
/* All four steps share one cell; the script shows one at a time. */
.gc-step { grid-area: 1 / 1; }
.gc-kicker {
  margin: 0; font-size: 11px; letter-spacing: var(--track-mid, .18em); text-transform: uppercase;
  color: var(--circle-steel-text, #5F7182);
}
.gc-kicker::after { content: ""; display: block; width: 34px; height: 1px; margin: 14px 0 18px; background: var(--gc-ink); }
.gc-text { margin: 0; max-width: 26em; font-size: 16px; line-height: 1.7; color: var(--circle-slate, #3A4E5C); }

.gc-map { grid-column: 2; grid-row: 1 / 3; position: relative; min-height: 320px; }
/* Absolutely placed at the box's size: Safari has been known to size a
   percentage-high SVG inside a grid cell differently from Chrome. */
.gc-svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; overflow: visible; }
.gc-world, .gc-isles { fill: var(--gc-land); stroke: var(--gc-border); stroke-linejoin: round; }
.gc-world path, .gc-isles path { transition: fill .6s ease; }
.gc-world .is-origin, .gc-isles .is-origin { fill: var(--gc-tint); }
.gc-arcs { fill: none; stroke: var(--gc-ink); stroke-opacity: .42; stroke-linecap: round; }
.gc-pin__ring { fill: var(--gc-land); stroke: var(--gc-ink); }
.gc-pin__disc { fill: var(--gc-ink); }
.gc-pin__void { fill: var(--gc-land); }
.gc-home__ring { fill: none; stroke: var(--gc-ink); stroke-dasharray: none; }
.gc-home__label { fill: var(--gc-ink); font-family: inherit; letter-spacing: .16em; text-transform: uppercase; }
.gc-home__label { font-weight: 500; }

.gc-tag {
  grid-column: 1; grid-row: 2; align-self: end; margin: 0;
  font-size: 10px; letter-spacing: .3em; text-transform: uppercase; color: var(--gc-ink);
}

/* ---- Static (no script, or reduced motion): every word shows at once. ---- */
.cw-stop--global:not(.gc-live) .gc-step { grid-area: auto; }
.cw-stop--global:not(.gc-live) .gc-step + .gc-step { margin-top: 26px; }
.cw-stop--global:not(.gc-drawn) .gc-map { display: none; }
.cw-stop--global:not(.gc-drawn) .gc-frame { grid-template-columns: 1fr; }

/* ---- Live: the scroll plays the map. ---- */
.circle-world .cw-stop--global.gc-live { min-height: 560vh; }
.gc-live .gc-frame { position: -webkit-sticky; position: sticky; top: 0; height: 100vh; height: 100svh; min-height: 0; background: none; pointer-events: none; }
.gc-live .gc-frame::before, .gc-live .gc-frame::after { display: none; }
.gc-live .gc-copy { pointer-events: auto; }
/* The layer under the crowd. global-circle.js moves it with the frame and
   sizes the map box to match the frame's (empty) one. */
.gc-under {
  position: fixed; top: 0; left: 0; right: 0; z-index: 0; height: 100vh; height: 100svh;
  background: var(--gc-ground); pointer-events: none; visibility: hidden; will-change: transform;
}
.gc-under::before, .gc-under::after { content: ""; position: absolute; left: 0; right: 0; height: 18vh; pointer-events: none; }
.gc-under::before { bottom: 100%; background: linear-gradient(to bottom, rgba(233,239,243,0), var(--gc-ground)); }
.gc-under::after  { top: 100%;    background: linear-gradient(to top,    rgba(233,239,243,0), var(--gc-ground)); }
.gc-under__map { position: absolute; }
.gc-live .gc-step { opacity: 0; transform: translateY(10px); transition: opacity .5s ease, transform .5s ease; visibility: hidden; }
.gc-live .gc-step.is-on { opacity: 1; transform: none; visibility: visible; }

/* ---- Phones and tablets: copy on top, the map beneath it. ---- */
@media (max-width: 860px) {
  .gc-frame { grid-template-columns: 1fr; grid-template-rows: auto 1fr; padding: 84px 22px 70px; gap: 0; }
  .gc-map { grid-column: 1; grid-row: 2; min-height: 300px; margin: 12px -22px 0; }
  .gc-tag { display: none; }               /* the rail's pill sits in the bottom corner here */
  .gc-mark, .gc-mark svg { width: 32px; height: 32px; }
  .gc-mark { margin-bottom: 14px; }
  .gc-title { font-size: 22px; }
  .gc-steps { margin-top: 12px; }
  .gc-kicker::after { margin: 10px 0 12px; }
  .gc-text { font-size: 15px; line-height: 1.6; }
  /* world.css drops every stop's height on a phone; this one keeps its
     scroll room, because the scroll is what plays it. */
  .circle-world .cw-stop--global.gc-live { min-height: 560vh; min-height: 560svh; }
  .cw-stop--global.gc-live + .cw-stop { margin-top: 0; }
}
