/*
 * Contact page: headline, contact lines with copy buttons, falling droplets.
 */

.contact {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: grid;
  align-content: center;
  min-height: 62vh;
  padding-block: clamp(56px, 9vw, 120px) clamp(72px, 12vw, 160px);
}

.contact h1 {
  margin-top: 22px;
  max-width: 13ch;
  font-size: clamp(2.5rem, 8vw, 6.4rem);
}

.contact .lede {
  margin-top: 24px;
}

/* ---------- Contact lines ---------- */

.contact-lines {
  margin-top: clamp(40px, 6vw, 76px);
  border-top: 1.5px solid var(--line);
}

.contact-line {
  position: relative;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: clamp(20px, 3vw, 36px) 0;
  border-bottom: 1.5px solid var(--line);
}

/* Ochre underline that draws across on hover */
.contact-line::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1.5px;
  height: 4px;
  border-radius: 4px;
  background: var(--ochre);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform .8s var(--ease-io);
}

.contact-line:hover::before,
.contact-line:focus-within::before {
  transform: none;
}

.contact-line__label {
  font-family: var(--mono);
  font-size: var(--fs-small);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ochre);
}

/* A tel: or mailto: link, sized to its text so only the text itself is clickable. */
.contact-line__value {
  justify-self: start;
  min-width: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.5rem, 5.6vw, 4.2rem);
  letter-spacing: -.035em;
  line-height: 1.05;
  text-decoration: none;
  overflow-wrap: anywhere;
  -webkit-user-select: all;
  user-select: all;
  transition: color .25s;
}

.contact-line__value:hover {
  color: var(--ochre);
}

.copy-btn {
  min-width: 92px;
  padding: 11px 20px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1.5px var(--line);
  font-family: var(--display);
  font-weight: 600;
  font-size: .95rem;
  transition: background-color .25s, color .25s, box-shadow .25s;
}

.copy-btn:hover {
  box-shadow: inset 0 0 0 1.5px var(--ochre);
  color: var(--ochre);
}

.copy-btn.is-done {
  background: var(--ochre);
  box-shadow: none;
  color: var(--forest);
}

@media (max-width: 860px) {
  .contact-line {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .contact-line__label {
    grid-column: 1 / -1;
  }
}

/* ---------- Background droplets ---------- */

.contact__drips {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.contact__drips span {
  position: absolute;
  top: -60px;
  left: var(--left);
  width: var(--size);
  height: calc(var(--size) * 1.45);
  background: var(--color, var(--leaf));
  clip-path: polygon(50% 0, 62% 18%, 82% 40%, 96% 60%, 100% 74%, 92% 90%, 74% 99%, 50% 100%, 26% 99%, 8% 90%, 0 74%, 4% 60%, 18% 40%, 38% 18%);
  opacity: .5;
  animation: drip var(--duration) cubic-bezier(.5, 0, .9, .6) var(--delay) infinite;
}

/* Position, size and pace of each droplet. Negative delays start them mid-fall. */
.contact__drips span:nth-child(1) { --left: 8%;  --size: 22px; --duration: 11s; --delay: -2s; }
.contact__drips span:nth-child(2) { --left: 27%; --size: 12px; --duration: 8s;  --delay: -5s; --color: var(--ochre); }
.contact__drips span:nth-child(3) { --left: 49%; --size: 30px; --duration: 14s; --delay: -9s; }
.contact__drips span:nth-child(4) { --left: 68%; --size: 14px; --duration: 9s;  --delay: -1s; --color: var(--ochre); }
.contact__drips span:nth-child(5) { --left: 84%; --size: 24px; --duration: 12s; --delay: -7s; }
.contact__drips span:nth-child(6) { --left: 94%; --size: 10px; --duration: 7s;  --delay: -3s; }

@keyframes drip {
  0% { transform: translateY(0) scale(.5); opacity: 0; }
  12% { transform: translateY(6vh) scale(1); opacity: .55; }
  100% { transform: translateY(110vh) scale(1); opacity: .55; }
}
