/* ============================================================
   SFIZIO v2 — base: reset, fonts, primitives. Mobile-first.
   ============================================================ */

/* fonts resolve relative to THIS css file — portable at any mount point */
@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---- reset ---- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--fs-md);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;                 /* wide scrubbed layers never cause body scroll */
  min-height: 100dvh;
}
img, picture, video, canvas, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; padding: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 560; line-height: 1.08; text-wrap: balance; }
p { text-wrap: pretty; }
:focus-visible { outline: 2px solid var(--act); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--pizza-deep); color: var(--ink); }

/* ---- layout primitives ---- */
.wrap { width: min(100% - 2 * var(--gutter), var(--page-max)); margin-inline: auto; }
.section { padding-block: var(--sp-8); }
.stack > * + * { margin-top: var(--sp-4); }

.kicker {
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
.kicker--pizza { color: var(--pizza); }
.kicker--street { color: var(--street); }
.kicker--dining { color: var(--dining); }

.display { font-size: var(--fs-display); }
.lede { font-size: var(--fs-lg); color: var(--muted); line-height: 1.4; }

/* ---- buttons (44px+ touch targets, thumb-first) ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: 2.9rem; padding: 0.65rem 1.4rem;
  border-radius: var(--r-pill);
  font-weight: 640; font-size: var(--fs-sm); letter-spacing: 0.02em;
  background: var(--surface-2); color: var(--ink);
  border: 1px solid var(--line);
  transition: transform var(--dur-1) var(--ease), background var(--dur-1) var(--ease),
              border-color var(--dur-1) var(--ease);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.96); }
.btn--primary { background: var(--act); border-color: transparent; color: #fff; }
.btn--ghost { background: transparent; }

/* ---- media frames: every image sits in a frame; loads soft ---- */
.media {
  position: relative; overflow: hidden;
  border-radius: var(--r-md);
  background:
    radial-gradient(120% 90% at 30% 20%, var(--surface-2), var(--surface) 70%);
}
.media > img { width: 100%; height: 100%; object-fit: cover; }
.media > img[data-lazy] { opacity: 0; transform: scale(1.04); }
.media > img.is-loaded { opacity: 1; transform: none;
  transition: opacity var(--dur-3) var(--ease), transform var(--dur-3) var(--ease); }
.media--16x9 { aspect-ratio: 16 / 9; }
.media--4x3 { aspect-ratio: 4 / 3; }
.media--1x1 { aspect-ratio: 1 / 1; }
.media--3x4 { aspect-ratio: 3 / 4; }

/* concept-card placeholder frame (only when a section has no live products) */
.media--concept::after {
  content: "in arrivo";
  position: absolute; inset: auto var(--sp-3) var(--sp-3) auto;
  font-size: var(--fs-xs); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); border: 1px dashed var(--line-strong);
  padding: 0.2rem 0.6rem; border-radius: var(--r-pill);
}

/* ---- price chip ---- */
.price { font-family: var(--font-display); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---- horizontal scroller base (carousels build on this) ---- */
.hscroll {
  display: flex; gap: var(--sp-4);
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  padding-inline: var(--gutter);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { scroll-snap-align: start; flex: 0 0 auto; }

/* ---- reveal engine hooks (IO baseline paradigm) ---- */
[data-reveal] { opacity: 0; transform: translateY(24px); }
[data-reveal].is-revealed {
  opacity: 1; transform: none;
  transition: opacity var(--dur-3) var(--ease), transform var(--dur-3) var(--ease);
  transition-delay: calc(var(--i, 0) * 60ms);
}

/* ---- utilities ---- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}
.has-dock { padding-bottom: calc(var(--dock-h) + env(safe-area-inset-bottom) + var(--sp-6)); }

/* ---- reduced motion: content first, always ---- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .media > img[data-lazy] { opacity: 1; transform: none; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
