/* Contact us page (/contact).
 *
 * Built on auth.css (the aurora stage, glass card, fields and gold button of
 * the sign-in pages) and theme-dark.css; this file adds the hero, the service
 * chips, the contact-detail cards, the map and the enquiry form's extras.
 *
 * Layout, mobile first: hero, detail cards, form, map in one column. From
 * 1024px the cards and the map share the left column and the form sits on
 * the right; a page without details or map shows the form alone, centred.
 * Motion: a staggered rise on load, a soft pulse, hover lifts. Only transform
 * and opacity are animated and everything stops under prefers-reduced-motion.
 */

.contact-body {
  --contact-card: rgba(18, 19, 25, 0.82);
  --contact-card-solid: #121319;
  --contact-card-hover: rgba(24, 25, 33, 0.92);
  --contact-chip: rgba(255, 255, 255, 0.04);
  --contact-form-width: clamp(26rem, 22rem + 14vw, 44rem);
  --contact-max: clamp(64rem, 50rem + 30vw, 96rem);
}

/* --------------------------------------------------------------- Stage */

.contact-stage {
  display: block;
  padding-block: clamp(1.5rem, 1rem + 3vw, 4.5rem) clamp(2.5rem, 1.5rem + 4vw, 6rem);
}

.contact-shell {
  display: grid;
  gap: clamp(1.75rem, 1.2rem + 2vw, 3.5rem);
  width: 100%;
  max-width: var(--contact-max);
  margin-inline: auto;
}

/* ---------------------------------------------------------------- Hero */

.contact-hero {
  display: grid;
  justify-items: center;
  gap: clamp(0.75rem, 0.5rem + 0.6vw, 1.25rem);
  text-align: center;
  animation: auth-rise 800ms var(--auth-ease) both;
}

.contact-hero__kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--auth-line);
  border-radius: var(--radius-pill);
  background-color: var(--auth-gold-soft);
  color: var(--auth-gold);
  font-size: var(--auth-fs-small);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.contact-hero__pulse {
  position: relative;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background-color: var(--auth-gold);
}

.contact-hero__pulse::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background-color: var(--auth-gold);
  animation: contact-ping 2.4s var(--auth-ease) infinite;
}

@keyframes contact-ping {
  0% {
    opacity: 0.7;
    transform: scale(1);
  }

  80%,
  100% {
    opacity: 0;
    transform: scale(2.8);
  }
}

.contact-hero__title {
  max-width: 18ch;
  font-family: var(--font-brand);
  font-size: var(--auth-fs-hero);
  font-weight: var(--font-weight-brand);
  line-height: 1.05;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.contact-hero__lead {
  max-width: 44rem;
  color: var(--auth-muted);
  font-size: clamp(1rem, 0.9rem + 0.35vw, 1.25rem);
  line-height: 1.6;
  text-wrap: pretty;
}

.contact-services {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  max-width: 60rem;
  margin: 0.25rem 0 0;
  padding: 0;
  list-style: none;
}

.contact-services__item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.25rem;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--auth-line);
  border-radius: var(--radius-pill);
  background-color: var(--contact-chip);
  color: var(--auth-text);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  animation: auth-rise 700ms var(--auth-ease) both;
  transition: transform var(--transition-normal), border-color var(--transition-normal);
}

.contact-services__item:nth-child(2) { animation-delay: 60ms; }
.contact-services__item:nth-child(3) { animation-delay: 120ms; }
.contact-services__item:nth-child(4) { animation-delay: 180ms; }
.contact-services__item:nth-child(5) { animation-delay: 240ms; }
.contact-services__item:nth-child(6) { animation-delay: 300ms; }
.contact-services__item:nth-child(n + 7) { animation-delay: 360ms; }

.contact-services__item:hover {
  border-color: var(--auth-gold);
  transform: translateY(-2px);
}

.contact-services__icon {
  width: 0.95rem;
  height: 0.95rem;
  color: var(--auth-gold);
}

/* -------------------------------------------------------------- Layout */

.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "info"
    "form"
    "map";
  gap: clamp(1.25rem, 0.9rem + 1.2vw, 2rem);
  align-items: start;
}

.contact-info {
  grid-area: info;
  min-width: 0;
}

.contact-form-card {
  grid-area: form;
  width: 100%;
  min-width: 0;
  /* The sticky site header must not cover the form when it is the link target. */
  scroll-margin-top: calc(var(--site-header-height) + 1rem);
}

.contact-map {
  grid-area: map;
  min-width: 0;
  margin: 0;
}

@media (min-width: 1024px) {
  .contact-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, var(--contact-form-width));
    grid-template-rows: auto 1fr;
    grid-template-areas:
      "info form"
      "map form";
  }

  /* With only a map (no detail cards) the map takes the whole left column. */
  .contact-layout:not(:has(.contact-info)) {
    grid-template-areas: "map form";
    grid-template-rows: auto;
  }
}

.contact-layout--form-only {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "form";
  justify-items: center;
}

.contact-layout--form-only .contact-form-card {
  max-width: var(--contact-form-width);
}

@media (min-width: 1024px) {
  .contact-layout--form-only {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "form";
  }
}

/* -------------------------------------------------------- Detail cards */

.contact-cards {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(0.75rem, 0.6rem + 0.5vw, 1.25rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 640px) {
  .contact-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.contact-card-item {
  display: flex;
  min-width: 0;
  animation: auth-rise 750ms var(--auth-ease) both;
}

.contact-card-item:nth-child(1) { animation-delay: 120ms; }
.contact-card-item:nth-child(2) { animation-delay: 190ms; }
.contact-card-item:nth-child(3) { animation-delay: 260ms; }
.contact-card-item:nth-child(4) { animation-delay: 330ms; }

.contact-detail {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  gap: 1rem;
  min-width: 0;
  padding: clamp(1.1rem, 0.9rem + 0.7vw, 1.6rem);
  overflow: hidden;
  border: 1px solid var(--auth-line);
  border-radius: var(--auth-radius);
  background-color: var(--contact-card-solid);
  box-shadow: 0 30px 60px -40px rgba(0, 0, 0, 0.9);
  transition: transform var(--transition-normal), border-color var(--transition-normal);
}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .contact-detail {
    background-color: var(--contact-card);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    backdrop-filter: blur(18px) saturate(140%);
  }
}

/* A soft gold light that fades in on hover (opacity only). */
.contact-detail::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 0% 0%, rgba(235, 196, 42, 0.14), transparent 60%);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.contact-detail:hover,
.contact-detail:focus-within {
  border-color: var(--auth-line-strong);
  transform: translateY(-3px);
}

.contact-detail:hover::before,
.contact-detail:focus-within::before {
  opacity: 1;
}

.contact-detail__icon {
  position: relative;
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--auth-gold-strong), var(--auth-gold));
  color: var(--color-brand-contrast);
  box-shadow: 0 10px 30px -12px var(--auth-gold-glow);
}

.contact-detail__icon svg {
  width: 1.3rem;
  height: 1.3rem;
}

.contact-detail__body {
  position: relative;
  display: grid;
  align-content: start;
  gap: 0.5rem;
  min-width: 0;
}

.contact-detail__title {
  color: var(--auth-text);
  font-family: var(--font-brand);
  font-size: clamp(1.05rem, 0.95rem + 0.3vw, 1.25rem);
  font-weight: var(--font-weight-bold);
  letter-spacing: -0.01em;
}

.contact-detail__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--auth-gold);
  font-weight: var(--font-weight-semibold);
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 0.25em;
  transition: color var(--transition-fast), text-decoration-color var(--transition-fast);
}

.contact-detail__link:hover {
  color: var(--auth-gold-strong);
  text-decoration-color: currentColor;
}

.contact-detail__list {
  display: grid;
  gap: 0.15rem;
  margin: 0;
}

.contact-detail__row {
  display: grid;
  gap: 0;
}

.contact-detail__row dt {
  color: var(--auth-subtle);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.contact-detail__row dd {
  margin: 0 0 0.35rem;
  color: var(--auth-text);
  overflow-wrap: anywhere;
}

.contact-detail__row dd .contact-detail__link {
  min-height: 36px;
}

.contact-detail__address {
  display: grid;
  gap: 0.15rem;
  color: var(--auth-muted);
  font-style: normal;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.contact-detail__line:first-child {
  color: var(--auth-text);
  font-weight: var(--font-weight-semibold);
}

/* ----------------------------------------------------------------- Map */

.contact-map {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--auth-line);
  border-radius: var(--auth-radius);
  background-color: var(--contact-card-solid);
  box-shadow: 0 30px 60px -40px rgba(0, 0, 0, 0.9);
  animation: auth-rise 800ms 300ms var(--auth-ease) both;
}

.contact-map__frame {
  display: block;
  width: 100%;
  /* Reserved size, so the lazy frame never shifts the page when it loads. */
  aspect-ratio: 4 / 3;
  border: 0;
  /* Darken Google's light tiles slightly to sit inside the dark page. */
  filter: grayscale(0.25) brightness(0.92);
}

@media (min-width: 640px) {
  .contact-map__frame {
    aspect-ratio: 16 / 9;
  }
}

.contact-map__caption {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--auth-line);
  color: var(--auth-muted);
  font-size: var(--auth-fs-small);
}

.contact-map__caption-icon {
  width: 1rem;
  height: 1rem;
  color: var(--auth-gold);
}

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

.contact-form-card .auth-card__header {
  margin-bottom: clamp(0.9rem, 0.7rem + 0.6vw, 1.4rem);
}

.contact-optional {
  color: var(--auth-subtle);
  font-weight: var(--font-weight-medium);
}

.contact-textarea {
  min-height: 9rem;
  padding-block: 0.85rem;
  line-height: 1.6;
  resize: vertical;
}

/* The success message after a sent enquiry. */
.contact-success {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: var(--auth-gap);
  padding: 1rem 1.1rem;
  border: 1px solid rgba(94, 224, 160, 0.35);
  border-radius: var(--auth-radius-sm);
  background-color: rgba(94, 224, 160, 0.1);
  animation: auth-rise 600ms var(--auth-ease) both;
}

.contact-success__icon {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background-color: var(--auth-success);
  color: var(--color-brand-contrast);
  animation: contact-pop 700ms 150ms var(--auth-ease) both;
}

.contact-success__icon svg {
  width: 1.15rem;
  height: 1.15rem;
}

@keyframes contact-pop {
  from {
    opacity: 0;
    transform: scale(0.4);
  }
}

.contact-success__title {
  color: var(--auth-success);
  font-weight: var(--font-weight-bold);
}

.contact-success__text {
  color: var(--auth-text);
  font-size: var(--auth-fs-small);
  line-height: 1.5;
}

/* Honeypot: out of sight and out of the tab order; never display: none, which some bots detect. */
.contact-hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

/* -------------------------------------------------------------- Phones */

@media (max-width: 479.98px) {
  .contact-detail {
    gap: 0.8rem;
  }

  .contact-detail__icon {
    width: 2.4rem;
    height: 2.4rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .contact-hero,
  .contact-services__item,
  .contact-card-item,
  .contact-map,
  .contact-success,
  .contact-success__icon,
  .contact-hero__pulse::after {
    animation: none;
  }

  .contact-services__item,
  .contact-detail,
  .contact-detail::before {
    transition: none;
  }

  .contact-services__item:hover,
  .contact-detail:hover,
  .contact-detail:focus-within {
    transform: none;
  }
}
