/* ========== COLORI E BASE ========== */
:root {
  --purple: #412466;
  --magenta: #E5017E;
  --text-soft: #7D6F8E;
  --line: #ECE6F2;
  --tint: #F7F3FB;
  --white: #FFFFFF;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --font: "Outfit", "Avenir Next", "Segoe UI", system-ui, sans-serif;

  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: inherit; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: calc(84px + env(safe-area-inset-top, 0px)); }

body {
  font-family: var(--font);
  color: var(--purple);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img { display: block; max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--magenta); outline-offset: 4px; border-radius: 6px; }

h2 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: 1;
  margin-bottom: 2.2rem;
}

/* ========== NAV ========== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: calc(1rem + env(safe-area-inset-top, 0px)) clamp(1.25rem, 4vw, 3rem) 1rem;
  background: rgba(255, 255, 255, 0);
  transition: background-color .35s var(--ease), box-shadow .35s var(--ease);
}
.nav.scrolled {
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--line);
}
.nav-logo img {
  width: 92px;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.nav.scrolled .nav-logo img { opacity: 1; transform: none; }
.nav-links { display: flex; gap: 2rem; font-size: .98rem; }
.nav-links a { position: relative; padding: .2rem 0; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
  background: var(--magenta);
  transform: scaleX(0); transform-origin: left;
  transition: transform .3s var(--ease);
}
.nav-links a:hover::after { transform: scaleX(1); }
.nav-call {
  padding: .5rem 1.1rem;
  border-radius: 999px;
  border: 1.5px solid var(--purple);
  font-size: .95rem;
  transition: background-color .25s, color .25s;
}
.nav-call:hover { background: var(--purple); color: var(--white); }

/* ========== HERO ========== */
.hero {
  min-height: 100svh;
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 3rem;
  padding: 7rem clamp(1.25rem, 5vw, 4rem) 4rem;
}

.hero-logo img { width: min(440px, 100%); }
.hero-sub {
  margin-top: 1.8rem;
  font-size: clamp(1.1rem, 1.7vw, 1.3rem);
  color: var(--text-soft);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2.2rem; }
.btn {
  display: inline-flex; align-items: center;
  padding: .9rem 1.6rem;
  border-radius: 999px;
  background: var(--purple);
  color: var(--white);
  font-weight: 500;
  border: 1.5px solid var(--purple);
  transition: background-color .25s, color .25s, transform .25s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--purple); }
.btn-ghost:hover { background: var(--purple); color: var(--white); }

.status { display: flex; align-items: center; gap: .55rem; margin-top: 1.6rem; font-size: .95rem; color: var(--text-soft); }
.status i { flex: none; width: .55rem; height: .55rem; border-radius: 50%; background: #C9C1D3; }
.status.open i { background: #3FA163; animation: pulse 2s infinite; }
.status.closed i { background: var(--magenta); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(63, 161, 99, .5); }
  70%, 100% { box-shadow: 0 0 0 9px rgba(63, 161, 99, 0); }
}

/* entrata hero, solo con JS attivo */
.js .hero-text > * { opacity: 0; transform: translateY(14px); }
.js .loaded .hero-text > * { opacity: 1; transform: none; transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js .loaded .hero-text > *:nth-child(2) { transition-delay: .12s; }
.js .loaded .hero-text > *:nth-child(3) { transition-delay: .24s; }
.js .loaded .hero-text > *:nth-child(4) { transition-delay: .36s; }

/* ---------- Pila di foto ---------- */
.stack {
  position: relative;
  justify-self: center;
  width: min(380px, 80vw);
  aspect-ratio: 1;
  cursor: pointer;
}
.card {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 28px;
  border: 8px solid var(--white);
  box-shadow: 0 18px 40px -18px rgba(65, 36, 102, .45);
  transition: transform .9s var(--ease), opacity .6s var(--ease);
  will-change: transform;
}
/* posizioni: data-pos lo imposta il JS (0 = davanti) */
.card[data-pos="0"] { transform: rotate(-3deg); z-index: 3; }
.card[data-pos="1"] { transform: translate(14%, -6%) rotate(7deg) scale(.94); z-index: 2; }
.card[data-pos="2"] { transform: translate(-14%, -10%) rotate(-11deg) scale(.88); z-index: 1; }
.card.leaving { transform: translate(-30%, 40%) rotate(-24deg) scale(.9); opacity: 0; z-index: 4; }
.js .stack:not(.ready) .card { transform: translateY(30%) rotate(0) scale(.9); opacity: 0; }
.stack:hover .card[data-pos="1"] { transform: translate(20%, -8%) rotate(10deg) scale(.94); }
.stack:hover .card[data-pos="2"] { transform: translate(-20%, -12%) rotate(-14deg) scale(.88); }

/* ========== RATING ========== */
.rating {
  display: flex; flex-direction: column; align-items: center; gap: .9rem;
  padding: 3rem 1.5rem 6rem;
  text-align: center;
  font-size: clamp(1.05rem, 2vw, 1.3rem);
}
.rating strong { font-weight: 600; font-variant-numeric: tabular-nums; }
.stars { display: flex; gap: .3rem; }
.stars span {
  width: 1.5rem; height: 1.5rem;
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  background: linear-gradient(90deg, var(--magenta) calc(var(--fill) * 100%), var(--line) 0);
}

/* ========== MENU ========== */
.menu {
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem clamp(1.25rem, 5vw, 3rem) 7rem;
}
.tabs {
  display: flex;
  gap: .4rem;
  overflow-x: auto;
  scrollbar-width: none;
  margin-bottom: 1.8rem;
  padding: .3rem;
  background: var(--tint);
  border-radius: 999px;
  width: fit-content;
  max-width: 100%;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none;
  padding: .6rem 1.2rem;
  border-radius: 999px;
  font-size: .98rem;
  color: var(--text-soft);
  transition: background-color .25s, color .25s;
}
.tab:hover { color: var(--purple); }
.tab[aria-selected="true"] { background: var(--white); color: var(--purple); box-shadow: 0 2px 10px -4px rgba(65, 36, 102, .3); }

.menu-list { list-style: none; }
.menu-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: .3rem 1.5rem;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--line);
  animation: rowIn .5s var(--ease) both;
  animation-delay: calc(var(--i) * 45ms);
}
.menu-list li.has-img { cursor: default; }
.menu-list .thumb { display: none; }
.item-name { font-size: 1.15rem; font-weight: 500; }
.item-note { grid-column: 1; font-size: .95rem; color: var(--text-soft); }
.item-price {
  grid-row: 1;
  grid-column: 2;
  font-size: 1.1rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.item-price.empty { color: #C9C1D3; }
.menu-note { margin-top: 1.6rem; font-size: .95rem; color: var(--text-soft); }
@keyframes rowIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* anteprima che segue il mouse */
.peek {
  position: fixed;
  top: 0; left: 0;
  width: 200px;
  aspect-ratio: 1;
  border-radius: 20px;
  overflow: hidden;
  pointer-events: none;
  z-index: 60;
  opacity: 0;
  transform: translate(-50%, -50%) scale(.85);
  transition: opacity .25s var(--ease), transform .25s var(--ease);
  box-shadow: 0 20px 40px -16px rgba(65, 36, 102, .5);
}
.peek.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.peek img { width: 100%; height: 100%; object-fit: cover; }

/* ========== GALLERY ========== */
.gallery-section { padding-bottom: 7rem; }
.gallery-section h2 { max-width: 1240px; margin-left: auto; margin-right: auto; padding: 0 clamp(1.25rem, 5vw, 4rem); }
.gallery {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0 clamp(1.25rem, 5vw, 4rem);
  scroll-padding-inline: clamp(1.25rem, 5vw, 4rem);
  scrollbar-width: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.gallery::-webkit-scrollbar { display: none; }
.gallery.dragging { cursor: grabbing; scroll-snap-type: none; }
.gallery figure {
  flex: 0 0 auto;
  width: clamp(240px, 28vw, 340px);
  aspect-ratio: 1;
  border-radius: 24px;
  overflow: hidden;
  scroll-snap-align: start;
  background: var(--tint);
}
.gallery img {
  width: 100%; height: 100%;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
  transition: transform .8s var(--ease);
}
.gallery figure:hover img { transform: scale(1.05); }
.gallery-bar {
  margin: 1.5rem auto 0;
  width: min(200px, 50vw);
  height: 3px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
}
.gallery-bar span { display: block; height: 100%; width: 25%; background: var(--purple); border-radius: 3px; }

/* ========== ORARI ========== */
.hours, .where {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 5vw, 3rem) 7rem;
}
.hours { max-width: 860px; }
.week { list-style: none; }
.week li {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 1rem 1.1rem;
  font-size: 1.1rem;
  border-bottom: 1px solid var(--line);
  border-radius: 14px;
}
.week li span:last-child { color: var(--text-soft); font-variant-numeric: tabular-nums; }
.week li.closed span:last-child { color: #C9C1D3; }
.week li.today { background: var(--tint); border-bottom-color: transparent; font-weight: 600; }
.week li.today span:last-child { color: var(--purple); }

/* ========== DOVE ========== */
.where {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
address { font-style: normal; font-size: 1.25rem; line-height: 1.55; }
.contacts { list-style: none; margin-top: 2rem; display: flex; flex-direction: column; gap: .7rem; }
.contacts a {
  font-size: 1.1rem;
  background: linear-gradient(var(--magenta), var(--magenta)) 0 100% / 0 2px no-repeat;
  padding-bottom: 2px;
  transition: background-size .35s var(--ease);
}
.contacts a:hover { background-size: 100% 2px; }
.map { border-radius: 24px; overflow: hidden; aspect-ratio: 4 / 3; background: var(--tint); }
.map iframe { display: block; width: 100%; height: 100%; border: 0; }

/* ========== FOOTER ========== */
.footer {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem;
  padding: 2rem clamp(1.25rem, 5vw, 4rem) calc(2rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  font-size: .9rem;
  color: var(--text-soft);
}
.footer img { width: 80px; }

/* ========== COMPARSA (solo con JS) ========== */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.js .reveal.visible { opacity: 1; transform: none; }

/* ========== RESPONSIVE ========== */
@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 3.5rem;
    padding-top: 6.5rem;
  }
  .hero-logo img { margin: 0 auto; width: min(300px, 78vw); }
  .hero-actions, .status { justify-content: center; }
  .stack { width: min(280px, 70vw); margin-top: 1rem; }
  .nav-links { display: none; }
  .where { grid-template-columns: 1fr; }

  /* su mobile la foto sta nella riga */
  .menu-list li.has-img { grid-template-columns: 56px 1fr auto; }
  .menu-list li.has-img .thumb {
    display: block;
    grid-row: 1 / span 2;
    width: 56px; height: 56px;
    border-radius: 14px;
    object-fit: cover;
    align-self: center;
  }
  .menu-list li.has-img .item-name { grid-column: 2; grid-row: 1; }
  .menu-list li.has-img .item-note { grid-column: 2; }
  .menu-list li.has-img .item-price { grid-column: 3; }
}

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


/* =====================================================
   PAGINA DI MANUTENZIONE (neutra, senza marchio)
   ===================================================== */
.maint-screen { display: none; }
.maint body { overflow: hidden; background: #FAFAFA; }
.maint body > :not(.maint-screen) { display: none !important; }

.maint .maint-screen,
.maint-screen.leaving {
  display: grid;
  place-items: center;
  position: fixed;
  inset: 0;
  z-index: 100;
  padding: 1.5rem;
  background: #FAFAFA;
  color: #161616;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  transition: opacity .6s ease;
}
.maint-screen.out { opacity: 0; pointer-events: none; }

.maint-box { width: min(480px, 100%); text-align: center; }
.maint-form { max-width: 360px; margin-left: auto; margin-right: auto; }

.maint-title {
  font-size: clamp(2rem, 6vw, 2.8rem);
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: 1.1;
  opacity: 0;
  transform: translateY(10px);
  animation: maintIn .9s cubic-bezier(.22, 1, .36, 1) .1s forwards;
}
.maint-form {
  margin-top: 2.5rem;
  opacity: 0;
  transform: translateY(10px);
  animation: maintIn .9s cubic-bezier(.22, 1, .36, 1) .3s forwards;
}
@keyframes maintIn { to { opacity: 1; transform: none; } }

.maint-field {
  display: flex;
  align-items: center;
  gap: .25rem;
  padding: .3rem .3rem .3rem 1.1rem;
  background: #FFFFFF;
  border: 1px solid #E3E3E3;
  border-radius: 999px;
  transition: border-color .2s, box-shadow .2s;
}
.maint-field:focus-within { border-color: #161616; box-shadow: 0 0 0 4px rgba(0, 0, 0, .06); }
.maint-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 1rem;
  color: inherit;
  padding: .6rem 0;
}
.maint-field input::placeholder { color: #A3A3A3; }
.maint-field button {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  background: #161616;
  color: #FFFFFF;
  transition: transform .2s ease, opacity .2s;
}
.maint-field button:hover { transform: translateX(2px); }
.maint-field button:focus-visible { outline: 2px solid #161616; outline-offset: 3px; }

.maint-error { min-height: 1.4em; margin-top: .9rem; font-size: .9rem; color: #C2410C; }
.maint-field.shake { animation: shake .4s ease; border-color: #C2410C; }
@keyframes shake {
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.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 (prefers-reduced-motion: reduce) {
  .maint-title, .maint-form { opacity: 1; transform: none; }
}
