/* =========================================================================
   Dr.ssa Sonia Castelli — Fisiatra a Torino
   Design system: petrolio + avorio caldo + rame. Light/dark, WCAG AA.
   ========================================================================= */

/* ---------------------------------------------------------------- tokens */
:root {
  /* colore */
  --bg:            #FAF8F4;
  --bg-alt:        #F3EFE8;
  --surface:       #FFFFFF;
  --surface-2:     #F7F4EE;
  --ink:           #12343B;
  --ink-soft:      #4E6B70;
  --ink-faint:     #7A9096;
  --primary:       #0A4F58;
  --primary-hover: #0D6570;
  --primary-soft:  #E2EFEF;
  --primary-line:  #B9D6D8;
  --accent:        #A85530;
  --accent-warm:   #C1744A;
  --accent-soft:   #F8EDE5;
  --border:        #E5DED2;
  --border-strong: #CFC5B4;
  --on-primary:    #FFFFFF;
  --on-accent:     #FFFFFF;
  --focus:         #0D6570;

  /* tipografia */
  --font-display: "Newsreader", ui-serif, Georgia, "Times New Roman", serif;
  --font-sans: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --step--1: clamp(0.82rem, 0.79rem + 0.15vw, 0.9rem);
  --step-0:  clamp(1rem, 0.96rem + 0.2vw, 1.075rem);
  --step-1:  clamp(1.18rem, 1.1rem + 0.4vw, 1.4rem);
  --step-2:  clamp(1.45rem, 1.3rem + 0.75vw, 1.95rem);
  --step-3:  clamp(1.8rem, 1.5rem + 1.5vw, 2.7rem);
  --step-4:  clamp(2.2rem, 1.7rem + 2.5vw, 3.8rem);
  --step-5:  clamp(2.15rem, 1.35rem + 3.6vw, 4.8rem);

  /* spazio */
  --space-3xs: 0.25rem; --space-2xs: 0.5rem; --space-xs: 0.75rem;
  --space-s: 1rem; --space-m: 1.5rem; --space-l: 2rem;
  --space-xl: 3rem; --space-2xl: 4rem; --space-3xl: 6rem;

  /* forma */
  --r-s: 8px; --r-m: 14px; --r-l: 22px; --r-xl: 32px; --r-full: 999px;
  --shadow-s: 0 1px 2px rgba(18, 52, 59, .05), 0 2px 8px rgba(18, 52, 59, .04);
  --shadow-m: 0 2px 6px rgba(18, 52, 59, .06), 0 12px 28px -8px rgba(18, 52, 59, .10);
  --shadow-l: 0 4px 12px rgba(18, 52, 59, .07), 0 28px 60px -20px rgba(18, 52, 59, .18);

  /* motion */
  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --t-fast: 150ms; --t-base: 280ms; --t-slow: 520ms;

  --bodymap-top: #DCEDEC;
  --bodymap-bottom: #C4E0E0;

  --container: 1180px;
  --header-h: 76px;
  --z-header: 100; --z-drawer: 200; --z-top: 300;
}

:root[data-theme="dark"] {
  --bg:            #0C1A1D;
  --bg-alt:        #101F23;
  --surface:       #13262A;
  --surface-2:     #182E33;
  --ink:           #E9EFEE;
  --ink-soft:      #A9C0C2;
  --ink-faint:     #7E9698;
  --primary:       #67BCC6;
  --primary-hover: #8AD0D8;
  --primary-soft:  #14333A;
  --primary-line:  #24505A;
  --accent:        #E0935F;
  --accent-warm:   #E9A97E;
  --accent-soft:   #2A2018;
  --border:        #22383D;
  --border-strong: #315056;
  --on-primary:    #04252A;
  --on-accent:     #2A1608;
  --focus:         #8AD0D8;
  --bodymap-top: #1B3A40;
  --bodymap-bottom: #142C31;
  --shadow-s: 0 1px 2px rgba(0,0,0,.3);
  --shadow-m: 0 2px 6px rgba(0,0,0,.3), 0 12px 28px -8px rgba(0,0,0,.45);
  --shadow-l: 0 4px 12px rgba(0,0,0,.35), 0 28px 60px -20px rgba(0,0,0,.6);
}

/* ------------------------------------------------------------- reset/base */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}
html { scroll-padding-top: calc(var(--header-h) + 1rem); }

img, svg, video { display: block; max-width: 100%; height: auto; }
/* icona inline senza classe: dimensione legata al testo, mai a tutta larghezza */
svg[aria-hidden="true"]:not([class]) { width: 1.25em; height: 1.25em; flex: none; vertical-align: -.22em; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
ul, ol { padding: 0; list-style: none; }

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: var(--r-s);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.015em;
  text-wrap: balance;
  color: var(--ink);
}
h1 { font-size: var(--step-4); overflow-wrap: break-word; }

h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); }
p { text-wrap: pretty; }

::selection { background: var(--primary); color: var(--on-primary); }

/* --------------------------------------------------------------- layout */
.container { width: min(100% - 2rem, var(--container)); margin-inline: auto; }
@media (min-width: 768px) { .container { width: min(100% - 4rem, var(--container)); } }

.section { padding-block: clamp(3.5rem, 8vw, 7rem); }
.section--tight { padding-block: clamp(2.5rem, 5vw, 4rem); }
.section--alt { background: var(--bg-alt); }
.stack > * + * { margin-top: var(--space-s); }
.measure { max-width: 68ch; }
.center { text-align: center; margin-inline: auto; }

.skip-link {
  position: absolute; left: 1rem; top: -100px; z-index: var(--z-top);
  background: var(--primary); color: var(--on-primary);
  padding: .75rem 1.25rem; border-radius: var(--r-s); font-weight: 600;
  transition: top var(--t-fast) var(--ease);
}
.skip-link:focus { top: 1rem; }

/* ------------------------------------------------------------ tipografia */
.eyebrow {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--font-sans); font-size: var(--step--1);
  font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); flex-wrap: wrap;
}
.eyebrow::before {
  content: ""; width: 26px; height: 1px; background: currentColor; opacity: .55;
}
.eyebrow--center::after {
  content: ""; width: 26px; height: 1px; background: currentColor; opacity: .55;
}
.lead { font-size: var(--step-1); line-height: 1.5; color: var(--ink-soft); }
.muted { color: var(--ink-soft); }
.section-head { max-width: 62ch; margin-bottom: clamp(2rem, 4vw, 3.25rem); }
.section-head > * + * { margin-top: var(--space-s); }
.section-head--center { margin-inline: auto; text-align: center; }

/* ---------------------------------------------------------------- bottoni */
.btn {
  --btn-bg: var(--primary); --btn-fg: var(--on-primary); --btn-bd: var(--primary);
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  min-height: 48px; padding: .8rem 1.6rem;
  background: var(--btn-bg); color: var(--btn-fg);
  border: 1.5px solid var(--btn-bd); border-radius: var(--r-full);
  font-weight: 600; font-size: var(--step-0); letter-spacing: -.01em;
  text-align: center; cursor: pointer;
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-base) var(--ease),
              background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
  box-shadow: var(--shadow-s);
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-m); background: var(--primary-hover); border-color: var(--primary-hover); }
.btn:active { transform: translateY(0) scale(.985); }
.btn svg { width: 1.15em; height: 1.15em; flex: none; }

.btn--ghost { --btn-bg: transparent; --btn-fg: var(--ink); --btn-bd: var(--border-strong); box-shadow: none; }
.btn--ghost:hover { background: var(--surface); border-color: var(--primary); color: var(--primary); }
.btn--accent { --btn-bg: var(--accent); --btn-fg: var(--on-accent); --btn-bd: var(--accent); }
.btn--accent:hover { background: var(--accent-warm); border-color: var(--accent-warm); }
.btn--light { --btn-bg: var(--surface); --btn-fg: var(--primary); --btn-bd: var(--surface); }
.btn--light:hover { background: var(--surface); color: var(--primary-hover); }
.btn--sm { min-height: 40px; padding: .5rem 1.1rem; font-size: var(--step--1); }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.btn-row--center { justify-content: center; }

.link-arrow {
  display: inline-flex; align-items: center; gap: .45rem;
  font-weight: 600; color: var(--primary);
  border-bottom: 1.5px solid transparent;
  transition: gap var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.link-arrow svg { width: 1em; height: 1em; transition: transform var(--t-fast) var(--ease); }
.link-arrow:hover { border-color: currentColor; }
.link-arrow:hover svg { transform: translateX(3px); }

/* ------------------------------------------------------------------ pill */
.pill {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .35rem .8rem; border-radius: var(--r-full);
  background: var(--primary-soft); color: var(--primary);
  border: 1px solid var(--primary-line);
  font-size: var(--step--1); font-weight: 600; line-height: 1.4;
}
.pill--accent { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.pill-row { display: flex; flex-wrap: wrap; gap: .45rem; }

/* ---------------------------------------------------------------- header */
.header {
  position: sticky; top: 0; z-index: var(--z-header);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-base) var(--ease), background-color var(--t-base) var(--ease),
              box-shadow var(--t-base) var(--ease);
}
.header.is-scrolled { border-bottom-color: var(--border); box-shadow: 0 6px 24px -18px rgba(18,52,59,.5); }
.header__bar {
  display: flex; align-items: center; gap: var(--space-m);
  min-height: var(--header-h);
}
.brand { display: flex; align-items: center; gap: .7rem; flex: none; margin-right: auto; }
.brand__mark { width: 40px; height: 40px; flex: none; }
.brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.brand__name { font-family: var(--font-display); font-size: 1.08rem; font-weight: 600; letter-spacing: -.02em; }
.brand__role { font-size: .68rem; letter-spacing: .13em; text-transform: uppercase; color: var(--ink-faint); font-weight: 600; }

.nav { display: none; }
@media (min-width: 1120px) {
  .nav { display: flex; align-items: center; gap: .15rem; }
  .nav a {
    position: relative; padding: .55rem .8rem; border-radius: var(--r-s);
    font-size: .95rem; font-weight: 500; color: var(--ink-soft);
    transition: color var(--t-fast) var(--ease);
  }
  .nav a::after {
    content: ""; position: absolute; left: .8rem; right: .8rem; bottom: .25rem;
    height: 2px; border-radius: 2px; background: var(--accent);
    transform: scaleX(0); transform-origin: left; transition: transform var(--t-base) var(--ease);
  }
  .nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
  .nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }
  .nav a[aria-current="page"] { font-weight: 600; }
}
.header__actions { display: flex; align-items: center; gap: .5rem; flex: none; }
.header__cta { display: none; }
@media (min-width: 640px) { .header__cta { display: inline-flex; } }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: var(--r-full);
  border: 1.5px solid var(--border); color: var(--ink-soft); background: transparent;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.icon-btn:hover { color: var(--primary); border-color: var(--primary-line); background: var(--primary-soft); }
.icon-btn svg { width: 20px; height: 20px; }
.nav-toggle { display: inline-flex; }
@media (min-width: 1120px) { .nav-toggle { display: none; } }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* ---------------------------------------------------------------- drawer */
.drawer {
  position: fixed; inset: 0; z-index: var(--z-drawer);
  background: var(--bg); padding: var(--space-s);
  display: flex; flex-direction: column;
  opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: opacity var(--t-base) var(--ease), transform var(--t-base) var(--ease), visibility var(--t-base);
}
.drawer.is-open { opacity: 1; visibility: visible; transform: none; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); }
.drawer__nav { display: flex; flex-direction: column; gap: .25rem; margin-top: var(--space-m); overflow-y: auto; }
.drawer__nav a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem .5rem; font-family: var(--font-display); font-size: var(--step-2);
  border-bottom: 1px solid var(--border);
  transition: color var(--t-fast) var(--ease), padding-left var(--t-fast) var(--ease);
}
.drawer__nav a:hover, .drawer__nav a[aria-current="page"] { color: var(--primary); padding-left: 1rem; }
.drawer__nav svg { width: 1rem; height: 1rem; color: var(--ink-faint); }
.drawer__foot { margin-top: auto; padding-top: var(--space-m); display: grid; gap: .6rem; }
body.is-locked { overflow: hidden; }

/* ------------------------------------------------------------------ hero */
.hero { position: relative; overflow: hidden; padding-block: clamp(3rem, 8vw, 6.5rem) clamp(3rem, 7vw, 5.5rem); }
.hero__glow {
  position: absolute; inset: -30% -10% auto -10%; height: 130%;
  background:
    radial-gradient(48% 46% at 78% 18%, color-mix(in srgb, var(--primary) 20%, transparent) 0%, transparent 62%),
    radial-gradient(42% 40% at 12% 72%, color-mix(in srgb, var(--accent) 16%, transparent) 0%, transparent 60%);
  filter: blur(6px); pointer-events: none; z-index: 0;
  animation: drift 22s var(--ease) infinite alternate;
}
@keyframes drift { to { transform: translate3d(2%, -2%, 0) scale(1.06); } }
.hero__inner { position: relative; z-index: 1; display: grid; gap: clamp(2.5rem, 5vw, 4rem); align-items: center; }
@media (min-width: 980px) { .hero__inner { grid-template-columns: 1.05fr .95fr; } }
.hero h1 { font-size: var(--step-5); margin-top: var(--space-s); }
.hero h1 em { font-style: italic; color: var(--primary); }
.hero__lead { margin-top: var(--space-m); max-width: 52ch; }
.hero__actions { margin-top: var(--space-l); }
.hero__trust {
  margin-top: var(--space-l); padding-top: var(--space-m);
  border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; gap: var(--space-m) var(--space-l);
}
.hero__trust-item { display: flex; align-items: center; gap: .6rem; font-size: var(--step--1); color: var(--ink-soft); }
.hero__trust-item svg { width: 20px; height: 20px; color: var(--primary); flex: none; }
.hero__trust-item strong { color: var(--ink); font-weight: 600; }

.hero__visual { position: relative; }
.hero-card {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: clamp(1.5rem, 3vw, 2.25rem);
  box-shadow: var(--shadow-l);
}
.hero-card__art { border-radius: var(--r-l); overflow: hidden; background: var(--primary-soft); }
.hero-card__meta { margin-top: var(--space-m); display: grid; gap: .9rem; }
.hero-card__row { display: flex; align-items: flex-start; gap: .75rem; font-size: var(--step--1); }
.hero-card__row svg { width: 20px; height: 20px; color: var(--accent); flex: none; margin-top: 2px; }
.hero-card__row strong { display: block; color: var(--ink); font-weight: 600; font-size: var(--step-0); }
.hero-card__row span { color: var(--ink-soft); }
.hero-badge {
  position: absolute; top: -18px; right: clamp(1rem, 4vw, 2rem);
  background: var(--accent); color: var(--on-accent);
  padding: .55rem 1.1rem; border-radius: var(--r-full);
  font-size: var(--step--1); font-weight: 700; letter-spacing: .02em;
  box-shadow: var(--shadow-m);
}

/* ----------------------------------------------------------------- cards */
.grid { display: grid; gap: var(--space-m); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.grid--videos { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }

.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-l); padding: clamp(1.35rem, 2.5vw, 1.85rem);
  transition: transform var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease), border-color var(--t-base) var(--ease);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-m); border-color: var(--primary-line); }
.card__icon {
  width: 52px; height: 52px; border-radius: var(--r-m);
  display: grid; place-items: center; flex: none;
  background: var(--primary-soft); color: var(--primary);
  margin-bottom: var(--space-s);
  transition: background var(--t-base) var(--ease), color var(--t-base) var(--ease);
}
.card__icon svg { width: 26px; height: 26px; }
.card:hover .card__icon { background: var(--primary); color: var(--on-primary); }
.card h3 { margin-bottom: .5rem; }
.card p { color: var(--ink-soft); font-size: var(--step-0); }
.card__foot { margin-top: auto; padding-top: var(--space-s); }
.card--link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }

.card--flat { background: var(--surface-2); border-color: transparent; }
.card--flat:hover { transform: none; box-shadow: none; border-color: var(--border); }

.treatment-card__kicker {
  font-size: var(--step--1); font-weight: 600; color: var(--accent);
  letter-spacing: .04em; margin-bottom: .3rem;
}

/* ---------------------------------------------------- mappa del dolore */
.bodymap { display: grid; gap: var(--space-l); align-items: start; }
@media (min-width: 900px) { .bodymap { grid-template-columns: minmax(260px, 380px) 1fr; gap: var(--space-xl); } }

.bodymap__figure {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: var(--space-m); box-shadow: var(--shadow-s);
}
.bodymap__svg { width: 100%; max-width: 300px; height: auto; max-height: 60vh; margin-inline: auto; }
.bodymap__svg .silhouette { fill: url(#bodyFill); stroke: var(--primary-line); stroke-width: 1.4; }
.bodymap__svg .silhouette-detail {
  fill: none; stroke: var(--primary); stroke-width: 1.6;
  stroke-linecap: round; opacity: .2;
}
.bodymap__hot {
  cursor: pointer; fill: var(--primary); fill-opacity: 0;
  stroke: var(--primary); stroke-width: 1.2; stroke-opacity: .28; stroke-dasharray: 3 5;
  transition: fill-opacity var(--t-fast) var(--ease), stroke-opacity var(--t-fast) var(--ease),
              stroke-width var(--t-fast) var(--ease);
}
.bodymap__hot:hover { fill-opacity: .22; stroke-opacity: .8; stroke-dasharray: none; }
.bodymap__hot[aria-pressed="true"] {
  fill: var(--accent); stroke: var(--accent);
  fill-opacity: .26; stroke-opacity: 1; stroke-width: 2.2; stroke-dasharray: none;
}
/* nessun contorno al clic col puntatore: resta solo per la navigazione da tastiera */
.bodymap__hot:focus { outline: none; }
.bodymap__hot:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.bodymap__chip:focus { outline: none; }
.bodymap__chip:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.bodymap__hint {
  margin-top: var(--space-s); display: flex; align-items: center; justify-content: center;
  gap: .4rem; font-size: var(--step--1); color: var(--ink-faint);
}
.bodymap__hint svg { width: 16px; height: 16px; }
.bodymap__chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: var(--space-s); justify-content: center; }
.bodymap__chip {
  padding: .4rem .85rem; border-radius: var(--r-full);
  border: 1.5px solid var(--border); background: var(--surface);
  font-size: var(--step--1); font-weight: 600; color: var(--ink-soft);
  min-height: 36px;
  transition: all var(--t-fast) var(--ease);
}
.bodymap__chip:hover { border-color: var(--primary); color: var(--primary); }
.bodymap__chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }

.bodymap__panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: clamp(1.5rem, 3vw, 2.25rem);
  box-shadow: var(--shadow-s); min-height: 340px;
}
.bodymap__panel h3 { font-size: var(--step-2); }
.bodymap__panel-body { animation: fadeUp var(--t-slow) var(--ease-out) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } }
.bodymap__list { display: grid; gap: .5rem; margin-top: var(--space-s); }
.bodymap__list li { display: flex; gap: .6rem; align-items: flex-start; color: var(--ink-soft); }
.bodymap__list svg { width: 18px; height: 18px; color: var(--accent); flex: none; margin-top: 5px; }
.bodymap__sub { margin-top: var(--space-m); font-weight: 600; color: var(--ink); font-size: var(--step-0); }
.bodymap__links { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }

/* ------------------------------------------------------------- timeline */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: .6rem; bottom: .6rem;
  width: 2px; background: linear-gradient(var(--primary-line), transparent);
}
.timeline__item { position: relative; padding-bottom: var(--space-l); }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item::before {
  content: ""; position: absolute; left: -2rem; top: .45rem;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--primary);
}
.timeline__year {
  font-size: var(--step--1); font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent);
}
.timeline__item h3 { font-size: var(--step-1); margin: .25rem 0 .4rem; }
.timeline__item p { color: var(--ink-soft); }

/* ----------------------------------------------------------------- stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--space-m); }
.stats--2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 639px) { .stats { grid-template-columns: repeat(2, 1fr); gap: var(--space-s); } }
.stat { text-align: center; padding: var(--space-m) var(--space-s); }
.stat__value {
  font-family: var(--font-display); font-size: var(--step-4); font-weight: 500;
  line-height: 1; color: var(--primary); font-variant-numeric: tabular-nums;
}
.stat__label { margin-top: .5rem; font-size: var(--step--1); color: var(--ink-soft); }

/* ------------------------------------------------------------ accordion */
.accordion { border-top: 1px solid var(--border); }
.accordion__item { border-bottom: 1px solid var(--border); }
.accordion__trigger {
  width: 100%; display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-s);
  padding: 1.35rem .25rem; text-align: left;
  font-family: var(--font-display); font-size: var(--step-1); font-weight: 500; color: var(--ink);
  transition: color var(--t-fast) var(--ease);
}
.accordion__trigger:hover { color: var(--primary); }
.accordion__sign {
  flex: none; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; border: 1.5px solid var(--border);
  color: var(--primary); margin-top: 2px;
  transition: transform var(--t-base) var(--ease), background var(--t-base) var(--ease), border-color var(--t-base) var(--ease);
}
.accordion__sign svg { width: 16px; height: 16px; }
.accordion__trigger[aria-expanded="true"] .accordion__sign { transform: rotate(45deg); background: var(--primary-soft); border-color: var(--primary-line); }
.accordion__panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--t-base) var(--ease); }
.accordion__panel[data-open="true"] { grid-template-rows: 1fr; }
.accordion__panel > div { overflow: hidden; }
.accordion__panel p { padding: 0 3rem 1.5rem .25rem; color: var(--ink-soft); max-width: 72ch; }

/* --------------------------------------------------------- testimonianze */
.quotes { position: relative; }
.quotes__viewport { overflow: hidden; }
.quotes__track { display: flex; transition: transform var(--t-slow) var(--ease-out); }
@media (prefers-reduced-motion: reduce) { .quotes__track { transition: none; } }
.quote { flex: 0 0 100%; padding: .5rem; }
@media (min-width: 1000px) { .quote { flex: 0 0 50%; } }
.quote__inner {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl);
  padding: clamp(1.75rem, 4vw, 3rem); box-shadow: var(--shadow-s);
  display: flex; flex-direction: column; gap: var(--space-m); height: 100%;
}
.quote__mark { width: 40px; height: 32px; color: var(--primary-line); }
.quote blockquote { font-family: var(--font-display); font-size: var(--step-1); line-height: 1.55; color: var(--ink); }
.quote figcaption { display: flex; align-items: center; gap: .75rem; font-size: var(--step--1); color: var(--ink-soft); }
.quote__avatar {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  background: var(--primary-soft); color: var(--primary);
  display: grid; place-items: center; font-weight: 700; font-size: 1rem;
}
.quote figcaption strong { display: block; color: var(--ink); font-size: var(--step-0); }
.quotes__controls { display: flex; align-items: center; justify-content: center; gap: .6rem; margin-top: var(--space-m); }
.quotes__dots { display: flex; gap: .4rem; }
.quotes__dot {
  width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong);
  transition: background var(--t-fast) var(--ease), width var(--t-fast) var(--ease);
}
.quotes__dot[aria-current="true"] { background: var(--primary); width: 26px; border-radius: var(--r-full); }
.quotes__dot-hit { display: grid; place-items: center; width: 32px; height: 32px; }

/* ---------------------------------------------------------------- prezzi */
.pricing { border: 1px solid var(--border); border-radius: var(--r-xl); overflow: hidden; background: var(--surface); }
.pricing__row {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem var(--space-m);
  padding: 1.15rem clamp(1rem, 3vw, 1.75rem); border-bottom: 1px solid var(--border);
  transition: background var(--t-fast) var(--ease);
}
.pricing__row:last-child { border-bottom: 0; }
.pricing__row:hover { background: var(--surface-2); }
.pricing__name { font-weight: 600; font-size: var(--step-0); flex: 1 1 240px; }
.pricing__note { flex: 1 1 100%; font-size: var(--step--1); color: var(--ink-soft); order: 3; }
.pricing__price {
  font-family: var(--font-display); font-size: var(--step-2); color: var(--primary);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.pricing__price small { font-family: var(--font-sans); font-size: var(--step--1); color: var(--ink-faint); font-weight: 600; }

/* ------------------------------------------------------------------ note */
.note {
  display: flex; gap: .9rem; align-items: flex-start;
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: var(--r-m); padding: var(--space-s) var(--space-m);
  font-size: var(--step--1); color: var(--ink-soft);
}
.note svg { width: 20px; height: 20px; color: var(--accent); flex: none; margin-top: 2px; }
.note strong { color: var(--ink); }

/* ------------------------------------------------------------------- CTA */
.cta-band {
  position: relative; overflow: hidden;
  background: var(--primary); color: var(--on-primary);
  border-radius: var(--r-xl); padding: clamp(2.25rem, 5vw, 4rem);
  text-align: center;
}
:root[data-theme="dark"] .cta-band { background: var(--primary-soft); color: var(--ink); }
.cta-band::before {
  content: ""; position: absolute; inset: -50% -20% auto -20%; height: 200%;
  background: radial-gradient(40% 40% at 20% 20%, rgba(255,255,255,.14), transparent 70%),
              radial-gradient(45% 45% at 85% 80%, rgba(255,255,255,.1), transparent 70%);
  pointer-events: none;
}
.cta-band > * { position: relative; }
.cta-band h2 { color: inherit; }
.cta-band p { color: inherit; opacity: .85; max-width: 56ch; margin-inline: auto; margin-top: var(--space-s); }
.cta-band .btn-row { margin-top: var(--space-l); }

/* ------------------------------------------------------------------ prose */
.prose { max-width: 72ch; }
.prose > * + * { margin-top: var(--space-s); }
.prose h2 { font-size: var(--step-2); margin-top: var(--space-xl); }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: var(--space-l); }
.prose p, .prose li { color: var(--ink-soft); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose ul { display: grid; gap: .65rem; margin-top: var(--space-s); }
.prose ul li { display: flex; gap: .75rem; align-items: flex-start; }
.prose ul li::before {
  content: ""; flex: none; width: 7px; height: 7px; margin-top: .65em;
  border-radius: 50%; background: var(--accent);
}
.prose a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }

.article-layout { display: grid; gap: var(--space-xl); align-items: start; }
@media (min-width: 1000px) { .article-layout { grid-template-columns: minmax(0, 1fr) 320px; } }
.sidebar { display: grid; gap: var(--space-m); position: sticky; top: calc(var(--header-h) + 1.5rem); }
@media (max-width: 999px) { .sidebar { position: static; } }
.sidebar__card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-l); padding: var(--space-m); }
.sidebar__card h3 { font-size: var(--step-1); margin-bottom: .75rem; }
.sidebar__list { display: grid; gap: .3rem; }
.sidebar__list a {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .55rem .6rem; border-radius: var(--r-s); font-size: var(--step--1);
  color: var(--ink-soft); transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.sidebar__list a:hover { background: var(--surface); color: var(--primary); }
.sidebar__list a[aria-current="page"] { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.sidebar__list svg { width: 14px; height: 14px; flex: none; }

/* ------------------------------------------------------------ breadcrumb */
.breadcrumb { padding-top: var(--space-m); }
.breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; font-size: var(--step--1); color: var(--ink-faint); }
.breadcrumb a { color: var(--ink-soft); }
.breadcrumb a:hover { color: var(--primary); text-decoration: underline; }
.breadcrumb svg { width: 12px; height: 12px; opacity: .6; }

.page-head { padding-block: clamp(2rem, 4vw, 3.5rem) clamp(1.5rem, 3vw, 2.5rem); }
.page-head h1 { margin-top: var(--space-s); }
.page-head .lead { margin-top: var(--space-m); max-width: 60ch; }
.page-head__grid { display: grid; gap: var(--space-l); align-items: center; }
.page-head__grid > .portrait { order: -1; }
@media (min-width: 768px) {
  .page-head__grid { grid-template-columns: 1fr auto; gap: clamp(2rem, 5vw, 4.5rem); }
  .page-head__grid > .portrait { order: 0; }
}
.portrait {
  width: clamp(132px, 34vw, 300px); aspect-ratio: 1; margin: 0; flex: none;
  border-radius: 50%; overflow: hidden; position: relative;
  background: linear-gradient(160deg, var(--primary-soft), var(--accent-soft));
  box-shadow: 0 0 0 6px var(--surface), 0 0 0 7px var(--border), var(--shadow-m);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.portrait__placeholder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--primary-line); }
.portrait__icon { width: 38%; height: 38%; stroke-width: 1.1; }

/* ------------------------------------------------------------------ form */
.form { display: grid; gap: var(--space-m); }
.field { display: grid; gap: .4rem; }
.field label { font-weight: 600; font-size: var(--step--1); }
.field .req { color: var(--accent); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 48px; padding: .75rem 1rem;
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--r-m);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:hover, .field textarea:hover, .field select:hover { border-color: var(--border-strong); }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 16%, transparent);
}
.field__help { font-size: var(--step--1); color: var(--ink-faint); }
.field__error { font-size: var(--step--1); color: #B3261E; font-weight: 600; display: none; }
:root[data-theme="dark"] .field__error { color: #F2B8B5; }
.field[data-invalid="true"] .field__error { display: block; }
.field[data-invalid="true"] input, .field[data-invalid="true"] textarea { border-color: #B3261E; }
.form__row { display: grid; gap: var(--space-m); }
@media (min-width: 640px) { .form__row { grid-template-columns: 1fr 1fr; } }
.checkbox { display: flex; gap: .7rem; align-items: flex-start; font-size: var(--step--1); color: var(--ink-soft); }
.checkbox input { width: 22px; height: 22px; min-height: 22px; margin-top: 2px; flex: none; accent-color: var(--primary); }
.form__status { font-size: var(--step--1); font-weight: 600; }

/* ------------------------------------------------------------------ mappa */
.map-embed {
  border-radius: var(--r-xl); overflow: hidden; border: 1px solid var(--border);
  background: var(--surface-2); aspect-ratio: 16 / 10;
}
.map-embed iframe { width: 100%; height: 100%; border: 0; display: block; }
.map-embed__icon { width: 40px; height: 40px; color: var(--primary); margin-inline: auto; }

/* ----------------------------------------------------------------- footer */
.footer { background: var(--bg-alt); border-top: 1px solid var(--border); padding-block: var(--space-2xl) var(--space-l); margin-top: var(--space-2xl); }
.footer__grid { display: grid; gap: var(--space-l); }
@media (min-width: 760px) { .footer__grid { grid-template-columns: 1.4fr 1fr 1fr; gap: var(--space-xl); } }
.footer h4 { font-family: var(--font-sans); font-size: var(--step--1); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: var(--space-s); }
.footer__links { display: grid; gap: .5rem; }
.footer__links a { color: var(--ink-soft); font-size: var(--step-0); transition: color var(--t-fast) var(--ease); }
.footer__links a:hover { color: var(--primary); }
.footer address { font-style: normal; color: var(--ink-soft); display: grid; gap: .45rem; margin-top: var(--space-s); }
.footer address a { color: var(--ink); font-weight: 600; }
.footer address a:hover { color: var(--primary); }
.footer__bottom {
  margin-top: var(--space-xl); padding-top: var(--space-m); border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; gap: var(--space-s) var(--space-m); justify-content: space-between;
  font-size: var(--step--1); color: var(--ink-faint);
}
.footer__social { display: flex; gap: .5rem; }

/* ------------------------------------------------------- barra mobile CTA */
.callbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-header);
  display: grid; grid-template-columns: 1fr 1fr; gap: .5rem;
  padding: .6rem .75rem calc(.6rem + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  transform: translateY(110%); transition: transform var(--t-base) var(--ease);
}
.callbar.is-visible { transform: none; }
.callbar .btn { min-height: 46px; padding-inline: .75rem; font-size: .92rem; }
@media (min-width: 880px) { .callbar { display: none; } }
@media (max-width: 879px) { body { padding-bottom: 4.5rem; } }

/* ------------------------------------------------------- reveal on scroll */
.reveal { opacity: 0; transform: translateY(22px); }
.reveal.is-in { opacity: 1; transform: none; transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out); }
.reveal-stagger > * { opacity: 0; transform: translateY(18px); }
.reveal-stagger.is-in > * { opacity: 1; transform: none; transition: opacity 620ms var(--ease-out), transform 620ms var(--ease-out); }
.reveal-stagger.is-in > *:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger.is-in > *:nth-child(2) { transition-delay: 70ms; }
.reveal-stagger.is-in > *:nth-child(3) { transition-delay: 140ms; }
.reveal-stagger.is-in > *:nth-child(4) { transition-delay: 210ms; }
.reveal-stagger.is-in > *:nth-child(5) { transition-delay: 280ms; }
.reveal-stagger.is-in > *:nth-child(6) { transition-delay: 350ms; }
.reveal-stagger.is-in > *:nth-child(n+7) { transition-delay: 420ms; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-stagger > * { opacity: 1 !important; transform: none !important; transition: none !important; }
  .hero__glow { animation: none; }
  .bodymap__panel-body { animation: none; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@media print {
  .header, .drawer, .callbar, .quotes__controls, .map-embed, .btn { display: none !important; }
  body { color: #000; background: #fff; }
}


/* ------------------------------------------------------------------ video */
.video-card { display: flex; flex-direction: column; }
.video-card__frame {
  position: relative; display: block; width: 100%; padding: 0;
  aspect-ratio: 16 / 9; border: 0; border-radius: var(--r-l); overflow: hidden;
  background: var(--surface-2); cursor: pointer;
  box-shadow: var(--shadow-s);
  transition: transform var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease);
}
.video-card__frame:hover { transform: translateY(-3px); box-shadow: var(--shadow-m); }
.video-card__frame img { width: 100%; height: 100%; object-fit: cover; }
.video-card__frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.video-card__frame::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(10,44,48,.05), rgba(10,44,48,.42));
  transition: background var(--t-base) var(--ease);
}
.video-card__frame:hover::after { background: linear-gradient(180deg, rgba(10,44,48,.02), rgba(10,44,48,.3)); }
.video-card__play {
  position: absolute; inset: 0; margin: auto;
  width: 68px; height: 68px; border-radius: 50%;
  display: grid; place-items: center; pointer-events: none;
  background: var(--surface); color: var(--primary);
  box-shadow: var(--shadow-m); z-index: 1;
  transition: transform var(--t-base) var(--ease-out);
}
.video-card__frame:hover .video-card__play { transform: scale(1.08); }
.video-card__play svg { width: 26px; height: 26px; margin-left: 3px; }
.video-card h3 { margin-top: var(--space-s); font-size: var(--step-1); }
.video-card p { color: var(--ink-soft); margin-top: .35rem; font-size: var(--step-0); }
.video-card__note { margin-top: .5rem; font-size: var(--step--1); color: var(--ink-faint);
  display: flex; align-items: center; gap: .35rem; font-variant-numeric: tabular-nums; }
.video-card__note svg { width: 14px; height: 14px; }

/* --------------------------------------------------------------- galleria */
.tiles { display: grid; gap: var(--space-s); grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.tile {
  position: relative; display: block; padding: 0; width: 100%;
  aspect-ratio: 4 / 3; border: 1px solid var(--border); border-radius: var(--r-l);
  overflow: hidden; background: var(--surface-2); cursor: pointer;
  transition: transform var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease);
}
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-m); }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-slow) var(--ease-out); }
.tile:hover img { transform: scale(1.05); }
.tile__label {
  position: absolute; inset: auto 0 0 0; padding: 2.2rem .9rem .8rem;
  display: flex; align-items: flex-end; justify-content: space-between; gap: .5rem;
  background: linear-gradient(transparent, rgba(8,34,38,.82));
  color: #fff; font-size: var(--step--1); font-weight: 600; text-align: left;
}
.tile__label svg { width: 18px; height: 18px; flex: none; opacity: .85; }

/* ---------------------------------------------------------------- diplomi */
.diplomas { display: grid; gap: .6rem; margin-top: var(--space-m); }
/* dentro .prose gli elenchi hanno il pallino: qui non serve */
.prose .diplomas li::before { content: none; }
.prose .diplomas li { display: grid; }
/* telefono: icona a sinistra, testo e pulsante impilati accanto; da 640px tutto su una riga */
.diploma {
  grid-template-columns: 40px minmax(0, 1fr); align-items: start; gap: .7rem var(--space-s);
  padding: 1rem 1.1rem; border: 1px solid var(--border); border-radius: var(--r-m);
  background: var(--surface);
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.diploma > .btn { grid-column: 2; justify-self: start; }
@media (min-width: 640px) {
  .diploma { grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; }
  .diploma > .btn { grid-column: auto; }
}
.diploma:hover { border-color: var(--primary-line); background: var(--surface-2); }
.diploma__icon { margin-top: -2px;
  width: 40px; height: 40px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary);
}
.diploma__icon svg { width: 20px; height: 20px; }
.diploma__body { min-width: 0; }
.prose .diploma__body h3 { margin: 0; }
.diploma__body h3 { font-size: var(--step-0); font-family: var(--font-sans); font-weight: 600; line-height: 1.35; }
.diploma__meta { font-size: var(--step--1); color: var(--ink-soft); margin-top: .2rem; }
.diploma .btn { flex: none; }

/* -------------------------------------------------------------- lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: var(--z-top);
  display: grid; grid-template-rows: auto 1fr auto; gap: var(--space-s);
  padding: var(--space-s);
  background: rgba(6, 26, 29, .93);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: 0; transition: opacity var(--t-base) var(--ease);
}
/* display:grid sovrascriverebbe l'attributo hidden: va ripristinato a mano.
   Niente transizione su visibility, altrimenti il focus iniziale non aggancia. */
.lightbox[hidden] { display: none; }
.lightbox:focus { outline: none; }
.lightbox.is-open { opacity: 1; }
.lightbox__bar { display: flex; align-items: center; justify-content: flex-end; gap: .5rem; }
.lightbox__stage {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center; gap: var(--space-s); min-height: 0;
}
.lightbox__figure {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--space-s); min-height: 0; height: 100%;
}
.lightbox__figure img {
  max-width: 100%; max-height: calc(100dvh - 12rem); width: auto; height: auto;
  object-fit: contain; border-radius: var(--r-m); background: #fff;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .8);
}
.lightbox figcaption {
  color: #E9EFEE; text-align: center; font-size: var(--step--1); max-width: 62ch;
}
.lightbox figcaption strong { display: block; font-size: var(--step-0); color: #fff; margin-bottom: .2rem; }
.lightbox .icon-btn {
  color: #E9EFEE; border-color: rgba(233, 239, 238, .35); background: rgba(255, 255, 255, .06);
}
.lightbox .icon-btn:hover { color: #fff; border-color: #fff; background: rgba(255, 255, 255, .16); }
.lightbox__count { color: #A9C0C2; font-size: var(--step--1); margin-right: auto; align-self: center; }
@media (max-width: 640px) {
  .lightbox__stage { grid-template-columns: 1fr; }
  .lightbox__nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; }
  .lightbox__prev { left: 0; }
  .lightbox__next { right: 0; }
}
