body.contact-modal-open {
  overflow: hidden;
}

.contact-modal {
  width: min(calc(100% - 2rem), 46rem);
  max-width: none;
  max-height: min(92vh, 47rem);
  margin: auto;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  color: var(--ink);
  border: 1px solid oklch(34% 0.07 243 / 0.2);
  border-radius: 1.6rem;
  background: var(--paper);
  box-shadow:
    0 2rem 5rem oklch(18% 0.025 245 / 0.32),
    0 0 0 0.35rem oklch(97.4% 0.018 86 / 0.2);
}

.contact-modal::backdrop {
  background: oklch(18% 0.025 245 / 0.64);
  backdrop-filter: blur(8px) saturate(0.8);
}

.contact-modal[open] {
  animation: contact-modal-in 360ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes contact-modal-in {
  from {
    opacity: 0;
    transform: translateY(0.8rem) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.contact-modal-shell {
  padding: clamp(1.25rem, 3vw, 2.15rem);
}

.contact-modal-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.35rem;
  border-bottom: 1px solid oklch(34% 0.07 243 / 0.14);
}

.contact-modal-kicker {
  margin: 0 0 0.38rem;
  color: var(--blue);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  line-height: 1.3;
  text-transform: uppercase;
}

.contact-modal h2 {
  margin: 0;
  color: var(--ink);
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(2.25rem, 6vw, 3.7rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 0.98;
}

.contact-modal-header > div > p:last-child {
  max-width: 38rem;
  margin: 0.75rem 0 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.5;
}

.contact-modal-close {
  display: inline-grid;
  width: 2.65rem;
  height: 2.65rem;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 1px solid oklch(34% 0.07 243 / 0.2);
  border-radius: 50%;
  color: var(--ink);
  background: oklch(97.4% 0.018 86 / 0.72);
  cursor: pointer;
  transition: color 180ms ease-out, background-color 180ms ease-out, transform 180ms ease-out;
}

.contact-modal-close:hover {
  color: var(--blue-dark);
  background: oklch(95% 0.025 225 / 0.7);
  transform: translateY(-2px);
}

.contact-modal-close:active {
  transform: scale(0.96);
}

.contact-modal-close:focus-visible,
.contact-field input:focus-visible,
.contact-field select:focus-visible,
.contact-field textarea:focus-visible,
.contact-consent input:focus-visible,
.contact-submit:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.contact-modal-close svg {
  width: 1.05rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

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

.contact-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.contact-field {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}

.contact-field--wide {
  grid-column: 1 / -1;
}

.contact-field > span,
.contact-consents legend {
  color: var(--ink);
  font-size: 0.77rem;
  font-weight: 800;
}

.contact-field b,
.contact-consents legend b {
  color: var(--blue);
}

.contact-field input,
.contact-field select,
.contact-field textarea {
  width: 100%;
  border: 1px solid oklch(34% 0.07 243 / 0.2);
  border-radius: 0.8rem;
  color: var(--ink);
  background: oklch(100% 0 0 / 0.48);
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.45;
  transition: border-color 180ms ease-out, box-shadow 180ms ease-out, background-color 180ms ease-out;
}

.contact-field input,
.contact-field select {
  min-height: 3.1rem;
  padding: 0.75rem 0.9rem;
}

.contact-field textarea {
  min-height: 7.5rem;
  padding: 0.8rem 0.9rem;
  resize: vertical;
}

.contact-field input::placeholder,
.contact-field textarea::placeholder {
  color: var(--ink-soft);
  opacity: 0.7;
}

.contact-field input:focus,
.contact-field select:focus,
.contact-field textarea:focus {
  border-color: var(--blue);
  background: var(--paper);
  box-shadow: 0 0 0 3px oklch(57% 0.12 230 / 0.12);
}

.contact-field input[aria-invalid="true"],
.contact-field select[aria-invalid="true"],
.contact-field textarea[aria-invalid="true"] {
  border-color: oklch(54% 0.16 25);
}

.contact-consents {
  display: grid;
  gap: 0.72rem;
  margin: 0;
  padding: 0;
  border: 0;
}

.contact-consents legend {
  margin-bottom: 0.15rem;
  padding: 0;
}

.contact-consent {
  display: grid;
  grid-template-columns: 1.2rem minmax(0, 1fr);
  align-items: start;
  gap: 0.65rem;
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.45;
  cursor: pointer;
}

.contact-consent input {
  width: 1.1rem;
  height: 1.1rem;
  margin: 0.12rem 0 0;
  accent-color: var(--blue-dark);
}

.contact-consent a {
  color: var(--blue-dark);
  font-weight: 700;
  text-underline-offset: 0.16em;
}

.contact-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.35rem;
}

.contact-form-note {
  max-width: 27rem;
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.72rem;
  line-height: 1.4;
}

.contact-submit {
  min-width: 10.5rem;
  min-height: 3.25rem;
  flex: 0 0 auto;
}

.contact-submit:disabled {
  cursor: wait;
  opacity: 0.65;
}

.contact-form-status {
  margin: 0;
  padding: 0.75rem 0.85rem;
  border: 1px solid oklch(57% 0.12 230 / 0.25);
  border-radius: 0.75rem;
  color: var(--ink);
  background: oklch(88% 0.045 223 / 0.42);
  font-size: 0.78rem;
  line-height: 1.45;
}

@media (max-width: 38rem) {
  .contact-modal {
    width: min(calc(100% - 1.25rem), 46rem);
    max-height: calc(100vh - 1.25rem);
    border-radius: 1.25rem;
  }

  .contact-modal-shell {
    padding: 1.1rem;
  }

  .contact-modal h2 {
    font-size: clamp(2.05rem, 11vw, 3rem);
  }

  .contact-form-grid {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }

  .contact-field--wide {
    grid-column: auto;
  }

  .contact-field input,
  .contact-field select,
  .contact-field textarea {
    font-size: 1rem;
  }

  .contact-form-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .contact-submit {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .contact-modal[open] {
    animation: none;
  }

  .contact-modal-close,
  .contact-field input,
  .contact-field select,
  .contact-field textarea,
  .contact-submit {
    transition: none;
  }
}
