/* =========================================================
   Paul Puciu · Numerologo — "Radici & Numeri"
   ========================================================= */

/* ---------- Font (self-hosted, Fontshare ITF Free Font License) ---------- */
@font-face { font-family: 'Erode'; font-style: normal; font-weight: 300 700; font-display: swap; src: url('../assets/fonts/erode-variable.woff2') format('woff2'); }
@font-face { font-family: 'Erode'; font-style: italic; font-weight: 300 700; font-display: swap; src: url('../assets/fonts/erode-variable-italic.woff2') format('woff2'); }
@font-face { font-family: 'Satoshi'; font-style: normal; font-weight: 300 900; font-display: swap; src: url('../assets/fonts/satoshi-variable.woff2') format('woff2'); }
@font-face { font-family: 'Satoshi'; font-style: italic; font-weight: 300 900; font-display: swap; src: url('../assets/fonts/satoshi-variable-italic.woff2') format('woff2'); }

/* ---------- Token ---------- */
:root {
  --plum-900: #2E1838;
  --plum-800: #3A2146; /* superficie su plum-900 */
  --plum-700: #3F1B4F; /* logo */
  --sand-300: #ECE0B8; /* logo */
  --sand-200: #EFE6CC;
  --ivory-50: #FBF8F1;
  --coral-500: #D04A53; /* logo: solo accenti / testo grande */
  --coral-600: #C03F48; /* bottoni: bianco 5.2:1 */
  --coral-700: #A8343D; /* testo piccolo su chiaro: AA su avorio e sabbia */
  --mauve-500: #7A6A85; /* solo decorativo */
  --ink-soft: #5E4F6A;  /* testo secondario: AA anche su sabbia */
  --white: #FFFFFF;

  --font-display: 'Erode', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Satoshi', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --text-sm: .875rem;   /* etichette, note: niente sotto i 14px */
  --text-lead: clamp(1.125rem, 1.05rem + .3vw, 1.25rem);

  --header-h: 76px;
  --radius: 20px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(.23, 1, .32, 1); /* ingressi e feedback */
  --ease-in-out: cubic-bezier(.77, 0, .175, 1);
  --ease-drawer: cubic-bezier(.32, .72, 0, 1); /* pannelli che salgono dal basso, come su iOS */
  --shadow: 0 18px 40px -24px rgba(46, 24, 56, .35);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); /* sezioni e campi a fuoco non finiscono sotto l'intestazione fissa */ -webkit-text-size-adjust: 100%; scrollbar-color: rgba(63, 27, 79, .35) var(--ivory-50); }
/* Lenis (js/vendor/lenis.js): quando è attivo guida lui lo scorrimento, lo smooth nativo lo intralcerebbe */
html.lenis, html.lenis body { height: auto; }
html.lenis { scroll-behavior: auto; }
.lenis:not(.lenis-autoToggle).lenis-stopped { overflow: clip; }
.lenis.lenis-smooth iframe { pointer-events: none; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--plum-700);
  background: var(--ivory-50);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: .22em; text-decoration-thickness: 1px; }
p { margin: 0 0 1em; text-wrap: pretty; }
::selection { background: rgba(208, 74, 83, .22); color: var(--plum-900); }
.section--dark ::selection { background: rgba(236, 224, 184, .28); color: var(--ivory-50); }
input, textarea { caret-color: var(--coral-600); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; line-height: 1.04; margin: 0 0 .5em; letter-spacing: -.02em; text-wrap: balance; }
.step__number, .calc__number { font-variant-numeric: lining-nums; }
h2 { font-size: clamp(2.2rem, 1.6rem + 2.6vw, 3.6rem); }
h3 { font-size: clamp(1.5rem, 1.3rem + .6vw, 1.85rem); }
/* Una parola in corsivo corallo nei titoli, come nei libri dei corsi */
:is(h1, h2) em { font-style: italic; font-weight: 400; color: var(--coral-600); }
:focus-visible { outline: 2px solid var(--coral-600); outline-offset: 3px; border-radius: 4px; }

.container { width: min(1160px, 100%); margin-inline: auto; padding-inline: clamp(1.25rem, 4vw, 2.5rem); }
.container--narrow { width: min(820px, 100%); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 100; padding: .75rem 1.25rem; background: var(--plum-700); color: var(--ivory-50); border-radius: 999px; }
.skip-link:focus { top: 1rem; }

/* Segnaposto da sostituire: volutamente evidenti */
mark.ph {
  background: #FFE9A8;
  color: #5A3D00;
  outline: 1px dashed #C99A00;
  border-radius: 4px;
  padding: 0 .3em;
  font-family: var(--font-body);
  font-size: .85em;
  font-style: normal;
  letter-spacing: 0;
}

/* ---------- Bottoni ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  min-height: 3.25rem;
  padding: .85rem 1.75rem;
  border: 1.5px solid transparent;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: .9375rem;
  font-weight: 700;
  letter-spacing: 0;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .16s var(--ease-out);
}
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--coral-600); color: var(--white); }
.btn--ghost { border-color: var(--plum-700); color: var(--plum-700); }
@media (hover: hover) and (pointer: fine) {
  .btn--primary:hover { background: var(--plum-700); }
  .section--dark .btn--primary:hover { background: var(--ivory-50); color: var(--plum-700); }
  .btn--ghost:hover { background: var(--plum-700); color: var(--ivory-50); }
}
.btn--small { min-height: 2.75rem; padding: .55rem 1.25rem; font-size: .875rem; }
.btn--block { width: 100%; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--ivory-50);
  transition: box-shadow .3s ease;
}
.site-header.is-scrolled { box-shadow: 0 6px 24px -18px rgba(46, 24, 56, .4); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); }

.brand { display: flex; flex-shrink: 0; align-items: center; gap: .75rem; text-decoration: none; }
.brand__mark { width: 44px; height: 44px; border-radius: 50%; mix-blend-mode: multiply; }
.brand__text { display: flex; flex-direction: column; line-height: 1.25; }
.brand__name { font-weight: 700; font-size: .95rem; letter-spacing: .2em; text-transform: uppercase; }
/* Il wordmark riprende il lockup del logo: unico maiuscolo spaziato della pagina */
.brand__role { font-weight: 500; font-size: .6875rem; letter-spacing: .42em; text-transform: uppercase; color: var(--coral-700); }

.site-nav ul { display: flex; align-items: center; gap: clamp(1.25rem, 2.2vw, 2.25rem); margin: 0; padding: 0; list-style: none; }
.site-nav a:not(.btn) {
  position: relative;
  font-size: .9375rem;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  transition: color .2s ease;
}
.site-nav a:not(.btn)::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 1.5px;
  border-radius: 1px;
  background: var(--coral-600);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s var(--ease-out);
}
.site-nav a.is-current::after { transform: scaleX(1); }
@media (hover: hover) and (pointer: fine) { .site-nav a:not(.btn):hover::after { transform: scaleX(1); } }

.nav-toggle { display: none; }

.scroll-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; display: none; }
.scroll-progress span { display: block; height: 100%; width: 100%; background: var(--coral-600); transform: scaleX(var(--progress, 0)); transform-origin: left; }

/* Otto voci: sotto i 1180px non stanno più su una riga, quindi passa al menu a tendina */
@media (max-width: 1180px) {
  .nav-toggle {
    display: grid;
    place-items: center;
    width: 44px; height: 44px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--plum-700);
    cursor: pointer;
  }
  .nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after {
    display: block;
    width: 24px; height: 1.5px;
    background: currentColor;
    transition: transform .2s var(--ease-out), background-color .15s ease;
  }
  .nav-toggle__bars { position: relative; }
  .nav-toggle__bars::before, .nav-toggle__bars::after { content: ''; position: absolute; left: 0; }
  .nav-toggle__bars::before { top: -7px; }
  .nav-toggle__bars::after { top: 7px; }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { transform: translateY(-7px) rotate(-45deg); }

  .site-nav {
    position: absolute;
    top: var(--header-h);
    left: 0; right: 0;
    background: var(--ivory-50);
    box-shadow: var(--shadow);
    /* Uscita più rapida dell'entrata; visibility tiene il menu chiuso fuori dal tab order */
    visibility: hidden;
    opacity: 0;
    translate: 0 -8px;
    transition: opacity .15s ease, translate .15s ease, visibility 0s linear .15s;
  }
  .nav-scrim {
    position: fixed;
    inset: var(--header-h) 0 0;
    z-index: 45;
    background: rgba(46, 24, 56, .38);
    opacity: 0;
    visibility: hidden;
    transition: opacity .15s ease, visibility 0s linear .15s;
  }
  .nav-scrim.is-open { opacity: 1; visibility: visible; transition: opacity .2s var(--ease-out), visibility 0s; }
  .site-nav.is-open {
    visibility: visible;
    opacity: 1;
    translate: none;
    transition: opacity .2s var(--ease-out), translate .2s var(--ease-out), visibility 0s;
  }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 0; padding: .5rem clamp(1.25rem, 4vw, 2.5rem) 1.5rem; }
  .site-nav li a:not(.btn) { display: block; padding: .9rem 0; font-family: var(--font-display); font-size: 1.5rem; line-height: 1.2; }
  .site-nav li a:not(.btn)::after { display: none; }
  .site-nav .btn { margin-top: 1.25rem; width: 100%; }
}

/* ---------- Indicatore: Albero della Vita ---------- */
.tree-nav {
  position: fixed;
  right: 1.25rem;
  top: 50%;
  z-index: 40;
  width: 68px;
  padding: .85rem .7rem;
  background: var(--sand-200);
  border-radius: 999px;
  transform: translateY(-50%);
}
/* Etichetta della voce sotto il puntatore o il focus: il nome della sezione accanto all'albero */
.tree-nav__label {
  position: absolute;
  right: calc(100% + .6rem);
  top: var(--y, 50%);
  padding: .35rem .8rem;
  border-radius: 999px;
  background: var(--plum-700);
  color: var(--ivory-50);
  font-size: var(--text-sm);
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  translate: 4px -50%;
  transition: opacity .125s var(--ease-out), translate .125s var(--ease-out);
}
.tree-nav__label.is-shown { opacity: 1; translate: 0 -50%; }
.tree--nav .tree__paths line { stroke: var(--plum-700); stroke-opacity: .25; stroke-width: 5; }
.tree-nav__link circle:not(.tree-nav__hit) {
  fill: var(--ivory-50);
  stroke: var(--plum-700);
  stroke-width: 6;
  transform-box: fill-box;
  transform-origin: center;
  transition: fill .2s ease, stroke .2s ease, transform .3s var(--ease-out);
}
@media (hover: hover) and (pointer: fine) { .tree-nav__link:hover circle:not(.tree-nav__hit) { fill: var(--plum-700); } }
.tree-nav__link:focus { outline: none; }
.tree-nav__hit { fill: transparent; }
.tree-nav__link:focus-visible circle:not(.tree-nav__hit) { stroke: var(--coral-600); stroke-width: 12; }
.tree-nav__link.is-active circle:not(.tree-nav__hit) { fill: var(--coral-600); stroke: var(--coral-600); transform: scale(1.3); }

/* Il nome della sefira sopra il titolo di ogni sezione */
@media (max-width: 1279px) {
  .tree-nav { display: none; }
  .scroll-progress { display: block; }
}

/* Sul telefono l'albero sta in un bottone in basso a destra e si apre in un pannello con i nomi delle sezioni */
.tree-fab {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 40;
  display: none;
  place-items: center;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--sand-200);
  box-shadow: 0 10px 24px -10px rgba(46, 24, 56, .45), 0 0 0 1px rgba(63, 27, 79, .08);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  translate: 0 14px;
  scale: .9;
  transition: opacity .18s var(--ease-out), translate .18s var(--ease-out), scale .18s var(--ease-out), visibility 0s linear .18s;
}
/* Entra salendo appena, poi i punti dell'albero si accendono uno dopo l'altro da Keter a Malkhut */
.tree-fab.is-shown { opacity: 1; visibility: visible; translate: 0 0; scale: 1; transition: opacity .28s var(--ease-out), translate .28s var(--ease-out), scale .28s var(--ease-out), visibility 0s; }
.tree-fab.is-shown:active { scale: .94; transition-duration: .28s, .28s, .12s, 0s; }
.tree-fab .tree-nav__dot { opacity: 0; scale: .5; }
.tree-fab.is-shown .tree-nav__dot {
  opacity: 1;
  scale: 1;
  transition: opacity .2s var(--ease-out), scale .3s var(--ease-out), fill .2s ease, stroke .2s ease;
  transition-delay: calc(140ms + var(--i) * 30ms), calc(140ms + var(--i) * 30ms), 0s, 0s;
}
.tree-fab:focus-visible { outline: 3px solid var(--coral-600); outline-offset: 3px; }
.tree--fab { width: auto; height: 38px; }
.tree--fab .tree__paths line, .tree--sheet .tree__paths line { stroke: var(--plum-700); stroke-opacity: .3; stroke-width: 7; }
.tree-nav__dot { fill: var(--ivory-50); stroke: var(--plum-700); stroke-width: 8; transform-box: fill-box; transform-origin: center; transition: fill .2s ease, stroke .2s ease; }
.tree-nav__dot.is-active { fill: var(--coral-600); stroke: var(--coral-600); }
@media (max-width: 1279px) { .tree-fab { display: grid; } }

.tree-sheet {
  position: fixed;
  inset: auto 0 0;
  width: 100%;
  max-width: 34rem;
  max-height: min(88dvh, 40rem);
  margin: 0 auto;
  padding: 0;
  border: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--ivory-50);
  color: var(--plum-700);
  overflow: auto;
  overscroll-behavior: contain;
  translate: 0 100%;
  transition: translate .24s var(--ease-out), overlay .24s allow-discrete, display .24s allow-discrete;
}
/* Sale con la curva dei pannelli iOS; poi ogni voce arriva insieme al suo punto sull'albero, dall'alto in basso */
.tree-sheet[open] { translate: 0 0; transition: translate .42s var(--ease-drawer), overlay .42s allow-discrete, display .42s allow-discrete; }
@starting-style { .tree-sheet[open] { translate: 0 100%; } }
.tree-sheet::backdrop { background: rgba(46, 24, 56, 0); transition: background-color .24s ease, overlay .24s allow-discrete, display .24s allow-discrete; }
.tree-sheet[open]::backdrop { background: rgba(46, 24, 56, .45); }
@starting-style { .tree-sheet[open]::backdrop { background: rgba(46, 24, 56, 0); } }
.tree-sheet[open] .tree-sheet__list li,
.tree-sheet[open] .tree-nav__dot { transition: opacity .3s var(--ease-out) calc(90ms + var(--i) * 30ms), translate .3s var(--ease-out) calc(90ms + var(--i) * 30ms), scale .35s var(--ease-out) calc(90ms + var(--i) * 30ms), fill .2s ease, stroke .2s ease; }
.tree-sheet[open] .tree__paths { transition: opacity .5s var(--ease-out) .1s; }
@starting-style {
  .tree-sheet[open] .tree-sheet__list li { opacity: 0; translate: 0 10px; }
  .tree-sheet[open] .tree-nav__dot { opacity: 0; scale: .5; }
  .tree-sheet[open] .tree__paths { opacity: 0; }
}
.tree-sheet__head { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1rem .25rem 1.5rem; }
.tree-sheet__title { margin: 0; font-family: var(--font-display); font-size: 1.35rem; font-style: italic; }
.tree-sheet__close { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
.tree-sheet__close svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.tree-sheet__close:focus-visible { outline: 3px solid var(--coral-600); outline-offset: -3px; }
.tree-sheet__body { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 1rem; padding: .25rem 1rem calc(1.25rem + env(safe-area-inset-bottom)) 1.5rem; }
.tree--sheet { width: auto; height: min(40dvh, 17rem); }
.tree-sheet__list { margin: 0; padding: 0; list-style: none; }
.tree-sheet__link {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 44px;
  padding: .35rem 1rem;
  border-radius: 14px;
  line-height: 1.25;
  color: inherit;
  font-weight: 500;
  text-decoration: none;
  transition: background-color .2s ease, color .2s ease;
}
.tree-sheet__link.is-active { background: var(--plum-700); color: var(--ivory-50); }
.tree-sheet__link:focus-visible { outline: 3px solid var(--coral-600); outline-offset: -3px; }
/* Telefono stretto: l'albero sopra resterebbe minuscolo accanto ai nomi, meglio solo l'elenco con il suo punto */
@media (max-width: 359px) { .tree--sheet { display: none; } .tree-sheet__body { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) {
  .tree-fab, .tree-fab.is-shown, .tree-sheet, .tree-sheet[open], .tree-sheet::backdrop { transition: none; }
  .tree-fab, .tree-fab .tree-nav__dot { translate: none; scale: none; }
  .tree-fab .tree-nav__dot { opacity: 1; }
  .tree-fab.is-shown .tree-nav__dot, .tree-sheet[open] .tree-sheet__list li, .tree-sheet[open] .tree-nav__dot, .tree-sheet[open] .tree__paths { transition: fill .2s ease, stroke .2s ease; }
}

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; }
.hero__inner {
  display: grid;
  grid-template-columns: 1.4fr .6fr;
  align-items: center;
  gap: clamp(2rem, 4vw, 4rem);
  min-height: calc(100svh - var(--header-h));
  padding-block: clamp(3rem, 8vw, 6rem);
}
.hero__title { font-size: clamp(2.2rem, 1.1rem + 4.6vw, 5rem); font-weight: 400; text-wrap: balance; line-height: 1.02; letter-spacing: -.03em; margin-bottom: .45em; }
.hero__lead { max-width: 34em; font-size: var(--text-lead); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 1rem; margin: 2.25rem 0 1.75rem; }
.hero__note { font-size: var(--text-sm); color: var(--ink-soft); }

/* Due dischi pieni concentrici, come cerchi nell'acqua attorno all'albero */
.hero__art { position: relative; display: grid; place-items: center; }
.hero__art::before, .hero__art::after {
  content: '';
  position: absolute;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--sand-200);
}
.hero__art::before { width: min(135%, 520px); opacity: .45; }
.hero__art::after { width: min(108%, 420px); }
/* Col mouse l'albero e i due cerchi si spostano appena, a profondità diverse (--px e --py da main.js) */
.hero__art::before { translate: calc(var(--px, 0) * -14px) calc(var(--py, 0) * -14px); }
.hero__art::after { translate: calc(var(--px, 0) * -6px) calc(var(--py, 0) * -6px); }
.tree--hero { position: relative; z-index: 1; width: min(62%, 200px); height: auto; overflow: visible; translate: calc(var(--px, 0) * 10px) calc(var(--py, 0) * 10px); }
.tree--hero .tree__path { stroke: var(--plum-700); stroke-opacity: .45; stroke-width: 2; stroke-linecap: round; }
.tree--hero .tree__sefira { fill: var(--plum-700); stroke: var(--ivory-50); stroke-width: 3; transform-box: fill-box; transform-origin: center; }
.tree--hero .tree__sefira:nth-child(6) { fill: var(--coral-600); }

/* Animazione d'ingresso dell'albero */
.js .tree--hero .tree__path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw .9s var(--ease-out) forwards; animation-delay: calc(var(--i) * 40ms + .15s); }
.js .tree--hero .tree__sefira { opacity: 0; transform: scale(.6); animation: bloom .6s var(--ease-out) forwards; animation-delay: calc(var(--i) * 60ms + .45s); }
.js .hero__text > * { opacity: 0; transform: translateY(16px); animation: rise .7s var(--ease-out) forwards; }
.js .hero__text > :nth-child(2) { animation-delay: .08s; }
.js .hero__text > :nth-child(3) { animation-delay: .16s; }
.js .hero__text > :nth-child(4) { animation-delay: .24s; }

/* Finché c'è la schermata di caricamento l'ingresso dell'albero resta fermo al primo fotogramma */
.js.is-loading .tree--hero *, .js.is-loading .hero__text > * { animation-play-state: paused; }

@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes bloom { to { opacity: 1; transform: scale(1); } }
@keyframes rise { to { opacity: 1; transform: none; } }
/* Per gli elementi già visibili di base (risultato, messaggi): `rise` parte dallo stile corrente e non si vedrebbe */
@keyframes enter { from { opacity: 0; transform: translateY(12px); } }
@keyframes fade { from { opacity: 0; } }

@media (max-width: 860px) {
  .hero__inner { grid-template-columns: 1fr; min-height: 0; text-align: center; }
  .hero__inner { padding-block: 1.5rem 3.5rem; }
  .hero__art { order: -1; padding-block: 1rem; }
  .hero__art::before { width: min(66vw, 260px); }
  .hero__art::after { width: min(53vw, 210px); }
  .tree--hero { width: min(24vw, 92px); }
  .hero__actions { margin: 1.75rem 0 1.25rem; }
  .hero__lead { margin-inline: auto; }
  .hero__actions { justify-content: center; }
}

/* ---------- Sezioni ---------- */
.section { position: relative; padding-block: clamp(5rem, 10vw, 9rem); }
.section--sand { background: var(--sand-200); }
.section--dark { background: var(--plum-900); color: var(--ivory-50); }

.section__head { position: relative; max-width: 760px; margin: 0 auto clamp(3rem, 6vw, 4.5rem); text-align: center; }
.section__intro { font-size: var(--text-lead); max-width: 36em; margin-inline: auto; }
.section--dark .section__intro { color: rgba(251, 248, 241, .88); }
.section > .container, .hero > .container, .site-footer > .container { position: relative; z-index: 2; }

/* Reveal on scroll.
   L'ingresso usa `translate` con il ritardo a cascata (--d); `transform` resta libero per hover e
   pressione, così il ritardo della cascata non rallenta mai il feedback. */
.js .reveal {
  opacity: 0;
  translate: 0 16px;
  transition:
    opacity .7s var(--ease-out) var(--d, 0s),
    translate .7s var(--ease-out) var(--d, 0s),
    transform .25s var(--ease-out),
    box-shadow .25s var(--ease-out);
}
.js .reveal.is-visible { opacity: 1; translate: none; }
:is(.pillar, .card, .step, .quote):nth-child(2) { --d: 70ms; }
:is(.pillar, .card, .step, .quote):nth-child(3) { --d: 140ms; }

/* ---------- 2 · Pilastri ---------- */
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.5rem, 4vw, 3.5rem); }
.pillars { margin-top: clamp(.5rem, 2vw, 1.5rem); }
/* Ogni pilastro parte da un nodo su un sentiero, come le sefirot sull'Albero: il tratto si disegna quando entra */
.pillar { position: relative; padding-top: 2.25rem; }
.pillar::before, .pillar::after { content: ''; position: absolute; top: 0; left: 0; }
.pillar::before { right: 0; height: 1px; background: rgba(63, 27, 79, .22); transform-origin: left; }
.pillar::after { width: 11px; height: 11px; margin-top: -5px; border-radius: 50%; background: var(--coral-600); box-shadow: 0 0 0 5px var(--sand-200); }
.js .pillar::before { transform: scaleX(0); transition: transform .9s var(--ease-out) calc(var(--d, 0s) + .2s); }
.js .pillar.is-visible::before { transform: none; }
.pillar h3 { margin-bottom: .4em; }

@media (max-width: 760px) {
  .pillars { grid-template-columns: 1fr; max-width: 480px; margin-inline: auto; }
}

/* ---------- 3 · Calcolatore ---------- */
.calc__form {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 1rem;
  max-width: 560px;
  margin: 0 auto;
}
.calc__form .field { flex: 1; margin: 0; }
.calc__form .btn { margin-top: 1.7rem; }
.calc__noscript { flex-basis: 100%; color: var(--sand-200); }

.calc__result {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 4.5rem);
  max-width: 900px;
  margin: clamp(3rem, 6vw, 4.5rem) auto 0;
  padding: clamp(2rem, 4vw, 3.5rem);
  border-radius: calc(var(--radius) * 1.5);
  background: var(--plum-800);
  animation: enter .5s var(--ease-out);
}
.calc__result[hidden] { display: none; }
.calc__result { scroll-margin-top: 1.5rem; }
.calc__number {
  display: grid;
  place-items: center;
  width: clamp(9rem, 18vw, 13rem);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--coral-600);
  font-family: var(--font-display);
  font-size: clamp(5rem, 10vw, 7.5rem);
  line-height: 1;
  color: var(--ivory-50);
  /* Il numero arriva un attimo dopo la scheda: è il momento della pagina */
  animation: pop .5s var(--ease-out) var(--pop, .12s) both;
}
@keyframes pop { from { opacity: 0; transform: scale(.92); } }
.calc__steps span { display: inline-block; white-space: nowrap; }
/* Il calcolo si svolge un passaggio alla volta, poi arriva il numero (--k e --pop da main.js) */
.calc__steps span { animation: step-in .35s var(--ease-out) both; animation-delay: calc(var(--k, 0) * 120ms + .1s); }
@keyframes step-in { from { opacity: 0; transform: translateY(6px); } }
.calc__steps { font-size: var(--text-sm); color: var(--sand-200); font-variant-numeric: tabular-nums; }
.calc__name { font-size: clamp(2rem, 1.6rem + 1.6vw, 2.8rem); margin-bottom: .4em; }
.calc__text { font-size: var(--text-lead); color: var(--ivory-50); }
.calc__more { font-size: var(--text-sm); color: rgba(251, 248, 241, .8); margin-bottom: 1.75rem; }

@media (max-width: 720px) {
  .calc__form { flex-direction: column; align-items: stretch; }
  .calc__form .btn { margin-top: 0; }
  .calc__result { grid-template-columns: 1fr; text-align: center; justify-items: center; }
}

/* ---------- Campi form ---------- */
.field { display: flex; flex-direction: column; margin-bottom: 1.5rem; }
.field label { font-size: var(--text-sm); font-weight: 600; margin-bottom: .35rem; }
.field__optional { font-weight: 400; color: var(--ink-soft); }
.field input, .field select, .field textarea {
  width: 100%;
  padding: .8rem .1rem;
  border: 0;
  border-bottom: 1.5px solid rgba(63, 27, 79, .3);
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: max(1rem, 16px); /* sotto i 16px iOS fa zoom sul campo */
  transition: border-color .2s ease, box-shadow .2s ease;
}
.field textarea { resize: vertical; min-height: 7rem; }
.field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%233F1B4F' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .25rem center;
  padding-right: 1.5rem;
}
@media (hover: hover) {
  .field input:hover, .field select:hover, .field textarea:hover { border-bottom-color: rgba(63, 27, 79, .55); }
  .field--dark input:hover { border-bottom-color: rgba(239, 230, 204, .7); }
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-bottom-color: var(--coral-600); box-shadow: 0 1.5px 0 var(--coral-600); }
.field ::placeholder { color: var(--mauve-500); opacity: .8; }
.field__error { min-height: 0; margin: .4rem 0 0; font-size: var(--text-sm); color: var(--coral-700); }
.field__error:empty { display: none; }
.field.is-invalid input, .field.is-invalid select { border-bottom-color: var(--coral-700); }

.field--dark input { color: var(--ivory-50); border-bottom-color: rgba(239, 230, 204, .45); color-scheme: dark; font-size: 1.1rem; }
.field--dark .field__error { color: #F2A397; }

.field--check { display: grid; grid-template-columns: 1.25rem 1fr; gap: .2rem .85rem; align-items: start; }
.field--check input { width: 1.15rem; height: 1.15rem; margin: .3rem 0 0; accent-color: var(--coral-600); }
.field--check label { margin: 0; font-size: var(--text-sm); font-weight: 400; color: var(--ink-soft); }
.field--check .field__error { grid-column: 2; }

/* ---------- 4 · Chi sono ---------- */
.about { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(2.5rem, 6vw, 6rem); align-items: center; }
.about__photo { margin: 0; }
/* Senza foto: a sinistra la frase in grande e i fatti, a destra la storia */
.about--quote { align-items: start; }
.about--quote .about__aside { order: -1; position: sticky; top: calc(var(--header-h) + 2rem); }
.about__quote {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.25rem);
  line-height: 1.2;
  letter-spacing: -.015em;
  text-wrap: balance;
  margin: 0 0 2rem;
}
.about__quote em { font-style: italic; color: var(--coral-600); }
.about--quote .facts { margin-top: 0; }
.about--quote .facts div { grid-template-columns: 1fr; gap: .15rem; }
.photo-placeholder {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1rem;
  aspect-ratio: 4 / 5;
  border-radius: 200px 200px var(--radius) var(--radius);
  background: var(--sand-200);
  border: 1.5px dashed rgba(63, 27, 79, .3);
  color: var(--mauve-500);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .2em;
}
.photo-placeholder svg { width: 40%; fill: none; stroke: currentColor; stroke-width: 2; }
.about__text { position: relative; }
.facts { display: grid; gap: .25rem; margin: 2.25rem 0 0; padding: 1.25rem 1.5rem; border-radius: var(--radius); background: var(--sand-200); }
.facts div { display: grid; grid-template-columns: 8rem 1fr; gap: 1rem; padding: .5rem 0; }
.facts dt { font-size: var(--text-sm); font-weight: 600; color: var(--coral-700); padding-top: .15rem; }
.facts dd { margin: 0; }

@media (max-width: 860px) {
  .about { grid-template-columns: 1fr; }
  .about__photo { max-width: 340px; margin-inline: auto; width: 100%; }
  .about--quote .about__aside { order: 0; position: static; }
  .facts div { grid-template-columns: 1fr; gap: .25rem; }
}

/* ---------- 5 · Consulenze ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.25rem, 2.5vw, 2rem); align-items: stretch; }
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: clamp(2rem, 3vw, 2.5rem);
  background: var(--ivory-50);
  border-radius: var(--radius);
  transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out);
}
.card:has(.card__cta:focus-visible) { outline: 2px solid var(--coral-600); outline-offset: 4px; }
.card__cta:focus-visible { outline: none; }
.card:active { transform: scale(.99); }
@media (hover: hover) and (pointer: fine) {
  .card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
}
.card--featured { background: var(--plum-900); color: var(--ivory-50); }
.card.card--featured p { color: rgba(251, 248, 241, .86); }
.card--featured .card__meta span { color: var(--sand-300); }
.card__badge {
  align-self: flex-start;
  margin-bottom: 1.25rem;
  padding: .2rem .75rem;
  border: 1px solid rgba(242, 163, 151, .5);
  border-radius: 999px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: #F2A397; /* corallo chiaro: 8:1 su plum-900 */
}
.card__meta { list-style: none; margin: .25rem 0 1.5rem; padding: 0; font-size: var(--text-sm); }
.card__meta li { display: flex; justify-content: space-between; gap: 1rem; padding: .3rem 0; }
.card__meta span { font-weight: 600; color: var(--ink-soft); }
.card__arrow { display: inline-block; width: 1em; height: .65em; margin-left: .3em; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; vertical-align: .02em; transition: transform .25s var(--ease-out); }
.card__cta::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.card__cta { margin-top: auto; align-self: flex-start; }

@media (max-width: 960px) {
  .cards { grid-template-columns: 1fr; max-width: 520px; margin-inline: auto; gap: 2rem; }
}

/* ---------- Corsi ---------- */
.courses__group { margin: clamp(2.5rem, 5vw, 3.5rem) 0 1.5rem; font-size: clamp(1.6rem, 1.3rem + .8vw, 2rem); }
.courses__group:first-of-type { margin-top: 0; }
.card--course { background: var(--sand-200); padding: clamp(1.75rem, 2.4vw, 2.25rem); }
.cards--two .card { padding: clamp(1.75rem, 2.4vw, 2.5rem); }
.card--course h3, .cards--two h3 { font-variant-numeric: lining-nums; }
.card__req { font-size: var(--text-sm); color: var(--ink-soft); }
.card--featured .card__req { color: var(--sand-300); }
.cards--four .card h3 { font-size: 1.55rem; }
/* Descrizioni lunghe: le prime 5 righe, sfumate in fondo come le testimonianze; il resto nel pop-up
   (solo con JS, altrimenti si legge tutto nella scheda) */
.card__summary.is-clamped, .about__story.is-clamped {
  max-height: calc(1.65em * 5); overflow: hidden; margin-bottom: .5rem;
  -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent);
}
.card__more[hidden] { display: none; }
.card__more {
  position: relative; z-index: 1; /* sopra il link che copre la scheda (.card__cta::after) */
  display: inline-flex; align-items: center; gap: .45em;
  align-self: flex-start; min-height: 2.75rem; margin: 0 0 1rem; padding: 0;
  border: 0; background: none; color: var(--coral-700); font: 700 .9375rem/1 var(--font-body); cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: color .2s ease, scale .16s var(--ease-out);
}
/* Il segno dice che si apre qualcosa: una freccia piccola, nello stesso colore */
.card__more::after { content: ''; width: .42em; height: .42em; border-top: 1.5px solid; border-right: 1.5px solid; rotate: 45deg; transition: translate .2s var(--ease-out); }
.card__more:active { scale: .97; }
.card--featured .card__more { color: #F2A397; }
.card__more:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 4px; }
@media (hover: hover) and (pointer: fine) {
  .card__more:hover { color: var(--plum-700); }
  .card__more:hover::after { translate: 2px 0; }
  .card--featured .card__more:hover { color: var(--ivory-50); }
}
/* Testo lungo: tutta la scheda apre il pop-up, solo il pulsante «Più informazioni» porta al modulo */
.has-more { cursor: pointer; }
.card.has-more .card__cta::after { content: none; }
/* Premendo «Leggi tutto» si muove il pulsante, non tutta la scheda */
.card:has(.card__more:active) { transform: none; }

.more-dialog {
  width: min(34rem, calc(100% - 2rem));
  max-height: min(85dvh, 44rem);
  margin: auto;
  --pad: clamp(1.75rem, 4vw, 2.5rem);
  padding: var(--pad);
  border: 0;
  border-radius: var(--radius);
  background: var(--ivory-50);
  color: var(--plum-700);
  box-shadow: var(--shadow);
  overflow: auto;
  overscroll-behavior: contain;
  opacity: 0;
  scale: .96;
  /* Chiusura più rapida dell'apertura: chi chiude ha già deciso */
  transition: opacity .15s var(--ease-out), scale .15s var(--ease-out), overlay .15s allow-discrete, display .15s allow-discrete;
}
.more-dialog[open] { opacity: 1; scale: 1; transition-duration: .2s; }
.more-dialog:focus-visible { outline: none; }
@starting-style { .more-dialog[open] { opacity: 0; scale: .96; } }
.more-dialog::backdrop { background: rgba(46, 24, 56, 0); transition: background-color .15s ease, overlay .15s allow-discrete, display .15s allow-discrete; }
.more-dialog[open]::backdrop { background: rgba(46, 24, 56, .45); transition-duration: .2s; }
@starting-style { .more-dialog[open]::backdrop { background: rgba(46, 24, 56, 0); } }
/* Barra alta zero, ferma sul margine interno mentre il testo scorre; la X sale a .5rem dal bordo e resta sempre a portata */
.more-dialog__bar { position: sticky; top: 0; z-index: 1; display: flex; justify-content: flex-end; height: 0; margin-right: calc(.5rem - var(--pad)); }
.more-dialog__close { translate: 0 calc(.5rem - var(--pad)); flex: none; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: var(--ivory-50); color: inherit; cursor: pointer; }
.more-dialog__close svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.more-dialog__close:focus-visible { outline: 3px solid var(--coral-600); outline-offset: -3px; }
.more-dialog__title { margin: 0 2.5rem .75em 0; font-variant-numeric: lining-nums; }
.more-dialog__text p { margin-bottom: .8em; }
.more-dialog__text h4 { margin: 1.4em 0 .5em; font: 500 1.35rem/1.2 var(--font-display); letter-spacing: -.01em; }
.more-dialog__cta { margin-top: .75rem; }
/* Una testimonianza nel pop-up: la stessa scheda, senza il suo riquadro */
.more-dialog .quote { padding: 1.75rem 0 0; background: none; }
.more-dialog .quote::before { top: -.5rem; left: -.25rem; }
@media (prefers-reduced-motion: reduce) { .more-dialog, .more-dialog[open] { scale: 1; } }
/* Tante colonne quanti sono i corsi, fino a quattro: niente colonna vuota con tre corsi */
.cards--four { grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.cards--two { grid-template-columns: repeat(2, 1fr); }
:is(.pillar, .card, .step, .quote):nth-child(4) { --d: 210ms; }
/* In colonna singola ogni scheda entra da sola: la cascata diventerebbe solo attesa */
@media (max-width: 560px) { :is(.pillar, .card, .step, .quote):nth-child(n) { --d: 0s; } }

@media (max-width: 960px) {
  .cards--four, .cards--two { max-width: none; margin-inline: 0; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
}
@media (max-width: 560px) {
  .cards--four, .cards--two { grid-template-columns: 1fr; max-width: 520px; margin-inline: auto; gap: .75rem; }
  .cards--four .card, .cards--two .card { padding: 1.4rem 1.5rem; }
  .cards--four .card h3, .cards--two .card h3 { font-size: 1.4rem; }
}

/* ---------- 6 · Come funziona ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(2rem, 4vw, 3.5rem); }
.steps { position: relative; }
/* Un sentiero unisce i tre passi e si disegna quando la sezione entra */
.steps::before {
  content: '';
  position: absolute;
  top: 1.85rem;
  left: calc(100% / 6);
  right: calc(100% / 6);
  height: 1px;
  background: repeating-linear-gradient(90deg, rgba(63, 27, 79, .35) 0 6px, transparent 6px 12px);
  transform-origin: left;
}
.js .steps::before { transform: scaleX(0); transition: transform 1.1s var(--ease-in-out) .25s; }
.js .steps.is-visible::before { transform: none; }
.step { position: relative; text-align: center; }
/* I tre dischi si scaldano di passo in passo: sabbia, prugna, corallo */
.step__number {
  position: relative;
  display: grid;
  place-items: center;
  width: 3.7rem; height: 3.7rem;
  margin: 0 auto 1.5rem;
  border-radius: 50%;
  background: var(--sand-300);
  font-family: var(--font-display);
  font-size: 1.7rem;
  box-shadow: 0 0 0 10px var(--ivory-50);
}
.step:nth-child(2) .step__number { background: var(--plum-700); color: var(--ivory-50); }
.step:nth-child(3) .step__number { background: var(--coral-600); color: var(--white); }
.step p { max-width: 22em; margin-inline: auto; }

@media (max-width: 760px) {
  .steps { grid-template-columns: 1fr; }
  .steps::before { display: none; }
}

/* ---------- 7 · Testimonianze ---------- */
.quotes { display: grid; grid-template-columns: repeat(3, 1fr); align-items: start; gap: clamp(1.25rem, 2.5vw, 2rem); }
.quote { position: relative; margin: 0; padding: 2.5rem 2rem 2rem; background: var(--ivory-50); border-radius: var(--radius); }
.quote::before { content: '“'; position: absolute; top: .2rem; left: 1.5rem; font-family: var(--font-display); font-size: 5rem; line-height: 1; color: var(--coral-500); opacity: .5; }
.quote blockquote { margin: 1rem 0 1.25rem; font-family: var(--font-display); font-size: 1.25rem; line-height: 1.45; }
.quote blockquote p { margin: 0; }
/* Testimonianze lunghe: le prime 7 righe, sfumate in fondo; «Leggi tutto» apre il resto in un pop-up (main.js).
   Senza JS il testo resta tutto visibile. */
.quote blockquote p.is-clamped {
  max-height: calc(1.45em * 7); overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent);
}
.quote .card__more { margin: -.75rem 0 .5rem; }
.quote__stars { margin: .25rem 0 0; color: var(--coral-600); font-size: 1rem; letter-spacing: .15em; line-height: 1; }
.quote figcaption { font-size: var(--text-sm); font-weight: 600; color: var(--ink-soft); }
.quote__stars-off { color: #DCD1DE; }
/* Meno di tre in home: restano al centro, della misura che avrebbero in tre */
.quotes[data-n="1"] { grid-template-columns: minmax(0, 560px); justify-content: center; }
.quotes[data-n="2"] { grid-template-columns: repeat(2, minmax(0, 520px)); justify-content: center; }
.quotes__link { display: inline-flex; align-items: center; min-height: 2.75rem; font-size: .9375rem; font-weight: 600; color: var(--coral-700); text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .quotes__link:hover .card__arrow { transform: translateX(4px); } }
.quotes__more { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 1rem 2rem; margin: clamp(2.5rem, 5vw, 3.5rem) 0 0; }

@media (max-width: 960px) {
  .quotes, .quotes[data-n] { grid-template-columns: 1fr; max-width: 560px; margin-inline: auto; }
}

/* ---------- 8 · FAQ ---------- */
/* Righe separate da un passo di tono, non da linee */
.faq { display: grid; gap: .5rem; }
.faq details { padding-inline: clamp(1.25rem, 3vw, 2rem); border-radius: calc(var(--radius) * .8); background: var(--sand-200); transition: background-color .2s ease; }
.faq details[open] { background: var(--sand-300); }
.faq summary {
  position: relative;
  padding: 1.35rem 3rem 1.35rem 0;
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 1.15rem + .5vw, 1.6rem);
  line-height: 1.3;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary { transition: color .2s ease, opacity .1s ease; }
.faq summary:active { opacity: .85; }
@media (hover: hover) and (pointer: fine) { .faq summary:hover { color: var(--coral-700); } }
.faq summary:focus-visible { outline-offset: 6px; }
.faq summary::before, .faq summary::after {
  content: '';
  position: absolute;
  right: .5rem;
  top: 50%;
  width: 16px;
  height: 1.5px;
  background: var(--coral-600);
  transition: transform .25s var(--ease-out);
}
.faq summary::after { transform: rotate(90deg); }
.faq details[open] summary::after { transform: rotate(0deg); }
.faq details p { padding: 0 3rem 1.5rem 0; transition: opacity .3s var(--ease-out); }
.faq details:not([open]) p { opacity: 0; }
@supports selector(::details-content) {
  .faq { interpolate-size: allow-keywords; }
  .faq details::details-content { height: 0; overflow: clip; transition: height .3s var(--ease-out), content-visibility .3s allow-discrete; }
  .faq details[open]::details-content { height: auto; }
}

/* ---------- 9 · Prenota ---------- */
.booking { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(2.5rem, 6vw, 6rem); align-items: start; }
.booking__intro { position: relative; }
@media (min-width: 861px) { .booking__intro { position: sticky; top: calc(var(--header-h) + 3rem); } }
.booking__alt { margin-top: 2.5rem; font-size: var(--text-sm); color: var(--ink-soft); }
.booking__alt a { color: var(--coral-700); font-weight: 500; }

.booking__form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 1.5rem;
  padding: clamp(1.75rem, 4vw, 3rem);
  background: var(--ivory-50);
  border-radius: calc(var(--radius) * 1.4);
}
.booking__form > * { grid-column: 1 / -1; }
.booking__form > .field--half { grid-column: span 1; }
.booking__form .btn { margin-top: .5rem; }
.booking__form .btn[disabled] { opacity: .6; cursor: progress; transform: none; }

.form-status { margin: 1rem 0 0; font-size: var(--text-sm); text-align: center; }
.form-status:not(:empty) { animation: enter .3s var(--ease-out); }
.form-status:empty { display: none; }
.form-status.is-success { padding: 1.25rem; border-radius: var(--radius); background: var(--sand-200); }
.form-status.is-error { color: var(--coral-700); }

@media (max-width: 860px) {
  .booking { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .booking__form { grid-template-columns: 1fr; }
  .booking__form > .field--half { grid-column: 1 / -1; }
}

/* ---------- 10 · Footer ---------- */
.site-footer { position: relative; padding-block: clamp(4rem, 8vw, 6rem); }
.site-footer__inner { display: grid; grid-template-columns: auto 1fr; gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.site-footer__logo { width: 220px; height: auto; mix-blend-mode: multiply; }
.site-footer__claim { font-family: var(--font-display); font-size: clamp(1.6rem, 1.3rem + 1vw, 2.2rem); line-height: 1.25; margin-bottom: 1.5rem; }
.site-footer__links { display: flex; flex-wrap: wrap; gap: .5rem 2rem; list-style: none; margin: 0 0 1.5rem; padding: 0; font-size: .9375rem; font-weight: 500; }
.site-footer__links a { text-decoration: none; transition: color .2s ease; }
@media (hover: hover) and (pointer: fine) { .site-footer__links a:hover { color: var(--coral-700); } }
.site-footer__legal { font-size: var(--text-sm); color: var(--ink-soft); margin: 0; }
.site-footer__legal + .site-footer__legal { margin-top: .4rem; }
.site-footer__law { max-width: 44em; font-size: .8125rem; }

@media (max-width: 720px) {
  .site-footer__inner { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .site-footer__links { justify-content: center; }
}

/* ---------- Movimento ridotto ----------
   Meno movimento, non zero: restano le dissolvenze che spiegano un cambio di stato,
   spariscono spostamenti, ingrandimenti e tracciati che si disegnano. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { translate: none; }
  .js .hero__text > * { opacity: 1; transform: none; animation-name: fade; }
  .js .tree--hero .tree__path { stroke-dashoffset: 0; animation: none; }
  .js .tree--hero .tree__sefira { opacity: 1; transform: none; animation: fade .4s ease .1s both; }
  .calc__result, .form-status:not(:empty), .calc__number, .calc__steps span { animation-name: fade; }
  .js .steps::before, .js .pillar::before { transform: none; transition: none; }
  .btn:active, .card:active, .card:hover, .tree-nav__link.is-active circle:not(.tree-nav__hit) { transform: none; }
  .card:hover .card__arrow { transform: none; }
  .faq details::details-content { transition: none; }
}

/* ---------- Informativa privacy ---------- */
.legal { padding-block: clamp(2.5rem, 6vw, 4.5rem) 3rem; }
.legal h1 { font-size: clamp(2.4rem, 1.8rem + 2.6vw, 3.6rem); margin-bottom: .35em; }
.legal h2 { font-size: clamp(1.75rem, 1.5rem + .8vw, 2.1rem); margin: 2.25em 0 .6em; }
.legal h3 { font-size: clamp(1.35rem, 1.25rem + .4vw, 1.5rem); margin: 1.75em 0 .5em; }
.legal__updated { color: var(--ink-soft); font-size: var(--text-sm); margin-bottom: 2rem; }
.legal ul, .legal ol { padding-left: 1.2rem; margin: 0 0 1em; }
.legal li { margin-bottom: .5em; }
.legal li::marker { color: var(--coral-600); }
.legal a { color: var(--coral-700); }
.legal code { font-size: .9em; overflow-wrap: anywhere; }
.legal__table { margin: 1.25rem 0 1.5rem; overflow-x: auto; border-radius: 16px; background: var(--sand-200); }
.legal__table table { width: 100%; min-width: 34rem; border-collapse: collapse; font-size: .9375rem; line-height: 1.5; }
.legal__table th, .legal__table td { padding: .85rem 1rem; text-align: left; vertical-align: top; }
.legal__table th { font-weight: 700; border-bottom: 1.5px solid var(--sand-300); }
.legal__table tr + tr td { border-top: 1px solid var(--sand-300); }
.legal__table small { color: var(--ink-soft); }
.legal__footer { padding-block: 0 3rem; color: var(--ink-soft); font-size: var(--text-sm); }
.legal__footer a { color: inherit; }

/* ---------- Schermata di caricamento ---------- */
/* Visibile solo con JS attivo e finché main.js non toglie .is-loading da <html> */
.loader {
  position: fixed; inset: 0; z-index: 200; display: grid; place-content: center; justify-items: center; gap: 1.75rem;
  background: var(--ivory-50); opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .55s var(--ease-out), visibility 0s linear .55s;
}
.js.is-loading { overflow: hidden; }
.js.is-loading .loader { opacity: 1; visibility: visible; pointer-events: auto; transition: none; }
.loader__mark { width: 88px; height: 88px; border-radius: 50%; mix-blend-mode: multiply; animation: breathe 1.6s var(--ease-in-out) infinite alternate; }
.loader__bar { position: relative; width: 120px; height: 2px; overflow: hidden; border-radius: 2px; background: var(--sand-300); }
.loader__bar::after { content: ''; position: absolute; inset: 0; width: 40%; border-radius: inherit; background: var(--coral-600); animation: loader-slide 1.2s var(--ease-in-out) infinite; }
@keyframes breathe { from { opacity: .7; transform: scale(.94); } to { opacity: 1; transform: none; } }
@keyframes loader-slide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
@media (prefers-reduced-motion: reduce) {
  .loader__mark, .loader__bar::after { animation: none; }
  .loader__bar { display: none; }
  .loader { transition-duration: .2s, 0s; transition-delay: 0s, .2s; }
}


/* ---------- Pagina delle testimonianze ---------- */
.page-actions { display: flex; align-items: center; gap: .5rem; }
@media (max-width: 480px) { .page-actions .btn--ghost { display: none; } }
#lascia { scroll-margin-top: var(--header-h); }
.tq { padding-block: clamp(3rem, 7vw, 5.5rem); }
.tq h1 { font-size: clamp(2.4rem, 1.8rem + 2.6vw, 3.6rem); }
.tq__summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .35rem .75rem; margin: 0 0 1.75rem; color: var(--ink-soft); }
.tq__summary .quote__stars { margin: 0; font-size: 1.15rem; }
.tq__summary strong { color: var(--plum-900); font-weight: 700; }
/* Testi interi, a colonne: ogni scheda prende l'altezza del suo testo */
.tq__grid { columns: 3 18rem; column-gap: clamp(1.25rem, 2.5vw, 2rem); }
.tq__grid .quote { break-inside: avoid; margin-bottom: clamp(1.25rem, 2.5vw, 2rem); background: var(--sand-200); }
.tq__empty { max-width: 34em; margin: 0 auto; text-align: center; color: var(--ink-soft); }

.tq__sent { align-content: start; gap: 0; }
.tq__sent-title { margin: 0 0 .5rem; font-family: var(--font-display); font-size: clamp(1.75rem, 1.5rem + .8vw, 2.1rem); line-height: 1.1; }
.tq__sent .btn { justify-self: start; margin-top: 1.25rem; }

.field__hint { margin: .4rem 0 0; font-size: var(--text-sm); color: var(--ink-soft); }
.field.is-invalid textarea { border-bottom-color: var(--coral-700); }

/* Scelta delle stelle: cinque radio con l'etichetta a forma di stella, accese fino a quella scelta
   (o a quella sotto il puntatore). :where tiene bassa la regola della scelta, così il passaggio del mouse vince. */
.stars-input { margin: 0 0 1.5rem; padding: 0; border: 0; min-width: 0; }
.stars-input legend { padding: 0; margin-bottom: .35rem; font-size: var(--text-sm); font-weight: 600; }
.stars-input__row { display: flex; width: max-content; margin-left: -.4rem; }
.stars-input__row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
:where(.stars-input__row) label { color: var(--coral-600); }
.stars-input__row label { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; font-size: 1.9rem; line-height: 1; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.stars-input__row label::before { content: '★'; transition: transform .16s var(--ease-out); }
:where(.stars-input__row input:checked + label) ~ label, .stars-input__row:not(:has(:checked)) label { color: #D6CAD9; }
@media (hover: hover) and (pointer: fine) {
  .stars-input__row:hover label { color: var(--coral-600); }
  .stars-input__row label:hover ~ label { color: #D6CAD9; }
  .stars-input__row label:hover::before { transform: scale(1.12); }
}
.stars-input__row input:focus-visible + label { outline: 2px solid var(--coral-600); outline-offset: -3px; border-radius: 10px; }
@media (prefers-reduced-motion: reduce) { .stars-input__row label::before { transition: none; } }
