/* Aspro d'Uva — fogli attaccati a un muro di mattoni, tra le bottiglie. Valori in tokens.css. */

/* Font scaricati nel sito (solo latino): Bodoni Moda e Jost, variabili */
@font-face { font-family: "Bodoni Moda"; font-style: normal; font-weight: 400 500; font-display: swap; src: url("fonts/bodoni-moda-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Jost"; font-style: normal; font-weight: 400 500; font-display: swap; src: url("fonts/jost-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  position: relative;
  margin: 0;
  background: var(--tavolo);
  color: var(--nero);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  caret-color: var(--blu);
}
::selection { background: var(--lime); color: var(--nero); }
/* Il muro di mattoni resta fermo mentre tutto scorre (niente background-attachment: fixed, che su iOS non va) */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background: var(--tavolo) url("img/muro-mattoni.webp") 0 0 / 1200px auto repeat;
}
/* Luce di cantina: più scuro ai bordi */
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse 70% 60% at 50% 28%, transparent 35%, var(--luce-cantina) 100%);
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--blu); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:focus-visible { outline: 2px solid var(--blu); outline-offset: 3px; }
p { margin: 0 0 1em; }
h1, h2, h3 { margin: 0; font-weight: normal; line-height: 1.2; text-wrap: balance; }
hr { border: 0; border-top: var(--rule); margin: 1.5rem 0; }
.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; }

/* Etichetta di campo: maiuscolo in penna rossa, come scritto con Word */
.label { display: block; color: var(--rosso); text-transform: uppercase; font-size: var(--fs-body); margin: 0 0 .5rem; }
.red { color: var(--rosso); }
.title { font-size: var(--fs-title); margin-bottom: 1rem; }
.title--piccolo { font-size: var(--fs-lead); margin-bottom: .6rem; }
.dainserire { color: var(--rosso); }

/* ---------- Il tavolo: bottiglie sparse, ognuna a una profondità diversa ---------- */
.tavolo {
  --g: calc((100% - var(--sheet-w)) / 2); /* larghezza di un margine laterale */
  position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
}
.bottiglia {
  position: absolute;
  top: var(--y);
  height: var(--h); width: auto; max-width: none;
  margin-left: calc(var(--h) * -.147); /* centra la bottiglia sul punto (larghezza = altezza × 0,294) */
  transform: rotate(var(--r));
  filter: drop-shadow(0 6px 6px var(--ombra-bottiglia));
  will-change: transform;
}
/* fx: 0 = bordo dello schermo, 1 = bordo del foglio, oltre 1 = sotto il foglio */
.bottiglia--l { left: calc(var(--g) * var(--fx)); }
.bottiglia--r { left: calc(100% - var(--g) * var(--fx)); }
/* Margini stretti (sotto i 200 px circa): bottiglie più piccole e lontane dal bordo del foglio */
@media (max-width: 1299px) {
  .bottiglia { height: calc(var(--h) * .8); margin-left: calc(var(--h) * -.118); }
  .bottiglia--l { left: calc(var(--g) * var(--fx) * .78); }
  .bottiglia--r { left: calc(100% - var(--g) * var(--fx) * .78); }
}

/* ---------- I fogli ---------- */
.sheets { position: relative; z-index: 1; padding: 40px 16px 88px; overflow-x: clip; display: grid; gap: var(--gap-sheets); justify-items: center; }
.sheet {
  position: relative;
  width: 100%; max-width: var(--sheet-w);
  background: var(--foglio);
  box-shadow: var(--ombra);
  padding: var(--sheet-pad);
}
.sheet:nth-child(odd)  { transform: rotate(-.3deg); }
.sheet:nth-child(even) { transform: rotate(.25deg); }
.sheet--dritto { transform: none !important; } /* fogli con caselle da cliccare */
.sheet--piccolo { max-width: 560px; }

/* Scotch di carta: pezzi veri (raster con bordi strappati), tre varianti */
.tape {
  position: absolute; width: 124px; height: 34px;
  background: url("img/scotch-1.webp") center / 100% 100% no-repeat;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .07));
  pointer-events: none;
}
.tape--tl { top: -11px; left: -36px; transform: rotate(-38deg); }
.tape--tr { top: -11px; right: -36px; transform: rotate(36deg); background-image: url("img/scotch-2.webp"); }
.tape--bl { bottom: -11px; left: -36px; transform: rotate(34deg); background-image: url("img/scotch-3.webp"); }
.tape--br { bottom: -11px; right: -36px; transform: rotate(-40deg); }

/* ---------- Pulsanti: una striscia di scotch con il testo battuto sopra ---------- */
.nastro {
  --tilt: -.8deg;
  display: inline-block;
  padding: .3em .55em .35em;
  border: solid transparent; border-width: 0 13px;
  border-image: url("img/scotch-1.webp") 0 30 fill / 0 13px stretch;
  color: var(--nero); text-decoration: none; line-height: 1.3; white-space: nowrap;
  transform: rotate(var(--tilt));
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .09));
  transition: transform var(--dur-lift) var(--ease-out), filter var(--dur-lift) var(--ease-out);
}
.nastro:hover { transform: translateY(-2px) rotate(calc(var(--tilt) * -1)); filter: drop-shadow(0 4px 5px rgba(0, 0, 0, .18)); }
.nastro:active { transform: translateY(0) rotate(var(--tilt)); filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .09)); }
.nastro[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--blu); text-decoration-thickness: 2px; }
.nastro--b { border-image-source: url("img/scotch-2.webp"); --tilt: .9deg; }
.nastro--c { border-image-source: url("img/scotch-3.webp"); --tilt: -.4deg; }
.nastro--grande { font-size: var(--fs-lead); padding: .35em .75em .4em; }

/* ---------- Annotazioni a biro ---------- */
.cerchiato { position: relative; white-space: nowrap; margin: 0 .5em; } /* il cerchio non deve coprire i "·" vicini */
.cerchiato::after {
  content: ""; position: absolute; inset: -.45em -.6em -.4em -.55em;
  background: url("biro/cerchio-1.svg") center / 100% 100% no-repeat;
  pointer-events: none;
}
.sottolineato { position: relative; white-space: nowrap; } /* a capo il tratto si spezzerebbe */
.sottolineato::after {
  content: ""; position: absolute; left: -.1em; right: -.2em; bottom: -.35em; height: .45em;
  background: url("biro/sottolineatura.svg") center / 100% 100% no-repeat;
  pointer-events: none;
}
.freccia { position: absolute; width: 92px; pointer-events: none; }
.mark { background: var(--lime); padding: 0 .12em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }

/* ---------- Testata (dentro il primo foglio) ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem 1.5rem; }
.top__logo { line-height: 0; flex: none; }
.top__logo img { width: 48px; height: 48px; }
/* Il logo Superbo non si ruota mai: compensa l'inclinazione del primo foglio */
.sheet:nth-child(odd) .top__logo { transform: rotate(.3deg); }
@media (max-width: 760px) { .sheet:nth-child(odd) .top__logo { transform: none; } }
.top__nav ul { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .6rem .5rem; margin: 0; padding: 0; list-style: none; }
.top__nav .nastro { font-size: var(--fs-small); }

/* ---------- Foglio 1: la frase a mano ---------- */
.hand { margin: 2.25rem 0 2rem; display: grid; gap: .55rem; justify-items: start; }
.hand h1 { margin: 0 0 .9rem 9%; width: 46%; }
.hand .r1 { width: 71%; }
.hand .r2 { width: 77%; }
.hand .r3 { width: 100%; }
.hand img { width: 100%; }

/* Visibile di base: l'animazione nasconde la riga solo mentre gira (fill backwards), quindi se non parte la scritta c'è comunque */
.write { animation: write var(--dur-write) var(--ease-inout) backwards; animation-delay: calc(var(--i, 0) * var(--step-write) + 300ms); }
@keyframes write { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@media (prefers-reduced-motion: reduce) { .write { animation: none; } }

.hero__foot { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.1rem 1.5rem; align-items: end; }
.hero__info { color: var(--rosso); }
.hero__info p { margin-bottom: .6rem; max-width: 46ch; }
.hero__actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: .9rem 1.1rem; }
.hero__bottle { display: none; margin: 0; }

/* ---------- Testo ---------- */
.lead { font-size: var(--fs-lead); line-height: 1.4; max-width: 40ch; }
.sheet > p { max-width: 68ch; }
.footnote { font-size: var(--fs-small); }

/* ---------- Retro dell'etichetta: tabella da modulo ---------- */
.scheda { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); border: var(--rule); }
.field { padding: .9rem 1.1rem 1.1rem; border-top: var(--rule); }
.field:nth-child(-n+2) { border-top: 0; }
.field:nth-child(odd) { border-right: var(--rule); }
.field--full { grid-column: 1 / -1; border-right: 0 !important; }
.field p:last-child, .field ul:last-child { margin-bottom: 0; }
.field__hand img { width: min(100%, 15rem); }
.nots { margin: 0; padding: 0; list-style: none; }
.nots li { display: flex; gap: .5rem; align-items: baseline; }
.nots li::before { content: ""; flex: none; width: .85em; height: .85em; background: url("biro/croce.svg") center / contain no-repeat; transform: translateY(.1em); }
.quotes { margin: 0; padding-left: 1.2em; }
.quotes q { quotes: "«" "»"; }

/* ---------- Chi siamo ---------- */
.sheet > .scheda { margin-top: 1.5rem; }
.squadra, .partner { margin: 0; padding-left: 1.2em; }
.squadra li + li, .partner li + li { margin-top: .3rem; }
.partner strong { font-weight: 500; } /* il peso più forte che abbiamo: niente grassetto finto */

/* ---------- Contatti e ordini: un modulo cartaceo che funziona ---------- */
.contatti .freccia { left: -42px; top: 4px; }
.modulo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.1rem 1.4rem; margin-top: 1.5rem; }
.scelta, .campo--pieno, .consenso, .modulo button { grid-column: 1 / -1; }
.scelta { border: 0; margin: 0 0 .3rem; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem 2.2rem; }
.scelta legend { padding: 0; margin-bottom: .5rem; }
.facoltativo { text-transform: none; color: var(--nero); font-size: var(--fs-small); }

/* Scelta a casella disegnata a biro: la spunta si traccia quando è selezionata */
.casella { position: relative; padding-left: 2.1rem; font-size: var(--fs-lead); cursor: pointer; }
.casella input { position: absolute; left: 0; top: .1em; width: 1.25em; height: 1.25em; margin: 0; opacity: 0; cursor: pointer; }
.casella span::before,
.casella span::after { content: ""; position: absolute; left: 0; top: .1em; width: 1.25em; height: 1.25em; background: center / contain no-repeat; pointer-events: none; }
.casella span::before { background-image: url("biro/casella.svg"); }
.casella span::after { background-image: url("biro/spunta.svg"); left: .1em; top: -.1em; clip-path: inset(0 100% 0 0); transition: clip-path 260ms var(--ease-out); }
.casella input:checked + span::after { clip-path: inset(0 0 0 0); }
.casella input:focus-visible + span::before { outline: 2px solid var(--blu); outline-offset: 2px; }

.campo { display: flex; flex-direction: column; gap: .25rem; }
.campo .label { margin: 0; }
.modulo input:not([type="radio"]):not([type="checkbox"]), .modulo textarea {
  width: 100%; font: inherit; color: var(--nero); background: var(--bianco);
  border: 1px solid var(--nero); border-radius: 0; padding: .5rem .6rem;
}
.modulo textarea { resize: vertical; min-height: 7rem; }
.modulo input:focus-visible, .modulo textarea:focus-visible { outline: 2px solid var(--blu); outline-offset: 1px; }
.modulo input:user-invalid, .modulo textarea:user-invalid { border-color: var(--rosso); outline-color: var(--rosso); }
.consenso { display: flex; gap: .6rem; align-items: baseline; font-size: var(--fs-small); }
.consenso input { flex: none; width: 1.05em; height: 1.05em; margin: 0; accent-color: var(--blu); transform: translateY(.12em); }
.modulo button { justify-self: start; font-family: inherit; background: none; cursor: pointer; margin-top: .4rem; }
.modulo button:focus-visible { outline: 2px solid var(--blu); outline-offset: 3px; }

/* ---------- Ultimo foglio ---------- */
.provalo img { width: 8.5rem; margin-bottom: .75rem; }
.foot small { display: block; font-size: var(--fs-small); margin-top: 1rem; }

/* Il menu porta alle sezioni della stessa pagina */
html { scroll-padding-top: 24px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* ---------- Schermi medi: la bottiglia entra nel foglio ---------- */
@media (max-width: 1099px) {
  .tavolo { display: none; } /* senza margini le bottiglie sarebbero solo spicchi rossi ai bordi */
  .hero__foot { grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
  .hero__bottle { display: block; }
  .hero__bottle img { height: 300px; width: auto; }
}

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  .sheets { padding: 28px 16px 56px; }
  .sheet, .sheet:nth-child(odd), .sheet:nth-child(even) { transform: none; }
  .tape { width: 88px; height: 26px; }
  .tape--tl, .tape--bl { left: -20px; }
  .tape--tr, .tape--br { right: -20px; }
  .contatti .freccia { display: none; }
  .modulo { grid-template-columns: minmax(0, 1fr); }
  .top { flex-direction: column; align-items: flex-start; }
  .top__nav ul { justify-content: flex-start; }
  .hand { margin: 1.75rem 0 1.5rem; }
  .hero__foot { grid-template-columns: minmax(0, 1fr) 84px; gap: 1rem; }
  .hero__bottle img { height: auto; width: 84px; }
  .scheda { grid-template-columns: minmax(0, 1fr); }
  .field, .field:nth-child(2) { border-top: var(--rule); border-right: 0 !important; }
  .field:first-child { border-top: 0; }
}

/* ---------- Tipografia "Didone": Bodoni per titoli e frasi, Jost per testo, menu ed etichette ---------- */
.title { font-family: var(--font-display); font-weight: 400; font-size: var(--fs-title); line-height: 1.04; letter-spacing: -.012em; margin-bottom: 1.25rem; }
.title--piccolo { font-size: 1.75rem; }
.lead { font-family: var(--font-display); font-size: var(--fs-lead); line-height: 1.32; }
.label { font-size: .78rem; font-weight: 500; letter-spacing: .16em; }
.facoltativo { letter-spacing: 0; font-weight: 400; font-size: .85rem; }
.hero__info { font-family: var(--font-display); font-size: 1.3rem; line-height: 1.4; }
.hero__info p:first-child { letter-spacing: .02em; }
.nastro, .top__nav .nastro { text-transform: uppercase; letter-spacing: .14em; font-weight: 500; font-size: .74rem; padding: .55em .9em; }
.nastro--grande { font-size: .86rem; padding: .7em 1.1em; }
.footnote, .foot small { font-size: .82rem; }
.quotes li { font-family: var(--font-display); font-size: 1.12rem; }
.casella { font-family: var(--font-display); font-size: 1.35rem; }
@media (max-width: 640px) { .hero__info { font-size: 1.12rem; } }
