/* =============================================================================
   outfriends.app — foglio di stile unico
   Colori presi dall'app (lib/theme.ts) + il blu dell'icona (#1A6BFF).
   ============================================================================= */

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("fonts/PlusJakartaSans-400.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("fonts/PlusJakartaSans-600.ttf") format("truetype");
  font-weight: 500 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("fonts/PlusJakartaSans-800.ttf") format("truetype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Marca */
  --blue: #1A6BFF;          /* il blu dell'icona: bianco sopra = 4.57:1 */
  --blue-deep: #1450D6;     /* stato premuto / bordi sul blu */
  --navy: #0B1640;          /* sezione organizzatori */
  --on-blue: #FFFFFF;

  /* Colori dell'app (tema chiaro) */
  --primary: #1E40AF;       /* blu dell'app per testo su bianco: 8.7:1 */
  --preview-meta: #2D7AC1;  /* riga data sopra le card, come in app */
  --go: #12883E;
  --live: #CB2323;
  --amber: #F59E0B;
  --app-ink: #111827;
  --app-muted: #6B7280;
  --app-line: #E5E7EB;

  /* Superfici neutre del sito (cambiano col tema scuro) */
  --bg: #FFFFFF;
  --bg-tint: #F0F4FF;       /* bianco appena spinto verso il blu di marca */
  --surface: #FFFFFF;
  --ink: #111827;
  --body: #374151;
  --line: #E5E7EB;
  --accent-ink: #1E40AF;

  /* Ritmo */
  --gutter: clamp(16px, 5vw, 56px);
  --max: 1180px;
  --section-y: clamp(4.5rem, 3rem + 7vw, 9rem);
  --radius-card: 16px;
  --shadow-soft: 0 2px 12px rgba(0, 0, 0, .06);
  --shadow-float: 0 24px 60px -18px rgba(0, 0, 0, .3);

  /* Tipografia: scala 1.25+ */
  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --fs-xs: .8125rem;
  --fs-sm: .9375rem;
  --fs-base: 1.0625rem;
  --fs-lead: clamp(1.125rem, 1rem + .55vw, 1.375rem);
  --fs-h3: clamp(1.3125rem, 1.15rem + .7vw, 1.625rem);
  --fs-h2: clamp(2.125rem, 1.35rem + 3.6vw, 4rem);
  --fs-h1: clamp(2.75rem, 1.5rem + 6vw, 5.75rem);

  /* Livelli */
  --z-raised: 1;
  --z-header: 10;
  --z-skip: 20;

  --ease-out: cubic-bezier(.22, 1, .36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F1216;          /* come il tema scuro dell'app */
    --bg-tint: #141A24;
    --surface: #171B21;
    --ink: #F3F4F6;
    --body: #C9CED6;
    --line: #262C36;
    --accent-ink: #5B85F0;  /* primary scuro dell'app: 5.46:1 */
    --navy: #0A1230;
    --shadow-float: 0 24px 60px -18px rgba(0, 0, 0, .7);
  }
}

/* ----------------------------------------------------------------------------
   Base
   ---------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }

h1, h2, h3 {
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -.035em;
  text-wrap: balance;
}
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); letter-spacing: -.02em; line-height: 1.15; }
p { text-wrap: pretty; }

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
  border-radius: 6px;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.wrap {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: var(--z-skip);
  padding: 10px 16px;
  border-radius: 100px;
  background: #fff;
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}
.skip:focus { top: 12px; }

/* ----------------------------------------------------------------------------
   Header (sopra il blu dell'hero)
   ---------------------------------------------------------------------------- */
.site-header {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: var(--z-header);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: max(14px, env(safe-area-inset-top)) var(--gutter) 14px;
  color: var(--on-blue);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  padding: 6px 4px;
}
.brand-mark { width: 30px; height: 30px; color: var(--on-blue); }
.wordmark {
  font-weight: 800;
  font-size: 1.0625rem;
  letter-spacing: .08em;
}

.lang {
  display: inline-flex;
  padding: 3px;
  border-radius: 100px;
  background: rgba(8, 28, 90, .28);
}
.lang button {
  min-width: 44px;
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 100px;
  background: transparent;
  color: var(--on-blue);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: .04em;
  cursor: pointer;
  transition: background-color .2s var(--ease-out), color .2s var(--ease-out);
}
.lang button:hover { background: rgba(255, 255, 255, .14); }
.lang button[aria-pressed="true"] { background: #fff; color: var(--primary); }
.lang button:focus-visible { outline-color: #fff; outline-offset: 2px; }

/* ----------------------------------------------------------------------------
   Hero
   ---------------------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: clip;
  background: var(--blue);
  color: var(--on-blue);
  padding-top: calc(76px + env(safe-area-inset-top));
}
.hero :focus-visible { outline-color: #fff; }

.hero-motif {
  position: absolute;
  width: clamp(560px, 120vw, 1180px);
  height: auto;
  right: -38%;
  top: 24%;
  fill: none;
  stroke: #fff;
  stroke-width: 72;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .1;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: var(--z-raised);
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: grid;
  gap: clamp(40px, 8vw, 72px);
}

.hero-copy { padding-top: clamp(12px, 4vw, 48px); }

.hero-title {
  font-size: var(--fs-h1);
  line-height: .98;
  letter-spacing: -.04em;
  max-width: 11ch;
}

.lead {
  margin-top: clamp(18px, 3vw, 28px);
  max-width: 34rem;
  font-size: var(--fs-lead);
  font-weight: 500;
  line-height: 1.5;
}

/* Badge degli store (stile ufficiale nero) */
.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: clamp(28px, 4vw, 40px);
}
.store {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 54px;
  padding: 0 16px 0 12px;
  border-radius: 12px;
  background: #000;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .22);
  transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out);
}
.store-logo { width: 25px; height: 25px; flex: none; }
.store-text { display: grid; line-height: 1.1; }
.store-text small { font-size: .6875rem; font-weight: 600; letter-spacing: .01em; }
.store-text strong { font-size: 1.1875rem; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.store-text small { white-space: nowrap; }
@media (max-width: 379px) {
  .stores { gap: 10px; }
  .store { padding: 0 12px 0 10px; gap: 7px; }
  .store-text strong { font-size: 1.0625rem; }
}
.store[href]:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px rgba(255, 255, 255, .5), 0 10px 24px -8px rgba(0, 0, 0, .5); }
.store[href]:active { transform: translateY(0); }
.store:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

.store-soon { display: none; }
.store.is-soon { cursor: default; }
.store.is-soon .store-logo,
.store.is-soon .store-text { opacity: .72; }
.store.is-soon .store-soon {
  display: block;
  position: absolute;
  top: -12px;
  right: -10px;
  padding: 3px 9px;
  border-radius: 100px;
  background: #fff;
  color: var(--primary);
  font-size: .6875rem;
  font-weight: 800;
  letter-spacing: .02em;
  box-shadow: var(--shadow-soft);
}
.store:not(.is-soon) .sr { display: none; }

.store-status {
  margin-top: 14px;
  font-size: var(--fs-sm);
  font-weight: 600;
}
.store-status[hidden] { display: none; }

/* Avviso "ti hanno mandato un link" */
.shared {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px 14px;
  align-items: start;
  margin-bottom: clamp(28px, 5vw, 44px);
  padding: 16px 18px;
  max-width: 34rem;
  border-radius: var(--radius-card);
  background: #fff;
  color: var(--app-ink);
  box-shadow: var(--shadow-float);
}
.shared[hidden] { display: none; }
.shared-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 100px;
  background: var(--bg-tint);
  color: var(--primary);
}
.shared-icon svg { width: 24px; height: 24px; display: none; }
.shared[data-kind="event"] svg[data-kind="event"],
.shared[data-kind="organizer"] svg[data-kind="organizer"],
.shared[data-kind="memory"] svg[data-kind="memory"] { display: block; }
.shared svg[data-kind="memory"] { fill: none; }
.shared-title { font-weight: 800; font-size: 1.0625rem; line-height: 1.3; }
.shared-body { margin-top: 2px; font-size: var(--fs-sm); color: #374151; line-height: 1.45; }
.shared-missing { margin-top: 8px; font-size: var(--fs-sm); font-weight: 700; color: var(--live); }
.shared .btn,
.shared-desktop { grid-column: 1 / -1; }
.shared-desktop { font-size: var(--fs-sm); font-weight: 600; color: var(--primary); }
.shared .btn[hidden],
.shared-desktop[hidden],
.shared-missing[hidden] { display: none; }

@media (prefers-color-scheme: dark) {
  .shared-icon { background: #E8EEFF; }
  /* riga data delle card sulla pagina scura: valore scuro dell app (lib/theme.ts) */
  .ev-rail { --preview-meta: #6FB3E8; }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 100px;
  font-weight: 700;
  text-decoration: none;
  transition: transform .2s var(--ease-out), background-color .2s var(--ease-out);
}
.btn-solid { background: var(--blue); color: #fff; }
.btn-solid:hover { background: var(--blue-deep); }
.btn-solid:active { transform: scale(.98); }
.shared .btn:focus-visible { outline-color: var(--blue); }

/* Telefono */
.hero-visual {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  /* il telefono esce dal fondo dell'hero: se ne vede l'82% */
  height: calc(var(--ph) * .82);
  --pw: 300px;
  --ph: calc(var(--pw) * 2.1);
  --s: calc((300 - 20) / 360);
}
@media (max-width: 379px) {
  .hero-visual { --pw: 270px; --s: calc((270 - 20) / 360); }
}

.phone {
  position: relative;
  flex: none;
  width: var(--pw);
  height: var(--ph);
  padding: 10px;
  border-radius: calc(var(--pw) * .15);
  background: #0B0D12;
  box-shadow:
    inset 0 0 0 1.5px #2A2E37,
    0 50px 90px -30px rgba(0, 0, 0, .5),
    0 20px 40px -20px rgba(0, 0, 0, .4);
}
.phone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: calc(var(--pw) * .12);
  background: #fff;
}

/* L'app è disegnata a 360 px logici e scalata */
.app {
  position: absolute;
  top: 0;
  left: 0;
  width: 360px;
  height: calc((var(--ph) - 20px) / var(--s));
  transform: scale(var(--s));
  transform-origin: 0 0;
  background: #fff;
  color: var(--app-ink);
  font-size: 15px;
  line-height: 1.35;
  letter-spacing: 0;
}
.app-island {
  position: absolute;
  top: 11px;
  left: 50%;
  width: 104px;
  height: 30px;
  margin-left: -52px;
  border-radius: 100px;
  background: #0B0D12;
}
.app-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 50px;
  padding: 6px 30px 0 34px;
  font-size: 15px;
  font-weight: 700;
}
.app-status-icons { display: inline-flex; align-items: flex-end; gap: 2px; }
.app-status-icons i { width: 3.5px; background: var(--app-ink); border-radius: 1px; }
.app-status-icons i:nth-child(1) { height: 5px; }
.app-status-icons i:nth-child(2) { height: 8px; }
.app-status-icons i:nth-child(3) { height: 11px; }
.app-status-icons b {
  width: 24px; height: 11px; margin-left: 6px;
  border: 1.5px solid var(--app-ink); border-radius: 3.5px;
  background: linear-gradient(90deg, var(--app-ink) 70%, transparent 70%) content-box;
  padding: 1.5px;
}
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 50px;
  padding: 0 16px;
}
.app-logo { font-weight: 700; font-size: 18px; letter-spacing: 1.2px; color: var(--primary); }
.ic24 { width: 24px; height: 24px; }
.c-primary { color: var(--primary); }

.app-activity {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px 10px;
  font-size: 15px;
}
.app-activity b { font-weight: 700; }
.app-time { color: var(--app-muted); font-size: 13px; }
.app-ann-ic {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 100px;
  background: #FEF3C7;
  color: #B45309;
}
.app-ann-ic svg { width: 17px; height: 17px; }
.app .ev { padding: 0 16px; }
.app-peek { padding: 0 16px; }
.app-peek img { width: 100%; height: 150px; object-fit: cover; border-radius: 10px 10px 0 0; }
.app-tabs {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 78px;
  padding-bottom: 14px;
  background: #fff;
  border-top: 1px solid var(--app-line);
  color: var(--app-ink);
}
.app-tabs span { position: relative; display: grid; place-items: center; width: 48px; height: 48px; }
.app-tabs svg { width: 27px; height: 27px; }
.app-tabs .is-active { color: var(--primary); }
.app-tabs .is-active::after {
  content: "";
  position: absolute;
  bottom: 2px;
  width: 22px;
  height: 3px;
  border-radius: 3px;
  background: var(--primary);
}

/* Avatar con iniziale */
.av {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 100px;
  background: var(--av, #475569);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}
.av30 { width: 30px; height: 30px; font-size: 13px; }
.av-sq { border-radius: 9px; }
.faces { display: inline-flex; flex: none; }
.faces .av { box-shadow: 0 0 0 2px #fff; }
.faces .av + .av { margin-left: -7px; }

/* ----------------------------------------------------------------------------
   Card evento (come EventCard nell'app)
   ---------------------------------------------------------------------------- */
.ev-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--preview-meta);
}
.ev-card {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 10px;
  background: #1A1A2E;
  color: #fff;
}
.ev-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ev-card::after {
  content: "";
  position: absolute;
  inset: 45% 0 0 0;
  background: linear-gradient(to top, rgba(0, 0, 0, .82) 0%, rgba(0, 0, 0, .5) 45%, rgba(0, 0, 0, 0) 100%);
}
.ev-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 11px;
  border-radius: 13px;
  background: var(--c);
  color: var(--t);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .01em;
}
.ev-bottom {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 1;
  padding: 14px 14px 14px;
}
.ev-title {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.01em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .45);
}
.ev-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}
.ev-friends { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ev-friends .faces .av { width: 22px; height: 22px; font-size: 10px; box-shadow: 0 0 0 1.5px #fff; }
.ev-ftext {
  min-width: 0;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .5);
}
.ev-actions { display: flex; align-items: center; gap: 9px; flex: none; color: #fff; }
.ev-actions svg { width: 23px; height: 23px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .4)); }

/* Tasto GO animato nel telefono */
.go { position: relative; display: block; width: 23px; height: 23px; }
.go svg { position: absolute; inset: 0; }
.go-on { opacity: 0; transform: scale(.4); transition: opacity .25s var(--ease-out), transform .45s var(--ease-out); }
.go-on circle { fill: var(--go); stroke: #fff; stroke-width: 1.5; }
.go-on path { fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.go-off { transition: opacity .2s; }
.go::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 100px;
  box-shadow: 0 0 0 0 rgba(18, 136, 62, .9);
  opacity: 0;
}
.go.is-on .go-on { opacity: 1; transform: scale(1); }
.go.is-on .go-off { opacity: 0; }
.go.is-on::after { animation: go-ring .9s var(--ease-out) .1s; }
@keyframes go-ring {
  0% { opacity: 1; box-shadow: 0 0 0 0 rgba(255, 255, 255, .9); }
  100% { opacity: 0; box-shadow: 0 0 0 14px rgba(255, 255, 255, 0); }
}

/* Facce che entrano una alla volta */
[data-phone-faces] .av { transition: transform .5s var(--ease-out), opacity .3s var(--ease-out); }
[data-phone-faces] .av.is-out { opacity: 0; transform: scale(.3); margin-left: -22px; }
[data-phone-faces] .av:first-child.is-out { margin-left: 0; }
[data-phone-ftext] { transition: opacity .25s ease, filter .25s ease; }
[data-phone-ftext].is-swapping { opacity: 0; filter: blur(3px); }

/* ----------------------------------------------------------------------------
   Sezione eventi
   ---------------------------------------------------------------------------- */
.events { padding-block: var(--section-y) calc(var(--section-y) * .8); }
.events-head {
  display: grid;
  gap: 20px;
  align-items: end;
}
.events-head h2 { max-width: 14ch; }
.events-head p { max-width: 36rem; color: var(--body); font-size: var(--fs-lead); line-height: 1.55; }

.ev-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(84vw, 340px);
  gap: 16px;
  margin-top: clamp(36px, 5vw, 56px);
  padding: 4px var(--gutter) 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.ev-rail::-webkit-scrollbar { display: none; }
.ev-rail > li { scroll-snap-align: start; }
.ev-rail:focus-visible { outline-offset: -3px; border-radius: 0; }
.ev-rail .ev-card { box-shadow: var(--shadow-soft); }

.cats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 8px;
  margin-top: clamp(28px, 4vw, 44px);
  max-width: 46rem;
}
.cats li {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 100px;
  background: var(--c);
  color: var(--t);
  font-size: 1.0625rem;
  font-weight: 800;
  rotate: var(--r, 0deg);
}
.cats li:nth-child(3n + 1) { --r: -2.5deg; }
.cats li:nth-child(3n + 2) { --r: 1.5deg; }
.cats li:nth-child(4n) { --r: -1deg; }

/* ----------------------------------------------------------------------------
   Prima / durante / dopo
   ---------------------------------------------------------------------------- */
.flow {
  padding-block: var(--section-y);
  background: var(--bg-tint);
}
.flow h2 { max-width: 14ch; }
.flow-steps {
  display: grid;
  gap: clamp(56px, 8vw, 72px);
  margin-top: clamp(40px, 6vw, 72px);
}
.step { display: grid; align-content: start; gap: 12px; }
.step-when {
  display: inline-flex;
  justify-self: start;
  position: relative;
  z-index: 1;
  padding-right: 14px;
  background: var(--bg-tint);
  align-items: center;
  gap: 12px;
  font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1;
  color: var(--accent-ink);
}
.step-when::before {
  content: "";
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 100px;
  background: var(--blue);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--blue) 18%, transparent);
}
.step h3 { margin-top: 6px; }
.step-body { color: var(--body); max-width: 30rem; }

.vis {
  margin-top: 18px;
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-soft), 0 0 0 1px var(--line);
  color: var(--app-ink);
}
@media (prefers-color-scheme: dark) {
  /* le interfacce mostrate restano quelle chiare dell'app */
  .vis { background: #fff; box-shadow: none; }
}

/* Chat Crew */
.vis-chat { display: grid; gap: 10px; padding: 16px; font-size: 14px; }
.chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--app-line);
}
.chat-head b { font-weight: 800; }
.bubble { display: flex; align-items: flex-end; gap: 8px; max-width: 88%; }
.bubble p {
  padding: 9px 13px;
  border-radius: 18px 18px 18px 6px;
  background: #F1F2F4;
  line-height: 1.35;
}
.bubble--me { margin-left: auto; }
.bubble--me p { border-radius: 18px 18px 6px 18px; background: var(--primary); color: #fff; }

/* Live */
.vis-live { padding: 14px 16px 6px; }
.live-head { display: flex; align-items: baseline; gap: 10px; padding-bottom: 10px; }
.live-head b { font-size: 20px; font-weight: 800; }
.live-head span { font-size: 13px; color: var(--app-muted); font-weight: 600; }
.live-row {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--app-line);
}
.live-row img { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; }
.live-tag { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; color: var(--live); letter-spacing: .04em; }
.live-dist { color: var(--app-muted); font-weight: 600; letter-spacing: 0; }
.live-dot { position: relative; width: 8px; height: 8px; border-radius: 100px; background: var(--live); }
.live-title { font-size: 15px; font-weight: 800; line-height: 1.25; }
.live-friends { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 12.5px; font-weight: 600; color: #374151; }
.live-friends .av { width: 20px; height: 20px; font-size: 9px; }

/* Ricordi */
.vis-memories {
  position: relative;
  height: 270px;
  background: none;
  box-shadow: none;
}
@media (prefers-color-scheme: dark) { .vis-memories { background: none; } }
.polaroid {
  position: absolute;
  width: 46%;
  max-width: 190px;
  padding: 8px 8px 30px;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 14px 30px -12px rgba(0, 0, 0, .28), 0 0 0 1px rgba(0, 0, 0, .04);
}
.polaroid img { width: 100%; aspect-ratio: 7 / 8; object-fit: cover; border-radius: 2px; }
.polaroid figcaption {
  position: absolute;
  left: 10px;
  bottom: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
}
.polaroid figcaption svg { width: 16px; height: 16px; fill: none; }
.polaroid figcaption svg + svg { margin-left: 8px; }
.polaroid figcaption .heart { fill: #E01889; color: #E01889; }
.p1 { left: 2%; top: 18px; rotate: -7deg; }
.p2 { left: 27%; top: 0; rotate: 4deg; }
.p3 { left: 51%; top: 26px; rotate: -2deg; }

/* ----------------------------------------------------------------------------
   Riviera (foto a tutta larghezza)
   ---------------------------------------------------------------------------- */
.riviera {
  position: relative;
  display: grid;
  align-items: end;
  min-height: clamp(460px, 88vw, 720px);
  overflow: clip;
  background: #F2C9B3;
}
.riviera-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.riviera-card {
  position: relative;
  margin: 0 var(--gutter) var(--gutter);
  padding: clamp(22px, 4vw, 40px);
  max-width: 34rem;
  border-radius: 20px;
  background: var(--blue);
  color: #fff;
}
.riviera-card h2 { font-size: clamp(1.875rem, 1.3rem + 2.6vw, 3rem); }
.riviera-card p { margin-top: 12px; font-weight: 600; font-size: var(--fs-lead); line-height: 1.45; }

/* ----------------------------------------------------------------------------
   Organizzatori
   ---------------------------------------------------------------------------- */
.org {
  padding-block: var(--section-y);
  background: var(--navy);
  color: #fff;
}
.org :focus-visible { outline-color: #fff; }
.org-inner { display: grid; gap: clamp(40px, 6vw, 64px); align-items: center; }
.org-lead { margin-top: 18px; max-width: 34rem; font-size: var(--fs-lead); line-height: 1.5; }
.org-list { display: grid; gap: 12px; margin-top: 28px; max-width: 34rem; }
.org-list li {
  position: relative;
  padding-left: 32px;
  font-weight: 600;
}
.org-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .2em;
  width: 20px;
  height: 20px;
  border-radius: 100px;
  background: var(--blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 10.2l2.7 2.6L14 7.4' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat;
}
.org-how { margin-top: 28px; max-width: 34rem; color: #D6DCF0; }
.org-how a { color: #fff; font-weight: 700; text-underline-offset: 3px; }
.org-how a:hover { text-decoration-thickness: 2px; }

.org-visual {
  position: relative;
  justify-self: center;
  width: min(100%, 440px);
  padding-bottom: 100px;
}
.push {
  position: absolute;
  bottom: 0;
  left: 12%;
  right: -5%;
  z-index: 1;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 20px;
  background: #F4F6FB;
  color: var(--app-ink);
  rotate: -3deg;
  box-shadow: 0 24px 40px -18px rgba(0, 0, 0, .6);
}
.push-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #fff;
  color: var(--blue);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .06);
}
.push-icon svg { width: 66%; height: 66%; }
.push-top { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; color: #4B5563; letter-spacing: .02em; }
.push-top b { font-weight: 700; }
.push-title { font-size: 14px; font-weight: 800; line-height: 1.3; }
.push-text {
  font-size: 13.5px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.vis-ann {
  width: 100%;
  margin: 0;
  padding: 22px 20px 18px;
  rotate: 2deg;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .55);
}
@media (prefers-color-scheme: dark) { .vis-ann { box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .8); } }
.ann-head { display: flex; align-items: center; gap: 8px; }
.ann-head div { display: grid; line-height: 1.2; }
.ann-head b { font-size: 15px; font-weight: 800; color: #911919; }
.ann-head div span { font-size: 12.5px; color: var(--app-muted); font-weight: 600; }
.ann-text { margin-top: 14px; font-size: 17px; line-height: 1.45; color: var(--app-ink); }
.ann-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--app-line);
  font-size: 13px;
  font-weight: 700;
  color: var(--go);
}
.ann-meta svg { width: 18px; height: 18px; }

/* ----------------------------------------------------------------------------
   Chiusura + footer
   ---------------------------------------------------------------------------- */
.cta {
  position: relative;
  overflow: clip;
  padding-top: var(--section-y);
  background: var(--blue);
  color: #fff;
}
.cta :focus-visible { outline-color: #fff; }
.cta-inner { position: relative; display: grid; justify-items: start; }
.cta-icon { display: none; }
@media (min-width: 980px) {
  .cta-icon {
    position: absolute;
    right: calc(var(--gutter) + 4%);
    top: 50%;
    display: grid;
    place-items: center;
    width: clamp(180px, 17vw, 236px);
    aspect-ratio: 1;
    margin-top: calc(clamp(180px, 17vw, 236px) / -2);
    border-radius: 23%;
    background: #fff;
    color: var(--blue);
    rotate: -8deg;
    box-shadow: 0 40px 70px -24px rgba(0, 0, 0, .45), 0 10px 24px -12px rgba(0, 0, 0, .3);
  }
  .cta-icon svg { width: 64%; height: 64%; }
}
.cta h2 { font-size: var(--fs-h1); letter-spacing: -.04em; line-height: .98; max-width: 10ch; }
.giant {
  margin-top: clamp(48px, 8vw, 96px);
  font-size: 15vw;
  font-weight: 800;
  /* .85: con le metriche di Plus Jakarta Sans la linea di base cade sul bordo
     inferiore del box, quindi le lettere poggiano sul footer senza tagli */
  line-height: .85;
  letter-spacing: -.02em;
  text-align: center;
  white-space: nowrap;
  color: #fff;
  user-select: none;
}

.site-footer {
  padding-block: 28px calc(28px + env(safe-area-inset-bottom));
  background: var(--navy);
  color: #D6DCF0;
  font-size: var(--fs-sm);
}
.site-footer :focus-visible { outline-color: #fff; }
.foot-inner { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.foot-inner a { color: #fff; font-weight: 600; text-underline-offset: 3px; }
.foot-note { flex-basis: 100%; color: #AEB8D6; }

/* ----------------------------------------------------------------------------
   Layout ampio
   ---------------------------------------------------------------------------- */
@media (min-width: 720px) {
  .events-head { grid-template-columns: 1fr 1fr; gap: 48px; }
  .ev-rail {
    grid-auto-flow: row;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-columns: auto;
    max-width: calc(var(--max) + 2 * var(--gutter));
    margin-inline: auto;
    overflow: visible;
    gap: clamp(16px, 2.4vw, 32px);
  }
  .ev-rail > li:nth-child(2) { translate: 0 clamp(20px, 4vw, 56px); }
  .ev-rail { padding-bottom: clamp(20px, 4vw, 56px); }
}

@media (min-width: 980px) {
  .hero { padding-top: 96px; }
  .hero-inner {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
    align-items: end;
  }
  .hero-copy { padding-top: 64px; padding-bottom: clamp(72px, 9vw, 128px); align-self: center; }
  .hero-visual { --pw: 330px; --s: calc((330 - 20) / 360); justify-content: flex-end; padding-right: 4%; }
  .hero-motif { right: -12%; top: -6%; width: 980px; }

  .flow-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(28px, 3.5vw, 48px); position: relative; }
  .flow-steps::before {
    content: "";
    position: absolute;
    top: 17px;
    left: 7px;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--blue), color-mix(in srgb, var(--blue) 15%, transparent));
  }
  .flow-steps { grid-template-rows: repeat(4, auto); row-gap: 0; }
  .step { grid-row: span 4; grid-template-rows: subgrid; row-gap: 12px; }

  .org-inner { grid-template-columns: 1.15fr .85fr; }
}

/* ----------------------------------------------------------------------------
   Movimento (solo se l'utente non l'ha ridotto)
   ---------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  .motif-arc,
  .motif-arrow { stroke-dasharray: 1; animation: draw 1.6s var(--ease-out) both; }
  .motif-arrow { animation-delay: .55s; animation-duration: 1.1s; }
  @keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

  .hero-title,
  .lead,
  .hero .stores,
  .hero .store-status,
  .shared { animation: rise .9s var(--ease-out) both; }
  .hero-title { animation-delay: .05s; }
  .lead { animation-delay: .15s; }
  .hero .stores { animation-delay: .25s; }
  .hero .store-status { animation-delay: .32s; }
  .phone { animation: phone-in 1.2s var(--ease-out) .2s both; }
  @keyframes rise { from { opacity: 0; transform: translateY(22px); filter: blur(6px); } }
  @keyframes phone-in { from { opacity: 0; transform: translateY(90px) rotate(3deg); } }

  .live-dot::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--live);
    animation: pulse 1.8s ease-out infinite;
  }
  @keyframes pulse { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(3); opacity: 0; } }

  /* Animazioni legate allo scorrimento, dove supportate: il contenuto è
     visibile di base e il browser che non le conosce lo mostra e basta. */
  @supports (animation-timeline: view()) {
    .cats li {
      animation: sticker linear both;
      animation-timeline: view();
      animation-range: entry 10% entry 70%;
    }
    @keyframes sticker { from { opacity: 0; transform: translateY(26px) scale(.8); rotate: 0deg; } }

    .vis-chat .bubble {
      animation: bubble linear both;
      animation-timeline: view();
    }
    .vis-chat .bubble:nth-of-type(2) { animation-range: entry 20% entry 60%; }
    .vis-chat .bubble:nth-of-type(3) { animation-range: entry 45% entry 85%; }
    .vis-chat .bubble:nth-of-type(4) { animation-range: entry 70% entry 100%; }
    @keyframes bubble { from { opacity: 0; transform: translateY(14px) scale(.96); } }

    .polaroid {
      animation: fan linear both;
      animation-timeline: view();
      animation-range: entry 15% cover 40%;
    }
    @keyframes fan { from { rotate: 0deg; translate: 0 30px; } }
    .p1 { animation-name: fan-left; }
    @keyframes fan-left { from { rotate: 0deg; translate: 40% 30px; } }
    .p3 { animation-name: fan-right; }
    @keyframes fan-right { from { rotate: 0deg; translate: -40% 30px; } }

    .riviera-img {
      animation: drift linear both;
      animation-timeline: view();
      animation-range: cover 0% cover 100%;
    }
    @keyframes drift { from { transform: scale(1.18) translateY(-3%); } to { transform: scale(1.02) translateY(2%); } }

    .giant {
      animation: giant-up linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 100%;
    }
    @keyframes giant-up { from { transform: translateY(55%); } }
  }
}

/* ----------------------------------------------------------------------------
   404
   ---------------------------------------------------------------------------- */
.notfound-main {
  min-height: 100svh;
  display: grid;
  align-items: center;
  padding-block: 48px;
}
.notfound-main .brand { margin-bottom: 48px; }
.notfound-main .lead { margin-bottom: 32px; }
.btn-home { background: #fff; color: var(--primary); }
.btn-home:hover { background: #E8EEFF; }
.btn-home:focus-visible { outline-color: #fff; }
