/* ============================================================
   Global Voices — 3D home page
   Layered on top of css/styles.css. Every colour, radius, shadow
   and the font stack come from the tokens already defined there;
   nothing new is introduced to the brand.
   Scoped to the home page (.orb*, .band*, .turn*, .lead*, .grail*)
   so the other five pages are untouched.
   ============================================================ */

#page-home {
  --orb: clamp(280px, 50vw, 700px);
  --hair: rgba(255, 255, 255, 0.09);
  --label: 0.7rem;
}

/* ---------- 1. Hero ---------------------------------------- */

.orb {
  position: relative;
  isolation: isolate;
  overflow: hidden;      /* fallback for browsers without overflow: clip */
  overflow: clip;
  padding-block: clamp(2rem, 5vw, 4.25rem) clamp(2.25rem, 4vw, 3.25rem);
}

/* Space behind the planet: a warm bloom low and right, a cold one
   high and left, then a fade back into the page. */
.orb__field {
  position: absolute;
  inset: -14% -6% -2%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(46% 40% at 74% 46%, rgba(255, 138, 30, 0.20), transparent 70%),
    radial-gradient(52% 46% at 22% 6%, rgba(42, 108, 255, 0.24), transparent 72%),
    radial-gradient(80% 70% at 50% 120%, rgba(5, 7, 15, 0.95), transparent 60%),
    linear-gradient(180deg, #070b17 0%, #060913 58%, var(--bg) 100%);
}

.orb__inner {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  align-items: center;
  gap: clamp(1.25rem, 4vw, 4rem);
}

/* --- copy column --- */

.orb__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0 0 1.35rem;
  font-size: var(--label);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}

.orb__eyebrow::before {
  content: "";
  width: 2.4rem;
  height: 2px;
  background: var(--grad-btn);
}

.orb__title {
  font-size: clamp(3rem, 8vw, 5.4rem);
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin: 0;
  text-wrap: balance;
}

.orb__lede {
  margin: 0.6rem 0 0;
  font-size: clamp(1.2rem, 2.7vw, 1.75rem);
  font-weight: 800;
  line-height: 1.3;
  color: #fff;
}

.orb__lede span { color: var(--gold); }

.orb__rule {
  width: 3.4rem;
  height: 2px;
  border: 0;
  margin: 1.5rem 0;
  background: var(--grad-btn);
}

.orb__text {
  margin: 0;
  max-width: 34rem;
  font-size: 1.04rem;
  line-height: 1.75;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.orb__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-top: 1.9rem;
}

/* A quieter partner to .btn--grad, for the second action. */
.orb__link {
  border: 0;
  background: none;
  padding: 0.55rem 0;
  color: var(--ink);
  font-weight: 700;
  font-size: 0.97rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.28);
  transition: color 0.25s, border-color 0.25s;
}

.orb__link:hover { color: var(--gold); border-color: var(--gold); }

/* --- globe column --- */

.orb__stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.orb__globe {
  position: relative;
  width: var(--orb);
  aspect-ratio: 1;
  max-width: 100%;
}

/* The bloom the planet casts on the page behind it. This lives in CSS
   rather than in the WebGL scene so it can spread past the canvas. */
.orb__globe::before {
  content: "";
  position: absolute;
  inset: -30%;
  z-index: -1;
  border-radius: 50%;
  background:
    radial-gradient(closest-side, rgba(122, 168, 255, 0.13), transparent 56%),
    radial-gradient(closest-side, rgba(255, 138, 30, 0.24), transparent 72%);
  filter: blur(8px);
}

.orb__globe canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  touch-action: none;
}

/* Fallback map used when WebGL or Three.js is unavailable. The map is
   over-scaled vertically so the polar distortion crops out of the disc,
   and a light-and-shadow overlay gives it back its curvature. */
.orb__flat {
  display: none;
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  background-size: 200% 132%;
  background-position: 0 center;
  background-repeat: repeat-x;
  box-shadow: 0 0 70px -8px rgba(255, 138, 30, 0.35);
  animation: orbSpin 90s linear infinite;
}

.orb__flat::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 26%, rgba(214, 234, 255, 0.28), transparent 46%),
    radial-gradient(circle at 72% 76%, rgba(2, 4, 10, 0.9), transparent 64%),
    radial-gradient(circle at 50% 50%, transparent 58%, rgba(2, 4, 10, 0.78) 99%);
  box-shadow: inset 0 0 34px rgba(122, 168, 255, 0.22);
}

.orb__globe.is-flat .orb__flat { display: block; }

@keyframes orbSpin {
  from { background-position: 0 center; }
  to   { background-position: -200% center; }
}

/* Marker label. Positioned from the marker's projected screen point by
   js/earth3d.js, so it stays on its pin as the Earth turns. */
.orb__tip {
  position: absolute;
  z-index: 3;
  transform: translate(-50%, calc(-100% - 0.75rem));
  width: max-content;
  max-width: 16rem;
  padding: 0.5rem 0.8rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(6, 10, 22, 0.95);
  box-shadow: 0 16px 34px -14px rgba(0, 0, 0, 0.85);
  pointer-events: none;
}

.orb__tip::before {
  content: "";
  position: absolute;
  left: 0.8rem;
  right: 0.8rem;
  top: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--c, var(--orange));
}

.orb__tip.is-below { transform: translate(-50%, 0.75rem); }

.orb__tip strong {
  display: block;
  font-size: 0.9rem;
  line-height: 1.35;
  color: #fff;
}

/* Goal colour lives in the rule above, not the text: several UN goal
   colours are too dark to read on this background. */
.orb__tip span {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

/* Stage caption + motion toggle */
.orb__hint {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.6rem 1rem;
  margin: 0;
  font-size: 0.8rem;
  color: var(--ink-faint);
  text-align: center;
}

.orb__motion {
  border: 0;
  background: none;
  padding: 0.2rem 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-soft);
  border-bottom: 1px dashed rgba(255, 255, 255, 0.3);
}

.orb__motion:hover { color: var(--gold); border-bottom-color: var(--gold); }

/* ---------- 2. Goal rail ----------------------------------- */

.grail {
  position: relative;
  border-block: 1px solid var(--hair);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent);
  padding-block: 1.5rem 1.7rem;
}

.grail__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem 1.5rem;
  margin-bottom: 1.1rem;
}

.grail__head h2 {
  margin: 0;
  font-size: 1.06rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
}

.grail__head p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--ink-faint);
}

.grail__row { display: flex; align-items: center; gap: 0.75rem; }

.grail__nav {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  font-size: 1rem;
  line-height: 1;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.grail__nav:hover {
  background: rgba(255, 138, 30, 0.16);
  border-color: rgba(255, 138, 30, 0.5);
  transform: translateY(-1px);
}

.grail__track {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  padding: 0.35rem 0.15rem;
  margin: -0.35rem -0.15rem;
  /* soft edges so a part-visible chip reads as "keep scrolling" */
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 1.5rem,
    #000 calc(100% - 1.5rem), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 1.5rem,
    #000 calc(100% - 1.5rem), transparent 100%);
}

.grail__track::-webkit-scrollbar { display: none; }

.grail__chip {
  flex: 0 0 auto;
  scroll-snap-align: center;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 1rem 0.5rem 0.55rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-soft);
  font-size: 0.86rem;
  font-weight: 600;
  text-align: left;
  transition: color 0.2s, background 0.2s, border-color 0.2s, transform 0.2s;
}

.grail__dot {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--c);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.grail__name { white-space: nowrap; }

.grail__chip:hover,
.grail__chip:focus-visible,
.grail__chip.is-live {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--c);
  transform: translateY(-2px);
}

.grail__chip:active { transform: translateY(0) scale(0.985); }

/* ---------- 3. Cohort band --------------------------------- */

.band {
  border-bottom: 1px solid var(--hair);
  padding-block: 1.35rem;
}

.band__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem 2rem;
}

.band__item { display: grid; gap: 0.2rem; }

.band__item strong {
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
}

.band__item span { font-size: 0.82rem; color: var(--ink-faint); }

/* ---------- 4. What changes (divided rows, not cards) ------ */

.turn { padding-block: clamp(2.75rem, 5.5vw, 4.5rem) clamp(1.5rem, 3vw, 2.25rem); }

.turn__head { max-width: 44rem; margin-bottom: clamp(1.5rem, 3.5vw, 2.4rem); }

.turn__head h2 {
  margin: 0 0 0.7rem;
  font-size: clamp(1.85rem, 4.4vw, 3rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: #fff;
  text-wrap: balance;
}

.turn__head p { margin: 0; color: var(--ink-soft); font-size: 1.02rem; }

.turn__rows { border-top: 1px solid var(--hair); }

.turn__row {
  display: grid;
  grid-template-columns: 2rem minmax(0, 17rem) minmax(0, 1fr);
  gap: 0.5rem clamp(1rem, 2.6vw, 2.5rem);
  align-items: start;
  padding-block: clamp(1.5rem, 3vw, 2.1rem);
  border-bottom: 1px solid var(--hair);
  transition: background 0.3s;
}

.turn__row:hover { background: rgba(255, 138, 30, 0.045); }

.turn__mark {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--orange);
  font-variant-numeric: tabular-nums;
  padding-top: 0.35rem;
}

.turn__row h3 {
  margin: 0;
  text-wrap: balance;
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: #fff;
}

.turn__row p { margin: 0; color: var(--ink-soft); line-height: 1.75; max-width: 46rem; }

.turn__row em {
  display: block;
  margin-top: 0.7rem;
  font-style: normal;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gold);
}

/* ---------- 5. Instructor split ---------------------------- */

.lead-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.22fr);
  gap: clamp(1.75rem, 4.5vw, 4rem);
  align-items: center;
  padding-block: clamp(2.25rem, 4.5vw, 3.75rem);
}

.lead-split__figure { position: relative; margin: 0; }

.lead-split__figure img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 22%;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 210, 122, 0.22);
  box-shadow: var(--shadow-card);
}

.lead-split__stamp {
  position: absolute;
  left: clamp(-0.5rem, -1vw, 0rem);
  bottom: 1.4rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-pill);
  background: var(--grad-btn);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: var(--glow-orange);
}

.lead-split__body h2 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.85rem, 4.2vw, 2.9rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: #fff;
}

.lead-split__role {
  margin: 0 0 1.3rem;
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--gold);
}

.lead-split__quote {
  margin: 0 0 1.3rem;
  padding-left: 1.1rem;
  border-left: 1px solid var(--orange);
  font-size: clamp(1.08rem, 2.2vw, 1.3rem);
  font-weight: 700;
  line-height: 1.5;
  color: #fff;
}

.lead-split__body p { color: var(--ink-soft); line-height: 1.78; margin: 0 0 1rem; }

.lead-split__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.4rem 0 1.7rem;
  padding: 0;
  list-style: none;
}

.lead-split__facts li {
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-soft);
}

/* ---------- 6. Closing invitation -------------------------- */

.invite {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 138, 30, 0.26);
  background: var(--panel-grad);
  box-shadow: var(--shadow-card);
  padding: clamp(1.75rem, 4vw, 3.25rem);
  margin-bottom: clamp(3rem, 6vw, 5rem);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
}

.invite::before {
  content: "";
  position: absolute;
  inset: -60% -30% auto auto;
  width: 32rem;
  height: 32rem;
  background: radial-gradient(closest-side, rgba(255, 138, 30, 0.16), transparent 70%);
  pointer-events: none;
}

.invite h2 {
  position: relative;
  margin: 0 0 0.8rem;
  font-size: clamp(1.7rem, 3.8vw, 2.6rem);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -0.03em;
  color: #fff;
  text-wrap: balance;
}

.invite p { position: relative; margin: 0; color: var(--ink-soft); line-height: 1.75; }

.invite__panel { position: relative; display: grid; gap: 0.9rem; }

.invite__list { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.55rem; }

.invite__list li {
  display: flex;
  gap: 0.65rem;
  align-items: baseline;
  font-size: 0.92rem;
  color: var(--ink);
}

.invite__list li::before {
  content: "";
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--orange);
  transform: translateY(-2px);
}

.invite__note {
  font-size: 0.82rem;
  color: var(--gold);
  font-weight: 700;
}

/* ---------- 7. Session modal, opened from the globe ---------
   The modal opens over the home page, so it gains a second action
   that leads to the full session list. styles.css sets the single
   footer button to full width; two buttons share the row instead. */

/* .btn sets display: inline-flex, and an author rule beats the user
   agent's [hidden] { display: none } whatever the specificity, so the
   attribute needs restating here or the button leaks onto the Sessions
   page where it does not belong. */
.modal__footer .btn[hidden] { display: none !important; }

.modal__footer.has-all {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.modal__footer.has-all .btn {
  width: auto;
  flex: 1 1 11rem;
  padding-inline: 1.4rem;
}

/* ---------- 8. Responsive ---------------------------------- */

@media (max-width: 1080px) {
  .band__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 920px) {
  .orb { padding-top: 1.5rem; }
  .orb__inner { grid-template-columns: 1fr; gap: 2rem; }
  .orb__stage { order: -1; }
  #page-home { --orb: clamp(250px, 86vw, 470px); }
  .orb__text { max-width: none; }
  .turn__row { grid-template-columns: 1.5rem minmax(0, 1fr); }
  .turn__row p { grid-column: 2; }
  .lead-split { grid-template-columns: 1fr; }
  .lead-split__figure img { aspect-ratio: 3 / 2; object-position: center 20%; }
  .invite { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .orb__eyebrow { letter-spacing: 0.14em; font-size: 0.64rem; }
  .orb__eyebrow::before { width: 1.5rem; }
  .band__grid { grid-template-columns: 1fr; gap: 0.85rem; }
  .band__item { grid-template-columns: 1fr; }
  .grail__nav { display: none; }
  .turn__row { grid-template-columns: 1fr; gap: 0.55rem; }
  .turn__row p { grid-column: 1; }
  .orb__actions .btn { width: 100%; }
}

/* ---------- 9. Reduced motion ------------------------------ */

@media (prefers-reduced-motion: reduce) {
  .orb__flat { animation: none; }
  .grail__chip,
  .grail__nav,
  .turn__row,
  .orb__link,
  .orb__motion { transition: none; }
  .grail__chip:hover,
  .grail__chip.is-live,
  .grail__nav:hover { transform: none; }
}
