/* =========================================================
   Dott.ssa Antonella Cobianco — Psicologa Clinica, Como
   Royaletiger — foglio di stile unico
   ========================================================= */

@font-face {
  font-family: 'Cormorant Garamond';
  src: url('../fonts/cormorant-garamond.woff2') format('woff2-variations');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter.woff2') format('woff2-variations');
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* palette — dedotta dal logo (monogramma salvia su avorio) */
  --brand: #2C4A46;
  --brand-dark: #1E3532;
  --accent: #7FA79E;
  --accent-soft: #A8C4BC;
  --accent-pale: #E4EEEA;

  --ink: #1E3532;
  --text: #4A5A57;
  --muted: #7C8B88;

  --bg: #FAF7F2;
  --bg-alt: #F2EDE5;
  --bg-dark: #2C4A46;
  --line: #E3DCD1;

  --font-display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --shadow-sm: 0 2px 10px rgba(30, 53, 50, .06);
  --shadow-md: 0 10px 30px rgba(30, 53, 50, .09);
  --shadow-lg: 0 24px 60px rgba(30, 53, 50, .14);

  --radius: 14px;
  --radius-lg: 24px;
  --container: 1200px;
  --nav-h: 104px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden; /* il menu mobile fuori schermo non deve creare scroll laterale */
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration: none; transition: color .25s var(--ease); }
a:hover { color: var(--accent); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.15;
  font-weight: 600;
  margin: 0 0 .5em;
  letter-spacing: -.01em;
}
h1 { font-size: clamp(2.4rem, 5.6vw, 4.2rem); }
h2 { font-size: clamp(1.9rem, 3.8vw, 3rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.55rem); }
h4 { font-size: 1.1rem; }
p { margin: 0 0 1.1em; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.section { padding: clamp(64px, 9vw, 118px) 0; }
.section-alt { background: var(--bg-alt); }
.section-dark { background: var(--bg-dark); color: #D9E4E1; }
.section-dark h2, .section-dark h3 { color: #FAF7F2; }
.section-tight { padding: clamp(48px, 6vw, 78px) 0; }

.eyebrow {
  display: inline-block;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.section-dark .eyebrow { color: var(--accent-soft); }

.lead { font-size: 1.14rem; color: var(--text); max-width: 62ch; }
.section-dark .lead { color: #C9D8D4; }

.section-head { max-width: 760px; margin-bottom: clamp(38px, 5vw, 62px); }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

/* ---------- bottoni ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 30px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: .01em;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform .3s var(--ease), background .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--brand); color: #FAF7F2; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--brand-dark); color: #fff; box-shadow: var(--shadow-md); }
.btn-outline { border-color: var(--brand); color: var(--brand); background: transparent; }
.btn-outline:hover { background: var(--brand); color: #FAF7F2; }
.section-dark .btn-outline { border-color: var(--accent-soft); color: #FAF7F2; }
.section-dark .btn-outline:hover { background: var(--accent-soft); color: var(--brand-dark); }
.btn-light { background: #FAF7F2; color: var(--brand-dark); }
.btn-light:hover { background: #fff; }
.btn svg { width: 17px; height: 17px; flex: none; }

/* ---------- topbar + header ---------- */
.topbar {
  background: var(--brand-dark);
  color: #C9D8D4;
  font-size: .85rem;
}
.topbar .container {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; min-height: 42px; flex-wrap: wrap;
}
.topbar a { color: #C9D8D4; display: inline-flex; align-items: center; gap: 7px; }
.topbar a:hover { color: #fff; }
.topbar-list { display: flex; gap: 22px; flex-wrap: wrap; }
.topbar svg { width: 15px; height: 15px; opacity: .8; }

.site-header {
  position: sticky; top: 0; z-index: 90;
  background: rgba(250, 247, 242, .92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .3s var(--ease), background .3s var(--ease);
}
.site-header.is-scrolled { box-shadow: var(--shadow-sm); background: rgba(250, 247, 242, .98); }
.nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; min-height: var(--nav-h);
  transition: min-height .35s var(--ease);
}
.site-header.is-scrolled .nav { min-height: 84px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo {
  width: 196px; height: auto;
  transition: opacity .3s var(--ease), width .35s var(--ease);
}
.site-header.is-scrolled .brand-logo { width: 156px; }
.brand:hover .brand-logo { opacity: .78; }

.nav-menu { display: flex; align-items: center; gap: 6px; list-style: none; margin: 0; padding: 0; }
.nav-menu a {
  display: block; padding: 10px 15px; border-radius: 999px;
  font-size: .95rem; font-weight: 500; color: var(--text);
}
.nav-menu a:hover { color: var(--brand); background: var(--accent-pale); }
.nav-menu a[aria-current="page"] { color: var(--brand); font-weight: 600; }
.nav-cta { margin-left: 10px; }
/* il bottone in barra non deve ereditare colore e padding delle voci di menu */
.nav-menu a.btn { padding: 14px 26px; }
.nav-menu a.btn-primary { color: #FAF7F2; background: var(--brand); }
.nav-menu a.btn-primary:hover { color: #fff; background: var(--brand-dark); }

.nav-toggle {
  display: none; width: 46px; height: 46px; border: 1px solid var(--line);
  border-radius: 12px; background: transparent; cursor: pointer;
  align-items: center; justify-content: center; flex-direction: column; gap: 5px;
}
.nav-toggle span {
  display: block; width: 20px; height: 1.6px; background: var(--ink);
  transition: transform .3s var(--ease), opacity .25s var(--ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.6px) rotate(-45deg); }

/* ---------- hero home ---------- */
.hero {
  position: relative;
  padding: clamp(70px, 10vw, 130px) 0 clamp(60px, 8vw, 110px);
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 100%);
  overflow: hidden;
}
.hero::after {
  content: ''; position: absolute; inset: auto 0 0 0; height: 46%;
  background: url('../img/sfondo-fiori.webp') bottom center / cover no-repeat;
  opacity: .28; pointer-events: none;
}
.hero .container { position: relative; z-index: 2; }
.hero-grid {
  display: grid; grid-template-columns: 1.08fr .92fr;
  gap: clamp(34px, 5vw, 70px); align-items: center;
}
.hero h1 { margin-bottom: .35em; }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.hero-badges {
  display: flex; flex-wrap: wrap; gap: 26px; margin-top: 40px;
  padding-top: 28px; border-top: 1px solid var(--line);
}
.hero-badge strong {
  display: block; font-family: var(--font-display);
  font-size: 1.85rem; color: var(--brand); line-height: 1.1;
}
.hero-badge span { font-size: .86rem; color: var(--muted); }

.hero-media { position: relative; }
.hero-media img {
  width: 100%; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); object-fit: cover;
}
.hero-media::before {
  content: ''; position: absolute; inset: 18px -18px -18px 18px;
  border: 1.5px solid var(--accent-soft); border-radius: var(--radius-lg);
  z-index: -1;
}

/* ---------- hero pagine interne ---------- */
.page-hero {
  position: relative;
  padding: clamp(56px, 7vw, 96px) 0 clamp(46px, 6vw, 76px);
  background: var(--bg-alt);
  overflow: hidden;
  text-align: center;
}
.page-hero::before {
  content: ''; position: absolute; inset: 0;
  background-position: center; background-size: cover;
  opacity: .16;
}
.page-hero .container { position: relative; z-index: 2; }
.page-hero h1 { margin-bottom: .3em; }
.page-hero .lead { margin: 0 auto; }

.breadcrumb {
  list-style: none; display: flex; flex-wrap: wrap; justify-content: center;
  gap: 8px; padding: 0; margin: 0 0 18px; font-size: .85rem; color: var(--muted);
}
.breadcrumb li + li::before { content: '/'; margin-right: 8px; color: var(--accent-soft); }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--brand); }

/* ---------- griglie e card ---------- */
.grid { display: grid; gap: 26px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 34px 30px; box-shadow: var(--shadow-sm);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s var(--ease);
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: var(--accent-soft); }
.card h3 { margin-bottom: .45em; }
.card p:last-child { margin-bottom: 0; }

.card-icon {
  width: 56px; height: 56px; border-radius: 16px;
  background: var(--accent-pale); color: var(--brand);
  display: flex; align-items: center; justify-content: center; margin-bottom: 22px;
}
.card-icon svg { width: 26px; height: 26px; }

.service-card { overflow: hidden; padding: 0; display: flex; flex-direction: column; }
.service-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.service-card-body { padding: 28px 28px 32px; flex: 1; display: flex; flex-direction: column; }
.service-card-body .eyebrow { margin-bottom: 8px; }
.service-card-body p:last-of-type { margin-bottom: 0; }
.service-card .card-link { margin-top: 18px; }

.card-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .92rem; font-weight: 600; color: var(--brand);
}
.card-link svg { width: 15px; height: 15px; transition: transform .3s var(--ease); }
.card-link:hover svg { transform: translateX(4px); }

/* ---------- split ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(34px, 5vw, 70px); align-items: center; }
.split.reverse .split-media { order: 2; }
.split-media img { border-radius: var(--radius-lg); box-shadow: var(--shadow-md); width: 100%; object-fit: cover; }
.split-body h2 { margin-bottom: .5em; }

.check-list { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 14px; }
.check-list li { display: flex; gap: 12px; align-items: flex-start; font-size: 1rem; }
.check-list svg { width: 20px; height: 20px; flex: none; color: var(--accent); margin-top: 3px; }

/* ---------- accordion competenze ---------- */
.accordion { border-top: 1px solid var(--line); margin-top: 30px; }
.accordion-item { border-bottom: 1px solid var(--line); }
.accordion-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  gap: 18px; padding: 22px 0; background: none; border: 0; cursor: pointer;
  font-family: var(--font-display); font-size: 1.2rem; font-weight: 600;
  color: var(--ink); text-align: left;
}
.accordion-btn:hover { color: var(--brand); }
.accordion-btn .plus { position: relative; width: 18px; height: 18px; flex: none; }
.accordion-btn .plus::before,
.accordion-btn .plus::after {
  content: ''; position: absolute; background: var(--accent);
  left: 0; top: 8px; width: 18px; height: 1.8px; transition: transform .3s var(--ease);
}
.accordion-btn .plus::after { transform: rotate(90deg); }
.accordion-btn[aria-expanded="true"] .plus::after { transform: rotate(0); }
.accordion-panel { overflow: hidden; max-height: 0; transition: max-height .45s var(--ease); }
.accordion-panel > div { padding: 0 0 24px; color: var(--text); }

/* ---------- galleria ---------- */
.gallery-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
.gallery-grid button {
  padding: 0; border: 0; background: none; cursor: zoom-in;
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm);
  display: block; aspect-ratio: 1 / 1;
}
.gallery-grid img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s var(--ease);
}
.gallery-grid button:hover img { transform: scale(1.06); }

.lightbox {
  position: fixed; inset: 0; z-index: 200; display: none;
  align-items: center; justify-content: center;
  background: rgba(30, 53, 50, .93); padding: 24px;
}
.lightbox.is-open { display: flex; }
.lightbox img { max-width: min(92vw, 900px); max-height: 86vh; border-radius: var(--radius); }
.lightbox-close, .lightbox-nav {
  position: absolute; background: rgba(250, 247, 242, .12); border: 1px solid rgba(250, 247, 242, .3);
  color: #FAF7F2; width: 48px; height: 48px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
  transition: background .25s var(--ease);
}
.lightbox-close:hover, .lightbox-nav:hover { background: rgba(250, 247, 242, .26); }
.lightbox-close { top: 22px; right: 22px; }
.lightbox-nav.prev { left: 22px; top: 50%; transform: translateY(-50%); }
.lightbox-nav.next { right: 22px; top: 50%; transform: translateY(-50%); }

/* ---------- blog ---------- */
.post-card { overflow: hidden; padding: 0; display: flex; flex-direction: column; }
.post-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.post-card-body { padding: 26px 28px 30px; display: flex; flex-direction: column; flex: 1; }
.post-card h3 { font-size: 1.28rem; }
.post-card .card-link { margin-top: auto; padding-top: 16px; }
.post-meta { font-size: .82rem; color: var(--muted); margin-bottom: 10px; letter-spacing: .04em; }

.article { max-width: 760px; margin: 0 auto; }
.article > p:first-of-type { font-size: 1.15rem; color: var(--ink); }
.article h2 { margin-top: 1.7em; font-size: clamp(1.6rem, 2.6vw, 2.1rem); }
.article h3 { margin-top: 1.5em; }
.article ul { padding-left: 1.2em; margin: 0 0 1.3em; }
.article li { margin-bottom: .5em; }
.article figure { margin: 34px 0; }
.article figure img { border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.article figcaption { font-size: .85rem; color: var(--muted); margin-top: 10px; text-align: center; }

.pullquote {
  margin: 40px 0; padding: 30px 34px; background: var(--accent-pale);
  border-left: 3px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0;
  font-family: var(--font-display); font-size: 1.35rem; line-height: 1.45; color: var(--ink);
}
.pullquote strong { font-weight: 600; }

.steps { list-style: none; padding: 0; margin: 34px 0; display: grid; gap: 20px; }
.steps li {
  display: grid; grid-template-columns: 46px 1fr; gap: 18px; align-items: start;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 24px; box-shadow: var(--shadow-sm);
}
.steps .num {
  width: 46px; height: 46px; border-radius: 50%; background: var(--brand); color: #FAF7F2;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 1.2rem; font-weight: 600;
}
.steps h3 { margin: 0 0 .3em; font-size: 1.12rem; }
.steps p { margin: 0; font-size: .98rem; }

/* ---------- contatti ---------- */
.contact-grid { display: grid; grid-template-columns: .92fr 1.08fr; gap: clamp(34px, 5vw, 64px); align-items: start; }
.contact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 22px; }
.contact-list li { display: grid; grid-template-columns: 48px 1fr; gap: 16px; align-items: start; }
.contact-ico {
  width: 48px; height: 48px; border-radius: 14px; background: var(--accent-pale); color: var(--brand);
  display: flex; align-items: center; justify-content: center;
}
.contact-ico svg { width: 22px; height: 22px; }
.contact-list h3 { font-size: 1rem; margin: 0 0 2px; font-family: var(--font-body); font-weight: 600; }
.contact-list a, .contact-list p { color: var(--text); margin: 0; }

.form-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: clamp(28px, 4vw, 42px); box-shadow: var(--shadow-md);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: .88rem; font-weight: 600; color: var(--ink); margin-bottom: 7px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 13px 16px; border: 1px solid var(--line); border-radius: 12px;
  font-family: var(--font-body); font-size: 1rem; color: var(--ink); background: var(--bg);
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(127, 167, 158, .18);
}
.field textarea { min-height: 140px; resize: vertical; }
.field-check { display: flex; gap: 11px; align-items: flex-start; font-size: .88rem; color: var(--muted); }
.field-check input { width: auto; margin-top: 4px; flex: none; }
.form-note { font-size: .84rem; color: var(--muted); margin-top: 16px; }
.form-status { margin-top: 16px; font-size: .93rem; font-weight: 500; }
.form-status.ok { color: var(--brand); }
.form-status.err { color: #B5462F; }

.map-card {
  margin-top: 40px; border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow-sm);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 26px 30px; flex-wrap: wrap;
}

/* ---------- CTA banner ---------- */
.cta-banner { background: var(--bg-dark); color: #D9E4E1; text-align: center; }
.cta-banner h2 { color: #FAF7F2; }
.cta-banner .lead { margin: 0 auto 30px; color: #C9D8D4; }
.cta-banner .eyebrow { color: var(--accent-soft); }
.cta-banner .btn-outline { border-color: var(--accent-soft); color: #FAF7F2; }
.cta-banner .btn-outline:hover { background: var(--accent-soft); color: var(--brand-dark); }
.cta-actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }

/* ---------- footer ---------- */
.site-footer { background: var(--brand-dark); color: #B9CBC7; padding: clamp(56px, 7vw, 82px) 0 0; }
.footer-grid {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: 40px;
  padding-bottom: 46px;
}
.site-footer h4 {
  color: #FAF7F2; font-family: var(--font-body); font-size: .82rem;
  letter-spacing: .16em; text-transform: uppercase; margin-bottom: 20px;
}
.site-footer a { color: #B9CBC7; }
.site-footer a:hover { color: #FAF7F2; }
.footer-logo { width: 190px; margin-bottom: 20px; }
.footer-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 11px; font-size: .95rem; }
.footer-contact li { display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; }
.footer-contact svg { width: 17px; height: 17px; color: var(--accent-soft); flex: none; margin-top: 4px; }
.footer-social { display: flex; gap: 12px; margin-top: 22px; }
.footer-social a {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(250, 247, 242, .2);
  display: flex; align-items: center; justify-content: center;
  transition: background .25s var(--ease), border-color .25s var(--ease);
}
.footer-social a:hover { background: rgba(250, 247, 242, .12); border-color: var(--accent-soft); }
.footer-social svg { width: 17px; height: 17px; }
.footer-bottom {
  border-top: 1px solid rgba(250, 247, 242, .14); padding: 24px 0 30px;
  display: flex; flex-wrap: wrap; gap: 10px 26px; justify-content: space-between;
  font-size: .85rem; color: #9DB3AE;
}
.footer-bottom-links { display: flex; flex-wrap: wrap; gap: 10px 22px; }

/* ---------- azioni flottanti ---------- */
.floating {
  position: fixed; right: 18px; bottom: 18px; z-index: 80;
  display: flex; flex-direction: column; gap: 12px;
}
.floating a {
  width: 54px; height: 54px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; box-shadow: var(--shadow-md);
  transition: transform .3s var(--ease);
}
.floating a:hover { transform: translateY(-3px); }
.floating svg { width: 25px; height: 25px; }
.fab-wa { background: #25D366; color: #fff; }
.fab-tel { background: var(--brand); color: #FAF7F2; }

/* ---------- reveal ---------- */
.js .reveal {
  opacity: 0; transform: translateY(28px);
  transition: opacity .85s var(--ease), transform .85s var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
.js .reveal.is-visible { opacity: 1; transform: none; will-change: auto; }

/* ---------- barra di avanzamento lettura ---------- */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px;
  z-index: 95; pointer-events: none; background: transparent;
}
.scroll-progress span {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--brand));
  transition: width .12s linear;
}

/* ---------- torna su ---------- */
.to-top {
  position: fixed; left: 18px; bottom: 18px; z-index: 80;
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(250, 247, 242, .94);
  color: var(--brand); cursor: pointer; box-shadow: var(--shadow-sm);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity .35s var(--ease), transform .35s var(--ease), visibility .35s var(--ease), background .25s var(--ease);
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: #fff; transform: translateY(-2px); }
.to-top svg { width: 19px; height: 19px; }

/* ---------- parallasse leggera dell'hero ---------- */
.hero::after { will-change: transform; transform: translate3d(0, var(--hero-shift, 0px), 0); }

/* ---------- micro-interazioni immagini ---------- */
.split-media, .hero-media { overflow: hidden; border-radius: var(--radius-lg); }
.split-media img, .hero-media img { transition: transform 1s var(--ease); }
.split-media:hover img, .hero-media:hover img { transform: scale(1.03); }
.service-card img, .post-card img { transition: transform .9s var(--ease); }
.service-card:hover img, .post-card:hover img { transform: scale(1.05); }
.service-card, .post-card { will-change: transform; }

/* ---------- comparsa dolce al caricamento ---------- */
body { animation: page-in .5s var(--ease) both; }
@keyframes page-in { from { opacity: 0 } to { opacity: 1 } }

/* ---------- pagina 404 ---------- */
.error-page { text-align: center; padding: clamp(80px, 12vw, 150px) 0; }
.error-code {
  font-family: var(--font-display); font-size: clamp(5rem, 16vw, 10rem);
  color: var(--accent-soft); line-height: 1; margin-bottom: 10px;
}

/* ---------- pagine legali ---------- */
.legal { max-width: 800px; margin: 0 auto; }
.legal h2 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); margin-top: 1.8em; }
.legal ul { padding-left: 1.2em; }
.legal li { margin-bottom: .45em; }
.legal table { width: 100%; border-collapse: collapse; margin: 22px 0; font-size: .94rem; }
.legal th, .legal td { border: 1px solid var(--line); padding: 11px 14px; text-align: left; }
.legal th { background: var(--bg-alt); font-weight: 600; color: var(--ink); }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 34px; }
}

@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  .nav-menu {
    position: fixed; inset: 0 0 0 auto; width: min(86vw, 360px);
    background: var(--bg); flex-direction: column; align-items: stretch;
    justify-content: flex-start; gap: 4px; padding: 100px 26px 40px;
    transform: translateX(100%); visibility: hidden;
    transition: transform .38s var(--ease), visibility .38s var(--ease);
    box-shadow: var(--shadow-lg); overflow-y: auto;
  }
  .nav-menu.is-open { transform: none; visibility: visible; }
  .nav-menu a { padding: 14px 16px; font-size: 1.05rem; border-radius: 12px; }
  .nav-cta { margin: 14px 0 0; }
  .nav-cta .btn { width: 100%; justify-content: center; }

  .hero-grid, .split, .contact-grid { grid-template-columns: 1fr; }
  .split.reverse .split-media { order: 0; }
  .hero-media::before { display: none; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .topbar .container { justify-content: center; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .form-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; align-items: center; }
  .hero-badges { gap: 20px; }
}

@media (max-width: 480px) {
  body { font-size: 1rem; }
  .container { padding: 0 18px; }
  .card { padding: 28px 24px; }
  .brand-logo { width: 168px; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .to-top { left: 14px; bottom: 14px; width: 42px; height: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .hero::after { transform: none !important; }
  .split-media:hover img, .hero-media:hover img,
  .service-card:hover img, .post-card:hover img { transform: none; }
}
