/* stylelint-disable property-no-vendor-prefix, value-no-vendor-prefix */

@property --gg-nav-h {
  syntax: '<length>';
  inherits: true;
  initial-value: 124px;
}

.globe-gallery,
.globe-gallery-cursor {
  --gg-chrome-blur: 12px;
}

.globe-gallery {
  --gg-hang-max: 0.8em;
  --gg-runway-height: 550vh;
  --gg-formation-vh: 380vh;

  /* The pull-quote's own left text edge, reused by the arc copy. */
  --gg-copy-max: 1920px;
  --gg-copy-pad: var(--s2a-spacing-lg);
  --gg-content-inset: calc(max(0px, 100% - var(--gg-copy-max)) / 2 + var(--gg-copy-pad));
  --gg-crosshair-width: 1px;
  --gg-controls-size: 48px;
  --gg-controls-radius: 6px;
  --gg-controls-inset: var(--s2a-spacing-md);
  --gg-modal-anim-ms: 350;
  --gg-nav-h: calc(var(--gnav-height-nav, 72px) + var(--feds-breadcrumbs-height, 52px));
  --gg-band-h: calc(100vh - var(--gg-nav-h));
  --gg-optical-center: calc(var(--gg-nav-h) + var(--gg-band-h) / 2);
  --gg-controls-top: calc(var(--gg-nav-h) + var(--gg-controls-inset));

  height: var(--gg-runway-height);
  position: relative;
  background: var(--s2a-color-gray-900);
  margin-top: 0;
  overflow-x: clip; /* prevent sticky descendants from creating a horizontal scrollbar */
  -webkit-tap-highlight-color: transparent;

  &.globe-gallery-reduced,
  &.globe-gallery-empty {
    height: auto;
    min-height: 0;
  }
}

/* Custom cursor (src/cursor.js). */
@media (hover: hover) and (pointer: fine) {
  .globe-gallery-cursor {
    pointer-events: none;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 17;
  }

  .globe-gallery-cursor-disc {
    pointer-events: none;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 16;
    width: 48px;
    height: 48px;
    margin: -24px;
    border-radius: 50%;
    background: var(--s2a-color-gray-25);
    mix-blend-mode: difference;
    transform: scale(0);
    visibility: hidden;
    transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  .globe-gallery-cursor-disc-active {
    transform: scale(1);
    visibility: visible;
  }

  .globe-gallery-cursor-disc-dragging {
    transform: scale(0.82);
    transition: transform 0.15s ease;
  }

  .globe-gallery-cursor-ring-wrap,
  .globe-gallery-cursor-text-wrap {
    position: absolute;
    top: 0;
    left: 0;
  }

  .globe-gallery-cursor-text-wrap {
    display: flex;
    align-items: center;
    padding: var(--s2a-spacing-2xs) var(--s2a-spacing-xs);
    border-radius: var(--s2a-border-radius-xs);
    background: var(--s2a-color-transparent-black-64);
    -webkit-backdrop-filter: blur(var(--gg-chrome-blur));
    backdrop-filter: blur(var(--gg-chrome-blur));
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.42s ease;
  }

  .globe-gallery-cursor-ring {
    display: block;
    position: absolute;
    top: -24px;
    left: -24px;
    width: 48px;
    height: 48px;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.5);
    transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  .globe-gallery-cursor-active .globe-gallery-cursor-ring {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
  }

  .globe-gallery-cursor-dragging .globe-gallery-cursor-ring {
    transform: scale(0.82);
    transition: opacity 0.35s ease, transform 0.15s ease;
  }

  .globe-gallery-cursor-chevron-l,
  .globe-gallery-cursor-chevron-r {
    transition: transform 0.15s ease;
  }

  .globe-gallery-cursor-dragging .globe-gallery-cursor-chevron-l { transform: translateX(4px); }
  .globe-gallery-cursor-dragging .globe-gallery-cursor-chevron-r { transform: translateX(-4px); }

  .globe-gallery-cursor-text {
    display: block;
    font-family: var(--heading-font-family);
    font-size: var(--s2a-font-size-xs);
    font-weight: var(--s2a-font-weight-adobe-clean-bold);
    letter-spacing: 0.02em;
    white-space: nowrap;
    line-height: 1;
    color: var(--s2a-color-gray-25);
  }

  .globe-gallery-cursor-active .globe-gallery-cursor-text-wrap {
    opacity: 0.9;
    visibility: visible;
    transition-delay: 0.15s;
  }

  .globe-gallery-cursor-retiring .globe-gallery-cursor-text-wrap,
  .globe-gallery-cursor-retiring .globe-gallery-cursor-ring,
  .globe-gallery-cursor-disc-retiring {
    opacity: 0;
    transition: opacity 0.42s ease, transform 0.42s ease;
  }

  .globe-gallery-cursor-retiring .globe-gallery-cursor-ring,
  .globe-gallery-cursor-disc-retiring {
    transform: scale(0.6);
  }
}

@media (width >= 768px) {
  .globe-gallery {
    --gg-formation-vh: 360vh;
    --gg-copy-pad: var(--s2a-spacing-3xl);
    --gg-controls-inset: var(--s2a-spacing-lg);
  }
}

@media (width >= 1440px) {
  .globe-gallery { --gg-copy-pad: var(--s2a-spacing-4xl); }
}

.globe-gallery-canvas,
.globe-gallery-modal-canvas {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.globe-gallery-world {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: visible;
  pointer-events: none;
  z-index: 0;
}

.globe-gallery-controls {
  position: fixed;
  inset: 0;
  pointer-events: none; /* not intercepting canvas drag */
  z-index: 1;
  opacity: 0;
  visibility: hidden; /* pulls the buttons out of the tab order while the globe isn't live */

  /* visibility flips AFTER the fade, never during: an interpolated `visible` would leave the
     buttons tappable and tabbable at opacity 0 for the whole 0.35s. */
  transition: opacity 0.35s ease, visibility 0s linear 0.35s;
}

.globe-gallery-controls.is-visible {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.35s ease, visibility 0s;
}

.globe-gallery-control {
  width: var(--gg-controls-size);
  height: var(--gg-controls-size);
  flex: none;
  box-sizing: border-box;
  padding: 0;
  border-radius: var(--gg-controls-radius);
  border: var(--s2a-border-width-sm) solid var(--s2a-color-transparent-white-24);
  background: var(--s2a-color-transparent-black-64);
  -webkit-backdrop-filter: blur(var(--gg-chrome-blur));
  backdrop-filter: blur(var(--gg-chrome-blur));
  color: var(--s2a-color-gray-25);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  pointer-events: auto;
  transition: background 0.2s ease, transform 0.2s ease;
}

.globe-gallery-control:hover {
  background: var(--s2a-color-transparent-black-80);
  transform: scale(1.05);
}

.globe-gallery-control:active { transform: scale(0.98); }

.globe-gallery-spin-toggle {
  position: absolute;
  top: var(--gg-controls-top);
  inset-inline-end: var(--gg-controls-inset);
}

.globe-gallery-spin-toggle .globe-gallery-icon-play { display: none; }
.globe-gallery-spin-toggle.is-paused .globe-gallery-icon-pause { display: none; }
.globe-gallery-spin-toggle.is-paused .globe-gallery-icon-play { display: block; }

.globe-gallery-hint { display: none; } /* barrel only */

.globe-gallery-barrel .globe-gallery-hint {
  position: absolute;
  inset-inline: var(--gg-controls-inset);
  bottom: var(--gg-controls-inset);
  display: flex;
  align-items: center;
  gap: var(--s2a-spacing-md);
}

.globe-gallery-hint-text {
  flex: 1;
  margin: 0;
  color: var(--s2a-color-gray-25);
  font-family: var(--body-font-family);
  font-size: var(--s2a-font-size-sm);
  font-weight: var(--s2a-font-weight-body);
  line-height: 1.35;
  text-align: center;
  text-wrap: balance;
  user-select: none;
  box-sizing: border-box;
  padding: var(--s2a-spacing-xs) var(--s2a-spacing-sm);
  border: var(--s2a-border-width-sm) solid var(--s2a-color-transparent-white-00);
  border-radius: var(--gg-controls-radius);
  background: var(--s2a-color-transparent-black-64);
  -webkit-backdrop-filter: blur(var(--gg-chrome-blur));
  backdrop-filter: blur(var(--gg-chrome-blur));

  & > p { margin: 0; }
}

.globe-gallery-barrel .globe-gallery-hint-text {
  transition: opacity 0.5s ease, visibility 0s;
}

.globe-gallery-barrel .globe-gallery-hint.is-dismissed .globe-gallery-hint-text {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0s linear 0.5s;
}

.globe-gallery-arc-copy {
  --gg-arc-pad: var(--s2a-spacing-md);

  position: fixed;

  /* Full width less a gap each side, capped. */
  width: calc(100% - var(--s2a-spacing-xs) * 2);
  max-width: 359px;
  bottom: var(--s2a-spacing-xs);

  /* The pill hugs the edge; its own padding lands the copy on --gg-content-inset. */
  inset-inline-start: var(--s2a-spacing-xs);
  box-sizing: border-box;
  padding: var(--gg-arc-pad);
  background: var(--s2a-color-transparent-black-64);
  -webkit-backdrop-filter: blur(var(--s2a-blur-lg));
  backdrop-filter: blur(var(--s2a-blur-lg));
  border-radius: var(--s2a-border-radius-md);
  pointer-events: none;
  opacity: 0;
  will-change: opacity, transform;
  transform-origin: left bottom;
}

html[dir="rtl"] .globe-gallery-arc-copy {
  transform-origin: right bottom;
}

.globe-gallery-arc-copy-title {
  /* 18px: between Title-4 and body — no standard type class fits. */
  font-family: var(--heading-font-family);
  font-weight: var(--s2a-font-weight-adobe-clean-black);
  font-size: var(--s2a-font-size-lg);
  line-height: var(--s2a-font-line-height-21);

  /* stylelint-disable-next-line custom-property-pattern -- upstream S2A token has an underscore */
  letter-spacing: var(--s2a-font-letter-spacing-neg-0_48);
  color: var(--s2a-color-gray-25);
  margin: 0 0 var(--s2a-spacing-2xs);
}

.globe-gallery-arc-copy-body {
  font-family: var(--body-font-family);
  color: var(--s2a-color-gray-400);
  margin: 0;
}

/* Ends half a quote box above the runway end, so the rail lets go as the next section's top reaches
   the quote's bottom edge. Clamped to the reveal point; unmeasured falls back past that ceiling. */
.globe-gallery-pullquote-pin {
  position: absolute;
  top: var(--gg-formation-vh);
  bottom: clamp(0px, var(--gg-pq-half-box, var(--gg-runway-height)), calc(
    (1 - var(--gg-pq-appear-t, 0.42)) * (var(--gg-runway-height) - var(--gg-formation-vh))
      - var(--gg-optical-center)
  ));
  left: 0;
  right: 0;
  pointer-events: none;
}

.globe-gallery-pullquote-rail {
  position: sticky;
  top: var(--gg-optical-center);
  height: 0;
}

.globe-gallery-pullquote {
  --gg-pq-ideal-gap: var(--s2a-layout-lg);

  /* Yields on short viewports so a long quote can't outgrow the band. */
  --gg-pq-gap: min(var(--gg-pq-ideal-gap), calc(var(--gg-band-h) * 0.2));
  --gg-pq-pad-block: var(--gg-copy-pad);
  --gg-pq-copy-rise: 14px;
  --gg-pq-line-start: 120%; /* how far below its mask a line waits, as a share of its own height */
  --gg-pq-line-bleed: 0.14em; /* mask headroom for ascenders/descenders, taken back off the flow */
  --gg-pq-rule-color: var(--s2a-color-gray-800);

  position: absolute;
  top: 0;
  inset-inline: 0;
  box-sizing: border-box;
  max-width: var(--gg-copy-max);
  margin: 0 auto;
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: var(--gg-pq-gap);
  padding-block: var(--gg-pq-pad-block);
  padding-inline: var(--gg-copy-pad);

  /* Centred on the optical centre until the box is taller than the band, then top-anchored: a
     long quote overflows downward only, never under the nav. */
  transform: translateY(max(-50%, calc(var(--gg-band-h) * -0.5)));
}

/* Four rules at the same insets, drawn by masking. */
.globe-gallery-pullquote::before,
.globe-gallery-pullquote::after {
  content: '';
  position: absolute;
  pointer-events: none;

  /* Longhands, not the `border` shorthand: an unresolvable var() colour inside a shorthand is
     invalid at computed-value time and resets border-style to none, erasing every rule. */
  border-style: solid;
  border-width: 0;
  border-color: var(--gg-pq-rule-color, currentcolor);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

/* Each rule is masked to the fraction of itself that is drawn, measured along its OWN clockwise
   direction — top runs left→right, right top→bottom, bottom right→left, left bottom→top. The
   gradient's direction encodes that clockwise sense, so a var never needs to know which edge it is
   on — and since the horizontals always share a fraction, as do the verticals, two vars cover four
   rules. JS writes them per frame; the 100% fallbacks mean no-JS renders the complete crosshair. */
.globe-gallery-pullquote::before {
  inset-block: var(--gg-pq-pad-block);
  inset-inline: 0;
  border-block-width: var(--gg-crosshair-width);
  -webkit-mask-image:
    linear-gradient(to right, #000 var(--gg-pq-h, 100%), transparent var(--gg-pq-h, 100%)),
    linear-gradient(to left, #000 var(--gg-pq-h, 100%), transparent var(--gg-pq-h, 100%));
  mask-image:
    linear-gradient(to right, #000 var(--gg-pq-h, 100%), transparent var(--gg-pq-h, 100%)),
    linear-gradient(to left, #000 var(--gg-pq-h, 100%), transparent var(--gg-pq-h, 100%));
  -webkit-mask-position: left top, left bottom;
  mask-position: left top, left bottom;
  -webkit-mask-size: 100% 51%;
  mask-size: 100% 51%;
}

/* 51% per half so a subpixel box height can't leave a rule half-masked; the halves overlap across
   the middle, where there is nothing to draw. */
.globe-gallery-pullquote::after {
  inset-block: 0;
  inset-inline: var(--gg-copy-pad);
  border-inline-width: var(--gg-crosshair-width);
  -webkit-mask-image:
    linear-gradient(to bottom, #000 var(--gg-pq-v, 100%), transparent var(--gg-pq-v, 100%)),
    linear-gradient(to top, #000 var(--gg-pq-v, 100%), transparent var(--gg-pq-v, 100%));
  mask-image:
    linear-gradient(to bottom, #000 var(--gg-pq-v, 100%), transparent var(--gg-pq-v, 100%)),
    linear-gradient(to top, #000 var(--gg-pq-v, 100%), transparent var(--gg-pq-v, 100%));
  -webkit-mask-position: right top, left top;
  mask-position: right top, left top;
  -webkit-mask-size: 51% 100%;
  mask-size: 51% 100%;
}

/* Each line's arrival is one 0..1 var written per frame, already eased and staggered in JS; the 1
   fallbacks are the rest state. Opening mark is outdented by authoring.js; `hanging-punctuation`
   deliberately unused. See README. */
.globe-gallery-pullquote-quote {
  opacity: var(--gg-pq-copy-q, 1);
  transform: translateY(calc(var(--gg-pq-copy-rise) * (1 - var(--gg-pq-copy-q, 1))));
  color: var(--s2a-color-gray-25);
  margin: 0;
}

/* Written by the split; an unsplit quote keeps the plain flow and the fade/rise below. Flex so the
   lines' negative bleed margins meet without collapsing. */
.globe-gallery-pullquote-lines {
  display: flex;
  flex-direction: column;
  opacity: 1;
  transform: none;
}

/* One mask per rendered line, so each rolls up into place from under it. JS writes
   --gg-pq-line-v per line, already eased and staggered; the 1 fallbacks are the rest state. */
.globe-gallery-pullquote-line {
  display: block;
  overflow: hidden;

  /* Bleed for the glyphs and the hung mark, taken straight back off the flow. */
  padding: var(--gg-pq-line-bleed) var(--gg-hang-max);
  margin: calc(var(--gg-pq-line-bleed) * -1) calc(var(--gg-hang-max) * -1);
}

.globe-gallery-pullquote-line-inner {
  display: inline-block;
  transform: translate3d(0, calc((1 - var(--gg-pq-line-v, 1)) * var(--gg-pq-line-start)), 0);
}

.globe-gallery-pullquote-sr {
  -webkit-user-select: none;
  user-select: none;
}

.globe-gallery-pullquote-name {
  opacity: var(--gg-pq-copy-n, 1);
  transform: translateY(calc(var(--gg-pq-copy-rise) * (1 - var(--gg-pq-copy-n, 1))));
  font-family: var(--body-font-family);
  color: var(--s2a-color-gray-25);
  margin: 0;
}

.globe-gallery-pullquote-role {
  opacity: var(--gg-pq-copy-r, 1);
  transform: translateY(calc(var(--gg-pq-copy-rise) * (1 - var(--gg-pq-copy-r, 1))));
  font-family: var(--body-font-family);
  color: var(--s2a-color-gray-400);
  margin: 0;
}

.globe-gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 13;
  display: none;
  pointer-events: none;
  opacity: 0;
  transition: opacity calc(var(--gg-modal-anim-ms) * 1ms) linear;
}
.globe-gallery-modal.is-visible { display: block; }
.globe-gallery-modal.is-open    { opacity: 1; }

.globe-gallery-modal-backdrop {
  position: absolute;
  inset: 0;
  background: var(--s2a-color-transparent-black-64);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

/* Native <dialog> via showModal(): full-viewport top layer, siblings inert. */
.globe-gallery-modal-chrome {
  --gg-modal-edge: var(--s2a-spacing-md);
  --gg-control-size: 48px;
  --gg-control-radius: 6px;
  --gg-counter-w: auto; /* md+ pill is a fixed width; the md offsets below need the number */
  --gg-nav-gap: 12px; /* counter pill edge → each arrow */
  --gg-scrim-w: 316px; /* md+ info scrim (sm is full-width) */

  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  touch-action: none;
  opacity: 0;
  transition: opacity calc(var(--gg-modal-anim-ms) * 1ms) ease;
}
.globe-gallery-modal-chrome.is-open { opacity: 1; }

.globe-gallery-modal-chrome:focus,
.globe-gallery-modal-chrome:focus-visible { outline: none; }

/* Transparent ::backdrop — a styled one would sit ABOVE the photo canvas and hide it. */
.globe-gallery-modal-chrome::backdrop { background: transparent; }

/* Bottom row (arrows + counter): sm spreads it into the corners, md+ centres it as one group under
   the image. All static — JS only fades the chrome in. See README (Modal chrome). */
.globe-gallery-modal-nav,
.globe-gallery-modal-counter {
  position: absolute;
  bottom: var(--gg-modal-edge);
}

.globe-gallery-modal-nav-prev { inset-inline-start: var(--gg-modal-edge); }
.globe-gallery-modal-nav-next { inset-inline-end: var(--gg-modal-edge); }

.globe-gallery-modal-nav {
  width: var(--gg-control-size);
  height: var(--gg-control-size);
  border-radius: var(--gg-control-radius);
  border: var(--s2a-border-width-sm) solid var(--s2a-color-transparent-white-24);
  background: var(--s2a-color-transparent-black-64);
  -webkit-backdrop-filter: blur(var(--gg-chrome-blur));
  backdrop-filter: blur(var(--gg-chrome-blur));
  color: var(--s2a-color-gray-25);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  transition: background 0.2s ease, transform 0.2s ease;
}

.globe-gallery-modal-nav:hover {
  background: var(--s2a-color-transparent-black-80);
  transform: scale(1.05);
}

.globe-gallery-modal-nav:active { transform: scale(0.98); }

/* Close button — top inline-end corner of the viewport at every breakpoint; same frosted
   treatment as the nav arrows. */
.globe-gallery-modal-close {
  position: absolute;
  top: var(--gg-modal-edge);
  inset-inline-end: var(--gg-modal-edge);
  width: var(--gg-control-size);
  height: var(--gg-control-size);
  border-radius: var(--gg-control-radius);
  border: var(--s2a-border-width-sm) solid var(--s2a-color-transparent-white-24);
  background: var(--s2a-color-transparent-black-64);
  -webkit-backdrop-filter: blur(var(--gg-chrome-blur));
  backdrop-filter: blur(var(--gg-chrome-blur));
  color: var(--s2a-color-gray-25);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}
.globe-gallery-modal-close:hover { background: var(--s2a-color-transparent-black-80); }

/* sm = full-width chunk on the viewport's bottom edge, content-sized. Badges margin-top:auto pins
   them to bottom; padding-bottom reserves the sm nav row (edge + control + edge). */
.globe-gallery-modal-info {
  position: absolute;
  inset: auto 0 0;
  max-height: 45dvh;
  margin: 0;
  padding: var(--gg-modal-edge) var(--gg-modal-edge) calc(var(--gg-modal-edge) * 2 + var(--gg-control-size));
  border: var(--s2a-border-width-sm) solid var(--s2a-color-transparent-white-00);
  border-radius: var(--s2a-border-radius-md);
  background: var(--s2a-color-transparent-black-64);
  -webkit-backdrop-filter: blur(var(--gg-chrome-blur));
  backdrop-filter: blur(var(--gg-chrome-blur));
  box-shadow: none;
  display: flex;
  flex-direction: column;

  /* padding must count toward width — no global border-box reset in Milo */
  box-sizing: border-box;
}

.globe-gallery-modal-name,
.globe-gallery-modal-role-label,
.globe-gallery-modal-badges { flex-shrink: 0; }

.globe-gallery-modal-badges {
  display: flex;
  flex-direction: column;
  gap: var(--s2a-spacing-xs);
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Push badges to the bottom of the content area; 0,2,0 beats the 0,1,0 rule above. */
.globe-gallery-modal-info > .globe-gallery-modal-badges {
  margin-top: auto;
}

.globe-gallery-modal-name {
  font-family: var(--heading-font-family);
  font-weight: var(--s2a-font-weight-adobe-clean-black);
  font-size: var(--s2a-font-size-xl);
  line-height: var(--s2a-font-line-height-md);
  letter-spacing: var(--s2a-font-letter-spacing-5xl);
  color: var(--s2a-color-gray-25);
  margin: 0 0 var(--s2a-spacing-3xs);
}

.globe-gallery-modal-role-label {
  font-family: var(--body-font-family);
  font-size: var(--s2a-font-size-sm);
  line-height: var(--s2a-font-line-height-sm);
  font-weight: var(--s2a-font-weight-body);
  color: var(--s2a-color-gray-400);
  margin: 0 0 var(--s2a-spacing-xs);
}

.globe-gallery-modal-description {
  font-family: var(--body-font-family);
  font-size: var(--s2a-font-size-sm);
  line-height: var(--s2a-font-line-height-sm);
  color: var(--s2a-color-gray-400);
  padding-inline-start: var(--gg-hang-max);
  margin-block: 0 var(--s2a-spacing-sm);
  margin-inline-start: calc(var(--gg-hang-max) * -1);
  min-height: 0; /* let this flex item shrink below its content so it scrolls, not overflows */
  overflow-y: auto;
  touch-action: pan-y; /* dialog is touch-action:none — re-enable vertical touch scroll here */
  scrollbar-width: thin;
  scrollbar-color: var(--s2a-color-transparent-white-24) transparent;

  /* Scroll-shadow fade cue; JS (updateDescFade) toggles .is-faded-top/-bottom. */
  --gg-desc-fade-len: 20px;
  --gg-desc-fade-top: 0;
  --gg-desc-fade-bottom: 0;

  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 var(--gg-desc-fade-top), #000 calc(100% - var(--gg-desc-fade-bottom)), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 var(--gg-desc-fade-top), #000 calc(100% - var(--gg-desc-fade-bottom)), transparent 100%);

  &.is-faded-top { --gg-desc-fade-top: var(--gg-desc-fade-len); }
  &.is-faded-bottom { --gg-desc-fade-bottom: var(--gg-desc-fade-len); }
}

.globe-gallery-arc-copy-body p,
.globe-gallery-modal-description p {
  margin: 0;
}

.globe-gallery-arc-copy-body p + p,
.globe-gallery-modal-description p + p {
  margin-top: var(--s2a-spacing-xs);
}

.globe-gallery-modal-description a {
  color: inherit;
  text-decoration: underline;
}

.globe-gallery-modal-description a:hover {
  color: var(--s2a-color-gray-25);
}

.globe-gallery-modal-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2a-spacing-sm);
}

.globe-gallery-modal-badge-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.globe-gallery-modal-badge-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: block;
}

.globe-gallery-modal-badge-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.globe-gallery-modal-badge-app {
  font-family: var(--body-font-family);
  font-weight: var(--s2a-font-weight-adobe-clean-bold);
  font-size: 13px;
  color: var(--s2a-color-gray-25);
}

.globe-gallery-modal-badge-app-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--s2a-spacing-3xs);
}

.globe-gallery-modal-badge-app-link::after {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-right: var(--s2a-border-width-md) solid var(--s2a-color-gray-25);
  border-top: var(--s2a-border-width-md) solid var(--s2a-color-gray-25);
  transform: rotate(45deg) translateY(-1px);
  flex-shrink: 0;
}

.globe-gallery-modal-badge-app-link:hover {
  text-decoration: underline;
}

.globe-gallery-modal-badge-role {
  font-family: var(--body-font-family);
  font-size: 13px;
  color: var(--s2a-color-gray-400);
}

/* Counter ("1/N"). Base (sm) = plain text; min-width:768 = frosted pill. Centres on physical
   `left`, not an inset-inline, because the translateX(-50%) it pairs with is physical. */
.globe-gallery-modal-counter {
  left: 50%;
  transform: translateX(-50%);
  height: var(--gg-control-size);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--s2a-color-gray-25);
  font-family: var(--body-font-family);
  font-size: var(--s2a-font-size-sm);
  font-weight: var(--s2a-font-weight-body);
  letter-spacing: 0.02em;
  user-select: none;
}

/* Both: either may be the scrolling element, and body alone leaks wheel events on some browsers. */
html.globe-gallery-modal-open,
body.globe-gallery-modal-open { overflow: hidden; }

/* Never intercepts canvas drag; tabbable only while interactive. */
.globe-gallery-a11y {
  position: fixed;
  top: var(--gg-optical-center);
  left: 50%;
  width: min(80%, 80vh);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  border-radius: 50%;
  pointer-events: none; /* never intercept canvas drag */
}
.globe-gallery-a11y:focus { outline: none; }

/* JS sizes/positions this per frame to each card's projected screen rect. */
.globe-gallery-a11y-cards {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 100vh;
}

/* Default to viewport centre so the frame before the first setFocusRect() lands the ring near the
   image, not the top-left. JS overwrites left/top/width/height each frame while focused. */
.globe-gallery-a11y-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  transform: translate(-50%, -50%);
}
.globe-gallery-a11y-card:focus { outline: none; }

/* aria-labelledby target + visible instructions pill on focus. */
.globe-gallery-a11y-tip {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.96);
  max-width: min(78%, 320px);
  padding: var(--s2a-spacing-sm) var(--s2a-spacing-20);
  border-radius: var(--s2a-border-radius-sm);
  border: var(--s2a-border-width-sm) solid var(--s2a-color-transparent-white-24);
  background: var(--s2a-color-transparent-black-64);
  -webkit-backdrop-filter: blur(var(--gg-chrome-blur));
  backdrop-filter: blur(var(--gg-chrome-blur));
  color: var(--s2a-color-gray-25);
  font-size: var(--s2a-font-size-md);
  font-weight: var(--s2a-font-weight-adobe-clean-medium);
  line-height: 1.35;
  text-align: center;
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.globe-gallery-a11y:focus-visible .globe-gallery-a11y-tip {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

/* Keyboard focus indicators (2px S2A focus ring, 2px offset). */
.globe-gallery-a11y:focus-visible,
.globe-gallery-a11y-card:focus-visible,
.globe-gallery-control:focus-visible,
.globe-gallery-modal-close:focus-visible,
.globe-gallery-modal-nav:focus-visible {
  outline: var(--s2a-border-width-md) solid var(--s2a-color-focus-ring-default);
  outline-offset: 2px;
}

@media (width >= 768px) {
  .globe-gallery-modal-chrome {
    --gg-modal-edge: var(--s2a-spacing-lg);
    --gg-counter-w: 138px;
  }

  /* md+: no pill background, so the copy's own left edge must sit on --gg-content-inset. */
  .globe-gallery-arc-copy {
    width: 382px;
    max-width: none;
    bottom: var(--s2a-spacing-lg);
    inset-inline-start: calc(var(--gg-content-inset) - var(--gg-arc-pad));
  }

  /* Full-height scrim on the viewport's inline-start edge. */
  .globe-gallery-modal-info {
    inset: 0 auto 0;
    inset-inline-start: 0;
    width: var(--gg-scrim-w);
    height: auto;
    max-height: none;
    border-radius: 0;
    padding: var(--gg-modal-edge);
  }

  /* One centred row: counter pill in the middle, an arrow --gg-nav-gap out on each side. */
  .globe-gallery-modal-nav-prev {
    inset-inline-start: calc(50% - var(--gg-counter-w) / 2 - var(--gg-nav-gap) - var(--gg-control-size));
  }

  .globe-gallery-modal-nav-next {
    inset-inline-start: calc(50% + var(--gg-counter-w) / 2 + var(--gg-nav-gap));
  }

  .globe-gallery-modal-name { margin: 0 0 var(--s2a-spacing-2xs); }

  .globe-gallery-modal-role-label { margin: 0 0 var(--s2a-spacing-md); }

  .globe-gallery-modal-description { margin-block: 0; }

  .globe-gallery-modal-badges { gap: 10px; }

  .globe-gallery-modal-badge-icon {
    width: 28px;
    height: 28px;
  }

  .globe-gallery-modal-badge-app { font-size: var(--s2a-font-size-sm); }
  .globe-gallery-modal-badge-role { font-size: var(--s2a-font-size-sm); }

  .globe-gallery-modal-counter {
    width: var(--gg-counter-w);
    box-sizing: border-box;
    border-radius: var(--gg-control-radius);
    border: var(--s2a-border-width-sm) solid var(--s2a-color-transparent-white-24);
    background: var(--s2a-color-transparent-black-64);
    -webkit-backdrop-filter: blur(var(--gg-chrome-blur));
    backdrop-filter: blur(var(--gg-chrome-blur));
  }

  .globe-gallery-pullquote {
    --gg-pq-ideal-gap: var(--s2a-layout-xl);
  }
}

@media (width >= 1280px) {
  .globe-gallery-pullquote {
    --gg-pq-ideal-gap: var(--s2a-layout-2xl);
  }
}

.globe-gallery-reduced {
  --gg-nav-h: 0;
}

/* Scrolls away and anchors the absolute canvas. Keeps the base 100vh. */
.globe-gallery-reduced .globe-gallery-world {
  position: relative;
}

/* No arc phase under RM — a fixed pill would hang over the scrolling page.
   `html` prefix matches the specificity of the html[dir="rtl"] rule above. */
html .globe-gallery-reduced .globe-gallery-arc-copy {
  display: none;
}

/* Scrolls with the globe; the base 50vh still centres on the sphere. */
.globe-gallery-reduced .globe-gallery-a11y {
  position: absolute;
}

.globe-gallery-reduced .globe-gallery-a11y-cards {
  position: absolute;
}

.globe-gallery-reduced .globe-gallery-controls {
  position: absolute;
}

html .globe-gallery-reduced .globe-gallery-spin-toggle {
  display: none;
}

/* Flows normally after the globe: no pin/rail/sticky, static with a gap above. */
.globe-gallery-reduced .globe-gallery-pullquote-pin,
.globe-gallery-reduced .globe-gallery-pullquote-rail {
  position: static;
  height: auto;
  pointer-events: auto;
}

.globe-gallery-reduced .globe-gallery-pullquote {
  --gg-pq-pad-block: 10vh 8vh;

  position: relative;
  top: auto;
  opacity: 1;
  transform: none;
}

/* Full reveal. The copy needs no override: updatePullQuote returns early, so its vars stay unset
   at their 1 fallback. */
.globe-gallery-reduced .globe-gallery-pullquote::before,
.globe-gallery-reduced .globe-gallery-pullquote::after {
  -webkit-mask-image: none;
  mask-image: none;
}

.globe-gallery-reduced .globe-gallery-pullquote-quote,
.globe-gallery-reduced .globe-gallery-pullquote-name,
.globe-gallery-reduced .globe-gallery-pullquote-role {
  transition: none;
}

/* RM can be toggled after the lines already carry a written progress var. */
.globe-gallery-reduced .globe-gallery-pullquote-line-inner {
  transform: none;
}

@media (height <= 460px) {
  .globe-gallery-modal-chrome {
    --gg-modal-edge: 8px;
    --gg-control-size: 44px;
  }

  .globe-gallery-modal-info {
    max-height: 70dvh;
    overflow-y: auto;
  }

  .globe-gallery-modal-description {
    flex-shrink: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .globe-gallery-modal-nav:hover,
  .globe-gallery-modal-nav:active,
  .globe-gallery-control:hover,
  .globe-gallery-control:active {
    transform: none;
  }

  /* Hint retires instantly, no 0.5s fade (drag, rotate and modal-open all reach is-dismissed). */
  .globe-gallery-barrel .globe-gallery-hint-text,
  .globe-gallery-barrel .globe-gallery-hint.is-dismissed .globe-gallery-hint-text {
    transition: none;
  }
}

html[dir="rtl"] .globe-gallery-modal-nav svg {
  transform: scaleX(-1);
}

html[dir="rtl"] .globe-gallery-hint {
  flex-direction: row-reverse;
}

html[dir="rtl"] .globe-gallery-modal-badge-app-link::after {
  transform: scaleX(-1) rotate(45deg) translateY(-1px);
}
