/* ==========================================================================
   TechAbbot – contact and project enquiry
   Markup: partials/contact.html (generated by tools/build-contact.js)
   Behaviour: js/contact.js

   Full-width split, edge to edge:
     left  (45%)  dark navy: heading and one client testimonial at a time
     right (55%)  white: the four-field enquiry form

     below 1024px   stacked: heading, testimonials, then the form
     1024px and up  45% / 55%

   The panels run to the screen edges; their contents line up with the rest
   of the page (the 1320px container) through the --edge padding.

   Without JavaScript (<html> has no .js class) the testimonials are a row
   that scrolls sideways and the form is an ordinary POST.
   ========================================================================== */

.contact {
  --c-navy: #07172D;
  --c-navy-2: #102A43;
  --c-accent: #39C78B;
  --c-mute: #C2D0DF;
  /* Distance from the screen edge to the page container's content edge. */
  --edge: max(var(--gutter), calc((100vw - var(--container)) / 2 + var(--gutter)));

  background: var(--c-bg);
}

.contact__inner { display: grid; }

/* Left: voices ---------------------------------------------------------------- */

.contact__voices {
  position: relative;
  background: var(--c-navy);
  color: #fff;
  isolation: isolate;
  overflow: hidden;
}

/* Ambient light, a dot grid and rings: technology and reach, kept quiet. */
.contact__voices::before,
.contact__voices::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.contact__voices::before {
  background:
    radial-gradient(46% 38% at 0% 0%, rgba(8, 113, 167, 0.5), transparent 70%),
    radial-gradient(50% 40% at 100% 100%, rgba(57, 199, 139, 0.26), transparent 70%);
}

.contact__voices::after {
  background:
    repeating-radial-gradient(circle at 100% 0%, transparent 0 58px, rgba(194, 208, 223, 0.09) 58px 59.500px) 100% 0 / 520px 520px no-repeat,
    radial-gradient(circle, rgba(194, 208, 223, 0.16) 1.200px, transparent 1.700px) 0 0 / 24px 24px;
  -webkit-mask-image: linear-gradient(200deg, #000, transparent 62%);
  mask-image: linear-gradient(200deg, #000, transparent 62%);
}

.contact__voices :focus-visible {
  outline-color: #fff;
  outline-offset: 3px;
}

.contact__voices-inner {
  padding: clamp(36px, 4vw, 56px) var(--gutter);
}

.contact__label { color: var(--c-accent); }
.contact__label::after { content: none; }
.contact__label::before { background: linear-gradient(90deg, var(--c-accent), #4DA9E8); }

.contact__title {
  margin: 14px 0 0;
  font-size: clamp(1.625rem, 1.2rem + 1.6vw, 2.25rem);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.contact__accent { color: var(--c-accent); }

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .contact__accent {
    background: linear-gradient(60deg, var(--c-accent), #4DA9E8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    -webkit-text-fill-color: transparent;
  }
}

.contact__intro {
  max-width: 34em;
  margin: 12px 0 0;
  color: var(--c-mute);
  font-size: 1rem;
  line-height: 1.55;
}

/* Testimonial carousel */

.voices {
  --display: 6000ms;
  --slide: 700ms;

  position: relative;
  margin-top: clamp(20px, 2.2vw, 28px);
  padding: clamp(16px, 1.8vw, 22px);
  border: 1px solid rgba(194, 208, 223, 0.2);
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(16, 42, 67, 0.92), rgba(16, 42, 67, 0.55));
  box-shadow: 0 30px 50px -34px rgba(0, 0, 0, 0.9);
}

.voices__label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--c-accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.3;
  text-transform: uppercase;
}

.voices__label::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-accent);
  box-shadow: 0 0 0 4px rgba(57, 199, 139, 0.22);
}

.voices__text {
  /* Leaves the corner clear for the quotation mark. */
  max-width: calc(100% - clamp(84px, 9vw, 130px));
  margin: 8px 0 0;
  color: var(--c-mute);
  font-size: 0.9375rem;
  line-height: 1.55;
}

/* Quotation mark motif. */
.voices__mark {
  position: absolute;
  top: clamp(8px, 1.4vw, 16px);
  right: clamp(14px, 2vw, 26px);
  height: 0.55em;
  color: var(--c-accent);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(4rem, 3rem + 3vw, 5.5rem);
  font-weight: 700;
  line-height: 1;
  opacity: 0.28;
  pointer-events: none;
  user-select: none;
}

.voices__viewport {
  margin-top: 12px;
  padding-top: 14px;
  border-top: 1px solid rgba(194, 208, 223, 0.18);
  overflow: hidden;
  touch-action: pan-y;
}

html:not(.js) .voices__viewport {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  touch-action: auto;
}

.voices__track {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
  transition: transform var(--slide) cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: transform;
}

/* base.css shortens every transition under reduced-motion settings; the
   slide keeps its length unless the carousel is in its static mode. */
.js .voices__track { transition-duration: var(--slide) !important; }

.js .voices.is-static .voices__track,
.js .voices__track.is-instant { transition-duration: 0s !important; }

.voice {
  display: flex;
  flex: 0 0 100%;
  min-width: 0;
  scroll-snap-align: start;
}

.voice__figure {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  margin: 0;
  /* Room so a slide's focus ring and text never touch the clipped edge. */
  padding-right: 2px;
}

.voice__quote {
  margin: 0;
  padding: 0;
}

.voice__quote p {
  margin: 0;
  color: #fff;
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.55;
}

.voice__client {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: auto;
  /* The avatar's ring must stay inside its own slide. */
  padding: 16px 0 6px 6px;
}

.voice__avatar {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-accent), #0871A7);
  box-shadow: 0 0 0 3px var(--c-navy-2), 0 0 0 4.500px rgba(57, 199, 139, 0.5);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.voice__who {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.voice__name {
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.3;
}

.voice__role {
  color: var(--c-mute);
  font-size: 0.9375rem;
  line-height: 1.4;
}

.voice__country {
  margin-top: 2px;
  color: var(--c-accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
}

/* Pagination: the active dot is a bar that fills while its testimonial shows. */

html:not(.js) .voices__dots { display: none; }

.voices__dots {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  margin: 6px 0 -10px -9px;
}

.voices__dot {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  cursor: pointer;
  transition: width 320ms ease;
}

.voices__dot::before {
  content: "";
  width: 10px;
  height: 6px;
  border-radius: 999px;
  background: rgba(194, 208, 223, 0.42);
  transition: width 320ms ease, background-color 200ms ease;
}

.voices__dot:hover::before { background: #fff; }

.voices__dot.is-active { width: 54px; }

.voices__dot.is-active::before {
  width: 36px;
  background: rgba(194, 208, 223, 0.3);
}

.voices__dot.is-active::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 9px;
  width: 36px;
  height: 6px;
  margin-top: -3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--c-accent), #4DA9E8);
  transform-origin: left;
}

.voices.is-playing .voices__dot.is-active::after { animation: voices-progress var(--display) linear both; }

@keyframes voices-progress {
  from { transform: scaleX(0.12); }
  to { transform: scaleX(1); }
}

/* Right: form ------------------------------------------------------------------ */

.contact__form { background: var(--c-bg); }

.contact__form-inner {
  max-width: 640px;
  margin-inline: auto;
  padding: clamp(32px, 3.6vw, 48px) var(--gutter);
}

.contact__form-title {
  margin: 0;
  font-size: clamp(1.5rem, 1.25rem + 1vw, 2rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.contact__form-text {
  margin: 6px 0 0;
  color: var(--c-text-muted);
  font-size: 1rem;
  line-height: 1.5;
}

.contact-form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.contact-form[hidden] { display: none; }

/* Spam trap: present for bots, out of sight and out of reach for people. */
.contact-form__trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.field { min-width: 0; }

.field__label {
  display: block;
  margin-bottom: 5px;
  color: var(--c-text);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.3;
}

.field__control {
  display: block;
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 10px 14px;
  border: 1.500px solid #7F919E;
  border-radius: 10px;
  background: #F9FBFC;
  color: var(--c-text);
  font: inherit;
  font-size: 1rem;
  line-height: 1.4;
  transition: border-color var(--ease), box-shadow var(--ease), background-color var(--ease);
}

.field__control::placeholder { color: #5F6B79; opacity: 1; }

.field__control:hover { border-color: #5E6F7C; }

.field__control:focus {
  border-color: var(--c-blue);
  background: var(--c-bg);
  box-shadow: 0 0 0 4px rgba(11, 109, 145, 0.16);
  outline: 2px solid transparent;
}

.field__control--select {
  padding-right: 44px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23253746' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-position: right 14px center;
  background-size: 18px;
  background-repeat: no-repeat;
  cursor: pointer;
}

/* The prompt option reads as a placeholder until something is chosen. */
.field__control--select:invalid { color: #5F6B79; }
.field__control--select option { color: var(--c-text); }

.field__control--area {
  min-height: 96px;
  resize: vertical;
}

.field.is-invalid .field__control {
  border-color: #C0362C;
  background: #FFF8F7;
}

.field.is-invalid .field__control:focus { box-shadow: 0 0 0 4px rgba(192, 54, 44, 0.16); }

.field__error {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 6px 0 0;
  color: #B42318;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
}

.field__error[hidden] { display: none; }

.field__error::before {
  content: "!";
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  border-radius: 50%;
  background: #B42318;
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 800;
  line-height: 1;
}

.contact-form__status {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #F1B7B1;
  border-left: 4px solid #C0362C;
  border-radius: 8px;
  background: #FFF4F2;
  color: #8E1B12;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.45;
}

.contact-form__status[hidden] { display: none; }

.contact-form__submit { margin-top: 2px; }

.contact-form__submit:disabled {
  cursor: progress;
  filter: saturate(0.7);
  opacity: 0.85;
}

/* Sending: a spinner replaces the arrow. */
.contact-form__submit.is-loading::after {
  content: "";
  width: 16px;
  height: 16px;
  margin-left: 10px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  font-size: 0;
  animation: contact-spin 700ms linear infinite;
  transform: none;
}

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

.contact-form__privacy {
  margin: 0;
  color: var(--c-text-muted);
  font-size: 0.875rem;
  line-height: 1.5;
  text-align: center;
}

.contact-form__privacy a {
  color: var(--c-blue);
  font-weight: 600;
  text-underline-offset: 3px;
}

/* Confirmation shown once the server has accepted the enquiry. */
.contact-form__done {
  margin-top: clamp(22px, 2.6vw, 32px);
  padding: clamp(24px, 3vw, 36px);
  border: 1px solid #BFE3CF;
  border-radius: 16px;
  background: #F1FAF5;
  text-align: center;
}

.contact-form__done[hidden] { display: none; }

.contact-form__done:focus { outline: 2px solid transparent; }

.contact-form__done-icon {
  display: inline-flex;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--c-green-strong) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.500l4.500 4.500L19 7.500'/%3E%3C/svg%3E") center / 56% no-repeat;
}

.contact-form__done-title {
  margin: 14px 0 0;
  color: var(--c-text);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}

.contact-form__done-text {
  margin: 6px 0 0;
  color: var(--c-text-muted);
  font-size: 1.0625rem;
  line-height: 1.5;
}

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

@media (min-width: 1024px) {
  .contact__inner { grid-template-columns: 45% 55%; }

  .contact__voices-inner {
    padding-left: var(--edge);
    padding-right: clamp(32px, 3.6vw, 60px);
  }

  .contact__form {
    display: flex;
    align-items: center;
  }

  .contact__form-inner {
    flex: 1;
    max-width: none;
    margin: 0;
    padding-left: clamp(36px, 4.6vw, 80px);
    padding-right: var(--edge);
  }

  .contact-form { max-width: 620px; }
  .contact-form__done { max-width: 620px; }
}
