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

/* ---------- Font (self-hosted, OFL) ---------- */
@font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 500; font-display: swap; src: url('../assets/fonts/cormorant-garamond-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 600; font-display: swap; src: url('../assets/fonts/cormorant-garamond-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-style: italic; font-weight: 500; font-display: swap; src: url('../assets/fonts/cormorant-garamond-latin-500-italic.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 400; font-display: swap; src: url('../assets/fonts/montserrat-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 500; font-display: swap; src: url('../assets/fonts/montserrat-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 700; font-display: swap; src: url('../assets/fonts/montserrat-latin-700-normal.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: 'Cormorant Garamond', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Montserrat', 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);
  --shadow: 0 18px 40px -24px rgba(46, 24, 56, .35);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -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: clamp(1rem, .96rem + .2vw, 1.0625rem);
  line-height: 1.7;
  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.08; margin: 0 0 .5em; letter-spacing: -.005em; text-wrap: balance; }
.pillar__number, .card__numeral, .step__number, .calc__number, .section__numeral { 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); }
h1 em { font-style: italic; color: var(--coral-600); }
section[id], footer[id] { scroll-margin-top: var(--header-h); }
: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: 600;
  letter-spacing: .01em;
  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: rgba(251, 248, 241, .86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  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;
  }
  .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: 58px;
  padding: .8rem .65rem;
  background: var(--ivory-50);
  border-radius: 999px;
  box-shadow: var(--shadow);
  transform: translateY(-50%);
}
.tree--nav .tree__paths line { stroke: var(--plum-700); stroke-opacity: .25; stroke-width: 5; }
.tree-nav__link circle {
  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 { fill: var(--plum-700); } }
.tree-nav__link:focus { outline: none; }
.tree-nav__link:focus-visible circle { stroke: var(--coral-600); stroke-width: 12; }
.tree-nav__link.is-active circle { fill: var(--coral-600); stroke: var(--coral-600); transform: scale(1.3); }

@media (max-width: 1279px) {
  .tree-nav { display: none; }
  .scroll-progress { display: block; }
}

/* ---------- 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.8rem, 1.5rem + 4.6vw, 5rem); line-height: 1.02; letter-spacing: -.015em; 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); }
.tree--hero { position: relative; z-index: 1; width: min(62%, 200px); height: auto; overflow: visible; }
.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 1.1s var(--ease) forwards; animation-delay: calc(var(--i) * 55ms + .2s); }
.js .tree--hero .tree__sefira { opacity: 0; transform: scale(.4); animation: bloom .7s var(--ease) forwards; animation-delay: calc(var(--i) * 110ms + .5s); }
.js .hero__text > * { opacity: 0; transform: translateY(18px); animation: rise .8s 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; }

@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes bloom { to { opacity: 1; transform: scale(1); } }
@keyframes rise { to { opacity: 1; transform: none; } }

@media (max-width: 860px) {
  .hero__inner { grid-template-columns: 1fr; min-height: 0; text-align: center; }
  .hero__art { order: -1; padding-block: 1.75rem; }
  .hero__art::before { width: min(90vw, 360px); }
  .hero__art::after { width: min(72vw, 290px); }
  .tree--hero { width: min(32vw, 128px); }
  .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__numeral {
  position: absolute;
  z-index: -1;
  left: 50%;
  top: -.35em;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-size: clamp(9rem, 6rem + 12vw, 16rem);
  line-height: 1;
  color: var(--coral-500);
  opacity: .1;
  pointer-events: none;
  user-select: none;
}
.section__numeral + h2 { margin-top: clamp(2rem, 1.4rem + 1.6vw, 3rem); } /* il titolo resta sotto l'occhiello del numerale, non lo attraversa */
.section > .container { position: relative; z-index: 0; }
.section--dark .section__numeral { opacity: .14; }
@supports (-webkit-text-stroke: 1px black) {
  .section__numeral { color: transparent; -webkit-text-stroke: 1.25px var(--coral-500); opacity: .32; top: -.42em; }
  .section--dark .section__numeral { -webkit-text-stroke-color: var(--sand-300); opacity: .22; }
}

/* 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 20px;
  filter: blur(4px);
  transition:
    opacity .7s var(--ease-out) var(--d, 0s),
    translate .7s var(--ease-out) var(--d, 0s),
    filter .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; filter: none; }
:is(.pillar, .card, .step, .quote):nth-child(2) { --d: 80ms; }
:is(.pillar, .card, .step, .quote):nth-child(3) { --d: 160ms; }

/* ---------- 2 · Pilastri ---------- */
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.5rem, 4vw, 3.5rem); }
.pillar__number { display: block; font-family: var(--font-display); font-style: italic; font-size: 3.25rem; line-height: 1; color: var(--coral-600); margin-bottom: .75rem; }

@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: rise .6s var(--ease-out);
}
.calc__result[hidden] { display: none; }
.calc__result { scroll-margin-top: calc(var(--header-h) + 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 .55s var(--ease-out) .12s both;
}
@keyframes pop { from { opacity: 0; transform: scale(.88); } }
.calc__steps span { white-space: nowrap; }
.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; }
.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; }
.about__text .section__numeral { left: 0; transform: none; top: -.45em; }
.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%; }
  .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__link:focus-visible) { outline: 2px solid var(--coral-600); outline-offset: 4px; }
.card__link: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:hover .card__link span { transform: translateX(4px); }
}
.card--featured { background: var(--plum-900); color: var(--ivory-50); }
.card.card--featured p { color: rgba(251, 248, 241, .86); }
.card--featured .card__numeral { color: var(--coral-500); }
.card--featured .card__meta span { color: var(--sand-300); }
.card--featured .card__price { color: var(--ivory-50); }
.card--featured .card__link { color: var(--sand-300); }
.card__badge {
  position: absolute;
  top: clamp(2rem, 3vw, 2.5rem);
  right: clamp(2rem, 3vw, 2.5rem);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 2.2rem; /* allineato otticamente al numerale */
  color: var(--coral-500);
}
.card__numeral { font-family: var(--font-display); font-style: italic; font-size: 2.2rem; line-height: 1; color: var(--coral-600); margin-bottom: 1.25rem; }
.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__price { margin-top: auto; font-family: var(--font-display); font-size: 2rem; color: var(--plum-700); }
.card__link {
  font-size: .9375rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--coral-700);
}
.card__link span { display: inline-block; transition: transform .2s var(--ease-out); }
.card__link::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }

@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); }
.card--course .card__numeral, .cards--four .card__numeral { margin-bottom: 1rem; }
.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; }
.cards--four .card__price, .cards--two .card__price { padding-top: .5rem; font-size: 1.75rem; margin-bottom: .75rem; }
.cards--four { grid-template-columns: repeat(4, 1fr); }
.cards--two { grid-template-columns: repeat(2, 1fr); }
:is(.pillar, .card, .step, .quote):nth-child(4) { --d: 240ms; }

@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; }
}

/* ---------- 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); }
.step { position: relative; text-align: center; }
/* I tre dischi si scaldano di passo in passo: sabbia, prugna, corallo */
.step__number {
  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;
}
.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; }
}

/* ---------- 7 · Testimonianze ---------- */
.quotes { display: grid; grid-template-columns: repeat(3, 1fr); 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__flag { position: absolute; top: 1rem; right: 1rem; padding: .2rem .6rem; border-radius: 999px; border: 1px dashed #C99A00; color: #5A3D00; background: #FFF4D1; font-size: .6rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.quote blockquote { margin: 1rem 0 1.25rem; font-family: var(--font-display); font-style: italic; font-size: 1.35rem; line-height: 1.4; }
.quote figcaption { font-size: var(--text-sm); font-weight: 600; color: var(--ink-soft); }

@media (max-width: 960px) {
  .quotes { 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; }
@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; }
@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__intro .section__numeral { left: 0; transform: none; top: -.45em; }
.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: rise .35s 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 { 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-style: italic; 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; }

@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 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
  .js .reveal, .js .hero__text > *, .js .tree--hero .tree__sefira { opacity: 1; transform: none; translate: none; filter: none; }
  .btn:active, .card:active { transform: none; }
  .js .tree--hero .tree__path { stroke-dashoffset: 0; }
}
