/* Contact page */

.contact-hero {
  position: relative;
  padding: calc(var(--header-h) + 48px) 0 112px;
  overflow: hidden;
}

.contact-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(45% 55% at 100% 10%, rgba(52, 89, 166, 0.12), transparent 70%),
    radial-gradient(35% 45% at 0% 60%, rgba(52, 89, 166, 0.06), transparent 70%);
}

.contact-grid {
  display: grid;
  gap: 48px;
  align-items: start;
}

.contact-title {
  margin-top: 28px;
  font-size: clamp(44px, 6.4vw, 84px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.05em;
  text-wrap: balance;
}

.contact-title .accent {
  color: var(--blue);
}

.contact-intro .page-sub {
  max-width: 460px;
}

/* Live availability pill */

.avail {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
}

.avail .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(11, 13, 18, 0.3);
}

.avail.is-open {
  color: #15803d;
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.07);
}

.avail.is-open .dot {
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18);
}

/* Direct contact cards */

.people {
  display: grid;
  gap: 12px;
  margin-top: 36px;
}

.person {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--white);
  transition: border-color 0.3s ease, box-shadow 0.4s ease;
}

.person:hover {
  border-color: rgba(52, 89, 166, 0.25);
  box-shadow: 0 20px 44px -30px rgba(37, 63, 122, 0.45);
}

.person-avatar {
  flex: none;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--blue), var(--blue-600));
  font-size: 16px;
  font-weight: 700;
  color: var(--white);
}

.person:nth-child(2) .person-avatar {
  background: var(--ink);
}

.person-info {
  min-width: 0;
  flex: 1;
}

.person-info strong {
  display: block;
  font-size: 16px;
  font-weight: 700;
}

.person-info small {
  display: block;
  font-size: 13px;
  color: var(--ink-2);
}

.person-actions {
  display: flex;
  gap: 8px;
}

.icon-btn {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.icon-btn svg {
  width: 17px;
  height: 17px;
}

.icon-btn:hover {
  border-color: var(--blue);
  background: var(--blue);
  color: var(--white);
}

.offices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.office {
  padding: 16px 18px;
  border-radius: 20px;
  background: var(--surface);
}

.office span {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.office strong {
  display: block;
  margin-top: 4px;
  font-size: 16px;
  font-weight: 700;
}

.general-mail {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-2);
}

.general-mail a {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-color: rgba(52, 89, 166, 0.35);
  text-underline-offset: 3px;
}

/* ---------- Form card ---------- */

.form-card {
  position: relative;
  padding: 28px 22px;
  border: 1px solid var(--line);
  border-radius: 32px;
  background: var(--white);
  box-shadow: 0 50px 100px -60px rgba(37, 63, 122, 0.55);
}

.form-card h2 {
  font-size: clamp(24px, 2.4vw, 30px);
  font-weight: 700;
  letter-spacing: -0.025em;
}

.form-card > p {
  margin-top: 8px;
  font-size: 15px;
  color: var(--ink-2);
}

.cform {
  display: grid;
  gap: 18px;
  margin-top: 28px;
}

.cform-row {
  display: grid;
  gap: 18px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label,
.field legend {
  padding: 0;
  font-size: 14px;
  font-weight: 600;
}

.field label small {
  font-weight: 500;
  color: var(--ink-2);
}

.field input,
.field textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(11, 13, 18, 0.14);
  border-radius: 14px;
  background: var(--surface);
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.field textarea {
  min-height: 150px;
  resize: vertical;
  line-height: 1.55;
}

.field input::placeholder,
.field textarea::placeholder {
  color: rgba(11, 13, 18, 0.35);
}

.field input:hover,
.field textarea:hover {
  border-color: rgba(11, 13, 18, 0.28);
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--blue);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(52, 89, 166, 0.12);
}

.field.is-invalid input,
.field.is-invalid textarea {
  border-color: #dc2626;
  background: #fef6f6;
}

.field-error {
  display: none;
  font-size: 13px;
  font-weight: 500;
  color: #dc2626;
}

.field.is-invalid .field-error {
  display: block;
}

.field-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.char-count {
  font-size: 12.5px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

/* Topic chips */

.topics {
  margin: 0;
  padding: 0;
  border: 0;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chip span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid rgba(11, 13, 18, 0.14);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.chip span::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  transition: background-color 0.2s ease;
}

.chip:hover span {
  border-color: rgba(11, 13, 18, 0.3);
  color: var(--ink);
}

.chip input:checked + span {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--white);
}

.chip input:checked + span::before {
  border-color: var(--blue-300);
  background: var(--blue-300);
}

.chip input:focus-visible + span {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* Honeypot: invisible to people, still in the DOM for bots */
.hp {
  position: absolute !important;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.cform-foot {
  display: grid;
  gap: 16px;
  margin-top: 4px;
}

.privacy-note {
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-2);
}

.privacy-note a {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}

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

.submit:disabled {
  cursor: progress;
  opacity: 0.85;
}

.submit .spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin-submit 0.7s linear infinite;
}

.cform.is-sending .submit .spinner {
  display: block;
}

.cform.is-sending .submit svg {
  display: none;
}

@keyframes spin-submit {
  to { transform: rotate(360deg); }
}

.form-alert {
  display: none;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #fef2f2;
  font-size: 14px;
  font-weight: 500;
  color: #b91c1c;
}

.form-alert.is-visible {
  display: flex;
}

.form-alert svg {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
}

/* Success state */

.form-success {
  display: none;
  flex-direction: column;
  align-items: center;
  padding: 48px 8px 32px;
  text-align: center;
}

.form-card.is-sent .form-success {
  display: flex;
}

.form-card.is-sent .form-body {
  display: none;
}

.success-mark {
  width: 84px;
  height: 84px;
}

.success-mark circle {
  fill: none;
  stroke: var(--blue);
  stroke-width: 3;
  stroke-dasharray: 240;
  stroke-dashoffset: 240;
  transform: rotate(-90deg);
  transform-origin: center;
}

.success-mark path {
  fill: none;
  stroke: var(--blue);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
}

.form-card.is-sent .success-mark circle {
  animation: draw 0.8s var(--ease) forwards;
}

.form-card.is-sent .success-mark path {
  animation: draw 0.5s var(--ease) 0.6s forwards;
}

@keyframes draw {
  to { stroke-dashoffset: 0; }
}

.form-success h2 {
  margin-top: 24px;
}

.form-success p {
  max-width: 360px;
  margin-top: 10px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-2);
}

.form-success .btn {
  margin-top: 28px;
}

/* ---------- What happens next ---------- */

.next-steps {
  display: grid;
  gap: 14px;
}

.next {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
}

.next .step-num {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--blue);
  font-size: 14px;
  font-weight: 700;
  color: var(--white);
}

.next h3 {
  margin-top: 18px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.next p {
  margin-top: 8px;
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--ink-2);
}

/* ---------- Breakpoints ---------- */

@media (min-width: 640px) {
  .cform-row {
    grid-template-columns: 1fr 1fr;
  }

  .form-card {
    padding: 40px;
  }

  .cform-foot {
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 24px;
  }

  .submit {
    width: auto;
  }
}

@media (min-width: 768px) {
  .next-steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .contact-grid {
    grid-template-columns: 0.9fr 1.1fr;
    gap: 72px;
  }

  .contact-intro {
    position: sticky;
    top: calc(var(--header-h) + 32px);
  }
}

@media (max-width: 400px) {
  .person {
    flex-wrap: wrap;
  }

  .person-actions {
    width: 100%;
  }

  .person-actions .icon-btn {
    flex: 1;
    border-radius: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .submit .spinner {
    animation-duration: 2s;
  }

  .success-mark circle,
  .success-mark path {
    stroke-dashoffset: 0;
    animation: none !important;
  }
}
