.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
  margin: 2rem 0 4rem;
}

.contact-intro,
.contact-form-shell {
  min-width: 0;
}

.contact-intro h2,
.contact-form-heading h2 {
  margin-top: 0.35rem;
}

.contact-paths {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
}

.contact-paths article,
.direct-email,
.contact-form-shell {
  border: 1px solid var(--border, #30363d);
  border-radius: 1rem;
  background: rgba(18, 24, 32, 0.78);
}

.contact-paths article {
  padding: 1rem 1.1rem;
}

.contact-paths h3,
.contact-paths p,
.direct-email p {
  margin: 0;
}

.contact-paths p,
.direct-email p {
  margin-top: 0.35rem;
  color: var(--muted, #8b949e);
}

.direct-email {
  margin-top: 1.25rem;
  padding: 1.1rem;
}

.direct-email > span {
  display: block;
  color: var(--muted, #8b949e);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.direct-email a {
  display: inline-block;
  margin-top: 0.35rem;
  font-family: "Source Code Pro", monospace;
  font-weight: 600;
}

.contact-form-shell {
  padding: clamp(1.25rem, 3vw, 2rem);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.18);
}

.contact-form-heading {
  margin-bottom: 1.5rem;
}

.contact-form-heading p:last-child {
  color: var(--muted, #8b949e);
}

.contact-form {
  display: grid;
  gap: 1.15rem;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.form-field {
  display: grid;
  gap: 0.45rem;
}

.form-field label {
  font-weight: 600;
}

.form-field label span,
.field-help {
  color: var(--muted, #8b949e);
  font-size: 0.82rem;
  font-weight: 400;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border, #30363d);
  border-radius: 0.7rem;
  background: rgba(15, 20, 25, 0.94);
  color: var(--text, #e6edf3);
  font: inherit;
  padding: 0.82rem 0.9rem;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.form-field textarea {
  resize: vertical;
  min-height: 12rem;
  line-height: 1.55;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: #58a6ff;
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.16);
  background: #0f1419;
}

.form-field input[aria-invalid="true"],
.form-field select[aria-invalid="true"],
.form-field textarea[aria-invalid="true"] {
  border-color: #f85149;
}

.field-help {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.form-trap {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

.contact-security-note {
  padding: 1rem;
  border-left: 3px solid #d29922;
  border-radius: 0.4rem;
  background: rgba(210, 153, 34, 0.08);
}

.contact-security-note p {
  margin: 0.35rem 0 0;
  color: var(--muted, #8b949e);
  font-size: 0.9rem;
}

.contact-submit {
  width: 100%;
  justify-content: center;
  border: 0;
  cursor: pointer;
}

.contact-submit .submit-progress {
  display: none;
}

.contact-submit[aria-busy="true"] {
  cursor: wait;
  opacity: 0.78;
}

.contact-submit[aria-busy="true"] .submit-label {
  display: none;
}

.contact-submit[aria-busy="true"] .submit-progress {
  display: inline;
}

.contact-status {
  min-height: 1.5rem;
  border-radius: 0.6rem;
  font-size: 0.92rem;
  line-height: 1.45;
}

.contact-status:not(:empty) {
  padding: 0.85rem 1rem;
  border: 1px solid var(--border, #30363d);
  background: rgba(15, 20, 25, 0.72);
}

.contact-status[data-state="success"] {
  border-color: rgba(63, 185, 80, 0.55);
  background: rgba(63, 185, 80, 0.09);
}

.contact-status[data-state="error"] {
  border-color: rgba(248, 81, 73, 0.55);
  background: rgba(248, 81, 73, 0.09);
}

@media (max-width: 860px) {
  .contact-layout {
    grid-template-columns: 1fr;
  }
}

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

  .field-help {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.3rem;
  }
}
