/* ==========================================================================
   Contact: quick channels, the project brief and the floating
   "Let's talk" button. Loaded after motion.css on every page.
   Colors come from motion.css (--m-*).
   ========================================================================== */

/* Quick channels --------------------------------------------------------- */

/* On wide screens the channels stay in view while the visitor fills in the brief. */
@media (min-width: 961px) {
  .contact-copy {
    position: sticky;
    top: 110px;
    align-self: start;
  }
}

.channels {
  display: grid;
  gap: 10px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.channel {
  --channel: var(--m-mint);
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.channel-whatsapp { --channel: #25d366; }
.channel-call { --channel: var(--m-mint); }
.channel-messenger { --channel: #3b82f6; }
.channel-email { --channel: var(--m-blue); }

.channel > a {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 12px 16px 12px 12px;
  border: 1px solid var(--m-line);
  border-radius: 16px;
  background: rgba(238, 246, 242, .03);
  color: var(--m-ink);
  transition: border-color .3s ease, background-color .3s ease, transform .5s var(--m-ease);
}

.channel > a:hover {
  border-color: color-mix(in srgb, var(--channel) 55%, transparent);
  background: color-mix(in srgb, var(--channel) 8%, transparent);
  transform: translateY(-2px);
}

.channel-icon {
  display: grid;
  flex: none;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 12px;
  background: color-mix(in srgb, var(--channel) 16%, transparent);
  color: var(--channel);
  transition: background-color .3s ease, color .3s ease;
}

.channel > a:hover .channel-icon {
  background: var(--channel);
  color: #06201a;
}

.channel-icon .icon {
  width: 22px;
  height: 22px;
}

.channel-text {
  flex: 1;
  min-width: 0;
}

.channel-text strong,
.channel-text small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-text strong {
  font-size: 1rem;
  font-weight: 700;
}

.channel-text small {
  margin-top: 2px;
  color: var(--m-muted);
  font-size: .85rem;
  font-weight: 600;
}

.channel > a > .icon {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--m-muted);
  transition: transform .4s var(--m-ease), color .3s ease;
}

.channel > a:hover > .icon {
  color: var(--channel);
  transform: translate(2px, -2px);
}

.channel-copy {
  position: relative;
  display: grid;
  flex: none;
  width: 52px;
  place-items: center;
  border: 1px solid var(--m-line);
  border-radius: 16px;
  color: var(--m-muted);
  transition: color .3s ease, border-color .3s ease;
}

.channel-copy:hover {
  border-color: rgba(238, 246, 242, .24);
  color: var(--m-ink);
}

.channel-copy .icon {
  width: 18px;
  height: 18px;
}

.channel-copy.is-copied {
  border-color: color-mix(in srgb, var(--m-mint) 60%, transparent);
  color: var(--m-mint);
}

.channel-copy.is-copied:after {
  content: "Copied";
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  padding: 4px 9px;
  border-radius: 8px;
  background: var(--m-mint);
  color: #06201a;
  font-size: .72rem;
  font-weight: 800;
  white-space: nowrap;
  transform: translateX(-50%);
  animation: copied-in .3s var(--m-ease);
}

@keyframes copied-in {
  from {
    opacity: 0;
    transform: translate(-50%, 6px);
  }
}

.socials {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.social {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid var(--m-line);
  border-radius: 50%;
  color: var(--m-muted);
  transition: color .3s ease, border-color .3s ease, background-color .3s ease, transform .5s var(--m-ease);
}

.social:hover {
  border-color: transparent;
  background: var(--m-ink);
  color: var(--m-bg);
  transform: translateY(-3px);
}

.social .icon {
  width: 19px;
  height: 19px;
}

/* Project brief ---------------------------------------------------------- */

.brief {
  --brief-progress: 0;
  display: grid;
  gap: 26px;
}

.brief-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brief-head img {
  flex: none;
  width: 44px;
  height: 44px;
  border: 2px solid color-mix(in srgb, var(--m-mint) 50%, transparent);
  border-radius: 50%;
  object-fit: cover;
}

.brief-head > p:first-of-type {
  flex: 1;
  min-width: 0;
}

.brief-head > p:first-of-type > * {
  display: block;
}

.brief-head strong {
  color: var(--m-ink);
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -.01em;
}

.brief-head > p:first-of-type > span {
  color: var(--m-muted);
  font-size: .85rem;
  font-weight: 600;
}

.brief-count {
  flex: none;
  color: var(--m-muted);
  font-size: .85rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.brief-count span {
  color: var(--m-mint);
  font-size: 1.05rem;
}

.brief-meter {
  height: 3px;
  margin-top: -14px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--m-line);
}

.brief-meter i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--m-mint), var(--m-blue));
  transform: scaleX(var(--brief-progress));
  transform-origin: left;
  transition: transform .7s var(--m-ease);
}

.brief-step {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.brief-step legend {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 0;
  color: var(--m-ink);
  font-size: 1rem;
  font-weight: 700;
}

/* The step number turns into a tick once the step is answered. */
.brief-num {
  position: relative;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid var(--m-line);
  border-radius: 50%;
  color: var(--m-muted);
  font-size: .75rem;
  font-weight: 800;
  transition: background-color .4s ease, border-color .4s ease, color .3s ease;
}

.brief-num:after {
  content: "";
  position: absolute;
  width: 9px;
  height: 5px;
  margin-top: -2px;
  border-bottom: 2px solid #06201a;
  border-left: 2px solid #06201a;
  opacity: 0;
  transform: rotate(-45deg) scale(.4);
  transition: opacity .25s ease, transform .5s var(--m-ease);
}

.is-answered .brief-num {
  border-color: transparent;
  background: var(--m-mint);
  color: transparent;
}

.is-answered .brief-num:after {
  opacity: 1;
  transform: rotate(-45deg) scale(1);
}

.brief-hint {
  margin: -4px 0 12px;
  color: var(--m-muted);
  font-size: .85rem;
  font-weight: 600;
}

.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.choice {
  position: relative;
  cursor: pointer;
}

.choice input,
.ref input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  border: 1px solid var(--m-line);
  border-radius: 999px;
  background: rgba(238, 246, 242, .03);
  color: var(--m-muted);
  font-size: .9rem;
  font-weight: 600;
  transition: color .25s ease, border-color .25s ease, background-color .25s ease, transform .4s var(--m-ease);
}

.choice:hover span {
  border-color: rgba(238, 246, 242, .24);
  color: var(--m-ink);
}

.choice input:checked + span {
  border-color: transparent;
  background: var(--m-mint);
  color: #06201a;
  animation: choice-pop .45s var(--m-ease);
}

.choice input:focus-visible + span,
.ref input:focus-visible + .ref-card {
  outline: 2px solid var(--m-mint);
  outline-offset: 3px;
}

@keyframes choice-pop {
  40% { transform: scale(1.06); }
}

/* Reference projects scroll sideways, like a shelf. */
.refs {
  position: relative;
  display: grid;
  grid-auto-columns: 148px;
  grid-auto-flow: column;
  gap: 10px;
  margin: 0 -4px;
  padding: 4px 4px 10px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-color: rgba(238, 246, 242, .2) transparent;
  scrollbar-width: thin;
  /* Fade the right edge, a hint that the shelf scrolls. */
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent);
}

.ref {
  scroll-snap-align: start;
  cursor: pointer;
}

.ref-card {
  display: block;
  overflow: hidden;
  border: 1px solid var(--m-line);
  border-radius: 14px;
  background: rgba(238, 246, 242, .03);
  transition: border-color .3s ease, transform .5s var(--m-ease), box-shadow .3s ease;
}

.ref:hover .ref-card {
  border-color: rgba(238, 246, 242, .24);
  transform: translateY(-3px);
}

.ref input:checked + .ref-card {
  border-color: var(--m-mint);
  box-shadow: 0 0 0 1px var(--m-mint), 0 16px 40px -18px color-mix(in srgb, var(--m-mint) 70%, transparent);
}

.ref-thumb {
  position: relative;
  display: grid;
  aspect-ratio: 16 / 10;
  place-items: center;
  overflow: hidden;
  background: rgba(238, 246, 242, .04);
  color: var(--m-muted);
}

.ref-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: transform .8s var(--m-ease);
}

.ref:hover .ref-thumb img {
  transform: scale(1.06);
}

.ref-thumb .icon {
  width: 26px;
  height: 26px;
}

/* A tick badge on the chosen project. */
.ref-thumb:after {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2306201a' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.2 4.2L19 7'/%3E%3C/svg%3E") center / 13px no-repeat,
    var(--m-mint);
  opacity: 0;
  transform: scale(.4);
  transition: opacity .25s ease, transform .5s var(--m-ease);
}

.ref input:checked + .ref-card .ref-thumb:after {
  opacity: 1;
  transform: scale(1);
}

.ref-name {
  display: block;
  padding: 9px 11px 10px;
}

.ref-name strong,
.ref-name small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ref-name strong {
  color: var(--m-ink);
  font-size: .88rem;
  font-weight: 700;
}

.ref-name small {
  color: var(--m-muted);
  font-size: .75rem;
  font-weight: 600;
}

.brief-url,
.brief-level {
  margin-top: 14px;
  animation: brief-reveal .5s var(--m-ease);
}

.brief-url[hidden],
.brief-level[hidden] {
  display: none;
}

@keyframes brief-reveal {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}

.brief .field textarea {
  min-height: 0;
}

.brief .field label small {
  margin-left: 4px;
  color: var(--m-muted);
  font-size: .78rem;
  font-weight: 600;
}

.brief [aria-invalid=true] {
  border-color: #f87171;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, .18);
}

/* The message, as it will arrive. */
.brief-preview .brief-hint {
  margin-bottom: 8px;
}

.brief-bubble {
  position: relative;
  padding: 14px 16px;
  border-radius: 16px 16px 16px 4px;
  background: rgba(37, 211, 102, .1);
  box-shadow: inset 0 0 0 1px rgba(37, 211, 102, .22);
  color: var(--m-ink);
  font-size: .9rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.brief-bubble strong {
  font-weight: 800;
}

.brief-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.brief-actions .button {
  justify-content: center;
  width: 100%;
  margin: 0;
}

.brief-actions .button[hidden] {
  display: none;
}

.brief .form-note {
  margin-top: -14px;
}

/* Project pages and the spotlight -------------------------------------- */

.spot-more {
  margin-top: 18px;
  font-size: .92rem;
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.cta-actions .button {
  margin: 0;
}

/* Floating "Let's talk" button ------------------------------------------- */

.talk {
  position: fixed;
  right: clamp(14px, 2.5vw, 28px);
  bottom: clamp(14px, 2.5vw, 28px);
  z-index: 8000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  font-family: Manrope, system-ui, sans-serif;
  transition: opacity .35s ease, transform .6s var(--m-ease), visibility 0s linear 0s;
  /* The wrapper keeps the closed panel's size, which on phones covers most of
     the screen; only the button and the open panel should catch taps. */
  pointer-events: none;
}

.talk:not(.is-away) .talk-toggle,
.talk.is-open:not(.is-away) .talk-panel {
  pointer-events: auto;
}

.talk.is-away {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(24px) scale(.9);
  transition: opacity .3s ease, transform .5s var(--m-ease), visibility 0s linear .5s;
}

.talk-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 14px 20px 14px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--m-mint), #58d0a4);
  box-shadow: 0 18px 40px -14px rgba(126, 226, 184, .6), 0 6px 16px -8px rgba(0, 0, 0, .7);
  color: #06201a;
  font-size: .95rem;
  font-weight: 800;
  transition: transform .5s var(--m-ease), box-shadow .3s ease;
}

.talk-toggle:hover {
  box-shadow: 0 22px 50px -14px rgba(126, 226, 184, .75), 0 6px 16px -8px rgba(0, 0, 0, .7);
  transform: translateY(-3px);
}

.talk-toggle .icon {
  width: 21px;
  height: 21px;
}

/* A soft ring pulses out every few seconds to catch the eye. */
.talk-ring {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 0 rgba(126, 226, 184, .55);
  animation: talk-ring 3.2s ease-out 2s infinite;
  pointer-events: none;
}

@keyframes talk-ring {
  0% { box-shadow: 0 0 0 0 rgba(126, 226, 184, .55); }
  45%, 100% { box-shadow: 0 0 0 16px rgba(126, 226, 184, 0); }
}

.talk.is-open .talk-ring {
  animation: none;
}

.talk-panel {
  width: min(360px, calc(100vw - 28px));
  padding: 18px;
  border: 1px solid rgba(238, 246, 242, .12);
  border-radius: 22px;
  background: rgba(10, 17, 16, .96);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .95);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  visibility: hidden;
  opacity: 0;
  transform: translateY(14px) scale(.96);
  transform-origin: bottom right;
  transition: opacity .25s ease, transform .45s var(--m-ease), visibility 0s linear .45s;
}

.talk.is-open .talk-panel {
  visibility: visible;
  opacity: 1;
  transform: none;
  transition-delay: 0s;
}

.talk-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.talk-head img {
  width: 44px;
  height: 44px;
  border: 2px solid color-mix(in srgb, var(--m-mint) 50%, transparent);
  border-radius: 50%;
  object-fit: cover;
}

.talk-head p {
  flex: 1;
  min-width: 0;
}

.talk-head strong {
  display: block;
  color: var(--m-ink);
  font-size: 1rem;
  font-weight: 800;
}

.talk-head p > span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--m-muted);
  font-size: .8rem;
  font-weight: 600;
}

.talk-close {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  color: var(--m-muted);
  transition: color .2s ease, background-color .2s ease;
}

.talk-close:hover {
  background: rgba(238, 246, 242, .08);
  color: var(--m-ink);
}

.talk-close .icon {
  width: 18px;
  height: 18px;
}

.talk-intro {
  margin: 14px 0;
  padding: 11px 14px;
  border-radius: 14px 14px 14px 4px;
  background: rgba(238, 246, 242, .06);
  color: var(--m-ink);
  font-size: .9rem;
  line-height: 1.5;
}

.talk-channels {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

.talk-channels .channel > a {
  padding: 9px 12px 9px 9px;
  border-radius: 14px;
}

.talk-channels .channel-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
}

.talk-channels .channel-icon .icon {
  width: 19px;
  height: 19px;
}

.talk-channels .channel-text strong {
  font-size: .92rem;
}

.talk-channels .channel-text small {
  font-size: .78rem;
}

.talk-channels .channel-copy {
  width: 46px;
  border-radius: 14px;
}

/* Staggered entrance for the channels when the panel opens. */
.talk-channels .channel {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .3s ease, transform .5s var(--m-ease);
}

.talk.is-open .talk-channels .channel {
  opacity: 1;
  transform: none;
}

.talk.is-open .talk-channels .channel:nth-child(2) { transition-delay: .05s; }
.talk.is-open .talk-channels .channel:nth-child(3) { transition-delay: .1s; }
.talk.is-open .talk-channels .channel:nth-child(4) { transition-delay: .15s; }

.talk-brief {
  justify-content: center;
  width: 100%;
}

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

@media (max-width: 640px) {
  .channel > a {
    gap: 12px;
    padding: 10px 12px 10px 10px;
  }

  .refs {
    grid-auto-columns: 132px;
  }

  .brief .form-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .talk-toggle {
    padding: 13px 17px 13px 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .talk,
  .talk *,
  .brief *,
  .channel * {
    transition-duration: .01ms !important;
    animation: none !important;
  }
}
