body.modal-open {
  overflow: hidden;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal[hidden] {
  display: none;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgb(22 22 22 / 0.78);
  border: none;
  padding: 0;
  cursor: pointer;
}

.modal__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 720px);
  max-height: min(90vh, 900px);
  overflow: auto;
  background: #fff;
  border: 1px solid var(--grey-rule);
  box-shadow: 0 24px 60px rgb(22 22 22 / 0.28);
}

.modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--grey-rule);
  background: #fff;
  color: var(--black);
  font-family: var(--head);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}

.modal__close:hover {
  background: var(--black);
  color: #fff;
  border-color: var(--black);
}

/* ── LIGHTBOX ── */
.lightbox__panel {
  width: min(96vw, 1200px);
  max-height: none;
  overflow: visible;
  background: transparent;
  border: none;
  box-shadow: none;
}

.lightbox__panel .modal__close {
  background: rgb(255 255 255 / 0.92);
}

.lightbox__image {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: min(85vh, 820px);
  margin: 0 auto;
  border: 1px solid var(--grey-rule);
  box-shadow: 0 24px 60px rgb(22 22 22 / 0.35);
}

.lightbox__caption {
  margin: 14px 0 0;
  font-family: var(--body);
  font-size: 14px;
  line-height: 1.5;
  color: #e8e4de;
  text-align: center;
}

.screenshot-frame img.js-lightbox {
  cursor: zoom-in;
  transition: opacity 0.15s;
}

.screenshot-frame img.js-lightbox:hover {
  opacity: 0.92;
}

/* ── CONTACT MODAL ── */
.contact-modal__panel {
  padding: 36px 32px 32px;
}

.contact-modal__eyebrow {
  font-family: var(--head);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 10px;
}

.contact-modal__title {
  font-family: var(--head);
  font-size: clamp(22px, 4vw, 28px);
  font-weight: bold;
  line-height: 1.2;
  color: var(--black);
  margin-bottom: 12px;
  padding-right: 2rem;
}

.contact-modal__intro {
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.62;
  color: var(--grey-static);
  margin-bottom: 22px;
}

.contact-modal__direct {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  margin-bottom: 28px;
  padding: 24px 28px;
  background: var(--orange-pale);
  border: 1px solid var(--grey-rule);
}

.contact-modal__direct-label {
  font-family: var(--head);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--grey-meta);
}

.contact-modal__direct-link {
  font-family: var(--head);
  font-size: 19px;
  font-weight: bold;
  color: var(--black);
  text-decoration: none;
  border-bottom: 2px solid var(--orange);
  padding-bottom: 3px;
  transition:
    color 0.15s,
    border-color 0.15s;
}

.contact-modal__direct-link:hover {
  color: var(--orange-deep);
  border-color: var(--orange-deep);
}

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

.contact-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.contact-form__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.contact-form__field label {
  font-family: var(--head);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--grey-meta);
}

.contact-form__field input,
.contact-form__field select,
.contact-form__field textarea {
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.4;
  color: var(--ink);
  border: 1px solid var(--grey-rule);
  background: #fff;
  padding: 11px 12px;
  transition: border-color 0.15s;
}

.contact-form__field input:focus,
.contact-form__field select:focus,
.contact-form__field textarea:focus {
  outline: none;
  border-color: var(--orange);
}

.contact-form__field input.is-invalid,
.contact-form__field select.is-invalid,
.contact-form__field textarea.is-invalid {
  border-color: #b33;
}

.contact-form__error {
  font-family: var(--body);
  font-size: 13px;
  line-height: 1.35;
  color: #b33;
}

.contact-form__form-error {
  font-family: var(--body);
  font-size: 14px;
  line-height: 1.45;
  color: #b33;
  margin: 0;
}

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

.contact-form__field textarea {
  min-height: 96px;
  resize: vertical;
}

.contact-form__submit {
  font-family: var(--head);
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--orange);
  color: #fff;
  border: none;
  padding: 10px 18px;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 4px;
}

.contact-form__submit:hover {
  background: var(--orange-deep);
}

.contact-modal__success {
  display: none;
  padding: 12px 0 4px;
}

.contact-modal__success.is-visible {
  display: block;
}

.contact-modal__success p {
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.62;
  color: var(--ink);
  margin-bottom: 16px;
}

.contact-modal__success.is-error p {
  color: #8a2f2f;
}

.contact-modal__success a {
  color: var(--orange-deep);
  font-weight: bold;
}

.contact-modal__success .contact-form__submit {
  margin-top: 0;
}

.contact-form.is-hidden {
  display: none;
}

.contact-demo-btn {
  display: block;
  width: 100%;
  margin-top: 16px;
  font-family: var(--head);
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  background: var(--orange);
  color: #fff;
  border: none;
  padding: 11px 18px;
  cursor: pointer;
  transition: background 0.15s;
}

.contact-demo-btn:hover {
  background: var(--orange-deep);
}

button.serve-cta,
button.nav-cta,
button.platform-cta {
  font: inherit;
  text-align: inherit;
}

button.serve-cta {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

@media (max-width: 720px) {
  .modal {
    align-items: flex-start;
    padding: 12px;
    padding-top: max(12px, env(safe-area-inset-top));
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }

  .modal__panel,
  .contact-modal__panel {
    width: 100%;
    max-height: calc(100dvh - 24px);
    padding: 28px 18px 24px;
  }

  .contact-modal__title {
    font-size: clamp(22px, 6vw, 28px);
    padding-right: 28px;
  }

  .contact-form__row {
    grid-template-columns: 1fr;
  }

  .contact-form__field input,
  .contact-form__field select,
  .contact-form__field textarea {
    font-size: 16px;
  }

  .contact-form__submit {
    width: 100%;
    padding: 11px 16px;
  }

  .lightbox__image {
    max-height: 70dvh;
  }

  .lightbox__panel {
    max-width: 100%;
  }
}
