:root {
  --sage: #1A6B5A;
  --sage-dark: #135245;
  --sage-light: #E8F5F1;
  --gold: #A66208;
  --gold-light: #FFD98F;
  --cream: #FCF9F5;
  --ink: #2D3436;
}

/* ---------- Base typography ---------- */
html { scroll-behavior: smooth; }

body {
  font-family: 'Manrope', ui-sans-serif, system-ui, sans-serif;
  color: var(--ink);
  background-color: var(--cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.font-display {
  font-family: 'Playfair Display', Georgia, serif;
}

/* ---------- Header / nav ---------- */
#main-nav {
  transition: background .35s ease, box-shadow .35s ease, padding .35s ease;
}
.scrolled-header {
  background: rgba(252, 249, 245, 0.82);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  box-shadow: 0 8px 30px rgba(26, 107, 90, 0.08);
}

/* scroll progress bar */
#scroll-progress {
  transform-origin: 0 50%;
  transform: scaleX(0);
  transition: transform .1s linear;
}

.nav-link {
  position: relative;
  color: var(--ink);
  transition: color .25s ease;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  height: 2px; width: 100%;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .3s cubic-bezier(.65,.05,.36,1);
}
.nav-link:hover { color: var(--sage); }
.nav-link:hover::after { transform: scaleX(1); transform-origin: left; }
.nav-link.is-active { color: var(--sage); font-weight: 700; }
.nav-link.is-active::after { transform: scaleX(1); }

/* ---------- Page transition ---------- */
.page-transition {
  transition: opacity .4s ease, transform .4s ease;
}
.page-transition.is-leaving {
  opacity: 0;
  transform: translateY(8px);
}

/* ---------- Reveal on scroll ---------- */
/* Nascoste solo se JS è attivo: senza JS restano visibili (progressive enhancement) */
.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .8s cubic-bezier(.25,1,.5,1), transform .8s cubic-bezier(.25,1,.5,1);
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Hero decorative blobs ---------- */
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: .5;
  z-index: 0;
  animation: float 14s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(20px, -30px) scale(1.08); }
}
@media (prefers-reduced-motion: reduce) { .blob { animation: none; } }

/* animated underline flourish under hero highlight word */
.hero-highlight {
  position: relative;
  white-space: nowrap;
}

/* ---------- Cards ---------- */
.lift {
  transition: transform .35s cubic-bezier(.25,1,.5,1), box-shadow .35s ease, border-color .35s ease;
}
.lift:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 50px rgba(26, 107, 90, 0.12);
}

/* ---------- Timeline (day) ---------- */
.timeline-line {
  background: repeating-linear-gradient(90deg, #c8e6da, #c8e6da 8px, transparent 8px, transparent 16px);
}
.timeline-dot {
  transition: transform .4s ease, background .4s ease;
}
.timeline-node:hover .timeline-dot {
  transform: scale(1.12);
}

/* ---------- FAQ ---------- */
.faq-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s cubic-bezier(.4,0,.2,1);
}
.faq-open .faq-content { max-height: 420px; }
.faq-open .faq-chevron { transform: rotate(180deg); }
.faq-chevron { transition: transform .35s ease; }
.faq-open { border-color: var(--gold) !important; box-shadow: 0 12px 26px rgba(26,107,90,.06); }

/* ---------- Forms ---------- */
.field {
  transition: border-color .25s ease, box-shadow .25s ease, background .25s ease;
}
.field:focus {
  outline: none;
  border-color: var(--sage);
  box-shadow: 0 0 0 4px rgba(26, 107, 90, 0.12);
  background: #fff;
}

/* ---------- Floating call button ---------- */
@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(26, 107, 90, .45); }
  70% { box-shadow: 0 0 0 18px rgba(26, 107, 90, 0); }
  100% { box-shadow: 0 0 0 0 rgba(26, 107, 90, 0); }
}
.pulse-ring { animation: pulse-ring 3s infinite; }

.float-btn {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: opacity .4s ease, transform .4s ease;
}
.float-btn.is-shown {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ---------- Mobile menu ---------- */
#mobile-menu { transition: transform .5s cubic-bezier(.65,.05,.36,1); }
.mobile-nav-link { transition: transform .25s ease, color .25s ease; }
.mobile-nav-link:hover { transform: scale(1.08); color: var(--gold-light); }

/* ---------- Marquee (trust strip) ---------- */
.marquee-track {
  display: flex;
  gap: 3rem;
  width: max-content;
  animation: marquee 28s linear infinite;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.marquee:hover .marquee-track { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; } }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--cream); }
::-webkit-scrollbar-thumb {
  background: var(--sage);
  border-radius: 10px;
  border: 2px solid var(--cream);
}

/* ---------- Responsive tweaks ---------- */
@media (max-width: 768px) {
  h1 { line-height: 1.1 !important; }
}

/* ---------- Lightbox (foto degli spazi) ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(19, 82, 69, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .25s ease;
  cursor: zoom-out;
}
.lightbox.is-open { opacity: 1; }
.lightbox img {
  max-width: min(1100px, 100%);
  max-height: 90vh;
  width: auto;
  height: auto;
  border-radius: 1rem;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .4);
  transform: scale(.96);
  transition: transform .25s ease;
  cursor: default;
}
.lightbox.is-open img { transform: scale(1); }
.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  width: 3rem;
  height: 3rem;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .15);
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  transition: background .2s ease;
}
.lightbox-close:hover { background: rgba(255, 255, 255, .28); }
@media (prefers-reduced-motion: reduce) {
  .lightbox, .lightbox img { transition: none; }
}

/* ---------- Accessibility ---------- */
/* Visible keyboard focus (keeps mouse clicks clean) */
a:focus-visible,
button:focus-visible,
[onclick]:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Skip link: nascosto finché non riceve il focus da tastiera */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -3.5rem;
  z-index: 200;
  background: var(--sage);
  color: #fff;
  padding: .6rem 1.1rem;
  border-radius: .6rem;
  font-weight: 600;
  transition: top .2s ease;
}
.skip-link:focus { top: 1rem; }

/* Il focus programmatico (cambio pagina) non mostra un contorno */
#app:focus, #app h1:focus { outline: none; }

/* Screen-reader-only helper */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
