/* Contacts page — six contact cards inside the big centred card.
   Sizes are design pixels × var(--u), so the whole card scales with the screen. */

.contacts {
  justify-content: flex-start;
  align-items: stretch;
  gap: calc(108 * var(--u));
}

.contacts__back {
  font-size: calc(44 * var(--u));
  line-height: normal;
  color: var(--color-text);
  transition: color 0.3s ease;
}

.contacts__back:hover {
  color: rgba(255, 255, 255, 0.95);
}

.contacts__grid {
  display: grid;
  flex: 1;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: calc(12 * var(--u));
  min-height: 0;
}

/* ---------- Contact card ---------- */

.contact {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  padding: calc(20 * var(--u));
  overflow: hidden;
  background: var(--color-page);
  border-radius: calc(5 * var(--u));
  line-height: normal;
}

.contact__detail {
  font-size: calc(16 * var(--u));
  font-weight: 300;
  color: var(--color-text);
}

.contact__name {
  font-size: calc(28 * var(--u));
  text-align: right;
  color: var(--color-text-strong);
}

/* Hover: light card, dark text */
.contact,
.contact__detail,
.contact__name {
  transition:
    background-color 0.35s var(--ease-out),
    color 0.35s var(--ease-out);
}

/* Keep the hover transition alongside the appear-on-load one from page.css */
.contact[data-reveal].is-visible {
  transition:
    opacity 0.9s var(--ease-out) var(--delay, 0s),
    transform 1.1s var(--ease-out) var(--delay, 0s),
    background-color 0.35s var(--ease-out),
    color 0.35s var(--ease-out);
}

.contact:hover,
.contact:focus-visible {
  background: #b7b7b7;
}

.contact:hover :is(.contact__detail, .contact__name),
.contact:focus-visible :is(.contact__detail, .contact__name) {
  color: var(--color-page);
}
