/* Keep the existing design usable on narrow screens. */
html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-block: 1rem;
}

body.site-home,
body.site-page {
  min-width: 0;
  padding-inline: clamp(1rem, 3vw, 2rem);
}

body > section,
.site-home .CTA > *,
.site-page .grid > * {
  min-width: 0;
}

body > section {
  width: 100%;
}

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

.site-home .page-hero,
.site-page .page-hero {
  height: auto;
  padding-block: clamp(3rem, 8vw, 6rem);
}

.site-home .page-hero {
  min-height: 100vh;
  min-height: 100svh;
}

.site-page .page-hero {
  min-height: 50vh;
  min-height: 50svh;
  max-width: 80rem;
  margin-inline: auto;
}

.page-hero h1 {
  max-width: 100%;
  font-size: clamp(2.25rem, 6vw, 4.5rem);
  line-height: 1.15;
  text-wrap: balance;
}

.page-hero p,
section h2 {
  text-wrap: balance;
}

.site-home .hero-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  width: 100%;
}

.site-home .hero-actions > a,
.site-home .CTA a,
.site-page section > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  max-width: 100%;
  white-space: normal;
  line-height: 1.5;
}

.site-home .whatisleaf {
  width: 100%;
  max-width: 56rem;
}

.site-home .CTA {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 2.5rem;
}

.site-home .CTA .block-cta {
  min-width: 0;
}

/* Only the table scrolls, so its heading and surrounding text stay readable. */
.table-scroll {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  border-radius: 0.5rem;
  scrollbar-color: #3dd08a #18261f;
  scrollbar-width: auto;
}

.table-scroll table {
  margin-bottom: 0;
}

.table-scroll:focus-visible,
body a:focus-visible {
  outline: 2px solid #3dd08a;
  outline-offset: 4px;
}

.table-scroll::-webkit-scrollbar {
  height: 0.65rem;
}

.table-scroll::-webkit-scrollbar-track {
  background: #18261f;
  border-radius: 1rem;
}

.table-scroll::-webkit-scrollbar-thumb {
  background: #3dd08a;
  border: 2px solid #18261f;
  border-radius: 1rem;
}

body > footer {
  color: #9ca3af;
  font-size: 0.875rem;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.site-home footer a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
}

@media (max-width: 767px) {
  .site-home .CTA {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
    text-align: left;
  }

  .site-home .CTA .block-cta:first-child h2,
  .site-home .CTA .block-cta:first-child p {
    text-align: left;
  }

  .site-home .CTA .block-cta:first-child div {
    align-items: stretch;
  }

  .site-home .CTA .block-cta:last-child {
    width: 100%;
    border-left: 0;
    border-top: 1px solid rgba(61, 208, 138, 0.2);
    padding-top: 2rem;
    padding-left: 0;
  }

  .site-home .whatisleaf {
    margin-block: 3rem;
    padding: 1.5rem;
  }

  .site-home .CTA {
    padding: 1.5rem;
    margin-bottom: 3rem;
  }

  .site-home .glass:hover,
  .site-page .glass:hover {
    transform: none;
  }

  .site-page > section.grid {
    padding-inline: 0;
  }

  .site-page .glass {
    padding: 1.25rem;
  }

  .site-page section h2 {
    font-size: clamp(1.375rem, 5vw, 1.875rem);
    line-height: 1.35;
    overflow-wrap: anywhere;
  }

  .site-page section.glass p {
    font-size: 1rem;
    line-height: 1.65;
  }

  .table-scroll .data-table th,
  .table-scroll .data-table td {
    padding: 0.8rem;
    line-height: 1.5;
  }
}

@media (max-width: 639px) {
  .site-home .hero-actions {
    flex-direction: column;
    align-items: stretch;
    max-width: 24rem;
  }

  .site-home .hero-actions > a,
  .site-home .CTA a {
    width: 100%;
  }

  .site-home .page-hero {
    padding-block: 3rem;
  }
}

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

  .background-animation,
  .bubble,
  .neon-text,
  .fade-up {
    animation: none !important;
    transform: none;
    opacity: 1;
  }

  .bubble {
    display: none;
  }

  body *,
  body *::before,
  body *::after {
    transition: none !important;
  }
}
