/* Sell or Scale. /contact's own stylesheet, loaded after site.css.
   The form, which is the one place on the site where a reader does something, and what happens next beside it.
   The form is built on the button's measures so that it belongs: a field 48px tall with the button's corners and a
   hairline edge, 17px type inside, a 15px label over it and 6px apart, the 2px ring, and the main button to send.
   A message about a field is ink words beside a small ink dot, the home page's own mark for what is waiting. No red,
   and no colour: amber and green belong inside an app screen only.
   Nothing here needs a script: the form posts as it is. contact.js adds the checks, and sending without leaving. */

/* ---------- the two columns ----------
   In the page the form comes first, so a phone shows it first and the three steps under it. From 900 wide (where
   .split has two columns) the form takes the right column and the steps the left, where they stay in view. */

@media (min-width: 900px) {
  .contact > .form { grid-column: 2; grid-row: 1; }
  /* (3px up: the first step then stands on the baseline of the form's first label, 19px type beside 15px) */
  .contact > .next { grid-column: 1; grid-row: 1; position: sticky; top: 30px; margin-top: -0.1875rem; }
}
/* under the form (one column): the steps open on a hairline, with the same room over it as under it */
@media (max-width: 899px) {
  .next { padding-top: 36px; border-top: 1px solid var(--rule); }
}

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

.form { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 24px; scroll-margin-top: 30px; }
.form__label { display: block; padding: 0; font-size: 0.9375rem; line-height: 1.6; font-weight: 500; color: var(--text); }
.form__opt { font-weight: 400; color: var(--text-2); }

.field { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 6px; }
/* the phone and the email share a row where each has 15rem or more; under that the email goes under the phone */
.form__pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); gap: 24px; align-items: start; }

.field__input {
  display: block; width: 100%; min-height: 48px; margin: 0; padding: 11px 14px;
  border: 1px solid var(--rule-2); border-radius: var(--r);
  background: var(--paper); color: var(--text);
  font: inherit; line-height: 1.4118; letter-spacing: inherit;      /* 17px on a 24px line: 48px with its padding and edge */
  -webkit-appearance: none; appearance: none;
  transition: border-color 0.2s var(--ease);
}
/* the note: four lines to start, and where the browser can it grows with what is written (elsewhere it scrolls).
   No corner grip: a browser draws its own across the field's rounded corner. */
textarea.field__input { min-height: calc(4 * 1.4118em + 24px); resize: none; field-sizing: content; }
.field__input:hover { border-color: rgba(11, 13, 17, 0.55); }
/* the ring lies on the field's own edge: the hairline becomes 2px of ink */
.field__input:focus-visible { border-color: var(--text); border-radius: var(--r); outline-offset: -1px; }
.field__input[aria-invalid="true"] { border-color: var(--text); }
/* a field the browser filled in keeps the paper and the ink (a browser's own tint is blue or yellow) */
.field__input:-webkit-autofill { -webkit-text-fill-color: var(--text); box-shadow: inset 0 0 0 100px var(--paper); }
.field__input:autofill { -webkit-text-fill-color: var(--text); box-shadow: inset 0 0 0 100px var(--paper); }

/* the list: a field, with a drawn arrow where the browser's own would be */
.field__list { position: relative; }
.field__list select { padding-right: calc(1rem + 28px); cursor: pointer; text-overflow: ellipsis; }
.field__list svg { position: absolute; right: 15px; top: 50%; width: 1rem; height: 1rem; margin-top: -0.5rem; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }

/* ---------- the choice of two ----------
   Each choice is a field-sized box with a drawn radio mark. The real radio lies over its box with nothing of its own
   drawn: it takes the pointer and the keys, its box shows whether it is chosen (an ink edge and a filled mark), and
   the ring a keyboard gives it is its own, around the whole box, as a button's is.
   The two share a row where each has 13rem or more (room for its words on one line); under that the second goes
   under the first. In rem, so a reader's larger type gets there sooner. */

.pick { min-width: 0; margin: 0; padding: 0; border: 0; }
.pick .form__label { margin-bottom: 6px; }
.pick__row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(13rem, 100%), 1fr)); gap: 12px; }
.pick__opt { position: relative; display: flex; }
.pick__input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; border: 0; border-radius: var(--r); background: none; -webkit-appearance: none; appearance: none; cursor: pointer; }
.pick__input:focus-visible { border-radius: var(--r); }
.pick__box {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 11px 14px;
  border: 1px solid var(--rule-2); border-radius: var(--r);
  line-height: 1.4118;
  transition: border-color 0.2s var(--ease);
}
/* the mark: an 18px ring, and when chosen an 8px dot of ink inside it (it grows with the reader's type, as its words do) */
.pick__box::before { content: ""; flex: none; width: 1.125rem; height: 1.125rem; border: 1.5px solid var(--text-2); border-radius: 50%; box-shadow: inset 0 0 0 0.21875rem var(--paper); }
.pick__input:hover + .pick__box { border-color: rgba(11, 13, 17, 0.55); }
.pick__input:checked + .pick__box { border-color: var(--text); }
.pick__input:checked + .pick__box::before { border-color: var(--text); background: var(--text); }

/* ---------- sending, and the messages ---------- */

.form__end { margin-top: 6px; }
/* the main button, as everywhere; here its words may take a second line before they would leave it (a reader's very large type on a small phone) */
.form__send { height: auto; min-height: 48px; padding-block: 10px; line-height: 1.2; white-space: normal; text-align: center; }
/* while it sends, the button keeps its room and its place (contact.js holds its width) and goes quiet */
.form__send[aria-disabled="true"] { background: var(--text-2); cursor: default; transform: none; }

/* a message: ink words beside a small ink dot (the home page's mark beside "Waiting for you": home.css). Drawn as a
   border, so it is still there where the system draws its own colours. */
.field__error, .form__problem, .form__status p { position: relative; padding-left: 1rem; color: var(--text); text-wrap: pretty; overflow-wrap: anywhere; }
.field__error::before, .form__problem::before, .form__status p::before {
  content: ""; position: absolute; left: 0; top: calc((1.55em - 0.5rem) / 2); width: 0.5rem; height: 0.5rem; border-radius: 50%;
  border: 0.25rem solid currentColor;
}
.field__error { font-size: 0.9375rem; line-height: 1.6; }
.field__error::before { top: calc((1.6em - 0.5rem) / 2); }
.form__status p { margin-top: 18px; }
/* without scripts a send that fails comes back to /contact#problem: this line shows only as that address's target */
.form__problem { display: none; scroll-margin-top: 30px; }
.form__problem:target { display: block; }

/* the field people never see (the function drops what fills it) */
.form__trap { display: none; }

/* ---------- what happens next: three steps, a hairline under each, as the home page's rows ---------- */

.next__steps li { display: grid; grid-template-columns: 2.25rem minmax(0, 1fr); align-items: baseline; padding: 18px 0; border-bottom: 1px solid var(--rule); }
.next__steps li:first-child { padding-top: 0; }
.next__n, .next__steps p { font-size: 1.1875rem; line-height: 1.42; letter-spacing: -0.01em; color: var(--text-2); }
.next__steps p { text-wrap: pretty; }
.next__steps b { font-weight: 500; color: var(--text); }
.next__write { margin-top: 24px; color: var(--text-2); overflow-wrap: anywhere; }

/* ---------- smaller screens ---------- */

@media (max-width: 599px) {
  .form__send { width: 100%; }
  .next__n, .next__steps p { font-size: 1.0625rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .pick__box::before { transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease); }
}
/* where the system draws its own colours a filled mark would be lost: the chosen one is a thick ring */
@media (forced-colors: active) {
  .pick__input:checked + .pick__box::before { border-width: 0.375rem; }
}
