/* FROM — Contact, section 2: send us a message. The form on the left, a photo on the right
   (RDNE Stock project, Pexels 10375901). There's no server yet, so "Open in my e-mail" hands the finished message to the visitor's own mail
   app. js/message.js runs it. */

.msg {
  padding: clamp(88px, 11vw, 160px) 0;
  background: var(--paper-warm);
}

.msg__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr);
  align-items: start;
  gap: 56px clamp(48px, 7vw, 112px);
}

.msg__title {
  max-width: 13ch;
  margin: 0;
  font-size: clamp(36px, 4.6vw, 72px);
  line-height: 1.02;
  font-weight: 760;
  letter-spacing: -0.05em;
  text-wrap: balance;
}

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

.msg__lede {
  max-width: 44ch;
  margin-top: 24px;
  font-size: clamp(17px, 1.3vw, 20px);
  line-height: 1.55;
  color: var(--ink-2);
}

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

.msg__form {
  display: grid;
  gap: 24px;
  margin-top: clamp(32px, 4vw, 48px);
}

.msg__group {
  margin: 0;
  padding: 0;
  border: 0;
}

.msg__label {
  display: block;
  margin-bottom: 10px;
  padding: 0;
  font-size: 15px;
  font-weight: 650;
}

.msg__label small {
  font-weight: 500;
  color: var(--ink-3);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  position: relative;
  cursor: pointer;
}

.chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chip span {
  display: inline-flex;
  align-items: center;
  height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--paper);
  box-shadow: inset 0 0 0 1.5px var(--line);
  font-size: 15px;
  font-weight: 650;
  transition: background-color 0.2s, box-shadow 0.2s, color 0.2s;
}

.chip:hover span {
  box-shadow: inset 0 0 0 1.5px var(--ink-3);
}

.chip input:checked + span {
  background: var(--ink);
  box-shadow: none;
  color: #fff;
}

.chip input:focus-visible + span {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
}

.msg__input {
  display: block;
  width: 100%;
  height: 56px;
  padding: 0 18px;
  border: 0;
  border-radius: 16px;
  background: var(--paper);
  box-shadow: inset 0 0 0 1.5px var(--line);
  font: inherit;
  font-size: 17px;
  color: var(--ink);
  outline: none;
  transition: box-shadow 0.2s;
}

textarea.msg__input {
  height: auto;
  min-height: 168px;
  padding: 16px 18px;
  line-height: 1.5;
  resize: vertical;
}

.msg__input::placeholder {
  color: #98a2b3;
}

.msg__input:focus {
  box-shadow: inset 0 0 0 2px var(--ink);
}

.msg__field.is-invalid .msg__input {
  box-shadow: inset 0 0 0 2px #e0521d;
}

.msg__count {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  font-size: 14px;
  color: var(--ink-3);
}

.msg__error {
  display: none;
  font-weight: 600;
  color: #c4320a;
}

.msg__field.is-invalid .msg__error {
  display: block;
}

.msg__send {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
}

.msg__note {
  max-width: 34ch;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink-3);
}

/* ---------- The photo ---------- */

.msg__shot {
  position: sticky;
  top: 112px;
  margin: 0;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--orange-tint);
  clip-path: inset(0 round var(--radius-lg));
}

.msg__shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 52% 50%;
}

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

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

  .msg__shot {
    position: static;
    max-width: 640px;
    aspect-ratio: 5 / 4;
  }
}

@media (max-width: 560px) {
  .msg__send .btn {
    width: 100%;
    justify-content: center;
  }
}

