.home-opening {
  --site-focus: #f7d699;
  --home-wash-x: 76%;
  --home-wash-y: 53%;
  color: #f7faf7;
  background:
    radial-gradient(ellipse min(34rem, 52vw) 15rem at var(--home-wash-x) var(--home-wash-y), rgb(125 135 79 / 27%), transparent),
    radial-gradient(ellipse min(43rem, 64vw) 22rem at var(--home-wash-x) var(--home-wash-y), rgb(69 132 112 / 29%), transparent),
    #163c34;
}

.home-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  padding-block: clamp(3.25rem, 5.5vw, 5.5rem);
}

.home-lead h1,
.home-databases h2,
.home-resources h2,
.home-database-name {
  font-family: "Playfair Display", Georgia, serif;
}

.home-lead h1 {
  margin: 0 0 1.25rem;
  color: inherit;
  font-size: clamp(2.75rem, 4.7vw, 4.5rem);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 1.06;
}

.home-lead h1 em {
  color: #bce0c4;
}

.home-lead p {
  max-width: 46ch;
  margin: 0;
  color: #e0ede5;
  font-size: 1.0625rem;
  line-height: 1.65;
}

.home-browse {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 1.5rem;
  padding: 0.6rem 1rem;
  border: 1px solid #adc9b7;
  color: #fff;
  font-weight: 600;
}

.home-browse:hover,
.home-browse:focus-visible {
  color: #163c34;
  background: #f7faf7;
}

.home-artwork {
  margin: 0;
}

.home-art-scene {
  position: relative;
  isolation: isolate;
  width: 100%;
  aspect-ratio: 1.66;
}

.home-art-scene::before {
  position: absolute;
  inset: auto 5% 0;
  z-index: -1;
  height: 30%;
  background: radial-gradient(ellipse 50% 50% at 50% 57%, rgb(159 152 94 / 24%), transparent);
  content: "";
}

.home-art-scene::after {
  position: absolute;
  z-index: -1;
  top: 0;
  left: 28%;
  width: 52%;
  aspect-ratio: 1;
  border: 1px solid rgb(185 215 185 / 17%);
  border-radius: 50%;
  content: "";
}

.home-art-orbit {
  position: absolute;
  z-index: 2;
  top: 30%;
  left: 18%;
  width: 72%;
  height: 34%;
  transform: rotate(-24deg);
  border: 1px solid rgb(185 215 185 / 30%);
  border-radius: 50%;
}

.home-art-orbit-dot {
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #d4dfb3;
  box-shadow: 0 0 6px rgb(188 224 196 / 60%);
  offset-path: ellipse(50% 50% at 50% 50%);
  offset-distance: 66%;
  offset-rotate: 0deg;
}

/* Crop the globe from the original artwork and feather its edges. */
.home-art-globe {
  position: absolute;
  top: 2%;
  left: 29%;
  width: 52%;
  aspect-ratio: 210 / 214;
  background: url("../img/watercolor_veggies.png") 55.5% 86% / calc(992 / 210 * 100%) auto no-repeat;
  mask-image: radial-gradient(ellipse 52% 51% at 51% 53%, #000 54%, rgb(0 0 0 / 44%) 78%, transparent 100%);
}

.home-art-food {
  position: absolute;
  z-index: 4;
  inset: auto 0 0;
  display: block;
  width: 100%;
  height: auto;
  mask-image: linear-gradient(90deg, transparent, rgb(0 0 0 / 62%) 6%, #000 16%, #000 84%, rgb(0 0 0 / 62%) 94%, transparent),
    linear-gradient(180deg, transparent, #000 13%, #000 79%, rgb(0 0 0 / 58%) 92%, transparent);
  mask-composite: intersect;
}

.home-art-filters {
  position: absolute;
}

/* Keep the globe behind the warmer tones in the produce. */
.home-art-globe {
  filter: url("#home-art-feather") saturate(0.8) brightness(0.91);
}

.home-art-food {
  filter: url("#home-art-feather") saturate(0.94) sepia(0.06);
}

.home-art-molecule {
  --nitrogen-x: 50%;
  --nitrogen-y: 53%;
  --oxygen-y: 71%;
  --left-angle: 150deg;
  --right-angle: 30deg;
  --bond-length: 26%;
  --pigment-opacity: 0.73;
  position: absolute;
  z-index: 3;
  width: 14%;
  aspect-ratio: 1.4;
  isolation: isolate;
  opacity: var(--pigment-opacity);
  transform: rotate(var(--art-angle));
}

.home-art-molecule--nitrate {
  --art-angle: -13deg;
  top: 20%;
  left: 12%;
}

.home-art-molecule--nitrite {
  --art-angle: 14deg;
  --nitrogen-y: 68%;
  --oxygen-y: 43%;
  --left-angle: -141deg;
  --right-angle: -39deg;
  --bond-length: 29%;
  top: 6%;
  right: 8%;
}

.home-art-molecule--no {
  --art-angle: 10deg;
  --nitrogen-x: 35%;
  --nitrogen-y: 56%;
  --oxygen-y: 42%;
  --right-angle: -18deg;
  --bond-length: 33%;
  top: 30%;
  right: 2%;
  width: 11%;
}

.home-art-atom {
  position: absolute;
  width: 26%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: url("../img/home-watercolour-atom.png") center / contain no-repeat;
}

.home-art-atom--top { top: 17%; left: 50%; }
.home-art-atom--left { top: var(--oxygen-y); left: 27%; }
.home-art-atom--right { top: var(--oxygen-y); left: 73%; }
.home-art-molecule--no .home-art-atom--right { left: 66%; }

.home-art-atom--nitrogen {
  top: var(--nitrogen-y);
  left: var(--nitrogen-x);
  filter: hue-rotate(187deg) saturate(0.82);
}

.home-art-bond {
  position: absolute;
  top: var(--nitrogen-y);
  left: var(--nitrogen-x);
  width: var(--bond-length);
  height: 3px;
  transform-origin: left center;
  border-radius: 60% 31% 48% 27%;
  background: linear-gradient(90deg, #89b5c6, #d59b8a);
  opacity: 0.72;
}

.home-art-bond--top { transform: translateY(-50%) rotate(-90deg); }
.home-art-bond--left { transform: translateY(-50%) rotate(var(--left-angle)); }
.home-art-bond--right { transform: translateY(-50%) rotate(var(--right-angle)); }

@media (prefers-reduced-motion: no-preference) {
  .home-art-globe {
    animation: home-globe-arrive 3.2s ease-out both;
  }

  .home-art-food {
    animation: home-food-arrive 2.4s 0.15s ease-out both;
  }

  .home-art-orbit-dot {
    animation: home-orbit-light 3.8s ease-out both;
  }

  .home-art-molecule {
    animation: home-compound-arrive 1.45s 0.25s ease-out both;
  }

  .home-art-molecule--nitrite {
    animation-delay: 0.48s;
  }

  .home-art-molecule--no {
    animation-delay: 0.71s;
  }
}

@keyframes home-globe-arrive {
  from { transform: translateY(4%) rotate(-5deg); opacity: 0.55; }
  to { transform: translateY(0) rotate(0); opacity: 1; }
}

@keyframes home-food-arrive {
  from { transform: translateY(4%) scale(0.985); opacity: 0.52; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes home-orbit-light {
  0% { offset-distance: 15%; opacity: 0.3; }
  50% { opacity: 1; }
  100% { offset-distance: 66%; opacity: 0.65; }
}

@keyframes home-compound-arrive {
  from { transform: rotate(calc(var(--art-angle) - 9deg)) scale(0.66); opacity: 0.15; filter: blur(1.5px); }
  to { transform: rotate(var(--art-angle)) scale(1); opacity: var(--pigment-opacity); filter: blur(0); }
}

.home-databases {
  padding-block: clamp(2rem, 4vw, 3.5rem);
  border-bottom: 1px solid var(--site-line);
}

.home-databases h2,
.home-resources h2 {
  margin: 0 0 1.15rem;
  color: var(--site-ink);
  font-size: clamp(1.65rem, 2.5vw, 2.15rem);
  font-weight: 600;
  line-height: 1.2;
}

.home-databases-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem 1.5rem;
  margin-bottom: 1.15rem;
}

.home-databases-heading h2 {
  margin: 0;
}

.home-databases-heading a {
  color: var(--site-green-dark);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.home-database-list,
.home-link-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-database-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-block: 1px solid #b9c9bf;
}

.home-database-list li + li {
  border-left: 1px solid #b9c9bf;
}

.home-database-list a {
  display: block;
  height: 100%;
  padding: 1.25rem clamp(0.8rem, 2vw, 1.5rem);
  color: var(--site-green-dark);
  text-decoration: none;
}

.home-database-list a:hover {
  background: #f1f5f2;
}

.home-database-name {
  display: block;
  margin-bottom: 0.4rem;
  font-size: clamp(1.4rem, 2.25vw, 1.9rem);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.home-database-description {
  display: block;
  color: var(--site-ink);
  line-height: 1.55;
}

.home-resources {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(2rem, 6vw, 6rem);
  padding-block: clamp(2rem, 4vw, 3.5rem);
}

.home-link-list a {
  display: inline-block;
  padding-block: 0.45rem;
  color: var(--site-green-dark);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.home-link-list a:hover,
.home-databases-heading a:hover {
  text-decoration-thickness: 2px;
}

@media (max-width: 820px) {
  .home-opening {
    --home-wash-x: 50%;
    --home-wash-y: 76%;
  }

  .home-hero-grid {
    grid-template-columns: 1fr;
  }

  .home-lead h1 {
    font-size: clamp(2.25rem, 7.8vw, 3.8rem);
  }

  .home-artwork {
    width: min(100%, 34rem);
    justify-self: center;
  }
}

@media (max-width: 600px) {
  .home-hero-grid {
    padding-block: 2.5rem;
  }

  .home-art-scene {
    aspect-ratio: 1.48;
  }

  .home-database-list,
  .home-resources {
    grid-template-columns: 1fr;
  }

  .home-database-list li + li {
    border-top: 1px solid #b9c9bf;
    border-left: 0;
  }

  .home-database-list a {
    padding-inline: 0;
  }
}
