/* FROM — Contact, section 1: ways to reach us. A plain-spoken heading, the e-mail address set large with a copy
   button, then three cards that open an e-mail already titled for what you're writing about. js/contact.js copies. */

.reach {
  padding: calc(80px + clamp(48px, 7vw, 104px)) 0 clamp(88px, 11vw, 160px);
  background: var(--paper);
}

.reach__title {
  max-width: 14ch;
  margin: 0;
  font-size: clamp(44px, 5.4vw, 88px);
  line-height: 0.98;
  font-weight: 760;
  letter-spacing: -0.055em;
  text-wrap: balance;
}

.reach__title em {
  font-style: normal;
  color: var(--orange);
}

.reach__lede {
  max-width: 46ch;
  margin-top: 28px;
  font-size: clamp(17px, 1.4vw, 21px);
  line-height: 1.55;
  color: var(--ink-2);
}

/* ---------- The address ---------- */

.mail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 32px;
  margin-top: clamp(48px, 6vw, 88px);
  padding: clamp(24px, 3vw, 40px) 0;
  border-top: 1.5px solid var(--line);
  border-bottom: 1.5px solid var(--line);
}

.mail__label {
  display: block;
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-3);
}

.mail__address {
  position: relative;
  font-size: clamp(24px, 4.2vw, 64px);
  line-height: 1.1;
  font-weight: 720;
  letter-spacing: -0.045em;
  overflow-wrap: anywhere;
}

/* An orange line that draws under the address on hover. */
.mail__address::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 4px;
  border-radius: 4px;
  background: var(--orange);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s var(--ease-out);
}

.mail__address:hover::after,
.mail__address:focus-visible::after {
  transform: none;
}

.mail__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.mail__copy {
  min-width: 132px;
}

.mail__copy[data-done] {
  background: var(--orange-wash);
  color: var(--orange-ink);
}

/* ---------- What it's about ---------- */

.topics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin: clamp(40px, 5vw, 64px) 0 0;
  padding: 0;
  list-style: none;
}

.topic {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 28px 28px 0;
  border-radius: var(--radius-lg);
  background: var(--orange-wash);
  overflow: hidden;
  transition: transform 0.5s var(--ease-out);
}

.topic:nth-child(2) {
  background: var(--paper-warm);
}

.topic:nth-child(3) {
  background: var(--orange-tint);
}

.topic:hover {
  transform: translateY(-6px);
}

.topic__title {
  margin: 0;
  font-size: clamp(22px, 1.9vw, 28px);
  line-height: 1.12;
  font-weight: 740;
  letter-spacing: -0.035em;
}

.topic__text {
  margin-top: 10px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink-2);
}

/* The whole card is the link; the arrow line sits under the text. */
.topic__link {
  margin-top: 20px;
}

.topic__link::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.topic__link:focus-visible {
  outline: none;
}

.topic:has(.topic__link:focus-visible) {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.topic__art {
  width: 100%;
  max-width: 300px;
  height: auto;
  margin: 12px auto -8px;
  transition: transform 0.6s var(--ease-out);
}

.topic:hover .topic__art {
  transform: translateY(-6px) rotate(-1.5deg);
}

/* Plays in: the cards rise one after another. */
.topics[data-reveal] .topic {
  opacity: 0;
  translate: 0 28px;
  transition: opacity 0.6s calc(var(--i) * 0.12s), translate 0.9s calc(var(--i) * 0.12s) var(--ease-out),
    transform 0.5s var(--ease-out);
}

.topics.is-in .topic {
  opacity: 1;
  translate: 0 0;
}

/* ---------- Tablet and phone ---------- */

@media (max-width: 1000px) {
  .topics {
    grid-template-columns: 1fr;
    max-width: 560px;
  }

  .topic {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 140px;
    align-items: center;
    column-gap: 12px;
    padding: 24px 0 24px 24px;
  }

  .topic__art {
    grid-column: 2;
    grid-row: 1 / span 3;
    margin: 0;
  }
}

@media (max-width: 560px) {
  .mail__actions,
  .mail__actions .btn {
    width: 100%;
  }

  .mail__actions .btn {
    justify-content: center;
  }

  .topic {
    grid-template-columns: minmax(0, 1fr) 104px;
    padding: 20px 0 20px 20px;
  }

  .topic__text {
    font-size: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .topics[data-reveal] .topic {
    opacity: 1;
    translate: none;
  }
}
