:root {
  --paper: #F1F6F6;
  --paper-2: #DDE9E9;
  --ink: #18334E;
  --ink-deep: #0F2438;
  --tiffany: #0ABAB5;
  --soft: #3F5870;
  --soft-on-deep: #A9BECB;

  --m: clamp(16px, 2.2vw, 32px);
  --gap-section: clamp(96px, 11vw, 160px);

  --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-h2: clamp(2rem, 1.6rem + 1.2vw, 2.5rem);
  --step-head: clamp(2.5rem, 1.2rem + 3.6vw, 4.75rem);

  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --text: "Barlow", system-ui, sans-serif;

  --ease: cubic-bezier(.2, .7, .2, 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: 400 var(--step-body)/1.5 var(--text);
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, figure { margin: 0; }
.num { font-variant-numeric: tabular-nums; }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 3px solid currentColor; outline-offset: 3px; }
::selection { background: var(--tiffany); color: var(--ink-deep); }

.h2 {
  font: 700 var(--step-h2)/1 var(--display);
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.btn {
  display: inline-block;
  padding: 0.7em 1.3em;
  border: 0; cursor: pointer;
  background: var(--ink);
  color: var(--paper);
  font: 500 var(--step-body)/1.2 var(--text);
  text-decoration: none;
  border-radius: 0;
  transition: transform .2s var(--ease), background-color .2s, color .2s;
}
.btn:hover { background: var(--ink-deep); transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn--light { background: var(--paper); color: var(--ink-deep); }
.btn--light:hover { background: var(--tiffany); color: var(--ink-deep); }

.textlink { font: 500 var(--step-body)/1.2 var(--text); text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
.textlink:hover { text-decoration-thickness: 2px; }

/* Link per saltare al contenuto: visibile solo quando riceve il focus da tastiera */
.skip { position: absolute; left: 12px; top: -64px; z-index: 100; padding: 12px 18px; background: var(--ink-deep); color: var(--paper); font: 500 var(--step-body)/1.2 var(--text); text-decoration: none; transition: top .2s var(--ease); }
.skip:focus { top: 12px; }

/* ---------- Barra: logo + menu ---------- */

.bar { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.logo img { width: clamp(44px, 4vw, 60px); height: auto; transition: transform .4s var(--ease); }
.logo:hover img { transform: rotate(-12deg); }
.menu { display: flex; gap: clamp(16px, 2vw, 28px); font: 500 var(--step-body)/1.2 var(--text); }
.menu a { text-decoration: none; }
.menu a:hover, .menu a[aria-current] { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 2px; }

/* ---------- Hero: due blocchi affiancati ---------- */

.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  min-height: 100svh;
}
.hero__left {
  display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  padding: var(--m);
  background: var(--tiffany); color: var(--ink);
}
.hero__left { position: relative; overflow: hidden; isolation: isolate; }
.hero__left > * { position: relative; z-index: 1; }
.hero__left > .mesh { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; display: block; pointer-events: none; }

/* 3.08 = larghezza di "ALTROVE" in Barlow Condensed 700, in em, con tracking -0.02em */
.name { margin: 0; container-type: inline-size; }
.name__mask { display: block; overflow: hidden; }
.name__line {
  display: block; white-space: nowrap; text-transform: uppercase;
  font: 700 calc(100cqw / 3.08)/0.88 var(--display);
  letter-spacing: -0.02em;
}
.hero__city { font-size: var(--step-body); }

.hero__right {
  display: flex; flex-direction: column; justify-content: space-between; gap: 48px;
  padding: clamp(24px, 3.2vw, 48px) var(--m) var(--m);
  background: var(--ink-deep); color: #fff;
}
.ev__top { display: grid; gap: 16px; }
.ev__main { display: grid; grid-template-columns: 1fr; gap: 24px; }
.ev__poster { display: block; width: min(62%, 320px); transition: transform .4s var(--ease); }
.ev__poster:hover { transform: translateY(-4px); }
.ev__poster img { width: 100%; height: auto; }
@media (min-width: 901px) {
  /* Locandina centrata nello spazio libero tra titolo e informazioni, si adatta all'altezza dello schermo */
  .ev__main { display: contents; }
  .ev__poster { order: 2; flex: 1 1 0; min-height: 200px; width: 100%; position: relative; }
  .ev__poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: center; }
  .ev__body { order: 3; }
  .ev__top { order: 1; }
}
.ev__title {
  max-width: 14em;
  font: 700 var(--step-head)/0.92 var(--display);
  letter-spacing: -0.02em; text-transform: uppercase;
}
.ev__body { display: grid; gap: 12px; justify-items: start; align-content: end; max-width: 38em; }
.ev__when { font: 500 var(--step-lead)/1.2 var(--text); color: var(--tiffany); }
.ev__where, .ev__desc { font-size: var(--step-body); }
.ev__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; margin-top: 12px; }
.ev__actions .textlink { color: var(--paper); }
.ev__actions .textlink:hover { color: var(--tiffany); }

/* ---------- Chi siamo ---------- */

.about { padding: var(--gap-section) var(--m) 0; }
.about__text {
  margin-top: clamp(40px, 5vw, 64px);
  columns: 2; column-gap: var(--m);
  font-size: var(--step-lead); line-height: 1.3;
  text-align: justify; hyphens: auto;
}
.about__text strong { font-weight: 700; }
.about__map { margin-top: clamp(64px, 8vw, 104px); }
.about__map img { width: 100%; max-height: 72vh; object-fit: cover; object-position: 50% 45%; background: #e4dcc4; }
.about__map figcaption { margin-top: 10px; font-size: var(--step-small); color: var(--soft); }

/* ---------- Progetti: tre cerchi ---------- */

.orbs {
  margin-top: var(--gap-section);
  padding: clamp(72px, 9vw, 120px) var(--m);
  background: var(--ink-deep); color: var(--paper);
}
.orbs__row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--m);
  margin-top: clamp(40px, 5vw, 72px);
}
.orb { display: grid; justify-items: center; gap: 6px; text-decoration: none; text-align: center; }
.orb__disc {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: 12%; text-align: center;
  width: 100%; max-width: 440px; aspect-ratio: 1; border-radius: 50%;
  transition: transform .5s var(--ease);
}
.orb--a .orb__disc { background: var(--tiffany); color: var(--ink-deep); }
.orb--b .orb__disc { background: var(--paper); color: var(--ink); }
.orb__icon { width: clamp(3rem, 6vw, 5.5rem); height: clamp(3rem, 6vw, 5.5rem); fill: currentColor; }
.orb:hover .orb__disc { transform: scale(1.04); }
.orb__name { font: 700 var(--step-lead)/1.05 var(--display); text-transform: uppercase; letter-spacing: -0.01em; }
.orb__host { font-size: var(--step-body); color: var(--soft-on-deep); }
.orb:hover .orb__host { color: var(--tiffany); }

/* ---------- Archivio: ultimi tre ---------- */

.archive { padding: var(--gap-section) var(--m) 0; }
.archive__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px 32px; margin-bottom: clamp(40px, 5vw, 72px); }
.past {
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--m);
  align-items: center;
  margin-bottom: clamp(56px, 7vw, 104px);
}
.past__pic { width: 100%; aspect-ratio: 1587 / 2245; object-fit: cover; }
.past__pic--empty {
  display: grid; place-items: center; text-align: center;
  background: var(--paper-2); color: var(--soft);
  font: 700 var(--step-lead)/1.1 var(--display); text-transform: uppercase; padding: 16px;
}
.past--l .past__pic { grid-column: 1 / 5; grid-row: 1; }
.past--l .past__text { grid-column: 6 / 12; grid-row: 1; }
.past--r .past__pic { grid-column: 9 / 13; grid-row: 1; }
.past--r .past__text { grid-column: 2 / 8; grid-row: 1; }
.past__title { font: 700 var(--step-head)/0.95 var(--display); letter-spacing: -0.02em; text-transform: uppercase; margin-bottom: 20px; }
.past__meta { font-size: var(--step-body); }
.past__desc { margin-top: 14px; max-width: 48ch; }

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

.foot {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  padding: clamp(64px, 8vw, 104px) var(--m) 0;
  background: var(--ink-deep); color: var(--paper);
}
.foot__top { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--m); font-size: var(--step-body); }
.foot__who { grid-column: 1 / 7; }
.foot__who a, .foot__links a { display: inline-block; padding: 6px 0; }
.foot__links { grid-column: 9 / 13; display: flex; flex-direction: column; gap: 6px; }
.foot__links a { text-decoration: none; }
.foot__links a:hover { color: var(--tiffany); }
.foot__legal { padding-top: 56px; font-size: 1rem; color: var(--soft-on-deep); display: grid; gap: 12px; max-width: 75ch; }
.foot__legal a { color: inherit; }
.foot__name { margin: 40px 0 0; container-type: inline-size; color: var(--tiffany); transform: translateY(2%); }
.foot__text {
  display: block; white-space: nowrap; text-transform: uppercase;
  font: 700 calc(100cqw / 4.95)/0.88 var(--display);
  letter-spacing: -0.02em;
}

/* ---------- Pagina privacy ---------- */

.band__text--sm { font-size: clamp(2.75rem, 8vw, 8rem); }
.legal { padding: clamp(56px, 7vw, 96px) var(--m) var(--gap-section); display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--m); row-gap: 72px; }
.legal__toc { grid-column: 1 / 4; align-self: start; position: sticky; top: 24px; display: grid; gap: 8px; font: 500 var(--step-body)/1.2 var(--text); }
.legal__toc a { text-decoration: none; }
.legal__toc a:hover { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 2px; }
.legal__text { grid-column: 4 / 11; max-width: 65ch; scroll-margin-top: 24px; }
.legal__text h2 { font: 700 var(--step-h2)/1 var(--display); letter-spacing: -0.01em; text-transform: uppercase; margin-bottom: 24px; }
.legal__text h3 { font: 700 var(--step-lead)/1.15 var(--display); letter-spacing: -0.01em; text-transform: uppercase; margin: 36px 0 10px; }
.legal__text p, .legal__text li { margin-bottom: 12px; }
.legal__text ul { padding-left: 1.1em; margin: 0 0 12px; }
.legal__text a { text-underline-offset: 4px; }
.legal__text strong { font-weight: 700; }

/* ---------- Pagina calendario ---------- */

.band { padding: var(--m); background: var(--tiffany); color: var(--ink); }
.band__main {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px 48px;
  margin-top: clamp(64px, 12vw, 160px);
}
.band__title { margin: 0; }
.band__mask { display: block; overflow: hidden; }
.band__text {
  display: block; text-transform: uppercase;
  font: 700 clamp(4rem, 17vw, 16rem)/0.9 var(--display);
  letter-spacing: -0.02em;
}
.band__side { display: grid; gap: 20px; justify-items: start; }
.band__lead { max-width: 24em; font: 400 var(--step-lead)/1.25 var(--text); padding-bottom: 1.2vw; }

.cal { padding: clamp(72px, 9vw, 120px) var(--m); background: var(--ink-deep); color: var(--paper); }
.cal--page { padding-top: clamp(40px, 5vw, 64px); }
.cal__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 20px 40px; }
.cal__filters { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.cal__filters button {
  padding: 4px 0; border: 0; background: none; cursor: pointer;
  font: 500 var(--step-body)/1.2 var(--text); color: var(--soft-on-deep);
  transition: color .2s;
}
.cal__filters button:hover { color: var(--paper); }
.cal__filters button[aria-pressed="true"] { color: var(--tiffany); text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }

.cal__table { margin-top: clamp(32px, 4vw, 56px); font-size: var(--step-lead); }
.cal__month {
  position: sticky; top: 0; z-index: 2;
  margin: 0; padding: 72px 0 20px;
  background: var(--ink-deep); color: var(--tiffany);
  font: 400 var(--step-lead)/1.2 var(--text);
}
.cal__group:first-child .cal__month { padding-top: 0; }
.cal__row {
  display: grid;
  grid-template-columns: 33% 1fr 1fr 6.5em;
  column-gap: var(--m);
  line-height: 1.5;
  transition: color .2s;
}
.cal__row:hover { color: var(--tiffany); }
.cal__proj a { text-decoration: none; }
.cal__proj a:hover { text-decoration: underline; text-underline-offset: 5px; }
.cal__when { text-align: right; font-variant-numeric: tabular-nums; }
.cal__sample { color: var(--soft-on-deep); }
.cal__empty { padding-top: 24px; color: var(--soft-on-deep); }
.cal__row[hidden], .cal__group[hidden] { display: none; }

/* ---------- Movimento ---------- */

@media (prefers-reduced-motion: no-preference) {
  .name__line { animation: rise .95s var(--ease) both; }
  .name__line:nth-child(2) { animation-delay: .11s; }
  .band__text { animation: rise .95s var(--ease) both; }
  .band .bar, .band__lead, .band__side .btn { animation: fade .8s .5s var(--ease) both; }
  .cal__filters button { animation: fade .6s var(--ease) both; }
  .cal__filters button:nth-child(1) { animation-delay: .5s; }
  .cal__filters button:nth-child(2) { animation-delay: .58s; }
  .cal__filters button:nth-child(3) { animation-delay: .66s; }
  .cal__filters button:nth-child(4) { animation-delay: .74s; }
  .cal__filters button:nth-child(5) { animation-delay: .82s; }
  .cal__month { animation: fade .7s .6s var(--ease) both; }
  .bar, .hero__city { animation: fade .8s .5s var(--ease) both; }
  .hero__right > * { animation: fade .9s .35s var(--ease) both; }
  .hero__right .ev__body { animation-delay: .55s; }

  .js .reveal, .js .legal__text > * { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
  .js .reveal.is-in, .js .legal__text > .is-in { opacity: 1; transform: none; }
  .js .orb.reveal:nth-child(2) { transition-delay: .1s; }
  .js .orb.reveal:nth-child(3) { transition-delay: .2s; }
  .js .past__pic { clip-path: inset(100% 0 0 0); transition: clip-path 1s var(--ease); }
  .js .past.is-in .past__pic { clip-path: inset(0); }
  .js .cal__row { opacity: 0; transform: translateY(12px); transition: opacity .6s var(--ease), transform .6s var(--ease), color .2s; }
  .js .cal__row.is-in { opacity: 1; transform: none; }
}
@keyframes rise { from { transform: translateY(105%); } to { transform: none; } }
@keyframes fade { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- Telefono e tablet stretto ---------- */

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero__left { min-height: 100vh; min-height: 100svh; }
  .hero__right { min-height: 70svh; }

  .about__text { columns: 1; text-align: left; }

  .orbs__row { grid-template-columns: 1fr; gap: 56px; }
  .orb__disc { max-width: min(320px, 78vw); }

  .past, .past--l, .past--r { grid-template-columns: 38% 1fr; column-gap: var(--m); }
  .past--l .past__pic, .past--r .past__pic { grid-column: 1; }
  .past--l .past__text, .past--r .past__text { grid-column: 2; }
  .past__title { font-size: clamp(2.25rem, 10vw, 3.25rem); }

  .legal { display: block; }
  .legal__toc { position: static; grid-auto-flow: column; justify-content: start; gap: 24px; margin-bottom: 48px; }
  .legal__text + .legal__text { margin-top: 72px; }
  .foot__top { display: block; }
  .foot__links { margin-top: 20px; flex-direction: row; flex-wrap: wrap; gap: 4px 18px; }

  .cal__row { grid-template-columns: 1fr auto; row-gap: 2px; margin-bottom: 18px; }
  .cal__what { grid-column: 1 / -1; font-size: var(--step-lead); }
  .cal__proj, .cal__where, .cal__when { font-size: var(--step-small); color: var(--soft-on-deep); }
  .cal__proj, .cal__where { grid-column: 1; }
  .cal__when { grid-column: 2; grid-row: 2; align-self: end; }
}

@media (max-width: 560px) {
  .past, .past--l, .past--r { display: block; }
  .past__pic { width: 62%; margin-bottom: 24px; }
  .past--r .past__pic { margin-left: auto; }
}
