/* Contact page. Palette comes entirely from web/css/tokens.css — no local
   :root palette (see the Design System note in docs/codebase.md). */

.contact-wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: var(--space-8) var(--space-5) var(--space-8);
}

.contact-wrap h1 {
  font-family: var(--font-ui);
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-3);
  color: var(--text);
}

.contact-lede {
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 var(--space-7);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.contact-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  position: relative;
}

.contact-label {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.contact-field input[type="email"],
.contact-field select,
.contact-field textarea {
  font: inherit;
  font-family: var(--font-ui);
  color: var(--text);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  width: 100%;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.contact-field textarea {
  resize: vertical;
  min-height: 160px;
  line-height: 1.55;
}

/* The topic <select>. Without an appearance reset the browser draws its own
   control inside our border — on Windows that is a bevelled arrow button, so
   the field reads as a different widget from the email/message inputs beside
   it. appearance:none drops the native chrome and we draw the chevron
   ourselves, which makes the closed control identical on every platform.
   (The open popup is OS-drawn and cannot be styled; it follows the
   `color-scheme` already set in theme.css, so it themes correctly.)

   The chevron is a data-URI SVG, which cannot read a CSS variable — hence one
   rule per theme rather than a token. Dark is the default here (theme.css
   sets color-scheme:dark on html, .light opts out). */
.contact-field select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  padding-right: 36px;                  /* clear the chevron */
  background-repeat: no-repeat;
  background-position: right 13px center;
  background-size: 11px 7px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7'%3E%3Cpath d='M1 1l4.5 4.5L10 1' fill='none' stroke='%239aa39a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
html.light .contact-field select,
body.light .contact-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7'%3E%3Cpath d='M1 1l4.5 4.5L10 1' fill='none' stroke='%235d665d' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
/* Windows Chrome renders <option> with system colors unless told otherwise,
   which put near-black text on a near-black popup in the dark theme. */
.contact-field select option {
  background: var(--bg-panel);
  color: var(--text);
}

.contact-field input:focus,
.contact-field select:focus,
.contact-field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

.contact-field input[aria-invalid="true"],
.contact-field textarea[aria-invalid="true"] {
  border-color: var(--down);
}

.contact-count {
  position: absolute;
  right: 2px;
  top: 0;
  font-size: 0.75rem;
  color: var(--muted-dim);
  font-family: var(--font-mono);
}

/* Honeypot. Off-screen rather than display:none — some bots skip fields that
   are explicitly hidden, but fill anything that is merely positioned away. */
.contact-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.contact-submit {
  font-family: var(--font-ui);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--bg);
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  padding: 11px 22px;
  cursor: pointer;
  transition: filter 120ms ease, opacity 120ms ease;
}

.contact-submit:hover:not(:disabled) { filter: brightness(1.08); }
.contact-submit:disabled { opacity: 0.55; cursor: default; }

.contact-status {
  font-size: 0.875rem;
  color: var(--muted);
}
.contact-status.is-ok    { color: var(--up); }
.contact-status.is-error { color: var(--down); }

.contact-alt {
  margin-top: var(--space-8);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.contact-alt a { color: var(--accent); text-decoration: none; }
.contact-alt a:hover { text-decoration: underline; }

@media (max-width: 560px) {
  .contact-wrap { padding-top: var(--space-6); }
  .contact-wrap h1 { font-size: 1.625rem; }
}
