/* Better Than Eleven - Main Stylesheet */
/* Mobile-first responsive design, WCAG 2.1 AA compliant */

/* ============================================
   CSS Custom Properties (Design Tokens)
   ============================================ */
:root {
  /* Brand Colors */
  --brand-orange: #E67131;
  --brand-orange-dark: #D55A1F;
  --brand-blue-dark: #153582;
  --brand-blue-light: #369AD1;

  /* Neutral Colors */
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-400: #9CA3AF;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;
  --white: #FFFFFF;

  /* Blue Tints */
  --blue-50: #EFF6FF;
  --blue-100: #DBEAFE;
  --blue-200: #BFDBFE;

  /* Typography */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Essai', 'Inter', sans-serif;

  /* Spacing Scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;

  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.1);

  /* Transitions */
  --transition-base: 0.3s ease;

  /* Container */
  --container-max: 80rem;
}

/* ============================================
   Font Face Declarations
   ============================================ */
@font-face {
  font-family: 'Essai';
  src: url('../fonts/Essai.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--gray-50);
  color: var(--gray-700);
  line-height: 1.6;
  min-height: 100vh;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

ul, ol {
  list-style: none;
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6,
.font-heading {
  font-family: var(--font-heading);
  line-height: 1.2;
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
}

h2 {
  font-size: 2rem;
  font-weight: 700;
}

h3 {
  font-size: 1.5rem;
  font-weight: 700;
}

h4 {
  font-size: 1.25rem;
  font-weight: 600;
}

p {
  margin-bottom: 1rem;
}

p:last-child {
  margin-bottom: 0;
}

/* ============================================
   Utility Classes
   ============================================ */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-center {
  text-align: center;
}

/* Gradient Background */
.gradient-bg {
  background: linear-gradient(135deg, var(--brand-blue-dark) 0%, var(--brand-blue-light) 100%);
}

/* Gradient Text */
.gradient-text {
  background: linear-gradient(135deg, var(--brand-blue-dark) 0%, var(--brand-blue-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================
   Navigation
   ============================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: var(--white);
  box-shadow: var(--shadow-lg);
  z-index: 50;
}

.nav__container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 5rem;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.nav__logo-img {
  width: 3rem;
  height: 3rem;
  object-fit: contain;
}

.nav__logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--font-heading);
}

/* Desktop Navigation */
.nav__desktop {
  display: none;
  align-items: center;
  gap: var(--space-8);
}

.nav__link {
  color: var(--gray-700);
  font-weight: 500;
  transition: color var(--transition-base);
}

.nav__link:hover,
.nav__link:focus {
  color: var(--brand-blue-light);
}

/* Services Dropdown */
.nav__dropdown {
  position: relative;
}

.nav__dropdown-btn {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--gray-700);
  font-weight: 500;
  transition: color var(--transition-base);
}

.nav__dropdown-btn:hover,
.nav__dropdown-btn:focus {
  color: var(--brand-blue-light);
}

.nav__dropdown-icon {
  width: 1rem;
  height: 1rem;
}

.nav__dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  width: 16rem;
  background-color: var(--white);
  box-shadow: var(--shadow-xl);
  border-radius: var(--radius-lg);
  margin-top: var(--space-2);
  padding: var(--space-2) 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all var(--transition-base);
  z-index: 50;
}

.nav__dropdown-menu.is-active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav__dropdown-link {
  display: block;
  padding: var(--space-2) var(--space-4);
  font-size: 0.875rem;
  color: var(--gray-700);
  transition: background-color var(--transition-base);
}

.nav__dropdown-link:hover,
.nav__dropdown-link:focus {
  background-color: var(--blue-50);
}

/* Mobile Menu Button */
.nav__mobile-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-700);
  padding: var(--space-2);
}

.nav__mobile-btn:hover,
.nav__mobile-btn:focus {
  color: var(--brand-blue-light);
}

.nav__mobile-icon {
  width: 1.5rem;
  height: 1.5rem;
}

/* Mobile Menu */
.nav__mobile-menu {
  display: none;
  background-color: var(--white);
  border-top: 1px solid var(--gray-100);
  padding: var(--space-2);
}

.nav__mobile-menu.is-active {
  display: block;
}

.nav__mobile-link {
  display: block;
  padding: var(--space-2) var(--space-3);
  color: var(--gray-700);
  transition: background-color var(--transition-base);
  border-radius: var(--radius-md);
}

.nav__mobile-link:hover,
.nav__mobile-link:focus {
  background-color: var(--blue-50);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-block;
  padding: var(--space-4) var(--space-8);
  font-size: 1.125rem;
  font-weight: 600;
  text-align: center;
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
  cursor: pointer;
}

.btn--primary {
  background-color: var(--brand-orange);
  color: var(--white);
}

.btn--primary:hover,
.btn--primary:focus {
  background-color: var(--brand-orange-dark);
}

.btn--link {
  color: var(--brand-orange);
  font-weight: 600;
  padding: 0;
}

.btn--link:hover,
.btn--link:focus {
  color: var(--brand-orange-dark);
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
  padding: 6rem 0 5rem;
  color: var(--white);
}

.hero--page {
  padding-top: 8rem;
}

.hero__title {
  font-size: 2.5rem;
  margin-bottom: var(--space-6);
}

.hero__subtitle {
  font-size: 1.25rem;
  color: var(--blue-100);
  max-width: 56rem;
  margin: 0 auto var(--space-10);
}

.hero__icon {
  font-size: 3.75rem;
  margin-bottom: var(--space-6);
}

/* ============================================
   Sections
   ============================================ */
.section {
  padding: var(--space-20) 0;
}

.section--white {
  background-color: var(--white);
}

.section--gray {
  background-color: var(--gray-50);
}

.section__title {
  font-size: 2rem;
  color: var(--gray-900);
  margin-bottom: var(--space-16);
  text-align: center;
}

.section__content {
  max-width: 56rem;
  margin: 0 auto;
}

.section__text {
  font-size: 1.125rem;
  color: var(--gray-700);
  line-height: 1.8;
}

.section__text--large {
  font-size: 1.25rem;
  margin-bottom: var(--space-16);
}

/* ============================================
   Service Cards
   ============================================ */
.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
}

.service-card {
  background-color: var(--white);
  padding: var(--space-8);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.service-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
}

.service-card__icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-4);
}

.service-card__title {
  font-size: 1.5rem;
  color: var(--gray-900);
  margin-bottom: var(--space-3);
}

.service-card__tagline {
  color: var(--brand-blue-dark);
  font-weight: 600;
  margin-bottom: var(--space-4);
}

.service-card__description {
  color: var(--gray-700);
  margin-bottom: var(--space-6);
}

/* ============================================
   Differentiators Grid
   ============================================ */
.differentiators-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
}

.differentiator {
  text-align: center;
}

.differentiator__icon-wrap {
  width: 4rem;
  height: 4rem;
  background-color: var(--blue-100);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-4);
}

.differentiator__icon {
  width: 2rem;
  height: 2rem;
  color: var(--brand-blue-dark);
}

.differentiator__title {
  font-size: 1.25rem;
  color: var(--gray-900);
  margin-bottom: var(--space-3);
}

.differentiator__text {
  color: var(--gray-700);
}

/* ============================================
   Case Studies
   ============================================ */
.case-studies-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
}

.case-study {
  background-color: var(--gray-50);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-lg);
  transition: box-shadow var(--transition-base);
}

.case-study:hover {
  box-shadow: var(--shadow-xl);
}

.case-study__header {
  display: flex;
  align-items: flex-start;
  margin-bottom: var(--space-6);
}

.case-study__avatar {
  width: 4rem;
  height: 4rem;
  border-radius: var(--radius-lg);
  margin-right: var(--space-4);
  flex-shrink: 0;
}

.case-study__title {
  font-size: 1.5rem;
  color: var(--gray-900);
  margin-bottom: var(--space-2);
}

.case-study__tag {
  display: inline-block;
  background-color: var(--brand-blue-dark);
  color: var(--white);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 500;
}

.case-study__content {
  color: var(--gray-700);
  line-height: 1.7;
}

/* ============================================
   Stats Grid
   ============================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-8);
}

.stat {
  text-align: center;
}

.stat__value {
  font-size: 3rem;
  font-weight: 700;
  color: var(--brand-orange);
  margin-bottom: var(--space-2);
}

.stat__label {
  color: var(--gray-700);
}

/* ============================================
   CTA Section
   ============================================ */
.cta {
  padding: var(--space-20) 0;
  text-align: center;
  color: var(--white);
}

.cta__title {
  font-size: 2rem;
  margin-bottom: var(--space-6);
}

.cta__text {
  font-size: 1.25rem;
  color: var(--blue-100);
  margin-bottom: var(--space-8);
}

/* ============================================
   Footer
   ============================================ */
.footer {
  background-color: var(--gray-900);
  color: var(--white);
  padding: var(--space-12) 0;
}

.footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  margin-bottom: var(--space-8);
}

.footer__brand-name {
  font-size: 1.25rem;
  font-weight: 700;
  font-family: var(--font-heading);
  margin-bottom: var(--space-4);
}

.footer__tagline {
  color: var(--gray-400);
}

.footer__heading {
  font-weight: 600;
  margin-bottom: var(--space-4);
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer__link {
  color: var(--gray-400);
  transition: color var(--transition-base);
}

.footer__link:hover,
.footer__link:focus {
  color: var(--white);
}

.footer__bottom {
  border-top: 1px solid var(--gray-800);
  padding-top: var(--space-8);
  text-align: center;
  color: var(--gray-400);
}

/* ============================================
   Accessibility - Focus States
   ============================================ */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--brand-blue-light);
  outline-offset: 2px;
}

/* Skip Link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--brand-blue-dark);
  color: var(--white);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  z-index: 100;
  transition: top var(--transition-base);
}

.skip-link:focus {
  top: var(--space-4);
}

/* ============================================
   Responsive Breakpoints
   ============================================ */

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 36em) {
  .container {
    padding: 0 var(--space-6);
  }

  .nav__container {
    padding: 0 var(--space-6);
  }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 48em) {
  h1 {
    font-size: 3.75rem;
  }

  h2 {
    font-size: 2.5rem;
  }

  .nav__desktop {
    display: flex;
  }

  .nav__mobile-btn {
    display: none;
  }

  .nav__mobile-menu {
    display: none !important;
  }

  .hero__title {
    font-size: 3.75rem;
  }

  .hero__subtitle {
    font-size: 1.5rem;
  }

  .section__title {
    font-size: 2.5rem;
  }

  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .differentiators-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .case-studies-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .cta__title {
    font-size: 2.5rem;
  }

  .footer__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 62em) {
  .container {
    padding: 0 var(--space-8);
  }

  .nav__container {
    padding: 0 var(--space-8);
  }

  h1 {
    font-size: 4.5rem;
  }

  .hero__title {
    font-size: 4.5rem;
  }

  .footer__grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
  .nav,
  .nav__mobile-menu,
  .btn {
    display: none !important;
  }

  .hero {
    padding-top: 2rem;
    background: none !important;
    color: var(--gray-900);
  }

  .hero__subtitle {
    color: var(--gray-700);
  }

  .cta {
    background: none !important;
    color: var(--gray-900);
  }

  .cta__text {
    color: var(--gray-700);
  }
}
