/* The contact page: a card per subject, and one form in a dialog. */

.contact-block {
  padding: 64px 0 96px;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.contact-card {
  display: grid;
  gap: 8px;
  align-content: start;
  text-align: left;
  padding: 24px;
  border-radius: 14px;
  border: 1px solid var(--panel-line, #3a3d52);
  background: var(--panel, #171a24);
  color: var(--ink);
  cursor: pointer;
  transition:
    border-color 0.16s,
    transform 0.16s;
}

.contact-card:hover {
  border-color: #b69bff;
  transform: translateY(-2px);
}

.contact-card b {
  font-weight: 500;
  font-size: 1.0625rem;
  color: #f0f1fa;
}

.contact-card small {
  color: var(--ink2);
  font-size: 0.875rem;
  line-height: 1.55;
}

.contact-icon {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 6px;
  border-radius: 10px;
  background: #b69bff1a;
  color: #b69bff;
}

.contact-note {
  margin-top: 36px;
  color: var(--ink2);
  font-size: 0.9375rem;
}

.contact-note a {
  color: #b69bff;
}

/* --- The dialog ----------------------------------------------------------- */

.contact-dialog {
  /* The site's reset zeroes every margin, which pins a modal to the corner. */
  margin: auto;
  inset: 0;
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 1px solid #3a3d52;
  border-radius: 16px;
  background: #11141c;
  color: #e7edfa;
  box-shadow: 0 30px 80px #000a;
}

.contact-dialog::backdrop {
  background: #05070bcc;
  backdrop-filter: blur(4px);
}

.contact-form,
.contact-done {
  display: grid;
  gap: 16px;
  padding: 26px;
}

.contact-form[hidden],
.contact-done[hidden] {
  display: none;
}

.contact-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.contact-dialog h2 {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: #f5f6fa;
}

.contact-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #a2b1c9;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.contact-close:hover {
  background: #ffffff10;
  color: #fff;
}

.contact-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.contact-field {
  display: grid;
  gap: 6px;
  font-size: 0.875rem;
  color: #c5cfe0;
}

.contact-field i {
  font-style: normal;
  color: #7d8aa3;
}

.contact-field input,
.contact-field select,
.contact-field textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #343b4d;
  border-radius: 8px;
  background: #0a0d13;
  color: #f0f3fa;
  font: inherit;
  font-size: 0.9375rem;
}

/* The browser paints autofilled fields light blue; keep them in the dialog's dark. */
.contact-field input:-webkit-autofill,
.contact-field input:-webkit-autofill:hover,
.contact-field input:-webkit-autofill:focus {
  -webkit-text-fill-color: #f0f3fa;
  box-shadow: 0 0 0 1000px #0a0d13 inset;
  caret-color: #f0f3fa;
}

.contact-field textarea {
  resize: vertical;
  min-height: 130px;
}

.contact-field :focus {
  outline: 2px solid #b69bff;
  outline-offset: 1px;
  border-color: transparent;
}

.contact-field [aria-invalid='true'] {
  border-color: #f87171;
}

.contact-error {
  font-style: normal;
  font-size: 0.8125rem;
  color: #fca5a5;
}

.contact-error:empty {
  display: none;
}

/* The honeypot: off the page for people, still in the form for scripts. */
.contact-trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-status {
  margin: 0;
  font-size: 0.875rem;
  color: #a2b1c9;
}

.contact-status:empty {
  display: none;
}

.contact-status.is-error {
  color: #fca5a5;
}

.contact-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.contact-actions .btn,
.contact-done .btn {
  padding: 12px 20px;
}

.contact-done p {
  margin: 0;
  color: #c5cfe0;
}

.contact-done .btn {
  justify-self: start;
}

@media (max-width: 1000px) {
  .contact-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

  .contact-row {
    grid-template-columns: 1fr;
  }

  .contact-form,
  .contact-done {
    padding: 20px;
  }

  .contact-actions .btn {
    flex: 1;
  }
}
