/* =========================================================
   EruditIA APS — foglio di stile
   Idea guida: il globo di punti del logo (blu → verde acqua)
   ========================================================= */

:root {
  --ink: #0E2A47;        /* testo e titoli */
  --ink-soft: #3D5468;   /* testo secondario */
  --blu: #1D5FB4;        /* blu del logo */
  --blu-scuro: #154A8C;
  --teal: #1BA88C;       /* verde acqua del logo ("IA") */
  --teal-chiaro: #DDF3EE;
  --carta: #F2F6F7;      /* sfondo */
  --bianco: #FFFFFF;
  --linea: #D3DFE4;

  --f-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --f-testo: "Atkinson Hyperlegible", "Atkinson Hyperlegible Next", "Segoe UI", system-ui, -apple-system, sans-serif;

  --max: 1180px;
  --gutter: clamp(20px, 4vw, 40px);
  --header-h: 84px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 20px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--f-testo);
  font-size: 1.0625rem;     /* 17px */
  line-height: 1.65;
  color: var(--ink);
  background: var(--carta);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--blu); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--blu-scuro); }
p { margin: 0 0 1.1em; }
strong { font-weight: 700; }

h1, h2, h3, h4 {
  font-family: var(--f-display);
  color: var(--ink);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -.015em;
  margin: 0 0 .5em;
}

:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; border-radius: 2px; }

.wrap { width: 100%; max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 200; padding: 10px 16px; background: var(--ink); color: #fff; border-radius: 6px; }
.skip-link:focus { top: 12px; color: #fff; }

/* ---------- Bottoni ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5em;
  padding: .85em 1.5em;
  font: 700 1rem/1.1 var(--f-testo);
  color: #fff; background: var(--blu);
  border: 2px solid var(--blu); border-radius: 999px;
  text-decoration: none; cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s;
}
.btn:hover { background: var(--blu-scuro); border-color: var(--blu-scuro); color: #fff; }
.btn--teal { background: var(--teal); border-color: var(--teal); color: #06302A; }
.btn--teal:hover { background: #17927a; border-color: #17927a; color: #fff; }
.btn--ghost { background: transparent; color: var(--blu); }
.btn--ghost:hover { background: var(--blu); color: #fff; }
.btn--light { background: #fff; border-color: #fff; color: var(--blu); }
.btn--light:hover { background: var(--teal-chiaro); border-color: var(--teal-chiaro); color: var(--ink); }

/* =========================================================
   HEADER
   ========================================================= */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(242, 246, 247, .92);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s, box-shadow .2s;
}
.site-header.is-scrolled { border-bottom-color: var(--linea); box-shadow: 0 6px 24px -18px rgba(14, 42, 71, .45); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); gap: 24px; }

.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; }
.brand img { width: 56px; height: 56px; }
.brand-name { display: block; font-family: var(--f-display); font-weight: 800; font-size: 1.75rem; line-height: 1; letter-spacing: .06em; color: var(--blu); }
.brand-name em { font-style: italic; color: var(--teal); letter-spacing: .02em; }
.brand-tag { display: block; margin-top: 5px; font-size: .8125rem; line-height: 1; letter-spacing: .22em; color: var(--ink-soft); }

.nav ul { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; }
.nav a {
  display: block; padding: 10px 16px;
  font-weight: 700; font-size: 1.0625rem; color: var(--ink);
  text-decoration: none; border-radius: 999px;
  transition: background-color .2s, color .2s;
}
.nav a:hover { background: var(--bianco); color: var(--blu); }
.nav a[aria-current="page"] { background: var(--ink); color: #fff; }

.menu-toggle {
  display: none; width: 48px; height: 48px; padding: 0;
  border: 1px solid var(--linea); border-radius: 12px; background: var(--bianco);
  color: var(--ink); cursor: pointer;
}
.menu-toggle svg { width: 24px; height: 24px; margin: auto; display: block; }
.menu-toggle .i-close { display: none; }
.menu-toggle[aria-expanded="true"] .i-open { display: none; }
.menu-toggle[aria-expanded="true"] .i-close { display: block; }

@media (max-width: 760px) {
  :root { --header-h: 72px; }
  .brand img { width: 46px; height: 46px; }
  .brand-name { font-size: 1.45rem; }
  .brand-tag { font-size: .72rem; letter-spacing: .18em; }
  .menu-toggle { display: block; }
  .nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--carta); border-bottom: 1px solid var(--linea);
    display: none;
  }
  .nav.is-open { display: block; }
  .nav ul { flex-direction: column; gap: 0; padding: 8px var(--gutter) 16px; }
  .nav a { padding: 14px 16px; border-radius: 10px; font-size: 1.125rem; }
}

/* =========================================================
   HOME
   ========================================================= */
.hero { position: relative; overflow: hidden; padding: clamp(40px, 7vw, 96px) 0 clamp(48px, 8vw, 112px); }
.hero .wrap { display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: clamp(24px, 4vw, 64px); }
.hero h1 {
  font-size: clamp(2.6rem, 6.2vw, 5.4rem);
  line-height: .98; letter-spacing: -.035em; font-weight: 800;
  margin-bottom: .45em; max-width: 12ch;
}
.hero .lead { font-size: clamp(1.1rem, 1.6vw, 1.3rem); line-height: 1.55; color: var(--ink-soft); max-width: 44ch; margin-bottom: 1.8em; }
.globe { position: relative; aspect-ratio: 1 / 1; width: 100%; max-width: 520px; justify-self: end; }
.globe canvas { width: 100%; height: 100%; display: block; }

/* Ambiti */
.areas { background: var(--bianco); border-top: 1px solid var(--linea); border-bottom: 1px solid var(--linea); }
.areas ul { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; padding: 0; list-style: none; }
.areas li { padding: 34px 28px 36px; border-left: 1px solid var(--linea); }
.areas li:first-child { border-left: 0; padding-left: 0; }
.areas svg { width: 34px; height: 34px; fill: currentColor; margin-bottom: 18px; }
.areas h3 { font-size: 1.3rem; line-height: 1.2; margin: 0; font-weight: 700; }
.areas .a1 { color: #1D5FB4; } .areas .a2 { color: #1A74AE; } .areas .a3 { color: #1A8E9E; } .areas .a4 { color: #1BA88C; }

/* Nessuno escluso */
.statement { padding: clamp(64px, 10vw, 128px) 0; }
.statement .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 5vw, 80px); align-items: end; }
.statement h2 { font-size: clamp(2.2rem, 4.6vw, 3.8rem); letter-spacing: -.03em; margin: 0; }
.statement p { font-size: 1.15rem; color: var(--ink-soft); }

/* Conoscenza e Tecnologia per Tutti */
.manifesto { background: var(--bianco); padding: clamp(64px, 9vw, 120px) 0; }
.manifesto .wrap { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(32px, 6vw, 96px); }
.manifesto-intro { position: relative; }
.manifesto-intro h3 { font-size: clamp(1.8rem, 3vw, 2.4rem); }
.manifesto-intro p { color: var(--ink-soft); line-height: 1.75; }
.manifesto-intro figure { margin: 28px 0 0; }
.manifesto-intro figure img { width: 140px; }
@media (min-width: 901px) { .manifesto-intro .sticky { position: sticky; top: calc(var(--header-h) + 32px); } }

.pillars { display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; }
.pillar { padding: 28px 0 8px; border-top: 3px solid var(--c, var(--blu)); }
.pillar h4 { font-size: 1.25rem; color: var(--ink); margin-bottom: .55em; }
.pillar p { color: var(--ink-soft); }
.pillar--wide { grid-column: 1 / -1; }
.pillar.p1 { --c: #1D5FB4; } .pillar.p2 { --c: #1A6CB0; } .pillar.p3 { --c: #1A84A3; }
.pillar.p4 { --c: #1A9A96; } .pillar.p5 { --c: #1BA88C; }

/* Unisciti a noi */
.join { position: relative; overflow: hidden; background: var(--blu); color: #fff; padding: clamp(72px, 11vw, 140px) 0; }
.join::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.16) 1.6px, transparent 1.7px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(115deg, transparent 35%, #000 95%);
  mask-image: linear-gradient(115deg, transparent 35%, #000 95%);
}
.join .wrap { position: relative; z-index: 1; }
.join h2 { color: #fff; font-size: clamp(3rem, 9vw, 7.5rem); letter-spacing: -.04em; line-height: .9; font-weight: 800; margin-bottom: .35em; }
.join p { font-size: 1.2rem; max-width: 52ch; color: rgba(255,255,255,.9); margin-bottom: 1.8em; }

/* =========================================================
   PAGINE INTERNE
   ========================================================= */
.page-head { padding: clamp(48px, 7vw, 88px) 0 clamp(28px, 4vw, 44px); border-bottom: 1px solid var(--linea); }
.page-head h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); letter-spacing: -.035em; font-weight: 800; margin: 0; }

.prose { max-width: 68ch; }
.prose h3 { font-size: 1.6rem; margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.prose li { margin-bottom: .35em; }
.prose li::marker { color: var(--teal); }

/* Chi siamo */
.about { padding: clamp(40px, 6vw, 72px) 0 clamp(64px, 9vw, 112px); }
.about-section { display: grid; grid-template-columns: 260px 1fr; gap: clamp(20px, 4vw, 64px); padding: 40px 0; border-top: 1px solid var(--linea); }
.about-section:first-child { border-top: 0; padding-top: 8px; }
.about-section > h3 { font-size: 1.45rem; color: var(--blu); margin: 0; }
.about-section .prose > :last-child { margin-bottom: 0; }
.about-intro .prose p:first-child { font-size: 1.25rem; line-height: 1.5; }
.values { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0 !important; margin: 0; }
.values li { margin: 0; padding: 10px 18px; background: var(--bianco); border: 1px solid var(--linea); border-radius: 999px; }
.about-cta { background: var(--bianco); border: 1px solid var(--linea); border-radius: 20px; padding: 32px; margin-top: 8px; }
.about-cta .btn { margin: 4px 0 18px; }

/* Statuto */
.statuto { padding: clamp(32px, 5vw, 56px) 0 clamp(64px, 9vw, 112px); }
.statuto .wrap { display: grid; grid-template-columns: 280px 1fr; gap: clamp(28px, 5vw, 72px); align-items: start; }
.toc { position: sticky; top: calc(var(--header-h) + 24px); max-height: calc(100vh - var(--header-h) - 48px); overflow: auto; padding-right: 8px; font-size: .9rem; }
.toc h2 { font-family: var(--f-testo); font-size: .95rem; letter-spacing: 0; color: var(--ink-soft); margin: 0 0 12px; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc .t-title > a { display: block; margin: 16px 0 4px; font-weight: 700; color: var(--ink); text-decoration: none; }
.toc .t-art > a { display: block; padding: 5px 0 5px 12px; border-left: 2px solid var(--linea); color: var(--ink-soft); text-decoration: none; line-height: 1.35; }
.toc a:hover { color: var(--blu); }
.toc a.is-active { color: var(--blu); border-left-color: var(--teal); font-weight: 700; }
.toc-download { margin-top: 24px; }

.statuto-body { max-width: 74ch; background: var(--bianco); border: 1px solid var(--linea); border-radius: 20px; padding: clamp(24px, 5vw, 64px); }
.statuto-body h1 { font-size: clamp(1.4rem, 2.4vw, 1.75rem); color: var(--blu); letter-spacing: -.01em; padding-top: 1.6em; margin: 1.6em 0 .9em; border-top: 2px solid var(--teal); }
.statuto-body h1:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.statuto-body h2 { font-family: var(--f-testo); font-size: 1.125rem; letter-spacing: 0; color: var(--ink); margin: 1.8em 0 .7em; }
.statuto-body ol, .statuto-body ul { padding-left: 1.4em; margin: 0 0 1.1em; }
.statuto-body li { margin-bottom: .45em; }
.statuto-body li > ol, .statuto-body li > ul { margin: .45em 0 .2em; }
.statuto-body li::marker { color: var(--blu); font-weight: 700; }
.statuto-body .firma { margin-top: 2.4em; padding-top: 1.4em; border-top: 1px solid var(--linea); }
.download { display: inline-flex; align-items: center; gap: .5em; font-weight: 700; }
.download svg { width: 18px; height: 18px; fill: currentColor; }

@media (max-width: 900px) {
  .hero .wrap, .statement .wrap, .manifesto .wrap { grid-template-columns: 1fr; }
  .globe { justify-self: center; max-width: 380px; order: -1; margin-bottom: -10px; }
  .hero h1 { max-width: 14ch; }
  .areas ul { grid-template-columns: 1fr 1fr; }
  .areas li { padding: 28px 22px; border-left: 0; border-top: 1px solid var(--linea); }
  .areas li:nth-child(even) { border-left: 1px solid var(--linea); }
  .areas li:nth-child(-n+2) { border-top: 0; }
  .areas li:first-child { padding-left: 22px; }
  .about-section { grid-template-columns: 1fr; padding: 32px 0; }
  .statuto .wrap { grid-template-columns: 1fr; }
  .toc { position: static; max-height: none; background: var(--bianco); border: 1px solid var(--linea); border-radius: 16px; padding: 18px 20px; }
  .toc details summary { cursor: pointer; font-weight: 700; }
}
@media (max-width: 560px) {
  .pillars { grid-template-columns: 1fr; }
  .areas ul { grid-template-columns: 1fr; }
  .areas li, .areas li:nth-child(even) { border-left: 0; }
  .areas li:nth-child(2) { border-top: 1px solid var(--linea); }
  .statuto-body { border-radius: 14px; }
}

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer { background: var(--ink); color: #C9D6E0; padding: 64px 0 28px; font-size: .97rem; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1.3fr; gap: 40px; }
.footer-brand .brand-name { color: #fff; }
.footer-org { margin-top: 18px; }
.footer-org strong { display: block; font-family: var(--f-display); font-size: 1.35rem; color: #fff; }
.site-footer h3 { font-family: var(--f-testo); font-size: 1rem; letter-spacing: 0; color: #fff; margin: 0 0 10px; }
.site-footer address { font-style: normal; line-height: 1.75; }
.social { display: flex; gap: 10px; margin-top: 22px; }
.social a { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.08); transition: background-color .2s; }
.social a:hover { background: var(--teal); }
.social svg { width: 18px; height: 18px; fill: #fff; }
.footer-bottom { margin-top: 48px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.12); font-size: .875rem; color: #8FA5B8; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr; gap: 32px; } }

/* Torna su */
.to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 90;
  width: 46px; height: 46px; border: 0; border-radius: 50%;
  background: var(--blu); color: #fff; cursor: pointer;
  box-shadow: 0 8px 22px -10px rgba(14,42,71,.6);
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .2s, transform .2s, visibility .2s;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top svg { width: 20px; height: 20px; fill: currentColor; display: block; margin: auto; }
