/* =========================================================
   CAV San Donato Milanese — "Un abbraccio colorato"
   ========================================================= */

/* ---------- Fonts (self-hosted) ---------- */
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-var-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("../fonts/nunito-var.woff2") format("woff2");
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  /* palette
     L'inchiostro e' quello del marchio (il disegno "madre con bambino",
     assets/img/logo.svg: #2e2a3b). Ogni colore d'accento nasce dal suo tono
     puro mescolato al 16% con quell'inchiostro: tutta la tavolozza condivide
     cosi' il sottotono prugna del tratto e il marchio sta dentro la pagina,
     non sopra. Effetto collaterale utile: il rosso dei pulsanti passa da 3.8
     a 4.7 di contrasto sul bianco. */
  --latte: #fdf8f1;
  --latte-alta: #fffdf9;
  --sabbia: #f7ece2;
  --bianco: #ffffff;
  --ink: #2e2a3b;
  --ink-soft: #615a6e;
  --cuore: #c44c3e;
  --cuore-dark: #a3372b;
  --terracotta: #b36449;
  --giallo: #e0ad44;
  --verde: #78a878;
  /* Il verde pieno sta a 2.5 di contrasto sul latte: per la scritta CAV
     serve la variante scura (4.9), che resta nella stessa famiglia. */
  --verde-scritta: #4e7a52;
  --azzurro: #76a7cd;
  --rosa: #dd96a8;

  /* tinted backgrounds: lo stesso accento stemperato nella carta */
  --giallo-tint: #f9edd7;
  --verde-tint: #e8ede0;
  --azzurro-tint: #e7eef3;
  --rosa-tint: #f9ebe8;

  /* page accent (overridden per page) */
  --accent: var(--cuore);
  --accent-tint: var(--rosa-tint);

  /* type */
  --font-display: "Fraunces", "Georgia", serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;

  --step--1: clamp(0.88rem, 0.85rem + 0.15vw, 0.95rem);
  --step-0: clamp(1.06rem, 1rem + 0.25vw, 1.15rem);
  --step-1: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
  --step-2: clamp(1.6rem, 1.35rem + 1.1vw, 2.2rem);
  --step-3: clamp(2.1rem, 1.6rem + 2.2vw, 3.4rem);
  --step-4: clamp(2.6rem, 1.8rem + 3.6vw, 4.8rem);

  /* shape
     Niente contorni a inchiostro ne' ombre a lastra: il bordo e' un accenno
     e l'accento di ogni scheda le resta intorno come un alone morbido.
     E' la differenza fra un adesivo e una cosa tenuta in braccio. */
  --radius: 30px;
  --radius-sm: 20px;
  --outline: 2px solid color-mix(in srgb, var(--ink) 11%, transparent);
  --outline-ink: 2px solid color-mix(in srgb, var(--ink) 22%, transparent);

  /* ombre tiepide e diffuse, come la luce di una stanza */
  --ombra: 0 1px 2px rgba(46, 42, 59, 0.05), 0 14px 30px -20px rgba(46, 42, 59, 0.26);
  --ombra-alta: 0 2px 6px rgba(46, 42, 59, 0.06), 0 26px 50px -24px rgba(46, 42, 59, 0.3);
  --alone: 0 0 0 6px color-mix(in srgb, var(--c, var(--accent)) 16%, transparent);
  --alone-alto: 0 0 0 10px color-mix(in srgb, var(--c, var(--accent)) 22%, transparent);

  /* layout */
  --container: 1180px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --section-y: clamp(4rem, 9vw, 7.5rem);

  /* motion */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-spring: cubic-bezier(0.34, 1.3, 0.64, 1);
}

/* page color identities */
.page-attivita   { --accent: var(--giallo);  --accent-tint: var(--giallo-tint); }
.page-nido       { --accent: var(--azzurro); --accent-tint: var(--azzurro-tint); }
.page-partecipa  { --accent: var(--verde);   --accent-tint: var(--verde-tint); }
.page-sostienici { --accent: var(--rosa);    --accent-tint: var(--rosa-tint); }
.page-chi        { --accent: var(--terracotta); --accent-tint: var(--sabbia); }

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 6rem; }
body {
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.72;
  color: var(--ink);
  background: var(--latte);
  background-image: radial-gradient(135% 70% at 50% -18%, var(--latte-alta), transparent 60%);
  background-attachment: fixed;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* subtle paper grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.26;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.6 0 0 0 0 0.5 0 0 0 0 0.4 0 0 0 .08 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
img, svg, picture { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--cuore-dark); }
p { max-width: 65ch; text-wrap: pretty; }
ul[role="list"] { list-style: none; padding: 0; }
button { font: inherit; color: inherit; cursor: pointer; }

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 200;
  background: var(--ink);
  color: var(--latte);
  padding: 0.6rem 1rem;
  border-radius: 10px;
  font-weight: 800;
  text-decoration: none;
}
.skip-link:focus { top: 1rem; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Typography ---------- */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 560;
  line-height: 1.15;
  letter-spacing: -0.008em;
  font-variation-settings: "SOFT" 100, "WONK" 1;
  text-wrap: balance;
}
h1 { font-size: var(--step-4); font-weight: 600; }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); line-height: 1.2; font-variation-settings: "SOFT" 100, "WONK" 0; }
h1 em, h2 em { font-style: italic; font-weight: 500; color: var(--cuore); }

.lead { font-size: var(--step-1); line-height: 1.62; color: var(--ink-soft); }
.prose > * + * { margin-top: 1.1em; }
.prose h3 { margin-top: 2em; }
strong { font-weight: 750; }

/* hand-drawn underline */
.scribble {
  position: relative;
  /* inline, non inline-block: cosi' la virgola dopo "mamme" non puo'
     finire da sola a capo */
  display: inline;
  white-space: nowrap;
}
.scribble svg {
  position: absolute;
  left: -2%;
  bottom: -0.18em;
  width: 104%;
  height: 0.35em;
  overflow: visible;
}
.scribble path {
  fill: none;
  stroke: var(--c, color-mix(in srgb, var(--rosa) 92%, var(--bianco)));
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

/* ---------- Layout ---------- */
.container {
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}
.section { padding-block: var(--section-y); position: relative; }
.section--tint { background: var(--accent-tint); border-radius: clamp(28px, 4.5vw, 56px); }
.section--sabbia { background: var(--sabbia); border-radius: clamp(28px, 4.5vw, 56px); }
.section-head { max-width: 46rem; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-head p { margin-top: 1rem; }
.split {
  display: grid;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
}
@media (min-width: 900px) {
  .split { grid-template-columns: 1.1fr 0.9fr; }
  .split--rev > :first-child { order: 2; }
}


/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--latte-alta);
  view-transition-name: site-header;
  transition: transform 300ms var(--ease-out), box-shadow 200ms ease;
}
.site-header.is-hidden { transform: translateY(-100%); }
.site-header.is-scrolled { box-shadow: 0 14px 28px -26px rgba(46, 42, 59, 0.55); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 0.9rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  line-height: 1;
}
.logo:hover { color: inherit; }
/* Il marchio ufficiale è un disegno a tratto in verticale (1248×1616):
   si dimensiona sull'altezza e la larghezza segue le proporzioni. */
.logo-mark {
  height: var(--logo-h, 52px);
  width: auto;
  flex: none;
  transform-origin: bottom center;
  transition: transform 0.4s var(--ease-spring);
}
@media (hover: hover) and (pointer: fine) {
  .logo:hover .logo-mark { transform: scale(1.06); }
}
@media (max-width: 860px) { .logo-mark { --logo-h: 44px; } }
.logo-text { display: flex; flex-direction: column; }
.logo-text strong {
  color: var(--verde-scritta);
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  font-variation-settings: "SOFT" 100, "WONK" 1;
}
.logo-text small {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  margin-top: 0.15rem;
}
/* Su schermi stretti la riga andrebbe a capo accanto al marchio: resta la sola dicitura. */
@media (max-width: 520px) { .logo-place { display: none; } }
.site-footer .logo-place { display: inline; }

.nav-list {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  padding: 0;
}
.nav-list a {
  display: block;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  font-weight: 750;
  font-size: 0.98rem;
  text-decoration: none;
  transition: background-color 0.2s;
}
.nav-list a:hover { background: var(--sabbia); color: var(--ink); }
.nav-list a[aria-current="page"] { background: var(--accent-tint); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--ink) 16%, transparent); }

.nav-toggle {
  display: none;
  width: 48px; height: 48px;
  border: var(--outline);
  border-radius: 50%;
  background: var(--bianco);
  align-items: center;
  justify-content: center;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  display: block;
  width: 20px; height: 2.5px;
  border-radius: 2px;
  background: var(--ink);
  position: relative;
  transition: transform 0.3s var(--ease-out), background-color 0.2s;
}
.nav-toggle span::before, .nav-toggle span::after { content: ""; position: absolute; left: 0; }
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }
.nav-open .nav-toggle span { background: transparent; }
.nav-open .nav-toggle span::before { transform: translateY(6px) rotate(45deg); }
.nav-open .nav-toggle span::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 1000px) {
  .nav-toggle { display: inline-flex; position: relative; z-index: 60; }
  .site-nav {
    position: fixed;
    inset: 0;
    z-index: 55;
    background: var(--latte-alta);
    padding: 6.5rem var(--gutter) 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-12px);
    transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out), visibility 0s 180ms;
    overflow-y: auto;
  }
  .nav-open .site-nav {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition: opacity 280ms var(--ease-drawer), transform 280ms var(--ease-drawer);
  }
  .nav-list li, .site-nav .nav-cta-mobile {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 150ms var(--ease-out), transform 150ms var(--ease-out);
  }
  .nav-open .nav-list li, .nav-open .site-nav .nav-cta-mobile {
    opacity: 1;
    transform: none;
    transition: opacity 300ms var(--ease-out), transform 300ms var(--ease-out);
    transition-delay: calc(60ms + var(--i, 0) * 40ms);
  }
  .nav-list li:nth-child(2) { --i: 1; }
  .nav-list li:nth-child(3) { --i: 2; }
  .nav-list li:nth-child(4) { --i: 3; }
  .nav-list li:nth-child(5) { --i: 4; }
  .site-nav .nav-cta-mobile { --i: 5; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 0.35rem; }
  .nav-list a {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 600;
    padding: 0.4rem 1rem;
  }
  .site-nav .btn { margin-top: 2rem; align-self: flex-start; }
  .site-nav .header-cta { display: none; }
}
@media (min-width: 1001px) {
  .site-nav { display: flex; align-items: center; gap: 1rem; }
  .site-nav .nav-cta-mobile { display: none; }
  .nav-list a { white-space: nowrap; }
}
/* Fra 1001 e 1180px le voci del menu non stanno su una riga accanto al marchio completo. */
@media (min-width: 1001px) and (max-width: 1180px) {
  .site-header .logo-place { display: none; }
  .nav-list a { padding-inline: 0.6rem; }
}
body.nav-open { overflow: hidden; }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--cuore);
  --btn-fg: var(--bianco);
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 1.5rem;
  border: 2px solid color-mix(in srgb, var(--btn-bg) 84%, var(--ink));
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 750;
  font-size: 1.02rem;
  line-height: 1.2;
  text-decoration: none;
  box-shadow: var(--ombra);
  transition: transform 220ms var(--ease-out), box-shadow 220ms var(--ease-out), background-color 200ms ease;
  white-space: nowrap;
}
@media (hover: hover) and (pointer: fine) {
  .btn:hover { color: var(--btn-fg); transform: translateY(-3px); box-shadow: var(--ombra-alta); }
}
.btn:active { transform: translateY(1px) scale(0.98); box-shadow: var(--ombra); transition-duration: 120ms; }
.btn--light { --btn-bg: var(--bianco); --btn-fg: var(--ink); }
.btn--giallo { --btn-bg: var(--giallo); --btn-fg: var(--ink); }
.btn--small { padding: 0.55rem 1.1rem; font-size: 0.92rem; }
.btn svg { width: 1.1em; height: 1.1em; flex: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 2rem; }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(2.5rem, 6vw, 5rem) clamp(4rem, 8vw, 7rem); position: relative; }
/* Due aloni sfumati, rosa e verde, dietro al collage: la pagina tiene le foto
   in mezzo a un chiarore caldo invece di appoggiarle sul bianco. */
.hero::before {
  content: "";
  position: absolute;
  inset: -8% -6% 4% 44%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(56% 52% at 64% 36%, color-mix(in srgb, var(--rosa) 30%, transparent), transparent 70%),
    radial-gradient(50% 48% at 22% 78%, color-mix(in srgb, var(--verde) 20%, transparent), transparent 72%);
  filter: blur(8px);
}
.hero > .container { position: relative; z-index: 1; }
@media (max-width: 899px) { .hero::before { inset: 46% -12% 4% -12%; } }
.hero .split { align-items: center; }
.hero h1 { margin-bottom: 1.5rem; }
.hero .lead { max-width: 34rem; }
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.4rem;
  margin-top: 2.2rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink-soft);
}
.hero-meta span, .hero-meta a { display: inline-flex; align-items: center; gap: 0.4rem; }
.hero-meta a { text-decoration: none; }
.hero-meta a:hover { text-decoration: underline; color: var(--ink); }
.hero-meta svg { width: 1.15em; height: 1.15em; color: var(--cuore); }

/* page hero (inner pages) */
.page-hero { padding-block: clamp(2.5rem, 6vw, 5rem) clamp(3rem, 6vw, 5rem); position: relative; }
.page-hero h1 { font-size: var(--step-4); max-width: 16ch; }
.page-hero .lead { margin-top: 1.5rem; max-width: 40rem; }

/* ---------- Il marchio come filigrana ----------
   Il disegno "madre con bambino" ricompare in grande e appena accennato nella
   meta' vuota dei titoli di pagina e dentro le fasce scure: e' lo stesso
   tratto dell'intestazione, non un ornamento diverso. Dove il titolo ha gia'
   una foto accanto (.split) non compare. */
.page-hero::after {
  content: "";
  position: absolute;
  right: clamp(1rem, 6vw, 7rem);
  bottom: 0;
  width: min(30vw, 360px);
  aspect-ratio: 1248 / 1616;
  pointer-events: none;
  z-index: 0;
  opacity: 0.075;
  background: var(--ink);
  -webkit-mask: url("../img/logo.svg") center / contain no-repeat;
  mask: url("../img/logo.svg") center / contain no-repeat;
}
.page-hero > .container { position: relative; z-index: 1; }
.page-hero:has(.split)::after { content: none; }
@media (max-width: 860px) { .page-hero::after { content: none; } }

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  padding: 0;
  font-size: var(--step--1);
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 1.5rem;
}
.breadcrumb li + li::before { content: "›"; margin-right: 0.4rem; }
.breadcrumb a { text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* ---------- Polaroids ---------- */
.collage {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(12, minmax(28px, 1fr));
  aspect-ratio: 1 / 1.02;
  max-width: 560px;
  margin-inline: auto;
  width: 100%;
}
.collage .polaroid:nth-child(1) { grid-area: 1 / 1 / 7 / 8;  --r: -4deg; z-index: 2; }
.collage .polaroid:nth-child(2) { grid-area: 2 / 7 / 7 / 13; --r: 3deg;  z-index: 1; }
.collage .polaroid:nth-child(3) { grid-area: 6 / 1 / 13 / 7; --r: 2.5deg; z-index: 3; }
.collage .polaroid:nth-child(4) { grid-area: 7 / 6 / 12 / 13; --r: -2deg; z-index: 4; }

.polaroid {
  --r: -2deg;
  --tape: var(--giallo);
  position: relative;
  margin: 0;
  background: var(--bianco);
  padding: 11px 11px 2.2rem;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(46, 42, 59, 0.12), 0 10px 24px -8px rgba(46, 42, 59, 0.28);
  transform: rotate(var(--r));
  transition: transform 400ms var(--ease-spring), box-shadow 400ms var(--ease-out);
}
.polaroid::before {
  /* washi tape */
  content: "";
  position: absolute;
  top: -12px;
  left: 50%;
  width: 84px;
  height: 26px;
  transform: translateX(-50%) rotate(calc(var(--r) * -1.5));
  background: var(--tape);
  opacity: 0.66;
  clip-path: polygon(3% 0, 97% 4%, 100% 50%, 96% 100%, 2% 96%, 0 50%);
}
.polaroid img, .polaroid picture { width: 100%; height: 100%; object-fit: cover; border-radius: 2px; }
.polaroid picture { height: 100%; }
.collage .polaroid { display: flex; flex-direction: column; }
.collage .polaroid picture { flex: 1; min-height: 0; }
.polaroid figcaption {
  position: absolute;
  left: 12px; right: 12px; bottom: 0.45rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--ink-soft);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (hover: hover) and (pointer: fine) {
  .polaroid:hover {
    transform: rotate(0deg) translateY(-6px) scale(1.02);
    box-shadow: 0 2px 4px rgba(46, 42, 59, 0.12), 0 22px 40px -12px rgba(46, 42, 59, 0.38);
    z-index: 10;
  }
}
.polaroid.tape-rosa { --tape: var(--rosa); }
.polaroid.tape-verde { --tape: var(--verde); }
.polaroid.tape-azzurro { --tape: var(--azzurro); }

/* blob portrait */
.blob {
  position: relative;
  aspect-ratio: 1;
  width: 100%;
  max-width: 460px;
  margin-inline: auto;
}
.blob-bg {
  position: absolute;
  inset: -7% -5% -3% -7%;
  background: color-mix(in srgb, var(--accent) 42%, var(--latte));
  border-radius: 58% 42% 50% 50% / 47% 55% 45% 53%;
  border: 0;
}
.blob picture, .blob img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 46% 54% 42% 58% / 55% 45% 55% 45%;
  border: 6px solid var(--bianco);
  box-shadow: var(--ombra);
}

/* ---------- Cards ---------- */
.cards {
  display: grid;
  gap: clamp(1.25rem, 2.5vw, 2rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}
.card {
  --c: var(--accent);
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bianco);
  border: var(--outline);
  border-radius: var(--radius);
  padding: clamp(1.6rem, 3vw, 2.2rem);
  box-shadow: var(--alone), var(--ombra);
  transition: transform 260ms var(--ease-out), box-shadow 260ms var(--ease-out);
}
.card h3 { margin-bottom: 0.7rem; }
.card p { color: var(--ink-soft); }
.card > .card-foot { margin-top: auto; }
.card .card-foot { padding-top: 1.4rem; }
a.card { text-decoration: none; color: inherit; }
@media (hover: hover) and (pointer: fine) {
  a.card:hover { transform: translateY(-4px); box-shadow: var(--alone-alto), var(--ombra-alta); }
}
a.card:active { transform: scale(0.99); box-shadow: var(--alone), var(--ombra); transition-duration: 120ms; }
.card--giallo  { --c: var(--giallo); }
.card--verde   { --c: var(--verde); }
.card--azzurro { --c: var(--azzurro); }
.card--rosa    { --c: var(--rosa); }
.card--cuore   { --c: var(--cuore); }

.card-icon {
  width: 64px; height: 64px;
  border-radius: 50% 50% 50% 16px;
  border: 0;
  background: color-mix(in srgb, var(--c) 30%, var(--bianco));
  display: grid;
  place-items: center;
  margin-bottom: 1.25rem;
  transform: rotate(-4deg);
  transition: transform 0.4s var(--ease-spring);
}
@media (hover: hover) and (pointer: fine) {
  .card:hover .card-icon { transform: rotate(4deg) scale(1.06); }
}
.card-icon svg { width: 34px; height: 34px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 2px solid color-mix(in srgb, var(--c, var(--accent)) 45%, var(--bianco));
  background: color-mix(in srgb, var(--c, var(--accent)) 24%, var(--bianco));
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.3;
  color: var(--ink);
}
.chip svg { width: 1.05em; height: 1.05em; flex: none; }

/* ---------- Activity blocks ---------- */
.activity {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
  padding-block: clamp(2rem, 4vw, 3rem);
}
.activity + .activity { border-top: 2px dashed color-mix(in srgb, var(--ink) 16%, transparent); }
@media (min-width: 860px) { .activity { grid-template-columns: 1fr 300px; } }
.activity h2 { font-size: var(--step-2); margin-bottom: 1rem; }
.activity .prose p { color: var(--ink-soft); }
.info-box {
  background: var(--bianco);
  border: var(--outline);
  border-radius: var(--radius-sm);
  padding: 1.25rem 1.35rem;
  box-shadow: 0 0 0 7px color-mix(in srgb, var(--c) 16%, transparent), var(--ombra);
}
.info-box h3 { font-family: var(--font-body); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 800; color: var(--ink-soft); margin-bottom: 0.6rem; }
.info-box ul { padding-left: 1.1rem; display: grid; gap: 0.3rem; font-weight: 650; }
.info-box p { font-weight: 650; }

/* ---------- Timeline (La nostra giornata) ---------- */
.timeline {
  --line: 3px;
  position: relative;
  max-width: 760px;
  margin-inline: auto;
}
.timeline-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 1.1rem;
}
.timeline::before {
  content: "";
  position: absolute;
  left: calc(6.6rem + 1rem + 14px);
  top: 1rem;
  bottom: 1rem;
  width: var(--line);
  background: repeating-linear-gradient(to bottom, var(--ink) 0 8px, transparent 8px 16px);
  opacity: 0.35;
}
.t-item {
  --c: var(--giallo);
  position: relative;
  display: grid;
  grid-template-columns: 6.6rem 31px 1fr;
  gap: 0 1rem;
  align-items: center;
}
.t-time {
  font-weight: 900;
  font-size: 0.95rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.t-dot {
  width: 31px; height: 31px;
  border-radius: 50%;
  border: var(--outline);
  background: var(--latte);
  display: grid;
  place-items: center;
  position: relative;
  z-index: 1;
  transition: background-color 0.4s var(--ease-out), transform 0.5s var(--ease-spring);
}
.t-dot svg { width: 16px; height: 16px; opacity: 0; transition: opacity 0.3s; }
.t-item.is-lit .t-dot { background: var(--c); transform: scale(1.12); }
.t-item.is-lit .t-dot svg { opacity: 1; }
.t-card {
  background: var(--bianco);
  border: var(--outline);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.15rem;
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--c) 16%, transparent), var(--ombra);
}
.t-card strong { display: block; font-family: var(--font-display); font-size: 1.2rem; font-weight: 650; line-height: 1.25; }
.t-card span { display: block; font-size: 0.95rem; color: var(--ink-soft); margin-top: 0.15rem; }
.t-item:nth-child(6n+1) { --c: var(--giallo); }
.t-item:nth-child(6n+2) { --c: var(--verde); }
.t-item:nth-child(6n+3) { --c: var(--azzurro); }
.t-item:nth-child(6n+4) { --c: var(--rosa); }
.t-item:nth-child(6n+5) { --c: var(--cuore); }
.t-item:nth-child(6n+6) { --c: var(--terracotta); }
@media (max-width: 520px) {
  .t-item { grid-template-columns: 31px 1fr; }
  .t-time { grid-column: 2; text-align: left; order: -1; padding-left: 0; margin-bottom: 0.25rem; }
  .t-dot { grid-row: 1 / span 2; align-self: start; margin-top: 1.8rem; }
  .timeline::before { left: 14px; }
}

/* ---------- Hours card ---------- */
.hours {
  background: var(--bianco);
  border: var(--outline);
  border-radius: var(--radius);
  box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 16%, transparent), var(--ombra);
  overflow: hidden;
}
.hours-head {
  background: color-mix(in srgb, var(--accent) 42%, var(--bianco));
  border-bottom: var(--outline);
  padding: 1.1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.hours-head h3 { font-size: 1.35rem; }
.hours dl { padding: 0.5rem 1.5rem 1.25rem; }
.hours dl div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0;
  border-bottom: 2px dashed color-mix(in srgb, var(--ink) 13%, transparent);
}
.hours dl div:last-child { border-bottom: 0; }
.hours dt { font-weight: 800; }
.hours dd { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.hours-note { padding: 0 1.5rem 1.4rem; font-size: 0.95rem; color: var(--ink-soft); }

/* ---------- Gallery ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(1.25rem, 3vw, 2.25rem);
  align-items: start;
}
@media (min-width: 760px) { .gallery { grid-template-columns: repeat(3, 1fr); } }
.gallery .polaroid:nth-child(odd) { --r: -2deg; }
.gallery .polaroid:nth-child(even) { --r: 2.5deg; }
.gallery .polaroid--wide { grid-column: span 2; }
.gallery img { width: 100%; object-fit: cover; }
.gallery button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}
.gallery img { aspect-ratio: 3 / 4; }
.gallery .polaroid--wide img { aspect-ratio: 3 / 2; }

/* lightbox */
.lightbox {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: min(92vw, 720px);
  max-height: 90vh;
  overflow: visible;
}
.lightbox {
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 150ms var(--ease-out), transform 150ms var(--ease-out),
              overlay 150ms allow-discrete, display 150ms allow-discrete;
}
.lightbox[open] { opacity: 1; transform: none; transition-duration: 220ms; }
@starting-style { .lightbox[open] { opacity: 0; transform: scale(0.96); } }
.lightbox::backdrop {
  background: rgba(46, 42, 59, 0);
  backdrop-filter: blur(4px);
  transition: background-color 150ms ease, overlay 150ms allow-discrete, display 150ms allow-discrete;
}
.lightbox[open]::backdrop { background: rgba(46, 42, 59, 0.82); transition-duration: 220ms; }
@starting-style { .lightbox[open]::backdrop { background: rgba(46, 42, 59, 0); } }
.lightbox figure { background: var(--bianco); padding: 12px 12px 3rem; border-radius: 8px; position: relative; }
.lightbox img { max-height: 76vh; width: auto; margin-inline: auto; border-radius: 3px; }
.lightbox figcaption { position: absolute; left: 0; right: 0; bottom: 0.8rem; text-align: center; font-family: var(--font-display); font-style: italic; font-size: 1.1rem; color: var(--ink-soft); }
.lightbox-close {
  position: absolute;
  top: -18px; right: -18px;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: var(--outline);
  background: var(--giallo);
  font-size: 1.4rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: var(--ombra);
  transition: transform 160ms var(--ease-out);
}
.lightbox-close:active { transform: scale(0.94); }

/* ---------- Highlights list ---------- */
.highlights { display: grid; gap: 1rem; list-style: none; padding: 0; }
.highlights li {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 1rem;
  align-items: start;
  background: var(--bianco);
  border: var(--outline);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.25rem;
}
.highlights .hl-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: var(--outline);
  display: grid;
  place-items: center;
  background: var(--c, var(--giallo));
}
.highlights .hl-icon svg { width: 22px; height: 22px; }
.highlights strong { display: block; font-size: 1.08rem; }
.highlights span { color: var(--ink-soft); font-size: 0.98rem; }

/* ---------- Roles (Partecipa) ---------- */
.roles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  list-style: none;
  padding: 0;
}
.roles li {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.9rem 1.3rem 0.9rem 0.9rem;
  border: var(--outline);
  border-radius: 999px;
  background: var(--bianco);
  font-weight: 700;
  font-size: 1.05rem;
  box-shadow: var(--alone), var(--ombra);
  transform: rotate(var(--r, 0deg));
  transition: transform 300ms var(--ease-spring);
}
@media (hover: hover) and (pointer: fine) {
  .roles li:hover { transform: rotate(0deg) translateY(-3px); }
}
.roles li:nth-child(5n+1) { --c: var(--giallo); --r: -1.5deg; }
.roles li:nth-child(5n+2) { --c: var(--azzurro); --r: 1deg; }
.roles li:nth-child(5n+3) { --c: var(--rosa); --r: -0.5deg; }
.roles li:nth-child(5n+4) { --c: var(--verde); --r: 1.5deg; }
.roles li:nth-child(5n+5) { --c: var(--cuore); --r: -1deg; }
.roles .role-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--c) 34%, var(--bianco));
  border: 0;
  flex: none;
}
.roles .role-icon svg { width: 20px; height: 20px; }

.steps { counter-reset: step; list-style: none; padding: 0; display: grid; gap: 1.25rem; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 52px 1fr; gap: 1rem; align-items: start; }
.steps li::before {
  content: counter(step);
  width: 52px; height: 52px;
  border-radius: 50%;
  border: var(--outline);
  background: var(--giallo);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
}
.steps li:nth-child(2)::before { background: var(--verde); }
.steps li:nth-child(3)::before { background: var(--azzurro); }
.steps strong { display: block; font-size: 1.1rem; margin-top: 0.2rem; }
.steps span { color: var(--ink-soft); }

/* ---------- Donations ---------- */
.copy-field {
  display: flex;
  align-items: stretch;
  border: var(--outline);
  border-radius: var(--radius-sm);
  background: var(--latte);
  overflow: hidden;
  margin-top: 1rem;
}
.copy-field code {
  flex: 1;
  min-width: 0;
  padding: 0.85rem 1rem;
  font-family: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, monospace;
  font-size: clamp(0.85rem, 0.78rem + 0.35vw, 1.02rem);
  font-weight: 700;
  letter-spacing: 0.03em;
  overflow-wrap: anywhere;
  align-self: center;
}
.copy-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 0;
  border-left: var(--outline);
  background: var(--giallo);
  padding: 0 1rem;
  font-weight: 850;
  font-size: 0.92rem;
  min-width: 7.2rem;
  justify-content: center;
  transition: background-color 200ms ease;
}
.copy-btn:hover { background: color-mix(in srgb, var(--giallo) 80%, white); }
.copy-btn:active .copy-label { transform: scale(0.95); transition-duration: 100ms; }
.copy-btn svg { width: 1.05em; height: 1.05em; }
.copy-btn.is-copied { background: var(--verde); }
.copy-label { display: inline-flex; align-items: center; gap: 0.4rem; transition: transform 160ms var(--ease-out), filter 160ms ease, opacity 160ms ease; }
.copy-label.is-swapping { filter: blur(2px); opacity: 0.4; }

.babybox {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  background: var(--bianco);
  border: var(--outline);
  border-radius: calc(var(--radius) + 8px);
  padding: clamp(1.75rem, 5vw, 3.5rem);
  box-shadow: 0 0 0 10px color-mix(in srgb, var(--cuore) 16%, transparent), var(--ombra);
  position: relative;
  overflow: hidden;
}
@media (min-width: 880px) { .babybox { grid-template-columns: 0.85fr 1.15fr; } }
.babybox-art {
  position: relative;
  max-width: 340px;
  margin-inline: auto;
  width: 100%;
}
.price-tag {
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
  font-family: var(--font-display);
  font-weight: 750;
  font-size: var(--step-3);
  line-height: 1;
  background: var(--giallo);
  border: var(--outline);
  border-radius: 18px;
  padding: 0.35rem 1rem 0.5rem;
  transform: rotate(-3deg);
  margin-bottom: 1.25rem;
  box-shadow: var(--ombra);
}
.price-tag small { font-size: 0.4em; font-family: var(--font-body); font-weight: 800; }
.box-list { list-style: none; padding: 0; display: grid; gap: 0.6rem; margin-block: 1.5rem; }
.box-list li { display: flex; align-items: center; gap: 0.75rem; font-weight: 700; }
.box-list li::before {
  content: "";
  flex: none;
  width: 26px; height: 26px;
  border-radius: 9px;
  border: 0;
  background: var(--c, var(--giallo)) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232e2a3b' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 16px no-repeat;
}
.box-list li:nth-child(2)::before { --c: var(--rosa); }
.box-list li:nth-child(3)::before { --c: var(--azzurro); }
.box-list li:nth-child(4)::before { --c: var(--verde); }
.box-list li:nth-child(5)::before { --c: var(--terracotta); }

/* ---------- CTA band ---------- */
.cta-band { background: color-mix(in srgb, var(--ink) 84%, var(--cuore)); color: var(--latte); position: relative; overflow: hidden; }
.cta-band h2 em { color: var(--giallo); }
.cta-band p { color: color-mix(in srgb, var(--latte) 78%, transparent); }
.cta-band .lead { color: color-mix(in srgb, var(--latte) 80%, transparent); }
.cta-band .container { position: relative; z-index: 1; }
.cta-band::after {
  content: "";
  position: absolute;
  right: -2%;
  top: -18%;
  height: 136%;
  aspect-ratio: 1248 / 1616;
  pointer-events: none;
  opacity: 0.07;
  background: var(--latte);
  -webkit-mask: url("../img/logo.svg") center / contain no-repeat;
  mask: url("../img/logo.svg") center / contain no-repeat;
}
.cta-band--big::after { content: none; }
@media (max-width: 860px) { .cta-band::after { content: none; } }
.cta-grid { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 900px) { .cta-grid { grid-template-columns: 1.4fr 1fr; } }
.cta-band .btn { --btn-bg: var(--giallo); --btn-fg: var(--ink); box-shadow: var(--ombra); border-color: color-mix(in srgb, var(--giallo) 78%, var(--ink)); }
@media (hover: hover) and (pointer: fine) {
  .cta-band .btn:hover { box-shadow: var(--ombra-alta); }
}
.cta-band .btn--light { --btn-bg: transparent; --btn-fg: var(--latte); border-color: color-mix(in srgb, var(--latte) 42%, transparent); }

/* ---------- FAQ ---------- */
.faq-list {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
}
.faq-item {
  background: var(--bianco);
  border: var(--outline);
  border-radius: var(--radius-sm);
  padding: 1.25rem 1.4rem;
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 16%, transparent), var(--ombra);
}
.faq-item h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }
.faq-item p { color: var(--ink-soft); }

/* FAQ: una colonna larga, ogni risposta si apre per intero */
.faq-list { grid-template-columns: 1fr; max-width: 860px; gap: 1rem; align-items: start; }
.faq-item { padding: 1.3rem 1.6rem; }
.faq-item summary { align-items: center; }
.faq-item h3 { font-size: clamp(1.15rem, 1.05rem + 0.4vw, 1.35rem); line-height: 1.3; }
.faq-item[open] { box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 16%, transparent), var(--ombra); }
.faq-body p { margin-top: 0.8rem; font-size: 1.08rem; line-height: 1.7; color: var(--ink); max-width: 68ch; }
.faq-icon { width: 30px; height: 30px; margin-top: 0; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--ink) 14%, transparent); background: var(--accent-tint); }

/* ---------- News ---------- */
.news-date { font-size: var(--step--1); font-weight: 800; color: var(--ink-soft); margin-bottom: 0.6rem; }
.card .news-date { margin-bottom: 0.4rem; }

/* ---------- "Sostieni il CAV": la fascia grande ---------- */
.cta-band--big { padding-block: clamp(5rem, 11vw, 9rem); }
.cta-band--big .cta-grid { gap: clamp(2.5rem, 6vw, 5rem); }
@media (min-width: 900px) { .cta-band--big .cta-grid { grid-template-columns: 1.25fr 0.75fr; } }
.cta-band--big h2 { font-size: clamp(2.8rem, 1.6rem + 5vw, 6rem); line-height: 1; }
.cta-band--big .lead { font-size: clamp(1.2rem, 1.05rem + 0.6vw, 1.55rem); margin-top: 1.5rem; max-width: 34rem; }
.cta-band--big .btn-row { margin-top: 2.5rem; }
.cta-band--big .btn { font-size: 1.15rem; padding: 1.1rem 2rem; }
.cta-band--big .btn svg { width: 1.25em; height: 1.25em; }
.cta-art {
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, 380px);
  aspect-ratio: 1;
  margin-inline: auto;
  border-radius: 50%;
  background: var(--latte-alta);
  box-shadow: 0 0 0 10px color-mix(in srgb, var(--latte) 16%, transparent),
              0 0 0 26px color-mix(in srgb, var(--latte) 7%, transparent), var(--ombra-alta);
  transition: transform 300ms var(--ease-spring);
}
.cta-art .babybox-art { display: block; width: 84%; }
.cta-art:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) { .cta-art:hover { transform: rotate(-3deg) scale(1.03); } }
.cta-price {
  position: absolute;
  top: 6%; right: 2%;
  display: inline-flex;
  align-items: baseline;
  gap: 0.15rem;
  padding: 0.35rem 0.9rem 0.5rem;
  border: 2px solid color-mix(in srgb, var(--giallo) 72%, var(--ink));
  border-radius: 16px;
  background: var(--giallo);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2rem;
  line-height: 1;
  transform: rotate(8deg);
  box-shadow: var(--ombra);
}
.cta-price small { font-size: 0.5em; font-family: var(--font-body); font-weight: 800; }
@keyframes cta-price-in { from { opacity: 0; transform: rotate(30deg) scale(0.6); } }
.cta-art .bb-play ~ .cta-price { animation: cta-price-in 600ms var(--ease-spring) 950ms backwards; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--sabbia);
  border-radius: clamp(32px, 5vw, 64px) clamp(32px, 5vw, 64px) 0 0;
  padding-block: clamp(3.5rem, 7vw, 5rem) 2rem;
  font-size: 0.98rem;
}
.footer-grid {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
}
.footer-grid h2 {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.9rem;
}
.footer-grid ul { list-style: none; padding: 0; display: grid; gap: 0.45rem; }
.footer-grid a { text-decoration: none; font-weight: 700; }
.footer-grid a:hover { text-decoration: underline; }
.footer-grid address { font-style: normal; display: grid; gap: 0.45rem; }
.footer-about p { margin-top: 1rem; color: var(--ink-soft); max-width: 30ch; }
.footer-bottom {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 2px dashed color-mix(in srgb, var(--ink) 14%, transparent);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.88rem;
  color: var(--ink-soft);
}
.todo { background: var(--giallo-tint); border-radius: 4px; padding: 0 0.25rem; outline: 1px dashed var(--terracotta); }

/* ---------- Page-load entrance ----------
   Only the first screen moves, once per page load: the header text rises in
   sequence, the photos settle into their tilt, the hand-drawn underline draws.
   fill-mode "backwards" hands the element back to its normal rules afterwards,
   so hover transforms keep working. */
@keyframes cav-rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes cav-settle { from { opacity: 0; transform: rotate(calc(var(--r, 0deg) * 2.5)) translateY(16px) scale(0.96); } }
@keyframes cav-draw { from { stroke-dashoffset: 1; } }
@keyframes cav-fade { from { opacity: 0; } }

.hero .split > :first-child > *,
.page-hero .container:not(.split) > *,
.page-hero .split > :first-child > * {
  animation: cav-rise 500ms var(--ease-out) backwards;
}
:is(.hero .split > :first-child, .page-hero .container:not(.split), .page-hero .split > :first-child) > :nth-child(2) { animation-delay: 60ms; }
:is(.hero .split > :first-child, .page-hero .container:not(.split), .page-hero .split > :first-child) > :nth-child(3) { animation-delay: 120ms; }
:is(.hero .split > :first-child, .page-hero .container:not(.split), .page-hero .split > :first-child) > :nth-child(4) { animation-delay: 180ms; }
:is(.hero .split > :first-child, .page-hero .container:not(.split), .page-hero .split > :first-child) > :nth-child(5) { animation-delay: 240ms; }

.page-hero .split > :last-child { animation: cav-rise 600ms var(--ease-out) 140ms backwards; }

.collage .polaroid { animation: cav-settle 700ms var(--ease-out) backwards; }
.collage .polaroid:nth-child(1) { animation-delay: 120ms; }
.collage .polaroid:nth-child(2) { animation-delay: 190ms; }
.collage .polaroid:nth-child(3) { animation-delay: 260ms; }
.collage .polaroid:nth-child(4) { animation-delay: 330ms; }

.hero .scribble path { animation: cav-draw 650ms var(--ease-in-out) 420ms backwards; }

/* ---------- Reveal on scroll (every page) ----------
   main.js tags blocks below the first screen with .rv and adds .in once they
   enter the viewport; after the transition the classes are removed, so hover
   rules take over again. Nothing is hidden without JS or with reduced motion. */
.rv {
  opacity: 0;
  transform: translateY(var(--rv-y, 14px));
}
.rv.in {
  opacity: 1;
  transform: none;
  transition: opacity 500ms var(--ease-out), transform 700ms var(--ease-out);
  transition-delay: calc(var(--rv-i, 0) * 70ms);
}
.rv.polaroid { transform: rotate(calc(var(--r) * 2.5)) translateY(18px) scale(0.97); }
.rv.in.polaroid { transform: rotate(var(--r)); }
.roles li.rv { transform: rotate(var(--r, 0deg)) translateY(var(--rv-y, 14px)); }
.roles li.rv.in { transform: rotate(var(--r, 0deg)); }

/* ---------- Baby Box ----------
   Un disegno, non un rendering: proiezione obliqua, tratto a inchiostro,
   tinte piatte. Lo stesso linguaggio del marchio e delle schede.
   Un solo numero comanda tutto, --open: 0 chiusa, 1 aperta. Ferma e' una
   scatola chiusa col marchio in vista; al passaggio del mouse il coperchio
   si alza e la spesa esce, sfalsata nel tempo.
   main.js aggiunge .bb-play quando la scatola entra in pagina. */

@property --open { syntax: "<number>"; inherits: true; initial-value: 0; }

.bb {
  --open: 0;

  /* cartone: tre toni piatti, nessun riflesso */
  --card: #ddc29c;             /* fianco              */
  --card-lit: #ecd6b6;         /* faccia in luce      */
  --card-dim: #c9a87e;         /* imboccatura, ombra  */
  --card-in: #f3e4c9;          /* coperchio, in alto  */
  --card-line: var(--ink);

  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

/* tratto e tinte */
.bb :is(path, rect, ellipse, image) {
  stroke: var(--card-line);
  stroke-width: 2.4;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.bb-ground { fill: var(--ink); opacity: 0.14; stroke: none; }
.bb-hole { fill: var(--card-dim); }
.bb-front { fill: var(--card-lit); }
.bb-side { fill: var(--card); }
.bb-lid-top { fill: var(--card-in); }
.bb-lid-front { fill: var(--card-lit); }
.bb-lid-side { fill: var(--card); }

/* la stampa sul fianco: il marchio e tre righe, come un indirizzo */
.bb-mark { opacity: 0.45; stroke: none; }
.bb-rule path { fill: none; stroke: var(--ink); stroke-width: 2.2; opacity: 0.36; }

/* la spesa */
.bb-pack { fill: #faf3e6; }
.bb-pack--azzurro { fill: #e2edf5; }
.bb-pack--rosa { fill: #f8e7e4; }
.bb-lidlet { fill: #f1e7d6; }
.bb-crease { fill: none; stroke-width: 2; opacity: 0.3; }
.bb-band--giallo { fill: var(--giallo); }
.bb-band--azzurro { fill: var(--azzurro); }
.bb-band--verde { fill: var(--verde); }
.bb-band--rosa { fill: var(--rosa); }

/* ---- il movimento ----
   Il coperchio parte per primo, poi la spesa esce a cascata: 35ms di scarto,
   quanto basta perche' si legga come una sequenza e non come un ritardo. */
.bb-lid {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  transition: transform 420ms var(--ease-spring);
  transform: translate(calc(var(--open) * -22px), calc(var(--open) * -86px))
             rotate(calc(var(--open) * -7deg));
}
.bb-it {
  --x: 0; --y: 0; --rise: 90; --rot: 0deg;
  transform-box: fill-box;
  transform-origin: 50% 100%;
  transition: transform 480ms var(--ease-spring);
  transform:
    translate(calc(var(--x) * 1px), calc((var(--y) - var(--open) * var(--rise)) * 1px))
    rotate(calc(var(--open) * var(--rot)));
}
.bb-biscotti  { transition-delay: 80ms; }
.bb-pannolini { transition-delay: 115ms; }
.bb-latte     { transition-delay: 150ms; }
.bb-zinco     { transition-delay: 185ms; }
.bb-salviette { transition-delay: 220ms; }

/* ---- stati ----
   Ferma: chiusa, col marchio in vista. Mouse o tastiera: si apre del tutto.
   Senza mouse (telefono) si apre da sola quando entra in pagina. */
@keyframes bb-in { from { opacity: 0; transform: translateY(14px); } }
.babybox-art.bb-play .bb { animation: bb-in 600ms var(--ease-out) backwards; }
@media (prefers-reduced-motion: no-preference) {
  .js .babybox-art:not(.bb-play) .bb { opacity: 0; }
}
@media (hover: hover) and (pointer: fine) {
  :is(.babybox, .babybox-art, .cta-art):hover .bb,
  :is(.babybox, .babybox-art, .cta-art):focus-visible .bb { --open: 1; }
}
@media (hover: none) {
  .babybox-art.bb-play .bb { --open: 1; }
}
/* Chiudere e' una risposta, non una decisione: niente attese, niente rimbalzo,
   e meta' del tempo che ci mette ad aprirsi. */
:is(.babybox, .babybox-art, .cta-art):not(:hover) :is(.bb-lid, .bb-it) {
  transition-duration: 240ms;
  transition-timing-function: var(--ease-out);
  transition-delay: 0ms;
}

/* il resto della scheda entra come prima */
@keyframes bb-tag  { from { opacity: 0; transform: rotate(-18deg) scale(0.85); } }
@keyframes bb-item { from { opacity: 0; transform: translateX(-10px); } }
@keyframes bb-tick { from { transform: scale(0.4); } }
.babybox.bb-play .price-tag { animation: bb-tag 420ms var(--ease-spring) 120ms backwards; }
.babybox.bb-play .box-list li { animation: bb-item 320ms var(--ease-out) backwards; }
.babybox.bb-play .box-list li::before { animation: bb-tick 320ms var(--ease-spring) backwards; }
.babybox.bb-play .box-list li:nth-child(1), .babybox.bb-play .box-list li:nth-child(1)::before { animation-delay: 200ms; }
.babybox.bb-play .box-list li:nth-child(2), .babybox.bb-play .box-list li:nth-child(2)::before { animation-delay: 240ms; }
.babybox.bb-play .box-list li:nth-child(3), .babybox.bb-play .box-list li:nth-child(3)::before { animation-delay: 280ms; }
.babybox.bb-play .box-list li:nth-child(4), .babybox.bb-play .box-list li:nth-child(4)::before { animation-delay: 320ms; }
.babybox.bb-play .box-list li:nth-child(5), .babybox.bb-play .box-list li:nth-child(5)::before { animation-delay: 360ms; }
@media (prefers-reduced-motion: no-preference) {
  .js .babybox:not(.bb-play) :is(.price-tag, .box-list li) { opacity: 0; }
}
/* con il movimento ridotto la scatola resta aperta e ferma */
@media (prefers-reduced-motion: reduce) {
  .bb { --open: 0.9; }
  .bb-lid, .bb-it { transition: none; }
}

/* =========================================================
   Livello dinamico (assets/js/motion.js)
   ========================================================= */
:root { --tilt-max: 5; interpolate-size: allow-keywords; }

/* transizione tra le pagine (Chrome, Edge, Safari): l'header resta fermo */
@view-transition { navigation: auto; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }
::view-transition-old(root) { animation: 160ms var(--ease-out) both vt-out; }
::view-transition-new(root) { animation: 300ms var(--ease-out) both vt-in; }

/* barra di lettura */
.scroll-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 120;
  background: var(--cuore);
  transform-origin: left;
  transform: scaleX(0);
  pointer-events: none;
}

/* titoli parola per parola */
.split-words { animation: none !important; }
.split-words .w { display: inline-block; opacity: 0; transform: translateY(0.45em); filter: blur(6px); }
.split-words.words-in .w { animation: word-in 650ms var(--ease-out) forwards; animation-delay: calc(var(--w) * 45ms); }
@keyframes word-in { to { opacity: 1; transform: none; filter: blur(0); } }

/* numeri */
.numbers { padding-block: clamp(2rem, 5vw, 3.5rem); }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; list-style: none; padding: 0; perspective: 1000px; }
@media (min-width: 760px) { .stats { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); } }
.stat {
  --c: var(--giallo);
  background: var(--bianco);
  border: var(--outline);
  border-radius: var(--radius);
  padding: 1.25rem 1rem 1.4rem;
  text-align: center;
  box-shadow: 0 0 0 7px color-mix(in srgb, var(--c) 16%, transparent), var(--ombra);
}
.stat:nth-child(1) { --c: var(--cuore); }
.stat:nth-child(3) { --c: var(--azzurro); }
.stat:nth-child(4) { --c: var(--verde); }
.stat-pre { display: block; font-size: var(--step--1); font-weight: 700; color: var(--ink-soft); }
.stat-num { display: block; font-family: var(--font-display); font-size: var(--step-3); font-weight: 700; line-height: 1.05; font-variant-numeric: tabular-nums; }
.stat-label { display: block; margin-top: 0.3rem; font-weight: 700; color: var(--ink-soft); }

/* card che si inclinano: serve la prospettiva sul contenitore */
.cards, .highlights { perspective: 1000px; }

/* domande frequenti a fisarmonica */
.faq-item summary { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; cursor: pointer; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item h3 { margin: 0; }
.faq-icon { position: relative; flex: none; width: 22px; height: 22px; margin-top: 0.2rem; }
.faq-icon::before, .faq-icon::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 14px; height: 2.5px; border-radius: 2px; background: currentColor;
  transform: translate(-50%, -50%);
  transition: transform 250ms var(--ease-out);
}
.faq-icon::after { transform: translate(-50%, -50%) rotate(90deg); }
.faq-item[open] .faq-icon::after { transform: translate(-50%, -50%) rotate(0deg); }
.faq-item::details-content {
  block-size: 0;
  overflow: hidden;
  transition: block-size 300ms var(--ease-out), content-visibility 300ms allow-discrete;
}
.faq-item[open]::details-content { block-size: auto; }
.faq-body p { margin-top: 0.6rem; }
.faq-item[open] .faq-body { opacity: 1; transform: none; transition: opacity 250ms ease, transform 300ms var(--ease-out); }
@starting-style { .faq-item[open] .faq-body { opacity: 0; transform: translateY(-4px); } }

/* la linea della giornata al nido si riempie scorrendo */
.timeline::after {
  content: "";
  position: absolute;
  left: calc(6.6rem + 1rem + 14px);
  top: 1rem;
  bottom: 1rem;
  width: 3px;
  border-radius: 3px;
  background: var(--cuore);
  transform-origin: top;
  transform: scaleY(var(--tl, 0));
}
@media (max-width: 520px) { .timeline::after { left: 14px; } }

/* cuore che batte nei pulsanti di donazione */
@keyframes beat { 0%, 100% { transform: scale(1); } 30% { transform: scale(1.28); } 60% { transform: scale(0.94); } }
@media (hover: hover) and (pointer: fine) {
  .btn:hover .i-heart { animation: beat 700ms var(--ease-out); }
}

/* cuori della copia */
.burst-heart { position: fixed; z-index: 200; width: 18px; height: 18px; pointer-events: none; transform: translate(-50%, -50%); }
.burst-heart svg { width: 100%; height: 100%; }

/* frecce della galleria */
.lightbox-nav {
  position: absolute;
  top: 50%;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: var(--outline);
  background: var(--bianco);
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  transition: transform 160ms var(--ease-out);
  box-shadow: var(--ombra);
}
.lightbox-nav svg { width: 22px; height: 22px; }
.lightbox-prev { left: -64px; }
.lightbox-prev svg { transform: rotate(180deg); }
.lightbox-next { right: -64px; }
.lightbox-nav:active { transform: translateY(-50%) scale(0.94); }
@media (max-width: 860px) { .lightbox-prev { left: 8px; } .lightbox-next { right: 8px; } }

/* ---------- Reduced motion ----------
   Fewer and gentler, not zero: keep fades and colour changes, drop movement. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-name: cav-fade !important;
    transition-property: opacity, color, background-color, border-color, box-shadow, filter !important;
  }
  .hero .scribble path { animation: none !important; }
  .split-words .w { animation: none !important; opacity: 1; transform: none; filter: none; }
  .faq-item::details-content { transition: none; }
}
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }

/* ---------- Small-screen tweaks ---------- */


/* =========================================================
   Feeling materno
   Lo stesso impianto, con il tono di una stanza di casa: linee piu'
   leggere, un respiro lento dietro alle foto, un cuore che batte
   piano nei pulsanti e due righe di accoglienza nel primo schermo.
   ========================================================= */

/* il tratto delle icone si assottiglia: disegno a mano, non segnaletica */
.card-icon svg, .role-icon svg, .hl-icon svg, .t-dot svg { stroke-width: 1.9; }

/* "Nessuna mamma e' sola": la prima cosa che si legge, in una pastiglia tiepida */
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.1rem;
  padding: 0.42rem 1rem 0.42rem 0.8rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--rosa) 22%, var(--bianco));
  color: color-mix(in srgb, var(--ink) 86%, var(--cuore));
  font-size: 0.93rem;
  font-weight: 700;
}
.hero-kicker svg { width: 1.15em; height: 1.15em; flex: none; color: var(--cuore); stroke-width: 2; }

/* la riga di rassicurazione sotto ai pulsanti: corsivo, voce bassa */
.hero-note {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 1.3rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.45;
  color: var(--ink-soft);
}
.hero-note svg { width: 1.15em; height: 1.15em; flex: none; color: var(--rosa); stroke-width: 2; }

/* la sequenza d'ingresso dell'eroe ha due righe in piu' da aspettare */
:is(.hero .split > :first-child, .page-hero .container:not(.split), .page-hero .split > :first-child) > :nth-child(6) { animation-delay: 300ms; }

/* il respiro degli aloni: dodici secondi, quasi impercettibile */
@keyframes cav-respiro {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.045); opacity: 1; }
}
@media (prefers-reduced-motion: no-preference) {
  .hero::before { animation: cav-respiro 12s ease-in-out infinite; transform-origin: 60% 50%; }
}

/* il cuore dei pulsanti di donazione batte piano anche da fermo */
@keyframes cav-battito {
  0%, 100% { transform: scale(1); }
  8% { transform: scale(1.13); }
  17% { transform: scale(1); }
  26% { transform: scale(1.07); }
  38% { transform: scale(1); }
}
@media (prefers-reduced-motion: no-preference) {
  .hero .btn .i-heart,
  .cta-band--big .btn .i-heart { animation: cav-battito 3.8s var(--ease-out) infinite; }
}
@media (hover: hover) and (pointer: fine) {
  .hero .btn:hover .i-heart,
  .cta-band--big .btn:hover .i-heart { animation: beat 700ms var(--ease-out); }
}
