/* CSS base & variables */
:root {
  /* Warm, food-friendly palette */
  --bg: #fffaf3;          /* panna */
  --card: #ffffff;        /* bianco morbido */
  --muted: #6b7280;       /* grigio caldo */
  --text: #1f2937;        /* antracite */
  --brand: #d97706;       /* ambra */
  --brand-2: #65a30d;     /* verde oliva */
  --accent: #f59e0b;      /* miele */
  --ring: rgba(217, 119, 6, 0.25);
  --container: 1120px;
  --dark: #1f2937;        /* lavagna */
  --on-dark: #f8fafc;     /* testo su scuro */
  --header-h: 64px;
}

* { box-sizing: border-box; }
html, body { height: 100%; overflow-x: hidden; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  padding-top: var(--header-h);
}

.container { width: min(100% - 2rem, var(--container)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 1px, 1px); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -999px; top: -999px; background: var(--brand-2); color: #07210a; padding: .75rem 1rem; border-radius: .5rem; }
.skip-link:focus { left: 1rem; top: 1rem; z-index: 999; }

/* Header */
.site-header { position: fixed; top: 0; left: 0; right: 0; backdrop-filter: blur(8px); background: rgba(255,255,255,0.7); border-bottom: 1px solid rgba(0,0,0,.06); z-index: 1000; transition: background .3s ease, box-shadow .3s ease; height: var(--header-h); }
.site-header.on-hero { background: rgba(255,255,255,0.9); border-bottom-color: rgba(0,0,0,.06); }
.site-header.scrolled { background: rgba(255,255,255,0.9); box-shadow: 0 4px 18px rgba(0,0,0,.06); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .5rem 0; height: 100%; }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--text); text-decoration: none; font-weight: 700; letter-spacing: .2px; }
.brand img { display: block; }
.brand-text { font-family: 'Great Vibes', ui-serif, Georgia, 'Times New Roman', serif; font-weight: 400; font-size: clamp(1.4rem, 1.1rem + 1vw, 2rem); letter-spacing: 0; line-height: 1; color: var(--text); }

.site-nav ul { display: flex; align-items: center; gap: 1rem; list-style: none; padding: 0; margin: 0; }
.site-nav a { position: relative; display: inline-block; color: var(--text); text-decoration: none; opacity: .85; padding: .80rem .75rem .9rem; border-radius: .5rem; transition: opacity .2s ease; }
.site-nav a::after { content: ""; position: absolute; left: .6rem; right: .6rem; bottom: .35rem; height: 2px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .25s ease; border-radius: 2px; }
.site-nav a:hover, .site-nav a:focus-visible { opacity: 1; }
.site-nav a:hover::after, .site-nav a:focus-visible::after { transform: scaleX(1); }

.nav-toggle { display: none; background: transparent; border: 1px solid rgba(0,0,0,.12); color: var(--text); padding: .4rem; border-radius: .5rem; }
.lang-select { display: flex; align-items: center; }
.lang-switch { position: relative; display: inline-flex; background: #fff; border: 1px solid rgba(0,0,0,.08); border-radius: 999px; padding: .2rem; box-shadow: 0 2px 8px rgba(0,0,0,.06) inset; gap: .2rem; }
.lang-indicator { position: absolute; top: 2px; left: 2px; height: calc(100% - 4px); width: var(--w, 0); transform: translateX(var(--x, 0)); background: linear-gradient(135deg, var(--brand), var(--brand-2)); border-radius: 999px; transition: transform .25s ease, width .25s ease; box-shadow: 0 1px 0 rgba(255,255,255,.4) inset; z-index: 0; }
.lang-btn { position: relative; z-index: 1; border: 0; background: transparent; color: var(--text); padding: .35rem .75rem; border-radius: 999px; font-weight: 700; letter-spacing: .3px; cursor: pointer; transition: color .2s ease, transform .06s ease; }
.lang-btn[aria-pressed="true"] { color: #fff; }
.lang-btn:active { transform: translateY(1px); }
.lang-btn:active { transform: translateY(1px); }

/* Hero */
.hero { position: relative; padding: 2.5rem 2rem 4rem; overflow: visible; }
.hero-inner { display: grid; grid-template-columns: 1.2fr 1fr; gap: 3rem; align-items: center; padding-bottom: 9rem;}
.hero-text h1 { font-size: clamp(1.8rem, 1.3rem + 2vw, 3rem); line-height: 1.1; margin: 0 0 .75rem; letter-spacing: .2px; }
.lead { color: var(--muted); font-size: 1.1rem; }
.hero-ctas { display: flex; gap: .75rem; margin-top: 1.25rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .7rem 1rem; color: var(--text); background: #fff; border: 1px solid rgba(0,0,0,.12); border-radius: .75rem; text-decoration: none; font-weight: 600; box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 6px 20px rgba(0,0,0,.06);
  transition: transform .06s ease, border-color .2s ease, background .2s ease; }
.btn:hover { border-color: rgba(0,0,0,.2); transform: translateY(-1px); }
.btn.primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; border: none; }
.btn.primary:hover { filter: brightness(1.05); }
.hero-media { width: 100%; aspect-ratio: 1 / 1; }
.hero-media, .plate { background: transparent; box-shadow: none; }
.hero-media.pizza { justify-self: end; width: clamp(280px, 42vw, 560px); aspect-ratio: 1 / 1; transform: translateY(0%); }
.hero-media.pizza img { border-radius: 50%; background: transparent; border: 0; 
  -webkit-mask-image: radial-gradient(circle closest-side, #000 99%, transparent 100%);
          mask-image: radial-gradient(circle closest-side, #000 99%, transparent 100%);
  filter: drop-shadow(0 28px 38px rgba(0,0,0,.05)) drop-shadow(0 8px 16px rgba(0,0,0,.05));
  pointer-events: none;
}
.media-cover { width: 100%; height: 100%; object-fit: cover; display: block; background: transparent; transition: opacity .2s ease; }

/* Surfaces and curves */
.surface-dark { color: var(--on-dark); background: var(--dark) url('assets/textures/chalk.svg'); background-size: cover; background-position: center; }
.surface-dark .lead { color: #e5e7eb; }
.surface-dark .btn { background: #fff; color: var(--text); border-color: rgba(0,0,0,.08); }
.surface-dark .btn.primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; }
.on-dark { color: var(--on-dark); }

.curve-top, .curve-bottom { position: relative; }
.curve-top::before, .curve-bottom::after { content: ""; position: absolute; left: 0; right: 0; pointer-events: none; z-index: 0; }
.curve-top { --curve-h: clamp(64px, 10vw, 160px); }
.curve-top::before {
  top: calc(var(--curve-h) * -1);
  height: calc(var(--curve-h) * 2);
  width: 140%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg);
  border-radius: 50%;
}
.curve-bottom { --curve-h: clamp(0px, 10vw, 160px); }
.curve-bottom::after {
  bottom: calc(var(--curve-h) * -1);
  height: calc(var(--curve-h) * 2);
  width: 140%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg);
  border-radius: 50%;
}
.curve-top > *, .curve-bottom > * { position: relative; z-index: 1; }

/* Sections */
.section { padding: 3.5rem 0; }
.section { scroll-margin-top: var(--header-h); }
.section.alt { background: transparent; }
.section h2 { font-size: 1.6rem; margin: 0 0 .5rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1rem; }
.card { background: var(--card); border: 1px solid rgba(0,0,0,.06); border-radius: .9rem; padding: 1rem; box-shadow: 0 6px 24px rgba(0,0,0,.08); }
.card.highlight { border-color: rgba(217,119,6,.35); box-shadow: 0 10px 28px rgba(217,119,6,.15); }
.card.feature h3 { margin: .25rem 0 .25rem; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); list-style: none; margin: 0; padding: 0; gap: .5rem; }
.stat { display: block; font-weight: 800; font-size: 1.5rem; }
.label { color: var(--muted); font-size: .9rem; }

.list { margin: 0; padding-left: 1rem; color: var(--text); }
.list li { margin: .35rem 0; }

/* Form */
.form { display: grid; gap: .9rem; }
.field { display: grid; gap: .35rem; }
.field input, .field textarea {
  width: 100%;
  background: #fff;
  color: var(--text);
  border: 1px solid rgba(0,0,0,.12);
  border-radius: .6rem;
  padding: .65rem .75rem;
  outline: none;
}
.field input:focus, .field textarea:focus { box-shadow: 0 0 0 4px var(--ring); border-color: var(--brand-2); }
.actions { display: flex; align-items: center; gap: .75rem; }
.form-status { color: var(--muted); font-size: .95rem; }
.note { margin-top: .75rem; color: var(--muted); font-size: .95rem; }

/* Footer */
.site-footer { border-top: 1px solid rgba(0,0,0,.06); padding: 1.25rem 0; background: rgba(255,255,255,.7); }
.footer-inner { display: flex; align-items: center; justify-content: center; }
.sep { margin: 0 .5rem; color: var(--muted); }

/* Responsive */
@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  .section h2, .section .lead { text-align: center; }
}

@media (max-width: 760px) {
  .site-nav ul {
    display: none;
    position: absolute;
    left: 1rem;
    right: 1rem;
    top: var(--header-h);
    flex-direction: column;
    align-items: stretch;
    background: #fff;
    padding: .5rem;
    border-radius: .75rem;
    border: 1px solid rgba(0,0,0,.1);
    width: auto;
    box-shadow: 0 12px 40px rgba(0,0,0,.18);
  }
  .site-nav ul.open { display: flex; }
  .site-nav li { width: 100%; }
  .site-nav a { display: block; text-align: center; padding: .9rem; }
  .nav-toggle { display: inline-flex; }
}

/* Subtle animations */
[data-animate] { opacity: 0; transition-property: opacity, transform; transition-duration: var(--dur, .6s); transition-timing-function: cubic-bezier(.2,.7,.2,1); will-change: transform, opacity; }
[data-animate="up"] { transform: translateY(16px); }
[data-animate="right"] { transform: translateX(-16px); }
[data-animate="zoom"] { transform: scale(.96); }
[data-animate].visible { opacity: 1; transform: none; }

.plates { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; margin-top: 3rem; align-items: start; justify-items: center; }
.plate { display: grid; justify-items: center; text-align: center; }
.plate picture, .hero-media picture { display: block; }
.plate img { width: clamp(180px, 28vw, 240px); height: clamp(180px, 28vw, 240px); object-fit: cover; border-radius: 50%; background: transparent; border: 0px solid #fff; box-shadow: 0 20px 40px rgba(0,0,0,.12); }
.plate img { -webkit-mask-image: radial-gradient(circle closest-side, #000 99%, transparent 100%); mask-image: radial-gradient(circle closest-side, #000 99%, transparent 100%); }
.plate figcaption { margin-top: .75rem; color: var(--text); font-family: 'Great Vibes', ui-serif, Georgia, 'Times New Roman', serif; font-size: 1.25rem; font-weight: 400; line-height: 1.05; text-align: center; white-space: nowrap; opacity: .95; }
.shadow-lg { box-shadow: 0 20px 40px rgba(0,0,0,.12); }
.shadow-xl { box-shadow: 0 30px 60px rgba(0,0,0,.18); }

.surface-dark .card { background: #fff; color: var(--text); border: 1px solid rgba(0,0,0,.06); }
.surface-dark .card.highlight { border-color: rgba(217,119,6,.35); box-shadow: 0 10px 28px rgba(217,119,6,.12); }

/* Decorative leaves */
.leaf { position: absolute; width: 56px; height: auto; opacity: .85; filter: drop-shadow(0 10px 18px rgba(0,0,0,.15)); pointer-events: none; }
.leaf.leaf-a { left: 4%; top: 18%; transform: rotate(-18deg); }
.leaf.leaf-b { right: 8%; bottom: 30%; transform: rotate(12deg); }

/* Mobile & tablet */
@media (max-width: 980px) {
  .hero { padding: 2rem 1rem 3rem; }
  .hero-inner { grid-template-columns: 1fr; gap: 1.5rem; justify-items: center; align-items: center; padding-bottom: 4rem; }
  .hero-media { order: -1; display: grid; place-items: center; }
  .hero-media.pizza { justify-self: center; transform: none; width: clamp(220px, 64vw, 420px); margin: 0 auto; }
  .hero-text { text-align: center; max-width: 34rem; margin-inline: auto; }
  .hero-ctas { justify-content: center; }
  .plates { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .plates { grid-template-columns: 1fr; gap: 2rem; }
  .leaf { display: none; }
  .stats { grid-template-columns: 1fr; text-align: center; }
}

.parallax { will-change: transform; transition: none; transform-origin: 50% 55%; }

/* Contact */
.contact-card { display: block; }
.contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.contact-list li { display: flex; align-items: center; gap: .6rem; }
.contact-list .icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 999px; background: #fff; border: 1px solid rgba(0,0,0,.08); color: var(--brand); }
.contact-list a { color: var(--text); text-decoration: none; font-weight: 700; }
.contact-list a:hover { text-decoration: underline; }

/* Filters and gallery */
.gallery { margin-top: 1.25rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; align-items: start; }
.tile { position: relative; background: transparent; display: grid; grid-template-rows: 1fr auto; align-items: center; justify-items: center; row-gap: .35rem; }
.tile-inner { width: 100%; aspect-ratio: 1 / 1; border-radius: 1rem; display: grid; place-items: center; position: relative; z-index: 0; }
.tile img { max-width: 80%; max-height: 80%; object-fit: contain; display: block; background: transparent; filter: drop-shadow(0 8px 16px rgba(0,0,0,.12)); transition: transform .25s ease; }
.tile-inner:hover img { transform: scale(1.04) rotate(.5deg); }
.tile figcaption { width: 100%; background: transparent; color: var(--text); padding-top: .2rem; border-radius: 0; font-family: 'Great Vibes', ui-serif, Georgia, 'Times New Roman', serif; font-size: 1.25rem; font-weight: 400; line-height: 1.25; text-align: center; opacity: .95; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; z-index: 1; }

@media (max-width: 980px) { .gallery { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) { .gallery { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .gallery { grid-template-columns: 1fr; } }

/* Catalog */
.catalog { margin-top: 1rem; display: grid; gap: 1rem; }
.catalog-controls { display: flex; align-items: center; justify-content: center; }
.cat-switch { position: relative; display: inline-flex; gap: .25rem; background: #fff; border: 1px solid rgba(0,0,0,.08); border-radius: 999px; padding: .25rem; box-shadow: 0 2px 8px rgba(0,0,0,.06) inset; }
.cat-indicator { position: absolute; top: 3px; left: 3px; height: calc(100% - 6px); width: var(--w, 0); transform: translateX(var(--x, 0)); background: linear-gradient(135deg, var(--brand), var(--brand-2)); border-radius: 999px; transition: transform .25s ease, width .25s ease; box-shadow: 0 1px 0 rgba(255,255,255,.4) inset; z-index: 0; }
.cat-btn { position: relative; z-index: 1; border: 0; background: transparent; color: var(--text); padding: .45rem .9rem; border-radius: 999px; font-weight: 700; letter-spacing: .2px; cursor: pointer; transition: color .2s ease, transform .06s ease; }
.cat-btn[aria-selected="true"] { color: #fff; }

.catalog-grid { position: relative; overflow: hidden; }
.catalog-grid.sizing { transition: height .42s cubic-bezier(.22,.69,.12,1); }
.catalog-grid.switching::after { content: none; }
@keyframes fadePulse { from { opacity: 0; } to { opacity: .5; } }

/* Catalog stage slide */
.catalog-stage { position: absolute; inset: 0; width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; align-items: start; will-change: transform; }
.catalog-stage.slide-anim { transition: transform .45s cubic-bezier(.22,.69,.12,1); }
.slide-from-left { transform: translateX(-100%); }
.slide-from-right { transform: translateX(100%); }
.slide-to-left { transform: translateX(-100%); }
.slide-to-right { transform: translateX(100%); }

@media (max-width: 760px) {
  .catalog-stage { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .catalog-stage { grid-template-columns: 1fr; }
}
.catalog-grid.switching { }
.catalog-grid.ready { }

@media (max-width: 760px) {
  .catalog-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .catalog-grid { grid-template-columns: 1fr; }
}

.catalog-empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: .5rem 0; }

/* Catalog note */
.catalog-note { margin-top: 1rem; display: grid; place-items: center; gap: .5rem; text-align: center; }
.catalog-note p { margin: 0; color: var(--muted); }
