/* =========================================================
   Dott. Matteo De Simone — Neurochirurgia
   Design system: editorial / clinical
   ========================================================= */

:root {
  /* Colour — rapporti di contrasto verificati (WCAG AA richiede 4.5:1)
     --ink-3  testo corrente su fondo chiaro   → 10.2:1 su --paper
     --teal   accento su fondo chiaro          →  7.6:1 su --paper
     --teal-2 accento su fondo scuro, SOLO lì  →  6.9:1 su --ink (2.5:1 su --paper: non usare su chiaro) */
  --ink: #0b1116;
  --ink-2: #16222b;
  --ink-3: #2d3f49;
  --paper: #f6f3ed;
  --paper-2: #ece7de;
  --white: #fffdfa;
  --teal: #14555c;
  --teal-2: #52a8b0;
  --teal-soft: rgba(20, 85, 92, 0.08);
  --line: rgba(11, 17, 22, 0.14);
  --line-soft: rgba(11, 17, 22, 0.07);
  --line-dark: rgba(246, 243, 237, 0.16);

  /* Type — un solo carattere, istituzionale, nessun corsivo.
     --display resta come variabile separata per poter reintrodurre
     un carattere da titolo senza toccare le singole regole. */
  --body: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --display: var(--body);

  /* Space */
  --gutter: clamp(1.25rem, 5vw, 5rem);
  --section: clamp(4.5rem, 10vw, 9rem);
  --maxw: 1280px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem; /* 17px — mai sotto i 16px, nemmeno su mobile */
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.no-scroll { overflow: hidden; }

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

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

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0;
  overflow-wrap: break-word; /* parole lunghe (es. "neuromodulazione") su schermi stretti */
  text-wrap: balance;
}
/* ai corpi molto grandi il semibold diventa urlato: si alleggerisce */
.h-xl, .hero h1 { font-weight: 500; letter-spacing: -0.03em; }

.card h3, .plist h3, .timeline h3, .qr strong {
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.005em;
}

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

::selection { background: var(--teal); color: var(--paper); }

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
  border-radius: 2px;
}
/* su fondo scuro serve l'accento chiaro, altrimenti il ring sparisce */
.section--dark :focus-visible,
.page-hero :focus-visible,
.hero :focus-visible,
.menu :focus-visible,
.site-footer :focus-visible,
.site-header--over :focus-visible { outline-color: var(--teal-2); }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--ink); color: var(--paper);
  padding: 0.85rem 1.25rem; font-size: 0.85rem;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* ---------- Layout primitives ---------- */

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section); }
.section--tight { padding-block: clamp(3rem, 6vw, 5rem); }

.section--dark {
  background: var(--ink);
  color: var(--paper);
}
.section--dark .eyebrow { color: var(--teal-2); }
.section--dark .rule { background: var(--line-dark); }

.section--alt { background: var(--paper-2); }

.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 1.6rem;
}
.eyebrow::before {
  content: "";
  width: 2.25rem;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
  flex: none;
}

.h-xl { font-size: clamp(2.5rem, 6.4vw, 5.4rem); }
.h-lg { font-size: clamp(2rem, 4.4vw, 3.4rem); }
.h-md { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
.h-sm { font-size: clamp(1.2rem, 1.8vw, 1.45rem); }

.lede {
  font-size: clamp(1.12rem, 1.5vw, 1.3rem);
  line-height: 1.6;
  color: var(--ink-3);
  max-width: 62ch;
}
.section--dark .lede { color: rgba(246, 243, 237, 0.72); }

.prose { max-width: 68ch; }
.prose p + p { margin-top: 0; }
.prose strong { font-weight: 600; color: var(--ink); }

.grid {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.5rem);
}
/* minmax(0, 1fr) e non 1fr: "1fr" vale "minmax(auto, 1fr)" e il minimo "auto"
   è il min-content, che impedisce alla colonna di scendere sotto il contenuto
   → traboccamento orizzontale su schermi stretti. */
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}
.split--reverse { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 48px;
  padding: 0.85rem 1.6rem;
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  transition: background 0.4s var(--ease), color 0.4s var(--ease),
              border-color 0.4s var(--ease), transform 0.4s var(--ease);
  cursor: pointer;
}
.btn:hover { background: var(--teal); border-color: var(--teal); transform: translateY(-2px); }

.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.btn--light {
  background: transparent;
  color: var(--paper);
  border-color: rgba(246, 243, 237, 0.4);
}
.btn--light:hover { background: var(--paper); color: var(--ink); border-color: var(--paper); }

.btn .arrow { transition: transform 0.4s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px; /* area di tocco */
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--teal);
  padding-block: 0.4rem;
  border-bottom: 1px solid currentColor;
  transition: gap 0.35s var(--ease), color 0.35s var(--ease);
}
.link-arrow:hover { gap: 0.9rem; color: var(--ink); }
.section--dark .link-arrow { color: var(--teal-2); }
.section--dark .link-arrow:hover { color: var(--paper); }

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  transition: background 0.45s var(--ease), box-shadow 0.45s var(--ease),
              border-color 0.45s var(--ease), transform 0.45s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  min-height: 80px;
}

.site-header--solid {
  background: rgba(246, 243, 237, 0.88);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom-color: var(--line-soft);
}
.site-header--hidden { transform: translateY(-100%); }

/* Over-hero (dark) state */
.site-header--over { color: var(--paper); }
.site-header--over .brand__name,
.site-header--over .brand__role,
.site-header--over .nav a { color: var(--paper); }
.site-header--over .brand__mark { border-color: rgba(246, 243, 237, 0.35); color: var(--paper); }
.site-header--over .nav-toggle span { background: var(--paper); }

.brand { display: flex; align-items: center; gap: 0.85rem; }
.brand__mark {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-family: var(--display);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  flex: none;
  transition: border-color 0.4s var(--ease), background 0.4s var(--ease), color 0.4s var(--ease);
}
.brand:hover .brand__mark { background: var(--teal); border-color: var(--teal); color: var(--paper); }
.brand__name {
  font-family: var(--display);
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  display: block;
}
.brand__role {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: block;
}

.nav { display: flex; align-items: center; gap: clamp(1rem, 2vw, 2rem); }
.nav a {
  position: relative;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding-block: 0.35rem;
  white-space: nowrap;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.45s var(--ease);
}
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }
.nav a[aria-current="page"] { color: var(--teal); }
.site-header--over .nav a[aria-current="page"] { color: var(--teal-2); }

.nav .btn { margin-left: 0.5rem; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 48px; height: 48px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 24px; height: 1.5px;
  background: var(--ink);
  transition: transform 0.4s var(--ease), opacity 0.3s var(--ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Mobile menu */
.menu {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--ink);
  color: var(--paper);
  padding: 6.5rem var(--gutter) 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transform: translateY(-100%);
  transition: transform 0.65s var(--ease);
  overflow-y: auto;
}
.menu[data-open="true"] { transform: translateY(0); }
.menu__list { list-style: none; margin: 0; padding: 0; }
.menu__list li { border-bottom: 1px solid var(--line-dark); }
.menu__list a {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 1.05rem 0;
  font-family: var(--display);
  font-size: clamp(1.5rem, 6vw, 2.1rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.menu__list a span {
  font-family: var(--body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--teal-2);
}
.menu__foot {
  margin-top: 2.5rem;
  font-size: 0.92rem;
  color: rgba(246, 243, 237, 0.75);
}
.menu__foot a { color: var(--paper); border-bottom: 1px solid var(--line-dark); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  background: var(--ink);
  color: var(--paper);
  padding-top: clamp(7rem, 12vw, 9rem);
  padding-bottom: clamp(3rem, 6vw, 5rem);
  overflow: hidden;
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 82% 8%, rgba(44, 129, 137, 0.28), transparent 58%),
    radial-gradient(90% 70% at 0% 100%, rgba(20, 85, 92, 0.22), transparent 60%);
  z-index: -2;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.28'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
  pointer-events: none;
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  min-height: clamp(28rem, 62vh, 40rem);
}

.hero__eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal-2);
  margin-bottom: 1.75rem;
}
.hero h1 {
  font-size: clamp(2.9rem, 7.6vw, 6.6rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}
.hero h1 span {
  display: block;
  color: var(--paper);
}
.hero__slogan {
  font-family: var(--display);
  font-size: clamp(1.15rem, 1.8vw, 1.45rem);
  font-weight: 400;
  line-height: 1.5;
  color: rgba(246, 243, 237, 0.88);
  max-width: 26ch;
  margin-bottom: 2.25rem;
  padding-left: 1.25rem;
  border-left: 1px solid var(--teal-2);
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.85rem; }

.hero__media {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 2px;
}
.hero__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 22%;
  filter: grayscale(0.35) contrast(1.05);
  transform: scale(1.02);
  transition: transform 1.4s var(--ease), filter 1.4s var(--ease);
}
.hero__media:hover img { transform: scale(1.06); filter: grayscale(0) contrast(1); }
.hero__media::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(11, 17, 22, 0) 55%, rgba(11, 17, 22, 0.55) 100%);
  pointer-events: none;
}
.hero__caption {
  position: absolute;
  left: 1.25rem; bottom: 1.1rem;
  right: 1.25rem;
  z-index: 2;
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(246, 243, 237, 0.92);
}

/* Hero stats band */
.hero__stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem;
  margin-top: clamp(2.5rem, 5vw, 4rem);
  padding-top: 2rem;
  border-top: 1px solid var(--line-dark);
}
/* varianti: da usare al posto di grid-template-columns inline, che vincerebbe
   sui media query e bloccherebbe il layout su mobile */
.hero__stats--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hero__stats--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat__num {
  font-family: var(--display);
  font-size: clamp(1.8rem, 3.1vw, 2.6rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}
.stat__label {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(246, 243, 237, 0.72);
  line-height: 1.5;
}
.section--alt .stat__label, .section .stat__label { color: var(--ink-3); }
.section--dark .stat__label { color: rgba(246, 243, 237, 0.72); }

/* ---------- Page hero (inner pages) ---------- */

.page-hero {
  background: var(--ink);
  color: var(--paper);
  padding-top: clamp(8rem, 14vw, 11rem);
  padding-bottom: clamp(3.5rem, 7vw, 5.5rem);
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(100% 80% at 90% 0%, rgba(44, 129, 137, 0.24), transparent 60%);
}
.page-hero > * { position: relative; }
.page-hero .eyebrow { color: var(--teal-2); }
.page-hero h1 { margin-bottom: 1.25rem; }
.page-hero .lede { color: rgba(246, 243, 237, 0.75); }

.crumbs {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(246, 243, 237, 0.66); /* era 0.45 → 4.2:1, sotto la soglia AA */
  margin-top: 2.5rem;
}
.crumbs a:hover { color: var(--paper); }

/* ---------- Cards ---------- */

.card {
  position: relative;
  padding: clamp(1.5rem, 2.5vw, 2.1rem);
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease), border-color 0.5s var(--ease);
  height: 100%;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 50px -30px rgba(11, 17, 22, 0.4);
  border-color: var(--line);
}
.card__num {
  font-family: var(--display);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--teal);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  display: block;
}
/* colore esplicito: la card è sempre chiara, anche dentro .section--dark */
.card h3 { font-size: 1.35rem; margin-bottom: 0.75rem; color: var(--ink); }
.card p { font-size: 1rem; color: var(--ink-3); line-height: 1.65; margin-bottom: 0; }
.card__tag {
  display: inline-block;
  margin-top: 1.1rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal);
  background: var(--teal-soft);
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
}

/* Pathology list */
.plist { list-style: none; margin: 0; padding: 0; }
.plist li {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--line-soft);
}
.plist li:first-child { border-top: 1px solid var(--line-soft); }
.plist .idx {
  font-family: var(--display);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--teal);
  flex: none;
  width: 2rem;
}
.plist h3 { font-size: 1.2rem; margin-bottom: 0.35rem; }
.plist p { font-size: 1rem; color: var(--ink-3); margin: 0; }

/* ---------- Media figure ---------- */

.figure {
  position: relative;
  overflow: hidden;
  border-radius: 2px;
  background: var(--ink-2);
}
.figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: grayscale(0.4) contrast(1.03);
  transition: transform 1.2s var(--ease), filter 1.2s var(--ease);
}
/* Le gallerie di ritratti (congressi, formazione) usano riquadri verticali
   (.figure--tall, 3/4): le foto a figura intera, quasi tutte verticali, vi
   entrano per intero. Restano da regolare solo le poche foto non esattamente
   3/4: si sposta l'ancoraggio del ritaglio "cover" per tenere i soggetti. */
.figure img[src$="eans25-vienna.jpg"] { object-position: center 62%; }
.figure img[src$="fellowship-barcellona.jpg"] { object-position: center 72%; }
.figure:hover img { transform: scale(1.04); filter: grayscale(0) contrast(1); }
.figure--tall { aspect-ratio: 3 / 4; }
.figure--wide { aspect-ratio: 16 / 10; }
.figure--square { aspect-ratio: 1 / 1; }
.figure figcaption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 2.75rem 1.1rem 0.95rem;
  /* gradiente più profondo: la didascalia deve reggere anche su foto chiare */
  background: linear-gradient(180deg, transparent, rgba(11, 17, 22, 0.55) 45%, rgba(11, 17, 22, 0.92));
  color: #fff;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.45;
}

/* ---------- Comparison table ---------- */

.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.compare {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  font-size: 0.97rem;
  text-align: left;
}
.compare th, .compare td {
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
.compare thead th {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--body);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-bottom: 0;
}
.compare tbody th {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  width: 12.5rem;
  white-space: nowrap;
  color: var(--ink);
}
.compare tbody th small {
  display: block;
  font-family: var(--body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--teal);
  margin-top: 0.35rem;
  line-height: 1.5;
  white-space: normal;
}
.compare tbody tr { background: var(--white); transition: background 0.35s var(--ease); }
.compare tbody tr:hover { background: var(--teal-soft); }
.compare td { color: var(--ink-3); line-height: 1.6; }

.table-note {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--ink-3);
  margin-top: 1.25rem;
  padding-left: 1rem;
  border-left: 2px solid var(--teal);
}
.section--dark .table-note { border-left-color: var(--teal-2); color: rgba(246, 243, 237, 0.72); }

/* ---------- Timeline ---------- */

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
  content: "";
  position: absolute;
  left: 9rem; top: 0.6rem; bottom: 0.6rem;
  width: 1px;
  background: var(--line);
}
.timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 2.5rem;
  padding-block: 1.6rem;
}
.timeline .when {
  font-family: var(--display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal);
  text-align: right;
  padding-right: 1.5rem;
  line-height: 1.5;
}
/* su fondo scuro il teal scuro sarebbe illeggibile (2.2:1) */
.section--dark .timeline .when { color: var(--teal-2); }
.section--dark .timeline::before { background: var(--line-dark); }
.section--dark .timeline .what::before { background: var(--ink); border-color: var(--teal-2); }
.section--dark .timeline li:hover .what::before { background: var(--teal-2); }
.section--dark .timeline h3 { color: var(--paper); }
.section--dark .timeline .where { color: rgba(246, 243, 237, 0.66); }
.section--dark .timeline p { color: rgba(246, 243, 237, 0.8); }
.timeline .what { position: relative; }
.timeline .what::before {
  content: "";
  position: absolute;
  left: -2.5rem; top: 0.55rem;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--teal);
  transform: translateX(-50%);
  transition: background 0.4s var(--ease);
}
.timeline li:hover .what::before { background: var(--teal); }
.timeline h3 { font-size: 1.3rem; margin-bottom: 0.35rem; }
.timeline .where {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 0.6rem;
}
.timeline p { font-size: 1rem; color: var(--ink-3); margin: 0; }

/* ---------- Quote ---------- */

.quote {
  font-family: var(--display);
  font-size: clamp(1.4rem, 2.8vw, 2.2rem);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.02em;
  max-width: 24ch;
}
.quote--wide { max-width: 30ch; }

/* ---------- Contact ---------- */

.contact-item { padding-block: 1.5rem; border-bottom: 1px solid var(--line-dark); }
.contact-item:first-child { border-top: 1px solid var(--line-dark); }
.contact-item .k {
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal-2);
  margin-bottom: 0.5rem;
}
.contact-item .v {
  font-family: var(--display);
  font-size: clamp(1.15rem, 1.8vw, 1.45rem);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.01em;
}
.contact-item .v a { border-bottom: 1px solid transparent; transition: border-color 0.35s var(--ease); }
.contact-item .v a:hover { border-color: currentColor; }
.contact-item .note { font-size: 0.92rem; color: rgba(246, 243, 237, 0.72); margin-top: 0.4rem; }

.map {
  width: 100%;
  min-height: 380px;
  height: 100%;
  border: 0;
  filter: grayscale(1) contrast(1.1);
  border-radius: 2px;
}

/* Mappa Google con consenso al clic: fino al clic si mostra questo segnaposto,
   così nessun dato viene inviato a Google prima dell'azione dell'utente. */
.map-embed {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 380px;
  border-radius: 2px;
  overflow: hidden;
}
.map-consent {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  text-align: center;
  padding: 2.5rem 1.5rem;
  border: 1px solid rgba(246, 243, 237, 0.16);
  border-radius: 2px;
  background-color: var(--ink-2);
  background-image:
    linear-gradient(rgba(246, 243, 237, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(246, 243, 237, 0.05) 1px, transparent 1px);
  background-size: 26px 26px;
}
.map-consent__icon { font-size: 1.9rem; line-height: 1; }
.map-consent__title { font-family: var(--display); font-size: 1.3rem; color: var(--paper); }
.map-consent__addr { font-size: 0.92rem; color: rgba(246, 243, 237, 0.7); }
.map-consent__btn { margin-top: 0.7rem; }
.map-consent__note {
  font-size: 0.74rem;
  line-height: 1.5;
  color: rgba(246, 243, 237, 0.55);
  max-width: 40ch;
  margin-top: 0.4rem;
}
.map-consent__note a { color: rgba(246, 243, 237, 0.82); }

.qr {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem;
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: 3px;
}
.qr img { width: 118px; height: 118px; flex: none; }
.qr p { font-size: 0.95rem; color: var(--ink-3); margin: 0; }
.qr strong { display: block; font-size: 1.15rem; color: var(--ink); margin-bottom: 0.35rem; }

/* ---------- CTA band ---------- */

.cta {
  background: var(--teal);
  color: var(--paper);
  text-align: center;
}
.cta h2 { margin-bottom: 1rem; }
.cta p { color: rgba(246, 243, 237, 0.82); max-width: 48ch; margin-inline: auto; margin-bottom: 2rem; }
.cta .btn { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.cta .btn:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--ink);
  color: rgba(246, 243, 237, 0.78);
  padding-block: clamp(3.5rem, 7vw, 5rem) 2rem;
  font-size: 0.95rem;
}
.site-footer h4 {
  font-family: var(--body);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal-2);
  margin-bottom: 1.1rem;
}
.site-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: clamp(2rem, 4vw, 4rem);
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--line-dark);
}
.site-footer__name {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--paper);
  line-height: 1.3;
  margin-bottom: 0.75rem;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.6rem; }
/* inline-block + padding: area di tocco decente sui link del footer */
.site-footer a {
  display: inline-block;
  padding-block: 0.2rem;
  border-bottom: 1px solid transparent;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.site-footer a:hover { color: var(--paper); border-bottom-color: currentColor; }
.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 2rem;
  font-size: 0.85rem;
  color: rgba(246, 243, 237, 0.62); /* era 0.45 → 4.2:1, sotto la soglia AA */
}

/* ---------- Reveal animation ---------- */

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  will-change: opacity, transform;
}
.reveal.is-in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: 0.09s; }
.reveal[data-delay="2"] { transition-delay: 0.18s; }
.reveal[data-delay="3"] { transition-delay: 0.27s; }
.reveal[data-delay="4"] { transition-delay: 0.36s; }

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .nav { display: none; }
  .nav-toggle { display: flex; }
  .hero__grid { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .hero__media { aspect-ratio: 16 / 11; max-height: 46vh; }
  .split, .split--reverse { grid-template-columns: minmax(0, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* La tabella di confronto ha min-width 780px: sotto i 900 non ci sta nel
   contenitore e costringerebbe allo scroll orizzontale → diventa a schede. */
@media (max-width: 900px) {
  .tablewrap { overflow: visible; }
  .compare { min-width: 0; display: block; font-size: 1rem; }
  .compare thead { display: none; }
  .compare tbody, .compare tr, .compare th, .compare td { display: block; width: 100%; }
  .compare tbody tr {
    border: 1px solid var(--line);
    border-radius: 3px;
    margin-bottom: 1.25rem;
    padding: 1.25rem;
  }
  .compare tbody th { border: 0; padding: 0 0 0.9rem; width: auto; white-space: normal; }
  .compare td { border: 0; padding: 0.75rem 0 0; }
  .compare td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--teal);
    margin-bottom: 0.3rem;
  }
  .compare td + td { border-top: 1px solid var(--line-soft); margin-top: 0.75rem; }
}

@media (max-width: 720px) {
  body { font-size: 1rem; } /* mai sotto 16px */
  .site-header__inner { min-height: 68px; }
  .hero { padding-top: 6.5rem; }
  .hero__stats,
  .hero__stats--2,
  .hero__stats--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.75rem 1.25rem; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .site-footer__grid { grid-template-columns: 1fr; gap: 2.25rem; }
  .site-footer__bottom { flex-direction: column; gap: 0.5rem; }

  .timeline::before { left: 4px; }
  .timeline li { grid-template-columns: 1fr; gap: 0.35rem; padding-left: 1.85rem; }
  .timeline .when { text-align: left; padding-right: 0; font-size: 0.85rem; letter-spacing: 0.06em; }
  .timeline .what::before { left: -1.85rem; top: 0.45rem; transform: none; }

  .qr { flex-direction: column; text-align: center; }
  .map { min-height: 300px; }
}

/* Telefoni stretti (iPhone SE ≈ 375px) */
@media (max-width: 480px) {
  .hero__stats,
  .hero__stats--2,
  .hero__stats--3 { grid-template-columns: minmax(0, 1fr); gap: 1.35rem; }
  .hero__stats .stat { display: flex; align-items: baseline; gap: 0.85rem; }
  .hero__stats .stat__num { margin-bottom: 0; font-size: 1.75rem; flex: none; min-width: 4.5rem; }
  .hero__stats .stat__label { letter-spacing: 0.06em; }
  .hero__actions .btn { width: 100%; justify-content: center; }
  .brand__mark { width: 38px; height: 38px; }
  .figure figcaption { font-size: 0.72rem; padding: 2.25rem 0.85rem 0.8rem; }
  .card { padding: 1.35rem; }
  .plist li { gap: 0.85rem; }
  .plist .idx { width: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

@media print {
  .site-header, .menu, .cta, .nav-toggle { display: none !important; }
  body { background: #fff; color: #000; }
}
