/* Cuori di Carta — foglio di stile unico */

@font-face { font-family: "Gilda Display"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/gilda-display-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Gilda Display"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/gilda-display-400-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+20A0-20AB, U+20AD-20C4, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Pinyon Script"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/pinyon-script-400-latin.woff2") format("woff2"); }
@font-face { font-family: "Mulish"; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url("../fonts/mulish-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Mulish"; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url("../fonts/mulish-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+20A0-20AB, U+20AD-20C4, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --carta: #f8f2ea;        /* off-white caldo, fondo */
  --carta-chiara: #fdfaf5; /* fogli e cornici */
  --cipria: #f0dcd6;       /* rosa cipria, campiture */
  --rosa: #c9939a;         /* rosa antico */
  --rosa-scuro: #995a62;   /* rosa antico profondo: pulsanti, link */
  --rosa-notte: #7d434b;   /* hover pulsanti */
  --salvia: #c9d3c1;       /* verde salvia pastello */
  --salvia-scuro: #5f6f58;
  --inchiostro: #4a3836;   /* testo */
  --tenue: #75605d;        /* testo secondario */
  --filo: #dcc9c1;         /* filetti */
  --ombra: 74 56 54;

  --f-titoli: "Gilda Display", "Didot", Georgia, serif;
  --f-corsivo: "Pinyon Script", "Snell Roundhand", cursive;
  --f-testo: "Mulish", system-ui, sans-serif;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --wrap: 1160px;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --sp-1: .5rem; --sp-2: 1rem; --sp-3: 1.5rem; --sp-4: 2.5rem; --sp-5: 4rem; --sp-6: clamp(4.5rem, 9vw, 7.5rem);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scrollbar-color: var(--rosa) var(--carta); }
body {
  margin: 0;
  background: var(--carta);
  color: var(--inchiostro);
  font: 400 1.0625rem/1.65 var(--f-testo);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  caret-color: var(--rosa-scuro);
}
::selection { background: var(--cipria); color: var(--rosa-notte); }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--rosa-scuro); text-decoration-thickness: 1px; text-underline-offset: .22em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--rosa-scuro); outline-offset: 3px; border-radius: 2px; }
button, a { touch-action: manipulation; }

h1, h2, h3 { font-family: var(--f-titoli); font-weight: 400; line-height: 1.12; letter-spacing: -0.01em; margin: 0; text-wrap: balance; color: var(--inchiostro); }
h1 { font-size: clamp(2.4rem, 5.2vw, 4.1rem); }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.75rem); }
h3 { font-size: 1.4rem; }
p { margin: 0; text-wrap: pretty; }
.lead { font-size: 1.15rem; color: var(--tenue); max-width: 34em; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.skip { position: absolute; left: 1rem; top: -4rem; background: var(--rosa-scuro); color: #fff; padding: .6rem 1rem; z-index: 10; border-radius: 4px; }
.skip:focus { top: 1rem; }

/* ---------- Testata ---------- */
.testata { padding: calc(var(--sp-4) + env(safe-area-inset-top)) 0 var(--sp-3); text-align: center; }
.logo { display: inline-flex; flex-direction: column; align-items: center; text-decoration: none; color: var(--inchiostro); }
.logo .nome { font-family: var(--f-corsivo); font-size: clamp(2.6rem, 6vw, 3.5rem); line-height: 1; color: var(--rosa-scuro); }
.logo .sotto { font-family: var(--f-titoli); font-size: .82rem; letter-spacing: .22em; text-transform: uppercase; color: var(--tenue); margin-top: .35rem; }
.logo svg { width: 22px; height: 22px; color: var(--rosa); margin-bottom: .25rem; }

.menu { margin-top: var(--sp-3); }
.menu ul { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem clamp(.5rem, 2.5vw, 2rem); margin: 0; padding: 0; }
.menu a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 .4rem;
  font-family: var(--f-titoli); font-size: 1.02rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--inchiostro); text-decoration: none; position: relative;
}
.menu a::after {
  content: ""; position: absolute; left: .4rem; right: .4rem; bottom: 9px; height: 1px; background: var(--rosa-scuro);
  transform: scaleX(0); transform-origin: left; transition: transform .25s var(--ease-out);
}
.menu a[aria-current="page"] { color: var(--rosa-scuro); }
.menu a[aria-current="page"]::after { transform: scaleX(1); }
@media (hover: hover) and (pointer: fine) { .menu a:hover::after { transform: scaleX(1); } }
.filetto { border: 0; height: 5px; margin: var(--sp-3) auto 0; width: min(100% - 2 * var(--gutter), var(--wrap));
  border-top: 1px solid var(--filo); border-bottom: 1px solid var(--filo); }

/* ---------- Pulsanti ---------- */
.azioni { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: var(--sp-4); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 48px; padding: .7rem 1.5rem; border-radius: 999px;
  font: 600 .95rem/1 var(--f-testo); letter-spacing: .04em; text-decoration: none; cursor: pointer;
  border: 1px solid var(--rosa-scuro);
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .12s var(--ease-out);
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primario { background: var(--rosa-scuro); color: #fff; }
.btn-secondario { background: transparent; color: var(--rosa-scuro); }
@media (hover: hover) and (pointer: fine) {
  .btn-primario:hover { background: var(--rosa-notte); border-color: var(--rosa-notte); color: #fff; }
  .btn-secondario:hover { background: var(--cipria); color: var(--rosa-notte); }
}
.btn:active { transform: scale(.97); }
.btn[aria-disabled="true"] { background: var(--carta); color: var(--tenue); border-color: var(--filo); cursor: default; }

/* ---------- Foto con washi tape ---------- */
.foto {
  position: relative; margin: 0; background: var(--carta-chiara); padding: 10px 10px 12px;
  box-shadow: 0 1px 2px rgb(var(--ombra) / .10), 0 10px 28px -12px rgb(var(--ombra) / .35);
  transition: transform .3s var(--ease-out), box-shadow .3s var(--ease-out);
}
.foto .cornice { overflow: hidden; background: var(--cipria); }
.foto img { width: 100%; aspect-ratio: var(--ratio, 4 / 5); object-fit: cover; filter: saturate(.78) contrast(.96);
  transition: transform .5s var(--ease-out); }
.foto::before {
  content: ""; position: absolute; z-index: 2; top: -12px; left: 50%; width: 92px; height: 26px;
  translate: -50% 0; rotate: var(--nastro, -4deg);
  background: rgb(214 160 166 / .62);
  background-image: repeating-linear-gradient(90deg, rgb(255 255 255 / .22) 0 6px, transparent 6px 12px);
  clip-path: polygon(3% 0, 97% 4%, 100% 100%, 0 96%);
}
.foto.salvia::before { background-color: rgb(165 183 156 / .65); }

/* ---------- Bordo smerlato (centrino) ---------- */
.smerlo-su { --r: 14px; padding-top: var(--r);
  mask: radial-gradient(var(--r) at 50% var(--r), #000 calc(100% - .5px), transparent) 50% 0 / calc(2 * var(--r)) calc(2 * var(--r)) repeat-x,
        linear-gradient(#000 0 0) 0 calc(var(--r) * 1) / 100% 100% no-repeat; }
.smerlo-giu { --r: 14px; padding-bottom: var(--r);
  mask: radial-gradient(var(--r) at 50% calc(100% - var(--r)), #000 calc(100% - .5px), transparent) 50% 100% / calc(2 * var(--r)) calc(2 * var(--r)) repeat-x,
        linear-gradient(#000 0 0) 0 calc(var(--r) * -1) / 100% 100% no-repeat; }

/* ---------- Sezioni ---------- */
.sezione { padding-block: var(--sp-6); }
.sezione-testa { display: grid; gap: var(--sp-2); margin-bottom: var(--sp-5); max-width: 40rem; }
.sezione-testa.centro { text-align: center; margin-inline: auto; justify-items: center; }
.campo-cipria { background: var(--cipria); }
.campo-salvia { background: var(--salvia); }
.campo-chiaro { background: var(--carta-chiara); }

/* Hero */
.hero { padding-block: var(--sp-5) var(--sp-6); }
.hero .wrap { display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: clamp(2rem, 6vw, 5rem); }
.hero h1 { max-width: 11em; }
.hero .lead { margin-top: var(--sp-3); }
.hero-figura { position: relative; justify-self: center; width: min(100%, 480px); padding: 13% 12%; }
.centrino { position: absolute; inset: -4%; background: url("../img/centrino.svg") center / contain no-repeat; }
.hero-figura .foto { --nastro: -6deg; rotate: -2.5deg; }
.hero-figura .foto img { --ratio: 4 / 5; }

/* Vetrina (anteprima negozio) */
.vetrina { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
.pezzo { display: grid; gap: var(--sp-2); }
.pezzo:nth-child(2) { margin-top: var(--sp-4); }
.pezzo:nth-child(3) .foto { --nastro: 5deg; }
.pezzo:nth-child(1) .foto { rotate: -1deg; }
.pezzo:nth-child(3) .foto { rotate: 1.2deg; }
.pezzo h3, .pezzo h2 { margin-top: var(--sp-1); font-size: 1.4rem; }
.pezzo .descr { color: var(--tenue); font-size: .98rem; }
.pezzo .riga { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: .25rem; }
.prezzo { font-family: var(--f-titoli); font-size: 1.35rem; color: var(--inchiostro); font-variant-numeric: tabular-nums lining-nums; }
.etichetta { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--salvia-scuro); font-weight: 700; }
@media (hover: hover) and (pointer: fine) {
  a.foto:hover, .pezzo:hover .foto { transform: translateY(-2px); box-shadow: 0 1px 2px rgb(var(--ombra) / .10), 0 16px 34px -14px rgb(var(--ombra) / .42); }
  a.foto:hover img, .pezzo:hover .foto img { transform: scale(1.03); }
}
.sotto-sezione { margin-top: var(--sp-5); text-align: center; }

/* Su misura */
.misura .wrap { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.misura ul { list-style: none; padding: 0; margin: var(--sp-3) 0 0; display: grid; gap: .1rem; }
.misura li { font-family: var(--f-titoli); font-size: clamp(1.3rem, 2.4vw, 1.7rem); padding: .6rem 0; border-bottom: 1px solid rgb(95 111 88 / .35); display: flex; align-items: baseline; gap: .9rem; }
.misura li svg { width: 16px; height: 16px; color: var(--salvia-scuro); flex: none; translate: 0 2px; }
.misura .foto { rotate: 1.5deg; --nastro: 3deg; }
.misura .foto img { --ratio: 5 / 4; }

/* Chi c'è dietro */
.mani .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.mani .foto { rotate: -1.5deg; max-width: 460px; }
.mani .foto img { --ratio: 4 / 5; }
.mani p + p { margin-top: var(--sp-2); }
.citazione { font-family: var(--f-titoli); font-size: clamp(1.5rem, 2.8vw, 2rem); line-height: 1.3; color: var(--rosa-scuro); margin: var(--sp-3) 0; }

/* Galleria creazioni */
.galleria { columns: 3 280px; column-gap: clamp(1.5rem, 3.5vw, 2.75rem); }
.galleria .opera { break-inside: avoid; margin-bottom: clamp(2rem, 4vw, 3.25rem); scroll-margin-top: 2rem; }
.galleria .opera:nth-child(3n+1) .foto { rotate: -1deg; }
.galleria .opera:nth-child(3n+2) .foto { rotate: .8deg; --nastro: 4deg; }
.galleria .opera:nth-child(3n) .foto { rotate: -.4deg; --nastro: -2deg; }
.galleria h2 { font-size: 1.4rem; margin-top: var(--sp-2); }
.galleria .opera p { color: var(--tenue); font-size: .97rem; margin-top: .3rem; }
.galleria .opera:target .foto { box-shadow: 0 0 0 2px var(--rosa), 0 16px 34px -14px rgb(var(--ombra) / .42); }

/* Negozio */
.negozio-griglia { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: clamp(2.5rem, 5vw, 4rem) clamp(1.5rem, 3.5vw, 3rem); }
.negozio-griglia .pezzo:nth-child(2) { margin-top: 0; }
.info-acquisto { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); margin-top: var(--sp-6); padding-top: var(--sp-4); border-top: 1px solid var(--filo); }
.info-acquisto h2 { font-size: 1.2rem; display: flex; align-items: center; gap: .6rem; }
.info-acquisto svg { width: 20px; height: 20px; color: var(--rosa-scuro); }
.info-acquisto p { color: var(--tenue); font-size: .97rem; margin-top: .4rem; }

/* Contatti */
.contatti-griglia { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.canale { display: grid; gap: .3rem; padding: var(--sp-3) 0; border-bottom: 1px solid var(--filo); }
.canale:first-child { border-top: 1px solid var(--filo); }
.canale .tipo { font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; color: var(--tenue); font-weight: 700; }
.canale a { font-family: var(--f-titoli); font-size: clamp(1.3rem, 2.6vw, 1.75rem); text-decoration: none; overflow-wrap: anywhere; }
.canale a:hover { text-decoration: underline; }

/* Pagine interne: intestazione */
.intro { padding-block: var(--sp-5) var(--sp-4); text-align: center; }
.intro .lead { margin: var(--sp-2) auto 0; }

/* Segnaposto da completare (solo prototipo) */
.da-completare { text-decoration: underline dotted var(--rosa); text-decoration-thickness: 2px; text-underline-offset: .28em; }

/* ---------- Piede ---------- */
.piede { margin-top: 0; background: var(--carta-chiara); padding: var(--sp-5) 0 calc(var(--sp-4) + env(safe-area-inset-bottom)); }
.piede .wrap { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: var(--sp-4); }
.piede .nome { font-family: var(--f-corsivo); font-size: 2.3rem; color: var(--rosa-scuro); line-height: 1; }
.piede p { color: var(--tenue); font-size: .95rem; margin-top: .6rem; }
.piede h2 { font-size: .8rem; font-family: var(--f-testo); font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--tenue); }
.piede ul { list-style: none; margin: .6rem 0 0; padding: 0; }
.piede li a { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; color: var(--inchiostro); text-decoration: none; }
.piede li a svg { width: 18px; height: 18px; color: var(--rosa-scuro); }
.piede li a:hover { color: var(--rosa-scuro); }
.crediti { grid-column: 1 / -1; border-top: 1px solid var(--filo); padding-top: var(--sp-3); font-size: .8rem !important; }
.crediti a { color: var(--tenue); }

/* ---------- Entrata della home (una volta, al caricamento) ---------- */
@keyframes posa { from { opacity: 0; transform: translateY(14px) rotate(-5deg); } }
@keyframes sali { from { opacity: 0; transform: translateY(10px); } }
@keyframes appari { from { opacity: 0; } }
.entra .hero h1 { animation: sali .7s var(--ease-out) both; }
.entra .hero .lead { animation: sali .6s var(--ease-out) .09s both; }
.entra .hero .azioni { animation: sali .6s var(--ease-out) .16s both; }
.entra .hero .centrino { animation: appari .8s var(--ease-out) both; }
.entra .hero-figura .foto { animation: posa .8s var(--ease-out) .12s both; }
@media (prefers-reduced-motion: reduce) {
  .entra .hero h1, .entra .hero .lead, .entra .hero .azioni, .entra .hero-figura .foto { animation: appari .3s ease both; }
  .foto, .foto img, .btn, .menu a::after { transition-duration: .01ms; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero .wrap, .misura .wrap, .mani .wrap, .contatti-griglia { grid-template-columns: 1fr; }
  .hero { text-align: left; padding-top: var(--sp-3); }
  .hero-figura { width: min(88%, 400px); }
  .vetrina { grid-template-columns: 1fr 1fr; }
  .vetrina .pezzo:nth-child(3) { display: none; }
  .pezzo:nth-child(2) { margin-top: 0; }
  .misura .foto { order: -1; max-width: 520px; }
  .mani .foto { justify-self: center; }
  .info-acquisto { grid-template-columns: 1fr; gap: var(--sp-3); }
  .piede .wrap { grid-template-columns: 1fr 1fr; }
  .piede .wrap > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  body { font-size: 1rem; }
  .vetrina { grid-template-columns: 1fr; }
  .vetrina .pezzo:nth-child(3) { display: grid; }
  .azioni .btn { flex: 1 1 100%; }
  .menu ul { gap: 0 .35rem; max-width: 21rem; margin-inline: auto; }
  .menu a { font-size: .9rem; letter-spacing: .08em; }
  .piede .wrap { grid-template-columns: 1fr; }
}
.galleria .opera { display: inline-block; width: 100%; padding-top: 14px; }
.campo-cipria .citazione { color: var(--rosa-notte); }
.campo-cipria .btn-secondario { color: var(--rosa-notte); border-color: var(--rosa-notte); }
.btn-primario:hover, .btn-primario:focus-visible { color: #fff; }
.skip:hover, .skip:focus { color: #fff; }

/* Filtri galleria */
.filtri { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin: 0 auto var(--sp-5); }
.filtri button {
  min-height: 44px; padding: .5rem 1.1rem; border-radius: 999px; cursor: pointer;
  font: 600 .9rem/1 var(--f-testo); letter-spacing: .03em;
  background: transparent; color: var(--inchiostro); border: 1px solid var(--filo);
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .12s var(--ease-out);
}
.filtri button[aria-pressed="true"] { background: var(--rosa-scuro); border-color: var(--rosa-scuro); color: #fff; }
@media (hover: hover) and (pointer: fine) { .filtri button[aria-pressed="false"]:hover { background: var(--cipria); border-color: var(--rosa); } }
.filtri button:active { transform: scale(.97); }
.opera[hidden] { display: none !important; }
.opera-piede { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem 1rem; margin-top: .5rem !important; }
.opera-piede a { display: inline-flex; align-items: center; gap: .35rem; font-size: .9rem; min-height: 32px; }
.opera-piede svg { width: 16px; height: 16px; }
