/* /contact.
 *
 * One column, one screen. This is a navigational page: the reader came to
 * type something, so the form starts as near the top as the heading allows
 * and nothing competes with it.
 *
 * Every state that matters is carried by more than colour — an error has its
 * own line of text under the field it belongs to, the confirmation has an
 * icon and a heading, and a required field is marked in its label.
 */

.ct-main { padding-bottom: 0; }

.ct-wrap { padding-block: clamp(36px, 4.5vw, 68px) clamp(56px, 7vw, 96px); }

/* ---- heading ------------------------------------------------------------- */

.ct-head { margin-bottom: 28px; }

.ct-h1 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 680;
  letter-spacing: -.025em;
  line-height: 1.12;
  margin: 8px 0 0;
}

.ct-lead {
  margin: 12px 0 0;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-secondary);
}

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

.ct-form { display: flex; flex-direction: column; gap: 18px; }

/* An author `display` beats the `hidden` attribute, so a rule that sets one
   has to say what hidden means as well — otherwise the form stays on screen
   after it is sent and the confirmation is visible before there is anything
   to confirm. Both of those happened here before this line existed. */
.ct-form[hidden],
.ct-success[hidden],
.ct-err[hidden] { display: none; }

.ct-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }

.ct-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.ct-field input,
.ct-field textarea {
  width: 100%;
  padding: 11px 13px;
  font: inherit;
  font-size: 14.5px;
  color: var(--text);
  background: var(--surface-raised);
  border: .5px solid var(--border-strong);
  border-radius: var(--radius-md);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}

.ct-field textarea { resize: vertical; min-height: 130px; line-height: 1.6; }

.ct-field input:focus-visible,
.ct-field textarea:focus-visible,
.ct-submit:focus-visible,
.ct-privacy a:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.ct-field input:focus,
.ct-field textarea:focus {
  border-color: var(--cyan);
}

/* A bad field is outlined AND carries its reason underneath. */
.ct-field input.is-bad,
.ct-field textarea.is-bad {
  border-color: var(--red);
}

.ct-err {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--red);
}

.ct-form-error {
  padding: 10px 13px;
  border: .5px solid color-mix(in srgb, var(--red) 45%, var(--border-strong));
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--red) 7%, transparent);
}

.ct-submit { align-self: flex-start; }
.ct-submit[disabled] { opacity: .6; cursor: progress; }

.ct-privacy {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-muted);
}

.ct-privacy a { color: var(--text-secondary); }

/* ---- the honeypot -------------------------------------------------------- */

/* Out of the page for everyone: off-screen rather than display:none, because
   some bots skip what is not rendered at all. It is aria-hidden and its input
   is tabindex -1, so nobody using a keyboard or a screen reader meets it. */
.ct-hp {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---- captcha ------------------------------------------------------------- */

.ct-captcha { display: flex; flex-direction: column; gap: 7px; }

/* Development only: the challenge is off and the page says so, so a
   screenshot cannot pass for a working integration. */
.ct-devnote {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0;
  padding: 11px 14px;
  font-size: 13px;
  line-height: 1.55;
  border-radius: var(--radius-md);
  border: .5px solid color-mix(in srgb, var(--amber) 50%, var(--border-strong));
  background: var(--surface-raised);
  color: var(--text-secondary);
}

.ct-devnote svg { flex: none; margin-top: 2px; color: var(--amber); }

/* ---- sent ---------------------------------------------------------------- */

.ct-success {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 26px;
  border: .5px solid color-mix(in srgb, var(--green) 45%, var(--border-strong));
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--green) 6%, var(--surface-raised));
}

.ct-success svg { color: var(--green); }
.ct-success h2 { margin: 0; font-size: 19px; font-weight: 650; }
.ct-success p { margin: 0; font-size: 14px; line-height: 1.65; color: var(--text-secondary); }
.ct-success:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }

/* ======================================================================== */
/* The two-column page                                                       */
/* ======================================================================== */
/*
 * The page is still one screen and still puts the box a reader came to type
 * in first. What follows styles the half of the viewport that used to be
 * empty: what happens to a message, and the four questions that already have
 * an answer.
 *
 * Logical properties throughout, and the honeypot above stays off-screen
 * rather than display:none — a bot that skips what is not rendered should
 * still find it.
 */

/* ---- the two columns ---------------------------------------------------- */

.cx-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
}

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

/* A name and an address are both short. Two rows for them pushed the message
   box below the fold on a laptop, which is the one field that wants room. */
.cx-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* ---- topic, as six visible choices -------------------------------------- */

/* A six-option <select> hides five of them behind a click and tells a reader
   nothing about what they are choosing between. The same six as radios are
   readable at a glance and submit exactly the same value.

   The input is moved out of sight with clip-path rather than display:none, so
   it still takes focus and arrow keys still move between the options. */
.cx-topics { border: 0; margin: 0; padding: 0; min-inline-size: 0; }

.cx-topics legend {
  padding: 0;
  margin-block-end: 9px;
  font-size: 13px;
  font-weight: 600;
}

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

.cx-chips input {
  position: absolute;
  clip-path: inset(50%);
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
}

.cx-chips label {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: .5px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  transition: border-color .15s var(--ease), color .15s var(--ease), background .15s var(--ease);
}

.cx-chips label:hover { border-color: var(--text-muted); color: var(--text); }

.cx-chips input:checked + label {
  border-color: var(--cyan);
  background: var(--cyan-dim);
  color: var(--cyan);
}

/* The ring belongs on the thing a keyboard is pointing at, which is the
   label, because the input itself is not on screen. */
.cx-chips input:focus-visible + label { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* ---- the message box ---------------------------------------------------- */

.cx-count {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-block-start: 6px;
  font-size: 11.5px;
  color: var(--text-muted);
}

/* ---- the aside ---------------------------------------------------------- */

.cx-aside { display: grid; gap: 14px; }

.cx-card {
  border: .5px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
}

.cx-card-head {
  padding: 13px 16px;
  border-block-end: .5px solid var(--border);
  background: var(--surface-raised);
  font-size: 12.5px;
  font-weight: 640;
}

.cx-card-body { padding: 4px 16px 14px; }

/* What happens to a message. Three facts, not three promises: no reply time
   is named anywhere, because nothing in the product sends one. */
.cx-fact {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 11px;
  padding-block: 12px;
  border-block-start: .5px solid var(--border);
}
.cx-fact:first-child { border-block-start: 0; }

.cx-fact-n {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  padding-block-start: 2px;
  font-variant-numeric: tabular-nums;
}

/* Direct children only: the wrapper span must not take the note's colour and
   size and hand them down to the bold line inside it. */
.cx-fact > span { min-width: 0; }
.cx-fact > span > b { display: block; font-size: 12.5px; font-weight: 620; margin-block-end: 3px; color: var(--text); }
.cx-fact > span > span { display: block; font-size: 11.5px; line-height: 1.55; color: var(--text-muted); }

/* The questions that already have an answer. A link is a faster reply than
   a reply. */
.cx-quick {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-block: 11px;
  border-block-start: .5px solid var(--border);
  font-size: 12.5px;
  color: var(--text-secondary);
  text-decoration: none;
}
.cx-quick:first-child { border-block-start: 0; }
.cx-quick:hover { color: var(--text); }
.cx-quick:hover .cx-quick-go { color: var(--cyan); }

.cx-quick-where {
  margin-inline-start: auto;
  font-size: 10.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

.cx-quick-go { flex: none; color: var(--text-muted); display: grid; place-items: center; }
/* An arrow that means "onward" follows the reading direction. */
[dir="rtl"] .cx-quick-go svg { transform: scaleX(-1); }

/* ---- the address -------------------------------------------------------- */

.cx-mail {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  border: .5px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  text-decoration: none;
  color: var(--text);
  transition: border-color .15s var(--ease);
}
.cx-mail:hover { border-color: var(--cyan); }

.cx-mail-ico {
  flex: none;
  display: grid;
  place-items: center;
  inline-size: 34px;
  block-size: 34px;
  border-radius: 9px;
  border: .5px solid var(--border-strong);
  background: var(--cyan-dim);
  color: var(--cyan);
}

.cx-mail-what { display: block; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.cx-mail-addr { display: block; font-size: 14px; font-weight: 600; }

/* ---- the closed state --------------------------------------------------- */

/* Production with no CAPTCHA secret: there is no form, so the address is not
   a footnote any more — it is the page. */
.cx-closed { max-width: 62ch; }

.cx-closed .cx-mail { padding: 20px; }
.cx-closed .cx-mail-addr { font-size: 17px; }

.cx-closed-why {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-block-start: 14px;
  padding: 14px 16px;
  border: .5px solid color-mix(in srgb, var(--amber) 30%, var(--border));
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--amber) 5%, transparent);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-secondary);
}
.cx-closed-why svg { flex: none; color: var(--amber); margin-block-start: 2px; }

/* Someone who cannot use the form needs the shortcuts more, not less. */
.cx-closed-quick { margin-block-start: 14px; }

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

@media (max-width: 900px) {
  /* The form is what a reader came for, so it stays first and the aside
     follows it rather than pushing it down the page. */
  .cx-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .cx-row { grid-template-columns: 1fr; }
}
