/* Homepage. Uses the site theme variables so light and dark modes follow the toggle. */
.home {
  --home-muted: var(--global-text-color-light, #666);
  --home-line: var(--global-divider-color, #ddd);
  --home-accent: var(--global-theme-color, #0076df);
  --home-tint: rgba(128, 128, 128, 0.07);
  padding-bottom: 3rem;
}
.home h2,
.home h3 {
  color: var(--global-text-color);
}
/* Lets a section run wider than the 900px text column, keeping a 16px gutter. */
.home-wide {
  width: min(1180px, calc(100vw - 32px));
  margin-left: calc(50% - min(590px, 50vw - 16px));
}
.home-eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--home-accent);
}
.home-eyebrow a {
  color: inherit;
}
.home-hero {
  padding: 2.5rem 0 0.5rem;
}
/* Hero: introduction on the left, the team on the right, their eyebrows on one line. */
.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 2.75rem;
  align-items: start;
}
.home-title {
  margin: 0 0 1.4rem;
  font-size: clamp(3rem, 7vw, 4.4rem);
  line-height: 1;
}
.home-title-svg {
  display: block;
  height: 1.5em;
  width: auto;
  max-width: 100%;
  overflow: visible;
}
.webs-group {
  font-family: inherit;
  font-size: 40px;
  font-weight: 300;
  letter-spacing: -0.01em;
  fill: var(--global-text-color);
}
/* Shown only if home-title.js does not run. */
.webs-fallback {
  font-size: 100px;
  font-weight: 600;
  fill: var(--global-text-color);
}
/* The food web, built by home-title.js: species coloured by trophic level, interactions as cables of silk. */
.webs-node {
  fill: var(--global-bg-color, #fff);
  stroke: var(--global-text-color);
  stroke-width: 1.8;
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.45s cubic-bezier(0.3, 1.7, 0.5, 1);
}
.webs-node.is-basal {
  fill: #2a9d6f;
}
.webs-node.is-top {
  fill: #d9822b;
}
.webs-cable path {
  fill: none;
  stroke: var(--global-text-color);
  stroke-width: 0.8;
  opacity: 0.85;
}
.webs-bind {
  stroke: var(--global-text-color);
  stroke-width: 0.4;
  opacity: 0.7;
  transition: opacity 0.5s ease;
}
.webs-tie {
  fill: none;
  stroke: var(--global-text-color);
  stroke-width: 0.7;
  opacity: 0.6;
}
.webs-dragline {
  stroke: var(--global-text-color);
  stroke-width: 0.5;
  opacity: 0.4;
  transition: opacity 0.6s ease;
}
.webs-dragline.is-gone {
  opacity: 0;
}
/* Each spinner is drawn over a halo in the page colour, so it stands out on the silk. */
.webs-ink {
  fill: var(--global-text-color);
  stroke: var(--global-text-color);
  stroke-width: 0.6;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.webs-halo {
  fill: var(--global-bg-color, #fff);
  stroke: var(--global-bg-color, #fff);
  stroke-width: 2.4;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.webs-ink polyline,
.webs-halo polyline {
  fill: none;
}
/* The tent caterpillar's body and the white stripe down its back; the weaver ant's larva. */
.webs-ink .nest-soft {
  stroke-width: 3.2;
}
.webs-halo .nest-soft {
  stroke-width: 5.4;
}
.webs-ink .nest-stripe {
  stroke: var(--global-bg-color, #fff);
  stroke-width: 0.7;
  stroke-dasharray: 1.3 1;
}
.webs-halo .nest-stripe {
  stroke: none;
}
.webs-ink .nest-larva {
  fill: var(--global-bg-color, #fff);
}
.webs-settled .webs-spinner-body {
  animation: web-bob 5s ease-in-out 1s infinite;
}
.home-title:hover .webs-spinner-body {
  animation: web-twitch 0.6s ease-in-out;
}
.home-acronym {
  font-size: 1.15rem;
  font-weight: 300;
  color: var(--home-muted);
  margin: 0 0 1.5rem;
}
.home-acronym .ac-word {
  white-space: nowrap;
}
.home-acronym b {
  font-weight: 600;
  color: var(--global-text-color);
}
.home-lede p {
  font-size: 1.05rem;
  line-height: 1.65;
  max-width: 60ch;
  margin: 0;
}
.home-approach {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
  padding: 1.5rem;
  border-radius: 10px;
  background: var(--home-tint);
}
.home-approach-step h2 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0.6rem 0 0.35rem;
}
.home-approach-step p {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--home-muted);
  margin: 0;
}
.home-approach-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--home-accent);
}
.home-section {
  margin-top: 4rem;
}
.home-section-head {
  margin-bottom: 1.4rem;
}
.home-section-head h2 {
  font-size: 1.75rem;
  font-weight: 500;
  margin: 0 0 0.5rem;
}
.home-section-head p:not(.home-eyebrow) {
  color: var(--home-muted);
  margin: 0;
  max-width: 62ch;
}
@media (max-width: 760px) {
  .home-approach {
    grid-template-columns: 1fr;
  }
  .home-approach {
    gap: 1.1rem;
  }
}
@media (max-width: 600px) {
  .home-hero {
    padding-top: 1.5rem;
  }
  .home-lede p {
    font-size: 1rem;
  }
  .home-section {
    margin-top: 3rem;
  }
  .home-section-head h2 {
    font-size: 1.4rem;
  }
}
/* Research: one art card per section of the Research page. */
.home-themes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.75rem 1.1rem;
}
.home-theme {
  display: flex;
  flex-direction: column;
  color: var(--global-text-color) !important;
  text-decoration: none !important;
}
.home-theme-art {
  display: block;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  overflow: hidden;
  background: var(--home-tint);
}
.home-theme-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s ease;
}
.home-theme:hover .home-theme-art img {
  transform: scale(1.05);
}
.home-theme-body {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.7rem 0.1rem 0;
}
.home-theme-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
}
.home-theme-question {
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--home-muted);
}
.home-theme-more {
  font-size: 0.78rem;
  color: var(--home-accent);
}
.home-theme:hover .home-theme-title,
.home-theme:focus-visible .home-theme-title {
  color: var(--home-accent);
}
.home-theme:focus-visible {
  outline: 2px solid var(--home-accent);
  outline-offset: 4px;
  border-radius: 10px;
}

/* Team mosaic beside the introduction. */
.home-team .home-eyebrow {
  margin-bottom: 0.7rem;
}
.home-team-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  list-style: none;
  padding: 0;
  margin: 0;
}
.home-member {
  position: relative;
  display: block;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: var(--home-tint);
  color: #fff !important;
  text-decoration: none !important;
}
.home-member img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 35%;
  display: block;
  transition: transform 0.4s ease;
}
/* Side by side, the photos stretch so the team column ends level with the introduction. */
@media (min-width: 761px) {
  .home-hero {
    align-items: stretch;
  }
  .home-team {
    display: flex;
    flex-direction: column;
  }
  .home-team-grid {
    flex: 1;
    grid-auto-rows: minmax(6rem, 1fr);
  }
  .home-member {
    aspect-ratio: auto;
    height: 100%;
  }
  .home-member img {
    position: absolute;
    inset: 0;
  }
}
/* Room for a name and a two-line role, filled from the top, so every name sits at the same height. */
.home-member-text {
  position: absolute;
  inset: auto 0 0 0;
  min-height: 4.5rem;
  padding: 1.6rem 0.5rem 0.45rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0));
  line-height: 1.2;
  color: #fff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.home-member-text span {
  color: inherit !important;
}
.home-member-name {
  display: block;
  font-size: 0.74rem;
  font-weight: 600;
}
.home-member-role {
  display: block;
  font-size: 0.62rem;
  opacity: 0.85;
}
.home-member:hover img {
  transform: scale(1.06);
}
.home-member:focus-visible {
  outline: 2px solid var(--home-accent);
  outline-offset: 2px;
}
.home-team-links {
  display: flex;
  gap: 1.25rem;
  margin: 0.8rem 0 0;
  font-size: 0.85rem;
}
/* Opening sequence (first visit only): the spinners spin the letters, then the name and the team arrive. */
.webs-intro .webs-group {
  opacity: 0;
  transition: opacity 0.6s ease;
}
.webs-intro .webs-group.is-in {
  opacity: 1;
}
.webs-intro .webs-node:not(.is-in) {
  transform: scale(0);
}
.webs-intro .webs-cable:not(.is-bound) .webs-bind {
  opacity: 0;
}
.webs-intro .webs-tie {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 0.7s ease var(--d, 0s);
}
.webs-intro .webs-ties.is-strung .webs-tie {
  stroke-dashoffset: 0;
}
.webs-intro .ac-tail {
  display: inline-block;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: pre;
  vertical-align: bottom;
}
.webs-intro .webs-done .ac-tail {
  animation: webs-expand 0.9s cubic-bezier(0.3, 0, 0.2, 1) var(--d, 0s) forwards;
}
@keyframes webs-expand {
  to {
    max-width: 10em;
    opacity: 1;
  }
}
@keyframes webs-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
  }
}
@keyframes webs-pop {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
  }
}
@keyframes web-bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(1.5px);
  }
}
@keyframes web-twitch {
  25% {
    transform: rotate(-14deg);
  }
  75% {
    transform: rotate(12deg);
  }
}

@media (max-width: 760px) {
  .home-themes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .home-hero {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  .webs-spinner-body {
    animation: none !important;
  }
  .home-member img,
  .home-theme-art img {
    transition: none;
  }
}
