/* Greenwich Mercantile · "Why Greenwich" platform stack.

   A small model built bottom-up while the stage is pinned: licensed customs
   brokers, the trade compliance platform on top of them, the apps on top of
   that. The section layout, pinning and chapter copy stay in
   /assets/globe/scroll-globe.css (the stack uses the globe's reading model);
   platform-stack.js draws the model into an SVG as a pure function of scroll
   progress. This file only colours it.

   Canonical Greenwich tokens only: navy, midnight, cream, paper, slate and
   navy hairlines; Playfair Display for names, Switzer for everything else.
   Shading is navy mixed into paper (and black into navy), never a new hue. */

.why-globe__instrument.why-stack {
  aspect-ratio: auto;
  width: min(100%, 800px);
  height: min(calc(100svh - 3rem), 780px);
}

/* The globe's ring and meridian belong to the globe. */
.why-globe__instrument.why-stack::before,
.why-globe__instrument.why-stack::after {
  content: none;
}

.why-stack__scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  user-select: none;
  font-feature-settings: "lnum" 1;
}

/* ----- ground, places and shadows ----- */

.why-stack__ground line {
  stroke: var(--gm-navy, #0A1628);
  stroke-opacity: 0.11;
  stroke-width: 1;
}

.why-stack__slot {
  fill: none;
  stroke: var(--gm-navy, #0A1628);
  stroke-opacity: 0.5;
  stroke-width: 1;
  stroke-dasharray: 4 5;
  stroke-linejoin: round;
}

.why-stack__shadow {
  fill: var(--gm-navy, #0A1628);
  fill-opacity: 0.2;
}

/* On the navy brokers layer the place is drawn in cream and the shadow in
   black. */
.why-stack__marks--on-navy .why-stack__slot {
  stroke: var(--gm-cream, #FAFAF8);
  stroke-opacity: 0.42;
}

.why-stack__marks--on-navy .why-stack__shadow {
  fill: #000000;
  fill-opacity: 0.42;
}

/* ----- the model ----- */

.why-stack__face {
  stroke-width: 1;
  stroke-linejoin: round;
}

.why-stack__part--paper .why-stack__face {
  stroke: var(--gm-navy, #0A1628);
}

.why-stack__part--paper .why-stack__face--top {
  fill: var(--gm-paper, #FFFFFF);
}

.why-stack__part--paper .why-stack__face--front {
  fill: #FCFCFB;
  fill: color-mix(in srgb, var(--gm-navy, #0A1628) 1.2%, var(--gm-paper, #FFFFFF));
}

.why-stack__part--paper .why-stack__face--side {
  fill: #E9EAEB;
  fill: color-mix(in srgb, var(--gm-navy, #0A1628) 9%, var(--gm-paper, #FFFFFF));
}

.why-stack__part--navy .why-stack__face {
  stroke: rgba(250, 250, 248, 0.14);
}

.why-stack__part--navy .why-stack__face--top {
  fill: var(--gm-midnight, #162032);
}

.why-stack__part--navy .why-stack__face--front {
  fill: var(--gm-navy, #0A1628);
}

.why-stack__part--navy .why-stack__face--side {
  fill: #07101D;
  fill: color-mix(in srgb, #000000 28%, var(--gm-navy, #0A1628));
}

.why-stack__grid line {
  stroke: var(--gm-navy, #0A1628);
  stroke-opacity: 0.09;
  stroke-width: 1;
}

/* ----- labels on the front faces ----- */

.why-stack__title,
.why-stack__name {
  font-family: var(--gm-font-serif);
  font-weight: 400;
  letter-spacing: -0.01em;
}

.why-stack__eyebrow,
.why-stack__aside {
  font-family: var(--gm-font-sans);
  font-weight: 500;
  letter-spacing: 0.2em;
}

.why-stack__part--paper .why-stack__label text {
  fill: var(--gm-navy, #0A1628);
}

.why-stack__part--paper .why-stack__eyebrow,
.why-stack__part--paper .why-stack__aside {
  fill: var(--gm-slate, #425066);
}

.why-stack__part--navy .why-stack__label text {
  fill: var(--gm-cream, #FAFAF8);
}

.why-stack__part--navy .why-stack__eyebrow,
.why-stack__part--navy .why-stack__aside {
  fill: rgba(250, 250, 248, 0.62);
}

/* ----- the finished stack, flat: no script, or before it runs ----- */

.why-stack__flat {
  position: absolute;
  inset: 16% 7% 18%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: var(--gm-navy);
  font-family: var(--gm-font-sans);
}

.why-globe[data-stack-ready="1"] .why-stack__flat {
  display: none;
}

.why-stack__flat p {
  margin: 0;
}

.why-stack__flat-apps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6%;
  padding: 0 12%;
}

.why-stack__flat-apps p {
  display: grid;
  place-items: center;
  min-height: 6.5em;
  padding: 0.9em 0.6em;
  border: 1px solid var(--gm-navy);
  border-bottom: 0;
  background: var(--gm-paper);
  font-family: var(--gm-font-serif);
  font-size: clamp(0.8rem, 2.6cqi, 1.2rem);
  line-height: 1.2;
  text-align: center;
}

.why-stack__flat-slab {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  column-gap: 1rem;
  row-gap: 0.35rem;
  padding: 1em 1.3em 1.15em;
  border: 1px solid var(--gm-navy);
  background: var(--gm-paper);
}

.why-stack__flat-slab small,
.why-stack__flat-slab em {
  color: var(--gm-slate);
  font-size: 0.6rem;
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.why-stack__flat-slab small {
  grid-column: 1 / -1;
}

.why-stack__flat-slab span {
  font-family: var(--gm-font-serif);
  font-size: clamp(1rem, 3.3cqi, 1.6rem);
  line-height: 1.15;
}

.why-stack__flat-slab--brokers {
  margin: 0 -4%;
  border-color: var(--gm-navy);
  background: var(--gm-navy);
  color: var(--gm-cream);
}

.why-stack__flat-slab--brokers small,
.why-stack__flat-slab--brokers em {
  color: rgba(250, 250, 248, 0.62);
}

@media (max-width: 900px) {
  .why-globe__instrument.why-stack {
    width: 100%;
    height: 100%;
  }

  /* Phones: the drawing runs edge to edge, and the chapters scroll under
     it rather than over it. */
  .why-globe[data-scroll-stack] .why-globe__visual {
    z-index: 3;
    margin-right: calc(50% - 50vw);
    margin-left: calc(50% - 50vw);
    padding: 0;
  }

  .why-stack__flat {
    inset: 6% 2% 14%;
  }

  .why-stack__flat-slab em {
    display: none;
  }
}
