import React from 'react';
import { motion, useReducedMotion } from 'framer-motion';

const fadeUpPreset = (delay = 0, duration = 1.2) => ({
  initial: { opacity: 0, y: 20 },
  whileInView: { opacity: 1, y: 0 },
  viewport: { once: true, amount: 0.2 },
  transition: { delay, duration, ease: "easeOut" }
});

const Contact = () => {
  const shouldReduceMotion = useReducedMotion();

  if (shouldReduceMotion) {
    return (
      <section className="py-20 gradient-bg">
        <div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
          <div className="text-center">
            <h2 className="text-3xl lg:text-4xl font-bold text-gray-900 mb-4">
              How can we help? Let's talk
            </h2>
            <p className="text-gray-600 max-w-2xl mx-auto mb-8">
              Ready to start your next project? Get in touch with our team.
            </p>
            <button className="btn-primary">
              Start Conversation
            </button>
          </div>
        </div>
      </section>
    );
  }

  return (
    <motion.section 
      {...fadeUpPreset(0.1, 1.0)}
      className="py-20 gradient-bg"
    >
      <div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
        <motion.div 
          {...fadeUpPreset(0.2, 0.8)}
          className="text-center"
        >
          <h2 className="text-3xl lg:text-4xl font-bold text-gray-900 mb-4">
            How can we help? Let's talk
          </h2>
          <p className="text-gray-600 max-w-2xl mx-auto mb-8">
            Ready to start your next project? Get in touch with our team.
          </p>
          <button className="btn-primary">
            Start Conversation
          </button>
        </motion.div>
      </div>
    </motion.section>
  );
};

export default Contact;