/* =========================================================
   PIZZA SPEEDY — Stylesheet
   Vintage cartoon poster · brand-coherent
   Palette/typography from official Brand Book v1.0
   ========================================================= */

/* ---------- Design tokens ---------- */
:root {
  /* Brand palette */
  --red:    #C43B2F;   /* Rosso Pomodoro — colore guida */
  --red-dk: #9e2c22;
  --green:  #2E6B44;   /* Verde Basilico — secondario */
  --green-dk:#214f33;
  --cream:  #F5ECD7;   /* Crema Mozzarella — sfondo (mai bianco puro) */
  --cream-2:#efe2c6;
  --cream-3:#e7ddc6;
  --ink:    #271F1B;   /* Nero Forno — testo e contorni */
  --mustard:#E0A82E;   /* Giallo Senape — solo accento */

  /* Semantic */
  --bg:        var(--cream);
  --surface:   #fbf4e3;
  --text:      var(--ink);
  --text-soft: #5b5049;
  --line:      rgba(39,31,27,.16);

  /* Type */
  --f-display: "Lobster", "Pacifico", cursive;
  --f-head:    "Oswald", system-ui, sans-serif;
  --f-body:    "Work Sans", system-ui, sans-serif;

  /* Rhythm */
  --maxw: 1180px;
  --gut: clamp(18px, 5vw, 56px);
  --radius: 14px;

  /* Layers */
  --z-stage: 1;
  --z-beats: 5;
  --z-nav: 40;
  --z-orderbar: 60;
  --z-modal: 100;
}

/* ---------- Reset ---------- */
*,*::before,*::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--f-body);
  color: var(--text);
  background: var(--bg);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
:focus-visible { outline: 3px solid var(--mustard); outline-offset: 3px; border-radius: 4px; }
.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; }

/* (nessuna texture di rumore: look pulito da animazione disegnata) */

/* ---------- Typography helpers ---------- */
.display { font-family: var(--f-display); font-weight: 400; line-height: .95; }
.head { font-family: var(--f-head); text-transform: uppercase; letter-spacing: .02em; }
.tabular { font-variant-numeric: tabular-nums; }

.eyebrow {
  font-family: var(--f-head);
  text-transform: uppercase;
  letter-spacing: .22em;
  font-size: .8rem;
  font-weight: 600;
  color: var(--red);
}

/* Tricolor speed stripe (brand element) */
.tricolor {
  height: 7px; width: 120px; border-radius: 99px;
  background: linear-gradient(90deg, var(--red) 0 33.3%, #fff 33.3% 66.6%, var(--green) 66.6% 100%);
  border: 1.5px solid var(--ink);
}

/* Checkerboard band (tovaglia) — brand element, never over the logo */
.checker {
  height: 26px;
  background:
    repeating-conic-gradient(var(--green) 0% 25%, transparent 0% 50%) 0 0 / 26px 26px,
    var(--cream);
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
}

/* ---------- Layout ---------- */
.wrap { width: min(100% - var(--gut)*2, var(--maxw)); margin-inline: auto; }
section { position: relative; z-index: 1; }

/* ---------- Buttons ---------- */
.btn {
  --bg: var(--red);
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 52px; padding: 0 1.5rem;
  font-family: var(--f-head); text-transform: uppercase; letter-spacing: .04em;
  font-weight: 700; font-size: 1.05rem;
  color: var(--cream); background: var(--bg);
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 4px 0 var(--ink);
  transition: transform .12s ease, box-shadow .12s ease, background .2s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--ink); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.btn--green { --bg: var(--green); }
.btn--ghost { --bg: var(--surface); color: var(--ink); }
.btn--lg { min-height: 64px; font-size: 1.3rem; padding: 0 2.2rem; }
.btn svg { width: 1.25em; height: 1.25em; }

/* =========================================================
   TOP NAV (reveals after hero)
   ========================================================= */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: var(--z-nav);
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .6rem var(--gut);
  background: rgba(245,236,215,.92);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--ink);
  transform: translateY(-110%);
  transition: transform .35s ease;
}
.nav.is-visible { transform: translateY(0); }
.nav__brand { display: flex; align-items: center; gap: .6rem; }
.nav__brand img { height: 38px; width: auto; }
.nav__links { display: flex; align-items: center; gap: 1.4rem; }
.nav__links a {
  font-family: var(--f-head); text-transform: uppercase; letter-spacing: .04em;
  font-weight: 600; font-size: .95rem;
}
.nav__links a:hover { color: var(--red); }
.nav__cta { display: flex; gap: .5rem; }
@media (max-width: 860px) {
  .nav__links { display: none; }
  .nav { padding: .5rem var(--gut); }
}

/* =========================================================
   CINEMATIC HERO (scroll-driven)
   Tall track + sticky stage. Poster crossfades to video,
   video time scrubbed by scroll, text beats appear in order.
   ========================================================= */
.cinema {
  position: relative;
  height: 460vh;            /* scroll track length (più corta = scroll più fluido/snello) */
  background: var(--ink);
  z-index: 1;
}
.stage {
  position: sticky; top: 0;
  height: 100vh; height: 100dvh;
  overflow: hidden;
  display: grid; place-items: center;
  background: var(--ink);
}
.stage__media { position: absolute; inset: 0; }
.stage__media img,
.stage__media video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
#heroVideo { opacity: 0; transition: opacity .6s ease; }
.stage.is-playing #heroVideo { opacity: 1; }
.stage.is-playing #heroPoster { opacity: 0; }
#heroPoster { transition: opacity .6s ease; z-index: 2; }

/* cinematic vignette + film grain over media */
.stage__media::after {
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 35%, transparent 45%, rgba(0,0,0,.55) 100%);
}

/* Poster title — wordmark ufficiale del brand sovrapposto alla scena */
.poster-title {
  position: absolute; z-index: 4; top: 1.5vh; left: 0; right: 0;
  display: flex; justify-content: center; pointer-events: none;
  transition: opacity .5s ease, transform .5s ease;
}
.poster-title img {
  width: min(66vw, 560px); height: auto;
  filter: drop-shadow(3px 5px 0 rgba(39,31,27,.4));
}
.stage.is-playing .poster-title { opacity: 0; transform: translateY(-24px); }

.scroll-hint {
  position: absolute; z-index: 6; bottom: 4vh; left: 50%; transform: translateX(-50%);
  color: var(--cream); font-family: var(--f-head); text-transform: uppercase;
  letter-spacing: .2em; font-size: .8rem; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: .4rem;
  transition: opacity .4s ease;
}
.scroll-hint .chev { width: 22px; height: 22px; animation: bob 1.4s ease-in-out infinite; }
@keyframes bob { 0%,100%{ transform: translateY(0);} 50%{ transform: translateY(7px);} }
.stage.scrolled .scroll-hint { opacity: 0; }
@media (max-width: 860px){ .scroll-hint { bottom: calc(74px + env(safe-area-inset-bottom)); } }

/* ----- Scroll text beats -----
   Le scritte entrano SOLO in orizzontale o verticale (mai diagonale, mai
   dagli angoli), si fermano in una zona che non copre la mascotte e poi
   scompaiono. Font = wordmark (Lobster). */
.beats { position: absolute; inset: 0; z-index: var(--z-beats); pointer-events: none; }
.beat {
  position: absolute;
  display: flex;
  opacity: 0;
  transition: transform .6s cubic-bezier(.2,.85,.25,1), opacity .45s ease;
  will-change: transform, opacity;
}
.beat__txt {
  font-family: var(--f-display);
  font-size: clamp(2.2rem, 9vw, 6.5rem);
  line-height: .9; color: var(--cream);
  -webkit-text-stroke: 3px var(--ink);   /* outline spesso come il wordmark */
  paint-order: stroke fill;              /* fill sopra lo stroke = bordo pulito */
  text-shadow: 4px 5px 0 rgba(39,31,27,.45);
  white-space: nowrap;
}

/* Posizioni alternate (mai centro): frase 1 in alto-sinistra, frase 2 in basso-destra.
   Lo slogan riusa gli stessi angoli per dare ritmo. Entrate solo orizzontali. */
.beat--asporto, .beat--toogood {
  top: 9%; left: 5vw; justify-content: flex-start;
  transform: translateX(-118vw);                 /* entra da SINISTRA */
}
.beat--consegne, .beat--toospeedy {
  bottom: 11%; right: 5vw; justify-content: flex-end;
  transform: translateX(118vw);                  /* entra da DESTRA */
}
.beat--asporto .beat__txt   { color: var(--green); -webkit-text-stroke-color: var(--ink); }
.beat--consegne .beat__txt  { color: var(--cream); -webkit-text-stroke-color: var(--ink); }
.beat--toogood .beat__txt   { color: var(--red);   -webkit-text-stroke-color: var(--cream); }
.beat--toospeedy .beat__txt { color: var(--green); -webkit-text-stroke-color: var(--cream); }
/* Lo slogan finale un filo più grande delle frasi singole */
.beat--toogood .beat__txt,
.beat--toospeedy .beat__txt { font-size: clamp(2.7rem, 10.5vw, 7.6rem); }

/* Final CTA beat (finale) */
.beat--cta {
  inset: 0; align-items: center; justify-content: center; flex-direction: column; gap: 1.6rem;
  transform: scale(.85);
}
.beat--cta .beat__txt { color: var(--mustard); position: relative; font-size: clamp(3rem, 13vw, 9rem); }
.beat--cta .cta-actions { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; pointer-events: auto; position: relative; }
/* Cinematic spotlight scrim for the finale, so CTA always reads */
.beat--cta::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(70% 60% at 50% 48%, rgba(0,0,0,.5), rgba(0,0,0,.82));
  opacity: 0; transition: opacity .5s ease;
}
.beat--cta.in::before { opacity: 1; }

/* Stato attivo: scivola alla posizione di riposo (solo asse) */
.beat.in { opacity: 1; transform: translateX(0); }
.beat--cta.in { opacity: 1; transform: scale(1); }

/* =========================================================
   GENERIC SECTIONS
   ========================================================= */
.section-pad { padding: clamp(56px, 9vw, 120px) 0; }
.section-head { text-align: center; margin-bottom: clamp(28px, 5vw, 56px); }
.section-head h2 {
  font-family: var(--f-display); font-weight: 400;
  font-size: clamp(2.4rem, 6vw, 4.2rem); color: var(--green); line-height: 1;
  margin-top: .3rem;
}
.section-head .tricolor { margin: 1rem auto 0; }
.lead { max-width: 60ch; margin-inline: auto; color: var(--text-soft); }

/* Intro / claim band */
.claim {
  background: var(--green); color: var(--cream);
  text-align: center; padding: clamp(40px,7vw,90px) 0;
  border-top: 3px solid var(--ink); border-bottom: 3px solid var(--ink);
}
.claim p { font-family: var(--f-display); font-size: clamp(2rem, 6vw, 4rem); line-height: 1.05; }
.claim .small { font-family: var(--f-body); font-size: 1.05rem; opacity: .9; margin-top: .6rem; }

/* ----- How it works ----- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 3vw, 30px); }
.step {
  background: var(--surface); border: 2.5px solid var(--ink); border-radius: var(--radius);
  padding: 2rem 1.4rem; text-align: center; box-shadow: 6px 6px 0 var(--ink);
}
.step__n {
  width: 56px; height: 56px; margin: 0 auto 1rem;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--red); color: var(--cream); border: 2.5px solid var(--ink);
  font-family: var(--f-display); font-size: 1.8rem;
}
.step h3 { font-family: var(--f-head); text-transform: uppercase; letter-spacing: .03em; font-size: 1.25rem; margin-bottom: .4rem; }
.step p { color: var(--text-soft); font-size: .98rem; }
@media (max-width: 760px){ .steps { grid-template-columns: 1fr; } }

/* ----- Menu ----- */
.menu { background: var(--cream-2); }
.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: clamp(16px,2.5vw,26px); }
.pizza {
  background: var(--surface); border: 2.5px solid var(--ink); border-radius: var(--radius);
  padding: 1.3rem 1.4rem; box-shadow: 5px 5px 0 var(--ink);
  display: flex; flex-direction: column; gap: .35rem;
  transition: transform .14s ease, box-shadow .14s ease;
}
.pizza:hover { transform: translateY(-3px); box-shadow: 7px 9px 0 var(--ink); }
.pizza__top { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.pizza__name { font-family: var(--f-head); text-transform: uppercase; letter-spacing: .02em; font-size: 1.2rem; font-weight: 600; }
.pizza__price { font-family: var(--f-head); font-weight: 700; font-size: 1.25rem; color: var(--red); background: var(--mustard); padding: .05em .5em; border: 2px solid var(--ink); border-radius: 8px; white-space: nowrap; }
.pizza__desc { color: var(--text-soft); font-size: .95rem; }
.menu-note { text-align:center; margin-top: 2rem; color: var(--text-soft); }

/* ----- Info / contatti ----- */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px,4vw,44px); align-items: stretch; }
.info-card { background: var(--surface); border: 2.5px solid var(--ink); border-radius: var(--radius); padding: 1.8rem; box-shadow: 6px 6px 0 var(--ink); }
.info-card h3 { font-family: var(--f-head); text-transform: uppercase; letter-spacing: .03em; font-size: 1.3rem; margin-bottom: 1rem; color: var(--green); }
.info-row { display: flex; gap: .8rem; padding: .55rem 0; border-bottom: 1px dashed var(--line); }
.info-row:last-child { border-bottom: none; }
.info-row svg { width: 22px; height: 22px; flex: none; color: var(--red); margin-top: 2px; }
.info-row .lbl { font-family: var(--f-head); text-transform: uppercase; font-size: .8rem; letter-spacing: .08em; color: var(--text-soft); }
.hours li { display: flex; justify-content: space-between; padding: .3rem 0; border-bottom: 1px dashed var(--line); }
.hours li:last-child { border-bottom: none; }
.map-embed { position: relative; border: 2.5px solid var(--ink); border-radius: var(--radius); overflow: hidden; box-shadow: 6px 6px 0 var(--ink); min-height: 300px; background: var(--cream-3); }
.map-embed iframe { position: relative; z-index: 1; width: 100%; height: 100%; min-height: 300px; border: 0; display: block; filter: saturate(.9) sepia(.12); }
/* Fallback shown behind the iframe (visible only if tiles fail to load) */
.map-fallback {
  position: absolute; inset: 0; z-index: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem;
  color: var(--green); text-align: center; padding: 1rem;
  background:
    repeating-linear-gradient(45deg, rgba(46,107,68,.06) 0 14px, transparent 14px 28px),
    var(--cream-3);
  font-family: var(--f-head); text-transform: uppercase; letter-spacing: .06em; font-size: .95rem;
}
.map-fallback svg { width: 42px; height: 42px; }
.map-open {
  position: absolute; z-index: 2; right: 12px; bottom: 12px;
  display: inline-flex; align-items: center; gap: .4em;
  padding: .55em .9em; background: var(--cream);
  border: 2.5px solid var(--ink); border-radius: 999px; box-shadow: 0 3px 0 var(--ink);
  font-family: var(--f-head); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; font-size: .85rem;
}
.map-open svg { width: 1.05em; height: 1.05em; }
.map-open:hover { transform: translateY(-1px); color: var(--red); }
@media (max-width: 820px){ .info-grid { grid-template-columns: 1fr; } }

/* ----- Big order CTA ----- */
.order {
  background: var(--red); color: var(--cream); text-align: center;
  border-top: 3px solid var(--ink); border-bottom: 3px solid var(--ink);
  background-image:
    repeating-conic-gradient(rgba(255,255,255,.05) 0% 25%, transparent 0% 50%);
  background-size: 40px 40px;
}
.order h2 { font-family: var(--f-display); font-size: clamp(2.6rem,7vw,5rem); line-height: 1; margin-bottom: 1rem; }
.order p { max-width: 46ch; margin: 0 auto 2rem; font-size: 1.1rem; }
.order .cta-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.order .btn--ghost { color: var(--ink); }

/* ----- Footer ----- */
.footer { background: var(--ink); color: var(--cream); padding: clamp(40px,6vw,72px) 0 110px; }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
.footer img.logo { height: 64px; width: auto; background: var(--cream); padding: 8px 12px; border-radius: 10px; }
.footer h4 { font-family: var(--f-head); text-transform: uppercase; letter-spacing: .08em; font-size: .9rem; margin-bottom: .8rem; color: var(--mustard); }
.footer a:hover { color: var(--mustard); }
.footer .muted { opacity: .7; font-size: .85rem; margin-top: 1.4rem; }
@media (max-width: 760px){ .footer__grid { grid-template-columns: 1fr; gap: 1.6rem; } }

/* =========================================================
   STICKY MOBILE ORDER BAR
   ========================================================= */
.orderbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-orderbar);
  display: none; gap: .6rem; padding: .6rem;
  padding-bottom: calc(.6rem + env(safe-area-inset-bottom));
  background: rgba(39,31,27,.96); backdrop-filter: blur(6px);
  border-top: 2.5px solid var(--mustard);
}
.orderbar .btn { flex: 1; box-shadow: none; min-height: 50px; }
@media (max-width: 860px){ .orderbar { display: flex; } .footer { padding-bottom: 96px; } }

/* =========================================================
   ACCESSIBILITY: reduced motion
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cinema { height: auto; }
  .stage { position: relative; height: auto; min-height: 80vh; }
  #heroVideo { display: none; }
  .scroll-hint, .chev { animation: none; }
  .beat { position: static; opacity: 1; padding: 1rem; }
  .beats { position: static; display: flex; flex-direction: column; gap: 1rem; padding: 2rem 0; }
  .beat--cta { padding: 1rem; }
  .btn:hover, .pizza:hover { transform: none; }
}
