@font-face { font-family: "Josefin"; src: url(/assets/fonts/josefin.woff2) format("woff2"); font-weight: 100 700; font-display: swap; }
@font-face { font-family: "Manrope"; src: url(/assets/fonts/manrope.woff2) format("woff2"); font-weight: 200 800; font-display: swap; }

:root {
  /* Palette: schiuma, blu Marina, blu elettrico, acqua. Tricolore solo come filo. */
  --bg: #F4F8FD;
  --surface: #FFFFFF;
  --ink: #0A2463;          /* blu Marina, 14.5:1 su bianco */
  --ink-2: #44506B;        /* testo secondario, 8.1:1 su bianco */
  --accent: #1F4FE0;       /* blu elettrico, 6.5:1 su bianco */
  --accent-ink: #FFFFFF;
  --water: #CFE3F7;
  --line: #DCE6F2;
  --field-line: #7D8BA8;  /* bordo del campo di ricerca, 3.4:1 su bianco (WCAG 1.4.11) */
  --chip: #EEF3FA;
  --out: #A32A33;          /* esaurito, 7.2:1 su bianco */
  --verde: #4E9A72; --bianco: #FFFFFF; --rosso: #C2525B;
  --glass: rgba(255, 255, 255, .66);
  --glass-edge: rgba(255, 255, 255, .7);
  --shadow: 0 1px 2px rgba(10, 36, 99, .05), 0 8px 24px rgba(10, 36, 99, .06);
  --r-out: 22px; --r-in: 14px; --r-pill: 999px;
  --gut: 16px;
  --ease: cubic-bezier(.25, .46, .45, .94);  /* power1.out */
  --bar-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B1630;
    --surface: #12213F;
    --ink: #E3EAF5;        /* 13.2:1 su surface */
    --ink-2: #A9B6CC;      /* 7.8:1 su surface */
    --accent: #8EAEFF;     /* 7.3:1 su surface */
    --accent-ink: #0B1630;
    --water: #24406E;
    --line: #22345A;
    --field-line: #5E73A0;
    --chip: #1A2B4D;
    --out: #F0A2A8;
    --verde: #5D9C7D; --bianco: #C9D3E3; --rosso: #B8646B;
    --glass: rgba(14, 27, 54, .62);
    --glass-edge: rgba(255, 255, 255, .08);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0; min-height: 100dvh; background: transparent; color: var(--ink);
  font: 400 1rem/1.5 "Manrope", system-ui, sans-serif; overflow-x: hidden;
  padding-bottom: calc(var(--bar-h) + 24px + env(safe-area-inset-bottom));
}
body.simple { padding-bottom: 0; }
img { display: block; max-width: 100%; }
a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3, p { margin: 0; }

/* Vetro: solo sulle barre (livello dei controlli), mai sul contenuto. */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
  backdrop-filter: blur(22px) saturate(1.4);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow);
}
.lite .glass { -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .glass { background: var(--surface); } }
@media (prefers-reduced-transparency: reduce) { .glass { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; } }
@media (prefers-contrast: more) { .glass { background: var(--surface); border-color: var(--ink); } }

/* Barra in alto */
.topbar {
  position: sticky; top: max(8px, env(safe-area-inset-top)); z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: calc(100% - 2 * var(--gut)); max-width: calc(1080px - 2 * var(--gut));
  margin: 8px auto 0; padding: 6px 6px 6px 14px; border-radius: var(--r-out);
}
.brand { display: flex; align-items: center; gap: 10px; min-height: 44px; color: var(--ink); text-decoration: none;
  font: 500 1.0625rem/1 "Josefin", sans-serif; letter-spacing: .08em; }
.brand span { padding-top: 3px; transition: opacity .3s var(--ease), transform .3s var(--ease); }
/* Sulla drink list il nome compare nella barra solo quando il titolo grande esce dallo schermo. */
.js body:not(.simple) .topbar:not(.named) .brand span { opacity: 0; transform: translateY(4px); }
.wheel { width: 26px; height: 26px; color: var(--accent); flex: none; }
.lang { display: grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0 12px; border-radius: var(--r-in);
  color: var(--ink); background: var(--chip); font-weight: 700; font-size: .875rem; text-decoration: none; letter-spacing: .04em; }

/* Apertura: un solo momento, < 1 s. Niente opacity sul titolo (non ritarda l'LCP). */
.hero { padding: 40px var(--gut) 8px; }
.wordmark { font-family: "Josefin", sans-serif; font-weight: 200; color: var(--ink); line-height: .98; letter-spacing: .04em; }
.wm-1 { display: block; font-size: clamp(1.25rem, 5vw, 1.75rem); font-weight: 400; letter-spacing: .5em; color: var(--accent); margin-bottom: 10px; }
.wm-2 { display: block; font-size: clamp(2.6rem, 12.5vw, 5rem); text-wrap: balance; }
.tricolore { height: 3px; width: 112px; margin: 20px 0 14px; border-radius: 3px; transform-origin: left;
  background: linear-gradient(90deg, var(--verde) 0 30%, var(--bianco) 38% 62%, var(--rosso) 70%); opacity: .85;
  box-shadow: 0 0 0 1px var(--line) inset; }
.tagline { color: var(--ink-2); font-size: 1rem; }
@media (prefers-reduced-motion: no-preference) {
  .wm-1 { animation: track .8s var(--ease) both; }
  .wm-2 { animation: rise .7s var(--ease) both; }
  .tricolore { animation: draw .9s var(--ease) .1s both; }
}
@keyframes track { from { letter-spacing: 1.1em; } }
@keyframes rise { from { transform: translateY(12px); } }
@keyframes draw { from { transform: scaleX(0); } }

/* Ricerca: in alto, raggiungibile e ben visibile */
.search { position: relative; margin-top: 24px; max-width: 560px; }
.search svg { position: absolute; left: 16px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); color: var(--ink-2); pointer-events: none; }
.search input {
  width: 100%; min-height: 52px; padding: 0 52px 0 46px; border-radius: var(--r-in); border: 1px solid var(--field-line);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 1rem; box-shadow: var(--shadow);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.search input::placeholder { color: var(--ink-2); opacity: 1; }
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.search input::-webkit-search-cancel-button { display: none; }
.clear { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border: 0; border-radius: 10px;
  background: transparent; color: var(--ink-2); font-size: 1.5rem; line-height: 1; cursor: pointer; }

/* Categorie e drink */
main { max-width: 1080px; margin: 0 auto; }
.cat { padding: 36px var(--gut) 0; scroll-margin-top: 76px; }
.cat-head { display: flex; align-items: baseline; gap: 12px; margin: 0 0 14px 2px; }
.cat-head h2 { font: 300 2rem/1.1 "Josefin", sans-serif; letter-spacing: .03em; color: var(--ink); }
.cat-note { color: var(--ink-2); font-size: .875rem; }
.cards { display: grid; gap: 12px; }
@media (min-width: 820px) { .cards { grid-template-columns: 1fr 1fr; gap: 16px; } }

.drink {
  display: grid; grid-template-columns: 116px 1fr; gap: 14px; padding: 12px; align-items: start;
  /* Quasi opaca: a destra si intravede l'acqua del bicchiere che sta dietro, il testo resta pienamente leggibile. */
  background: linear-gradient(90deg, var(--surface) 60%, color-mix(in srgb, var(--surface) 80%, transparent));
  border-radius: var(--r-out); box-shadow: var(--shadow); border: 1px solid var(--line);
  transition: transform .2s var(--ease);
}
.drink:active { transform: scale(.985); }
@media (hover: hover) { .drink:hover { transform: translateY(-2px); } }
@media (min-width: 480px) { .drink { grid-template-columns: 128px 1fr; } }

/* Vetrina Signature: card grandi in carosello sul telefono, griglia da 4 su desktop */
.cards--feature {
  display: grid; grid-auto-flow: column; grid-auto-columns: min(74%, 270px); gap: 12px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 var(--gut); overscroll-behavior-x: contain; scrollbar-width: none;
  margin: 0 calc(-1 * var(--gut)); padding: 4px var(--gut) 14px;
}
.cards--feature::-webkit-scrollbar { display: none; }
.cards--feature:focus-visible { outline-offset: -3px; }
.drink--feature { grid-template-columns: 1fr; gap: 14px; padding: 10px 10px 16px; scroll-snap-align: start; background: var(--surface); }
.drink--feature .ph { border-radius: 14px; }
.drink--feature .drink-body { padding: 0 6px; }
.drink--feature .drink-top { align-items: center; }
.drink--feature .drink-name { font: 400 1.5rem/1.15 "Josefin", sans-serif; letter-spacing: .01em; }
@media (min-width: 820px) {
  .cards--feature { grid-auto-flow: row; grid-template-columns: repeat(4, 1fr); overflow: visible; margin: 0; padding: 0; gap: 16px; }
}

/* Foto su un "piattino" bianco; skeleton con shimmer finché non è caricata */
.ph { position: relative; aspect-ratio: 1; border-radius: var(--r-in); overflow: hidden; background: var(--chip); box-shadow: inset 0 0 0 1px var(--line); }
.ph.is-loaded { background: #fff; }
@media (prefers-color-scheme: dark) { .ph img { filter: brightness(.9); } }
.ph::before { content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 70%, transparent), transparent); }
@media (prefers-reduced-motion: no-preference) { .ph::before { animation: shimmer 1.3s linear infinite; } }
.ph.is-loaded::before { display: none; }
.ph img { position: relative; width: 100%; height: 100%; object-fit: cover; }
.js .ph img { opacity: 0; transition: opacity .35s var(--ease); }
.js .ph.is-loaded img { opacity: 1; }
@keyframes shimmer { to { transform: translateX(100%); } }

.drink-body { min-width: 0; padding-top: 2px; }
.drink-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.drink-name { font: 600 1.0625rem/1.3 "Manrope", sans-serif; color: var(--ink); overflow-wrap: anywhere; }
.price {
  flex: none; padding: 4px 10px; border-radius: var(--r-pill); background: color-mix(in srgb, var(--accent) 11%, var(--surface));
  font-weight: 700; font-size: .9375rem; color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.is-out .price { background: none; padding: 0; }
.ing { margin-top: 4px; color: var(--ink); font-size: .9375rem; line-height: 1.45; }
.desc { margin-top: 6px; color: var(--ink-2); font-size: .875rem; line-height: 1.5; }
.al { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.al li { padding: 3px 9px; border-radius: var(--r-pill); background: var(--chip); color: var(--ink-2); font-size: .75rem; font-weight: 600; }
.is-out .ph img { filter: grayscale(1); opacity: .55; }
.is-out .drink-name, .is-out .ing { color: var(--ink-2); }
.out { display: inline-block; padding: 2px 10px; border-radius: var(--r-pill); color: var(--out); border: 1px solid currentColor; font-size: .8125rem; }

.drink[hidden], .cat[hidden] { display: none; }
.empty { margin: 32px var(--gut); padding: 20px; border-radius: var(--r-out); background: var(--surface); border: 1px dashed var(--line); color: var(--ink-2); text-align: center; }

.note { margin: 40px var(--gut) 0; padding: 18px 20px; border-radius: var(--r-out); background: var(--surface); border: 1px solid var(--line); }
.note h2 { font: 500 1.125rem/1.2 "Josefin", sans-serif; letter-spacing: .04em; margin-bottom: 6px; }
.note p { color: var(--ink-2); font-size: .9375rem; max-width: 70ch; }

.foot { max-width: 1080px; margin: 40px auto 0; padding: 24px var(--gut) 32px; color: var(--ink-2); font-size: .9375rem; display: grid; gap: 4px; }
.foot-name { color: var(--ink); font-weight: 700; }
.foot-legal { font-size: .8125rem; margin-top: 8px; }
.tel { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; }
.foot-links a { display: inline-flex; align-items: center; min-height: 44px; }

/* Barra delle categorie: in basso, a portata di pollice */
.catbar {
  position: fixed; left: 50%; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 10; transform: translateX(-50%);
  width: min(calc(100% - 2 * var(--gut)), 760px); border-radius: var(--r-out); padding: 6px;
}
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; scroll-snap-type: x proximity; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 44px; padding: 0 16px; border: 0; border-radius: var(--r-in); scroll-snap-align: start;
  background: transparent; color: var(--ink); font: 600 .9375rem/1 "Manrope", sans-serif; cursor: pointer;
  transition: background-color .25s var(--ease), color .25s var(--ease), transform .15s var(--ease);
}
.chip:active { transform: scale(.96); }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
/* Con GSAP una sola pastiglia scorre sotto il chip attivo; senza GSAP resta lo sfondo del chip qui sopra. */
.chips { position: relative; }
.chip-pill { position: absolute; left: 0; top: 0; width: 0; height: 44px; border-radius: var(--r-in); background: var(--accent); pointer-events: none; visibility: hidden; }
.has-pill .chip-pill { visibility: visible; }
.has-pill .chip { position: relative; z-index: 1; }
.has-pill .chip[aria-pressed="true"] { background: transparent; }
@media (hover: hover) { .chip:not([aria-pressed="true"]):hover { background: var(--chip); } }

/* Cubetti di ghiaccio: sempre dietro a tutto, mai cliccabili */
.ice { position: fixed; top: 0; right: 0; height: 100vh; width: 72px; z-index: -1; pointer-events: none; }
@media (min-width: 820px) { .ice { width: 112px; } }
@media (prefers-reduced-motion: reduce) { .ice { display: none; } }

/* Pagine semplici: privacy e 404 */
.page { max-width: 680px; margin: 0 auto; padding: 40px var(--gut) 0; }
.page h1 { font: 300 2.25rem/1.1 "Josefin", sans-serif; letter-spacing: .03em; margin-bottom: 16px; }
.page h2 { font: 600 1.0625rem/1.3 "Manrope", sans-serif; margin: 24px 0 6px; }
.page p { color: var(--ink-2); max-width: 70ch; }
.back { display: inline-flex; align-items: center; min-height: 44px; margin-top: 24px; font-weight: 700; }
.lost { text-align: center; padding: 40px 0 8px; }
.lost .wheel { width: 72px; height: 72px; margin: 0 auto 20px; }
@media (prefers-reduced-motion: no-preference) { .lost .wheel { animation: steer 2.4s var(--ease) infinite alternate; } }
@keyframes steer { from { transform: rotate(-18deg); } to { transform: rotate(18deg); } }
.simple .page + .foot { margin-top: 24px; }

/* Anteprima (?animazioni): animazioni attive anche con "riduci movimento" del sistema. */
.force-motion .wm-1 { animation: track .8s var(--ease) both; }
.force-motion .wm-2 { animation: rise .7s var(--ease) both; }
.force-motion .tricolore { animation: draw .9s var(--ease) .1s both; }
.force-motion .ph::before { animation: shimmer 1.3s linear infinite; }
.force-motion .ice { display: block; }
.force-motion .lost .wheel { animation: steer 2.4s var(--ease) infinite alternate; }

/* Su telefono il titolo resta lontano dal bicchiere a destra (va su due righe). */
@media (max-width: 819px) { .wordmark, .tagline { padding-right: 64px; } }

/* Logo del lido */
.logo-mini { width: 38px; height: 38px; flex: none; border-radius: 50%; }
.logo-hero { display: block; width: 110px; height: 166px; margin: 0 0 16px; filter: drop-shadow(0 8px 16px rgba(10, 36, 99, .22)); }
@media (prefers-reduced-motion: no-preference) { .logo-hero { animation: rise .7s var(--ease) both; } }
.force-motion .logo-hero { animation: rise .7s var(--ease) both; }

/* Le sezioni lontane si disegnano solo quando ci si arriva: la pagina ha 84 card. */
.cat + .cat + .cat { content-visibility: auto; contain-intrinsic-size: auto 1400px; }
