/* Studio Dentistico Ceraldi – stili. Token in DESIGN.md */

@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-latin-wght-italic.woff2") format("woff2");
  font-weight: 200 900; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Figtree";
  src: url("../fonts/figtree-latin-wght-normal.woff2") format("woff2");
  font-weight: 300 900; font-style: normal; font-display: swap;
}

:root {
  --blue-900: #1f3763;
  --blue-800: #2c4a80;
  --blue-700: #243f6f;
  --blue-500: #4d8ac8;
  --blue-100: #e3ebfe;
  --blue-50: #f5f8ff;
  --orange-500: #ec7442;
  --orange-400: #f28a5c;
  --orange-700: #c4541f;
  --orange-800: #a9461a;
  --ink: #16202c;
  --ink-2: #5d6b80;
  --line: #d9e2f2;
  --paper: #fff;
  --ok: #1f7a4d;

  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;

  --fs-xs: .8125rem;
  --fs-sm: .9375rem;
  --fs-base: 1.0625rem;
  --fs-lg: 1.25rem;
  --fs-h3: 1.5rem;
  --fs-h2: clamp(2rem, 4.2vw, 3.25rem);
  --fs-h1: clamp(2.625rem, 7vw, 5.5rem);

  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px;
  --s-7: 48px; --s-8: 64px; --s-9: 96px; --s-10: 128px;
  --section: clamp(72px, 11vw, 160px);
  --gutter: clamp(20px, 5vw, 56px);
  --max: 1240px;

  --r-sm: 10px; --r-md: 20px; --r-lg: 32px; --r-pill: 999px;
  --shadow: 0 1px 2px rgb(31 55 99 / .08), 0 16px 40px -12px rgb(31 55 99 / .22);
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-in-out: cubic-bezier(.77, 0, .175, 1);
  --header-h: 76px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 var(--fs-base)/1.65 var(--sans);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 650; color: var(--blue-900); text-wrap: balance; letter-spacing: -.015em; }
h2 { font-size: var(--fs-h2); line-height: 1.08; }
h3 { font-size: var(--fs-h3); line-height: 1.25; font-weight: 600; }
h1 em, h2 em { font-style: italic; font-weight: 500; color: var(--orange-700); }
p { margin: 0; text-wrap: pretty; }
a { color: var(--blue-800); text-underline-offset: .2em; text-decoration-thickness: 1px; }
::selection { background: var(--orange-500); color: #fff; }
:focus-visible { outline: 3px solid var(--orange-500); outline-offset: 3px; border-radius: 6px; }
button { font: inherit; }

.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip {
  position: fixed; left: var(--s-4); top: var(--s-4); z-index: 100;
  background: var(--blue-900); color: #fff; padding: var(--s-3) var(--s-5); border-radius: var(--r-pill);
  transform: translateY(-160%); transition: transform .2s var(--ease-out);
}
.skip:focus { transform: none; }

.i { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* Bottoni */
.btn {
  --bg: var(--blue-800); --fg: #fff; --bd: transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 52px; padding: 0 1.5em; border-radius: var(--r-pill);
  background: var(--bg); color: var(--fg); border: 1.5px solid var(--bd);
  font: 600 1rem/1 var(--sans); letter-spacing: .005em; text-decoration: none; cursor: pointer;
  transition: background-color .2s var(--ease-out), border-color .2s var(--ease-out), color .2s var(--ease-out), transform .16s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn[data-magnetic] { transition: background-color .2s var(--ease-out), border-color .2s var(--ease-out), color .2s var(--ease-out), transform .16s var(--ease-out), translate .5s var(--ease-out); }
.btn[data-magnetic].is-pulled { transition: background-color .2s var(--ease-out), border-color .2s var(--ease-out), color .2s var(--ease-out), transform .16s var(--ease-out), translate .15s var(--ease-out); }
.btn-primary { --bg: var(--blue-800); }
.btn-accent { --bg: var(--orange-700); }
.btn-secondary { --bg: #fff; --fg: var(--blue-900); --bd: var(--line); }
.btn-ghost { --bg: transparent; --fg: #fff; --bd: rgb(255 255 255 / .45); }
.btn-sm { min-height: 44px; padding: 0 1.15em; font-size: .9375rem; }
.btn-block { width: 100%; }
@media (hover: hover) {
  .btn-primary:hover { --bg: var(--blue-700); }
  .btn-accent:hover { --bg: var(--orange-800); }
  .btn-secondary:hover { --bd: var(--blue-500); }
  .btn-ghost:hover { --bg: rgb(255 255 255 / .1); --bd: #fff; }
}

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: rgb(255 255 255 / .96); border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease-out), box-shadow .3s var(--ease-out);
}
.site-header.is-scrolled { border-color: var(--line); box-shadow: 0 8px 24px -18px rgb(31 55 99 / .35); }
.header-row { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: var(--s-5); }
.brand img { width: 168px; height: auto; }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: clamp(var(--s-4), 2vw, var(--s-6)); }
.nav-list a:not(.btn) {
  color: var(--blue-900); text-decoration: none; font-weight: 500; font-size: .975rem;
  background: linear-gradient(var(--orange-500), var(--orange-500)) 0 100% / 0 2px no-repeat;
  padding-block: 6px; transition: background-size .3s var(--ease-out);
}
@media (hover: hover) { .nav-list a:not(.btn):hover { background-size: 100% 2px; } }
.nav-toggle { display: none; }

@media (max-width: 960px) {
  .nav-toggle {
    display: inline-flex; align-items: center; gap: var(--s-3); min-height: 44px; padding: 0 var(--s-4);
    border: 1.5px solid var(--line); border-radius: var(--r-pill); background: #fff; color: var(--blue-900); font-weight: 600; cursor: pointer;
    position: relative; z-index: 2;
  }
  .nav-toggle-bars, .nav-toggle-bars::before { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .3s var(--ease-out); }
  .nav-toggle-bars { position: relative; transform: translateY(-3px); }
  .nav-toggle-bars::before { content: ""; position: absolute; top: 6px; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bars { transform: translateY(0) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(-6px) rotate(-90deg); }
  .nav-list {
    position: fixed; inset: 0; z-index: 1; flex-direction: column; align-items: flex-start; justify-content: center; gap: var(--s-2);
    padding: var(--s-9) var(--gutter) var(--s-7); background: var(--blue-800);
    visibility: hidden; opacity: 0; transition: opacity .3s var(--ease-out), visibility 0s .3s;
  }
  .nav-list.is-open { visibility: visible; opacity: 1; transition: opacity .3s var(--ease-out); }
  .nav-list a:not(.btn) { color: #fff; font: 600 clamp(1.75rem, 8vw, 2.5rem)/1.3 var(--serif); }
  .nav-list li { transform: translateY(12px); opacity: 0; transition: transform .45s var(--ease-out), opacity .45s var(--ease-out); }
  .nav-list.is-open li { transform: none; opacity: 1; }
  .nav-list.is-open li:nth-child(2) { transition-delay: .03s; } .nav-list.is-open li:nth-child(3) { transition-delay: .06s; }
  .nav-list.is-open li:nth-child(4) { transition-delay: .09s; } .nav-list.is-open li:nth-child(5) { transition-delay: .12s; }
  .nav-list.is-open li:nth-child(6) { transition-delay: .15s; }
  .nav-cta { margin-top: var(--s-5); }
  .nav-open .nav-toggle { border-color: rgb(255 255 255 / .4); background: transparent; color: #fff; }
  .nav-open { overflow: hidden; }
}

/* Apertura */
.hero { background: var(--blue-800); color: #fff; overflow: hidden; position: relative; }
.hero-grid {
  display: grid; grid-template-columns: 1.08fr .92fr; align-items: center; gap: clamp(var(--s-6), 5vw, var(--s-9));
  min-height: min(calc(100svh - var(--header-h)), 860px); padding-block: clamp(var(--s-7), 7vw, var(--s-9));
}
.hero-title { color: #fff; font-size: var(--fs-h1); line-height: 1.02; font-weight: 600; letter-spacing: -.025em; }
.hero-title em { color: var(--orange-400); font-weight: 500; }
.hero-lead { margin-top: var(--s-5); max-width: 36ch; font-size: var(--fs-lg); line-height: 1.55; color: #dfe7f8; }
.status {
  display: inline-flex; align-items: center; gap: var(--s-3); margin-top: var(--s-6);
  padding: var(--s-2) var(--s-4) var(--s-2) var(--s-3); border-radius: var(--r-pill);
  background: rgb(255 255 255 / .1); color: #fff; font-weight: 500; font-size: var(--fs-sm);
}
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: #9fb3d6; box-shadow: 0 0 0 4px rgb(255 255 255 / .08); }
.status.is-open .status-dot { background: #5ee29b; animation: pulse 2.4s var(--ease-out) infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgb(94 226 155 / .55); } 70%, 100% { box-shadow: 0 0 0 10px rgb(94 226 155 / 0); } }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-5); }

.hero-visual { position: relative; aspect-ratio: 1; width: min(100%, 560px); justify-self: end; }
.scallop { display: block; -webkit-mask: url("../img/scallop.svg") center / contain no-repeat; mask: url("../img/scallop.svg") center / contain no-repeat; }
.scallop img { width: 100%; height: 100%; object-fit: cover; }
.hero-photo { position: absolute; inset: 7%; }
.hero-photo img { object-position: 50% 40%; }
.hero-tag {
  position: absolute; left: -2%; bottom: 12%; z-index: 2; margin: 0;
  display: grid; gap: 2px; padding: var(--s-3) var(--s-5) var(--s-3) var(--s-5);
  background: #fff; border-radius: var(--r-md); box-shadow: var(--shadow); line-height: 1.25;
  animation: float 8s var(--ease-in-out) infinite alternate; animation-delay: -2s;
}
.hero-tag strong { font: 600 1.05rem/1.25 var(--serif); color: var(--blue-900); }
.hero-tag span { font-size: var(--fs-xs); color: var(--ink-2); }
.hero-tag::before { content: ""; position: absolute; left: -6px; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; background: var(--orange-500); box-shadow: 0 0 0 4px #fff; }
.js .hero-tag { opacity: 0; scale: .96; transition: opacity .6s var(--ease-out) 1.1s, scale .7s var(--ease-out) 1.1s; }
.is-ready .hero-tag { opacity: 1; scale: 1; }
.scallop-ring {
  position: absolute; inset: 0; background: var(--orange-500);
  -webkit-mask: url("../img/scallop.svg") center / contain no-repeat; mask: url("../img/scallop.svg") center / contain no-repeat;
  animation: spin 90s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.dot { position: absolute; border-radius: 50%; animation: float 7s var(--ease-in-out) infinite alternate; }
.dot-a { width: 18px; height: 18px; background: var(--orange-500); left: -2%; top: 18%; }
.dot-b { width: 10px; height: 10px; background: var(--blue-100); right: 4%; bottom: 6%; animation-duration: 9s; animation-delay: -3s; }
.dot-c { width: 8px; height: 8px; background: var(--orange-400); right: -3%; top: 30%; animation-duration: 6s; animation-delay: -1s; }
.dot-d { width: 26px; height: 26px; background: rgb(227 235 254 / .14); left: 8%; bottom: 2%; animation-duration: 10s; }
.dot-e { width: 6px; height: 6px; background: #fff; left: 46%; top: -2%; animation-duration: 8s; animation-delay: -4s; }
@keyframes float { from { transform: translateY(-10px); } to { transform: translateY(12px); } }
.hero-photo, .scallop-ring, .dot, .hero-tag { will-change: translate; }

/* Ingresso dell'apertura, una volta */
.js .hero-title .w { display: inline-block; overflow: clip; overflow-clip-margin: .12em; vertical-align: bottom; padding-bottom: .06em; }
.js .hero-title .w > span { display: inline-block; transform: translateY(105%); transition: transform .9s var(--ease-out); transition-delay: calc(var(--i) * 45ms + 80ms); }
.js .hero-lead, .js .status, .js .hero-actions { opacity: 0; transform: translateY(10px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }
.js .hero-lead { transition-delay: .45s; } .js .status { transition-delay: .55s; } .js .hero-actions { transition-delay: .62s; }
.js .hero-photo { clip-path: circle(0% at 50% 50%); transition: clip-path 1.3s var(--ease-out) .2s; }
.js .hero-photo img { scale: 1.25; transition: scale 1.8s var(--ease-out) .2s; }
.js .dot { opacity: 0; transition: opacity .8s var(--ease-out) .9s; }
.js .scallop-ring { opacity: 0; scale: .9; transition: opacity .8s var(--ease-out) .35s, scale 1.1s var(--ease-out) .35s; }
.is-ready .hero-title .w > span { transform: none; }
.is-ready .hero-lead, .is-ready .status, .is-ready .hero-actions { opacity: 1; transform: none; }
.is-ready .hero-photo { clip-path: circle(75% at 50% 50%); }
.is-ready .hero-photo img { scale: 1; }
.is-ready .dot { opacity: 1; }
.is-ready .scallop-ring { opacity: 1; scale: 1; }

/* Sezioni */
.section { padding-block: var(--section); }
.section-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-6); align-items: end; margin-bottom: clamp(var(--s-7), 6vw, var(--s-9)); }
.section-head p { color: var(--ink-2); font-size: var(--fs-lg); max-width: 44ch; justify-self: end; }
.section-head h2::after { content: ""; display: block; width: 56px; height: 3px; margin-top: var(--s-4); border-radius: 3px; background: var(--orange-500); transform-origin: left; }
.js .section-head h2, .js .rooms-title { opacity: 0; translate: 0 28px; transition: opacity .8s var(--ease-out), translate .9s var(--ease-out); }
.js .section-head h2::after { transform: scaleX(0); transition: transform .7s var(--ease-out) .35s; }
.js .section-head p { opacity: 0; translate: 0 16px; transition: opacity .8s var(--ease-out) .15s, translate .9s var(--ease-out) .15s; }
.js .is-in > h2, .js .is-in.rooms-title, .js .section-head.is-in p { opacity: 1; translate: 0 0; }
.js .section-head.is-in h2::after { transform: scaleX(1); }
.js .t-list .t-item { opacity: 0; translate: 0 14px; transition: opacity .6s var(--ease-out), translate .7s var(--ease-out); transition-delay: calc(var(--k, 0) * 45ms); }
.js .t-list.is-in .t-item { opacity: 1; translate: 0 0; }
.js .booking { opacity: 0; translate: 0 40px; transition: opacity .9s var(--ease-out), translate 1s var(--ease-out); }
.js .booking.is-in { opacity: 1; translate: 0 0; }

/* Lo studio */
.studio-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(var(--s-7), 7vw, var(--s-10)); align-items: start; }
.js .statement[data-words] .sw { color: #8592a8; transition: color .35s var(--ease-out); }
.js .statement[data-words] .sw.is-lit { color: var(--blue-900); }
.js .statement[data-words] em .sw.is-lit { color: var(--orange-700); }
.statement { font-size: clamp(2.125rem, 4.6vw, 3.75rem); line-height: 1.06; font-weight: 600; letter-spacing: -.02em; }
.studio-body { display: grid; gap: var(--s-6); padding-top: var(--s-3); }
.doctor { margin: 0; display: flex; align-items: center; gap: var(--s-5); }
.doctor-photo { width: 132px; aspect-ratio: 1; flex: none; }
.doctor-photo img { object-position: 50% 50%; }
.doctor figcaption { display: grid; line-height: 1.35; }
.doctor figcaption strong { font: 600 var(--fs-lg)/1.3 var(--serif); color: var(--blue-900); }
.doctor figcaption span { color: var(--ink-2); font-size: var(--fs-sm); }
.prose { display: grid; gap: var(--s-4); max-width: 60ch; color: #2e3a4b; }

/* Trattamenti */
.treatments { background: var(--blue-50); }
.t-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: clamp(var(--s-6), 5vw, var(--s-9)); border-top: 1px solid var(--line); }
.t-item { border-bottom: 1px solid var(--line); }
.t-item summary {
  list-style: none; display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  padding: var(--s-5) 0; cursor: pointer; min-height: 44px;
}
.t-item summary::-webkit-details-marker { display: none; }
.t-name { font: 600 clamp(1.25rem, 1.9vw, 1.5rem)/1.25 var(--serif); color: var(--blue-900); transition: color .2s var(--ease-out); }
.t-plus { width: 28px; height: 28px; padding: 5px; border-radius: 50%; background: #fff; color: var(--orange-700); border: 1px solid var(--line); transition: transform .35s var(--ease-out), background-color .2s; }
.t-item[open] .t-plus { transform: rotate(45deg); background: var(--orange-700); color: #fff; border-color: var(--orange-700); }
.t-item p { padding: 0 var(--s-8) var(--s-5) 0; color: #2e3a4b; max-width: 52ch; }
.js .t-item[open] p { animation: drop .45s var(--ease-out); }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } }
.t-item summary { position: relative; }
.t-item summary::before { content: ""; position: absolute; inset: 0 -12px; border-radius: var(--r-sm); background: #fff; transform-origin: left; transform: scaleX(0); opacity: 0; transition: transform .45s var(--ease-out), opacity .3s var(--ease-out); z-index: -1; }
.t-item { position: relative; z-index: 0; }
.t-name { transition: color .2s var(--ease-out), translate .35s var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .t-item summary:hover::before { transform: scaleX(1); opacity: 1; }
  .t-item summary:hover .t-name { color: var(--orange-700); translate: 6px 0; }
  .t-item summary:hover .t-plus { background: var(--orange-700); color: #fff; border-color: var(--orange-700); }
}

/* Tecnologie */
.tech { background: var(--blue-900); color: #dfe7f8; }
.tech h2 { color: #fff; }
.tech h2 em { color: var(--orange-500); }
.tech-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(var(--s-7), 6vw, var(--s-10)); align-items: center; }
.tech-list { list-style: none; margin: clamp(var(--s-6), 4vw, var(--s-7)) 0 0; padding: 0; display: grid; }
.tech-list li { position: relative; display: grid; grid-template-columns: auto 1fr; gap: var(--s-5); padding: var(--s-5) 0; border-top: 1px solid rgb(255 255 255 / .14); }
.tech-list li:last-child { border-bottom: 1px solid rgb(255 255 255 / .14); }
.tech-list h3 { color: #fff; font-size: 1.3rem; transition: color .4s var(--ease-out); }
.tech-list p { margin-top: var(--s-1); color: #c2cfe6; max-width: 46ch; transition: color .4s var(--ease-out); }
.tech-icon { width: 44px; height: 44px; padding: 10px; border-radius: 50%; background: rgb(236 116 66 / .16); color: var(--orange-500); transition: background-color .4s var(--ease-out), color .4s var(--ease-out), scale .4s var(--ease-out); }
.tech-visual { position: relative; }
.tech-photo { margin: 0; border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 4 / 5; }
.tech-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 40% 50%; scale: 1.12; }
.tech-stage { display: none; }

/* Versione con foto che accompagna le voci (desktop, attivata dallo script) */
/* il testo scorre normalmente, la foto resta accanto finché ci sono voci da leggere */
.pin-tech .tech-grid { align-items: start; }
.pin-tech .tech-visual { position: sticky; top: calc(var(--header-h) + (100vh - var(--header-h) - min(68vh, 620px)) / 2); }
.pin-tech .tech-photo { aspect-ratio: auto; height: min(68vh, 620px); }
.pin-tech .tech-list li { padding-block: clamp(var(--s-6), 7vh, var(--s-8)); }
.pin-tech .tech-list { margin-bottom: 12vh; }
.pin-tech .tech-photo::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(180deg, rgb(31 55 99 / .05), rgb(31 55 99 / .55)); }
.pin-tech .tech-photo { position: relative; }
.pin-tech .tech-list li { cursor: pointer; }
.pin-tech .tech-list li h3, .pin-tech .tech-list li p { color: #9fb3d6; }
.pin-tech .tech-list li .tech-icon { background: rgb(255 255 255 / .06); color: #9fb3d6; }
.pin-tech .tech-list li.is-active h3 { color: #fff; }
.pin-tech .tech-list li.is-active p { color: #dfe7f8; }
.pin-tech .tech-list li.is-active .tech-icon { background: var(--orange-500); color: #fff; scale: 1.08; }
.pin-tech .tech-list li::before {
  content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 2px; background: var(--orange-500);
  transform-origin: left; transform: scaleX(0); transition: transform .6s var(--ease-out);
}
.pin-tech .tech-list li.is-active::before { transform: scaleX(1); }
.pin-tech .tech-stage { display: grid; place-items: center; position: absolute; inset: 0; pointer-events: none; }
.tech-badge { position: relative; width: min(46%, 240px); aspect-ratio: 1; display: grid; place-items: center; }
.tech-badge::before {
  content: ""; position: absolute; inset: 0; background: #fff;
  -webkit-mask: url("../img/scallop.svg") center / contain no-repeat; mask: url("../img/scallop.svg") center / contain no-repeat;
  rotate: var(--rot, 0deg); transition: rotate .9s var(--ease-out);
}
.tech-glyph {
  grid-area: 1 / 1; width: 46%; height: 46%; fill: none; stroke: var(--orange-700); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
  opacity: 0; scale: .9; transition: opacity .3s var(--ease-out), scale .5s var(--ease-out);
}
.tech-glyph path, .tech-glyph rect { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .9s var(--ease-out) .1s; }
.tech-glyph.is-on { opacity: 1; scale: 1; }
.tech-glyph.is-on path, .tech-glyph.is-on rect { stroke-dashoffset: 0; }
.tech-dots { position: absolute; bottom: var(--s-5); left: 50%; translate: -50% 0; display: flex; gap: var(--s-2); list-style: none; margin: 0; padding: 0; }
.tech-dots li { width: 8px; height: 8px; border-radius: var(--r-pill); background: rgb(255 255 255 / .45); transition: width .4s var(--ease-out), background-color .4s var(--ease-out); }
.tech-dots li.is-on { width: 28px; background: #fff; }

/* Prima visita */
.steps { --g: clamp(24px, 4vw, 64px); list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--g); }
.step { position: relative; padding-top: var(--s-8); }
/* pallino: si colora quando la linea lo raggiunge */
.step::before {
  content: ""; position: absolute; top: 0; left: 0; z-index: 1; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; border: 3px solid var(--orange-500); transition: background-color .25s var(--ease-out);
}
.step.is-lit::before { background: var(--orange-500); }
/* tratto verso il passo successivo: binario grigio + riempimento guidato dallo scroll */
.step-line { position: absolute; top: 9px; left: 20px; width: calc(100% + var(--g) - 20px); height: 2px; background: var(--line); overflow: hidden; }
.step-fill { position: absolute; inset: 0; background: var(--orange-500); transform: scaleX(0); transform-origin: left; will-change: transform; }
html:not(.js) .step::before { background: var(--orange-500); }
html:not(.js) .step-fill { transform: none; }
.step p { margin-top: var(--s-3); color: #2e3a4b; max-width: 38ch; }

/* Ambienti */
.rooms { padding-top: 0; }
.rooms-title { margin-bottom: var(--s-7); }
.rooms-grid { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: var(--s-4); }
.room { margin: 0; border-radius: var(--r-md); overflow: hidden; background: var(--blue-100); }
.room img { width: 100%; height: 100%; object-fit: cover; }
.room img[data-parallax] { scale: 1.12; }
.room-wide { grid-row: span 2; aspect-ratio: 16 / 9; }

/* Rivelazione immagini, una volta */
.js .reveal { clip-path: inset(12% 12% 12% 12% round var(--r-md)); transition: clip-path 1s var(--ease-out); }
.js .reveal img:not([data-parallax]) { scale: 1.08; transition: scale 1.4s var(--ease-out); }
.js .reveal.is-in { clip-path: inset(0 0 0 0 round var(--r-md)); }
.js .reveal.is-in img:not([data-parallax]) { scale: 1; }

/* Orari e prenotazione */
.book { background: var(--blue-100); }
.book-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: clamp(var(--s-7), 6vw, var(--s-10)); align-items: start; }
.hours-note { display: flex; align-items: center; gap: var(--s-2); margin-top: var(--s-4); color: var(--blue-900); }
.hours-note .i { color: var(--orange-700); }
.hours-table { width: 100%; margin-top: var(--s-5); border-collapse: collapse; font-variant-numeric: tabular-nums; }
.hours-table th, .hours-table td { padding: var(--s-3) var(--s-3); text-align: left; border-bottom: 1px solid #c9d6f1; }
.hours-table th { font-weight: 500; color: var(--blue-900); }
.hours-table td { text-align: right; color: #2e3a4b; }
.hours-table tr.is-today th, .hours-table tr.is-today td { background: #fff; font-weight: 700; color: var(--blue-900); }
.hours-table tr.is-today th { border-radius: var(--r-sm) 0 0 var(--r-sm); }
.hours-table tr.is-today td { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.hours-table tr.is-today th::after { content: "oggi"; margin-left: var(--s-2); padding: 2px 8px; border-radius: var(--r-pill); background: var(--orange-700); color: #fff; font-size: .75rem; font-weight: 600; vertical-align: 2px; }
.contact-lines { list-style: none; margin: var(--s-6) 0 0; padding: 0; display: grid; gap: var(--s-2); }
.contact-lines a { display: inline-flex; align-items: center; gap: var(--s-3); min-height: 44px; font: 600 var(--fs-lg)/1.2 var(--sans); color: var(--blue-900); text-decoration: none; }
.contact-lines .i { color: var(--orange-700); }
@media (hover: hover) { .contact-lines a:hover { color: var(--orange-700); } }

.booking { background: #fff; border-radius: var(--r-lg); padding: clamp(var(--s-5), 4vw, var(--s-7)); box-shadow: var(--shadow); display: grid; gap: var(--s-5); }
.booking h2 { font-size: clamp(1.75rem, 3vw, 2.375rem); }
.booking-intro { color: var(--ink-2); margin-top: calc(var(--s-3) * -1); }
.field { display: grid; gap: var(--s-2); margin: 0; padding: 0; border: 0; min-width: 0; }
.field label, .field legend { font-weight: 600; color: var(--blue-900); font-size: var(--fs-sm); padding: 0; }
.optional { font-weight: 400; color: var(--ink-2); }
input[type="text"], select, textarea {
  width: 100%; min-height: 52px; padding: var(--s-3) var(--s-4); border-radius: var(--r-sm);
  border: 1.5px solid var(--line); background: var(--blue-50); color: var(--ink); font: 400 1rem/1.4 var(--sans);
  transition: border-color .2s var(--ease-out), background-color .2s var(--ease-out);
}
textarea { resize: vertical; min-height: 96px; }
input[type="text"]:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue-800); background: #fff; box-shadow: 0 0 0 3px rgb(77 138 200 / .25); }
input[aria-invalid="true"] { border-color: #b42318; background: #fff5f4; }
.field-error { color: #b42318; font-size: var(--fs-sm); font-weight: 500; }
.select { position: relative; }
.select select { appearance: none; padding-right: var(--s-7); cursor: pointer; }
.select .i { position: absolute; right: var(--s-4); top: 50%; translate: 0 -50%; pointer-events: none; color: var(--blue-800); }
.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: baseline; gap: .4em; min-height: 44px; align-items: center; padding: 0 var(--s-4);
  border-radius: var(--r-pill); border: 1.5px solid var(--line); background: #fff; color: var(--blue-900); font-weight: 500;
  transition: background-color .2s var(--ease-out), border-color .2s var(--ease-out), color .2s var(--ease-out);
}
.chip small { font-size: .8125rem; color: var(--ink-2); }
.chip input:checked + span { background: var(--blue-800); border-color: var(--blue-800); color: #fff; }
.chip input:checked + span small { color: #cfdaf0; }
.chip input:focus-visible + span { outline: 3px solid var(--orange-500); outline-offset: 2px; }

/* Dove siamo */
.find { display: grid; grid-template-columns: 1.5fr 1fr; gap: clamp(var(--s-6), 4vw, var(--s-8)); align-items: end; margin-bottom: clamp(var(--s-8), 7vw, var(--s-10)); }
.find-step { margin: 0; }
.find-step figcaption { display: flex; align-items: center; gap: var(--s-3); margin-top: var(--s-4); font-weight: 600; color: var(--blue-900); }
.find-n { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--orange-500); color: #fff; font-size: var(--fs-sm); }
.find-aerial { position: relative; border-radius: var(--r-lg); overflow: hidden; background: var(--blue-100); }
.find-aerial img { display: block; width: 100%; height: auto; }
.find-building .scallop { aspect-ratio: 1; }
.route { position: absolute; inset: 0; width: 100%; height: 100%; }
/* tratto pieno sopra quello tratteggiato della foto: si allunga con lo scroll */
.route-path { fill: none; stroke: var(--orange-500); stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; filter: drop-shadow(0 0 4px rgb(255 255 255 / .9)); }
.route-end { fill: var(--orange-500); stroke: #fff; stroke-width: 5; transform-box: fill-box; transform-origin: center; opacity: 0; scale: .4; transition: opacity .3s var(--ease-out), scale .5s var(--ease-out); }
.is-done .route-end { opacity: 1; scale: 1; }
html:not(.js) .route-path { stroke-dashoffset: 0; }
html:not(.js) .route-end { opacity: 1; scale: 1; }
.where-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(var(--s-7), 6vw, var(--s-10)); align-items: center; }
address { font-style: normal; margin-top: var(--s-5); font-size: var(--fs-lg); line-height: 1.6; color: var(--blue-900); }
.where-links { display: flex; flex-wrap: wrap; column-gap: var(--s-6); margin-top: var(--s-5); }
.where-links .link-arrow { margin-top: 0; }
.link-arrow { background: linear-gradient(currentColor, currentColor) 0 calc(100% - 8px) / 0 1.5px no-repeat; transition: background-size .35s var(--ease-out);
  display: inline-flex; align-items: center; gap: var(--s-2); margin-top: var(--s-5); min-height: 44px; font-weight: 600; color: var(--orange-700); text-decoration: none; }
.link-arrow .i { transition: transform .25s var(--ease-out); }
@media (hover: hover) { .link-arrow:hover .i { transform: translate(2px, -2px); } .link-arrow:hover { background-size: calc(100% - 1.3em) 1.5px; } }
.map { position: relative; aspect-ratio: 4 / 3; border-radius: var(--r-lg); overflow: hidden; background: var(--blue-50); border: 1px solid var(--line); }
.map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.map-facade {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: var(--s-4); padding: var(--s-6); text-align: center;
  background:
    repeating-linear-gradient(0deg, transparent 0 46px, rgb(77 138 200 / .12) 46px 48px),
    repeating-linear-gradient(90deg, transparent 0 46px, rgb(77 138 200 / .12) 46px 48px),
    var(--blue-50);
}
.map-pin { width: 64px; height: 64px; padding: 14px; border-radius: 50%; background: #fff; color: var(--orange-700); box-shadow: var(--shadow); }
.map-facade p { max-width: 34ch; color: var(--ink-2); font-size: var(--fs-sm); }

/* Footer */
.site-footer { background: var(--blue-900); color: #c2cfe6; padding-block: var(--s-9) var(--s-7); font-size: var(--fs-sm); }
.site-footer a { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-7) var(--s-9); }
.footer-logo { display: inline-block; background: #fff; border-radius: var(--r-md); padding: var(--s-3) var(--s-4); }
.footer-logo img { width: 160px; }
.footer-brand p { margin-top: var(--s-5); line-height: 1.8; }
.social { list-style: none; margin: var(--s-5) 0 0; padding: 0; display: flex; gap: var(--s-5); }
.social a { display: inline-flex; align-items: center; gap: var(--s-1); min-height: 44px; font-weight: 600; text-decoration: none; }
@media (hover: hover) { .social a:hover { color: var(--orange-500); } }
.legal { margin: 0; display: grid; gap: var(--s-4); align-content: start; }
.legal dt { color: #9fb3d6; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .08em; }
.legal dd { margin: 2px 0 0; color: #fff; }
mark.todo { background: #ffe08a; color: #4a3500; padding: 1px 6px; border-radius: 4px; font-size: .85em; }
.footer-bottom { grid-column: 1 / -1; padding-top: var(--s-5); border-top: 1px solid rgb(255 255 255 / .12); }

/* Barra azioni mobile */
.action-bar { display: none; }
@media (max-width: 767px) {
  .action-bar {
    position: fixed; left: var(--s-3); right: var(--s-3); bottom: max(var(--s-3), env(safe-area-inset-bottom)); z-index: 40;
    display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); padding: var(--s-2);
    background: rgb(255 255 255 / .96); border-radius: var(--r-pill); box-shadow: var(--shadow);
    transform: translateY(140%); transition: transform .45s var(--ease-out);
  }
  .action-bar.is-visible { transform: none; }
  .action-bar .btn { min-height: 48px; padding: 0 1em; }
  .site-footer { padding-bottom: 120px; }
}

/* Responsive */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; min-height: 0; gap: var(--s-6); }
  .hero-visual { width: min(70%, 380px); justify-self: start; order: -1; }
  .studio-grid, .tech-grid, .book-grid, .where-grid, .find, .footer-grid { grid-template-columns: 1fr; }
  .find-building { width: min(80%, 380px); }
  .section-head { grid-template-columns: 1fr; gap: var(--s-4); }
  .section-head p { justify-self: start; }
  .tech-photo { aspect-ratio: 16 / 10; }
}
@media (max-width: 767px) {
  :root { --header-h: 68px; }
  .brand img { width: 140px; }
  .t-list { grid-template-columns: 1fr; }
  .t-item p { padding-right: 0; }
  .steps { grid-template-columns: 1fr; gap: var(--s-6); }
  .steps { --g: var(--s-6); }
  .step { padding: 0 0 0 var(--s-7); }
  .step-line { top: 20px; left: 9px; width: 2px; height: calc(100% + var(--g) - 20px); }
  .step-fill { transform: scaleY(0); transform-origin: top; }
  .rooms-grid { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  .room-wide { grid-column: 1 / -1; grid-row: auto; }
  .room:not(.room-wide) { aspect-ratio: 31 / 18; }
  .hero-actions .btn { width: 100%; }
  .hero-grid { padding-block: var(--s-6) var(--s-7); gap: var(--s-5); }
  .hero-visual { width: min(54%, 240px); justify-self: start; }
  .hero-tag { left: 92%; bottom: 34%; width: max-content; max-width: 150px; padding: var(--s-2) var(--s-3) var(--s-2) var(--s-4); border-radius: var(--r-sm); }
  .hero-tag strong { font-size: .9rem; }
  .hero-lead { margin-top: var(--s-4); font-size: var(--fs-base); }
  .status { margin-top: var(--s-5); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .js .hero-title .w > span, .js .hero-lead, .js .status, .js .hero-actions { transform: none; opacity: 1; }
  .js .hero-photo { clip-path: none; }
  .js .scallop-ring { opacity: 1; scale: 1; }
  .js .reveal { clip-path: none; } .js .reveal img { scale: 1; }
  .step::before { background: var(--orange-500); }
  .js .section-head h2, .js .rooms-title, .js .section-head p, .js .t-list .t-item, .js .booking { opacity: 1; translate: none; }
  .js .section-head h2::after { transform: none; }
  .js .hero-photo img { scale: 1; } .js .dot, .js .hero-tag { opacity: 1; scale: 1; }
  .js .statement[data-words] .sw { color: inherit; }
  .step-fill { transform: none !important; }
  .route-path { stroke-dashoffset: 0 !important; }
}
