.contact-modal {
  width: min(560px, calc(100% - 32px));
  max-width: none;
  max-height: min(90vh, 800px);
  padding: 0;
  border: 1px solid transparent;
  border-radius: 16px;
  color: var(--color-text, #f4f5f6);
  background: linear-gradient(#050d17, #050d17) padding-box, var(--gradient-brand, linear-gradient(90deg, #6676ff, #008cff, #00d8d2, #39ff46)) border-box;
  box-shadow: 0 0 55px rgba(0, 140, 255, 0.15), 0 28px 90px rgba(0, 0, 0, 0.65);
  opacity: 0;
  transform: translateY(24px) scale(0.97);
  transition: opacity 260ms ease, transform 360ms cubic-bezier(0.2, 0.8, 0.2, 1), overlay 360ms allow-discrete, display 360ms allow-discrete;
}

.contact-modal[open].is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@starting-style {
  .contact-modal[open].is-visible {
    opacity: 0;
    transform: translateY(24px) scale(0.97);
  }
}

.contact-modal::backdrop {
  background: rgba(3, 7, 11, 0.84);
  backdrop-filter: blur(9px);
  transition: opacity 260ms ease, overlay 360ms allow-discrete, display 360ms allow-discrete;
  opacity: 0;
}

.contact-modal[open].is-visible::backdrop {
  opacity: 1;
}

.contact-modal__panel {
  position: relative;
  padding: clamp(26px, 5vw, 48px);
  background: radial-gradient(ellipse at 90% 0%, rgba(0, 140, 255, 0.12), transparent 48%);
  overflow-y: auto;
}

.contact-modal__close {
  position: absolute;
  top: 18px;
  right: 20px;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: inherit;
  background: transparent;
  font-size: 27px;
  line-height: 1;
  cursor: pointer;
}

.contact-modal__eyebrow {
  margin: 0 0 12px;
  color: #00d8d2;
  font-size: 11px;
  letter-spacing: 0.18em;
}

.contact-modal h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(30px, 6vw, 42px);
  font-weight: 400;
}

.contact-modal__intro {
  margin: 12px 0 26px;
  color: rgba(245, 247, 247, 0.72);
  line-height: 1.6;
}

.contact-form {
  display: grid;
  gap: 9px;
}

.contact-form__honeypot {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
}

.contact-form label {
  margin-top: 8px;
  font-size: 13px;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #f5f7f7;
  background: rgba(255, 255, 255, 0.045);
  font: inherit;
}

.contact-form textarea {
  min-height: 110px;
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus,
.contact-modal__close:focus-visible,
.contact-form__submit:focus-visible {
  outline: 2px solid #00d8d2;
  outline-offset: 2px;
}

.contact-form .form-note {
  margin: 12px 0 4px;
  color: rgba(245, 247, 247, 0.66);
  font-size: 12px;
  line-height: 1.6;
}

.form-note a {
  color: #00d8d2;
  text-underline-offset: 3px;
}

.contact-form__status {
  margin: 2px 0;
  color: #f3cc85;
  font-size: 13px;
  line-height: 1.5;
}

.contact-form__submit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 8px;
  padding: 15px 18px;
  border: 0;
  border-radius: 999px;
  border: 1px solid transparent;
  color: #f4f5f6;
  background: linear-gradient(#030b15, #030b15) padding-box, var(--gradient-brand) border-box;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: box-shadow 180ms ease, transform 180ms ease;
}

.contact-form__submit:hover {
  box-shadow: 0 0 24px rgba(0, 190, 220, 0.2);
  transform: translateY(-1px);
}

.contact-toast:not([hidden]) {
  position: fixed;
  z-index: 1001;
  right: 0;
  bottom: 190px;
  left: 0;
  width: max-content;
  max-width: min(560px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 20px 32px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: var(--color-text, #f4f5f6);
  background: linear-gradient(#030b15, #030b15) padding-box, var(--gradient-brand) border-box;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  font-size: 18px;
  line-height: 1.5;
  text-align: center;
  animation: contact-toast-in 300ms ease both;
}

/* Phones: the footer menu is hidden, so show the confirmation in the middle of the screen. */
@media (max-width: 640px) {
  .contact-toast:not([hidden]) {
    top: 0;
    bottom: 0;
    height: fit-content;
    margin: auto;
    padding: 18px 24px;
    font-size: 17px;
  }
}

@keyframes contact-toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .contact-modal,
  .contact-modal::backdrop,
  .contact-toast:not([hidden]) {
    transition: none;
    animation: none;
  }
}
