/* Caratteri ospitati nel sito (nessuna richiesta a Google Fonts) */
@font-face { font-family: "Playfair Display"; src: url("fonts/playfair-display-latin-wght-normal.woff2") format("woff2"); font-weight: 400 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Playfair Display"; src: url("fonts/playfair-display-latin-wght-italic.woff2") format("woff2"); font-weight: 400 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Lato"; src: url("fonts/lato-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Lato"; src: url("fonts/lato-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Lato"; src: url("fonts/lato-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

/* Palette proposta G: crema cipria, cioccolato, rosa antico, pesca dorato, bronzo */
:root {
  --cream: #F8F3EE;
  --choc: #3D2C2E;
  --rose: #C47D8E;
  --rose-d: #8E4F61;   /* rosa scuro per testi piccoli e corsivi: il #C47D8E sul testo non ha contrasto sufficiente */
  --peach: #D49B83;
  --bronze: #B98A5E;
  --ink: #3D2C2E;
  --bg: #F4DED6;       /* sfondo della sezione servizi, cambia capitolo per capitolo */
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: "Lato", system-ui, sans-serif; color: var(--ink); background: var(--cream); line-height: 1.75; font-size: 1.08rem; overflow-x: hidden; }
body.lock { overflow: hidden; }
h1, h2, h3 { font-family: "Playfair Display", Georgia, serif; font-weight: 500; line-height: 1.02; letter-spacing: -.015em; }
em { font-style: italic; font-weight: 400; }
a { color: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--rose); outline-offset: 4px; }

/* grana leggerissima (spenta anche su ogni dispositivo touch, telefoni in orizzontale compresi) */
@media (pointer: coarse) { body::after { display: none; } }
body::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 90; opacity: .045; 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'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"); }

.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 120; }
.progress i { display: block; height: 100%; width: 100%; background: var(--bronze); transform: scaleX(0); transform-origin: 0 50%; will-change: transform; }

/* BARRA */
.bar { position: fixed; top: 0; left: 0; right: 0; z-index: 110; display: flex; justify-content: space-between; align-items: center; padding: 1rem clamp(1.2rem, 4vw, 3rem); }
.logo-link { display: flex; align-items: center; gap: .7rem; text-decoration: none; font: 500 1.1rem "Playfair Display", serif; color: var(--choc); }
.logo-link img { height: 50px; width: auto; padding: 6px 16px; background: #fffdfb; border-radius: 999px; box-shadow: 0 2px 12px rgba(61,44,46,.16); box-sizing: content-box; }
.menu-btn { display: flex; align-items: center; gap: .7rem; background: var(--choc); color: var(--cream); border: 0; border-radius: 999px; padding: .6rem 1.1rem .6rem 1.3rem; font: 700 .85rem "Lato", sans-serif; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; transition: background .25s; }
.menu-btn:hover { background: var(--rose-d); }
.menu-btn .dots { width: 22px; height: 8px; background: radial-gradient(circle, currentColor 3px, transparent 3.5px) 0 50%/11px 8px repeat-x; transition: transform .3s; }
.menu-btn[aria-expanded="true"] .dots { transform: rotate(90deg); }
body.menu-open .logo-link { color: var(--cream); }
body.menu-open .menu-btn { background: var(--cream); color: var(--choc); }

.overlay { position: fixed; inset: 0; z-index: 100; background: var(--choc); display: grid; place-items: center; }
.overlay[hidden] { display: none; }
.overlay ol { list-style: none; }
.overlay a { display: flex; align-items: baseline; gap: 1.2rem; text-decoration: none; color: var(--cream); font: 400 clamp(2.1rem, 6.6vw, 4.6rem)/1.2 "Playfair Display", serif; padding: .1em 0; transition: color .2s, transform .3s; }
.overlay a small { font: 700 .85rem "Lato", sans-serif; color: var(--peach); letter-spacing: .12em; }
.overlay a:hover { color: var(--peach); transform: translateX(14px); font-style: italic; }
.overlay:not([hidden]) li { animation: up .6s both; } .overlay li:nth-child(2) { animation-delay: .07s; } .overlay li:nth-child(3) { animation-delay: .14s; } .overlay li:nth-child(4) { animation-delay: .21s; } .overlay li:nth-child(5) { animation-delay: .28s; }
@keyframes up { from { opacity: 0; transform: translateY(30px); } }

/* PULSANTI: rosa antico con testo cioccolato in grassetto */
.btn { display: inline-flex; align-items: center; gap: .6rem; padding: 1rem 1.9rem; border-radius: 999px; background: var(--rose); color: var(--choc); text-decoration: none; font: 700 .9rem "Lato", sans-serif; letter-spacing: .06em; text-transform: uppercase; border: 2px solid var(--rose); transition: transform .25s, background .25s, color .25s, border-color .25s; }
.btn:hover { transform: translateY(-3px); background: var(--choc); border-color: var(--choc); color: var(--cream); }
.btn.ghost { background: transparent; color: var(--choc); border-color: var(--bronze); }
.btn.ghost:hover { background: var(--bronze); border-color: var(--bronze); color: var(--choc); }
.btn.dark { background: var(--choc); border-color: var(--choc); color: var(--cream); }
.btn.dark:hover { background: var(--rose); border-color: var(--rose); color: var(--choc); }
.btn.ghost-d { background: transparent; color: var(--choc); border-color: var(--choc); }
.btn.ghost-d:hover { background: var(--choc); color: var(--cream); }
.cta { display: flex; flex-wrap: wrap; gap: .8rem; }
.eyebrow { font: 700 .78rem "Lato", sans-serif; letter-spacing: .22em; text-transform: uppercase; color: var(--rose-d); }

/* HERO: cipria con alone */
.hero { position: relative; min-height: min(100svh, 900px); background: radial-gradient(60vmax 60vmax at 82% 38%, rgba(212,155,131,.38), transparent 62%), radial-gradient(40vmax 40vmax at 8% 95%, rgba(196,125,142,.18), transparent 65%), var(--cream); display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: 2rem; padding: 7rem clamp(1.2rem, 6vw, 6rem) 4rem; overflow: hidden; }
.hero > * { position: relative; z-index: 1; }
.hero h1 { font-size: clamp(3.6rem, 10.5vw, 9rem); line-height: .92; margin: 1rem 0 1.6rem; color: var(--choc); }
.hero h1 em { color: var(--rose-d); }
.w { display: inline-block; overflow: hidden; padding-bottom: .14em; }
.w > span { display: inline-block; transform: translateY(110%); animation: rise 1.1s .15s cubic-bezier(.2,.8,.2,1) forwards; }
.w + br + .w > span { animation-delay: .35s; }
@keyframes rise { to { transform: none; } }
.who { font: 400 clamp(1.3rem, 2.4vw, 1.9rem)/1.25 "Playfair Display", serif; }
.who strong { font-weight: 600; }
.hero .lead { max-width: 38ch; margin: .8rem 0 1.4rem; font-size: 1.15rem; }
.pills { list-style: none; display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 2rem; }
.pills li { border: 1px solid var(--bronze); border-radius: 999px; padding: .35rem 1rem; font-size: .92rem; }
.pills b { color: var(--rose-d); margin-right: .4rem; }

.portrait-wrap { position: relative; justify-self: center; width: min(100%, 360px); }
.portrait { position: relative; margin: 0; border-radius: 48% 52% 46% 54% / 40% 42% 58% 60%; overflow: hidden; border: 2px solid var(--bronze); box-shadow: 0 0 0 10px rgba(248,243,238,.7), 0 0 90px 20px rgba(212,155,131,.55), 0 24px 50px rgba(61,44,46,.2); }
.portrait img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 25%; }
.orbit { position: absolute; inset: -46px -64px; border-radius: 50%; border: 1px dashed var(--bronze); animation: spin 70s linear infinite; }
.orbit::after { content: ""; position: absolute; top: 9%; left: 5%; width: 16px; height: 16px; border-radius: 50%; background: var(--peach); border: 2px solid var(--bronze); }
@keyframes spin { to { transform: rotate(360deg); } }
.seal { position: absolute; left: -9%; bottom: 3%; width: 24%; height: auto; aspect-ratio: 1; object-fit: contain; background: var(--cream); border-radius: 50%; border: 4px solid var(--cream); z-index: 3; box-shadow: 0 6px 18px rgba(61,44,46,.18); }
.scroll-hint { position: absolute; left: 50%; bottom: 1.2rem; transform: translateX(-50%); font: 700 .7rem "Lato", sans-serif; letter-spacing: .3em; text-transform: uppercase; color: var(--rose-d); text-decoration: none; }
.scroll-hint::after { content: ""; display: block; width: 1px; height: 34px; margin: .5rem auto 0; background: linear-gradient(var(--bronze), transparent); animation: drip 1.8s infinite; transform-origin: top; }
@keyframes drip { 0% { transform: scaleY(0); } 60% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* CHI SONO */
.about { background: var(--cream); padding: clamp(4rem, 9vw, 7rem) clamp(1.2rem, 6vw, 6rem); }
.about-grid { max-width: 1150px; margin: auto; display: grid; grid-template-columns: .8fr 1.2fr; gap: 4rem; align-items: start; }
.about h2 { font-size: clamp(3.4rem, 8.5vw, 7.4rem); color: var(--choc); line-height: .9; }
.about h2 em { color: var(--rose-d); }
#perche h2 { font-size: clamp(3.2rem, 7.4vw, 6.4rem); }
.about p { margin-bottom: 1rem; max-width: 52ch; }
.about p.big { font: 400 clamp(1.4rem, 2.6vw, 2.05rem)/1.4 "Playfair Display", serif; color: var(--choc); margin-bottom: 1.4rem; }
.about .cta { margin-top: 2rem; }

/* VIAGGIO */
.journey { --bg: #F4DED6; position: relative; isolation: isolate; background: var(--bg); padding: clamp(4rem, 8vw, 7rem) clamp(1.2rem, 6vw, 6rem) 5rem; border-top: 1px solid var(--bronze); }
.journey-head { max-width: 900px; margin: 0 auto 3rem; text-align: center; }
.journey-head h2 { font-size: clamp(3.2rem, 8.5vw, 6.6rem); color: var(--choc); line-height: .95; }
.journey-head h2 em { color: var(--rose-d); }
.journey-head .sub { max-width: 46ch; margin: 1.2rem auto 1.6rem; font-size: 1.15rem; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; }
.chips a { display: inline-block; padding: .5rem 1.1rem; border-radius: 999px; background: var(--cream); border: 1px solid var(--bronze); color: var(--choc); text-decoration: none; font-weight: 700; font-size: .9rem; transition: background .2s, color .2s, transform .2s; }
.chips a:hover { background: var(--choc); border-color: var(--choc); color: var(--cream); transform: translateY(-2px); }
.chapter { scroll-margin-top: 4rem; }
/* cambio di colore dello sfondo: dissolvenza di un livello sopra lo sfondo (opacity, senza ridisegnare la sezione) */
.bgfade { position: absolute; inset: 0; z-index: -1; opacity: 0; pointer-events: none; will-change: opacity; }
.bgfade.go { opacity: 1; transition: opacity .9s ease; }
.thread { position: absolute; left: 0; right: 0; top: 0; bottom: 0; pointer-events: none; contain: layout style; }
.thread svg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; }
.thread path { fill: none; stroke-linecap: round; stroke-width: 2; }
.thread .track { stroke: rgba(185,138,94,.45); stroke-dasharray: 2 10; }
.thread .draw { stroke: var(--bronze); stroke-width: 3; }
/* Pallino e fine del tratto stanno sempre al 55% dello schermo (--k): vivono in un riquadro sticky (.t-view)
   che il browser tiene fermo da solo, come la mappa "pinnata" di Codrops. Così, anche con lo scroll veloce,
   il pallino non resta indietro rispetto alla pagina. .t-range sporge di uno schermo sopra e sotto la sezione
   (lo imposta script.js), perché il riquadro sia fermo per tutto il tempo in cui il pallino è visibile. */
.thread .t-range { position: absolute; left: 0; right: 0; top: 0; height: calc(100% + 100vh); height: calc(100% + 100lvh); pointer-events: none; }
.thread .t-view { position: sticky; top: 0; height: 100vh; height: 100lvh; }
.thread .t-clip { position: absolute; left: 0; right: 0; top: 0; height: var(--k, 55vh); overflow: hidden; }
.thread .t-move { position: absolute; left: 0; right: 0; top: 0; will-change: transform; }
.thread .bead { position: absolute; left: 0; top: var(--k, 55vh); width: 20px; height: 20px; margin: -10px 0 0 -10px; box-sizing: border-box; border-radius: 50%; background: var(--peach); border: 2.5px solid var(--choc); opacity: 0; will-change: transform; }

.chapter { position: relative; z-index: 1; max-width: 1150px; margin: 0 auto; min-height: min(80vh, 700px); display: grid; grid-template-columns: 1fr 1fr; gap: clamp(4rem, 12vw, 11rem); align-items: center; padding: 3rem 0; }
.chapter:nth-of-type(even) .txt { order: 2; }
.chapter:nth-of-type(even) .art { order: 1; }
.num { display: block; font: 400 clamp(5rem, 11vw, 9rem)/.8 "Playfair Display", serif; color: transparent; -webkit-text-stroke: 1.5px var(--bronze); margin-bottom: .6rem; }
.txt h3 { font-size: clamp(2.3rem, 4.8vw, 4rem); color: var(--choc); margin-bottom: 1.2rem; }
.txt h3 em { color: var(--rose-d); }
.txt p { max-width: 46ch; margin-bottom: .9rem; }
.txt p.opt { border-left: 2px solid var(--bronze); padding-left: 1rem; }
.txt p.opt strong { color: var(--rose-d); }
.art { position: relative; justify-self: center; width: min(100%, 380px); }
.art::before { content: ""; position: absolute; inset: 0; transform: translate(16px, 16px); background: var(--peach); opacity: .55; border-radius: inherit; }
.art img { position: relative; display: block; width: 100%; height: auto; object-fit: cover; background: var(--cream); border: 2px solid var(--bronze); }
.b1, .b1 img, .b1::before { border-radius: 58% 42% 52% 48% / 46% 56% 44% 54%; }
.b2, .b2 img, .b2::before { border-radius: 40% 60% 46% 54% / 56% 42% 58% 44%; }
.b3, .b3 img, .b3::before { border-radius: 52% 48% 38% 62% / 44% 60% 40% 56%; }
.b4, .b4 img, .b4::before { border-radius: 46% 54% 60% 40% / 52% 44% 56% 48%; }
.b5, .b5 img, .b5::before { border-radius: 60% 40% 48% 52% / 40% 54% 46% 60%; }
.b6, .b6 img, .b6::before { border-radius: 44% 56% 54% 46% / 58% 46% 54% 42%; }
.journey-end { position: relative; z-index: 1; text-align: center; margin-top: 2rem; }

/* FORMAZIONE */
.train { background: var(--cream); color: var(--choc); padding: clamp(4rem, 8vw, 7rem) clamp(1.2rem, 6vw, 6rem); border-top: 1px solid var(--bronze); }
.train-grid { max-width: 1150px; margin: auto; display: grid; grid-template-columns: .85fr 1.15fr; gap: 4rem; align-items: start; }
.train-head { position: sticky; top: 6rem; }
.train h2 { font-size: clamp(2.5rem, 5.2vw, 4.4rem); margin: 1rem 0 1.4rem; }
.train h2 em { color: var(--rose-d); }
.train .note { max-width: 32ch; }
.cv { list-style: none; border-top: 1px solid var(--bronze); }
.cv li { display: grid; grid-template-columns: 190px 1fr; gap: 1.5rem; align-items: center; padding: 1.7rem .5rem; border-bottom: 1px solid rgba(185,138,94,.5); transition: background .3s, padding .3s; }
.cv li:hover { background: rgba(212,155,131,.28); padding-left: 1.4rem; }
.cv .yr { font: 400 clamp(1.7rem, 3vw, 2.3rem)/1 "Playfair Display", serif; color: transparent; -webkit-text-stroke: 1.2px var(--bronze); }
.cv h3 { font-size: 1.55rem; line-height: 1.15; margin-bottom: .3rem; }
.cv p { margin: 0; }

/* DOMANDE FREQUENTI */
.faq { background: #F2E8E0; color: var(--choc); padding: clamp(4rem, 8vw, 7rem) clamp(1.2rem, 6vw, 6rem); border-top: 1px solid var(--bronze); }
.faq-head { max-width: 900px; margin: 0 auto 2.6rem; text-align: center; }
.faq-head h2 { font-size: clamp(2.8rem, 7vw, 5.4rem); line-height: .98; }
.faq-head h2 em { color: var(--rose-d); }
.faq-list { max-width: 860px; margin: 0 auto; border-top: 1px solid var(--bronze); }
.qa { border-bottom: 1px solid rgba(185,138,94,.55); }
.qa summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 1.2rem; padding: 1.35rem .4rem; font: 500 clamp(1.2rem, 2.2vw, 1.55rem)/1.25 "Playfair Display", serif; transition: color .2s, padding .3s; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: "+"; flex: none; width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--bronze); display: grid; place-items: center; font: 400 1.5rem/1 "Lato", sans-serif; color: var(--rose-d); transition: transform .3s, background .3s, color .3s; }
.qa summary:hover { color: var(--rose-d); }
.qa[open] summary::after { transform: rotate(45deg); background: var(--rose); color: var(--choc); border-color: var(--rose); }
.qa-body { padding: 0 .4rem 1.6rem; animation: fade .5s both; }
.qa-body p { max-width: 68ch; margin-bottom: .9rem; }
.qa-body ul { max-width: 68ch; margin: 0 0 .4rem 1.2rem; }
.qa-body li { margin-bottom: .6rem; padding-left: .3rem; }
.qa-body li::marker { color: var(--bronze); }

/* CONTATTI */
.contact { background: var(--peach); color: var(--choc); padding: clamp(4rem, 8vw, 6rem) clamp(1.2rem, 6vw, 6rem); overflow: hidden; }
.huge { font-size: clamp(4.2rem, 16vw, 14rem); line-height: .85; max-width: 1250px; margin: 0 auto .8em; color: var(--cream); }
.huge em { color: var(--choc); }
.contact-grid { max-width: 1150px; margin: auto; display: grid; grid-template-columns: .9fr 1.1fr; gap: 3.5rem; align-items: center; }
.contact .eyebrow { color: var(--choc); margin-bottom: 1.2rem; }
.contact address { font-style: normal; margin-bottom: 1.6rem; }
.contact address p { display: grid; grid-template-columns: 110px 1fr; padding: .7rem 0; border-top: 1px solid rgba(61,44,46,.3); font-size: 1.1rem; }
.contact address b { font: 700 .75rem "Lato", sans-serif; letter-spacing: .14em; text-transform: uppercase; align-self: center; }
.contact .btn { background: var(--choc); border-color: var(--choc); color: var(--cream); }
.contact .btn:hover { background: var(--cream); border-color: var(--cream); color: var(--choc); }
.social { display: flex; gap: .7rem; margin-top: 1.8rem; }
.social a { height: 48px; padding: 0 1.3rem 0 1rem; border-radius: 999px; border: 2px solid var(--choc); display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; font-weight: 700; transition: background .2s, color .2s, transform .2s; }
.social a:hover { background: var(--choc); color: var(--cream); transform: translateY(-2px); }
.social svg { width: 22px; height: 22px; fill: currentColor; }
.social svg[fill="none"] { fill: none; }
.contact .btn.ghost-d { background: transparent; color: var(--choc); border-color: var(--choc); }
.contact .btn.ghost-d:hover { background: var(--choc); color: var(--cream); border-color: var(--choc); }
.studios { display: flex; flex-direction: column; gap: 1.2rem; }
.studios .eyebrow { margin-bottom: 0; }
.map-card { border: 2px solid var(--choc); border-radius: 28px; padding: 1.8rem 2rem; background: rgba(248,243,238,.55); display: flex; flex-direction: column; gap: .7rem; }
.map-card h3 { font-size: clamp(1.5rem, 2.6vw, 2rem); line-height: 1.15; }
.map-addr { font: 400 1.2rem/1.4 "Playfair Display", serif; }
footer { background: var(--choc); color: rgba(248,243,238,.8); text-align: center; padding: 1.6rem 1rem; font-size: .85rem; line-height: 1.8; }
footer .legal { margin-top: .3rem; }
footer .legal span { margin: 0 .5rem; color: var(--peach); }
footer a { color: var(--cream); text-underline-offset: 3px; }
footer a:hover { color: var(--peach); }

/* pagine documento (consenso informato, privacy e cookie) */
.doc { max-width: 720px; margin: 0 auto; padding: 9rem clamp(1.2rem, 6vw, 3rem) 6rem; min-height: 70vh; }
.doc h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); margin: .8rem 0 1.4rem; }
.doc p { margin-bottom: 1rem; }

/* COMPARSA */
.rv { opacity: 0; transform: translateY(32px); transition: opacity .9s, transform .9s cubic-bezier(.2,.7,.2,1); }
.rv.in { opacity: 1; transform: none; }
.hero .rv { animation: fade .9s .6s both; opacity: 1; transform: none; transition: none; }
.hero .who { animation-delay: .75s; } .hero .lead { animation-delay: .9s; } .hero .pills { animation-delay: 1.05s; } .hero .cta { animation-delay: 1.2s; }
@keyframes fade { from { opacity: 0; transform: translateY(20px); } }
/* Su telefono e tablet niente comparsa allo scroll: far partire decine di transizioni mentre il dito scorre
   è la causa principale degli scatti misurata (primo scroll: 5-7% di fotogrammi persi con, 1-2% senza).
   La prima schermata mantiene la sua animazione d'ingresso; sul computer non cambia nulla. */
@media (pointer: coarse) {
  .rv { opacity: 1; transform: none; transition: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rv, .hero .rv { opacity: 1; transform: none; transition: none; animation: none; }
  .w > span { transform: none; animation: none; }
  .orbit, .scroll-hint::after { animation: none; }
  .qa-body { animation: none; }
}

/* schermi larghi: la prima schermata resta in una colonna centrata */
@media (min-width: 1100px) {
  .hero { padding-inline: max(3rem, calc((100% - 1180px) / 2)); gap: 3rem; }
  .hero h1 { font-size: clamp(4.5rem, 8vw, 7.6rem); }
  .bar { padding-inline: max(1.5rem, calc((100% - 1180px) / 2 - 1rem)); }
}
@media (min-width: 1700px) {
  .hero { padding-inline: max(3rem, calc((100% - 1240px) / 2)); }
  .hero h1 { font-size: 8rem; }
  .bar { padding-inline: max(1.5rem, calc((100% - 1240px) / 2 - 1rem)); }
}

@media (max-width: 860px) {
  body::after { display: none; } /* grana: su telefono appesantisce lo scroll */
  .logo-link span { display: none; }
  .logo-link img { height: 40px; padding: 5px 13px; }
  .hero { grid-template-columns: 1fr; padding-top: 6.5rem; gap: 2.5rem; }
  .portrait-wrap { order: -1; width: min(56%, 215px); margin-top: .8rem; }
  .orbit { inset: -34px -46px; } .scroll-hint { display: none; }
  .about-grid, .contact-grid, .train-grid { grid-template-columns: 1fr; gap: 2rem; }
  .train-head { position: static; }
  .cv li { grid-template-columns: 1fr; gap: .4rem; }
  .qa summary { padding: 1.15rem 0; }
  .qa-body { padding: 0 0 1.4rem; }
  .chapter { grid-template-columns: 1fr; gap: 2.5rem; min-height: 0; padding: 2.5rem 0 2.5rem 2.6rem; }
  .chapter:nth-of-type(even) .txt, .chapter:nth-of-type(even) .art { order: 0; }
  .art { width: min(85%, 300px); justify-self: start; }
  .journey { padding-left: 1.2rem; padding-right: 1.2rem; }
  .thread .t-range { right: auto; width: 64px; } /* su telefono il filo è a 22px dal bordo: strato grafico stretto, meno memoria */
  .map-card { padding: 1.5rem; }
  .contact address p { grid-template-columns: 95px 1fr; }
}

/* PULSANTE "TORNA SU" */
.to-top { position: fixed; right: max(1.1rem, env(safe-area-inset-right)); bottom: max(1.1rem, env(safe-area-inset-bottom)); z-index: 100; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--choc); color: var(--cream); box-shadow: 0 6px 18px rgba(61,44,46,.28); opacity: 0; visibility: hidden; transform: translateY(14px); transition: opacity .3s, transform .3s, visibility 0s .3s, background .25s; }
.to-top svg { width: 22px; height: 22px; }
.to-top.show { opacity: 1; visibility: visible; transform: none; transition: opacity .3s, transform .3s, visibility 0s, background .25s; }
.to-top:hover { background: var(--rose-d); }
body.menu-open .to-top { opacity: 0; visibility: hidden; }
