/* Home page only. Loaded by _layouts/home.html after theme.css, in place of the theme's main.css. */

body.home {
  margin: 0;
  min-height: 100vh;
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
}

/* Shared type */
h1,
h2 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

h1 em,
h2 em {
  color: var(--accent);
  font-style: normal;
}

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

/* Hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: clamp(16px, 2.4vw, 40px);
  max-width: 1360px;
  min-height: min(calc(82vh - 64px), 760px);
  margin: 0 auto;
  padding: clamp(40px, 6vw, 88px) var(--gutter);
}

.hero h1 {
  font-size: clamp(36px, 4.2vw, 64px);
}

/* Spacing when there is no intro under the headline */
.hero h1 + .button {
  margin-top: 32px;
}

.hero__lead {
  max-width: 34em;
  margin: 26px 0 32px;
  color: var(--soft);
  font-size: clamp(17px, 1.5vw, 20px);
}

.hero__mark {
  display: block;
  justify-self: center;
  /* Lets the map reach into the page margin, so it can be larger */
  margin-right: calc(var(--gutter) * -0.6);
  width: 100%;
  max-width: 800px;
  height: auto;
  /* No card: a soft white glow clears the background lines, with a pastel rim to lift the map */
  padding: 5% 1%;
  background:
    radial-gradient(ellipse closest-side, rgba(255, 255, 255, 0.82) 58%, rgba(255, 255, 255, 0.58) 78%, rgba(255, 255, 255, 0) 100%);
  filter: drop-shadow(0 0 22px rgba(160, 131, 224, 0.28));
}

.button,
.button:visited {
  display: inline-flex;
  align-items: center;
  min-height: 50px;
  padding: 0 26px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--button-text);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.15s ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* Three research areas */
.home__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 28px);
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.home__card,
.home__card:visited {
  display: block;
  padding: 12px;
  border-radius: 28px;
  color: var(--ink);
  text-decoration: none;
}

.home__card figure {
  margin: 0;
}

.home__card:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* Hover cues avoid moving the card itself, because the scroll reveal animates its position */
.home__card:hover figcaption {
  color: var(--accent);
}

.home__card-arrow {
  display: inline-block;
  color: var(--accent);
  transition: transform 0.15s ease;
}

.home__card:hover .home__card-arrow {
  transform: translateY(3px);
}

.home__card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1.05;
  object-fit: cover;
  border-radius: 18px;
}

/* The card is slightly taller than the square map, so the crop comes off the sides; take it all from the right to keep Liberia's glow */
.home__card img[src$="section-map.svg"] {
  object-position: left center;
}

.home__card figcaption {
  padding: 18px 10px 12px;
  font-size: clamp(19px, 1.6vw, 23px);
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: -0.015em;
}

/* Image and panel rows that appear on scroll */
.features {
  display: grid;
  gap: clamp(56px, 8vw, 120px);
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(56px, 8vw, 110px) var(--gutter) clamp(80px, 10vw, 150px);
}

.feature {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: center;
}

.feature__image {
  grid-row: 1;
  grid-column: 1 / span 6;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 5 / 4;
  object-fit: cover;
  border-radius: 28px;
  box-shadow: 0 26px 60px var(--shadow);
}

.feature__panel {
  grid-row: 1;
  grid-column: 6 / span 7;
  z-index: 1;
  padding: clamp(28px, 4vw, 56px);
  border-radius: 28px;
}

.feature:nth-child(even) .feature__image {
  grid-column: 7 / span 6;
}

.feature:nth-child(even) .feature__panel {
  grid-column: 1 / span 7;
}

.feature__panel h2 {
  margin-bottom: 16px;
  font-size: clamp(30px, 3.4vw, 46px);
}

.feature__panel p:last-child {
  margin: 0;
}

/* Scroll reveal. The class is set by script, so content stays visible without it. */
.has-reveal .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.has-reveal .reveal.is-visible {
  opacity: 1;
  transform: none;
}

.has-reveal .home__card:nth-child(2) {
  transition-delay: 0.12s;
}

.has-reveal .home__card:nth-child(3) {
  transition-delay: 0.24s;
}

/* Read more link at the end of each research area panel */
.feature__panel p:last-of-type {
  margin-bottom: 0;
}

.feature__more,
.feature__more:visited {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin-top: 14px;
  color: var(--accent);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
}

.feature__more:hover {
  text-decoration: underline;
}

.feature__more:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Affiliations and partners */
.partners {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--gutter) clamp(56px, 7vw, 96px);
}

.partners h2 {
  margin-bottom: 24px;
  font-size: clamp(30px, 3.4vw, 46px);
  text-align: center;
}

.partners__grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.partners__grid li {
  display: flex;
  flex: 0 1 calc((100% - 32px) / 3);
  min-width: 0;
}

.partner,
.partner:visited {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-height: 124px;
  padding: 22px 24px;
  border-radius: 22px;
  transition: transform 0.15s ease;
}

.partner:hover {
  transform: translateY(-3px);
}

.partner:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.partner img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 72px;
}

@media (max-width: 860px) {
  .partners__grid li {
    flex-basis: 100%;
    max-width: 480px;
  }
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    padding-top: 32px;
  }

  /* Wide map graphic, full width under the text */
  .hero__mark {
    max-width: 680px;
    margin-right: 0;
    grid-row: 2;
  }

  /* The text spans the full width here, so soften the art behind the hero instead of beside it */
  body.home::before {
    background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.66) 300px, rgba(255, 255, 255, 0) 500px), var(--art);
  }

  .home__grid {
    grid-template-columns: minmax(0, 1fr);
    max-width: 560px;
  }

  .home__card {
    padding: 10px;
    border-radius: 24px;
  }

  .home__card img {
    aspect-ratio: 1 / 1;
    border-radius: 16px;
  }

  .home__card figcaption {
    padding: 14px 8px 8px;
    font-size: 19px;
  }

  .has-reveal .home__card:nth-child(n) {
    transition-delay: 0s;
  }

  .features {
    max-width: 600px;
  }

  /* Image above, panel overlapping its lower edge */
  .feature,
  .feature:nth-child(even) {
    display: block;
  }

  .feature__image {
    width: 100%;
    margin: 0 auto -28px;
    border-radius: 24px;
  }

  .feature__panel {
    position: relative;
    border-radius: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
.has-reveal .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .button {
    transition: none;
  }
}

@media print {
  .has-reveal .reveal {
    opacity: 1;
    transform: none;
  }
}
