/* ── Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* palette: quasi nero tendente al blu, un solo blu usato con parsimonia */
  --bg:      oklch(0.155 0.008 255);
  --band:    oklch(0.195 0.011 255);
  --surface: oklch(0.235 0.013 255);
  --line:    oklch(1 0 0 / 0.12);
  --ink:        oklch(0.965 0.004 250);
  --muted:      oklch(0.79 0.012 250);
  --accent:     oklch(0.42 0.14 262);
  --accent-dark: oklch(0.36 0.12 262);
  --accent-ink: oklch(0.62 0.14 258);

  --font-display: 'Big Shoulders Display', 'Arial Narrow', sans-serif;
  --font-text: 'Source Sans 3', 'Segoe UI', system-ui, sans-serif;

  --nav-h: 68px;
  --wrap: 1200px;
  --gutter: clamp(20px, 4vw, 40px);
  --space-section: clamp(72px, 10vw, 136px);
  --radius: 6px;

  --ease-out: cubic-bezier(0.25, 1, 0.5, 1);

  --z-nav: 100;
  --z-dialog: 1000;
}

html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 1.125rem;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { display: block; max-width: 100%; }
ul { list-style: none; }
button { font: inherit; color: inherit; }

h1, h2, h3, h4 { text-wrap: balance; }
p { text-wrap: pretty; }

:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 3px; }

.container {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ── Tipografia condivisa ─────────────────────────── */
.titolo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3rem, 6.5vw, 5.5rem);
  line-height: 0.92;
  text-transform: uppercase;
  letter-spacing: 0.005em;
  margin-bottom: 28px;
}
.testo { color: var(--muted); max-width: 62ch; }
.testo + .testo { margin-top: 14px; }
.testo--piccolo { font-size: 1rem; }

.intestazione {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px 64px;
  align-items: end;
  margin-bottom: clamp(40px, 5vw, 64px);
}
.intestazione .titolo { margin-bottom: 0; }
.intestazione .testo { padding-bottom: 8px; }

/* ── Bottoni e link ───────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 12px 26px;
  border-radius: 100px;
  border: 1.5px solid transparent;
  font-family: var(--font-text);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.25s var(--ease-out), border-color 0.25s var(--ease-out), color 0.25s var(--ease-out);
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-dark); }
.btn--ghost { border-color: oklch(1 0 0 / 0.45); color: var(--ink); }
.btn--ghost:hover { border-color: var(--ink); background: oklch(1 0 0 / 0.06); }
.btn--full { width: 100%; }

.link-freccia {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent-ink);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
  transition: text-underline-offset 0.25s var(--ease-out), color 0.25s var(--ease-out);
}
.link-freccia:hover { color: var(--accent-ink); text-underline-offset: 9px; }

/* ── NAV ──────────────────────────────────────────── */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: var(--z-nav);
  height: var(--nav-h);
  display: flex;
  align-items: center;
  transition: background-color 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: oklch(0.155 0.008 255 / 0.94);
  border-bottom-color: var(--line);
}
.nav__inner {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.nav__logo {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.75rem;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
}
.nav__links { display: flex; align-items: center; gap: 4px; }
.nav__links a {
  display: block;
  padding: 8px 12px;
  font-weight: 600;
  font-size: 1rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s var(--ease-out);
}
.nav__links a:hover { color: var(--ink); }
.nav__links .nav__cta {
  margin-left: 8px;
  padding: 9px 20px;
  border-radius: 100px;
  background: var(--accent);
  color: #fff;
}
.nav__links .nav__cta:hover { background: var(--accent-dark); color: #fff; }
.nav__burger {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px 4px;
}
.nav__burger span {
  display: block;
  width: 26px;
  height: 2px;
  background: var(--ink);
  transition: transform 0.3s var(--ease-out), opacity 0.3s var(--ease-out);
}
.nav__burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav__burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ── APERTURA ─────────────────────────────────────── */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: clamp(28px, 4vh, 48px);
  padding: calc(var(--nav-h) + 40px) 0 clamp(24px, 4vh, 40px);
}
.hero__content { width: 100%; padding-top: clamp(0px, 6vh, 64px); }
.hero__place { font-weight: 600; color: var(--muted); margin-bottom: 14px; }
.hero__title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(3.25rem, 8.5vw, 6rem);
  line-height: 0.88;
  text-transform: uppercase;
  letter-spacing: 0;
  margin-bottom: 22px;
}
.hero__title span { color: var(--accent-ink); }
.hero__sub {
  font-size: clamp(1.125rem, 1.6vw, 1.3rem);
  color: var(--ink);
  max-width: 60ch;
}

.porte {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
  flex: 1;
}
.porta {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  min-height: 260px;
  padding: clamp(20px, 3vw, 32px);
  border-radius: var(--radius);
  overflow: hidden;
  isolation: isolate;
  text-decoration: none;
  color: var(--ink);
  background: var(--surface);
}
.porta img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  transition: transform 0.9s var(--ease-out);
}
.porta::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top, oklch(0.12 0.008 255 / 0.92) 0%, oklch(0.12 0.008 255 / 0.35) 55%, oklch(0.12 0.008 255 / 0.1) 100%);
}
.porta:hover img { transform: scale(1.04); }
.porta__testo { display: grid; gap: 4px; }
.porta__nome {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.4rem, 4.6vw, 3.75rem);
  line-height: 0.9;
  text-transform: uppercase;
}
.porta__desc { color: var(--ink); opacity: 0.9; }
.porta__freccia {
  flex: none;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 1.5rem;
  transition: transform 0.3s var(--ease-out), background-color 0.3s var(--ease-out);
}
.porta:hover .porta__freccia { transform: translateX(4px); background: var(--accent-dark); }

/* ── INIZIO DI OGNI PARTE (scuola / live) ──────────── */
.parte {
  position: relative;
  min-height: clamp(420px, 70vh, 640px);
  display: flex;
  align-items: flex-end;
  padding: 120px 0 clamp(48px, 7vw, 88px);
  overflow: hidden;
  isolation: isolate;
  border-top: 1px solid var(--line);
}
.parte__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}
.parte::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to top, var(--bg) 0%, oklch(0.155 0.008 255 / 0.75) 45%, oklch(0.155 0.008 255 / 0.35) 100%),
    linear-gradient(to right, oklch(0.155 0.008 255 / 0.7), transparent 70%);
}
.parte__testo { width: 100%; }
.parte__etichetta { font-weight: 700; color: var(--accent-ink); margin-bottom: 8px; }
.parte__titolo {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(4rem, 12vw, 9.5rem);
  line-height: 0.85;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.parte__intro { font-size: clamp(1.125rem, 1.6vw, 1.3rem); max-width: 52ch; margin-bottom: 8px; }
.parte .btn { margin-top: 24px; }

/* ── SEZIONI ──────────────────────────────────────── */
.section { padding: var(--space-section) 0; }
.section--band { background: var(--band); }

/* ── CORSI ────────────────────────────────────────── */
.corsi__layout {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(40px, 7vw, 112px);
  align-items: start;
}
.corsi__intro { position: sticky; top: calc(var(--nav-h) + 32px); }
.corsi__intro .btn { margin-top: 32px; }
.corsi__gruppo + .corsi__gruppo { margin-top: 48px; }
.corsi__gruppo-titolo {
  font-family: var(--font-text);
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent-ink);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.corso {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 8px 32px;
  align-items: baseline;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.corso__nome {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.9rem, 3vw, 2.5rem);
  line-height: 1;
  text-transform: uppercase;
}
.corso__desc { color: var(--muted); }

/* ── LABORATORIO BAMBINI ──────────────────────────── */
/* sfondo preso dal volantino del cliente, così l'immagine si fonde con la sezione */
.laboratorio { background: rgb(34 22 70); }
.laboratorio__layout {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(40px, 7vw, 104px);
  align-items: center;
}
.laboratorio__volantino img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: 0 8px 8px -4px rgb(0 0 0 / 0.35);
}
.laboratorio__per { font-weight: 700; color: rgb(247 148 29); margin-bottom: 12px; }
.laboratorio__motto {
  font-size: clamp(1.125rem, 1.6vw, 1.3rem);
  font-style: italic;
  color: var(--ink);
  max-width: 44ch;
}
.laboratorio__giochi {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 28px;
  margin: 28px 0 32px;
}
.laboratorio__gioco {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
  text-transform: uppercase;
  line-height: 1.1;
}
.laboratorio__gioco--rosso { color: rgb(245 96 105); }
.laboratorio__gioco--arancio { color: rgb(247 148 29); }
.laboratorio__gioco--azzurro { color: rgb(38 170 226); }
.laboratorio__info {
  display: grid;
  grid-template-columns: repeat(2, auto);
  justify-content: start;
  gap: 16px 40px;
  padding: 22px 0;
  margin-bottom: 32px;
  border-top: 1px solid oklch(1 0 0 / 0.18);
  border-bottom: 1px solid oklch(1 0 0 / 0.18);
}
.laboratorio__info dt { font-size: 0.9375rem; color: oklch(0.85 0.03 280); }
.laboratorio__info dd { font-weight: 700; font-size: 1.125rem; }
.laboratorio .btn--primary { background: var(--ink); color: rgb(34 22 70); }
.laboratorio .btn--primary:hover { background: #fff; }

/* ── INSEGNANTI ───────────────────────────────────── */
.docenti {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(40px, 5vw, 72px);
  margin-top: clamp(32px, 4vw, 48px);
}
.docente__foto {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 28px;
}
.docente__foto img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
  transition: transform 0.8s var(--ease-out);
}
.docente__foto--alessandra img { object-position: 35% 40%; }
.docente:hover .docente__foto img { transform: scale(1.03); }
.docente__ruolo { font-weight: 700; color: var(--accent-ink); margin-bottom: 6px; }
.docente__nome {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.5rem, 4.5vw, 3.75rem);
  line-height: 0.95;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.docente .link-freccia { margin-top: 22px; }

/* ── EVENTI ───────────────────────────────────────── */
.eventi {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  grid-template-rows: auto auto;
  gap: 24px;
}
.evento {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
  min-height: 280px;
}
.evento--grande { grid-row: span 2; min-height: 580px; }
.evento img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease-out);
}
.evento:hover img { transform: scale(1.03); }
.evento figcaption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 80px 28px 26px;
  background: linear-gradient(to top, oklch(0.12 0.008 255 / 0.95), transparent);
}
.evento h3 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.9rem, 3vw, 2.6rem);
  line-height: 1;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.evento--grande h3 { font-size: clamp(2.4rem, 4vw, 3.4rem); }
.evento p { color: var(--ink); opacity: 0.85; max-width: 44ch; }

.eventi__more { margin-top: 40px; }
.videoToggle__count {
  font-weight: 400;
  padding-left: 12px;
  border-left: 1px solid oklch(1 0 0 / 0.4);
}

/* ── VIDEO ────────────────────────────────────────── */
.video.is-open .intestazione,
.video.is-open .video-card { animation: comparsa 0.7s var(--ease-out) both; }
.video.is-open .video-card:nth-child(3n+2) { animation-delay: 0.06s; }
.video.is-open .video-card:nth-child(3n+3) { animation-delay: 0.12s; }
@keyframes comparsa {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: none; }
}

.video__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px 24px;
}
.video-card__thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: var(--radius);
  background: #000 center / cover no-repeat;
  cursor: pointer;
  overflow: hidden;
  margin-bottom: 14px;
}
.video-card__thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: oklch(0.12 0.008 255 / 0.25);
  transition: background-color 0.3s var(--ease-out);
}
.video-card__thumb:hover::after { background: oklch(0.12 0.008 255 / 0); }
.video-card__play {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 1;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  transition: transform 0.3s var(--ease-out);
}
.video-card__play::before {
  content: '';
  position: absolute;
  left: 21px;
  top: 17px;
  border-style: solid;
  border-width: 9px 0 9px 14px;
  border-color: transparent transparent transparent #fff;
}
.video-card__thumb:hover .video-card__play { transform: scale(1.1); }
.video-card__meta { font-size: 0.9375rem; color: var(--muted); }
.video-card__title { font-weight: 700; font-size: 1.1875rem; line-height: 1.35; }

/* ── SERVIZI ──────────────────────────────────────── */
.servizi {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}
.servizio {
  display: flex;
  flex-direction: column;
  padding: 36px 36px 8px 0;
}
.servizio + .servizio { padding-left: 36px; border-left: 1px solid var(--line); }
.servizio__nome {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 3vw, 2.6rem);
  line-height: 1;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.servizio__desc { color: var(--muted); margin-bottom: 18px; }
.servizio__lista { margin-bottom: 28px; }
.servizio__lista li { padding: 6px 0; border-top: 1px solid var(--line); }
.servizio .link-freccia { margin-top: auto; align-self: flex-start; }

/* ── GALLERIA ─────────────────────────────────────── */
/* righe giustificate: ogni riga ha la stessa altezza e occupa tutta la larghezza,
   le foto si vedono intere e l'ordine si legge da sinistra a destra */
.galleria {
  --riga: 210px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.galleria::after { content: ''; flex-grow: 1000000; }
.foto {
  position: relative;
  flex: var(--r) 1 calc(var(--r) * var(--riga));
  aspect-ratio: var(--r);
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  cursor: zoom-in;
}
.foto img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease-out), filter 0.4s var(--ease-out);
}
.foto::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 0 var(--accent-ink);
  transition: box-shadow 0.25s var(--ease-out);
}
.foto:hover img { transform: scale(1.04); }
.foto:hover::after,
.foto:focus-visible::after { box-shadow: inset 0 0 0 3px var(--accent-ink); }

/* ── CONTATTI ─────────────────────────────────────── */
.contatti {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: stretch;
}
.contatti__colonna { display: flex; flex-direction: column; }
.contatti__colonna .titolo { margin-bottom: 40px; }
.contatti__info { flex: 1; align-content: space-between; }
.contatti__info { display: grid; gap: 28px; }
.contatti__info dt { font-weight: 700; color: var(--accent-ink); font-size: 1rem; }
.contatti__info dd {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 2.4vw, 2rem);
  line-height: 1.15;
}
.contatti__info dd a { text-decoration: none; transition: color 0.2s var(--ease-out); }
.contatti__info dd a:hover { color: var(--accent-ink); }

.modulo {
  display: grid;
  gap: 18px;
  padding: clamp(24px, 3vw, 40px);
  background: var(--band);
  border-radius: var(--radius);
}
.modulo__titolo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2rem;
  text-transform: uppercase;
  line-height: 1;
}
.modulo__nota { color: var(--muted); font-size: 1rem; margin-top: -8px; }
.campo { display: grid; gap: 6px; }
.campo span { font-weight: 600; font-size: 0.9375rem; color: var(--muted); }
.campo input,
.campo select,
.campo textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.2s var(--ease-out);
}
.campo input:focus,
.campo select:focus,
.campo textarea:focus { border-color: var(--accent-ink); }
.campo select option { background: var(--band); }
.campo textarea { resize: vertical; }
.campo textarea::placeholder { color: oklch(0.62 0.01 250); }

.mappa {
  margin-top: clamp(48px, 6vw, 80px);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--band);
}
.mappa__frame {
  display: block;
  width: 100%;
  height: 400px;
  border: 0;
  /* mappa scura in tono col sito */
  filter: invert(0.9) hue-rotate(180deg) saturate(0.8) brightness(0.95);
}
.mappa__barra {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  padding: 20px clamp(20px, 3vw, 32px);
}
.mappa__indirizzo { color: var(--muted); }
.mappa__indirizzo strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.6rem;
  line-height: 1.1;
  text-transform: uppercase;
  color: var(--ink);
}

/* ── FOOTER ───────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--line);
  padding: 48px 0;
  color: var(--muted);
  font-size: 1rem;
}
.footer__inner { display: grid; gap: 4px; }
.footer__logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  text-transform: uppercase;
  color: var(--ink);
}
.footer__social { margin-top: 12px; }

/* icone social */
.social { display: flex; gap: 12px; }
.contatti__info dd.social { margin-top: 8px; }
.social__link {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1.5px solid oklch(1 0 0 / 0.35);
  color: var(--ink);
  transition: background-color 0.25s var(--ease-out), border-color 0.25s var(--ease-out), color 0.25s var(--ease-out);
}
.social__link:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.social__link svg { width: 24px; height: 24px; }
.social__link--piccolo { width: 44px; height: 44px; }
.social__link--piccolo svg { width: 20px; height: 20px; }
.footer__copy { margin-top: 12px; font-size: 0.875rem; }

/* ── DIALOG (lightbox e player) ───────────────────── */
dialog {
  border: none;
  padding: 0;
  background: transparent;
  color: var(--ink);
  max-width: none;
  max-height: none;
  margin: auto;
  overflow: visible;
}
dialog::backdrop { background: oklch(0.1 0.006 255 / 0.94); }
.dialog__chiudi {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: var(--z-dialog);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--band);
  font-size: 1.25rem;
  cursor: pointer;
  transition: background-color 0.2s var(--ease-out);
}
.dialog__chiudi:hover { background: var(--accent); }

#lightbox { width: 100vw; height: 100dvh; display: none; }
#lightbox[open] { display: grid; place-items: center; }
.lightbox__figura { display: grid; justify-items: center; gap: 12px; padding: 64px 72px 24px; }
#lightboxImg {
  max-width: min(1400px, calc(100vw - 144px));
  max-height: calc(100dvh - 140px);
  width: auto;
  height: auto;
  border-radius: var(--radius);
  object-fit: contain;
}
#lightboxCaption { color: var(--muted); font-size: 1rem; text-align: center; }
.lightbox__nav {
  position: fixed;
  top: 50%;
  translate: 0 -50%;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--band);
  font-size: 1.4rem;
  cursor: pointer;
  transition: background-color 0.2s var(--ease-out);
}
.lightbox__nav:hover { background: var(--accent); }
.lightbox__nav--prev { left: 12px; }
.lightbox__nav--next { right: 12px; }

#videoModal { width: min(1100px, 92vw); }
.videoModal__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  max-height: 80vh;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
}
.videoModal__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.videoModal__yt {
  display: block;
  width: fit-content;
  margin: 14px auto 0;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}
.videoModal__yt:hover { color: var(--ink); }

/* ── COMPARSA ALLO SCROLL (solo con JS attivo) ────── */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}
.js .reveal.visible { opacity: 1; transform: none; }

/* entrata della hero al caricamento */
.js .hero__content > * { animation: comparsa 0.9s var(--ease-out) both; }
.js .hero__content > :nth-child(2) { animation-delay: 0.1s; }
.js .hero__content > :nth-child(3) { animation-delay: 0.2s; }
.js .hero__content > :nth-child(4) { animation-delay: 0.3s; }
@keyframes heroFoto {
  from { transform: scale(1.06); opacity: 0.4; }
  to   { transform: none; opacity: 1; }
}

/* ── CURRICULUM ───────────────────────────────────── */
.cv-hero {
  padding: calc(var(--nav-h) + clamp(32px, 5vw, 64px)) 0 clamp(56px, 7vw, 96px);
  border-bottom: 1px solid var(--line);
}
.cv-back {
  display: inline-block;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 40px;
  transition: color 0.2s var(--ease-out);
}
.cv-back:hover { color: var(--ink); }
.cv-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: end;
}
.cv-hero__foto {
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.cv-hero__foto img { width: 100%; height: 100%; object-fit: cover; object-position: 45% 35%; }
.cv-hero__ruolo { font-weight: 700; color: var(--accent-ink); margin-bottom: 10px; }
.cv-hero__nome {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(3.5rem, 9vw, 7.5rem);
  line-height: 0.86;
  text-transform: uppercase;
  margin-bottom: 24px;
}
.cv-hero__intro { font-size: clamp(1.125rem, 1.6vw, 1.3rem); max-width: 50ch; }
.cv-citazione {
  margin-top: 32px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  line-height: 1.05;
  text-transform: uppercase;
  max-width: 22ch;
}
.cv-citazione::before { content: '“'; color: var(--accent-ink); margin-right: 2px; }
.cv-citazione::after { content: '”'; color: var(--accent-ink); margin-left: 2px; }

.cv { padding: clamp(56px, 8vw, 112px) 0 var(--space-section); }
.cv__grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: clamp(40px, 7vw, 112px);
  align-items: start;
}
.cv__main, .cv__aside { display: grid; gap: clamp(48px, 6vw, 72px); }
.cv-block h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.2rem, 4vw, 3rem);
  line-height: 1;
  text-transform: uppercase;
  padding-bottom: 14px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.cv-block h3 { font-weight: 700; color: var(--accent-ink); font-size: 1rem; margin: 22px 0 6px; }
.cv-block h3:first-of-type { margin-top: 0; }
.cv-block p { color: var(--muted); max-width: 64ch; }
.cv-block p + p { margin-top: 14px; }
.cv-block strong { color: var(--ink); font-weight: 600; }

.cv-list li { padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--ink); }
.cv-list li:last-child { border-bottom: 0; }

.cv-timeline li {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  gap: 4px 24px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.cv-timeline li:last-child { border-bottom: 0; }
.cv-timeline__year { grid-row: span 3; font-weight: 700; color: var(--accent-ink); }
.cv-timeline__title { font-weight: 700; font-size: 1.1875rem; line-height: 1.35; }
.cv-timeline__org { color: var(--ink); opacity: 0.8; }
.cv-timeline__text { color: var(--muted); font-size: 1rem; }

.cv-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.cv-tags li {
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 100px;
  border: 1px solid var(--line);
}

.cv-cta {
  padding: 32px;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
}
.cv-cta h2 { border-bottom-color: oklch(1 0 0 / 0.3); }
.cv-cta p { color: #fff; margin-bottom: 20px; }
.cv-cta .btn { background: var(--bg); color: var(--ink); }
.cv-cta .btn:hover { background: #000; }

/* ── RESPONSIVE ───────────────────────────────────── */
@media (max-width: 1080px) {
  .nav__burger { display: flex; }
  .nav__links {
    position: fixed;
    inset: var(--nav-h) 0 0 0;
    overflow-y: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px var(--gutter) 28px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s var(--ease-out), opacity 0.3s var(--ease-out), visibility 0s linear 0.3s;
  }
  .nav__links.open {
    transform: none;
    opacity: 1;
    visibility: visible;
    transition: transform 0.3s var(--ease-out), opacity 0.3s var(--ease-out);
  }
  .nav__links a {
    padding: 14px 0;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.9rem;
    text-transform: uppercase;
    color: var(--ink);
    border-bottom: 1px solid var(--line);
  }
  .nav__links .nav__cta {
    margin: 20px 0 0;
    text-align: center;
    font-family: var(--font-text);
    font-size: 1.0625rem;
    text-transform: none;
    border-bottom: 0;
  }
  .nav.menu-aperto { background: var(--bg); border-bottom-color: var(--line); }

  .video__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .servizi { grid-template-columns: 1fr; border-top: 0; }
  .servizio,
  .servizio + .servizio { padding: 32px 0; border-left: 0; border-top: 1px solid var(--line); }
}

@media (max-width: 860px) {
  .intestazione,
  .corsi__layout,
  .laboratorio__layout,
  .docenti,
  .contatti,
  .cv-hero__grid,
  .cv__grid { grid-template-columns: 1fr; }
  .intestazione { gap: 16px; }
  .galleria { --riga: 170px; }
  .corsi__intro { position: static; }
  .eventi { grid-template-columns: 1fr; }
  .evento--grande { grid-row: auto; min-height: 420px; }
  .cv-hero__foto { max-width: 420px; }
}

@media (max-width: 600px) {
  body { font-size: 1.0625rem; }
  .hero__actions .btn { flex: 1 1 100%; }
  .corso { grid-template-columns: 1fr; gap: 4px; }
  .laboratorio__info { grid-template-columns: 1fr; gap: 12px; }
  .video__grid { grid-template-columns: 1fr; }
  .evento, .evento--grande { min-height: 340px; }
  .galleria { --riga: 120px; gap: 8px; }
  .mappa__frame { height: 300px; }
  .mappa__barra .btn { width: 100%; }
  .cv-timeline li { grid-template-columns: 1fr; }
  .cv-timeline__year { grid-row: auto; }
  .lightbox__figura { padding: 64px 12px 84px; }
  #lightboxImg { max-width: calc(100vw - 24px); max-height: calc(100dvh - 180px); }
  .lightbox__nav { top: auto; bottom: 16px; translate: none; }
  .lightbox__nav--prev { left: calc(50% - 64px); }
  .lightbox__nav--next { right: calc(50% - 64px); }
}

/* ── LIVE: occasioni e formazioni ─────────────────── */
.occasioni__foto { margin-top: 36px; border-radius: var(--radius); overflow: hidden; }
.occasioni__foto img { width: 100%; height: auto; }
.corsi__lista--occasioni { border-top: 1px solid var(--line); }
.formazioni {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(40px, 7vw, 112px);
  align-items: start;
}
.formazioni__lista { list-style: none; margin-bottom: 40px; }
.formazioni__lista li {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.7rem, 2.8vw, 2.3rem);
  line-height: 1;
  text-transform: uppercase;
}
.formazioni__sotto { font-weight: 700; color: var(--accent-ink); margin-bottom: 12px; font-size: 1rem; }
.servizio--live { padding: 32px; background: var(--bg); border-radius: var(--radius); }
.servizi--due { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.eventi--due { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: none; }
.eventi--due .evento { min-height: 440px; }
.section--band .eventi__more { margin-top: 56px; }

/* ── GALLERIA: filtri ─────────────────────────────── */
.filtri { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.filtro {
  min-height: 44px;
  padding: 8px 18px;
  border-radius: 100px;
  border: 1.5px solid oklch(1 0 0 / 0.3);
  background: transparent;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}
.filtro span { font-weight: 400; opacity: 0.75; margin-left: 4px; }
.filtro:hover { border-color: var(--ink); }
.filtro[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.foto[hidden] { display: none; }

/* separatore tra le due parti nel menu */
.nav__sep { width: 1px; height: 20px; margin: 0 6px; background: var(--line); }

@media (max-width: 1080px) {
  .nav__sep { width: auto; height: 1px; margin: 8px 0; background: transparent; }
}
@media (max-width: 860px) {
  .formazioni, .eventi--due, .servizi--due { grid-template-columns: 1fr; }
  .porte { grid-template-columns: 1fr; }
  .porta { min-height: 200px; }
  .occasioni__foto { display: none; }
}

/* ── APERTURA CON FOTO (home e pagina live) ───────── */
.parte--hero { min-height: 92svh; padding-top: calc(var(--nav-h) + 48px); border-top: 0; }
.parte__titolo span { color: var(--accent-ink); }
.parte--hero .parte__titolo { font-size: clamp(3.75rem, 10vw, 7.5rem); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero__actions .btn { margin-top: 0; }

.sottotitolo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 3.4vw, 2.8rem);
  text-transform: uppercase;
  line-height: 1;
  margin: clamp(56px, 7vw, 88px) 0 28px;
}
.video__grid--due { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 820px; }

/* rimando dalla home alla pagina live e service */
.rimando { padding: 0 0 var(--space-section); }
.rimando__link {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  min-height: 460px;
  padding: 40px clamp(24px, 4vw, 48px);
  border-radius: var(--radius);
  overflow: hidden;
  isolation: isolate;
  text-decoration: none;
  color: var(--ink);
}
.rimando__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* inquadra la parte alta della foto, dove ci sono i volti */
  object-position: 50% 18%;
  z-index: -2;
  border-radius: var(--radius);
  transition: transform 0.9s var(--ease-out);
}
.rimando__link::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: var(--radius);
  background: linear-gradient(to right, oklch(0.12 0.008 255 / 0.92) 0%, oklch(0.12 0.008 255 / 0.55) 60%, oklch(0.12 0.008 255 / 0.2) 100%);
}
.rimando__link:hover .rimando__img { transform: scale(1.03); }
.rimando__link:hover .porta__freccia { transform: translateX(4px); background: var(--accent-dark); }
.rimando__testo { display: grid; gap: 6px; }
.rimando__domanda { font-weight: 700; color: var(--accent-ink); }
.rimando__titolo {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(3rem, 7vw, 5.5rem);
  line-height: 0.88;
  text-transform: uppercase;
}
.rimando__desc { max-width: 46ch; }

/* voce del menu che porta all'altra pagina */
.nav__links .nav__pagina { color: var(--ink); border: 1.5px solid oklch(1 0 0 / 0.3); border-radius: 100px; padding: 7px 16px; margin-left: 6px; }
.nav__links .nav__pagina:hover { border-color: var(--ink); }
.nav__links .nav__pagina.is-attiva { border-color: var(--accent-ink); color: var(--accent-ink); }

/* pagina live: formazioni e service */
.formazioni--sola { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.formazioni__nota { margin-top: 28px; }
.service__foto-griglia {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 40px;
}
.service__foto { aspect-ratio: 3 / 4; border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.service__foto img { width: 100%; height: 100%; object-fit: cover; }
.service__foto:last-child img { object-position: 50% 60%; }
.service__schede {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}
.service__schede .servizio--live { background: var(--band); display: flex; flex-direction: column; min-width: 0; }
.service__schede .servizio.servizio--live { padding: clamp(24px, 3vw, 32px); border: 0; }
.service__schede .link-freccia { margin-top: auto; padding-top: 20px; }
.attrezzatura__prodotti { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.attrezzatura__prodotti figure { display: grid; gap: 8px; align-content: start; min-width: 0; }
.attrezzatura__prodotti img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  background: #fff;
  border-radius: var(--radius);
  padding: 8px;
}
.attrezzatura__prodotti figcaption { font-weight: 600; font-size: 0.9375rem; color: var(--muted); }
.facchinaggio img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: 50% 35%; border-radius: var(--radius); margin-bottom: 20px; }

.contatto-rapido {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px 64px;
  align-items: end;
}
.contatto-rapido .titolo { margin-bottom: 16px; }
.contatto-rapido__azioni { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }

@media (max-width: 1080px) {
  .nav__links .nav__pagina { margin: 12px 0 0; border: 1.5px solid oklch(1 0 0 / 0.3); padding: 12px 20px; text-align: center; font-family: var(--font-text); font-size: 1.0625rem; text-transform: none; }
  .service__schede { grid-template-columns: 1fr; }
  .service__foto-griglia { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .contatto-rapido, .formazioni--sola, .video__grid--due { grid-template-columns: 1fr; }
  .rimando__link { flex-direction: column; align-items: flex-start; justify-content: flex-end; min-height: 520px; }
  .rimando__img { object-position: 60% 12%; }
  .rimando__link::before { background: linear-gradient(to top, oklch(0.12 0.008 255 / 0.95) 0%, oklch(0.12 0.008 255 / 0.7) 45%, oklch(0.12 0.008 255 / 0) 75%); }
  .parte--hero { min-height: 86svh; }
}

/* ── MOVIMENTO RIDOTTO ────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
}
