.contact-page {
  display: grid;
  grid-template: "intro doodle" auto "form doodle" auto "profiles profiles" auto / minmax(0, 620px) minmax(0, 1fr);
  gap: 20px clamp(30px, 6vw, 90px);
  padding-block: clamp(32px, 4.5vw, 64px) 52px;
}
.contact-intro { grid-area: intro; }
.contact-intro h1 { font-size: clamp(3.15rem, 5.8vw, 5.2rem); }
.contact-intro > p { margin-block-start: 8px; color: var(--secondary); font-size: clamp(1.125rem, 1.9vw, 1.55rem); }
.contact-doodle {
  grid-area: doodle;
  align-self: center;
  margin-inline: auto;
  width: min(100%, 300px);
}
.contact-doodle img { height: auto; }
[data-theme="dark"] .contact-doodle img { filter: brightness(0) invert(91%) sepia(14%) saturate(200%); }

.contact-form {
  grid-area: form;
  position: relative;
  padding: clamp(18px, 3vw, 36px);
}
.contact-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.contact-form svg path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.contact-frame path { color: var(--pen); stroke-width: 1.5; }
@media (prefers-reduced-motion: no-preference) {
  .contact-frame path { animation: contact-frame-draw 720ms ease-out; }
  @keyframes contact-frame-draw {
    from { stroke-dasharray: 1; stroke-dashoffset: 1; }
    to { stroke-dasharray: 1; stroke-dashoffset: 0; }
  }
}
.contact-fields, .contact-field {
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.contact-fields { display: grid; gap: 14px; }
.contact-field > :is(label, legend) {
  display: block;
  padding: 0;
  font: .875rem/1.4 var(--mono);
}
.contact-entry { position: relative; }
.contact-entry :is(input, textarea) {
  display: block;
  width: 100%;
  min-height: 40px;
  padding: 6px 2px 8px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: 1.125rem/1.25 var(--serif);
}
.contact-entry textarea { resize: vertical; }
.contact-entry svg {
  display: block;
  position: absolute;
  inset: auto 0 0;
  width: 100%;
  height: 6px;
  pointer-events: none;
}
.contact-entry path { color: var(--secondary); stroke-width: 1; }
.contact-entry:focus-within path { color: var(--pen); stroke-width: 3; }
.contact-entry:has([aria-invalid]) path { color: var(--oxide); }
@media (forced-colors: none) {
  .contact-entry :focus-visible { outline: none; }
}

.contact-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-block-start: 5px; }
.contact-chips label { position: relative; border-radius: 100vmax; padding-inline: 9px; }
.contact-chips input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: inherit;
}
.contact-chips label:has(:checked) { background: var(--ink); color: var(--paper); }
.contact-chips label:has(:focus-visible) { outline: 2px solid var(--oxide); outline-offset: 2px; }
.contact-chips:has([aria-invalid]) label { border-color: var(--oxide); }

.contact-help, .field-error { font: 1rem/1.2 var(--serif); margin-block-start: 5px; }
.contact-help { color: var(--secondary); }
.field-error, .contact-status[data-state="error"] { color: var(--oxide); }
.field-error:empty { margin: 0; }
.contact-actions { display: flex; align-items: center; gap: 10px; margin-block-start: 15px; }
.contact-actions button { min-width: 76px; }
.contact-actions button:disabled { opacity: .62; cursor: default; }
.contact-note { font: 1.2rem/1.35 var(--doodle-font); color: var(--pen); }
.contact-arrow { display: flex; align-items: center; gap: 6px; }
.contact-arrow svg { width: 34px; flex: none; stroke-width: 1.35; }
.contact-closed { margin-block-start: 10px; }
.contact-closed .link--text, .contact-status .link--text {
  display: inline;
  padding: 0;
  border: 0;
  font: inherit;
  color: inherit;
}
.contact-status { font: 1.1rem/1.3 var(--serif); }
.contact-status[data-state]:not([data-state=""]) { margin-block-start: 10px; }
.contact-status .contact-retry-link[hidden] { display: none; }
.contact-spinner { width: 18px; height: 18px; stroke-width: 1.6; }
.contact-spinner[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .contact-spinner { animation: contact-spin 850ms linear infinite; }
  @keyframes contact-spin { to { transform: rotate(1turn); } }
}

.contact-footer { grid-area: profiles; }
.contact-footer .profiles { margin: 0; }
@media screen and (width > 760px) and (prefers-reduced-motion: no-preference) {
  /* Keep a little scroll room below the form for the rider's return to the thread. */
  .contact-page { padding-block-end: max(52px, calc(100svh - 795px)); }
}
@media (max-width: 759.98px) {
  .contact-page {
    grid-template: "intro doodle" auto "form form" auto "profiles profiles" auto / minmax(0, 1fr) minmax(75px, 24%);
    gap: 14px 10px;
  }
}
@media (max-width: 475px) {
  .contact-chips label { padding-inline: 6px; font-size: .7rem; }
  .contact-note { font-size: 1.0625rem; }
}

