/* =====================================================================
   Hero — "Theme chords"
   A chord diagram of the two taxonomies: every name gets an equal slot
   around the rim (General runs left from due north, Mindful AI right),
   categories followed by their sub-themes. Every General sub-theme is joined to every Mindful AI
   sub-theme by one thread. Slots on a side are equal and every thread is
   the same: nothing encodes a count, score or rank.
   The canvas (js/hero-chords.js) draws everything, names included, on
   screens from 720px wide; the lists stay in the page for screen readers.
   On phones the circle, without names, sits behind the copy.
   ===================================================================== */

.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: var(--bg-hero);
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
}

.hero.is-point { cursor: pointer; }
.hero.is-grab { cursor: grab; }
.hero.is-grabbing,
.hero.is-grabbing * { cursor: grabbing !important; }

.hero__canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
}

/* Wide screens: copy | chord diagram */
.hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 32px;
  min-height: max(640px, calc(100vh - var(--util-h) - var(--bar-h)));
  min-height: max(640px, calc(100svh - var(--util-h) - var(--bar-h)));
  padding-inline: var(--pad);
  pointer-events: none;          /* let the canvas receive drags/clicks */
}

.hero__copy {
  align-self: center;
  max-width: 560px;
  /* clear the logo that hangs into the hero */
  padding: calc(var(--logo-lg) - var(--bar-h) + 40px) 0 118px;   /* bottom: room for the scroll cue */
  pointer-events: auto;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: clamp(36px, 3.8vw, 62px);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -.02em;
  text-wrap: balance;
}

.lede {
  max-width: 520px;
  margin: 22px 0 0;
  color: rgba(var(--fg-rgb), .74);
  font-size: clamp(16px, 1.3vw, 18px);
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

/* ---------- Chord diagram stage ---------- */

/* The circle is centred in this box by JS; it may use the right margin. */
.hero__stage {
  position: relative;
  min-height: 600px;
  margin-right: calc(24px - var(--pad));
}

.chord { display: none; }        /* legend mode only: reserves the circle's square */

/* Wide screens: the names are drawn on the canvas, so the lists are only
   for screen readers. */
.tax {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Industries: drawn by the script as a ring around the diagram (listed in
   the legend on narrow screens). */
.sectors {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Scroll cue: same target as "Explore the rankings" ---------- */

.hero__scroll {
  position: absolute;
  left: var(--pad);
  bottom: 28px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 16px;
  color: rgba(var(--fg-rgb), .85);
  font: 600 15px/1 var(--font);    /* same size as the "Explore the rankings" button */
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color .2s;
}

/* Holds the chevron, which keeps nudging downward. */
.hero__scroll-ring {
  display: grid;
  place-items: center;
  height: 50px;
  color: var(--accent);
  transition: color .2s;
}

.hero__scroll svg {
  width: 34px;
  height: auto;
  overflow: visible;             /* round caps sit just outside the viewBox */
  animation: scroll-nudge 1.2s ease-in-out infinite;
}

.hero__scroll:hover,
.hero__scroll:focus-visible,
.hero__scroll:hover .hero__scroll-ring,
.hero__scroll:focus-visible .hero__scroll-ring { color: var(--fg); }

.hero__scroll:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 6px;
}

@keyframes scroll-nudge {
  0%, 100% { transform: none; }
  50%      { transform: translateY(12px); }
}

@media (prefers-reduced-motion: reduce) {
  .hero__scroll svg { animation: none; }
}

/* ---------- Narrower screens: copy above the diagram ---------- */

@media (max-width: 1359px) {
  .hero__inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    min-height: 0;
  }

  .hero__copy {
    align-self: start;
    max-width: 680px;
    padding-bottom: 8px;
  }

  .hero h1 { font-size: clamp(34px, 6.2vw, 60px); }

  .hero__stage {
    min-height: 0;
    height: clamp(620px, 72vw, 860px);
    margin: 0;
  }
}

/* ---------- Tablets: as on narrower desktops, a little taller ----------
   The names need a square of about 644px round the circle. */

@media (min-width: 720px) and (max-width: 899px) {
  .hero__stage { height: clamp(660px, 90vw, 760px); }
}

/* ---------- Phones: the circle behind the copy ----------
   Too narrow for the names: no lists here (they stay for screen readers, as
   on wide screens) and no names on the circle. The circle sits behind the
   copy, centred on its text, dimmed so the words read over it. */

@media (max-width: 719px) {
  .hero__copy,
  .hero__stage { grid-area: 1 / 1; }

  .hero__copy {
    position: relative;
    z-index: 1;
    padding-bottom: 118px;         /* room for the scroll cue */
  }

  /* Spans the copy's text: below the logo's clearance, above the cue's room. */
  .hero__stage {
    height: auto;
    margin: calc(var(--logo-lg) - var(--bar-h) + 40px) 0 118px;
  }

  /* The script fits the circle to this box's shorter side, centred in it. */
  .chord {
    display: block;
    position: absolute;
    inset: -16px 0;
    max-width: 440px;
    margin-inline: auto;
  }

  .hero__canvas { opacity: .5; }
}
