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

body.menu-open {
  overflow: hidden;
  touch-action: none;
}

.safe-top {
  padding-top: env(safe-area-inset-top, 0px);
}

.safe-bottom {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.tap-target {
  min-height: 44px;
  min-width: 44px;
}

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

.mobile-only {
  display: flex;
}

.hero-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 42rem;
  margin: 0 auto;
}

.hero-section {
  position: relative;
  min-height: 100svh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.hero-inner {
  flex: 1;
  display: flex;
  align-items: center;
  padding-top: 5rem;
  padding-bottom: 5rem;
}

.hero-fade {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 8rem;
  background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.95));
  pointer-events: none;
  z-index: 1;
}

.scroll-cue {
  position: absolute;
  bottom: 6.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  color: #2d6a4f;
  transition: opacity 0.4s ease, transform 0.4s ease;
  -webkit-tap-highlight-color: transparent;
}

.scroll-cue:hover {
  color: #1b4332;
}

.scroll-cue-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.9);
  padding: 0.375rem 0.875rem;
  border-radius: 9999px;
  box-shadow: 0 2px 12px rgba(26, 39, 68, 0.08);
}

.scroll-cue-icon {
  display: flex;
  color: rgba(26, 39, 68, 0.4);
  animation: scrollBounce 2s ease-in-out infinite;
}

.scroll-cue.hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(8px);
  pointer-events: none;
}

@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

.services-section {
  position: relative;
  z-index: 2;
  margin-top: -9rem;
  padding-top: 2rem;
  background: white;
  border-radius: 1.5rem 1.5rem 0 0;
  box-shadow: 0 -12px 40px rgba(26, 39, 68, 0.06);
}

@media (min-width: 640px) {
  .services-section {
    margin-top: -8rem;
    padding-top: 3rem;
  }

  .scroll-cue {
    bottom: 7.5rem;
  }
}

@media (min-width: 1024px) {
  .hero-inner {
    padding-top: 6rem;
    padding-bottom: 0.5rem;
  }

  .services-section {
    margin-top: -9rem;
    border-radius: 2rem 2rem 0 0;
  }

  .scroll-cue {
    bottom: 8.5rem;
  }
}

.hero-content {
  width: 100%;
}

.pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  max-width: 20rem;
  margin: 0 auto;
}

.pillar-card {
  flex-direction: column;
  align-items: center;
}

.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

@media (min-width: 640px) {
  .pillars-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    max-width: none;
  }

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

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

@media (min-width: 768px) {
  .desktop-nav {
    display: flex !important;
  }

  .mobile-only,
  #mobile-menu {
    display: none !important;
  }
}

@media (min-width: 1024px) {
  .hero-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 4rem;
    align-items: center;
    max-width: none;
    margin: 0;
    text-align: left;
  }

  .hero-content {
    text-align: left;
  }

  .hero-logo {
    margin-left: 0;
    margin-right: auto;
  }

  .tagline-row {
    justify-content: flex-start;
  }

  .hero-pillars {
    width: 100%;
  }

  .pillars-grid {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    max-width: 22rem;
    margin-left: auto;
    margin-right: 0;
  }

  .pillar-card {
    flex-direction: row;
    align-items: center;
    gap: 1.25rem;
    text-align: left;
    padding: 1.25rem 1.5rem;
    border-radius: 1rem;
    border: 1px solid rgba(26, 39, 68, 0.08);
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(4px);
  }

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

  .services-grid .service-card:nth-child(-n + 3) {
    grid-column: span 2;
  }

  .services-grid .service-card:nth-child(4) {
    grid-column: 2 / span 2;
  }

  .services-grid .service-card:nth-child(5) {
    grid-column: 4 / span 2;
  }

  .about-grid {
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
  }

  .footer-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
  }
}

@media (min-width: 1280px) {
  .hero-grid {
    gap: 6rem;
  }

  .pillars-grid {
    max-width: 26rem;
  }
}

.nav-link {
  position: relative;
  transition: color 0.3s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: #2d6a4f;
  transition: width 0.3s ease;
}

.nav-link:hover {
  color: #2d6a4f;
}

.nav-link:hover::after {
  width: 100%;
}

.mobile-menu {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.35s ease, opacity 0.3s ease;
}

.mobile-menu.open {
  max-height: 16rem;
  opacity: 1;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0.75rem 0.5rem;
  color: rgba(26, 39, 68, 0.85);
  font-weight: 500;
  border-radius: 0.5rem;
  transition: color 0.2s ease, background-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.mobile-nav-link:active {
  background-color: rgba(45, 106, 79, 0.08);
  color: #2d6a4f;
}

.mobile-nav-cta {
  justify-content: center;
  margin-top: 0.5rem;
  background-color: #2d6a4f;
  color: white !important;
  border-radius: 0.375rem;
  box-shadow: 0 4px 14px rgba(45, 106, 79, 0.25);
}

.mobile-nav-cta:active {
  background-color: #1b4332 !important;
}

.tagline-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.625rem 0.75rem;
  padding: 0 0.25rem;
}

.tagline-line {
  display: none;
  height: 1px;
  width: 2.5rem;
  background-color: rgba(26, 39, 68, 0.2);
  flex-shrink: 0;
}

@media (min-width: 400px) {
  .tagline-line {
    display: block;
  }
}

@media (min-width: 640px) {
  .tagline-line {
    width: 5rem;
  }
}

.tagline-text {
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(26, 39, 68, 0.6);
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
}

@media (min-width: 640px) {
  .tagline-text {
    font-size: 0.875rem;
    letter-spacing: 0.25em;
  }
}

.btn-primary {
  display: inline-block;
  background-color: #2d6a4f;
  color: white;
  font-weight: 600;
  padding: 0.875rem 1.5rem;
  border-radius: 0.375rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 14px rgba(45, 106, 79, 0.25);
  -webkit-tap-highlight-color: transparent;
}

@media (min-width: 640px) {
  .btn-primary {
    padding: 0.875rem 2rem;
  }
}

.btn-primary:hover {
  background-color: #1b4332;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(45, 106, 79, 0.35);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(45, 106, 79, 0.3);
}

.btn-secondary {
  display: inline-block;
  background-color: white;
  color: #1a2744;
  font-weight: 600;
  padding: 0.875rem 1.5rem;
  border-radius: 0.375rem;
  transition: all 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}

@media (min-width: 640px) {
  .btn-secondary {
    padding: 0.875rem 2rem;
  }
}

.btn-secondary:hover {
  background-color: #f0fdf4;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.btn-secondary:active {
  transform: translateY(0);
}

.pillar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  .pillar-item:hover {
    transform: translateY(-4px);
  }
}

.service-card {
  background: white;
  border: 1px solid rgba(26, 39, 68, 0.08);
  border-radius: 1rem;
  padding: 1.5rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
}

@media (min-width: 640px) {
  .service-card {
    padding: 2rem;
  }
}

@media (hover: hover) {
  .service-card:hover {
    transform: translateY(-6px);
    border-color: rgba(45, 106, 79, 0.2);
    box-shadow: 0 20px 40px rgba(26, 39, 68, 0.08);
  }

  .service-card:hover .service-icon {
    background: linear-gradient(135deg, rgba(45, 106, 79, 0.2), rgba(45, 106, 79, 0.1));
    transform: scale(1.08);
  }
}

.service-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(45, 106, 79, 0.1), rgba(45, 106, 79, 0.05));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  transition: all 0.4s ease;
}

@media (min-width: 640px) {
  .service-icon {
    width: 3.5rem;
    height: 3.5rem;
    margin-bottom: 1.25rem;
  }
}

.contact-link {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  color: rgba(255, 255, 255, 0.8);
  transition: all 0.3s ease;
  padding: 0.25rem 0;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  .contact-link:hover {
    color: white;
    transform: translateX(4px);
  }

  .contact-link:hover img,
  .contact-link:hover .contact-icon {
    opacity: 1;
  }
}

.contact-link:active {
  color: white;
}

.contact-link img,
.contact-link .contact-icon {
  opacity: 0.85;
  transition: opacity 0.3s ease;
  margin-top: 0.125rem;
  filter: brightness(0) invert(1);
}

.slant-divider {
  height: 2rem;
  background: linear-gradient(
    to bottom right,
    #111c32 49.5%,
    #2d6a4f 50.5%
  );
}

@media (min-width: 640px) {
  .slant-divider {
    height: 3rem;
  }
}

#header.scrolled {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 20px rgba(26, 39, 68, 0.06);
}

.fade-in {
  animation: fadeIn 1s ease forwards;
}

.fade-in-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
  transition-delay: var(--delay, 0ms);
}

.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .scroll-cue,
  .scroll-cue-icon {
    animation: none;
    transition: none;
    transform: none;
    opacity: 1;
  }

  .scroll-cue.hidden {
    opacity: 0;
  }

  .fade-in,
  .fade-in-up,
  .service-card,
  .pillar-item,
  .btn-primary,
  .btn-secondary,
  .contact-link,
  .nav-link,
  .mobile-menu {
    animation: none;
    transition: none;
    transform: none;
    opacity: 1;
  }

  .mobile-menu {
    max-height: none;
  }
}

@media (max-width: 767px) {
  .btn-primary:hover,
  .btn-secondary:hover {
    transform: none;
  }
}
