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

/* ==========================================================================
   Custom Properties (Variables)
   ========================================================================== */
:root {
  /* Brand Colors */
  --primary-blue: #235A88;
  --secondary-blue: #3A7FB0;
  --green: #60B73D;
  --yellow: #FDC73B;
  --light-gray: #F5F5F5;
  --white: #FFFFFF;
  --dark-grey: #333333;
  --bg-dark: rgba(0,0,0,0.6);

  /* Typography */
  --font-primary: 'Montserrat', sans-serif;
  --font-fallback: 'Arial', sans-serif;
  
  /* Layout */
  --max-width: 1200px;
  --header-height: 90px;
  --header-height-sticky: 70px;
  --mobile-header: 70px;
  
  /* Transitions */
  --transition-fast: 150ms ease-out;
  --transition-normal: 200ms ease-in-out;
  --transition-slow: 300ms ease-in-out;
  
  /* Shadow */
  --shadow-sm: 0 4px 6px rgba(0,0,0,0.1);
  --shadow-md: 0 8px 12px rgba(0,0,0,0.15);
  --shadow-lg: 0 15px 30px rgba(0,0,0,0.2);
}

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

html {
  font-family: var(--font-primary), var(--font-fallback);
  color: var(--dark-grey);
  line-height: 1.6;
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Focus outline for accessibility */
*:focus-visible {
  outline: 2px solid var(--primary-blue);
  outline-offset: 2px;
}

/* ==========================================================================
   Typography Hierarchy
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--dark-grey);
}

h1 { font-size: 2.5rem; margin-bottom: 1.25rem; }
h2 { font-size: 2rem; margin-bottom: 1.5rem; }
h3 { font-size: 1.5rem; margin-bottom: 1rem; }
p { margin-bottom: 1.25rem; }
a { color: var(--primary-blue); text-decoration: none; transition: all var(--transition-normal); }
a:hover { color: var(--secondary-blue); }

@media (min-width: 768px) {
  h1 { font-size: 3.5rem; }
  h2 { font-size: 2.5rem; }
  h3 { font-size: 1.75rem; }
  p { font-size: 1.1rem; }
}

/* ==========================================================================
   Layout & Container
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

section {
  padding: 4rem 0;
  position: relative;
  background-color: var(--white);
}

section.bg-light { background-color: var(--light-gray); }
section.bg-primary { background-color: var(--primary-blue); color: var(--white); }
section.bg-primary h2, section.bg-primary p { color: var(--white); }

@media (min-width: 768px) {
  section { padding: 6rem 0; }
}

/* Optional subtle noise overlay */
.texture-overlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none;
  background-image: url('data:image/svg+xml,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noiseFilter"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)"/%3E%3C/svg%3E');
  opacity: 0.03;
  z-index: 1;
}

/* ==========================================================================
   Buttons (CTAs)
   ========================================================================== */
.button, button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2rem;
  font-family: var(--font-primary);
  font-size: 1rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition-normal);
  border: 1px solid transparent;
  text-decoration: none;
  text-align: center;
}

.button.primary-cta, .button-primary {
  background-color: var(--primary-blue);
  color: var(--white);
}

.button.primary-cta:hover, .button-primary:hover {
  background-color: var(--secondary-blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: var(--white);
}

.button.outline {
  background-color: transparent;
  color: var(--primary-blue);
  border: 2px solid var(--primary-blue);
}

.button.outline:hover {
  background-color: var(--primary-blue);
  color: var(--white);
}

.button.inverse {
  background-color: var(--white);
  color: var(--primary-blue);
}

.button.inverse:hover {
  background-color: var(--primary-blue);
  color: var(--white);
  border-color: var(--white);
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0; left: 0; width: 100%;
  background-color: var(--white);
  z-index: 1000;
  height: var(--header-height);
  transition: height var(--transition-normal), box-shadow var(--transition-normal);
  display: flex;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.site-header.sticky {
  height: var(--header-height-sticky);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.logo-container {
  display: flex;
  align-items: center;
  height: 100%;
  text-decoration: none;
}

.logo {
  height: 50px;
  width: auto;
  transition: height var(--transition-normal);
}

.site-header.sticky .logo {
  height: 40px;
}

/* Desktop Nav */
.desktop-nav {
  display: none;
  align-items: center;
  gap: 2rem;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-links a {
  color: var(--dark-grey);
  font-weight: 500;
  position: relative;
  padding-bottom: 5px;
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 0;
  height: 2px;
  background-color: var(--secondary-blue);
  transition: width var(--transition-normal);
}

.nav-links a:hover::after, .nav-links a.active::after {
  width: 100%;
}

@media (min-width: 1024px) {
  .desktop-nav { display: flex; }
  .mobile-menu-toggle { display: none; }
}

/* Mobile Nav Toggle */
.mobile-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.quick-dial {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  background-color: var(--primary-blue);
  color: var(--white);
  border-radius: 50%;
  text-decoration: none;
}

.quick-dial svg { width: 20px; height: 20px; fill: currentColor; }

.hamburger {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 1001; /* Above overlay */
}

.hamburger span {
  display: block;
  height: 3px;
  width: 100%;
  background-color: var(--primary-blue);
  border-radius: 3px;
  transition: all var(--transition-normal);
}

.hamburger.is-active span:nth-child(1) {
  transform: translateY(10.5px) rotate(45deg);
}

.hamburger.is-active span:nth-child(2) {
  opacity: 0;
}

.hamburger.is-active span:nth-child(3) {
  transform: translateY(-10.5px) rotate(-45deg);
}

@media (min-width: 1024px) {
  .mobile-controls { display: none; }
}

/* Mobile Overlay */
.mobile-overlay {
  position: fixed;
  top: 0; right: -100%;
  width: 100%; height: 100vh;
  background-color: var(--white);
  z-index: 999;
  transition: right var(--transition-slow);
  display: flex;
  flex-direction: column;
  padding: 80px 2rem 2rem;
  overflow-y: auto;
}

.mobile-overlay.is-open {
  right: 0;
}

.mobile-overlay .nav-links {
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.mobile-overlay .nav-links a {
  font-size: 1.5rem;
}

.mobile-contact-info {
  margin-top: auto;
  padding-top: 2rem;
  border-top: 1px solid var(--light-gray);
}

.mobile-contact-info p { margin-bottom: 0.5rem; font-size: 1rem; }
.mobile-contact-info a { color: var(--primary-blue); font-weight: 600; }

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
  position: relative;
  width: 100%;
  min-height: 50vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 20px 60px; /* offset header */
  background-size: cover;
  background-position: center;
  background-attachment: scroll; /* Default, overridden in JS for parallax if supported */
  overflow: hidden;
}

@media (min-width: 768px) {
  .hero { min-height: 70vh; padding-top: 150px; }
}

.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background-color: var(--bg-dark);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  color: var(--white);
  max-width: 800px;
  width: 100%;
  animation: fadeIn 1s ease-out;
}

.hero-content h1 { color: var(--white); }

/* ==========================================================================
   Components (Cards, Accordion, Carousels)
   ========================================================================== */
/* Service Cards */
.grid-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .grid-container.cols-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-container.cols-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-container.cols-4 { grid-template-columns: repeat(4, 1fr); }
}

.service-card {
  background-color: var(--light-gray);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.service-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--primary-blue);
}

.service-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.service-card-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.service-card-content p {
  flex-grow: 1;
}

.service-card .button {
  align-self: flex-start;
  margin-top: 1rem;
}

/* Feature/Value Blocks */
.feature-block {
  text-align: center;
  padding: 1.5rem;
  border-radius: 8px;
  transition: transform var(--transition-normal);
}

.feature-block:hover {
  transform: translateY(-5px);
}

.feature-icon {
  width: 60px; height: 60px;
  background-color: var(--light-gray);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.25rem;
  color: var(--green);
}

.feature-icon svg {
  width: 30px; height: 30px; fill: currentColor;
  transition: transform var(--transition-fast);
}

.feature-block:hover .feature-icon svg {
  transform: scale(1.1) rotate(5deg);
}

/* Timeline Process */
.process-timeline {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

@media (min-width: 768px) {
  .process-timeline {
    flex-direction: row;
    justify-content: space-between;
  }
}

.process-step {
  flex: 1;
  text-align: center;
  position: relative;
}

.step-icon {
  width: 80px; height: 80px;
  border-radius: 50%;
  background-color: var(--green);
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem;
  font-size: 1.5rem; font-weight: bold;
  position: relative;
  z-index: 2;
}

@media (min-width: 768px) {
  .process-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 40px; left: 50%; width: 100%; height: 2px;
    background-color: var(--light-gray);
    z-index: 1;
  }
}

/* Split Content Section (Image left, text right) */
.split-section {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 768px) {
  .split-section { flex-direction: row; gap: 4rem; }
  .split-section.reverse { flex-direction: row-reverse; }
  .split-section > * { flex: 1; }
}

.split-image img {
  width: 100%; height: auto; border-radius: 8px; box-shadow: var(--shadow-md);
}

/* Accordion */
.accordion {
  border: 1px solid var(--light-gray);
  border-radius: 8px;
  overflow: hidden;
}

.accordion-item {
  border-bottom: 1px solid var(--light-gray);
}
.accordion-item:last-child { border-bottom: none; }

.accordion-header {
  width: 100%;
  padding: 1.25rem;
  display: flex; justify-content: space-between; align-items: center;
  background-color: var(--light-gray);
  border: none; cursor: pointer;
  text-align: left;
  font-family: var(--font-primary); font-size: 1.1rem; font-weight: 600;
  color: var(--dark-grey);
  transition: background-color var(--transition-fast);
}

.accordion-header:hover { background-color: #e5e5e5; }
.accordion-header:focus-visible { outline-offset: -2px; }

.accordion-icon {
  width: 20px; height: 20px;
  transition: transform var(--transition-normal);
  fill: var(--primary-blue);
}

.accordion-item.is-active .accordion-icon {
  transform: rotate(180deg);
}

.accordion-content {
  padding: 0 1.25rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-in-out, padding 0.3s ease-in-out;
  background-color: var(--white);
}

.accordion-item.is-active .accordion-content {
  padding: 1.25rem;
  max-height: 500px; /* arbitrary large max-height for transition */
}

/* Testimonials Carousel */
.testimonial-carousel {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  overflow: hidden;
  text-align: center;
}

.carousel-inner {
  display: flex;
  transition: transform 0.5s ease-in-out;
}

.testimonial-item {
  min-width: 100%;
  padding: 2rem;
  background-color: var(--light-gray);
  border-radius: 8px;
  box-sizing: border-box;
}

.testimonial-item p {
  font-size: 1.25rem; font-style: italic; color: var(--dark-grey);
  margin-bottom: 1.5rem;
}

.testimonial-item cite {
  font-weight: 700; font-style: normal; color: var(--primary-blue);
}

/* Forms */
.contact-form {
  background-color: var(--white);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.form-group { margin-bottom: 1.5rem; position: relative; }

.form-group label {
  display: block; margin-bottom: 0.5rem; font-weight: 600; color: var(--dark-grey);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--light-gray);
  border-radius: 4px;
  font-family: var(--font-primary);
  font-size: 1rem;
  background-color: var(--light-gray);
  transition: all var(--transition-fast);
}

.form-control:focus {
  outline: none;
  background-color: var(--white);
  border-color: var(--secondary-blue);
  box-shadow: inset 0 -2px 0 var(--secondary-blue);
}

textarea.form-control { resize: vertical; min-height: 120px; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background-color: var(--dark-grey);
  color: var(--light-gray);
  padding: 4rem 0 0;
}

.site-footer h3 {
  color: var(--white);
  margin-bottom: 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

@media (min-width: 768px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .footer-grid { grid-template-columns: repeat(4, 1fr); }
}

.footer-logo {
  max-width: 200px;
  margin-bottom: 1rem;
  display: block;
}

.footer-links { list-style: none; }
.footer-links li { margin-bottom: 0.75rem; }
.footer-links a { color: var(--light-gray); transition: color var(--transition-fast); }
.footer-links a:hover { color: var(--white); padding-left: 5px; }

.footer-contact p { margin-bottom: 0.75rem; display: flex; align-items: center; gap: 0.5rem; }
.footer-contact a { color: var(--light-gray); }
.footer-contact a:hover { color: var(--white); }

.social-icons { display: flex; gap: 1rem; margin-top: 1.5rem; }
.social-icons a {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  background-color: rgba(255,255,255,0.1);
  border-radius: 50%;
  color: var(--white);
  transition: all var(--transition-fast);
}
.social-icons a:hover {
  background-color: var(--secondary-blue);
  transform: scale(1.1);
}
.social-icons svg { width: 20px; height: 20px; fill: currentColor; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.9rem;
}

.footer-bottom-flex {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
}

@media (min-width: 768px) {
  .footer-bottom-flex { flex-direction: row; }
}

.footer-bottom-links a {
  color: var(--light-gray); margin: 0 10px; font-size: 0.85rem;
}

/* ==========================================================================
   Animations & Utils
   ========================================================================== */
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.text-center { text-align: center; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }

/* Reduced Motion Override */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
