/* Greenwich Mercantile scroll globe.
   Uses Landed Cost Desk's Natural Earth orthographic treatment with
   screen-tuned 110m geometry for responsive chapter motion.
   Presentation uses only canonical Greenwich tokens from shared/base.css. */

/* Preserve horizontal clipping without creating the hidden overflow container
   that prevents position: sticky from tracking the page scroll. */
html, body { overflow-x: clip; }

.why-globe {
  --why-globe-progress: 0;
  position: relative;
  background:
    linear-gradient(to right, rgba(10, 22, 40, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(10, 22, 40, 0.03) 1px, transparent 1px),
    var(--gm-cream);
  background-size: 60px 60px;
  color: var(--gm-navy);
  border-top: 1px solid var(--gm-line);
  border-bottom: 1px solid var(--gm-line);
}

.why-globe__intro {
  width: min(100%, 1380px);
  margin: 0 auto;
  padding: clamp(5rem, 8vw, 8.5rem) 4rem clamp(2rem, 4vw, 4.5rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 3rem;
}

.why-globe__intro h2 {
  max-width: 760px;
  margin: 0;
}

.why-globe__stage {
  width: min(100%, 1480px);
  margin: 0 auto;
  padding: 0 4rem;
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(360px, 0.82fr);
  gap: clamp(3rem, 7vw, 8rem);
  align-items: start;
}

.why-globe__visual {
  position: sticky;
  top: 0;
  height: 100svh;
  display: grid;
  place-items: center;
  align-self: start;
}

.why-globe__instrument {
  position: relative;
  width: min(100%, 760px);
  aspect-ratio: 1;
  container-type: inline-size;
}

.why-globe__instrument::before,
.why-globe__instrument::after {
  content: "";
  position: absolute;
  z-index: 2;
  pointer-events: none;
}

.why-globe__instrument::before {
  inset: 5.5%;
  border: 1px solid rgba(10, 22, 40, 0.14);
  border-radius: 50%;
}

.why-globe__instrument::after {
  left: 50%;
  top: 2%;
  bottom: 2%;
  width: 1px;
  background: linear-gradient(to bottom, transparent, rgba(10, 22, 40, 0.18) 18%, rgba(10, 22, 40, 0.18) 82%, transparent);
  transform: translateX(-50%);
}

.why-globe__world {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  contain: strict;
}

.why-globe__readout {
  position: absolute;
  left: 50%;
  bottom: 4%;
  z-index: 3;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.8rem;
  background: rgba(250, 250, 248, 0.9);
  border: 1px solid rgba(10, 22, 40, 0.16);
  font-family: var(--gm-font-mono);
  font-size: 0.67rem;
  line-height: 1;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  white-space: nowrap;
}

.why-globe__readout::before {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--gm-navy);
  opacity: 0.74;
}

.why-globe__chapters {
  position: relative;
}

.why-globe__chapter {
  /* Exactly one viewport per chapter: a snapped chapter aligns the stage with
     the viewport, so the sticky globe never drifts between chapters. */
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 7rem 0;
  border-top: 1px solid rgba(10, 22, 40, 0.16);
  opacity: 0.32;
  transform: translateY(1.5rem);
  transition: opacity 320ms ease, transform 480ms var(--gm-ease);
}

.why-globe__chapter:last-child {
  border-bottom: 1px solid rgba(10, 22, 40, 0.16);
}

.why-globe__chapter.is-active {
  opacity: 1;
  transform: translateY(0);
}

@media (min-width: 901px) and (prefers-reduced-motion: no-preference) {
  .why-globe__stage {
    height: 100svh;
    overflow: clip;
  }

  .why-globe__visual {
    position: relative;
  }

  .why-globe__chapters {
    height: 100svh;
  }

  .why-globe__chapter {
    position: absolute;
    inset: 0;
    min-height: 100svh;
    z-index: 0;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    contain: layout paint;
    will-change: opacity, transform;
    backface-visibility: hidden;
    transition:
      opacity 180ms ease,
      transform 320ms var(--gm-ease),
      visibility 0s linear 320ms;
  }

  .why-globe__chapter.is-active {
    z-index: 1;
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transition-delay: 0s;
  }

  .why-globe__chapter.is-leaving {
    z-index: 1;
    visibility: visible;
    opacity: 0;
    transform: translateY(-0.8rem);
    pointer-events: none;
    transition:
      opacity 190ms ease,
      transform 260ms var(--gm-ease),
      visibility 0s;
  }

  .why-globe__chapter.is-entering {
    z-index: 1;
    visibility: visible;
    opacity: 0;
    transform: translateY(0.8rem);
    pointer-events: none;
    transition: none;
  }
}

.why-globe__number {
  margin-bottom: clamp(2rem, 5vw, 4.5rem);
  font-family: var(--gm-font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.why-globe__chapter h3 {
  max-width: 560px;
  margin: 0 0 1.35rem;
  font-family: var(--gm-font-serif);
  font-size: clamp(2rem, 3.5vw, 3.8rem);
  font-weight: 400;
  line-height: 1.03;
  letter-spacing: -0.03em;
}

.why-globe__copy {
  max-width: 530px;
  margin: 0 0 clamp(2.5rem, 5vw, 5rem);
  color: var(--gm-grey);
  font-size: clamp(1rem, 1.4vw, 1.18rem);
  line-height: 1.75;
}

.why-globe__fact {
  display: grid;
  grid-template-columns: minmax(90px, auto) 1fr;
  align-items: baseline;
  gap: 1.25rem;
  padding-top: 1.15rem;
  border-top: 1px solid rgba(10, 22, 40, 0.18);
  font-family: var(--gm-font-mono);
}

.why-globe__fact strong {
  font-family: var(--gm-font-serif);
  font-size: clamp(1.45rem, 2.4vw, 2.15rem);
  font-weight: 400;
  letter-spacing: -0.02em;
}

.why-globe__fact span {
  color: var(--gm-grey);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 900px) {
  .why-globe__intro {
    padding: 5rem 1.25rem 2.5rem;
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .why-globe__stage {
    padding: 0 1.25rem;
    display: block;
  }

  .why-globe__visual {
    top: 72px;
    z-index: 1;
    height: 43svh;
    margin: 0 -1.25rem;
    padding: 0 1.25rem;
    background:
      linear-gradient(to right, rgba(10, 22, 40, 0.03) 1px, transparent 1px),
      linear-gradient(to bottom, rgba(10, 22, 40, 0.03) 1px, transparent 1px),
      var(--gm-cream);
    background-size: 60px 60px;
  }

  .why-globe__instrument {
    width: min(84vw, 420px);
  }

  .why-globe__chapters {
    z-index: 2;
    margin-top: -43svh;
  }

  .why-globe__chapter {
    position: relative;
    min-height: 100svh;
    margin: 0 -0.15rem;
    padding: 57svh 1.15rem 5rem;
    border: 0;
    background: linear-gradient(to bottom, transparent 0, transparent 53svh, rgba(250, 250, 248, 0.97) 53svh);
    opacity: 0.42;
  }

  .why-globe__chapter::before {
    content: "";
    position: absolute;
    top: 53svh;
    left: 1.15rem;
    right: 1.15rem;
    border-top: 1px solid rgba(10, 22, 40, 0.16);
  }

  .why-globe__chapter:last-child {
    border-bottom: 0;
  }

  .why-globe__chapter h3 {
    font-size: clamp(2.15rem, 10vw, 3.25rem);
  }

  .why-globe__copy {
    margin-bottom: 3rem;
  }
}

@media (max-width: 520px) {
  .why-globe__readout { bottom: 1%; }
  .why-globe__visual { height: 40svh; }
  .why-globe__chapters { margin-top: -40svh; }
  .why-globe__chapter {
    min-height: 100svh;
    padding-top: 54svh;
    background: linear-gradient(to bottom, transparent 0, transparent 50svh, rgba(250, 250, 248, 0.97) 50svh);
  }
  .why-globe__chapter::before { top: 50svh; }
}

@media (prefers-reduced-motion: reduce) {
  .why-globe__chapter {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
