/* Shared band layout, reveals, and the dot-matrix / motif / stitch primitives used below the hero. */

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--color-plum);
  color: var(--color-white);
  font-weight: 700;
}

.skip-link:focus {
  top: 1rem;
}

/* ---------- Nav additions: end group and the hamburger menu button ---------- */

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

.nav__toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-plum);
  cursor: pointer;
}

/* Three bars; open, the outer two cross into an X and the middle one drops out */
.nav__toggle-bars {
  display: grid;
  gap: 5px;
  width: 22px;
}

.nav__toggle-bars i {
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition:
    transform var(--duration-normal) var(--ease-spring),
    opacity var(--duration-fast) var(--ease-out-expo);
}

.nav--open .nav__toggle-bars i:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav--open .nav__toggle-bars i:nth-child(2) {
  opacity: 0;
}

.nav--open .nav__toggle-bars i:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 860px) {
  .nav__toggle {
    display: inline-grid;
    place-items: center;
  }

  .nav--open .nav__links {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0.5rem var(--space-gutter) 1.25rem;
    background-color: var(--color-surface);
    background-image: var(--stitch), var(--stitch);
    background-size: var(--stitch-pitch) var(--stitch-dot);
    background-repeat: repeat-x;
    background-position: 0 0, 0 100%;
  }

  /* The links arrive one after another, so the opening has a shape */
  .nav--open .nav__links li {
    animation: menu-in 360ms var(--ease-out-expo) both;
    animation-delay: calc(var(--i, 0) * 40ms);
  }

  .nav--open .nav__links a {
    display: block;
    padding: 0.85rem 0;
    font-size: 1.125rem;
  }
}

@keyframes menu-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}

/* ---------- Hero meta line ---------- */

.hero__meta {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.6rem 0.75rem;
  margin-top: clamp(1.5rem, 1rem + 2vw, 2.75rem);
  font-size: var(--text-small);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--color-text-muted);
}

.hero__meta span {
  text-wrap: balance;
}

.hero__meta-sep {
  width: var(--dot-marker);
  height: var(--dot-marker);
  border-radius: 50%;
  background: var(--color-plum);
}

/* Below 480 the line stacks: a separator only ever sits between two items on one line */
@media (max-width: 480px) {
  .hero__meta {
    flex-direction: column;
    gap: 0.35rem;
  }

  .hero__meta-sep {
    display: none;
  }
}

/* ---------- Band scaffold ---------- */

.band {
  padding-block: var(--space-band);
}

.band--tight {
  padding-block: var(--space-band-tight);
}

.band__inner {
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--space-gutter);
}

.band__head {
  max-width: 62rem;
  margin: 0 auto var(--space-band-tight);
  text-align: center;
}

.band__head--left {
  margin-inline: 0;
  text-align: left;
}

.band__title {
  margin-top: 0.85rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--display-2);
  line-height: 1;
  letter-spacing: -0.015em;
  color: var(--color-plum);
  text-wrap: balance;
}

.band__lede {
  max-width: var(--measure);
  margin: 1.25rem auto 0;
  font-size: calc(var(--text-lede) * 0.9);
  line-height: 1.4;
  color: var(--color-navy);
  text-wrap: pretty;
}

.band__head--left .band__lede {
  margin-inline: 0;
}

.eyebrow--on-dark {
  color: var(--color-bone);
}

/* Each band has a hue; its eyebrow carries the hero's three-dot marker in that hue */
.band--theme { --band-hue: var(--color-bone); }
.band--stage { --band-hue: var(--color-violet); }
.band--programme { --band-hue: var(--color-plum); }

/* The speakers drawer and the programme read as one run: half the usual space between the two bands */
.band--stage { padding-bottom: calc(var(--space-band) / 2); }
.band--programme { padding-top: calc(var(--space-band) / 2); }
.band--compete { --band-hue: var(--color-violet); }
.band--room { --band-hue: var(--color-teal); }
.band--press { --band-hue: var(--color-violet); }
.band--partners { --band-hue: var(--color-oxblood); }
.band--involve { --band-hue: var(--color-saffron); }
.site-footer { --band-hue: var(--color-accent-on-dark); }

.band .eyebrow::before,
.site-footer .eyebrow::before {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  margin-right: 28px;
  border-radius: 50%;
  background: var(--band-hue, var(--color-plum));
  box-shadow:
    14px 0 0 color-mix(in oklab, var(--band-hue, var(--color-plum)) 70%, transparent),
    28px 0 0 color-mix(in oklab, var(--band-hue, var(--color-plum)) 40%, transparent);
}

/* Hand-off links: running-stitch underline that draws in */
.stitch-link {
  position: relative;
  display: inline-block;
  padding-block: 0.3em;
  font-weight: 600;
  color: inherit;
}

/* A full-width stitch under the link; on hover the stitch runs along it */
.stitch-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--stitch-dot);
  --stitch-color: currentColor;
  background-image: var(--stitch);
  background-size: var(--stitch-pitch) var(--stitch-dot);
  background-repeat: repeat-x;
  opacity: 0.6;
  transition: opacity var(--duration-normal) var(--ease-out-expo);
}

.stitch-link:hover::after,
.stitch-link:focus-visible::after {
  opacity: 1;
}

/* ---------- Ground: the hero's dot grid continues on every bone surface ---------- */

.band--proof,
.academic {
  background-image: var(--grid);
  background-size: var(--grid-size) var(--grid-size);
}

/* Reveals, staggers and every scroll-linked effect live in motion.css. */

/* ---------- Divider: a row of the hero's motif tiles between two white bands ---------- */

.divider {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(0.75rem, 0.5rem + 1vw, 1.5rem);
  padding-inline: var(--space-gutter);
}

.divider__tile {
  width: clamp(28px, 2rem + 1.2vw, 56px);
  color: var(--hue);
}

.divider__tile:nth-child(even) {
  width: clamp(20px, 1.4rem + 0.8vw, 40px);
}

/* The bands on either side of a divider give up half their padding */
.band:has(+ .divider) {
  padding-bottom: var(--space-band-tight);
}

.divider + .band {
  padding-top: var(--space-band-tight);
}

/* ---------- Dot-matrix text ---------- */

.dot-text {
  display: grid;
  grid-template-columns: repeat(var(--cols), var(--dot));
  grid-template-rows: repeat(var(--rows), var(--dot));
  gap: var(--dot-gap);
  color: var(--hue, var(--color-plum));
}

.dot-text--inline {
  display: inline-grid;
  vertical-align: -0.1em;
  --dot: 0.3em;
  --dot-gap: 0.06em;
  margin-right: 0.35em;
}

.dot-text__dot {
  grid-column: calc(var(--c) + 1);
  grid-row: calc(var(--r) + 1);
  width: var(--dot);
  height: var(--dot);
  border-radius: 50%;
  background: currentColor;
  transform: scale(0);
  transition: transform 520ms var(--ease-spring);
  transition-delay: var(--d, 0ms);
}

.is-in .dot-text__dot,
.dot-text--static .dot-text__dot {
  transform: scale(1);
}

/* ---------- Dot charts: one dot per person ---------- */

.dot-chart {
  display: grid;
  grid-template-columns: repeat(var(--cols), var(--dot));
  gap: var(--dot-gap);
}

.dot-chart__dot {
  width: var(--dot);
  height: var(--dot);
  border-radius: 50%;
  background: var(--hue);
  transform: scale(0);
  transition: transform 460ms var(--ease-spring);
  transition-delay: var(--d, 0ms);
}

.is-in .dot-chart__dot {
  transform: scale(1);
}

.legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem 1.25rem;
  margin-top: 1.25rem;
  font-size: var(--text-small);
  font-variant-numeric: tabular-nums;
  color: var(--color-navy);
}

.legend li {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.legend li::before {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--hue);
  transform: translateY(-1px);
}

.legend b {
  font-weight: 700;
  min-width: 1.6em;
}

/* ---------- Procedural motifs as inline SVG ---------- */

.motif {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.motif > * {
  transform-box: view-box;
  transform-origin: var(--ox) var(--oy);
  transform: scale(0);
  transition: transform 520ms var(--ease-spring);
  transition-delay: var(--d, 0ms);
}

.is-in .motif > *,
.motif--static > * {
  transform: scale(1);
}

/* Pulsing dot for "applications open" */
.dot-pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 0.4rem;
  border-radius: 50%;
  background: currentColor;
  animation: dot-pulse 1.8s ease-in-out infinite;
}

@keyframes dot-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dot-text__dot,
  .dot-chart__dot,
  .dot-motif__cell,
  .patchwork__cell,
  .motif > *,
  .stitch-link::after {
    transition-duration: 1ms;
    transition-delay: 0ms;
  }

  .dot-pulse,
  .nav--open .nav__links li {
    animation: none;
  }
}
