:root {
  --orange: #e8ac7c;
  --beige: #b5ac90;
  --brown: #8b6139;
  --dark: #1a0705;
  --ink: #222;
  --white: #fff;
  --ease: cubic-bezier(.22,.61,.36,1);
  --mo: cubic-bezier(.16,1,.3,1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Poppins, "Segoe UI", Helvetica, Arial, sans-serif;
  font-weight: 500;
  color: var(--ink);
  background: var(--beige);
}
img { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }

/* Hero */
.hero {
  background: radial-gradient(ellipse at 50% 100%, #4a2413 0%, var(--dark) 70%);
  color: var(--white);
  text-align: center;
  padding: 56px 20px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}
.logo { width: min(277px, 70vw); border: 3px solid var(--white); }
.welcome {
  margin: 0;
  max-width: 34em;
  font-size: clamp(1.050rem, 2.200vw, 1.500rem);
  font-weight: 500;
  line-height: 1.500;
  text-wrap: balance;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px 56px;
  margin-top: 16px;
}
.group { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 1.200rem; }
.icons { display: flex; gap: 14px; }
.icons a {
  width: 64px;
  height: 64px;
  border: 2px solid var(--white);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--white);
  transition: background .2s, color .2s, transform .25s var(--ease);
}
.icons a:hover, .icons a:focus-visible { background: var(--white); color: var(--dark); outline: none; transform: translateY(-4px) scale(1.06); }
.icons svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 1.600; stroke-linecap: round; stroke-linejoin: round; }

/* Sezioni del menù */
.band { padding: 64px 20px; overflow: hidden; }
.orange { background: var(--orange); }
.beige { background: var(--beige); }
.wrap {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px 48px;
  align-items: center;
  justify-items: center;
}
.text { text-align: center; max-width: 36em; }
h2 { margin: 0 0 8px; font-size: clamp(1.800rem, 4vw, 2.600rem); font-weight: 600; line-height: 1.200; }
.text p { margin: 0; font-size: clamp(1rem, 1.600vw, 1.200rem); line-height: 1.500; }

/* Chiusura */
.closing { text-align: center; padding-bottom: 40px; }
.outro {
  font-family: "Open Sans", "Segoe UI", Helvetica, Arial, sans-serif;
  font-weight: 400;
  font-size: clamp(1.100rem, 2.200vw, 1.600rem);
  line-height: 1.500;
  max-width: 44em;
  margin: 0 auto 20px;
}
address { font-style: normal; font-size: clamp(1.050rem, 2vw, 1.500rem); margin-bottom: 56px; }
.back { color: var(--white); font-weight: 600; font-size: 1.300rem; }

@media (max-width: 720px) {
  .band { padding: 44px 16px; }
  .wrap { grid-template-columns: 1fr; gap: 20px; }
  .icons a { width: 56px; height: 56px; }
}

/* Foto: cornice che taglia lo zoom al passaggio del mouse */
.foto { margin: 0; overflow: hidden; }
.foto img { transition: transform .7s var(--mo); }
.foto:hover img { transform: scale(1.06); }

/* Barra di avanzamento lettura */
#progress {
  position: fixed; top: 0; left: 0; z-index: 100;
  height: 3px; width: 0;
  background: linear-gradient(90deg, var(--brown), var(--orange));
  transition: width .1s linear;
}

/* Entrata della testata: CSS puro, parte anche senza JavaScript */
.hero { background-size: 100% 100%; }
.logo { animation: logoIn 1s var(--mo) both; }
@keyframes logoIn { from { opacity: 0; transform: scale(.86); } }
.welcome .parola {
  display: inline-block; overflow: hidden; vertical-align: bottom;
  padding-bottom: .14em; margin-bottom: -.14em;
}
.welcome .parola > span {
  display: inline-block;
  transform: translateY(105%);
  animation: parolaSu .85s var(--mo) both;
  animation-delay: calc(.4s + var(--i) * .035s);
}
@keyframes parolaSu { to { transform: none; } }
.actions .group { animation: salita .8s var(--mo) both; }
.actions .group:nth-child(1) { animation-delay: 1.5s; }
.actions .group:nth-child(2) { animation-delay: 1.62s; }
.actions .group:nth-child(3) { animation-delay: 1.74s; }
.actions .group:nth-child(4) { animation-delay: 1.86s; }
@keyframes salita { from { opacity: 0; transform: translateY(22px); } }

/* Comparsa allo scorrimento: attiva solo se il JavaScript è partito */
.js .reveal { --corsa: 64px; transition: opacity .7s var(--ease), transform .8s var(--mo), clip-path .9s var(--mo); }
.js .reveal:not(.visible) { opacity: 0; transform: translateX(calc(var(--corsa) * -1)); }
.js .reveal[data-da="dx"]:not(.visible) { transform: translateX(var(--corsa)); }
.js .reveal[data-da="su"]:not(.visible) { transform: translateY(30px); }
/* Il taglio a sipario sta sull'immagine, non sulla cornice: una cornice
   tagliata a zero non verrebbe mai vista dall'osservatore di scorrimento */
.js .foto.reveal img { clip-path: inset(0); transition: transform .7s var(--mo), clip-path .9s var(--mo); transition-delay: inherit; }
.js .foto.reveal:not(.visible) img { clip-path: inset(0 50% 0 50%); }
.js .reveal[data-delay="1"] { transition-delay: .07s; }
.js .reveal[data-delay="2"] { transition-delay: .14s; }
.js .reveal[data-delay="3"] { transition-delay: .21s; }
.js .text.reveal h2 { transition: transform .9s var(--mo) .09s; }
.js .text.reveal:not(.visible) h2 { transform: translateX(-40px); }
@media (max-width: 720px) { .js .reveal { --corsa: 40px; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .welcome .parola > span { transform: none; }
  .js .reveal:not(.visible), .js .foto.reveal:not(.visible) img, .js .text.reveal:not(.visible) h2 { opacity: 1; transform: none; clip-path: none; }
}
