/* Blog CMS content — clickable links & readable typography */
.cms-content {
  position: relative;
  z-index: 1;
}
.cms-content a,
.cms-content a.cms-link {
  color: hsl(var(--primary));
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  pointer-events: auto;
  font-weight: 500;
  transition: color 0.2s ease, opacity 0.2s ease;
}
.cms-content a:hover {
  opacity: 0.85;
}
.cms-content p,
.cms-content li,
.cms-content h2,
.cms-content h3 {
  overflow-wrap: anywhere;
}
.cms-content.blog-prose h2 {
  margin-top: 2rem;
  font-size: clamp(1.15rem, 3.5vw, 1.35rem);
  font-weight: 600;
  color: hsl(var(--foreground));
}
.cms-content.blog-prose h3 {
  margin-top: 1.5rem;
  font-size: clamp(1.05rem, 3vw, 1.15rem);
  font-weight: 600;
}
.cms-content.blog-prose ul {
  margin: 1rem 0;
  padding-left: 1.25rem;
  list-style: disc;
}
.cms-content.blog-prose ol {
  margin: 1rem 0;
  padding-left: 1.25rem;
  list-style: decimal;
}

/* Staggered reveal for blog body blocks */
.cms-content.blog-animated > * {
  opacity: 0;
  transform: translateY(12px);
  animation: uptulaBlogFade 0.55s ease forwards;
}
.cms-content.blog-animated > *:nth-child(1) { animation-delay: 0.06s; }
.cms-content.blog-animated > *:nth-child(2) { animation-delay: 0.12s; }
.cms-content.blog-animated > *:nth-child(3) { animation-delay: 0.18s; }
.cms-content.blog-animated > *:nth-child(4) { animation-delay: 0.24s; }
.cms-content.blog-animated > *:nth-child(5) { animation-delay: 0.3s; }
.cms-content.blog-animated > *:nth-child(6) { animation-delay: 0.36s; }
.cms-content.blog-animated > *:nth-child(7) { animation-delay: 0.42s; }
.cms-content.blog-animated > *:nth-child(8) { animation-delay: 0.48s; }
.cms-content.blog-animated > *:nth-child(n + 9) { animation-delay: 0.54s; }

@keyframes uptulaBlogFade {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Leadership page */
.leadership-hero {
  position: relative;
  overflow: hidden;
  border-radius: 1.5rem;
  border: 1px solid hsl(var(--border));
  background: linear-gradient(135deg, hsl(var(--primary) / 0.12), hsl(var(--accent) / 0.08) 45%, transparent);
  padding: clamp(1.25rem, 4vw, 3rem);
}
.leadership-hero::before {
  content: "";
  position: absolute;
  inset: -40% auto auto -20%;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, hsl(var(--primary) / 0.25), transparent 70%);
  pointer-events: none;
}
.leadership-grid {
  display: grid;
  gap: 1.25rem;
}
@media (min-width: 640px) {
  .leadership-grid.leaders {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1024px) {
  .leadership-grid.leaders {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
/* Single executive leader: center the card in the section */
.leadership-grid.leaders:has(> :only-child) {
  grid-template-columns: minmax(0, 22rem);
  justify-content: center;
}
.leadership-grid.leaders .leadership-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.leadership-grid.leaders .leadership-card img,
.leadership-grid.leaders .leadership-card > span:first-of-type {
  width: 8.5rem;
  height: 8.5rem;
  flex-shrink: 0;
}
.leadership-grid.leaders .leadership-card .cms-content {
  text-align: center;
}
.leadership-card {
  height: 100%;
  border-radius: 1.25rem;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--surface));
  padding: 1.25rem;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.leadership-card:hover {
  transform: translateY(-4px);
  border-color: hsl(var(--primary) / 0.45);
  box-shadow: 0 12px 40px hsl(var(--primary) / 0.08);
}
.leadership-spotlight {
  display: grid;
  gap: 1.5rem;
  align-items: center;
}
@media (min-width: 768px) {
  .leadership-spotlight {
    grid-template-columns: 200px 1fr;
  }
}
.leadership-spotlight img {
  width: 100%;
  max-width: 200px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 1.25rem;
  border: 2px solid hsl(var(--primary) / 0.2);
}
.leadership-contact-row {
  display: grid;
  gap: 1rem;
}
@media (min-width: 640px) {
  .leadership-contact-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Site-wide mobile polish */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (max-width: 1023px) {
  .mobile-nav-link {
    display: block;
    border-radius: 0.75rem;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    line-height: 1.45;
    font-weight: 500;
  }
  .mobile-nav-sublink {
    display: block;
    border-radius: 0.625rem;
    padding: 0.7rem 0.85rem;
    font-size: 0.9375rem;
    color: hsl(var(--muted-foreground));
    line-height: 1.4;
  }
  .mobile-nav-panel {
    max-height: min(82dvh, 680px);
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }
  main#main {
    overflow-x: clip;
    overflow-y: visible;
  }

  /* Home — avoid parallax hero clipping / hiding sections on phones */
  .home-hero {
    position: relative;
    min-height: 100dvh;
    overflow: visible;
  }
  .home-hero-bg {
    position: absolute !important;
    inset: 0;
    height: 100% !important;
    min-height: 100%;
  }
  .home-hero-content {
    margin-top: 0 !important;
    position: relative;
    z-index: 10;
    min-height: 100dvh;
  }
  .home-hero .text-display {
    font-size: clamp(1.65rem, 7.5vw, 2.75rem) !important;
    line-height: 1.12 !important;
  }
  .home-card-carousel-stage {
    height: min(70dvh, 480px) !important;
    max-width: 100%;
  }
  .home-card-carousel [class*="w-[200px]"],
  .home-card-carousel [class*="md:w-[250px]"] {
    width: min(82vw, 220px) !important;
  }
  .home-process-steps {
    margin-inline: 0 !important;
    max-width: 100%;
    overflow-x: hidden;
  }
  .home-process-steps svg {
    max-width: 100%;
  }

  /* Grids / cards should shrink inside the viewport */
  main#main .section > div,
  main#main .section .grid {
    min-width: 0;
    max-width: 100%;
  }
  main#main img,
  main#main video,
  main#main svg {
    max-width: 100%;
  }

  /* Typography scale */
  .text-h1,
  h1.text-h1 {
    font-size: clamp(1.65rem, 6.5vw, 2.5rem) !important;
    line-height: 1.15 !important;
  }
  .text-h2,
  h2.text-h2 {
    font-size: clamp(1.4rem, 5.5vw, 2rem) !important;
    line-height: 1.2 !important;
  }
  .text-h3,
  h2.text-h3,
  h3.text-h3 {
    font-size: clamp(1.15rem, 4.5vw, 1.5rem) !important;
  }
  .text-lead {
    font-size: clamp(0.98rem, 3.6vw, 1.125rem) !important;
    line-height: 1.55 !important;
  }

  /* Section spacing */
  .section {
    padding-top: clamp(2.5rem, 8vw, 4rem);
    padding-bottom: clamp(2.5rem, 8vw, 4rem);
  }

  /* Containers */
  .mx-auto.max-w-3xl,
  .mx-auto.max-w-5xl,
  .max-w-prose {
    max-width: 100%;
  }

  /* Footer stacks cleanly */
  footer .grid,
  footer [class*="grid-cols"] {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }

  /* Floating widgets — avoid overlap on small screens */
  .fixed.bottom-5.right-5.z-\[95\],
  .fixed.bottom-5.left-5.z-\[90\] {
    bottom: max(1rem, env(safe-area-inset-bottom));
  }
  .fixed.bottom-5.right-5.z-\[95\] {
    right: max(0.75rem, env(safe-area-inset-right));
  }
  .fixed.bottom-5.left-5.z-\[90\] {
    left: max(0.75rem, env(safe-area-inset-left));
  }

  /* Hero / CTA buttons */
  .flex.flex-col.gap-3.sm\:flex-row {
    width: 100%;
  }
}

@media (max-width: 639px) {
  .home-hero-content .flex.flex-col.gap-3.sm\:flex-row {
    align-items: stretch;
    width: 100%;
  }
  .home-hero-content .flex.flex-col.gap-3.sm\:flex-row > a,
  .home-hero-content .flex.flex-col.gap-3.sm\:flex-row > button {
    width: 100%;
    justify-content: center;
  }

  /* Header logo + actions */
  .site-logo {
    max-height: 2.25rem;
  }

  /* Blog article layout */
  article.max-w-prose {
    padding-inline: 0.15rem;
  }

  /* Leadership cards full width */
  .leadership-spotlight {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .leadership-spotlight img,
  .leadership-spotlight span {
    margin-inline: auto;
  }
}
