/* ============================================================
   Gomitolo di mamma · style.css
   "Il tavolo di lavoro di mamma" · Palette "Cesto dei filati"
   Fraunces + Karla + Caveat self-hosted
   ============================================================ */

/* ---------- Font ---------- */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/fraunces-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/fraunces-italic-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Karla';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('fonts/karla-var.woff2') format('woff2');
}
@font-face {
  font-family: 'Caveat';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/caveat-var.woff2') format('woff2');
}

/* ---------- Variabili ---------- */
:root {
  /* il sito è light-only: blocca l'auto-dark di Chrome Android & co. */
  color-scheme: only light;

  --panna: #FBF5EA;
  --bruno: #3F252C;
  --bordeaux: #7C2F42;
  --blu: #2B5AA7;
  --rosa: #F1DBD4;
  --lilla: #E6DAEF;
  --giallo: #F3B942;
  --verde: #55703F;

  /* il filo unico che percorre la pagina: si cambia colore qui */
  --filo: #7C2F42;

  /* legno e carta del tavolo di lavoro */
  --kraft: #E4CFA4;
  --kraft-bordo: #C9AC80;
  --carta: #FFFDF6;

  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --body: 'Karla', 'Trebuchet MS', Verdana, sans-serif;
  --hand: 'Caveat', 'Bradley Hand', cursive;

  --maxw: 68rem;
  --pad: clamp(1.25rem, 4vw, 2.5rem);
}

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

html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--panna);
  color: var(--bruno);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.65;
  /* i fili full-bleed e le card ruotate sbordano di poco: niente scrollbar orizzontale */
  overflow-x: clip;
}

/* Grana fibra su tutta la pagina */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: .045;
  /* feColorMatrix saturate=0: senza, il noise è RGB colorato e Safari iOS lo mostra sgargiante */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1, h2 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.12;
  margin: 0 0 .6em;
}
h1 { font-size: clamp(2.6rem, 7vw, 4.6rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }

p { margin: 0 0 1em; }

input, textarea, button { font: inherit; color: inherit; }
::selection { background: var(--rosa); }

/* i link sono cuciti: sottolineatura a filo, sempre */
a {
  color: var(--bordeaux);
  text-decoration: underline wavy;
  text-decoration-thickness: 1.5px;
  text-decoration-color: rgba(124, 47, 66, .4);
  text-underline-offset: 5px;
  transition: text-decoration-color .25s ease;
}
a:hover { text-decoration-color: var(--bordeaux); }

:focus-visible {
  outline: 3px solid var(--bordeaux);
  outline-offset: 2px;
  border-radius: 4px;
}
footer :focus-visible { outline-color: var(--giallo); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* skip link */
.skip {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 200;
  background: var(--bordeaux);
  color: var(--panna);
  font-weight: 700;
  padding: .7em 1.2em;
  border-radius: 0 0 12px 12px;
  text-decoration: none;
}
.skip:focus-visible { top: 0; }

#storia, #creazioni, #ordina { scroll-margin-top: 88px; }

.wrap {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad);
}

section { position: relative; }

/* ---------- Metro da sarta (in cima alla pagina) ---------- */
.metro {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 7px;
  z-index: 120;
  background-color: var(--giallo);
  background-image:
    repeating-linear-gradient(90deg, rgba(63, 37, 44, .85) 0 2px, transparent 2px 50px),
    repeating-linear-gradient(90deg, rgba(63, 37, 44, .45) 0 1.5px, transparent 1.5px 10px);
  box-shadow: 0 1px 4px rgba(63, 37, 44, .25);
}

/* ---------- Cucitura a zigzag tra le sezioni ---------- */
#zigzag path {
  fill: none;
  stroke: var(--filo);
  stroke-width: 2.2;
  stroke-linecap: round;
}
.zigzag {
  position: absolute;
  top: -7px;
  left: 0;
  width: 100%;
  height: 14px;
  z-index: 2;
  pointer-events: none;
}
/* piega d'ombra sotto la cucitura */
.storia    { box-shadow: inset 0 16px 20px -16px rgba(63, 37, 44, .22); }
.creazioni { box-shadow: inset 0 16px 20px -16px rgba(63, 37, 44, .18); }
.ordina    { box-shadow: inset 0 16px 20px -16px rgba(63, 37, 44, .2); }

/* ---------- Bottoni ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  min-height: 48px;
  padding: .7em 1.5em;
  border-radius: 999px;
  font-family: var(--body);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid var(--bordeaux);
  transition: transform .25s ease, box-shadow .25s ease, background-color .25s ease, color .25s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(63, 37, 44, .18); }

/* i pieni hanno la cucitura interna, gli outline il bordo imbastito */
.btn--pieno {
  background: var(--bordeaux);
  color: var(--panna);
  outline: 1px dashed rgba(251, 245, 234, .55);
  outline-offset: -6px;
}
.btn--pieno:hover { background: #6a2738; }

.btn--outline {
  background: transparent;
  color: var(--bordeaux);
  border: 2px dashed rgba(124, 47, 66, .65);
}
.btn--outline:hover { background: rgba(124, 47, 66, .07); }

.btn--giallo {
  background: var(--giallo);
  color: var(--bruno);
  border-color: var(--giallo);
  outline: 1px dashed rgba(63, 37, 44, .45);
  outline-offset: -6px;
}
.btn--panna {
  background: transparent;
  color: var(--panna);
  border: 2px dashed rgba(251, 245, 234, .7);
}
.btn--panna:hover { background: rgba(251, 245, 234, .12); }

/* il focus ring vince sempre sulla cucitura decorativa */
.btn:focus-visible { outline: 3px solid var(--bordeaux); outline-offset: 2px; }
footer .btn:focus-visible { outline-color: var(--giallo); }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem 1rem;
  margin: 1.6rem 0 1rem;
}

/* ---------- Header ---------- */
header {
  position: fixed;
  top: 7px; /* sotto il metro */
  left: 0;
  right: 0;
  z-index: 100;
}
.testata-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: rgba(251, 245, 234, .92);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: 0 2px 14px rgba(63, 37, 44, .1);
  opacity: 0;
  transition: opacity .3s ease;
}
header.scrolled .testata-bg { opacity: 1; }
/* senza JS: stesso effetto via scroll timeline */
@supports (animation-timeline: scroll()) {
  .testata-bg {
    animation: testataBg linear both;
    animation-timeline: scroll();
    animation-range: 0 120px;
  }
  @keyframes testataBg {
    to { opacity: 1; }
  }
}
header .wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
}
.logotipo {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-height: 44px;
  font-family: var(--display);
  font-weight: 600;
  /* scala fluida: mai a capo, nemmeno sui telefoni stretti */
  font-size: clamp(1rem, 3.4vw, 1.25rem);
  white-space: nowrap;
  color: var(--bruno);
  text-decoration: none;
}
.logo-mark { width: clamp(28px, 8vw, 34px); height: auto; flex: none; }
.logotipo:hover { text-decoration: none; color: var(--bordeaux); }
.testata-cta { display: flex; align-items: center; gap: .55rem; }
header .btn { min-height: 38px; padding: .3em .95em; font-size: .85rem; }
header .btn:hover { box-shadow: 0 6px 14px rgba(63, 37, 44, .18); }
header .btn--pieno { outline-offset: -5px; }
header .btn--outline { border-color: rgba(124, 47, 66, .6); }
header .btn:focus-visible { outline: 3px solid var(--bordeaux); outline-offset: 2px; }
@media (max-width: 480px) {
  header .btn { padding: .3em .7em; font-size: .78rem; }
  .testata-cta { gap: .4rem; }
}

/* ---------- Hero ---------- */
.hero {
  padding: clamp(7rem, 14vh, 9.5rem) 0 clamp(4.5rem, 10vh, 7rem);
  overflow: visible;
}
/* il filo parte dal gomitolo ed esce in basso, verso la storia */
.filo-hero {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: visible;
}
.hero .wrap {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
}
.overline {
  font-family: var(--hand);
  font-weight: 600;
  font-size: 1.6rem;
  color: var(--bordeaux);
  margin: 0 0 .6rem;
  transform: rotate(-1.2deg);
}
.hero h1 { line-height: 1.08; }
.hero h1 em {
  font-style: italic;
  color: var(--bordeaux);
}
.hero h1 span { display: inline-block; }
.hero .sotto {
  font-size: 1.15rem;
  max-width: 34rem;
}
.giu {
  display: inline-block;
  margin-top: .4rem;
  font-family: var(--hand);
  font-weight: 600;
  font-size: 1.35rem;
  padding-block: .55rem;
}

/* Visual hero: polaroid con washi tape + gomitolo che sbuca */
.hero-visual { position: relative; z-index: 1; }
.hero-foto {
  position: relative;
  z-index: 1;
  margin: 0 auto;
  max-width: 380px;
  transform: rotate(2deg);
}
.hero-foto img {
  display: block;
  width: 100%;
  height: auto;
  border: 10px solid var(--carta);
  border-radius: 6px;
  box-shadow: 0 18px 44px rgba(63, 37, 44, .24);
}
.hero-foto figcaption {
  margin-top: .7rem;
  font-family: var(--hand);
  font-weight: 600;
  font-size: 1.35rem;
  color: var(--bordeaux);
  text-align: center;
  transform: rotate(-1deg);
}
.gomitolo-mini {
  position: absolute;
  z-index: 0;
  bottom: -60px;
  left: -70px;
  width: 200px;
  height: auto;
}

/* ---------- Washi tape ---------- */
/* le tape si attaccano alla foto, non al figure: la figcaption resta fuori */
.polaroid { position: relative; display: block; }
.tape {
  position: absolute;
  z-index: 2;
  box-shadow: 0 1px 3px rgba(63, 37, 44, .12);
}
.tape--giallo { background: rgba(243, 185, 66, .5); }
.tape--rosa   { background: rgba(241, 219, 212, .75); }
.tape--lilla  { background: rgba(230, 218, 239, .8); }
.hero-foto .tape--giallo { top: -14px; left: 50%; transform: translateX(-50%) rotate(-4deg); width: 110px; height: 30px; }
.hero-foto .tape--rosa   { bottom: -12px; right: -18px; transform: rotate(38deg); width: 90px; height: 26px; }
.storia-foto .tape--giallo { top: -12px; left: -14px; transform: rotate(-42deg); width: 84px; height: 24px; }
.storia-foto .tape--lilla  { bottom: -10px; right: -12px; transform: rotate(-40deg); width: 74px; height: 22px; }
.biglietto .tape--lilla {
  top: -13px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 96px;
  height: 26px;
  background: rgba(230, 218, 239, .85);
}

/* ---------- Filo di lana (tratto comune) ---------- */
.filo {
  fill: none;
  stroke: var(--filo);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.filo--panna { stroke: var(--rosa); }

/* ---------- Spilli da sarto ---------- */
.spillo {
  position: absolute;
  top: -9px;
  left: 50%;
  z-index: 2;
  width: 22px;
  height: 22px;
  transform: translateX(-50%);
}
.spillo::before {
  content: "";
  position: absolute;
  top: 0;
  left: 5px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--spillo-chiaro), var(--spillo-scuro));
  box-shadow: 0 1px 3px rgba(63, 37, 44, .4);
}
.spillo::after {
  content: "";
  position: absolute;
  top: 10px;
  left: 10px;
  width: 2px;
  height: 13px;
  background: #8a8a92;
  border-radius: 1px;
}
.spillo--bordeaux { --spillo-chiaro: #a34a60; --spillo-scuro: #7C2F42; }
.spillo--blu      { --spillo-chiaro: #4d7fd0; --spillo-scuro: #2B5AA7; }
.spillo--giallo   { --spillo-chiaro: #f7cf74; --spillo-scuro: #F3B942; }

/* ---------- Storia ---------- */
.storia {
  background: var(--rosa);
  padding: clamp(4rem, 9vh, 6.5rem) 0;
}
/* il filo entra dall'hero, corre nel margine sinistro ed esce verso le creazioni */
.filo-storia {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: visible;
}
.storia .wrap {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(150px, .55fr) 1.45fr;
  gap: clamp(1.5rem, 5vw, 4rem);
}
.storia-testo { max-width: 60ch; font-size: 1.0625rem; }
.storia-testo h2 { max-width: none; }

/* nodi-tappa sul filo */
.tappe {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3.4rem;
}
.tappe li {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-family: var(--display);
  font-style: italic;
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--bordeaux);
}
.tappe li:nth-child(1) { transform: rotate(-2deg); }
.tappe li:nth-child(2) { transform: rotate(1.5deg); }
.tappe li:nth-child(3) { transform: rotate(-1deg); }
.nodo { flex: none; }
.nodo path { fill: none; stroke: var(--filo); stroke-width: 2.5; stroke-linecap: round; }
.nodo circle { fill: var(--filo); }

/* foto nella storia: polaroid con washi tape */
.storia-foto {
  position: relative;
  margin: 2.8rem 0 0;
  transform: rotate(-2deg);
}
.storia-foto img {
  display: block;
  width: 100%;
  height: auto;
  border: 9px solid var(--carta);
  border-radius: 4px;
  box-shadow: 0 12px 30px rgba(63, 37, 44, .18);
}
.storia-foto figcaption {
  margin-top: .9rem;
  font-family: var(--hand);
  font-weight: 600;
  font-size: 1.35rem;
  color: var(--bordeaux);
  text-align: center;
}

/* citazione dentro il telaio da ricamo */
.telaio {
  margin: 2.8rem auto 0;
  max-width: 290px;
  transform: rotate(2deg);
}
.telaio-anello {
  position: relative;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 10px solid #C9A26B;
  background: var(--carta);
  box-shadow:
    0 12px 26px rgba(63, 37, 44, .18),
    inset 0 0 0 2.5px #B8905A,
    inset 0 4px 12px rgba(63, 37, 44, .08);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.6rem;
}
.telaio-vite {
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 18px;
  border-radius: 3px;
  background: linear-gradient(180deg, #D9B98C, #B8905A);
  box-shadow: 0 2px 4px rgba(63, 37, 44, .25);
}
.telaio-barra {
  position: absolute;
  top: -25px;
  left: 50%;
  transform: translateX(-50%);
  width: 46px;
  height: 7px;
  border-radius: 4px;
  background: linear-gradient(180deg, #E0C08E, #B8905A);
  box-shadow: 0 2px 3px rgba(63, 37, 44, .3);
}
.telaio-tessuto {
  position: absolute;
  inset: 4px;
  width: calc(100% - 8px);
  height: calc(100% - 8px);
  border-radius: 50%;
  overflow: hidden;
  opacity: .5;
}
.pull-quote {
  position: relative;
  font-family: var(--display);
  font-style: italic;
  font-weight: 600;
  font-size: 1.04rem;
  line-height: 1.42;
  color: var(--bordeaux);
  text-align: center;
  text-wrap: pretty;
  border: 0;
  margin: 0;
  padding: 0 .4rem;
}
.telaio-nota {
  font-family: var(--hand);
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--bordeaux);
  text-align: center;
  margin: 1rem 0 0;
}

/* ---------- Creazioni ---------- */
.creazioni {
  background: var(--panna);
  padding: clamp(4rem, 9vh, 6.5rem) 0;
  overflow: hidden;
}
.creazioni .wrap { position: relative; z-index: 1; }
.creazioni .intro { max-width: 44rem; }
.appunto {
  font-family: var(--hand);
  font-weight: 600;
  font-size: 1.45rem;
  color: var(--bordeaux);
  margin: .2rem 0 0;
  transform: rotate(-.8deg);
}

/* due file da tre, appese a un filo da bucato */
.fila {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.2rem, 3vw, 2rem);
  align-items: start;
  padding-top: 46px;
}
.fila--1 { margin-top: 2.2rem; }
.fila--2 { margin-top: 3rem; }
.filo-bucato {
  position: absolute;
  top: 0;
  left: -5%;
  width: 110%;
  height: 64px;
  pointer-events: none;
  overflow: visible;
}

/* Cartellino kraft appeso con la molletta */
.card {
  position: relative;
  display: block;
  color: var(--bruno);
  text-decoration: none;
}
.card:hover, .card:focus-visible { text-decoration: none; }
.card:focus-visible { outline: 3px solid var(--bordeaux); outline-offset: 6px; }
.card-corpo {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  background: var(--kraft);
  border: 1px solid var(--kraft-bordo);
  border-radius: 7px;
  padding: 1.15rem 1.1rem 1.05rem;
  box-shadow: 0 12px 26px rgba(63, 37, 44, .16);
  transform-origin: top center;
  transition: box-shadow .3s ease;
}
.card:hover .card-corpo, .card:focus-visible .card-corpo {
  box-shadow: 0 18px 34px rgba(63, 37, 44, .22);
}
.molletta {
  position: absolute;
  top: -30px;
  left: 50%;
  z-index: 3;
  width: 15px;
  height: 38px;
  background: linear-gradient(180deg, #D9B98C, #C9A26B);
  border-radius: 4px 4px 6px 6px;
  box-shadow: 0 2px 5px rgba(63, 37, 44, .28);
  transform: translateX(-50%);
}
.molletta::after {
  content: "";
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 2.5px;
  height: 14px;
  background: rgba(63, 37, 44, .5);
}

/* sfalsamenti e rotazioni, come stese a mano */
.fila--1 .card:nth-of-type(1) { margin-top: 10px; transform: rotate(-1.6deg); }
.fila--1 .card:nth-of-type(2) { margin-top: 26px; transform: rotate(1.2deg); }
.fila--1 .card:nth-of-type(3) { margin-top: 8px;  transform: rotate(-.8deg); }
.fila--2 .card:nth-of-type(1) { margin-top: 22px; transform: rotate(1.4deg); }
.fila--2 .card:nth-of-type(2) { margin-top: 6px;  transform: rotate(-1.2deg); }
.fila--2 .card:nth-of-type(3) { margin-top: 18px; transform: rotate(.9deg); }
.fila--1 .card:nth-of-type(1) .molletta { transform: translateX(-50%) rotate(2deg); }
.fila--1 .card:nth-of-type(2) .molletta { transform: translateX(-50%) rotate(-3deg); }
.fila--1 .card:nth-of-type(3) .molletta { transform: translateX(-50%) rotate(4deg); }
.fila--2 .card:nth-of-type(1) .molletta { transform: translateX(-50%) rotate(-2deg); }
.fila--2 .card:nth-of-type(2) .molletta { transform: translateX(-50%) rotate(3deg); }
.fila--2 .card:nth-of-type(3) .molletta { transform: translateX(-50%) rotate(-4deg); }

.card figure { margin: 0; }
.card figure img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 6px solid var(--carta);
  border-radius: 6px;
}

.card h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.35rem;
  margin: .2rem 0 0;
}
.card p { margin: 0; font-size: .95rem; }
.card-link {
  margin-top: auto;
  padding-top: .6rem;
  font-weight: 700;
  color: var(--bordeaux);
  text-decoration: underline wavy;
  text-decoration-thickness: 1.5px;
  text-decoration-color: rgba(124, 47, 66, .4);
  text-underline-offset: 5px;
  transition: text-decoration-color .25s ease;
}
.card:hover .card-link, .card:focus-visible .card-link { text-decoration-color: var(--bordeaux); }

/* passerella: tre scatti spillati come al muro */
.passerella {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1rem, 2.5vw, 1.8rem);
  margin-top: 4rem;
}
.passerella figure { position: relative; margin: 0; }
.passerella figure:nth-child(1) { transform: rotate(-1.2deg); }
.passerella figure:nth-child(2) { transform: rotate(1deg) translateY(10px); }
.passerella figure:nth-child(3) { transform: rotate(-.8deg) translateY(4px); }
.passerella figure:nth-child(1) .spillo { transform: translateX(-50%) rotate(-14deg); }
.passerella figure:nth-child(2) .spillo { transform: translateX(-50%) rotate(10deg); }
.passerella figure:nth-child(3) .spillo { transform: translateX(-50%) rotate(-8deg); }
.passerella img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border: 8px solid var(--carta);
  border-radius: 5px;
  box-shadow: 0 10px 26px rgba(63, 37, 44, .16);
}
/* la borsa rossa sta nella metà destra dello scatto: centra il crop su di lei */
.passerella figure:first-child img { object-position: 68% center; }
.passerella figcaption {
  margin-top: .7rem;
  font-family: var(--hand);
  font-weight: 600;
  font-size: 1.35rem;
  color: var(--bordeaux);
  text-align: center;
}

.creazioni .chiusura { text-align: center; margin-top: 3rem; position: relative; z-index: 1; }

/* ---------- Come portarne una a casa ---------- */
.ordina {
  background: var(--lilla);
  padding: clamp(4rem, 9vh, 6.5rem) 0;
}
.ordina .intro { max-width: 44rem; }

/* i tre passi: bottoni da cucito su un filo, la sequenza la dà il filo */
.passi-wrap { position: relative; margin-top: 2.6rem; }
.filo-passi {
  position: absolute;
  top: 6px;
  left: 0;
  width: 100%;
  height: 27px;
  pointer-events: none;
}
.passi {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin: 0;
  padding: 0;
}
.passi h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.35rem;
  margin: 0 0 .3rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .55rem;
}
.passi h3::before {
  content: "";
  position: relative;
  z-index: 1;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 36%, var(--bruno) 3px, transparent 3.5px),
    radial-gradient(circle at 66% 36%, var(--bruno) 3px, transparent 3.5px),
    radial-gradient(circle at 34% 66%, var(--bruno) 3px, transparent 3.5px),
    radial-gradient(circle at 66% 66%, var(--bruno) 3px, transparent 3.5px),
    var(--giallo);
  box-shadow: inset 0 0 0 4px rgba(63, 37, 44, .25), 0 3px 8px rgba(63, 37, 44, .2);
}
.passi p { margin: 0; font-size: .98rem; }

/* Le due porte */
.porte {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.2rem, 3vw, 2rem);
  margin-top: 3rem;
  align-items: start;
}
.porta {
  background: var(--panna);
  border-radius: 14px;
  border: 2px dashed rgba(124, 47, 66, .45);
  padding: 1.6rem 1.6rem 1.8rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.porta h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.5rem;
  margin: 0;
}
.porta .btn { align-self: flex-start; margin-top: .4rem; }
.fiducia { font-size: .88rem; opacity: .85; margin: .4rem 0 0; }
.fascia { font-size: .88rem; opacity: .85; margin: 0; }

/* la porta Vinted è un pacchetto legato con lo spago */
.porta--pacchetto {
  border: 0;
  padding: 0;
  gap: 0;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(63, 37, 44, .14);
}
.pacchetto-fascia {
  position: relative;
  flex: none;
  height: 86px;
  background: var(--kraft);
  border-bottom: 1px solid var(--kraft-bordo);
}
.spago--orizzontale {
  position: absolute;
  left: 0;
  right: 0;
  top: 38px;
  height: 3px;
  background: var(--filo);
  box-shadow: 0 6px 0 -1px rgba(124, 47, 66, .4);
}
.spago--verticale {
  position: absolute;
  left: 64px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--filo);
  box-shadow: 6px 0 0 -1px rgba(124, 47, 66, .4);
}
.fiocco {
  position: absolute;
  left: 56px;
  top: 30px;
  width: 20px;
  height: 20px;
  border: 3px solid var(--filo);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
}
.francobollo {
  position: absolute;
  right: 14px;
  top: 12px;
  width: 58px;
  height: 62px;
  background: var(--carta);
  border: 2px dashed rgba(124, 47, 66, .5);
  border-radius: 3px;
  transform: rotate(3deg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(63, 37, 44, .15);
}
.porta-corpo {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  padding: 1.6rem 1.6rem 1.8rem;
}

/* ---------- Form "Un biglietto per mamma" ---------- */
.biglietto {
  position: relative;
  margin-top: .8rem;
  background: var(--carta);
  background-image: repeating-linear-gradient(180deg, transparent 0 35px, rgba(124, 47, 66, .13) 35px 36px);
  border: 1px solid rgba(63, 37, 44, .14);
  border-radius: 4px;
  box-shadow: 0 8px 22px rgba(63, 37, 44, .12);
  padding: 1.5rem 1.4rem 1.4rem;
  transform: rotate(-.7deg);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.biglietto[hidden] { display: none; }
.biglietto-titolo {
  font-family: var(--hand);
  font-weight: 600;
  font-size: 1.6rem;
  color: var(--bordeaux);
  margin: 0;
  transform: rotate(-.5deg);
}
.campo label {
  display: block;
  font-weight: 700;
  font-size: .85rem;
  letter-spacing: .02em;
  margin-bottom: 2px;
}
.campo .facoltativo { font-weight: 400; opacity: .7; }
.campo input, .campo textarea {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 2px dashed rgba(124, 47, 66, .45);
  border-radius: 0;
  padding: .35em 2px;
}
.campo textarea { resize: vertical; line-height: 1.5; }
.campo input:focus-visible, .campo textarea:focus-visible {
  outline: none;
  border-bottom: 2px solid var(--bordeaux);
}
.biglietto-foto {
  position: relative;
  border: 2px dashed rgba(124, 47, 66, .4);
  border-radius: 8px;
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  background: rgba(241, 219, 212, .35);
}
.spillo--mini { top: -7px; left: 18px; width: 18px; height: 20px; transform: none; }
.spillo--mini::before { width: 10px; height: 10px; left: 3px; }
.spillo--mini::after { top: 8px; left: 7px; height: 11px; }
.biglietto-foto-testo {
  font-family: var(--hand);
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--bordeaux);
  cursor: pointer;
  overflow-wrap: anywhere; /* i nomi file lunghi non sfondano il box */
  text-align: center;
  padding-inline: .6rem;
}
/* il focus del file input (sr-only) si vede sul box */
.biglietto-foto:focus-within { outline: 3px solid var(--bordeaux); outline-offset: 2px; border-radius: 8px; }
.biglietto-azioni {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .8rem 1rem;
  margin-top: .2rem;
}
.biglietto-nota { font-size: .8rem; opacity: .7; }
.direct-link { font-size: .95rem; margin-top: .6rem; }
.direct-link[hidden] { display: none; }

/* stato inviato: il biglietto si chiude con un cuore di filo */
.biglietto-fatto {
  margin-top: .8rem;
  background: var(--carta);
  border: 1px solid rgba(63, 37, 44, .14);
  border-radius: 4px;
  box-shadow: 0 8px 22px rgba(63, 37, 44, .12);
  padding: 2rem 1.4rem;
  transform: rotate(-.7deg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .6rem;
  text-align: center;
}
.biglietto-fatto[hidden] { display: none; }
.biglietto-fatto:focus { outline: none; }
.cuore-biglietto { width: 72px; height: auto; }
.biglietto-grazie {
  font-family: var(--hand);
  font-weight: 600;
  font-size: 1.7rem;
  color: var(--bordeaux);
  margin: 0;
}
.biglietto-poi { font-size: .95rem; margin: 0; opacity: .85; }
.biglietto-ancora {
  background: none;
  border: 0;
  padding: .4em;
  cursor: pointer;
  font-weight: 700;
  color: var(--bordeaux);
  text-decoration: underline wavy;
  text-decoration-thickness: 1.5px;
  text-decoration-color: rgba(124, 47, 66, .4);
  text-underline-offset: 5px;
  transition: text-decoration-color .25s ease;
}
.biglietto-ancora:hover { text-decoration-color: var(--bordeaux); }

/* striscia filati: mini-gomitoli */
.filati-label { font-weight: 700; margin: .8rem 0 .3rem; }
.filati {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem .9rem;
  margin: 0;
  padding: 0;
  font-size: .88rem;
}
.filati li { display: flex; align-items: center; gap: .4rem; }
.gomitolino { flex: none; }

/* ---------- Footer ---------- */
footer {
  position: relative;
  background: var(--bruno);
  color: var(--panna);
  padding: clamp(4rem, 9vh, 6rem) 0 2.5rem;
  text-align: center;
}
footer a { color: var(--panna); text-decoration-color: rgba(251, 245, 234, .5); }
footer a:hover { text-decoration-color: var(--giallo); }
.cuore-filo { margin: 0 auto 1rem; }
.cuore-filo svg {
  display: block;
  margin-inline: auto;
  width: 120px;
  height: auto;
  overflow: visible; /* il filo arriva da fuori, in alto */
}
.dedica {
  font-family: var(--display);
  font-style: italic;
  font-weight: 600;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  color: var(--rosa);
  margin: 0 auto 2rem;
  max-width: 24ch;
  line-height: 1.35;
}
footer .cta-row { justify-content: center; }
.su-misura-link { display: inline-block; margin-top: .8rem; font-weight: 700; padding-block: .55rem; }
.micro { margin: 2.2rem 0 .2rem; font-size: .95rem; opacity: .9; }
.micro2 { margin: 0; font-size: .95rem; opacity: .9; }
.firma { margin-top: 2.2rem; font-size: .85rem; opacity: .65; }

/* ---------- Motion ---------- */
/* nota: i path che si disegnano usano pathLength="1" SENZA vector-effect:
   Chrome con non-scaling-stroke calcola i dash in pixel schermo e il
   tratto unico diventa un tratteggio; i viewBox sono proporzionati al
   render reale così lo stroke non si deforma troppo */
@media (prefers-reduced-motion: no-preference) {

  /* load hero */
  .fade-up {
    opacity: 0;
    animation: fadeUp .65s cubic-bezier(.22, .8, .36, 1) forwards;
  }
  .d1 { animation-delay: .05s; }
  .d2 { animation-delay: .17s; }
  .d3 { animation-delay: .29s; }
  .d4 { animation-delay: .45s; }
  .d5 { animation-delay: .6s; }

  .hero-visual {
    animation: settle .7s cubic-bezier(.34, 1.56, .64, 1) both;
    animation-delay: .15s;
  }

  .hero-visual:hover .gomitolo-mini { transition: transform .5s ease; transform: rotate(8deg); }

  /* il filo dell'hero si disegna al load */
  .filo-hero .filo {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: draw 1.6s ease .9s both;
  }

  /* il cuore del biglietto si disegna quando compare lo stato inviato */
  .cuore-biglietto .filo {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: draw 1.4s ease .1s both;
  }

  /* i cartellini appesi dondolano piano */
  .card-corpo { animation: dondola 4.2s ease-in-out infinite alternate; }
  .fila--1 .card:nth-of-type(1) .card-corpo { animation-duration: 4.2s; animation-delay: -1s; }
  .fila--1 .card:nth-of-type(2) .card-corpo { animation-duration: 4.8s; animation-delay: -2.2s; }
  .fila--1 .card:nth-of-type(3) .card-corpo { animation-duration: 4.5s; animation-delay: -.6s; }
  .fila--2 .card:nth-of-type(1) .card-corpo { animation-duration: 5s;   animation-delay: -1.8s; }
  .fila--2 .card:nth-of-type(2) .card-corpo { animation-duration: 4.4s; animation-delay: -3s; }
  .fila--2 .card:nth-of-type(3) .card-corpo { animation-duration: 4.7s; animation-delay: -1.4s; }

  /* scroll: reveal + filo che si disegna (solo se supportato) */
  @supports (animation-timeline: view()) {
    .reveal {
      animation: fadeUp .8s linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 40%;
    }
    .draw .filo {
      stroke-dasharray: 1;
      stroke-dashoffset: 1;
      animation: draw linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 60%;
    }
    .filo-storia .filo { animation-range: entry 0% cover 70%; }
    .filo-bucato .filo, .filo-passi .filo { animation-range: entry 0% entry 90%; }
    /* il cuore si cuce arrivando a fondo pagina: il footer è l'ultimo elemento,
       range più alti non si raggiungono mai */
    @supports (view-timeline: --cuore) {
      footer { view-timeline: --cuore; }
      .draw--cuore .filo {
        animation-timeline: --cuore;
        animation-range: entry 0% entry 15%;
      }
    }
  }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes settle {
  from { opacity: 0; transform: rotate(-24deg) scale(.92); }
  to   { opacity: 1; transform: rotate(0) scale(1); }
}
@keyframes draw {
  to { stroke-dashoffset: 0; }
}
@keyframes dondola {
  from { transform: rotate(-1.3deg); }
  to   { transform: rotate(1.2deg); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition-duration: .01ms !important;
  }
}

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
  /* niente margini liberi: il filo full-bleed della storia taglierebbe i contenuti */
  .filo-storia { display: none; }
  /* file appese in colonna: molletta e dondolio restano, il filo no */
  .fila { grid-template-columns: 1fr; padding-top: 0; }
  .filo-bucato { display: none; }
  .fila .card { margin-top: 34px !important; }
  .passi { grid-template-columns: 1fr; gap: 1.2rem; }
  .filo-passi { display: none; } /* passi in colonna: il filo orizzontale non ha più senso */
  .passi h3 { flex-direction: row; align-items: center; gap: .6rem; }
  .porte { grid-template-columns: 1fr; }
  .passerella { grid-template-columns: 1fr; max-width: 26rem; margin-inline: auto; }
  /* in colonna niente translateY: solo la rotazione */
  .passerella figure:nth-child(2) { transform: rotate(1deg); }
  .passerella figure:nth-child(3) { transform: rotate(-.8deg); }
}

@media (max-width: 640px) {
  .hero { padding-top: 6.5rem; }
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
  .hero-foto { max-width: min(72%, 300px); }
  /* a colonna singola il filo attraverserebbe titolo e testo */
  .filo-hero { display: none; }
  /* il gomitolo sbuca dietro la foto senza coprire la didascalia */
  .gomitolo-mini { width: 130px; bottom: 2.8rem; left: -10px; }

  .storia .wrap { grid-template-columns: 1fr; }
  .tappe { display: none; } /* su mobile la storia parla da sola */
  .storia-aside { max-width: 22rem; }

  .fila .card { transform: none !important; }
}
