/* ===== Responsive Base (4iService) ===== */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  font-size: clamp(15px, 1.6vw, 18px);
}

body {
  margin: 0;
  line-height: 1.6;
  color: #0f172a; /* slate-900 */
  background: #fff;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans";
}

/* Fluid container */
.container { width: min(92vw, 1200px); margin-inline: auto; }

/* Media defaults */
img, video, iframe, canvas, svg { max-width: 100%; height: auto; display: block; }

/* Fluid type helpers */
.h1 { font-size: clamp(2rem, 3.6vw, 3.25rem); line-height: 1.15; }
.h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); line-height: 1.2; }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: #334155; }

/* Utility layouts */
.grid { display: grid; gap: clamp(12px, 2vw, 28px); }
.flex { display: flex; gap: clamp(10px, 2vw, 24px); align-items: center; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: clamp(10px, 2.4vw, 14px) clamp(14px, 3.2vw, 20px);
  border-radius: 999px; font-weight: 600; text-decoration: none;
}

/* Responsive tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Prevent layout shift for media */
.ratio-16x9 { aspect-ratio: 16 / 9; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ===== Mobile-First Responsive Utilities ===== */

/* Ensure no horizontal overflow */
body, html { overflow-x: hidden; max-width: 100vw; }

/* Fluid spacing utilities */
.section { 
  padding-block: clamp(32px, 8vw, 96px); 
  padding-inline: clamp(16px, 4vw, 40px);
}

/* Responsive navbar */
.site-header { 
  position: sticky; 
  top: 0; 
  background: #fff; 
  border-bottom: 1px solid #e2e8f0; 
  z-index: 50; 
}

.nav { 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  padding: 12px 0; 
}

.nav-menu a { 
  padding: 10px 14px; 
  display: block; 
}

.nav-toggle { 
  background: none; 
  border: 0; 
  font-size: 1.5rem; 
  padding: 8px;
  cursor: pointer;
}

/* Hero sections */
.hero { 
  padding-block: clamp(48px, 8vw, 96px); 
}

.hero-grid { 
  grid-template-columns: 1fr; 
  align-items: center; 
}

.hero-visual { 
  justify-self: center; 
}

/* Feature cards */
.features { 
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); 
}

.card {
  padding: clamp(16px, 3.2vw, 24px);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #fff;
}

/* Prevent text overflow */
.prose { 
  overflow-wrap: anywhere; 
  word-break: break-word; 
}

/* Ensure tap targets are accessible */
button, a, input, select, textarea {
  min-height: 44px;
  min-width: 44px;
}

/* Make iframes responsive */
iframe {
  max-width: 100%;
}

/* ===== Breakpoints (mobile-first) ===== */

@media (min-width: 480px) { 
  /* Small tweaks for larger phones */
  .section {
    padding-inline: clamp(20px, 5vw, 48px);
  }
}

@media (min-width: 768px) { 
  /* 2-cols, larger paddings */
  .hero-grid { 
    grid-template-columns: 1.1fr 0.9fr; 
  }
  
  .grid-2 { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: clamp(16px, 2vw, 32px); 
  }
  
  .section {
    padding-inline: clamp(24px, 6vw, 60px);
  }
}

@media (min-width: 900px) {
  .nav-toggle { 
    display: none; 
  }
  
  .nav-menu { 
    display: flex !important; 
    gap: 8px; 
  }
  
  .nav-menu[hidden] { 
    display: flex !important; 
  }
}

@media (min-width: 1024px) { 
  /* 3-cols, wider gutters */
  .grid-3 { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: clamp(20px, 3vw, 40px); 
  }
}

@media (min-width: 1280px) { 
  /* generous whitespace */
  .container {
    max-width: 1280px;
  }
}

/* ===== Webflow-Specific Fixes ===== */

/* Fix Webflow container issues */
.w-container {
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(16px, 4vw, 40px);
  padding-right: clamp(16px, 4vw, 40px);
}

/* Fix Webflow grid */
.w-layout-grid {
  display: grid;
  grid-auto-columns: 1fr;
  grid-row-gap: 16px;
  grid-column-gap: 16px;
}

/* Ensure images in Webflow are responsive */
.w-inline-block img,
.w-block img {
  max-width: 100%;
  height: auto;
}

/* Fix Webflow video embeds */
.w-video {
  width: 100%;
  position: relative;
  padding-bottom: 0;
}

.w-video iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Ensure dropdown menus work on mobile */
@media (max-width: 899px) {
  .w-dropdown-list {
    position: static !important;
  }
  
  .w-nav-menu {
    background: #fff;
  }
}

/* Fix full-width containers causing overflow */
.full-width-container {
  max-width: 100%;
  width: 100%;
  overflow-x: hidden;
}

/* Ensure buttons are responsive */
.button,
.w-button,
.primary-button,
.primary-button-on-inverse {
  min-height: 44px;
  padding: clamp(10px, 2.4vw, 14px) clamp(16px, 3.5vw, 24px);
  font-size: clamp(0.9rem, 1.8vw, 1rem);
  white-space: normal;
  text-align: center;
}

/* Fix rich text blocks */
.w-richtext {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.w-richtext img {
  max-width: 100%;
  height: auto;
}

/* Container queries for advanced responsiveness */
@supports (container-type: inline-size) {
  .card-container {
    container-type: inline-size;
  }
  
  @container (min-width: 720px) {
    .card-container .grid {
      grid-template-columns: 1fr 1fr;
    }
  }
}

