/*! Brythonic Academy — "Your English Opens Doors Worldwide" globe section (landing page).
 *  Everything is scoped to .gx and uses the site's existing palette and fonts.
 *  Behaviour: assets/js/destinations.js · Content: assets/js/destinations-data.js
 */

.gx {
  --gx-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gx-line: rgba(221, 215, 255, 0.14);
  --gx-chip: rgba(255, 255, 255, 0.035);
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: radial-gradient(ellipse 48% 60% at 76% 46%, rgba(62, 35, 126, 0.38), transparent 72%),
    radial-gradient(ellipse 40% 45% at 6% 90%, rgba(34, 46, 113, 0.2), transparent 75%),
    linear-gradient(180deg, #100d23 0%, #0c091d 55%, #090717 100%);
}

/* Faint star field behind the globe */
.gx-ambient {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.55;
  background-image: radial-gradient(1px 1px at 12% 18%, #cfc8ff 50%, transparent 51%),
    radial-gradient(1px 1px at 34% 72%, #9f91ff 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 58% 12%, #e9e6ff 50%, transparent 51%),
    radial-gradient(1px 1px at 66% 86%, #bdb5ff 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 88% 30%, #719aff 50%, transparent 51%),
    radial-gradient(1px 1px at 94% 74%, #cfc8ff 50%, transparent 51%),
    radial-gradient(1px 1px at 47% 48%, #9f91ff 50%, transparent 51%),
    radial-gradient(1.3px 1.3px at 22% 92%, #e9e6ff 50%, transparent 51%);
}

/* ---------- Layout ---------- */
.gx-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  grid-template-areas:
    "copy globe"
    "places globe";
  grid-template-rows: auto 1fr;
  column-gap: clamp(32px, 5vw, 80px);
  align-items: start;
}
.gx-copy {
  grid-area: copy;
  align-self: end;
}
.gx-globe {
  grid-area: globe;
  align-self: center;
}
.gx-places {
  grid-area: places;
}

/* ---------- Copy ---------- */
.gx-title {
  margin-bottom: 20px;
}
.gx-line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.06em;
  margin-bottom: -0.06em;
}
.gx-line > span {
  display: inline-block;
}
.gx-lead {
  max-width: 480px;
  margin: 0 0 30px;
  color: #aaa5c1;
  font-size: 15px;
  line-height: 1.9;
}

/* The three test labels */
.gx-tests {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.gx-test {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  padding: 12px 18px 12px 14px;
  border: 1px solid var(--gx-line);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(136, 90, 255, 0.16), rgba(69, 135, 255, 0.07));
  color: #ece9ff;
  font: 800 12px/1 Manrope, sans-serif;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: transform 0.45s var(--gx-ease), border-color 0.3s, box-shadow 0.45s var(--gx-ease), background 0.35s, color 0.35s;
}
/* not selected: quieter pill with an empty ring */
.gx-test[aria-pressed="false"] {
  background: rgba(255, 255, 255, 0.03);
  color: #c9c4e2;
}
.gx-test[aria-pressed="false"] .gx-test-mark {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px rgba(189, 181, 255, 0.55);
}
.gx-test[aria-pressed="false"] .gx-test-mark::after {
  opacity: 0;
  transform: rotate(45deg) scale(0.4);
}
/* selected */
.gx-test[aria-pressed="true"] {
  border-color: rgba(189, 181, 255, 0.6);
  box-shadow: 0 0 0 4px rgba(136, 90, 255, 0.14), 0 14px 30px -16px rgba(136, 90, 255, 0.9);
}
.gx-test::after {
  /* light sweep */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(233, 230, 255, 0.28) 50%, transparent 70%);
  transform: translateX(-120%);
  pointer-events: none;
}
.gx-test-mark {
  position: relative;
  width: 18px;
  height: 18px;
  flex: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #885aff, #4587ff);
  box-shadow: 0 0 14px rgba(120, 146, 255, 0.55);
  transition: background 0.35s, box-shadow 0.35s;
}
.gx-test-mark::after {
  /* tick */
  content: "";
  position: absolute;
  left: 6.4px;
  top: 4px;
  width: 4px;
  height: 7.5px;
  border: solid #fff;
  border-width: 0 1.7px 1.7px 0;
  transform: rotate(45deg);
  transition: opacity 0.3s, transform 0.4s var(--gx-ease);
}
.gx-test:hover,
.gx-test:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(189, 181, 255, 0.55);
  box-shadow: 0 14px 30px -14px rgba(136, 90, 255, 0.8);
}
.gx-test:focus-visible {
  outline: 2px solid #bdb5ff;
  outline-offset: 3px;
}

/* ---------- Globe ---------- */
.gx-globe {
  position: relative;
  width: 100%;
  max-width: 600px;
  aspect-ratio: 1;
  margin-inline: auto;
  touch-action: pan-y;
}
.gx-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.gx-pins {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.gx-pin {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 4px;
  border: 1px solid rgba(221, 215, 255, 0.24);
  border-radius: 9px;
  background: rgba(19, 15, 42, 0.82);
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.8), 0 0 0 0 rgba(136, 90, 255, 0);
  opacity: 0;
  visibility: hidden;
  pointer-events: auto;
  will-change: transform, opacity;
  transition: box-shadow 0.35s, border-color 0.35s, gap 0.45s var(--gx-ease), padding 0.45s var(--gx-ease);
}
.gx-pin svg {
  display: block;
  height: 16px;
  width: auto;
  border-radius: 3px;
}
.gx-pin-name {
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  color: #f2f0ff;
  font: 700 11.5px/1 "DM Sans", sans-serif;
  letter-spacing: 0.2px;
  opacity: 0;
  transition: max-width 0.5s var(--gx-ease), opacity 0.35s;
}
.gx-pin.is-spot,
.gx-pin.is-active,
.gx-pin:hover {
  gap: 8px;
  padding-right: 10px;
  z-index: 3;
  border-color: rgba(189, 181, 255, 0.6);
  box-shadow: 0 12px 28px -10px rgba(0, 0, 0, 0.85), 0 0 0 4px rgba(136, 90, 255, 0.18);
}
.gx-pin.is-off {
  pointer-events: none;
}
.gx-pin-name {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.gx-pin-detail {
  display: none;
  color: #c9c2ff;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0;
}
.gx-pin.is-active .gx-pin-detail {
  display: block;
}
.gx-pin.gx-measure,
.gx-pin.gx-measure * {
  transition: none !important;
}
.gx-pin.is-spot .gx-pin-name,
.gx-pin.is-active .gx-pin-name,
.gx-pin:hover .gx-pin-name {
  max-width: 140px;
  opacity: 1;
}
.gx-pin.is-active .gx-pin-name {
  max-width: 300px;
}

/* ---------- Destinations list ---------- */
.gx-places {
  padding-top: 38px;
}
.gx-places-title {
  margin: 0 0 14px;
  color: #bbb6e0;
  font: 800 11px/1 "DM Sans", sans-serif;
  letter-spacing: 2.1px;
  text-transform: uppercase;
}
.gx-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.gx-place {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 15px 9px 10px;
  border: 1px solid var(--gx-line);
  border-radius: 999px;
  background: var(--gx-chip);
  color: #dedaf0;
  font-size: 13px;
  font-weight: 700;
  cursor: default;
  transition: transform 0.45s var(--gx-ease), border-color 0.3s, background 0.3s, color 0.3s;
}
.gx-flag {
  display: none;
}
.gx-js .gx-flag {
  display: block;
  flex: none;
  line-height: 0;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 3px 8px rgba(0, 0, 0, 0.35);
  transition: transform 0.45s var(--gx-ease);
}
.gx-flag svg {
  display: block;
  height: 15px;
  width: auto;
  border-radius: 3px;
}
.gx-js .gx-place {
  cursor: pointer;
}
.gx-visa {
  margin-left: -2px;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(136, 90, 255, 0.22);
  color: #d9d4ff;
  font: 800 9.5px/1 "DM Sans", sans-serif;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
.gx-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.gx-count {
  color: #8f8aa8;
  letter-spacing: 1.4px;
}
.gx-count::before {
  content: "·";
  margin: 0 8px 0 6px;
}
.gx-js .gx-list .gx-place.gx-place-in {
  animation: gxPop 0.6s var(--gx-ease) both;
  animation-delay: calc(var(--i, 0) * 35ms);
}
.gx-place:hover,
.gx-place.is-active {
  transform: translateY(-3px);
  border-color: rgba(189, 181, 255, 0.5);
  background: rgba(136, 90, 255, 0.14);
  color: #fff;
}
.gx-place:hover .gx-flag,
.gx-place.is-active .gx-flag {
  transform: rotate(-6deg) scale(1.12);
}

.gx-note {
  display: flex;
  gap: 10px;
  max-width: 520px;
  margin: 26px 0 0;
  color: #8f8aa8;
  font-size: 12.5px;
  line-height: 1.75;
}
.gx-note-icon {
  width: 17px;
  height: 17px;
  flex: none;
  margin-top: 2px;
  color: #9f91ff;
}
.gx-sources {
  white-space: nowrap;
}
.gx-sources a {
  margin-left: 6px;
  color: #bdb5ff;
  font-weight: 700;
  border-bottom: 1px solid rgba(189, 181, 255, 0.35);
  transition: color 0.25s, border-color 0.25s;
}
.gx-sources a:hover,
.gx-sources a:focus-visible {
  color: #fff;
  border-color: #bdb5ff;
}
.gx-sources a:focus-visible {
  outline: 2px solid #bdb5ff;
  outline-offset: 2px;
  border-radius: 2px;
}

/* Without JavaScript the globe is hidden and the text stays readable. */
.gx:not(.gx-js) .gx-globe {
  display: none;
}
.gx:not(.gx-js) .gx-grid {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "copy" "places";
}

/* ---------- Entrance and ambient motion (only when motion is allowed) ---------- */
.gx-anim .gx-line > span {
  transition: transform 1.1s var(--gx-ease);
}
.gx-anim .gx-line:nth-child(2) > span {
  transition-delay: 0.1s;
}
.gx-anim .gx-rise,
.gx-anim .gx-places-title,
.gx-anim .gx-note {
  transition: opacity 0.9s ease, transform 1s var(--gx-ease);
}
.gx-anim .gx-lead {
  transition-delay: 0.2s;
}
.gx-anim .gx-test,
.gx-anim .gx-place {
  transition: transform 0.45s var(--gx-ease), border-color 0.3s, background 0.3s, color 0.3s, box-shadow 0.45s var(--gx-ease);
}
.gx-anim .gx-globe {
  transition: opacity 1.4s ease 0.1s, transform 1.6s var(--gx-ease) 0.1s;
}

.gx-anim:not(.gx-seen) .gx-line > span {
  transform: translateY(105%);
}
.gx-anim:not(.gx-seen) .gx-rise,
.gx-anim:not(.gx-seen) .gx-places-title,
.gx-anim:not(.gx-seen) .gx-note {
  opacity: 0;
  transform: translateY(18px);
}
.gx-anim:not(.gx-globe-in) .gx-globe {
  opacity: 0;
  transform: scale(0.88) rotate(-6deg);
}
.gx-anim:not(.gx-seen) .gx-test,
.gx-anim:not(.gx-seen) .gx-place {
  opacity: 0;
  transform: translateY(16px) scale(0.94);
}

/* Staggered pop-in, driven by --i set in JS */
.gx-anim.gx-seen .gx-test,
.gx-anim.gx-seen .gx-place {
  animation: gxPop 0.8s var(--gx-ease) both;
  animation-delay: calc(var(--d, 0.4s) + var(--i, 0) * 70ms);
}
.gx-anim.gx-seen .gx-test {
  --d: 0.35s;
}
.gx-anim.gx-seen .gx-place {
  --d: 0.65s;
}
.gx-anim.gx-seen .gx-places-title {
  transition-delay: 0.55s;
}
.gx-anim.gx-seen .gx-note {
  transition-delay: 1.2s;
}
@keyframes gxPop {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
/* After the entrance, hover transforms take over again */
.gx-anim.gx-done .gx-test,
.gx-anim.gx-done .gx-place {
  animation: none;
}

/* Gentle light sweep across the test labels every few seconds */
.gx-anim.gx-seen .gx-test::after {
  animation: gxSweep 6.5s ease-in-out infinite;
  animation-delay: calc(2.2s + var(--i, 0) * 0.35s);
}
@keyframes gxSweep {
  0%,
  72% {
    transform: translateX(-120%);
  }
  88%,
  100% {
    transform: translateX(120%);
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .gx-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "copy"
      "globe"
      "places";
    grid-template-rows: auto;
  }
  .gx-copy {
    text-align: center;
  }
  .gx-lead {
    margin-inline: auto;
  }
  .gx-tests,
  .gx-list {
    justify-content: center;
  }
  .gx-globe {
    max-width: 520px;
    margin-top: 18px;
  }
  .gx-places {
    padding-top: 22px;
    text-align: center;
  }
  .gx-note {
    margin-inline: auto;
    text-align: left;
  }
}
@media (max-width: 600px) {
  .gx-tests {
    gap: 8px;
  }
  .gx-test {
    padding: 10px 14px 10px 11px;
    font-size: 11px;
    letter-spacing: 1.2px;
    gap: 8px;
  }
  .gx-test-mark {
    width: 16px;
    height: 16px;
  }
  .gx-test-mark::after {
    left: 5.6px;
    top: 3.4px;
    width: 3.6px;
    height: 6.8px;
  }
  .gx-globe {
    width: calc(100% + 24px);
    margin-inline: -12px;
  }
  .gx-list {
    gap: 8px;
  }
  .gx-place {
    padding: 8px 12px 8px 9px;
    font-size: 12.5px;
    gap: 8px;
  }
  .gx-pin svg {
    height: 13px;
  }
  .gx-pin-name {
    font-size: 10.5px;
  }
  .gx-pin-detail {
    font-size: 9.5px;
  }
  .gx-count {
    display: block;
    margin-top: 8px;
  }
  .gx-count::before {
    content: none;
  }
  .gx-visa {
    font-size: 9px;
    padding: 3px 5px;
  }
  .gx-sources {
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gx-test::after {
    display: none;
  }
}
