/* =============================================
   MARA MELCHIORI — Supporto digitale
   Palette: Verde bosco, salvia, chiaro + grigio caldo
   Approccio: Mobile-first, minimal, elegante
   ============================================= */

/* ----- CUSTOM PROPERTIES ----- */
:root {
  --color-primary:    #1F3D2B;
  --color-secondary:  #7C9A87;
  --color-light:      #DCE8E2;
  --color-text:       #4A4A4A;
  --color-bg:         #F7F8F6;
  --color-white:      #ffffff;

  --font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-size-base:  1rem;      /* 16px */
  --font-size-sm:    0.875rem;  /* 14px */
  --font-size-lg:    1.125rem;  /* 18px */
  --font-size-xl:    1.5rem;    /* 24px */
  --font-size-2xl:   2rem;      /* 32px */
  --font-size-3xl:   2.5rem;    /* 40px */
  --font-size-hero:  2.75rem;   /* 44px */

  --radius:    12px;
  --radius-sm: 8px;

  --shadow-soft:  0 2px 16px rgba(31, 61, 43, 0.06);
  --shadow-card:  0 4px 24px rgba(31, 61, 43, 0.08);
  --shadow-hover: 0 8px 32px rgba(31, 61, 43, 0.12);

  --transition: 0.3s ease;
  --container-max: 1080px;
  --section-padding: 5rem 0;
}

/* ----- RESET & BASE ----- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.no-scroll {
  overflow: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

h1, h2, h3 {
  color: var(--color-primary);
  line-height: 1.25;
  font-weight: 700;
}

p + p {
  margin-top: 1rem;
}

strong {
  color: var(--color-primary);
}

/* ----- CONTAINER ----- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.25rem;
}


/* =============================================
   HEADER
   ============================================= */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background-color: rgba(247, 248, 246, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: box-shadow var(--transition), padding var(--transition);
}

.header--scrolled {
  box-shadow: 0 1px 12px rgba(31, 61, 43, 0.08);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  padding-bottom: 1rem;
  transition: padding var(--transition);
}

.header--scrolled .header__inner {
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
}

.header__brand {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.header__name {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: -0.01em;
}

.header__tagline {
  font-size: 0.7rem;
  color: var(--color-secondary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 500;
}

/* --- Nav desktop --- */
.header__menu {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.header__link {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text);
  position: relative;
  transition: color var(--transition);
}

.header__link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background-color: var(--color-secondary);
  border-radius: 1px;
  transition: width var(--transition);
}

.header__link:hover {
  color: var(--color-primary);
}

.header__link:hover::after {
  width: 100%;
}

.header__link--cta {
  background-color: var(--color-primary);
  color: var(--color-white) !important;
  padding: 0.5rem 1.25rem;
  border-radius: 50px;
  transition: background-color var(--transition), transform var(--transition);
}

.header__link--cta::after {
  display: none;
}

.header__link--cta:hover {
  background-color: var(--color-secondary);
  transform: translateY(-1px);
}

/* --- Hamburger --- */
.header__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 1001;
}

.header__toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--color-primary);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.header__toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.header__toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.header__toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}


/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: inline-block;
  font-family: var(--font-family);
  font-weight: 600;
  font-size: var(--font-size-base);
  text-align: center;
  border: none;
  cursor: pointer;
  border-radius: 50px;
  padding: 0.85rem 2rem;
  transition: background-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.btn--primary {
  background-color: var(--color-primary);
  color: var(--color-white);
  box-shadow: 0 4px 16px rgba(31, 61, 43, 0.18);
}

.btn--primary:hover {
  background-color: #2a5239;
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(31, 61, 43, 0.22);
}

.btn--large {
  font-size: var(--font-size-lg);
  padding: 1rem 2.5rem;
}


/* =============================================
   HERO
   ============================================= */
.hero {
  padding: 10rem 0 6rem;
  background-color: var(--color-light);
  text-align: center;
}

.hero__inner {
  max-width: 720px;
  margin: 0 auto;
}

.hero__title {
  font-size: var(--font-size-hero);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.15;
  margin-bottom: 1.25rem;
  color: var(--color-primary);
}

.hero__subtitle {
  font-size: var(--font-size-lg);
  color: var(--color-text);
  margin-bottom: 2.5rem;
  line-height: 1.7;
}


/* =============================================
   SEZIONE PROBLEMA
   ============================================= */
.problema {
  padding: 4.5rem 0;
  background-color: var(--color-bg);
}

.problema__inner {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.problema__text {
  font-size: var(--font-size-xl);
  color: var(--color-text);
  line-height: 1.6;
  margin-bottom: 0.35rem;
}

.problema__text--evidenza {
  color: var(--color-primary);
  font-weight: 700;
  margin-top: 0.75rem;
  font-size: 1.6rem;
}


/* =============================================
   SERVIZI (cards)
   ============================================= */
.servizi {
  padding: var(--section-padding);
  background-color: var(--color-white);
}

.section-title {
  text-align: center;
  font-size: var(--font-size-2xl);
  margin-bottom: 3rem;
  color: var(--color-primary);
}

.section-title--left {
  text-align: left;
}

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

.card {
  background-color: var(--color-bg);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow-soft);
  transition: transform var(--transition), box-shadow var(--transition);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.card__icon {
  width: 48px;
  height: 48px;
  margin-bottom: 1.25rem;
  color: var(--color-secondary);
}

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.card__head .card__icon {
  margin-bottom: 0;
  flex-shrink: 0;
}

.card__title {
  font-size: var(--font-size-lg);
  margin-bottom: 0.75rem;
  color: var(--color-primary);
}

.card__text {
  font-size: var(--font-size-base);
  color: var(--color-text);
  line-height: 1.7;
  text-align: justify;
}


/* =============================================
   METODO DI LAVORO (steps)
   ============================================= */
.metodo {
  padding: var(--section-padding);
  background-color: var(--color-light);
}

.metodo__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  max-width: 800px;
  margin: 0 auto;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.5rem;
}

.step__number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: var(--color-primary);
  color: var(--color-white);
  font-size: var(--font-size-lg);
  font-weight: 700;
  margin-bottom: 1rem;
  flex-shrink: 0;
}

.step__title {
  font-size: var(--font-size-lg);
  margin-bottom: 0.5rem;
  color: var(--color-primary);
}

.step__text {
  font-size: var(--font-size-base);
  color: var(--color-text);
  line-height: 1.7;
  max-width: 320px;
}


/* =============================================
   CHI SONO
   ============================================= */
.chi-sono {
  padding: var(--section-padding);
  background-color: var(--color-white);
}

.chi-sono__inner {
  max-width: 700px;
  margin: 0 auto;
}

.chi-sono__content {
  font-size: var(--font-size-base);
  line-height: 1.8;
  text-align: justify;
}

.chi-sono__content p + p {
  margin-top: 1.15rem;
}

.chi-sono__evidenza {
  position: relative;
  font-weight: 600;
  color: var(--color-primary);
  font-size: var(--font-size-lg);
  padding-left: 1.25rem;
  border-left: 3px solid var(--color-secondary);
  margin: 1.5rem 0;
}


/* =============================================
   ZONE SERVITE
   ============================================= */
.zone {
  padding: var(--section-padding);
  background-color: var(--color-light);
}

.zone__inner {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}

.zone__intro {
  font-size: var(--font-size-base);
  color: var(--color-text);
  line-height: 1.7;
  margin-bottom: 2rem;
}

.zone__list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.zone__chip {
  background-color: var(--color-white);
  color: var(--color-primary);
  font-weight: 600;
  padding: 0.6rem 1.35rem;
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
  transition: transform var(--transition), box-shadow var(--transition);
}

.zone__chip:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
}

.zone__chip--muted {
  background-color: transparent;
  color: var(--color-secondary);
  box-shadow: none;
  font-weight: 500;
  font-style: italic;
}

.zone__chip--muted:hover {
  transform: none;
  box-shadow: none;
}

.zone__remote {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-size: var(--font-size-base);
  color: var(--color-primary);
  background-color: var(--color-white);
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  line-height: 1.5;
  text-align: left;
}

.zone__remote svg {
  color: var(--color-secondary);
  flex-shrink: 0;
}


/* =============================================
   CTA FINALE
   ============================================= */
.cta-finale {
  padding: 5rem 0;
  background: linear-gradient(170deg, var(--color-light) 0%, var(--color-bg) 100%);
  text-align: center;
}

.cta-finale__inner {
  max-width: 560px;
  margin: 0 auto;
}

.cta-finale__title {
  font-size: var(--font-size-2xl);
  margin-bottom: 1rem;
  color: var(--color-primary);
}

.cta-finale__text {
  font-size: var(--font-size-base);
  color: var(--color-text);
  margin-bottom: 2rem;
  line-height: 1.7;
}


/* =============================================
   FOOTER
   ============================================= */
.footer {
  padding: 2.5rem 0;
  background-color: var(--color-primary);
  color: rgba(255, 255, 255, 0.75);
  text-align: center;
}

.footer__inner {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.footer__brand {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-white);
}

.footer__copy {
  font-size: 0.75rem;
}


/* =============================================
   ANIMAZIONI SCROLL (Intersection Observer)
   ============================================= */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Ritardo progressivo sulle card e gli step */
.servizi__grid .card:nth-child(2).animate-on-scroll,
.metodo__grid .step:nth-child(2).animate-on-scroll {
  transition-delay: 0.1s;
}

.servizi__grid .card:nth-child(3).animate-on-scroll,
.metodo__grid .step:nth-child(3).animate-on-scroll {
  transition-delay: 0.2s;
}

.servizi__grid .card:nth-child(4).animate-on-scroll,
.metodo__grid .step:nth-child(4).animate-on-scroll {
  transition-delay: 0.3s;
}

.zone__list .zone__chip:nth-child(2).animate-on-scroll { transition-delay: 0.08s; }
.zone__list .zone__chip:nth-child(3).animate-on-scroll { transition-delay: 0.16s; }
.zone__list .zone__chip:nth-child(4).animate-on-scroll { transition-delay: 0.24s; }
.zone__list .zone__chip:nth-child(5).animate-on-scroll { transition-delay: 0.32s; }


/* =============================================
   RESPONSIVE — Tablet (>=600px)
   ============================================= */
@media (min-width: 600px) {

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

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

  .step {
    padding: 2rem 1.25rem;
  }
}


/* =============================================
   RESPONSIVE — Desktop (>=900px)
   ============================================= */
@media (min-width: 900px) {

  :root {
    --font-size-hero: 3rem;
  }

  .container {
    padding: 0 2rem;
  }

  .hero {
    padding: 12rem 0 7rem;
  }

  .hero__subtitle {
    font-size: 1.2rem;
  }

  .problema {
    padding: 5.5rem 0;
  }

  .servizi__grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .metodo__grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .step {
    padding: 2rem 1rem;
  }

  .chi-sono__content {
    font-size: var(--font-size-lg);
  }
}


/* =============================================
   RESPONSIVE — Mobile (<=599px) — Menu
   ============================================= */
@media (max-width: 599px) {

  .header__toggle {
    display: flex;
  }

  .header__nav {
    position: fixed;
    top: 0;
    right: 0;
    width: 75%;
    max-width: 320px;
    height: 100vh;
    height: 100dvh;
    background-color: var(--color-bg);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateX(100%);
    transition: transform 0.35s ease;
    z-index: 999;
  }

  .header__nav--open {
    transform: translateX(0);
  }

  .header__menu {
    flex-direction: column;
    gap: 2rem;
  }

  .header__link {
    font-size: var(--font-size-lg);
  }

  .header__link--cta {
    margin-top: 0.5rem;
  }

  /* Overlay */
  .header__nav--open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background-color: rgba(0, 0, 0, 0.25);
    z-index: -1;
  }
}


/* =============================================
   REDUCED MOTION
   ============================================= */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }

  .animate-on-scroll {
    opacity: 1;
    transform: none;
  }
}
