/* Pizzeria Mia — shared styles.
   Colour system: white, red and black (approved update to the palette in brand_assets/BRAND-GUIDE.md).
   The token names are kept so every selector stays the same; only their values changed. */

:root {
  --farina: #FFFFFF;      /* white: page backgrounds, clean surfaces */
  --sabbia: #F5F5F5;      /* light grey: subtle panels */
  --tufo: #E5E5E5;        /* light grey: accents on black, selection */
  --kraft: #D4D4D4;       /* grey: dashed notice borders */
  --pietra: #525252;      /* grey: secondary text (7.8:1 on white) */
  --inchiostro: #171717;  /* black: text, headings, outlines, dark sections */
  --cuore: #C9232C;       /* red: brand accent, primary buttons, selected and active states */
  --cornicione: #C9232C;  /* handwritten notes and small tags use the red accent */
  --red-hover: #A81D25;
  --disabled: #6B6B6B;   /* grey: disabled button text */
  --rule: rgba(23, 23, 23, .14);
  --rule-soft: rgba(23, 23, 23, .07);
  --raised: #FFFFFF;

  /* depth: base → raised → floating */
  --shadow-raised: 0 1px 1px rgba(23, 23, 23, .05), 0 8px 18px -12px rgba(23, 23, 23, .28);
  --shadow-book: 0 1px 1px rgba(23, 23, 23, .06), 0 18px 34px -16px rgba(23, 23, 23, .32);
  --shadow-float: 0 2px 4px rgba(23, 23, 23, .07), 0 30px 60px -22px rgba(23, 23, 23, .42);

  --font-display: 'Bodoni Moda', Didot, Georgia, serif;
  --font-sans: 'Jost', Futura, 'Century Gothic', system-ui, sans-serif;
  --font-hand: 'Caveat', cursive;

  /* spacing scale */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px; --s-10: 128px;

  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --spring: cubic-bezier(.34, 1.45, .64, 1);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  /* motion: one easing family, three durations, one stagger step */
  --dur-quick: .3s; --dur-base: .9s; --dur-slow: 1.1s;
  --stagger: 120ms; --reveal-shift: 32px; --load-shift: 44px; --shift-small: 14px;
  --drift: clamp(32px, 4.5vw, 64px); /* travel of scroll-linked parallax */
  /* reveal: quick start, long soft settle, no overshoot; lift: for hovers, no bounce */
  --ease-reveal: cubic-bezier(.16, 1, .3, 1);
  --ease-fade: cubic-bezier(.33, 1, .68, 1);
  --ease-lift: cubic-bezier(.25, 1, .5, 1);
  --ease-exit: cubic-bezier(.4, 0, 1, 1);
}

/* ---------- base ---------- */

.site {
  margin: 0;
  background: var(--farina);
  color: var(--inchiostro);
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
.site ::selection { background: var(--tufo); color: var(--inchiostro); }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

.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;
}

.skip-link {
  position: absolute; left: var(--s-4); top: var(--s-4); z-index: 100;
  background: var(--inchiostro); color: var(--farina); padding: var(--s-3) var(--s-4);
  transform: translateY(-200%);
}
.skip-link:focus-visible { transform: none; }

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--inchiostro);
  outline-offset: 3px;
}

/* ---------- type ---------- */

.t-display {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(52px, 7.2vw, 80px);
  line-height: 1;
  letter-spacing: -.01em;
  font-optical-sizing: auto;
}
.t-h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(34px, 4.4vw, 44px);
  line-height: 1.1;
  letter-spacing: -.01em;
}
.t-h2 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(26px, 3vw, 30px);
  line-height: 1.15;
}
.t-dish {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.2;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.t-label {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.t-body { font-size: 17px; line-height: 1.6; }
.t-lead { font-size: 18px; line-height: 1.6; color: var(--pietra); }
.t-desc { font-size: 14px; font-weight: 300; line-height: 1.45; letter-spacing: .01em; color: var(--pietra); }
.t-price { font-weight: 500; font-size: 15px; line-height: 1.2; font-variant-numeric: tabular-nums; white-space: nowrap; }
.t-hand {
  font-family: var(--font-hand);
  font-weight: 500;
  font-size: 30px;
  line-height: 1.1;
  color: var(--cornicione);
  display: inline-block;
  transform: rotate(-3deg);
}
.measure { max-width: 34em; }

/* ---------- buttons ---------- */
/* Brand book §18: Jost 500 caps 12px +.16em, 1px radius, ink fill or 1px outline, heart appears on hover. */

.btn {
  --heart: 0;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 48px;
  padding: 0 30px;
  border: 1px solid var(--inchiostro);
  border-radius: 1px;
  font: 500 12px/1 var(--font-sans);
  letter-spacing: .16em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: transform .14s var(--ease-out), translate .35s var(--ease-lift), opacity .2s ease;
}
.btn::after {
  content: '';
  position: absolute;
  right: 11px;
  top: 50%;
  width: 11px;
  height: 11px;
  margin-top: -5px;
  background: var(--cuore);
  -webkit-mask: url('../brand_assets/graphics/cuore.svg') center / contain no-repeat;
          mask: url('../brand_assets/graphics/cuore.svg') center / contain no-repeat;
  opacity: 0;
  transform: scale(.3);
  transition: transform .4s var(--ease-lift), opacity .2s ease;
  pointer-events: none;
}
.btn:hover::after, .btn:focus-visible::after { opacity: 1; transform: none; }
.btn:active { transform: scale(.97); translate: 0 1px; transition-duration: .1s, .1s, .2s; }
@media (hover: hover) { .btn:hover { translate: 0 -2px; } }
/* hover colour fades in as a layer behind the label (only opacity animates) */
.btn { isolation: isolate; }
.btn::before {
  content: ''; position: absolute; inset: -1px; z-index: -1; border-radius: inherit;
  background: var(--btn-hover, transparent); box-shadow: var(--btn-shadow, none); opacity: 0; pointer-events: none;
  transition: opacity var(--dur-quick) ease;
}
.btn:hover::before { opacity: 1; }
.btn-primary { background: var(--cuore); border-color: var(--cuore); color: #FFFFFF; }
.btn-primary { --btn-hover: var(--red-hover); --btn-shadow: 0 12px 24px -12px rgba(201, 35, 44, .6); }
.btn-primary::after { background: #FFFFFF; }
.btn-outline { background: transparent; color: var(--inchiostro); }
.btn-outline { --btn-hover: var(--sabbia); --btn-shadow: 0 12px 24px -14px rgba(23, 23, 23, .35); }
.btn-light { background: var(--farina); color: var(--inchiostro); border-color: var(--farina); }
.btn-light { --btn-hover: var(--tufo); --btn-shadow: 0 12px 28px -12px rgba(0, 0, 0, .6); }
.btn-ghost-light { background: transparent; color: var(--farina); border-color: rgba(255, 255, 255, .5); }
.btn-ghost-light:hover { border-color: var(--farina); }
.btn-sm { min-height: 44px; padding: 0 24px; font-size: 11px; }
.btn-lg { min-height: 54px; padding: 0 34px; }
.btn-sm::after { right: 7px; width: 9px; height: 9px; margin-top: -4px; }
.btn-block { width: 100%; white-space: normal; text-align: center; line-height: 1.35; padding-block: 12px; }
.btn[disabled], .btn[aria-disabled='true'],
.btn[disabled]:hover, .btn[aria-disabled='true']:hover { background: var(--tufo); border-color: var(--tufo); color: var(--disabled); cursor: not-allowed; }
.btn[disabled]::after, .btn[aria-disabled='true']::after,
.btn[disabled]::before, .btn[aria-disabled='true']::before { display: none; }
.btn[disabled], .btn[aria-disabled='true'] { translate: none !important; transform: none !important; }

/* quiet text action, used in lists */
.link-btn {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 0 2px;
  background: none; border: 0; cursor: pointer;
  font: 500 11px/1 var(--font-sans); letter-spacing: .18em; text-transform: uppercase;
  color: var(--inchiostro);
  text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 6px;
  transition: opacity .2s ease, transform .3s var(--spring);
}
.link-btn:hover { text-decoration-color: var(--inchiostro); }
.link-btn:active { transform: translateY(1px); }
.link-btn--muted { color: var(--pietra); }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px;
  border: 1px solid var(--rule); border-radius: 50%;
  background: transparent; color: var(--inchiostro); cursor: pointer;
  transition: transform .3s var(--spring), opacity .2s ease;
}
.icon-btn:hover { border-color: var(--inchiostro); }
.icon-btn:active { transform: scale(.92); }
.icon-btn[disabled] { opacity: .35; cursor: not-allowed; }
.icon-btn svg { width: 16px; height: 16px; }

/* ---------- header ---------- */

.site-header { position: relative; z-index: 20; }
.header-inner {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-5);
  padding-block: var(--s-5);
}
/* logo: 96px minimum, a quarter-diameter clear space (24px) around it */
.brand { display: block; flex: none; width: 96px; margin: 0; }
.brand img { display: block; width: 96px; height: 96px; }
.main-nav { display: flex; align-items: center; gap: var(--s-6); margin-left: auto; }
.main-nav a {
  position: relative;
  font: 500 13px/1.4 var(--font-sans); letter-spacing: .16em; text-transform: uppercase;
  color: var(--inchiostro); text-decoration: none; white-space: nowrap;
  padding: 12px 0;
}
.main-nav a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 1px; height: 2px;
  background: var(--cuore); transform: scaleX(0); transform-origin: right;
  transition: transform .55s var(--ease-reveal);
}
.main-nav a:hover::after, .main-nav a[aria-current='page']::after { transform: scaleX(1); transform-origin: left; }
.main-nav a { transition: opacity var(--dur-quick) ease; }
@media (hover: hover) and (min-width: 1024px) { .main-nav:hover a:not(:hover) { opacity: .55; } }
.main-nav a:active { opacity: .7; }
.header-actions { display: flex; align-items: center; gap: var(--s-3); }
/* desktop: a hairline separates the page links from the controls (language, cart) */
@media (min-width: 1024px) {
  .header-actions { padding-left: var(--s-5); border-left: 1px solid var(--rule); }
}
/* mid widths: tighter nav, cart shows icon + count */
@media (min-width: 1024px) and (max-width: 1199px) {
  .main-nav { gap: var(--s-5); }
  .main-nav a { font-size: 12px; }
  .cart-btn .cart-word { display: none; }
  .cart-btn .cart-icon { display: block; }
  .cart-btn { gap: 8px; padding: 0 10px 0 14px; }
}

.cart-btn {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 0 var(--s-4);
  border: 1px solid var(--inchiostro); border-radius: 999px;
  background: transparent; color: var(--inchiostro); cursor: pointer;
  font: 500 12px/1 var(--font-sans); letter-spacing: .2em; text-transform: uppercase;
  transition: transform .14s var(--ease-out), translate .35s var(--ease-lift), opacity .2s ease;
}
@media (hover: hover) { .cart-btn:hover { translate: 0 -2px; } }
.cart-btn { position: relative; isolation: isolate; }
.cart-btn::before {
  content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: var(--sabbia); opacity: 0; pointer-events: none; transition: opacity var(--dur-quick) ease;
}
.cart-btn:hover::before { opacity: 1; }
.cart-icon { display: none; width: 18px; height: 18px; }
.cart-btn:active { transform: scale(.96); }
.cart-count {
  display: inline-grid; place-items: center;
  min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 999px; background: var(--cuore); color: #FFFFFF;
  font-size: 11px; letter-spacing: 0; font-variant-numeric: tabular-nums;
}
.cart-count.bump { animation: bump .5s var(--spring); }
@keyframes bump { 40% { transform: scale(1.35); } }

.nav-toggle { display: none; }

/* language switch: IT | EN, the active one in ink */
.lang-switch { display: inline-flex; padding: 1px; border: 1px solid var(--rule); border-radius: 999px; }
.lang-btn {
  display: inline-grid; place-items: center;
  min-width: 42px; min-height: 40px; padding: 0 10px;
  border: 0; border-radius: 999px; background: transparent; color: var(--pietra); cursor: pointer;
  font: 500 11px/1 var(--font-sans); letter-spacing: .16em; text-transform: uppercase;
  transition: transform .3s var(--spring);
}
.lang-btn:hover { color: var(--inchiostro); }
.lang-btn:active { transform: scale(.94); }
.lang-btn[aria-pressed='true'] { background: var(--inchiostro); color: var(--farina); }

@media (max-width: 1023px) {
  .nav-toggle { display: inline-grid; }
  .main-nav {
    position: absolute; left: var(--gutter); right: var(--gutter); top: calc(100% - var(--s-3));
    flex-direction: column; align-items: stretch; gap: 0;
    padding: var(--s-3) var(--s-5);
    background: var(--raised); border: 1px solid var(--rule); box-shadow: var(--shadow-float);
    opacity: 0; transform: translateY(-8px); pointer-events: none; visibility: hidden;
    transition: opacity .2s ease, transform .35s var(--ease-out), visibility 0s .35s;
  }
  .main-nav.open { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition: opacity .2s ease, transform .35s var(--ease-out); }
  .main-nav a { display: flex; align-items: center; min-height: 52px; padding: 0; font-size: 14px; border-bottom: 1px solid var(--rule-soft); }
  .main-nav a:last-child { border-bottom: 0; }
  .main-nav a::after { display: none; }
  .cart-btn .cart-word { display: none; }
  .cart-btn .cart-icon { display: block; }
  .cart-btn { gap: 8px; padding: 0 10px 0 14px; }
}

/* ---------- brand line graphics ---------- */

.line-art { display: block; overflow: visible; }
.line-art path { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.heart-mark { display: inline-block; width: 14px; height: 14px; vertical-align: -1px; color: var(--cuore); }
.heart-mark path { fill: currentColor; }

/* the one moment of motion: the road draws itself under the hero sentence (800ms) */
.road-draw path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw .8s .65s var(--ease-out) forwards; }
.road-draw + .road-heart { opacity: 0; transform: scale(.4); animation: heart-in .45s 1.5s var(--spring) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes heart-in { to { opacity: 1; transform: none; } }

/* ---------- surfaces ---------- */

/* the paper grain of the old palette is switched off: surfaces are flat white, light grey and black */
.grain { position: relative; isolation: isolate; }
.grain::before {
  content: none; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .14 0 0 0 0 .12 0 0 0 0 .11 0 0 0 .5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .22;
  mix-blend-mode: multiply;
}
.section-dark { background: var(--inchiostro); color: var(--farina); }
.section-dark .t-desc, .section-dark .t-lead { color: rgba(255, 255, 255, .78); }
.section-dark :where(a, button):focus-visible { outline-color: #FFFFFF; }
.section-sabbia { background: var(--sabbia); }
.rule { border: 0; border-top: 1px solid var(--rule); margin: 0; }

/* logo on dark grounds: white disc exactly the size of its circle */
.logo-disc { display: block; aspect-ratio: 1; border-radius: 50%; background: #FFFFFF; }
.logo-disc img { display: block; width: 100%; height: 100%; }

.tbc {
  color: var(--pietra);
  font-style: italic;
  text-decoration: underline dotted rgba(82, 82, 82, .5);
  text-underline-offset: 4px;
}
.section-dark .tbc { color: rgba(255, 255, 255, .72); text-decoration-color: rgba(255, 255, 255, .4); }

.notice {
  display: flex; gap: var(--s-3); align-items: flex-start;
  padding: var(--s-3) var(--s-4);
  border: 1px dashed var(--kraft); border-radius: 2px;
  font-size: 13px; line-height: 1.5; color: var(--pietra);
  background: color-mix(in srgb, var(--sabbia) 60%, transparent);
}

/* ---------- pizza illustration ---------- */

.pizza-svg { display: block; width: 100%; height: auto; overflow: visible; }
.pizza-body { transform-origin: 200px 200px; transition: transform .7s var(--spring); }
.pizza-frame { fill: none; stroke: var(--inchiostro); stroke-width: 1; vector-effect: non-scaling-stroke; }

.layer.entering .piece {
  transform-box: fill-box; transform-origin: center;
  animation: piece-drop .55s var(--spring) both;
  animation-delay: var(--d, 0ms);
}
.layer-sauce.entering, .layer-crust.entering {
  transform-origin: 200px 200px;
  animation: spread .6s var(--ease-out) both;
}
.layer.leaving { animation: layer-out .28s ease forwards; pointer-events: none; }
@keyframes piece-drop { from { opacity: 0; transform: translateY(-16px) scale(1.3) rotate(-8deg); } to { opacity: 1; transform: none; } }
@keyframes spread { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
@keyframes layer-out { to { opacity: 0; } }

/* ---------- cart drawer & sheets ---------- */

.drawer, .sheet {
  margin: 0; padding: 0; border: 0;
  background: var(--farina); color: var(--inchiostro);
  box-shadow: var(--shadow-float);
  max-height: 100dvh;
}
.drawer {
  position: fixed; inset: 0 0 0 auto;
  width: min(440px, 100vw); max-width: 100vw; height: 100dvh;
}
.drawer[open] { display: flex; flex-direction: column; animation: drawer-in .55s var(--ease-reveal); }
.sheet {
  position: fixed; inset: auto 0 0 0; width: 100%; max-width: 100%;
  max-height: 85dvh; border-radius: 14px 14px 0 0;
}
.sheet[open] { display: flex; flex-direction: column; animation: sheet-in .45s var(--ease-out); }
.drawer::backdrop, .sheet::backdrop { background: rgba(23, 23, 23, .45); animation: fade-in .3s ease; }
@keyframes drawer-in { from { transform: translateX(64px); opacity: 0; } }
@keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } }

.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  padding: var(--s-5) var(--s-5) var(--s-4);
  border-bottom: 1px solid var(--rule);
}
.panel-body { flex: 1; overflow-y: auto; padding: var(--s-4) var(--s-5); overscroll-behavior: contain; }
.panel-foot { padding: var(--s-4) var(--s-5) var(--s-5); border-top: 1px solid var(--rule); background: var(--sabbia); }

.cart-line { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: var(--s-3) var(--s-4); padding: var(--s-4) 0; border-bottom: 1px solid var(--rule-soft); }
.cart-line:last-child { border-bottom: 0; }
.cart-thumb { width: 56px; height: 56px; }
.qty { display: inline-flex; align-items: center; gap: var(--s-2); }
.qty output { min-width: 2ch; text-align: center; font-weight: 500; font-variant-numeric: tabular-nums; }
.qty .icon-btn { width: 34px; height: 34px; }

.cart-lines, .review-lines { list-style: none; margin: 0; padding: 0; }
.line-main { min-width: 0; }
.line-name { overflow-wrap: anywhere; }
.line-tag {
  display: inline-block; margin-top: 6px; padding: 2px 8px;
  border: 1px solid var(--rule); border-radius: 999px;
  font: 500 10px/1.5 var(--font-sans); letter-spacing: .16em; text-transform: uppercase; color: var(--pietra);
}
.line-tag--custom { border-color: var(--cornicione); color: var(--cornicione); }
.line-desc { margin-top: 6px; }
.line-details { margin: 8px 0 0; display: grid; gap: 2px; }
.line-details div { font-size: 13px; line-height: 1.45; color: var(--pietra); overflow-wrap: anywhere; }
.line-details dt { display: inline; font-weight: 500; color: var(--inchiostro); }
.line-details dt::after { content: ': '; }
.line-details dd { display: inline; margin: 0; }
.line-actions { flex-wrap: wrap; margin-top: 10px; }
.line-links { display: inline-flex; flex-wrap: wrap; gap: var(--s-4); margin-left: auto; }
.line-prices { text-align: right; }
.line-prices .t-desc { font-size: 12px; margin-top: 2px; white-space: nowrap; }

.cart-empty { padding: 48px 0; text-align: center; }
.cart-empty .t-desc { margin: 12px auto 28px; max-width: 26em; }
.cart-empty-actions { display: flex; flex-direction: column; gap: 12px; align-items: center; }

.panel-head-title { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.panel-head-title h2:focus { outline: none; }
.back-link { min-height: 32px; margin-left: -2px; }
.back-link svg { width: 12px; height: 12px; }
.foot-total { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-4); }
.foot-total .t-price { font-size: 22px; }
.foot-sample { font-size: 12px; margin: 4px 0 14px; }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 12px; margin-top: 12px; }
.foot-row .link-btn { white-space: nowrap; }
.foot-kept { font-size: 12px; margin-top: 10px; text-align: center; }

.review-lead { margin: 0 0 var(--s-2); }
.review-line { padding: var(--s-4) 0; border-bottom: 1px solid var(--rule-soft); }
.review-num { font-weight: 400; color: var(--pietra); }
.review-qty { font-family: var(--font-sans); font-weight: 500; letter-spacing: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
.review-prices { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); margin: 10px 0 0; }
.review-prices dt { font-size: 12px; color: var(--pietra); }
.review-prices dd { margin: 2px 0 0; }
.review-prices div:last-child { text-align: right; }
.wa-how { margin: 0 0 12px; }
.wa-send svg, .btn svg { flex: none; }
.wa-opened {
  margin: 0 0 12px; padding: var(--s-3) var(--s-4);
  border-left: 2px solid var(--inchiostro); background: var(--raised);
  font-size: 14px; line-height: 1.5;
}
.wa-blocked { margin: 0 0 12px; }

.note-field { display: block; margin-top: var(--s-5); }
.note-field .optional { text-transform: none; letter-spacing: 0; color: var(--pietra); }
.note-field textarea {
  display: block; width: 100%; min-height: 84px; margin-top: var(--s-2); padding: var(--s-3);
  border: 1px solid var(--rule); border-radius: 3px; background: var(--raised);
  font: 400 15px/1.5 var(--font-sans); color: var(--inchiostro); resize: vertical;
}
.note-field textarea:hover { border-color: rgba(23, 23, 23, .45); }
.note-field textarea:focus-visible { outline: 2px solid var(--inchiostro); outline-offset: 2px; border-color: var(--inchiostro); }

.field-error {
  display: flex; gap: var(--s-2); align-items: flex-start;
  margin: var(--s-5) 0 0; padding: var(--s-3) var(--s-4);
  border-left: 2px solid var(--cuore); background: var(--sabbia);
  font-size: 14px; color: var(--inchiostro);
}

.toast-region { position: fixed; left: 50%; bottom: var(--s-5); z-index: 60; transform: translateX(-50%); width: min(420px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  padding: var(--s-3) var(--s-3) var(--s-3) var(--s-5);
  background: var(--inchiostro); color: var(--farina);
  box-shadow: var(--shadow-float); border-radius: 2px;
  font-size: 15px; pointer-events: auto;
  animation: toast-in .45s var(--spring);
}
.toast.out { animation: layer-out .25s ease forwards; }
.toast .link-btn { color: #FFFFFF; text-decoration-color: rgba(255, 255, 255, .45); }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px); } }

/* ---------- footer ---------- */

.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; text-underline-offset: 5px; }
.site-footer .foot-nav a { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- motion system ----------
   Only transform and opacity animate. Hidden-until-revealed states apply only under <html class="motion">,
   set before first paint by the inline script in each page's <head> and never for reduced motion, so
   content is never hidden without it. js/ui/motion.js adds .is-visible as elements scroll into view. */

@keyframes rise { from { opacity: 0; transform: translate3d(0, var(--load-shift), 0); } }
@keyframes rise-sm { from { opacity: 0; transform: translate3d(0, var(--shift-small), 0); } }
@keyframes settle { from { opacity: 0; transform: scale(.9) rotate(-10deg); } }
@keyframes drawer-out { to { opacity: 0; transform: translateX(40px); } }
@keyframes sheet-out { to { opacity: 0; transform: translateY(40px); } }

/* page load: hero and page intro, staggered with --i */
.motion .load-in { animation: rise var(--dur-slow) var(--ease-reveal) both; animation-delay: calc(var(--i, 0) * 140ms + 80ms); }
.motion .load-in--settle { animation-name: settle; }

/* scroll reveal */
.motion [data-reveal], .motion [data-reveal-item] { opacity: 0; transform: translate3d(0, var(--reveal-shift), 0) scale(.98); }
.motion [data-reveal='settle'] { transform: scale(.9) rotate(-8deg); }
.motion [data-reveal='line'] { transform: scaleX(0); transform-origin: left center; }
.motion [data-reveal].is-visible, .motion [data-reveal-item].is-visible {
  opacity: 1; transform: none;
  transition:
    opacity var(--dur-base) var(--ease-fade) calc(var(--i, 0) * var(--stagger)),
    transform var(--dur-slow) var(--ease-reveal) calc(var(--i, 0) * var(--stagger)),
    translate .5s var(--ease-lift);
}
.motion [data-reveal='line'].is-visible { transition-duration: var(--dur-base), 1.4s, .5s; }

/* cart drawer and sheets: exit animation; cart lines stagger in when the drawer opens */
.drawer.is-closing { animation: drawer-out .22s var(--ease-exit) forwards; }
.sheet.is-closing { animation: sheet-out .22s var(--ease-exit) forwards; }
.drawer.is-closing::backdrop, .sheet.is-closing::backdrop { animation: layer-out .22s ease forwards; }
.motion .drawer.is-opening :is(.cart-line, .review-line, .cart-empty) { animation: rise-sm .6s var(--ease-reveal) both; animation-delay: 80ms; }
.motion .drawer.is-opening :is(.cart-line, .review-line):nth-child(2) { animation-delay: 150ms; }
.motion .drawer.is-opening :is(.cart-line, .review-line):nth-child(3) { animation-delay: 220ms; }
.motion .drawer.is-opening :is(.cart-line, .review-line):nth-child(n+4) { animation-delay: 290ms; }

/* mobile navigation: links follow the panel in */
.motion .main-nav.open a { animation: rise-sm .5s var(--ease-reveal) both; }
.motion .main-nav.open a:nth-child(2) { animation-delay: 60ms; }
.motion .main-nav.open a:nth-child(3) { animation-delay: 120ms; }
.motion .main-nav.open a:nth-child(4) { animation-delay: 180ms; }

/* scroll scenes: decorative motion scrubbed by the scroll position, never played on a timer.
   [data-scene="cover|entry|exit"] is the stretch of scrolling that drives it (a CSS view-timeline range).
   [data-fx] descendants name their keyframes in --fx and can use part of that stretch with --a/--b (0–1).
   Browsers without scroll-driven animations get --p from js/ui/motion.js, which scrubs a paused animation. */
[data-scene] { --a: 0; --b: 1; }
[data-scene='cover'] { --kind: cover; }
[data-scene='entry'] { --kind: entry; }
[data-scene='exit'] { --kind: exit; }
@supports (animation-timeline: view()) {
  .motion [data-scene] { view-timeline: --scene block; }
  .motion [data-fx] {
    animation: var(--fx) linear both; animation-duration: auto; animation-timeline: --scene;
    animation-range: var(--kind) calc(var(--a) * 100%) var(--kind) calc(var(--b) * 100%);
  }
}
.motion.scroll-js [data-fx] {
  animation: var(--fx) 1s linear both paused;
  animation-delay: calc(clamp(0, (var(--p, 0) - var(--a)) / (var(--b) - var(--a)), 1) * -1s);
}

/* road lines drawn by scrolling: the clip slides open from the left while its content slides back the
   same distance, so the line stays still and appears to be drawn (transform only) */
.road-wipe { overflow: hidden; overflow: clip; overflow-clip-margin: 3px; }
[data-fx='wipe'] { --fx: fx-wipe; }
[data-fx='wipe-in'] { --fx: fx-wipe-in; }
/* the extra 4px clears the 3px clip margin, so no dot of line shows before the drawing starts */
@keyframes fx-wipe { from { transform: translateX(calc(-100% - 4px)); } }
@keyframes fx-wipe-in { from { transform: translateX(calc(100% + 4px)); } }
/* the same wipe from the right, for a line whose stroke starts at its right-hand end */
[data-fx='wipe-rtl'] { --fx: fx-wipe-rtl; }
[data-fx='wipe-rtl-in'] { --fx: fx-wipe-rtl-in; }
@keyframes fx-wipe-rtl { from { transform: translateX(calc(100% + 4px)); } }
@keyframes fx-wipe-rtl-in { from { transform: translateX(calc(-100% - 4px)); } }

/* lists people read and order from: one quick fade for the whole list, no rise, no stagger */
.motion [data-reveal='fade'] { transform: none; }
.motion [data-reveal='fade'].is-visible { transition: opacity .45s var(--ease-fade); }

/* handwritten notes write themselves on, once, just after the block they sit in is revealed: the same
   moving clip as the road lines (the clip slides open, its content slides back the same distance). It sits
   inside the .t-hand element, so the note keeps its tilt and the pen follows the tilted line. The 12px start
   offset hides the swashes that the clip margin lets through. */
.note-write { display: inline-block; overflow: hidden; overflow: clip; overflow-clip-margin: 8px; }
.note-write-in { display: inline-block; }
.motion :is([data-reveal], [data-reveal-item]) .note-write { transform: translateX(calc(-100% - 12px)); }
.motion :is([data-reveal], [data-reveal-item]) .note-write-in { transform: translateX(calc(100% + 12px)); }
.motion .is-visible :is(.note-write, .note-write-in) {
  transform: none;
  transition: transform .8s var(--ease-fade) calc(var(--i, 0) * var(--stagger) + .45s);
}

@media print {
  .motion [data-reveal], .motion [data-reveal-item], .motion .load-in { opacity: 1 !important; transform: none !important; animation: none !important; }
  .motion [data-fx] { animation: none !important; }
  .motion :is(.note-write, .note-write-in) { transform: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0ms !important; transition-duration: .001ms !important; transition-delay: 0ms !important; scroll-behavior: auto !important; }
  .road-draw path { stroke-dashoffset: 0; }
}

/* very narrow phones: keep logo, language switch, cart and menu on one row */
@media (max-width: 374px) {
  .header-inner { gap: var(--s-3); }
  .header-actions { gap: 6px; }
  .lang-btn { min-width: 34px; padding: 0 6px; }
  .cart-btn { padding: 0 8px 0 10px; gap: 6px; }
}

/* ---------- database-backed menu (js/menu/live.js): only rendered when the data has it ---------- */

.site .price-was { color: var(--pietra); font-weight: 400; margin-right: var(--s-1); text-decoration-thickness: 1px; }
.site .menu-promo { margin: var(--s-1) 0 0; color: var(--cuore); font-size: 14px; font-weight: 500; letter-spacing: .02em; }
.site .menu-allergens { margin: var(--s-1) 0 0; font-size: 14px; line-height: 1.55; color: var(--pietra); }
.site .menu-allergens .t-label { margin-right: var(--s-1); }
.site .menu-allergens .allergen { white-space: nowrap; margin-right: var(--s-2); }
.site .menu-allergens .allergen b { font-weight: 600; color: var(--inchiostro); }
.site .menu-allergens .allergen-notes { display: block; }
.site .menu-terms { margin: var(--s-1) 0 0; font-size: 13px; color: var(--pietra); }
.site .menu-item.is-sold-out .t-dish,
.site .menu-item.is-sold-out .t-price { color: var(--pietra); }
.site .menu-add:disabled,
.site .btn:disabled { cursor: not-allowed; }
.site .menu-item.has-thumb { display: grid; grid-template-columns: 1fr; }
.site .menu-thumb { display: block; width: 96px; aspect-ratio: 1; border-radius: 50%; overflow: hidden; margin-bottom: var(--s-3);
  box-shadow: var(--shadow-raised); background: var(--sabbia); }
.site .menu-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.site .offers { padding: var(--s-5); background: var(--farina); border-radius: 4px; box-shadow: var(--shadow-raised); }
.site .line-tag--unavailable { background: var(--cuore); color: var(--farina); }
.site .wa-changed { border-color: var(--cuore); }
.menu-mode-badge {
  position: fixed; left: var(--s-3); bottom: var(--s-3); z-index: 60; display: flex; gap: var(--s-3); align-items: center;
  padding: var(--s-2) var(--s-3); background: var(--inchiostro); color: var(--farina); font: 500 12px/1.3 var(--font-sans);
  letter-spacing: .03em; border-radius: 3px; box-shadow: var(--shadow-float); max-width: calc(100vw - 24px);
}
.menu-mode-badge a { color: var(--farina); text-decoration: underline; text-underline-offset: 2px; }
.menu-mode-badge a:hover { color: var(--tufo); }
.menu-mode-badge a:focus-visible { outline: 2px solid var(--farina); outline-offset: 2px; }
.menu-mode-badge a:active { opacity: .8; }
/* a promotion makes the featured price longer: let price and button wrap instead of overflowing */
.site .feature-buy { flex-wrap: wrap; row-gap: var(--s-2); }
