/* Mobile-first overrides and SEO-friendly defaults */
:root {
  --karma-font-sans:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, Arial, sans-serif;
  --karma-font-heading: var(--karma-font-sans);
  --karma-font-body: var(--karma-font-sans);
  --karma-mobile-gutter: clamp(1rem, 4vw, 1.5rem);
  --karma-mobile-section-y: clamp(3.5rem, 12vw, 5rem);
  --karma-mobile-section-y-lg: clamp(4.5rem, 16vw, 6rem);
  --karma-text-xs: clamp(0.75rem, 0.72rem + 0.12vw, 0.8125rem);
  --karma-text-sm: clamp(0.875rem, 0.84rem + 0.15vw, 0.9375rem);
  --karma-text-base: clamp(1rem, 0.96rem + 0.18vw, 1.0625rem);
  --karma-text-lg: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
  --karma-text-xl: clamp(1.25rem, 1.14rem + 0.48vw, 1.5rem);
  --karma-text-2xl: clamp(1.5rem, 1.32rem + 0.72vw, 1.875rem);
  --karma-text-3xl: clamp(1.875rem, 1.58rem + 1.15vw, 2.5rem);
  --karma-text-4xl: clamp(2.25rem, 1.88rem + 1.45vw, 3rem);
  --karma-text-5xl: clamp(2.75rem, 2.15rem + 2.25vw, 4rem);
  --karma-text-6xl: clamp(3rem, 2.35rem + 2.6vw, 4.5rem);
  --karma-text-7xl: clamp(3.25rem, 2.45rem + 3vw, 5rem);
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-family: var(--karma-font-body);
}

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

/* Prevent horizontal overflow on small screens */
body {
  overflow-x: hidden;
  font-family: var(--karma-font-body);
  font-size: var(--karma-text-base);
  font-weight: 400 !important;
  line-height: 1.6;
  letter-spacing: 0.01em;
}

body * {
  font-weight: 400 !important;
}

.wix-verticals-container,
.font-theme-heading,
.font-heading,
.font-julius-sans-one,
.font-paragraph,
.font-josefin-slab,
.prose-p\:font-paragraph
  :is(:where(p):not(:where([class~="not-prose"], [class~="not-prose"] *))) {
  font-family: var(--karma-font-body) !important;
}

.font-theme-heading,
.font-heading,
.font-julius-sans-one,
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--karma-font-heading) !important;
  font-weight: 600 !important;
  letter-spacing: 0.01em;
}

.font-medium {
  font-weight: 500 !important;
}

.font-semibold,
.font-bold,
strong,
b {
  font-weight: 600 !important;
}

.text-xs {
  font-size: var(--karma-text-xs) !important;
  line-height: 1.35 !important;
}

.text-sm {
  font-size: var(--karma-text-sm) !important;
  line-height: 1.45 !important;
}

.text-base {
  font-size: var(--karma-text-base) !important;
  line-height: 1.6 !important;
}

.text-lg {
  font-size: var(--karma-text-lg) !important;
  line-height: 1.6 !important;
}

.text-xl {
  font-size: var(--karma-text-xl) !important;
  line-height: 1.45 !important;
}

.text-2xl {
  font-size: var(--karma-text-2xl) !important;
  line-height: 1.32 !important;
}

.text-3xl {
  font-size: var(--karma-text-3xl) !important;
  line-height: 1.2 !important;
}

.text-4xl {
  font-size: var(--karma-text-4xl) !important;
  line-height: 1.14 !important;
}

.text-5xl {
  font-size: var(--karma-text-5xl) !important;
  line-height: 1.08 !important;
}

.text-6xl {
  font-size: var(--karma-text-6xl) !important;
  line-height: 1.06 !important;
}

.text-7xl {
  font-size: var(--karma-text-7xl) !important;
  line-height: 1.04 !important;
}

.prose,
.prose-lg,
.md\:prose-xl {
  font-family: var(--karma-font-body) !important;
  font-size: var(--karma-text-base) !important;
  line-height: 1.75 !important;
}

/* Polished homepage composition fixes */
header > div {
  padding-top: 0.875rem !important;
  padding-bottom: 0.875rem !important;
}

header > div > div {
  align-items: center !important;
}

header a[href="/"] {
  display: inline-flex;
  align-items: center;
  max-width: 14rem;
  min-height: 3rem;
  line-height: 1.08 !important;
}

header button[aria-pressed] {
  min-height: 2rem;
  border-bottom: 1px solid transparent;
  border-radius: 0 !important;
  background: transparent !important;
  color: rgb(74 90 86 / 0.78) !important;
}

header button[aria-pressed="true"] {
  border-bottom-color: currentColor;
  color: rgb(74 90 86 / 1) !important;
}

header + section[class*="min-h-[100svh]"],
.karma-hero-refined {
  align-items: center !important;
  padding-top: clamp(8.5rem, 17vh, 11rem) !important;
  padding-bottom: clamp(4rem, 8vh, 5.5rem) !important;
}

header + section:not([class*="min-h-[100svh]"]) {
  padding-top: 150px !important;
}

header + main > section:first-child {
  padding-top: 150px !important;
}

header + section[class*="min-h-[100svh]"] > .relative.z-10,
.karma-hero-refined > .relative.z-10 {
  align-items: flex-start !important;
  text-align: left !important;
}

header + section[class*="min-h-[100svh]"] .max-w-5xl,
.karma-hero-refined .max-w-5xl {
  max-width: 48rem !important;
  margin-bottom: 0 !important;
  margin-left: 0 !important;
}

header + section[class*="min-h-[100svh]"] .max-w-5xl > h1,
.karma-hero-refined .max-w-5xl > h1 {
  display: inline-flex;
  width: auto;
  margin-bottom: 1.25rem !important;
  padding: 0.45rem 0.85rem;
  border: 1px solid rgba(248, 248, 255, 0.42);
  border-radius: 999px;
  background: rgba(74, 90, 86, 0.32);
  font-size: clamp(0.82rem, 0.72rem + 0.35vw, 1rem) !important;
  line-height: 1.2 !important;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

header + section[class*="min-h-[100svh]"] .max-w-5xl > .mb-12.rounded-lg,
.karma-hero-refined .max-w-5xl > .mb-12.rounded-lg {
  display: none !important;
}

header + section[class*="min-h-[100svh]"] .max-w-5xl > h2,
.karma-hero-refined .max-w-5xl > h2 {
  max-width: 13ch;
  margin-right: 0;
  margin-bottom: 1.25rem !important;
  margin-left: 0;
}

header + section[class*="min-h-[100svh]"] .max-w-5xl > p,
.karma-hero-refined .max-w-5xl > p {
  max-width: 42rem !important;
  margin-top: 1.25rem;
  margin-right: 0 !important;
  margin-left: 0 !important;
  padding: 1rem 1.25rem;
  border: 1px solid rgba(248, 248, 255, 0.2);
  border-radius: 0.75rem;
  background: rgba(30, 35, 32, 0.62);
  backdrop-filter: blur(8px);
  font-size: var(--karma-text-base) !important;
  font-weight: 500 !important;
}

header + section[class*="min-h-[100svh]"] .flex.flex-col.items-center.mb-8,
.karma-hero-refined .flex.flex-col.items-center.mb-8 {
  align-items: flex-start !important;
  margin-bottom: 1rem !important;
}

header + section[class*="min-h-[100svh]"] .flex.flex-col.items-center.gap-4,
.karma-hero-refined .flex.flex-col.items-center.gap-4 {
  align-items: flex-start !important;
  max-width: 22rem !important;
}

header + section[class*="min-h-[100svh]"] a[href="#services"],
.karma-hero-refined a[href="#services"] {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
}

header + section[class*="min-h-[100svh]"] a[href="#services"]::after,
.karma-hero-refined a[href="#services"]::after {
  content: "↓";
  font-size: 1.05em;
  line-height: 1;
}

header + section[class*="min-h-[100svh]"] .absolute.bottom-12,
.karma-hero-refined .absolute.bottom-12 {
  bottom: 1.5rem !important;
}

#about-us > div {
  padding-top: clamp(4rem, 8vw, 6rem) !important;
  padding-bottom: clamp(3rem, 6vw, 4.5rem) !important;
}

#about-us .grid {
  gap: clamp(2rem, 5vw, 4rem) !important;
}

#about-us h2 br {
  display: none;
}

#about-us h2 span.italic {
  color: inherit !important;
  font-style: normal !important;
}

#about-us blockquote {
  border-left: 3px solid #7a5c42 !important;
  font-style: normal !important;
  padding-left: 1rem !important;
}

#services {
  padding-top: clamp(3.5rem, 7vw, 5rem) !important;
  padding-bottom: clamp(3.5rem, 7vw, 5rem) !important;
}

#services .flex.flex-col.gap-24 {
  gap: clamp(4rem, 8vw, 6rem) !important;
}

#services h3 {
  color: #3d4f47 !important;
}

#services ul {
  border-left: 2px solid rgba(122, 92, 66, 0.45) !important;
  list-style: disc !important;
}

#services .absolute.top-4.left-4.w-8.h-8,
#services .absolute.bottom-4.right-4.w-8.h-8 {
  display: none !important;
}

#approach .rounded-full img {
  display: none !important;
}

#approach .rounded-full {
  position: relative;
  display: grid;
  place-items: center;
  background:
    radial-gradient(
      circle at 35% 30%,
      rgba(255, 255, 255, 0.78),
      transparent 42%
    ),
    linear-gradient(135deg, #9db4a8, #d9e8e3) !important;
}

#approach .rounded-full::before {
  width: 46%;
  height: 46%;
  border: 1px solid rgba(74, 90, 86, 0.38);
  border-radius: 999px;
  background: rgba(248, 248, 255, 0.5);
  content: "";
}

#approach p.uppercase {
  max-width: 18rem;
  text-transform: none !important;
  text-wrap: balance;
  letter-spacing: 0.04em !important;
}

#approach {
  padding-top: clamp(3.5rem, 7vw, 5rem) !important;
  padding-bottom: clamp(3.5rem, 7vw, 5rem) !important;
}

#approach .grid {
  align-items: stretch;
}

#approach .grid > div {
  min-height: 100%;
}

#pubblico .grid {
  background: transparent !important;
}

#pubblico .group > .mt-1 {
  display: none !important;
}

#pubblico .group {
  gap: 0 !important;
}

section:has(.bg-gradient-to-br.from-warm-cream\/90) p {
  font-size: var(--karma-text-lg) !important;
}

section:has(.bg-gradient-to-br.from-warm-cream\/90) h2 {
  font-size: var(--karma-text-4xl) !important;
}

body > div section:nth-last-of-type(1),
body > div section:nth-last-of-type(2) {
  padding-top: clamp(3.5rem, 7vw, 5rem) !important;
  padding-bottom: clamp(3.5rem, 7vw, 5rem) !important;
}

footer p {
  overflow-wrap: normal;
}

footer a[href*="linkedin.com"] {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid rgba(47, 58, 53, 0.14);
  border-radius: 999px;
}

.karma-social-label {
  font-size: var(--karma-text-sm);
  line-height: 1.3;
}

.karma-footer-social-note {
  max-width: 13rem;
  margin: 0.75rem auto 0;
  color: rgb(74 90 86 / 0.62);
  font-size: var(--karma-text-sm);
  line-height: 1.45;
}

.karma-footer-legal {
  flex-basis: 100%;
  padding-top: 0.25rem;
}

footer a[href^="tel:"],
footer a[href*="wa.me"] {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.karma-header-refined button.karma-language-button {
  border-bottom: 1px solid transparent !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: rgb(74 90 86 / 0.72) !important;
}

.karma-header-refined button.karma-language-button[aria-pressed="true"] {
  border-bottom-color: #4a5a56 !important;
  color: #4a5a56 !important;
}

.karma-hero-refined {
  align-items: flex-start !important;
  min-height: 100svh !important;
  padding-top: clamp(11rem, 20vh, 13rem) !important;
  padding-bottom: clamp(3rem, 7vh, 5rem) !important;
}

.karma-hero-refined::before {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    90deg,
    rgba(24, 30, 27, 0.78) 0%,
    rgba(24, 30, 27, 0.58) 46%,
    rgba(24, 30, 27, 0.28) 100%
  ) !important;
  content: "";
  pointer-events: none;
}

.karma-hero-content {
  align-items: flex-start !important;
  justify-content: flex-start !important;
  text-align: left !important;
}

.karma-hero-refined .text-center {
  text-align: left !important;
}

.karma-hero-content > div,
.karma-hero-content .max-w-5xl {
  max-width: 48rem !important;
  margin-right: 0 !important;
  margin-left: 0 !important;
  text-align: left !important;
}

.karma-hero-kicker {
  position: relative !important;
  z-index: 2;
  margin-top: 0 !important;
  margin-bottom: 1rem !important;
  transform: none !important;
}

.karma-hero-headline {
  max-width: 13ch !important;
  margin-right: 0 !important;
  margin-left: 0 !important;
  text-align: left !important;
}

.karma-hero-description {
  max-width: 42rem !important;
  margin-right: 0 !important;
  margin-left: 0 !important;
  background: rgba(24, 30, 27, 0.72) !important;
  color: #fff !important;
  text-align: left !important;
}

.karma-scroll-link {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.45rem !important;
}

.karma-scroll-arrow,
.karma-cta-arrow {
  display: inline-flex;
  margin-left: 0.45rem;
  line-height: 1;
}

.karma-remove-corner {
  display: none !important;
}

.karma-about-refined {
  margin-bottom: 0 !important;
}

.karma-about-refined > div {
  padding-bottom: clamp(2rem, 5vw, 3.5rem) !important;
}

.karma-about-refined h2 span {
  color: inherit !important;
  font-family: var(--karma-font-heading) !important;
  font-style: normal !important;
}

.karma-about-refined blockquote {
  border-left: 4px solid #7a5c42 !important;
  background: rgba(122, 92, 66, 0.06);
}

.karma-services-refined {
  padding-top: clamp(2.5rem, 5vw, 3.75rem) !important;
  padding-bottom: clamp(2.75rem, 5vw, 4rem) !important;
}

.karma-service-stack {
  gap: clamp(2.25rem, 5vw, 3.5rem) !important;
}

.karma-service-stack > div {
  gap: clamp(2rem, 4vw, 3rem) !important;
}

.karma-approach-refined {
  padding-top: clamp(2.5rem, 5vw, 3.75rem) !important;
  padding-bottom: clamp(2.75rem, 5vw, 4rem) !important;
}

.karma-approach-refined .grid {
  align-items: stretch !important;
}

.karma-approach-refined .grid > div {
  height: 100% !important;
}

.karma-value-icon img {
  display: none !important;
}

.karma-value-icon {
  display: grid !important;
  place-items: center !important;
  border: 1px solid rgba(122, 92, 66, 0.3) !important;
  background:
    radial-gradient(
      circle at 35% 30%,
      rgba(255, 255, 255, 0.82),
      transparent 42%
    ),
    linear-gradient(135deg, #9db4a8, #d9e8e3) !important;
}

.karma-value-icon::before {
  width: 42%;
  height: 42%;
  border: 1px solid rgba(74, 90, 86, 0.35);
  border-radius: 999px;
  background: rgba(248, 248, 255, 0.55);
  content: "";
}

.karma-value-motto {
  min-height: 0;
  text-transform: none !important;
  letter-spacing: 0.035em !important;
}

.karma-audience-refined {
  padding-top: clamp(2.5rem, 5vw, 3.75rem) !important;
  padding-bottom: clamp(2.75rem, 5vw, 4rem) !important;
}

.karma-audience-refined .group > .mt-1 {
  display: none !important;
}

.karma-audience-refined .karma-audience-last {
  grid-column: auto;
  max-width: none;
  justify-self: stretch;
}

.karma-audience-refined .grid {
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)) !important;
  column-gap: clamp(1.5rem, 2.6vw, 2.75rem) !important;
}

section:has(.bg-gradient-to-br.from-warm-cream\/90) {
  min-height: auto !important;
  padding-top: clamp(3rem, 6vw, 5rem) !important;
  padding-bottom: clamp(3rem, 6vw, 5rem) !important;
}

section:has(.bg-gradient-to-br.from-warm-cream\/90) > .relative.z-10 {
  max-width: 56rem !important;
}

section:has(.bg-gradient-to-br.from-warm-cream\/90) .bg-gradient-to-br {
  padding: clamp(2rem, 5vw, 4rem) !important;
}

section:has(.bg-gradient-to-br.from-warm-cream\/90) p {
  max-width: 42rem !important;
  border-top-width: 1px !important;
  border-bottom-width: 0 !important;
  font-size: var(--karma-text-lg) !important;
  line-height: 1.65 !important;
  font-weight: 400 !important;
}

section:has(.bg-gradient-to-br.from-warm-cream\/90) h2 {
  font-size: var(--karma-text-4xl) !important;
  line-height: 1.12 !important;
}

body > div > section:last-of-type {
  padding-top: clamp(3.5rem, 7vw, 5rem) !important;
  padding-bottom: clamp(3.5rem, 7vw, 5rem) !important;
}

.karma-footer-refined .karma-footer-social-note {
  display: none !important;
}

.karma-footer-refined .karma-footer-legal:first-of-type {
  margin-left: 1.25rem;
}

.karma-footer-refined .karma-footer-legal {
  opacity: 0.78;
}

.karma-footer-refined h3 + p {
  min-width: min(24rem, 100%);
  text-wrap: balance;
}

.karma-footer-refined a[href*="wa.me"],
.karma-footer-refined a[href^="tel:"] {
  white-space: nowrap;
}

.karma-footer-refined .grid {
  align-items: start;
}

/* Visible focus for keyboard users */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #9db4a8;
  outline-offset: 2px;
}

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

/* Touch targets (min 44px) for primary mobile nav */
@media (max-width: 767px) {
  header + section {
    align-items: flex-start !important;
    padding-top: clamp(8.25rem, 22svh, 9.5rem) !important;
  }

  header + section .max-w-5xl > h2 {
    max-width: 11ch;
  }

  header + section .max-w-5xl > p {
    padding: 0.85rem 1rem;
  }

  header + section > .relative.z-10 {
    padding-right: var(--karma-mobile-gutter) !important;
    padding-left: var(--karma-mobile-gutter) !important;
  }

  header + section .absolute.bottom-12 {
    display: none !important;
  }

  header nav a,
  header button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .max-w-\[100rem\],
  .max-w-\[120rem\] {
    width: 100%;
  }

  .px-6,
  .px-8,
  .px-10 {
    padding-left: var(--karma-mobile-gutter) !important;
    padding-right: var(--karma-mobile-gutter) !important;
  }

  .py-16,
  .py-20,
  .py-24,
  .py-32 {
    padding-top: var(--karma-mobile-section-y) !important;
    padding-bottom: var(--karma-mobile-section-y) !important;
  }

  .pt-20,
  .pt-24,
  .pt-32 {
    padding-top: var(--karma-mobile-section-y-lg) !important;
  }

  .pb-16 {
    padding-bottom: var(--karma-mobile-section-y) !important;
  }

  .gap-12,
  .gap-16,
  .gap-24 {
    gap: clamp(1.75rem, 7vw, 2.5rem) !important;
  }

  .space-y-12 > :not([hidden]) ~ :not([hidden]),
  .space-y-24 > :not([hidden]) ~ :not([hidden]) {
    margin-top: clamp(2rem, 8vw, 3rem) !important;
  }

  .mb-12,
  .mb-16 {
    margin-bottom: clamp(2.25rem, 9vw, 3.5rem) !important;
  }

  .h-screen {
    height: auto !important;
    min-height: 100svh !important;
  }

  .min-h-screen {
    min-height: 100svh !important;
  }

  .h-\[50vh\],
  .h-\[400px\] {
    height: clamp(16rem, 70vw, 22rem) !important;
  }

  .h-\[80vh\],
  .h-\[90vh\] {
    height: auto !important;
    min-height: clamp(30rem, 92svh, 42rem) !important;
  }

  .min-h-\[400px\] {
    min-height: clamp(16rem, 70vw, 22rem) !important;
  }

  .min-h-\[600px\],
  .min-h-\[700px\] {
    min-height: clamp(30rem, 92svh, 42rem) !important;
  }

  .min-h-\[85svh\],
  .min-h-\[100svh\] {
    min-height: 100svh !important;
  }

  header + section:not([class*="min-h-[100svh]"]),
  header + main > section:first-child {
    padding-top: 150px !important;
  }

  .karma-hero-refined {
    padding-top: clamp(10rem, 28svh, 12rem) !important;
  }

  .karma-audience-refined .grid {
    grid-template-columns: 1fr !important;
  }

  .text-center {
    text-wrap: balance;
  }

  .text-justify {
    text-align: start !important;
  }
}

@media (min-width: 1024px) {
  #pubblico .grid {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  }

  footer .grid {
    grid-template-columns: minmax(16rem, 1.1fr) minmax(16rem, 1fr) minmax(
        14rem,
        0.8fr
      ) !important;
  }
}

@media (min-width: 640px) {
  .sm\:text-4xl {
    font-size: var(--karma-text-4xl) !important;
    line-height: 1.14 !important;
  }
}

@media (min-width: 768px) {
  .md\:text-sm {
    font-size: var(--karma-text-sm) !important;
    line-height: 1.45 !important;
  }

  .md\:text-lg {
    font-size: var(--karma-text-lg) !important;
    line-height: 1.6 !important;
  }

  .md\:text-xl {
    font-size: var(--karma-text-xl) !important;
    line-height: 1.45 !important;
  }

  .md\:text-2xl {
    font-size: var(--karma-text-2xl) !important;
    line-height: 1.32 !important;
  }

  .md\:text-3xl {
    font-size: var(--karma-text-3xl) !important;
    line-height: 1.2 !important;
  }

  .md\:text-4xl {
    font-size: var(--karma-text-4xl) !important;
    line-height: 1.14 !important;
  }

  .md\:text-5xl {
    font-size: var(--karma-text-5xl) !important;
    line-height: 1.08 !important;
  }

  .md\:text-6xl {
    font-size: var(--karma-text-6xl) !important;
    line-height: 1.06 !important;
  }

  .md\:text-7xl {
    font-size: var(--karma-text-7xl) !important;
    line-height: 1.04 !important;
  }
}

@media (min-width: 1024px) {
  .lg\:text-3xl {
    font-size: var(--karma-text-3xl) !important;
    line-height: 1.2 !important;
  }

  .lg\:text-5xl {
    font-size: var(--karma-text-5xl) !important;
    line-height: 1.08 !important;
  }

  .lg\:text-6xl {
    font-size: var(--karma-text-6xl) !important;
    line-height: 1.06 !important;
  }

  .lg\:text-7xl {
    font-size: var(--karma-text-7xl) !important;
    line-height: 1.04 !important;
  }
}

.karma-page-header-offset {
  padding-top: 150px !important;
}
