/* =========================================================================
   ERA Soc. Coop. — Environment, Research and Application
   Foglio di stile principale
   ========================================================================= */

/* ===== Font auto-ospitati (nessuna richiesta esterna a Google) ===== */
@font-face{font-family:'Inter';font-style:normal;font-weight:100 900;font-display:swap;src:url(../fonts/inter.woff2) format('woff2');}
@font-face{font-family:'Sora';font-style:normal;font-weight:100 900;font-display:swap;src:url(../fonts/sora.woff2) format('woff2');}

/* ---------- Design tokens ---------- */
:root {
  /* Brand */
  --green:        #037f40;
  --green-600:    #04713a;
  --green-700:    #02602f;
  --green-800:    #044f28;
  --green-050:    #eef6f0;

  /* Earth / neutral */
  --ink:          #14231b;
  --slate:        #46574e;
  --slate-light:  #6d7d74;
  --stone-050:    #f7f9f6;
  --stone-100:    #eef1ec;
  --stone-200:    #e2e7de;
  --line:         #dbe1d9;
  --white:        #ffffff;
  --earth:        #9a7b3f;   /* subtle ornamental accent */

  /* Typography */
  --font-body:  "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-head:  "Sora", var(--font-body);

  /* Metrics */
  --container: 1200px;
  --radius:    14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 3px rgba(20, 35, 27, .07), 0 1px 2px rgba(20, 35, 27, .05);
  --shadow-md: 0 10px 30px -12px rgba(20, 35, 27, .28);
  --shadow-lg: 0 24px 60px -20px rgba(20, 35, 27, .38);
  --header-h:  76px;
  --ease:      cubic-bezier(.22, .61, .36, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--white);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
ul { list-style: none; padding: 0; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.12; font-weight: 700; letter-spacing: -.02em; }
:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; border-radius: 3px; }

/* ---------- Layout helpers ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 24px; }
.section { padding: clamp(56px, 8vw, 108px) 0; }
.section--tint { background: var(--stone-050); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-head); font-weight: 600; font-size: .82rem;
  letter-spacing: .16em; text-transform: uppercase; color: var(--green-700);
}
.eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--green); border-radius: 2px; }
.section-head { max-width: 720px; margin-bottom: clamp(34px, 5vw, 56px); }
.section-head h2 { font-size: clamp(2rem, 4vw, 3rem); margin: 16px 0 0; }
.section-head p { margin-top: 18px; color: var(--slate); font-size: 1.08rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-head); font-weight: 600; font-size: .98rem;
  padding: 14px 26px; border-radius: 999px; transition: all .25s var(--ease);
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; transition: transform .25s var(--ease); }
.btn:hover svg { transform: translateX(3px); }
.btn--primary { background: var(--green); color: #fff; box-shadow: 0 8px 20px -8px rgba(3,127,64,.6); }
.btn--primary:hover { background: var(--green-700); transform: translateY(-2px); box-shadow: 0 12px 26px -8px rgba(3,127,64,.65); }
.btn--outline { border: 1.5px solid var(--line); color: var(--ink); background: #fff; }
.btn--outline:hover { border-color: var(--green); color: var(--green-700); }

/* =========================================================================
   Header
   ========================================================================= */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--header-h);
  display: flex; align-items: center;
  transition: background .35s var(--ease), box-shadow .35s var(--ease), border-color .35s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand__logo { height: 34px; width: auto; transition: filter .35s var(--ease); }
.brand__tag {
  font-family: var(--font-head); font-size: .62rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; line-height: 1.25;
  color: var(--slate-light); border-left: 1px solid var(--line); padding-left: 12px;
  transition: color .35s var(--ease), border-color .35s var(--ease);
}

.nav { display: flex; align-items: center; gap: 6px; }
.nav a {
  font-family: var(--font-head); font-weight: 500; font-size: .96rem;
  padding: 10px 15px; border-radius: 999px; color: var(--ink);
  white-space: nowrap; transition: background .2s, color .2s;
}
.nav a:hover { background: var(--stone-100); color: var(--green-700); }
.nav a.is-active { color: var(--green-700); }

/* Header on transparent hero (top of home) */
.site-header[data-transparent="true"] {
  background: linear-gradient(to bottom, rgba(10,22,15,.55), rgba(10,22,15,0));
}
.site-header[data-transparent="true"] .brand__logo { filter: brightness(0) invert(1); }
.site-header[data-transparent="true"] .brand__tag { color: rgba(255,255,255,.8); border-color: rgba(255,255,255,.3); }
.site-header[data-transparent="true"] .nav a { color: #fff; }
.site-header[data-transparent="true"] .nav a:hover { background: rgba(255,255,255,.14); color: #fff; }
.site-header[data-transparent="true"] .nav__toggle span { background: #fff; }

/* Scrolled / solid */
.site-header.is-solid {
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(1.4) blur(10px);
  box-shadow: var(--shadow-sm); border-bottom-color: var(--line);
}
.site-header.is-solid .brand__logo { filter: none; }
.site-header.is-solid .brand__tag { color: var(--slate-light); border-color: var(--line); }
.site-header.is-solid .nav a { color: var(--ink); }
.site-header.is-solid .nav a:hover { background: var(--stone-100); color: var(--green-700); }
.site-header.is-solid .nav a.is-active { color: var(--green-700); }
.site-header.is-solid .nav__toggle span { background: var(--ink); }

/* Mobile nav toggle */
.nav__toggle { display: none; width: 44px; height: 44px; flex-direction: column; justify-content: center; align-items: center; gap: 5px; border-radius: 10px; }
.nav__toggle span { width: 24px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .3s var(--ease), opacity .2s; }
body.nav-open .nav__toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.nav-open .nav__toggle span:nth-child(2) { opacity: 0; }
body.nav-open .nav__toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =========================================================================
   Hero / carousel
   ========================================================================= */
.hero { position: relative; height: 100svh; min-height: 620px; max-height: 960px; overflow: hidden; background: var(--ink); }
.hero__slides { position: absolute; inset: 0; }
.hero__slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.2s var(--ease); }
.hero__slide.is-active { opacity: 1; }
.hero__slide img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); }
.hero__slide.is-active img { animation: kenburns 7s ease-out forwards; }
@keyframes kenburns { from { transform: scale(1.06); } to { transform: scale(1.16); } }
.hero__overlay {
  position: absolute; inset: 0;
  background:
    linear-gradient(to top, rgba(8,18,12,.82) 0%, rgba(8,18,12,.30) 42%, rgba(8,18,12,.42) 100%),
    linear-gradient(to right, rgba(8,18,12,.55), rgba(8,18,12,.05));
}

.hero__content { position: relative; z-index: 2; height: 100%; display: flex; align-items: center; }
.hero__content .container { width: 100%; }
.hero__inner { max-width: 880px; color: #fff; padding-top: var(--header-h); }
.hero__title {
  font-size: clamp(2.4rem, 6vw, 4.7rem); font-weight: 800; letter-spacing: -.03em;
  text-shadow: 0 2px 30px rgba(0,0,0,.35);
}
.hero__title .sep { color: var(--green); font-weight: 400; padding: 0 .12em; }

/* Carousel controls */
.hero__arrows { position: absolute; z-index: 3; bottom: 40px; right: max(24px, calc((100vw - var(--container)) / 2 + 24px)); display: flex; gap: 12px; }
.hero__arrow {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.35);
  color: #fff; backdrop-filter: blur(4px); transition: background .2s, transform .2s;
}
.hero__arrow:hover { background: rgba(255,255,255,.25); transform: scale(1.06); }
.hero__arrow svg { width: 22px; height: 22px; }

.hero__dots { position: absolute; z-index: 3; bottom: 40px; left: max(24px, calc((100vw - var(--container)) / 2 + 24px)); display: flex; flex-wrap: wrap; gap: 8px; max-width: min(60vw, 620px); }
.hero__dot { width: 18px; height: 4px; border-radius: 4px; background: rgba(255,255,255,.35); transition: background .3s, width .3s; overflow: hidden; }
.hero__dot.is-active { width: 26px; }
.hero__dot.is-active { background: rgba(255,255,255,.9); }

/* =========================================================================
   Intro strip
   ========================================================================= */
.intro__grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(32px, 6vw, 84px); align-items: center; }
.intro__text h2 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); margin: 16px 0 20px; }
.intro__text p { color: var(--slate); margin-bottom: 16px; }
.intro__stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 24px; box-shadow: var(--shadow-sm); }
.stat__num { font-family: var(--font-head); font-weight: 800; font-size: 2.5rem; color: var(--green-700); letter-spacing: -.03em; line-height: 1; }
.stat__label { margin-top: 10px; color: var(--slate); font-size: .96rem; }

/* =========================================================================
   Services
   ========================================================================= */
.services__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.service {
  position: relative; display: flex; flex-direction: column;
  border-radius: var(--radius); background: var(--green-800); color: #fff; border: 1px solid transparent;
  box-shadow: var(--shadow-md); transition: transform .3s var(--ease), box-shadow .3s var(--ease), background .3s;
}
.service:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); background: var(--green-700); }
.service__body { padding: 30px 28px 32px; display: flex; flex-direction: column; flex: 1; }
.service__title { font-size: 1.18rem; font-weight: 700; line-height: 1.26; color: #fff; }
.service__title::before {
  content: ""; display: block; width: 34px; height: 3px; margin-bottom: 18px;
  background: #7fd6a4; border-radius: 2px; transition: width .3s var(--ease);
}
.service:hover .service__title::before { width: 56px; }
.service__desc { margin-top: 14px; color: rgba(255,255,255,.82); font-size: .97rem; flex: 1; }

/* Full-bleed CTA band */
.cta-band { position: relative; overflow: hidden; background: var(--green-800); color: #fff; }
.cta-band::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(1200px 400px at 80% -10%, rgba(255,255,255,.10), transparent 60%);
}
.cta-band .container { position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 28px; padding-block: clamp(48px, 7vw, 80px); }
.cta-band h2 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); max-width: 640px; }
.cta-band p { margin-top: 14px; color: rgba(255,255,255,.82); max-width: 560px; }
.cta-band .btn--primary { background: #fff; color: var(--green-800); box-shadow: none; }
.cta-band .btn--primary:hover { background: var(--stone-100); transform: translateY(-2px); }

/* =========================================================================
   Page hero (interne)
   ========================================================================= */
.page-hero { position: relative; padding: calc(var(--header-h) + 64px) 0 64px; background: var(--green-800); color: #fff; overflow: hidden; }
.page-hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(1000px 420px at 85% -20%, rgba(255,255,255,.12), transparent 60%); }
.page-hero .container { position: relative; z-index: 1; }
.page-hero .eyebrow { color: #bff0d3; }
.page-hero .eyebrow::before { background: #bff0d3; }
.page-hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); margin-top: 16px; font-weight: 800; }
.page-hero p { margin-top: 18px; max-width: 660px; color: rgba(255,255,255,.85); font-size: 1.1rem; }
.breadcrumb { display: flex; gap: 8px; font-size: .86rem; color: rgba(255,255,255,.7); font-family: var(--font-head); }
.breadcrumb a:hover { color: #fff; }

/* =========================================================================
   Team (struttura tecnica)
   ========================================================================= */
.team-group + .team-group { margin-top: 56px; }
.team-group__title { font-size: 1.35rem; display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.team-group__title .tag { font-family: var(--font-head); font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--green-700); background: var(--green-050); border: 1px solid #cfe6d8; padding: 4px 10px; border-radius: 999px; }
.team-group__sub { color: var(--slate); margin-bottom: 26px; max-width: 760px; }
.team-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.person { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-sm); transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.person:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.person__avatar { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--green), var(--green-700)); color: #fff; font-family: var(--font-head); font-weight: 700; font-size: 1.2rem; margin-bottom: 18px; }
.person__name { font-family: var(--font-head); font-weight: 700; font-size: 1.16rem; }
.person__role { color: var(--green-700); font-weight: 600; font-size: .9rem; margin-top: 4px; font-family: var(--font-head); }
.person__rel { color: var(--slate-light); font-size: .84rem; margin-top: 2px; }
.person__comp { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--slate); font-size: .95rem; }

/* =========================================================================
   Contatti
   ========================================================================= */
.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: clamp(28px, 5vw, 56px); align-items: start; }
.contact-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(28px, 4vw, 40px); box-shadow: var(--shadow-sm); }
.contact-list { display: flex; flex-direction: column; gap: 26px; margin-top: 8px; }
.contact-item { display: flex; gap: 16px; }
.contact-item__icon { flex-shrink: 0; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--green-050); color: var(--green-700); }
.contact-item__icon svg { width: 22px; height: 22px; }
.contact-item__label { font-family: var(--font-head); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--slate-light); font-weight: 600; }
.contact-item__value { font-size: 1.08rem; font-weight: 500; margin-top: 3px; }
.contact-item__value small { color: var(--slate-light); }
.contact-item a.contact-item__value:hover { color: var(--green-700); }
.map-embed { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-sm); min-height: 420px; height: 100%; }
.map-embed iframe { width: 100%; height: 100%; min-height: 420px; border: 0; display: block; }
.map-consent { width: 100%; height: 100%; min-height: 420px; display: grid; place-items: center; text-align: center; padding: 32px; background: var(--stone-100); }
.map-consent__inner { max-width: 380px; }
.map-consent__icon { width: 46px; height: 46px; color: var(--green-700); margin: 0 auto 20px; }
.map-consent__note { margin-top: 20px; font-size: .82rem; color: var(--slate-light); line-height: 1.6; }
.map-consent__note a { color: var(--green-700); text-decoration: underline; }

/* =========================================================================
   Footer
   ========================================================================= */
.site-footer { background: var(--ink); color: rgba(255,255,255,.72); padding-top: clamp(52px, 7vw, 84px); }
.footer__top { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding-bottom: 48px; border-bottom: 1px solid rgba(255,255,255,.1); }
.footer__brand .brand__logo { height: 38px; filter: brightness(0) invert(1); }
.footer__brand p { margin-top: 20px; max-width: 340px; font-size: .96rem; }
.footer__col h4 { font-family: var(--font-head); color: #fff; font-size: .82rem; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 18px; }
.footer__col ul { display: flex; flex-direction: column; gap: 11px; }
.footer__col a { font-size: .96rem; transition: color .2s; }
.footer__col a:hover { color: #fff; }
.footer__addr { font-style: normal; font-size: .96rem; line-height: 1.9; }
.footer__addr a:hover { color: #fff; }
.footer__legal { padding: 26px 0 4px; font-size: .78rem; line-height: 1.7; color: rgba(255,255,255,.5); }
.footer__legal p { margin: 0 0 5px; }
.footer__legal strong { color: rgba(255,255,255,.72); font-weight: 600; }
.footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 18px; padding: 22px 0 34px; border-top: 1px solid rgba(255,255,255,.1); font-size: .86rem; color: rgba(255,255,255,.55); }
.footer__bottom a:hover { color: #fff; }

/* Documento legale (privacy) */
.legal-doc { max-width: 820px; }
.legal-doc h2 { font-size: 1.35rem; margin: 40px 0 14px; }
.legal-doc h2:first-child { margin-top: 0; }
.legal-doc p { color: var(--slate); margin-bottom: 14px; }
.legal-doc ul { list-style: disc; padding-left: 22px; margin: 0 0 16px; color: var(--slate); }
.legal-doc li { margin-bottom: 9px; }
.legal-doc a { color: var(--green-700); text-decoration: underline; }
.legal-doc a:hover { color: var(--green-800); }
.legal-doc strong { color: var(--ink); font-weight: 600; }
.legal-doc__updated { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); font-size: .9rem; color: var(--slate-light); }

/* =========================================================================
   Scroll reveal
   ========================================================================= */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .08s; }
.reveal[data-delay="2"] { transition-delay: .16s; }
.reveal[data-delay="3"] { transition-delay: .24s; }

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 1024px) {
  .services__grid { grid-template-columns: repeat(2, 1fr); }
  .team-grid { grid-template-columns: repeat(2, 1fr); }
  .footer__top { grid-template-columns: 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .nav {
    position: fixed; inset: var(--header-h) 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 4px;
    background: rgba(255,255,255,.98); backdrop-filter: blur(10px);
    padding: 18px 24px 26px; box-shadow: var(--shadow-md);
    transform: translateY(-140%); transition: transform .38s var(--ease); border-bottom: 1px solid var(--line);
  }
  body.nav-open .nav { transform: translateY(0); }
  .nav a { color: var(--ink) !important; padding: 13px 14px; border-radius: 10px; font-size: 1.05rem; }
  .nav a:hover { background: var(--stone-100) !important; }
  .nav__toggle { display: flex; }
  .site-header[data-transparent="true"] .nav a { color: var(--ink) !important; }
  .intro__grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
}

/* Sotto gli 800px i 16 puntini del carousel andrebbero a capo: li nascondo.
   Per navigare restano le due frecce prev/next. */
@media (max-width: 799.98px) {
  .hero__dots { display: none; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .services__grid { grid-template-columns: 1fr; }
  .team-grid { grid-template-columns: 1fr; }
  .intro__stats { grid-template-columns: 1fr; }
  .hero__arrows { left: auto; right: 16px; transform: none; bottom: 18px; gap: 10px; }
  .hero__arrow { width: 46px; height: 46px; }
  .brand__tag { display: none; }
  .footer__top { grid-template-columns: 1fr; gap: 32px; }
  .cta-band .container { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .hero__slide.is-active img { animation: none; transform: scale(1.06); }
  .reveal { opacity: 1; transform: none; }
}
