/* Contact page.
   Loaded after base.css, nav.css and home.css, so it reuses their shared parts:
   .page-hero (inner), .breadcrumb, .section-head, .icon-box, .contact-cta,
   the footer and .back-to-top.
   Only the styles that are new to this page live here: the sections, the
   contact details cards, and the popup form with its slide-to-submit button. */

[hidden] {
  display: none !important;
}

/* Contact uses the shared hero layout with its own general page image. */
.about-hero {
  background:
    linear-gradient(90deg, rgba(15, 23, 42, .35), rgba(15, 23, 42, 0) 60%),
    url("/assets/hero-image.jpg") center / cover no-repeat;
}


/* ---------- Sections ---------- */

.contact-section {
  padding: clamp(56px, 9vh, 96px) var(--gutter);
}

.contact-section--tint {
  background: #f8f9fb;
}

.contact-section__inner {
  max-width: 1200px;
  margin-inline: auto;
}

.contact-section .section-head__label {
  margin-bottom: 20px;
}

.contact-label {
  display: inline-block;
  margin-bottom: 20px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: transparent;
  background: linear-gradient(100deg, #2358f0, #0eb39a);
  -webkit-background-clip: text;
  background-clip: text;
}


/* ---------- Thank you message ---------- */

.thanks {
  max-width: 760px;
  margin-inline: auto;
  text-align: center;
}

.thanks__title {
  padding-bottom: 0.1em;
  font-size: clamp(26px, 2.64vw, 34px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.thanks__text {
  max-width: 36em;
  margin: 18px auto 0;
  font-size: clamp(16px, 1.35vw, 19px);
  line-height: 1.7;
  color: var(--text);
}


/* ---------- Contact details ---------- */

.reach {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  max-width: 880px;
  margin-inline: auto;
}

.reach__card {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  padding: 32px;
  border: 1px solid var(--line);
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.reach__card:hover {
  border-color: rgba(37, 99, 235, 0.4);
  box-shadow: 0 10px 28px rgba(20, 34, 68, 0.07);
  transform: translateY(-2px);
}

.reach__card > div {
  min-width: 0;
}

.reach__title {
  font-size: 18px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ink);
}

.reach__list {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.reach__tag {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}

.reach__link {
  display: inline-block;
  margin-top: 4px;
  font-size: 17px;
  font-weight: 500;
  overflow-wrap: anywhere;
  color: var(--ink);
  transition: color 0.2s ease;
}

.reach__link:hover {
  color: var(--accent);
}


/* ---------- Contact card button (opens the form) ---------- */

button.contact-cta__button {
  font-family: inherit;
  cursor: pointer;
}


/* ---------- Popup form ---------- */

html.modal-open {
  overflow: hidden;
}

.modal {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(640px, calc(100% - 32px));
  max-width: none;
  height: fit-content;
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.35);
  overflow: hidden;
}

.modal[open] {
  display: flex;
  animation: modal-in 0.28s ease;
}

.modal::backdrop {
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
}

.modal[open]::backdrop {
  animation: backdrop-in 0.28s ease;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

@keyframes backdrop-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal__panel {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  max-height: calc(100dvh - 32px);
}

/* Thin brand line along the top */
.modal__panel::before {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 1;
  height: 3px;
  background: linear-gradient(100deg, #2358f0, #0eb39a);
  content: "";
}

.modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.modal__close:hover {
  background: #f3f6fb;
  color: var(--ink);
}

.modal__close svg {
  width: 18px;
  height: 18px;
}

.modal button:focus-visible,
.modal select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.modal__head {
  padding: 36px 64px 20px 40px;
  border-bottom: 1px solid var(--line);
}

.modal__label {
  display: inline-block;
  margin-bottom: 12px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: transparent;
  background: linear-gradient(100deg, #2358f0, #0eb39a);
  -webkit-background-clip: text;
  background-clip: text;
}

.modal__title {
  padding-bottom: 0.1em;
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.modal__sub {
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
}

.modal__form {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.modal__body {
  flex: 1;
  min-height: 0;
  padding: 28px 40px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal__foot {
  padding: 20px 40px 28px;
  border-top: 1px solid var(--line);
  background: #fff;
}


/* ---------- Form fields ---------- */

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

.field--full {
  grid-column: 1 / -1;
}

.field label,
.field__label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}

.field .req {
  margin-left: 2px;
  color: #d92d20;
}

.field .opt {
  margin-left: 6px;
  font-size: 12.5px;
  font-weight: 400;
  color: #8a94a6;
}

.field__control {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid #d6dbe4;
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field__control::placeholder {
  color: #98a2b3;
}

.field__control:hover {
  border-color: #b6bdc9;
}

.field__control:focus {
  border-color: #2358f0;
  box-shadow: 0 0 0 3px rgba(35, 88, 240, 0.12);
  outline: none;
}

textarea.field__control {
  min-height: 120px;
  line-height: 1.5;
  resize: vertical;
}

select.field__control {
  padding-right: 42px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23475569' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-position: right 14px center;
  background-repeat: no-repeat;
  background-size: 16px;
  cursor: pointer;
}

select.field__control:invalid {
  color: #98a2b3;
}

select.field__control option {
  color: var(--ink);
}

.has-error .field__control {
  border-color: #d92d20;
}

.has-error .field__control:focus {
  box-shadow: 0 0 0 3px rgba(217, 45, 32, 0.12);
}

.field__error {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.4;
  color: #b42318;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text);
  cursor: pointer;
}

.field .check {
  margin-bottom: 0;
  font-weight: 400;
  color: var(--text);
}

.check input {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  accent-color: #2358f0;
  cursor: pointer;
}

.check a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form__error {
  margin-bottom: 14px;
  font-size: 14px;
  line-height: 1.5;
  color: #b42318;
}


/* ---------- Standard form submit button ---------- */

.modal__submit {
  display: flex;
  width: fit-content;
  margin-inline: auto;
  cursor: pointer;
  font-family: inherit;
}

.modal__submit:disabled {
  cursor: wait;
  opacity: 0.8;
}


/* ---------- Thank you panel inside the popup ---------- */

.modal__done {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 64px 40px 56px;
  text-align: center;
}

.modal__done-icon {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  background: linear-gradient(100deg, #2358f0, #0eb39a);
  color: #fff;
}

.modal__done-icon svg {
  width: 26px;
  height: 26px;
}

.modal__done-title {
  padding-bottom: 0.1em;
  font-size: clamp(24px, 2.4vw, 30px);
  font-weight: 400;
  letter-spacing: -0.02em;
}

.modal__done-text {
  max-width: 28em;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
}

.modal__done .btn {
  margin-top: 10px;
  cursor: pointer;
  font-family: inherit;
}


/* ---------- Responsive ---------- */

@media (max-width: 700px) {
  .reach {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .reach__card {
    padding: 24px;
    gap: 18px;
  }

  /* Keep the dialog centered, with viewport space around it on mobile. */
  .modal {
    width: calc(100% - 24px);
    max-height: calc(100dvh - 24px);
  }

  .modal[open] {
    animation-name: modal-in;
  }

  .modal__head {
    padding: 28px 60px 16px 20px;
  }

  .modal__body {
    padding: 20px;
  }

  .modal__foot {
    padding: 16px 20px calc(20px + env(safe-area-inset-bottom));
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .modal__done {
    padding: 56px 20px 40px;
  }
}

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

  .reach__card,
  .field__control,
  .modal__close {
    transition: none;
  }
}
