/*
 * contact.css — the contact section at the foot of the home page.
 *
 * Same language as the rest of the page: one centred column on a tall, quiet
 * stage. The form is styled as a plain mail composer — no boxes, just labels
 * over ruled fields. Submission goes to FormSubmit over fetch (see contact.js).
 */

.contact {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1.25rem, 3.5vh, 2.25rem);
  padding: clamp(4rem, 14vh, 9rem) var(--pad-hero);
  border-bottom: var(--rule);
  text-align: center;
  scroll-margin-top: var(--nav-h);
}

/* .hero-title is a flex row of chunks; centre it inside the column. */
.contact__title {
  justify-content: center;
  font-size: clamp(2.5rem, 9vw, 5.5rem);
}

.contact__lede {
  max-width: 34ch;
  font-size: var(--size-lede);
  font-weight: 400;
  line-height: 1.45;
  text-wrap: balance;
}

/* ----------------------------------------------------------------- form */

.connect-form {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 30rem;
  margin-top: clamp(0.5rem, 2vh, 1.5rem);
  text-align: left;
}

/* The send button floats top-right, over the padding reserved by __fields. */
.connect-form__toolbar {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.connect-form__fields {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-top: 3rem;
}

.connect-form__to {
  font-size: var(--size-body);
  font-weight: 400;
  line-height: 1.45;
}

.connect-form__to-address {
  font-weight: 500;
}

.connect-form__row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

.connect-form__label {
  font-family: var(--font-display);
  font-size: var(--size-label);
  font-weight: 700;
}

.connect-form__input,
.connect-form__textarea {
  width: 100%;
  max-width: 100%;
  padding: 0.45rem 0;
  font-size: var(--size-body);
  font-weight: 400;
  background: transparent;
  border: none;
  border-bottom: var(--rule);
  border-radius: 0;
  outline: none;
  transition: border-color 0.15s ease;
}

.connect-form__input::placeholder,
.connect-form__textarea::placeholder {
  color: var(--ink-faint);
  opacity: 1;
}

.connect-form__textarea {
  min-height: 7.5rem;
  padding-top: 0.5rem;
  line-height: 1.5;
  resize: vertical;
}

/* contact.js swaps the native submit for this button on load. Without JS the
   native input stays and still submits the form. */
.connect-form__actions {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
}

.connect-form__send {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: var(--ink);
  color: var(--paper);
  border: var(--rule);
  border-radius: 0;
  cursor: pointer;
  transition:
    opacity 0.2s ease,
    transform 0.15s ease;
}

.connect-form__send:hover,
.connect-form__send:focus-visible {
  opacity: 0.85;
  outline: none;
}

.connect-form__send:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* --------------------------------------------------------------- narrow */

/*
 * 16px is a hard floor for form fields on iOS: below it, Safari zooms the page
 * when a field takes focus and never zooms back out. This is the only place on
 * the site that overrides a type token, and it is why.
 */
@media (max-width: 768px) {
  .connect-form__input,
  .connect-form__textarea {
    font-size: 1rem;
  }
}

/* --------------------------------------------------------------- toast */

.connect-toast__text {
  font-weight: 700;
  font-size: var(--size-body);
}
