/*
  AI Perfect Fit Styles

  This stylesheet defines a modern, light‑themed design for the AI Perfect Fit
  website. The aesthetic takes cues from the provided slide template with
  clean typography, generous white space, and a harmonious blue colour palette.
  Section spacing, responsive layouts and subtle animations create an
  engaging, enterprise‑quality user experience that reflects the high‑touch
  nature of the services on offer.
*/

/* Global Variables */
:root {
  /* Base colours */
  --primary: #005fa3; /* deep yet vibrant blue used for buttons and accents */
  --accent: #00a8e8;  /* bright secondary hue for highlights */
  --dark: #0a2533;    /* dark blue used for text on light backgrounds */
  --light: #f5f7fa;   /* off‑white base colour for backgrounds */
  --white: #ffffff;
  --muted: #6c7a89;   /* subdued grey for secondary text */
  --border: #e1e6ea;  /* soft border colour */

  /* Typography */
  --font-heading: 'Montserrat', sans-serif;
  --font-body: 'Inter', 'Helvetica Neue', Arial, sans-serif;

  /* Spacing */
  --container-width: 1160px;
  --section-padding: 4rem;
  --border-radius: 0.5rem;
}

/* Font imports */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Montserrat:wght@600;700&display=swap');

/* Reset & Base Styles */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--dark);
  background-color: var(--light);
  line-height: 1.6;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.3s ease;
}
a:hover {
  color: var(--accent);
}

/* Container */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 1rem;
}

/* Navbar */
.navbar {
  width: 100%;
  background-color: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: box-shadow 0.3s ease;
}
.navbar .nav-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.navbar .logo {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--primary);
}

/* Nav menu */
.nav-menu {
  list-style: none;
  display: flex;
  gap: 2rem;
  transition: max-height 0.4s ease;
}
.nav-menu li a {
  font-weight: 500;
  color: var(--dark);
  padding: 0.5rem 0;
}
.nav-menu li a:hover {
  color: var(--primary);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
}
.nav-toggle-label {
  display: none;
  cursor: pointer;
  width: 24px;
  height: 24px;
  position: relative;
}
.nav-toggle-label span,
.nav-toggle-label span::before,
.nav-toggle-label span::after {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--dark);
  transition: transform 0.3s ease;
}
.nav-toggle-label span {
  top: 50%;
  transform: translateY(-50%);
}
.nav-toggle-label span::before {
  content: '';
  top: -8px;
}
.nav-toggle-label span::after {
  content: '';
  top: 8px;
}
.nav-toggle:checked + .nav-toggle-label span {
  background-color: transparent;
}
.nav-toggle:checked + .nav-toggle-label span::before {
  transform: translateY(8px) rotate(45deg);
}
.nav-toggle:checked + .nav-toggle-label span::after {
  transform: translateY(-8px) rotate(-45deg);
}
.nav-toggle:checked ~ .nav-menu {
  max-height: 300px;
}

/* Hero Section */
.hero {
  position: relative;
  height: 80vh;
  min-height: 480px;
  background: url('ai-brain.jpg') center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--white);
}
.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.7) 100%);
  z-index: 0;
}
.hero-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
}
.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}
.hero-subtitle {
  font-size: 1.125rem;
  margin-bottom: 2rem;
  line-height: 1.4;
  color: var(--light);
}
.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  border-radius: var(--border-radius);
  transition: background-color 0.3s ease, color 0.3s ease;
  text-align: center;
}
.primary-btn {
  background-color: var(--primary);
  color: var(--white);
}
.primary-btn:hover {
  background-color: var(--accent);
}
.secondary-btn {
  background-color: transparent;
  color: var(--white);
  border: 2px solid var(--white);
}
.secondary-btn:hover {
  background-color: var(--white);
  color: var(--primary);
}

/* Section Base */
.section {
  padding-top: var(--section-padding);
  padding-bottom: var(--section-padding);
}
.section-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  margin-bottom: 2rem;
  color: var(--dark);
  text-align: center;
}

/* Market Section */
.market-section {
  background-color: var(--white);
}
.market-content {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: flex-start;
}
.market-text {
  flex: 1 1 300px;
  color: var(--dark);
}
.market-chart {
  flex: 1 1 300px;
}
.chart-title {
  font-family: var(--font-heading);
  margin-bottom: 1rem;
  font-size: 1.25rem;
  color: var(--dark);
}
.bar-chart {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 2rem;
  height: 240px;
  background: var(--light);
  border-radius: var(--border-radius);
  padding: 2rem 1rem 1rem;
  border: 1px solid var(--border);
  overflow: hidden;
}
.bar {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  height: 100%; /* fill the height of the chart container */
}

/* Before pseudo-element draws the bar; height animated via JS */
.bar::before {
  height: 0;
}

/* When JS adds the animate class, the bar grows to the target height */
.bar.animate::before {
  height: var(--target-height);
}

/* Bar fill element inserted via JS */
.bar-fill {
  width: 60%;
  border-radius: var(--border-radius);
  /* Solid colour for clear visibility */
  background-color: var(--primary);
  transition: height 1s ease-out;
  height: 0;
}

.bar-value,
.bar-label {
  position: absolute;
  white-space: nowrap;
  font-weight: 600;
  color: var(--dark);
}
.bar-value {
  bottom: calc(100% + 0.5rem);
}
.bar-label {
  bottom: -1.5rem;
  font-weight: 500;
}
.y-axis {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 100%;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-left: 0.25rem;
  font-size: 0.75rem;
  color: var(--muted);
  z-index: -1;
}

/* About Section */
.about-section {
  background-color: var(--light);
}
.about-content {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: center;
}
.about-image {
  flex: 1 1 380px;
  overflow: hidden;
  border-radius: var(--border-radius);
}
.about-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--border-radius);
}
.about-text {
  flex: 1 1 380px;
  color: var(--dark);
}
.about-text p {
  margin-bottom: 1rem;
}
.about-cta {
  margin-top: 1rem;
}

/* Services Section */
.services-section {
  background-color: var(--white);
}
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}
.service-card {
  background-color: var(--light);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 2rem;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.07);
}
.service-icon {
  margin-bottom: 1rem;
  color: var(--primary);
  width: 40px;
  height: 40px;
  margin-inline: auto;
}
.service-card h3 {
  font-family: var(--font-heading);
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
  color: var(--dark);
}
.service-card p {
  color: var(--muted);
  font-size: 0.95rem;
}

/* Process Section */
.process-section {
  background-color: var(--light);
}
.process-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}
.step {
  background-color: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 2rem;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}
.step-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin: 0 auto 1rem;
}
.step h3 {
  font-family: var(--font-heading);
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
  color: var(--dark);
}
.step p {
  font-size: 0.95rem;
  color: var(--muted);
}

/* Benefits Section */
.benefits-section {
  background-color: var(--white);
}
.benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}
.benefit {
  background-color: var(--light);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 2rem;
  text-align: center;
}
.benefit h3 {
  font-family: var(--font-heading);
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
  color: var(--dark);
}
.benefit p {
  font-size: 0.95rem;
  color: var(--muted);
}

/* Testimonials Section */
.testimonials-section {
  background-color: var(--light);
}
.testimonial-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
  position: relative;
}
.testimonial {
  background-color: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 2rem;
  max-width: 600px;
  min-height: 180px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}
.testimonial p {
  margin-bottom: 0.5rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}
.testimonial .testimonial-quote {
  font-style: italic;
  color: var(--dark);
  font-weight: 500;
}
.testimonial .testimonial-author {
  text-align: right;
  font-weight: 600;
  color: var(--primary);
}
.testimonial-control {
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--primary);
  cursor: pointer;
  transition: color 0.2s ease;
}
.testimonial-control:hover {
  color: var(--accent);
}

/* Founder Section */
.founder-section {
  background-color: var(--white);
}
.founder-content {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: center;
}
.founder-text {
  flex: 1 1 380px;
}
.founder-text p {
  margin-bottom: 1rem;
  color: var(--muted);
}
.founder-card {
  flex: 1 1 320px;
  max-width: 400px;
  height: 300px;
  border-radius: var(--border-radius);
  overflow: hidden;
  position: relative;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
.founder-photo {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url('founder-bg.png');
  background-size: cover;
  background-position: center;
  filter: brightness(0.8);
}

/* Contact Section */
.contact-section {
  background-color: var(--light);
}
.contact-content {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}
.contact-intro {
  margin-bottom: 2rem;
  color: var(--muted);
}
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.form-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.form-group.full-width {
  flex-basis: 100%;
}
.form-group label {
  margin-bottom: 0.25rem;
  font-weight: 600;
  color: var(--dark);
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  background-color: var(--white);
  font-size: 1rem;
  color: var(--dark);
  transition: border-color 0.3s ease;
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
}
.contact-form button[type="submit"] {
  align-self: flex-start;
  margin-top: 1rem;
}
.form-response {
  margin-top: 1rem;
  min-height: 1.25rem;
  font-weight: 500;
}

/* Footer */
.footer {
  background-color: var(--white);
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  text-align: center;
  color: var(--muted);
}
.footer .citations a {
  margin-left: 0.25rem;
  margin-right: 0.25rem;
  color: var(--primary);
}
.footer .citations a:hover {
  color: var(--accent);
}

/* Utility Classes */
.hidden {
  display: none;
}

/* Responsive Queries */
@media (max-width: 768px) {
  /* Collapse nav menu */
  .nav-menu {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    background-color: var(--white);
    max-height: 0;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
  }
  .nav-menu li {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border);
  }
  .nav-toggle-label {
    display: block;
  }
  .nav-menu li a {
    display: block;
  }
  /* Adjust hero */
  .hero {
    height: 70vh;
  }
  /* About & Founder */
  .about-content,
  .founder-content {
    flex-direction: column;
    text-align: center;
  }
  .about-image,
  .about-text,
  .founder-text,
  .founder-card {
    flex-basis: 100%;
  }
  .founder-card {
    max-width: none;
    height: 260px;
  }
  .contact-content {
    padding: 0 1rem;
  }
}