/* ==========================================================================
   Orizzonti Educativi — Dott. Matteo Nesci, Pedagogista
   Foglio di stile unico. CSS custom, zero framework, zero dipendenze.
   Sommario:
     1 Font · 2 Design system · 3 Reset · 4 Tipografia · 5 Layout
     6 Bottoni · 7 Header · 8 Hero · 9 Card · 10 Split · 11 Liste
     12 Passi · 13 Servizi · 14 FAQ · 15 CTA · 16 Blog · 17 Contatti
     18 404 · 19 Legale · 20 Footer · 21 MOTION · 22 Utility · 23 Breakpoint
   ========================================================================== */

/* --------------------------------------------------------------- 1. Font */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../fonts/fraunces.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../fonts/inter.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ------------------------------------------------------ 2. Design system */
:root {
  /* palette brand */
  --brand: #1E5A67;
  --brand-dark: #123C46;
  --brand-deep: #0D2E36;
  --brand-soft: #E6F0F1;
  --accent: #E08A2E;
  --accent-dark: #A2601C;
  --accent-soft: #FBEEDC;

  /* neutri */
  --ink: #14232A;
  --text: #3D4E56;
  --muted: #6E8189;
  --bg: #FBF8F3;
  --bg-alt: #F3EEE5;
  --line: #E4DCD0;
  --white: #FFFFFF;

  /* tipografia */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  /* sistema */
  --shadow-sm: 0 2px 8px rgba(20, 35, 42, .06);
  --shadow-md: 0 10px 30px rgba(20, 35, 42, .09);
  --shadow-lg: 0 24px 60px rgba(20, 35, 42, .14);
  --shadow-xl: 0 40px 90px rgba(20, 35, 42, .2);
  --radius: 14px;
  --radius-lg: 24px;
  --container: 1180px;
  --nav-h: 78px;

  /* curve di movimento */
  --ease: cubic-bezier(.22, 1, .36, 1);          /* uscita morbida, generica */
  --ease-soft: cubic-bezier(.4, 0, .2, 1);       /* transizioni brevi */
  --ease-out-back: cubic-bezier(.34, 1.4, .64, 1);
}

/* ------------------------------------------------------------- 3. Reset */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
  -webkit-text-size-adjust: 100%;
}
body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.72;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.menu-open { overflow: hidden; }
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--brand); text-decoration: none; transition: color .25s var(--ease-soft); }
a:hover { color: var(--accent-dark); }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent); color: var(--ink); }

/* --------------------------------------------------------- 4. Tipografia */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.14;
  font-weight: 600;
  letter-spacing: -.015em;
}
h1 { font-size: clamp(2.35rem, 5.6vw, 4.1rem); line-height: 1.06; }
h2 { font-size: clamp(1.9rem, 3.8vw, 2.9rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.45rem); line-height: 1.25; }
h4 { font-size: 1.02rem; letter-spacing: .01em; }
p + p { margin-top: 1.05rem; }
strong { color: var(--ink); font-weight: 600; }

.eyebrow {
  font-family: var(--font-body);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .7rem;
}
.section-head.center .eyebrow { justify-content: center; }
.eyebrow::before {
  content: "";
  width: 26px; height: 2px;
  background: var(--accent);
  border-radius: 2px;
  flex: none;
  transform-origin: left;
}
.eyebrow-light { color: #F3C88A; }
.lead {
  font-size: clamp(1.05rem, 1.6vw, 1.22rem);
  color: var(--text);
  line-height: 1.7;
}
.section-head { max-width: 720px; margin-bottom: 3.2rem; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head p { margin-top: 1.1rem; }

/* ------------------------------------------------------------ 5. Layout */
.container { width: min(100% - 2.6rem, var(--container)); margin-inline: auto; }
.section { padding: clamp(4rem, 9vw, 7.5rem) 0; position: relative; }
.section-alt { background: var(--bg-alt); }
.section-soft { background: var(--brand-soft); }
.section-dark { background: var(--brand-deep); color: #CFE0E3; }
.section-dark h2, .section-dark h3, .section-dark h4 { color: #FFF; }
.section-tight { padding: clamp(3rem, 6vw, 5rem) 0; }
.grid { display: grid; gap: 1.6rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ----------------------------------------------------------- 6. Bottoni */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: .95rem 1.85rem;
  border-radius: 100px;
  font-weight: 600;
  font-size: .96rem;
  letter-spacing: .01em;
  text-align: center;
  overflow: hidden;
  isolation: isolate;
  border: 2px solid transparent;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease),
              background .3s var(--ease-soft), color .3s var(--ease-soft);
}
.btn:hover { transform: translateY(-3px); }
.btn:active { transform: translateY(-1px); }
.btn svg { width: 18px; height: 18px; flex: none; }
/* riflesso che attraversa il bottone al passaggio del mouse */
.btn::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 -80%;
  width: 60%;
  z-index: -1;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .3), transparent);
  transform: skewX(-18deg);
  transition: left .7s var(--ease);
}
.btn:hover::after { left: 120%; }
.btn-primary { background: var(--brand); color: #FFF; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--brand-dark); color: #FFF; box-shadow: 0 14px 30px rgba(30, 90, 103, .3); }
.btn-accent { background: var(--accent); color: var(--ink); box-shadow: var(--shadow-sm); }
.btn-accent:hover { background: #F0A04D; color: var(--ink); box-shadow: 0 14px 30px rgba(224, 138, 46, .38); }
.btn-outline { border-color: var(--brand); color: var(--brand); }
.btn-outline:hover { background: var(--brand); color: #FFF; }
.btn-ghost-light { border-color: rgba(255, 255, 255, .55); color: #FFF; }
.btn-ghost-light:hover { background: #FFF; color: var(--brand-dark); }
.btn-wa { background: #25D366; color: #06331A; }
.btn-wa:hover { background: #38E177; color: #06331A; box-shadow: 0 14px 30px rgba(37, 211, 102, .35); }
.btn-row { display: flex; flex-wrap: wrap; gap: .9rem; }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-weight: 600;
  font-size: .93rem;
  color: var(--brand);
  position: relative;
}
.link-arrow::after { content: "→"; transition: transform .35s var(--ease); }
.link-arrow:hover::after { transform: translateX(6px); }
.link-arrow::before {
  content: "";
  position: absolute;
  left: 0; bottom: -3px;
  width: 100%; height: 1.5px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .4s var(--ease);
}
.link-arrow:hover::before { transform: scaleX(1); transform-origin: left; }

/* ------------------------------------------------------------ 7. Header */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(251, 248, 243, .86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: box-shadow .4s var(--ease), border-color .4s var(--ease),
              transform .45s var(--ease), background .4s var(--ease);
}
.site-header.scrolled { box-shadow: var(--shadow-sm); border-bottom-color: var(--line); }
/* si ritira scendendo, ricompare risalendo */
.site-header.is-hidden { transform: translateY(-100%); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.nav-brand { display: flex; align-items: center; gap: .7rem; color: var(--ink); }
.nav-brand img { width: 52px; height: auto; transition: transform .5s var(--ease); }
.nav-brand:hover img { transform: scale(1.07) rotate(-2deg); }
.nav-brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.nav-brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.16rem;
  color: var(--brand-dark);
  letter-spacing: -.01em;
}
.nav-brand-sub {
  font-size: .66rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-links a { font-size: .93rem; font-weight: 500; color: var(--text); position: relative; }
.nav-links a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 100%; height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .4s var(--ease);
}
.nav-links a:not(.btn):hover::after,
.nav-links a[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }
.nav-links a[aria-current="page"] { color: var(--brand-dark); font-weight: 600; }
.nav-links .btn,
.nav-links .btn[aria-current="page"] { padding: .68rem 1.35rem; font-size: .9rem; color: #FFF; font-weight: 600; }
.nav-links .btn::after { display: none; }
.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}
.nav-toggle span {
  display: block;
  width: 24px; height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform .4s var(--ease), opacity .25s var(--ease-soft);
}
.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; transform: scaleX(.3); }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* barra di avanzamento lettura */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 100%;
  z-index: 101;
  background: linear-gradient(90deg, var(--accent), #F0B36A);
  transform: scaleX(var(--p, 0));
  transform-origin: left;
  pointer-events: none;
}

/* -------------------------------------------------------------- 8. Hero */
.hero {
  position: relative;
  min-height: min(92vh, 820px);
  display: flex;
  align-items: center;
  padding: calc(var(--nav-h) + 4rem) 0 5rem;
  color: #FFF;
  overflow: hidden;
}
.hero-bg { position: absolute; inset: -6% 0; z-index: 0; will-change: transform; }
.hero-bg img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 42%;
  transform: scale(1.06) translateY(var(--py, 0px));
  animation: kenburns 26s var(--ease-soft) infinite alternate;
}
@keyframes kenburns {
  from { transform: scale(1.04) translateY(var(--py, 0px)); }
  to   { transform: scale(1.14) translateY(calc(var(--py, 0px) - 14px)); }
}
.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(105deg, rgba(13, 46, 54, .94) 0%, rgba(13, 46, 54, .8) 44%, rgba(13, 46, 54, .38) 100%),
    linear-gradient(0deg, rgba(13, 46, 54, .55) 0%, transparent 40%);
}
/* aloni luminosi che respirano */
.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(10px);
  pointer-events: none;
  z-index: 1;
}
.hero-orb-1 {
  width: 460px; height: 460px;
  right: 6%; top: 8%;
  background: radial-gradient(circle, rgba(224, 138, 46, .3) 0%, transparent 66%);
  animation: float 15s ease-in-out infinite;
}
.hero-orb-2 {
  width: 380px; height: 380px;
  left: -6%; bottom: -8%;
  background: radial-gradient(circle, rgba(101, 187, 199, .26) 0%, transparent 68%);
  animation: float 19s ease-in-out infinite reverse;
}
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(26px, -30px) scale(1.08); }
  66%      { transform: translate(-20px, 20px) scale(.95); }
}
.hero .container {
  position: relative;
  z-index: 2;
  max-width: 780px;
  margin-inline: auto 0;
  margin-left: max(1.3rem, calc((100vw - var(--container)) / 2));
}
.hero h1 { color: #FFF; }
.hero .lead { color: rgba(255, 255, 255, .9); margin-top: 1.4rem; max-width: 34em; }
.hero-cta { margin-top: 2.3rem; }
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: 2.6rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, .2);
}
.hero-badges li {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: .84rem;
  font-weight: 500;
  color: rgba(255, 255, 255, .92);
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .18);
  padding: .45rem 1rem;
  border-radius: 100px;
  backdrop-filter: blur(6px);
  transition: background .3s var(--ease-soft), transform .3s var(--ease);
}
.hero-badges li:hover { background: rgba(255, 255, 255, .18); transform: translateY(-2px); }
.hero-badges svg { width: 15px; height: 15px; color: var(--accent); flex: none; }
/* invito a scorrere */
.scroll-cue {
  position: absolute;
  left: 50%; bottom: 26px;
  transform: translateX(-50%);
  z-index: 2;
  display: grid;
  place-items: center;
  gap: .5rem;
  font-size: .7rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .55);
}
.scroll-cue span {
  display: block;
  width: 1px; height: 42px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .7), transparent);
  animation: cue 2.4s var(--ease-soft) infinite;
}
@keyframes cue {
  0%       { transform: scaleY(0); transform-origin: top; }
  45%      { transform: scaleY(1); transform-origin: top; }
  55%      { transform: scaleY(1); transform-origin: bottom; }
  100%     { transform: scaleY(0); transform-origin: bottom; }
}

/* hero interno (pagine secondarie) */
.page-hero {
  background: var(--brand-deep);
  color: #CFE0E3;
  padding: calc(var(--nav-h) + 4.4rem) 0 3.8rem;
  position: relative;
  overflow: hidden;
}
.page-hero::after {
  content: "";
  position: absolute;
  right: -140px; top: -180px;
  width: 480px; height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(224, 138, 46, .24) 0%, transparent 68%);
  animation: float 17s ease-in-out infinite;
}
.page-hero .container { position: relative; z-index: 1; }
.page-hero h1 { color: #FFF; font-size: clamp(2.1rem, 4.4vw, 3.3rem); }
.page-hero .lead { color: rgba(255, 255, 255, .82); margin-top: 1.1rem; max-width: 46em; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: .4rem; font-size: .82rem; margin-bottom: 1.4rem; color: rgba(255, 255, 255, .6); }
.breadcrumb a { color: rgba(255, 255, 255, .78); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb li:not(:last-child)::after { content: " ›"; color: rgba(255, 255, 255, .4); }

/* -------------------------------------------------------------- 9. Card */
.card {
  position: relative;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 2.1rem;
  box-shadow: var(--shadow-sm);
  transition: transform .45s var(--ease), box-shadow .45s var(--ease), border-color .45s var(--ease);
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
/* alone che segue il cursore */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(340px circle at var(--mx, 50%) var(--my, 0%), rgba(224, 138, 46, .1), transparent 62%);
  opacity: 0;
  transition: opacity .45s var(--ease-soft);
  pointer-events: none;
}
.card:hover::before { opacity: 1; }
.card:hover { transform: translateY(-7px); box-shadow: var(--shadow-lg); border-color: #D3C7B6; }
.card > * { position: relative; }
.card h3 { margin-bottom: .75rem; }
.card p { font-size: .97rem; }
.card-icon {
  width: 54px; height: 54px;
  border-radius: 16px;
  background: var(--brand-soft);
  color: var(--brand);
  display: grid;
  place-items: center;
  margin-bottom: 1.4rem;
  transition: transform .5s var(--ease-out-back), background .4s var(--ease-soft), color .4s var(--ease-soft);
}
.card:hover .card-icon { transform: translateY(-3px) rotate(-6deg) scale(1.07); background: var(--accent); color: var(--ink); }
.card-icon svg { width: 26px; height: 26px; }
.card .link-arrow { margin-top: auto; padding-top: 1.3rem; align-self: flex-start; }

/* card servizio con immagine */
.service-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform .45s var(--ease), box-shadow .45s var(--ease);
}
.service-card:hover { transform: translateY(-7px); box-shadow: var(--shadow-lg); }
.service-card-media { aspect-ratio: 16 / 11; overflow: hidden; background: var(--bg-alt); position: relative; }
.service-card-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(13, 46, 54, .32));
  opacity: 0;
  transition: opacity .45s var(--ease-soft);
}
.service-card:hover .service-card-media::after { opacity: 1; }
.service-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.service-card:hover .service-card-media img { transform: scale(1.07); }
.service-card-body { padding: 1.7rem 1.7rem 1.9rem; display: flex; flex-direction: column; flex: 1; }
.service-card-body .eyebrow { margin-bottom: .6rem; font-size: .7rem; }
.service-card-body .eyebrow::before { width: 18px; }
.service-card-body p { font-size: .95rem; margin-top: .6rem; }
.service-card-body .link-arrow { margin-top: auto; padding-top: 1.2rem; align-self: flex-start; }

/* ------------------------------------------------------------- 10. Split */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.split-media { position: relative; z-index: 0; }
.split-media img {
  width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  aspect-ratio: 4 / 5;
  object-fit: cover;
}
.split-media.tall img { aspect-ratio: 3 / 4; }
.split-media.portrait img { aspect-ratio: 3 / 4; object-position: center 18%; }
/* cornice che entra con l'immagine */
.split-media::after {
  content: "";
  position: absolute;
  inset: 18px -18px -18px 18px;
  border: 2px solid var(--accent);
  border-radius: var(--radius-lg);
  z-index: -1;
  opacity: .5;
}
.split-badge {
  position: absolute;
  right: -18px; bottom: 32px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 1.1rem 1.4rem;
  max-width: 240px;
  border-left: 4px solid var(--accent);
  transition: transform .5s var(--ease);
}
.split-media:hover .split-badge { transform: translateY(-5px); }
.split-badge strong { display: block; font-family: var(--font-display); font-size: 1.05rem; }
.split-badge span { font-size: .85rem; color: var(--muted); }
.split-body h2 { margin-bottom: 1.3rem; }
.split-body .btn-row { margin-top: 2rem; }

/* ------------------------------------------------------ 11. Elenco check */
.check-list { display: grid; gap: .9rem; margin-top: 1.6rem; }
.check-list li { display: flex; gap: .8rem; align-items: flex-start; font-size: .98rem; }
.check-list svg { width: 21px; height: 21px; flex: none; color: var(--accent-dark); margin-top: .25rem; }
.section-dark .check-list svg { color: var(--accent); }

/* --------------------------------------------------- 12. Passi 1-2-3 */
.steps { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.6rem; counter-reset: step; }
/* linea che si disegna da sinistra a destra quando la sezione entra in vista */
.steps::before {
  content: "";
  position: absolute;
  top: 26px; left: 6%; right: 6%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), rgba(224, 138, 46, .25));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.6s var(--ease) .25s;
}
.steps.is-in::before { transform: scaleX(1); }
.step { position: relative; padding-top: 4.2rem; }
.step::before {
  counter-increment: step;
  content: "0" counter(step);
  position: absolute;
  top: 0; left: 0;
  width: 54px; height: 54px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand-deep);
  border: 2px solid var(--accent);
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
}
.step h3 { margin-bottom: .6rem; }
.step p { font-size: .96rem; }
.section-dark .step p { color: rgba(255, 255, 255, .78); }

/* ------------------------------------------------- 13. Servizio dettaglio */
.service-block { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4.2rem); align-items: center; }
.service-block + .service-block { margin-top: clamp(3.5rem, 7vw, 6rem); }
.service-block:nth-child(even) .service-block-media { order: 2; }
.service-block-media { overflow: hidden; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.service-block-media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform .9s var(--ease);
}
.service-block-media:hover img { transform: scale(1.05); }
.service-block h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); margin-bottom: 1.1rem; }
.service-block .tag-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.6rem; }
.tag {
  font-size: .8rem;
  font-weight: 500;
  background: var(--brand-soft);
  color: var(--brand-dark);
  border-radius: 100px;
  padding: .35rem .9rem;
  transition: background .3s var(--ease-soft), transform .3s var(--ease);
}
.tag:hover { background: var(--accent-soft); transform: translateY(-2px); }
.service-block .btn-row { margin-top: 2rem; }

/* ------------------------------------------------------- 14. Marquee */
.marquee {
  overflow: hidden;
  background: var(--brand);
  color: rgba(255, 255, 255, .9);
  padding: 1.1rem 0;
  border-block: 1px solid rgba(255, 255, 255, .12);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track { display: flex; width: max-content; animation: marquee 38s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span {
  display: inline-flex;
  align-items: center;
  gap: 2.4rem;
  padding-right: 2.4rem;
  font-family: var(--font-display);
  font-size: 1.12rem;
  white-space: nowrap;
}
.marquee-track span::after { content: "✦"; color: var(--accent); font-size: .8rem; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* --------------------------------------------------------- 15. Accordion */
.faq { display: grid; gap: .9rem; max-width: 860px; margin-inline: auto; }
.faq-item {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow .4s var(--ease), border-color .4s var(--ease);
}
.faq-item.is-open { box-shadow: var(--shadow-md); border-color: #D3C7B6; }
.faq-q {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.2rem;
  text-align: left;
  padding: 1.25rem 1.5rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  transition: color .3s var(--ease-soft);
}
.faq-q:hover { color: var(--brand); }
.faq-q::after {
  content: "+";
  font-size: 1.5rem;
  color: var(--accent-dark);
  flex: none;
  transition: transform .45s var(--ease-out-back);
}
.faq-item.is-open .faq-q::after { transform: rotate(135deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .45s var(--ease); }
.faq-a > div {
  padding: 0 1.5rem 1.4rem;
  font-size: .97rem;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity .4s var(--ease-soft) .1s, transform .4s var(--ease) .1s;
}
.faq-item.is-open .faq-a > div { opacity: 1; transform: none; }

/* ------------------------------------------------------- 16. CTA banner */
.cta-banner { background: var(--brand); color: #FFF; text-align: center; position: relative; overflow: hidden; }
.cta-banner-bg { position: absolute; inset: 0; z-index: 0; }
.cta-banner-bg img { width: 100%; height: 100%; object-fit: cover; opacity: .22; }
.cta-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(224, 138, 46, .34) 0%, transparent 56%),
    linear-gradient(180deg, rgba(30, 90, 103, .72), rgba(18, 60, 70, .92));
}
.cta-banner .container { position: relative; z-index: 2; max-width: 760px; }
.cta-banner h2 { color: #FFF; }
.cta-banner p { color: rgba(255, 255, 255, .9); margin-top: 1.1rem; }
.cta-banner .btn-row { justify-content: center; margin-top: 2.2rem; }

/* -------------------------------------------------------------- 17. Blog */
.post-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow: var(--shadow-sm);
  transition: transform .45s var(--ease), box-shadow .45s var(--ease);
}
.post-card:hover { transform: translateY(-7px); box-shadow: var(--shadow-lg); }
.post-card-media { aspect-ratio: 16 / 9; overflow: hidden; display: block; }
.post-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.post-card:hover .post-card-media img { transform: scale(1.06); }
.post-card-body { padding: 1.6rem 1.7rem 1.9rem; display: flex; flex-direction: column; flex: 1; }
.post-meta { font-size: .78rem; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; font-weight: 600; }
.post-card h3 { margin: .7rem 0 .6rem; font-size: 1.22rem; }
.post-card h3 a { color: inherit; }
.post-card:hover h3 a { color: var(--brand); }
.post-card p { font-size: .95rem; }
.post-card .link-arrow { margin-top: auto; padding-top: 1.2rem; align-self: flex-start; }

.article { max-width: 760px; margin-inline: auto; }
.article > * + * { margin-top: 1.15rem; }
.article h2 { font-size: clamp(1.55rem, 3vw, 2.05rem); margin-top: 2.8rem; }
.article h3 { margin-top: 2rem; font-size: 1.22rem; }
.article ul { display: grid; gap: .6rem; padding-left: 0; }
.article ul li { display: flex; gap: .7rem; }
.article ul li::before { content: "—"; color: var(--accent-dark); flex: none; }
.article ol { padding-left: 1.3rem; list-style: decimal; display: grid; gap: .6rem; }
.article .callout {
  background: var(--brand-soft);
  border-left: 4px solid var(--brand);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.3rem 1.5rem;
  font-size: .98rem;
}
.article-cta {
  margin-top: 3rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.article-cta .btn-row { justify-content: center; margin-top: 1.4rem; }

/* ---------------------------------------------------------- 18. Contatti */
.contact-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(2rem, 4vw, 3.5rem); align-items: start; }
.form-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1.7rem, 3.5vw, 2.6rem);
  box-shadow: var(--shadow-md);
}
.field { display: grid; gap: .45rem; margin-bottom: 1.2rem; }
.field label { font-size: .87rem; font-weight: 600; color: var(--ink); }
.field input, .field textarea, .field select {
  width: 100%;
  padding: .85rem 1rem;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  font-size: .97rem;
  transition: border-color .3s var(--ease-soft), background .3s var(--ease-soft), box-shadow .3s var(--ease-soft);
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(30, 90, 103, .1);
}
.field textarea { min-height: 140px; resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.field-check { display: flex; gap: .7rem; align-items: flex-start; font-size: .87rem; color: var(--muted); margin-bottom: 1.4rem; }
.field-check input { width: 19px; height: 19px; flex: none; margin-top: .18rem; accent-color: var(--brand); }
.form-status { margin-top: 1rem; font-size: .9rem; font-weight: 500; color: var(--brand-dark); min-height: 1.4em; }

.info-list { display: grid; gap: 1.4rem; }
.info-item { display: flex; gap: 1rem; align-items: flex-start; }
.info-icon {
  width: 46px; height: 46px;
  border-radius: 14px;
  background: var(--brand-soft);
  color: var(--brand);
  display: grid;
  place-items: center;
  flex: none;
  transition: transform .45s var(--ease-out-back), background .35s var(--ease-soft), color .35s var(--ease-soft);
}
.info-item:hover .info-icon { transform: rotate(-8deg) scale(1.08); background: var(--accent); color: var(--ink); }
.info-icon svg { width: 21px; height: 21px; }
.info-item h4 { font-family: var(--font-body); font-size: .78rem; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); margin-bottom: .2rem; }
.info-item a, .info-item p { font-size: 1.02rem; color: var(--ink); font-weight: 500; }
.info-item a:hover { color: var(--accent-dark); }

/* -------------------------------------------------------------- 19. 404 */
.error-page { min-height: 78vh; display: grid; place-items: center; text-align: center; padding: calc(var(--nav-h) + 4rem) 0 5rem; }
.error-code { font-family: var(--font-display); font-size: clamp(5rem, 16vw, 9rem); color: var(--brand); line-height: 1; opacity: .22; }

/* ------------------------------------------------------------ 20. Legale */
.legal { max-width: 800px; margin-inline: auto; }
.legal h2 { font-size: clamp(1.4rem, 2.6vw, 1.8rem); margin: 2.6rem 0 1rem; }
.legal h3 { margin: 1.8rem 0 .7rem; font-size: 1.12rem; }
.legal p, .legal li { font-size: .98rem; }
.legal ul { display: grid; gap: .55rem; margin-top: .8rem; }
.legal ul li { display: flex; gap: .7rem; }
.legal ul li::before { content: "•"; color: var(--accent-dark); flex: none; }
.legal table { width: 100%; border-collapse: collapse; margin-top: 1.2rem; font-size: .92rem; }
.legal th, .legal td { text-align: left; padding: .8rem 1rem; border: 1px solid var(--line); }
.legal th { background: var(--bg-alt); font-family: var(--font-display); }

/* ------------------------------------------------------------ 21. Footer */
.site-footer { background: var(--brand-deep); color: rgba(255, 255, 255, .74); padding: clamp(3.5rem, 7vw, 5rem) 0 0; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: 2.5rem; padding-bottom: 3rem; }
.footer-brand { display: flex; align-items: center; gap: .7rem; margin-bottom: 1.1rem; }
.footer-brand img { width: 54px; height: auto; }
.footer-brand-name { font-family: var(--font-display); font-size: 1.16rem; color: #FFF; font-weight: 600; line-height: 1.15; }
.footer-brand-sub { font-size: .67rem; letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .5); font-weight: 600; }
.footer-col p { font-size: .93rem; }
.footer-col h4 { color: #FFF; margin-bottom: 1.1rem; font-family: var(--font-body); font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; }
.footer-col ul { display: grid; gap: .65rem; }
.footer-col a { color: rgba(255, 255, 255, .74); font-size: .93rem; display: inline-block; }
.footer-col a:hover { color: var(--accent); transform: translateX(3px); }
.footer-col li a { transition: color .25s var(--ease-soft), transform .3s var(--ease); }
.footer-social { display: flex; gap: .6rem; margin-top: 1.4rem; }
.footer-social a {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .14);
  color: #FFF;
  transition: background .3s var(--ease-soft), transform .4s var(--ease-out-back), color .3s var(--ease-soft);
}
.footer-social a:hover { background: var(--accent); color: var(--ink); transform: translateY(-4px) scale(1.06); }
.footer-social svg { width: 18px; height: 18px; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .12);
  padding: 1.5rem 0 1.8rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: .8rem;
  font-size: .84rem;
}
.footer-bottom p { color: rgba(255, 255, 255, .58); }
.footer-bottom a { color: rgba(255, 255, 255, .74); }
.footer-bottom a:hover { color: var(--accent); }
.footer-credit a { font-weight: 600; }

/* ============================================================ 22. MOTION */

/* Regola di sicurezza: senza JS NULLA resta nascosto.
   Le classi di partenza valgono solo se <html> ha class="js". */
html.js [data-reveal] {
  opacity: 0;
  transition:
    opacity .85s var(--ease) var(--d, 0s),
    transform .85s var(--ease) var(--d, 0s),
    filter .85s var(--ease) var(--d, 0s),
    clip-path .95s var(--ease) var(--d, 0s);
  will-change: opacity, transform;
}
html.js [data-reveal="up"]    { transform: translateY(38px); }
html.js [data-reveal="down"]  { transform: translateY(-28px); }
html.js [data-reveal="left"]  { transform: translateX(-46px); }
html.js [data-reveal="right"] { transform: translateX(46px); }
html.js [data-reveal="scale"] { transform: scale(.93); }
html.js [data-reveal="blur"]  { filter: blur(12px); transform: translateY(20px); }
html.js [data-reveal="mask"]  { opacity: 1; clip-path: inset(0 0 100% 0); }
html.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
  filter: none;
  clip-path: inset(0 0 0 0);
  will-change: auto;
}

/* titolo che sale parola per parola */
.split-word { display: inline-block; overflow: hidden; vertical-align: bottom; }
.split-word > i {
  display: inline-block;
  font-style: inherit;
  transform: translateY(105%);
  transition: transform .72s var(--ease) var(--wd, 0s);
}
html:not(.js) .split-word > i { transform: none; }
.is-in .split-word > i, .split-word.is-in > i { transform: none; }

/* cornice dello split che si apre dopo l'immagine */
html.js .split-media::after {
  transform: scale(.9);
  opacity: 0;
  transition: transform 1s var(--ease) .3s, opacity 1s var(--ease) .3s;
}
html.js .split-media.is-in::after { transform: none; opacity: .5; }

/* torna su */
.to-top {
  position: fixed;
  right: 22px; bottom: 22px;
  z-index: 90;
  width: 48px; height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: #FFF;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(16px) scale(.9);
  pointer-events: none;
  transition: opacity .4s var(--ease), transform .5s var(--ease-out-back), background .3s var(--ease-soft);
}
.to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: var(--accent); color: var(--ink); }
.to-top svg { width: 20px; height: 20px; }

/* transizione tra pagine (browser che supportano le View Transitions) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .28s var(--ease-soft) both; }
::view-transition-new(root) { animation: vt-in .42s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-8px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(14px); } }

/* ---------------------------------------------------------- 23. Utility */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 50%; top: -60px;
  transform: translateX(-50%);
  z-index: 200;
  background: var(--brand);
  color: #FFF;
  padding: .7rem 1.4rem;
  border-radius: 0 0 12px 12px;
  transition: top .25s var(--ease);
}
.skip-link:focus { top: 0; color: #FFF; }
.text-center { text-align: center; }
.mt-lg { margin-top: 2.5rem; }

/* ------------------------------------------------------ 24. Breakpoints */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2.2rem; }
  .split-badge { right: 12px; }
  .split-media::after { inset: 14px -14px -14px 14px; }
}

@media (max-width: 900px) {
  :root { --nav-h: 70px; }
  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed;
    inset: var(--nav-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    padding: 1rem 1.6rem 2rem;
    transform: translateY(-130%);
    transition: transform .5s var(--ease);
    max-height: calc(100vh - var(--nav-h));
    overflow-y: auto;
  }
  .nav-links.is-open { transform: translateY(0); }
  .nav-links li { border-bottom: 1px solid var(--line); opacity: 0; transform: translateY(-10px); transition: opacity .4s var(--ease) var(--nd, 0s), transform .4s var(--ease) var(--nd, 0s); }
  .nav-links.is-open li { opacity: 1; transform: none; }
  html:not(.js) .nav-links li { opacity: 1; transform: none; }
  .nav-links li:last-child { border-bottom: 0; padding-top: 1.2rem; }
  .nav-links a { display: block; padding: .95rem 0; font-size: 1.02rem; }
  .nav-links a:not(.btn)::after { display: none; }
  .nav-links .btn { display: flex; padding: .9rem 1.4rem; }
  .site-header.is-hidden { transform: none; }
  .grid-3, .grid-2, .steps, .split, .service-block, .contact-grid { grid-template-columns: 1fr; }
  .service-block:nth-child(even) .service-block-media { order: 0; }
  .split-media img, .split-media.tall img { aspect-ratio: 16 / 10; }
  .split-media.portrait img { aspect-ratio: 4 / 5; }
  .split-media::after { display: none; }
  .split-badge { position: static; max-width: none; margin-top: 1rem; }
  .hero .container { margin-left: auto; }
  .steps::before { display: none; }
  .step { padding-top: 0; padding-left: 4.6rem; }
  .step::before { top: -2px; }
  .scroll-cue { display: none; }
}

@media (max-width: 768px) {
  body { font-size: 1rem; }
  .hero { min-height: auto; padding-top: calc(var(--nav-h) + 3.2rem); }
  .hero-bg::after { background: linear-gradient(180deg, rgba(13, 46, 54, .84) 0%, rgba(13, 46, 54, .92) 100%); }
  .hero-orb-1, .hero-orb-2 { display: none; }
  .section-head { margin-bottom: 2.4rem; }
  .marquee-track span { font-size: 1rem; gap: 1.6rem; padding-right: 1.6rem; }
}

@media (max-width: 640px) {
  .grid-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .field-row { grid-template-columns: 1fr; }
  .btn { width: 100%; }
  .btn-row { flex-direction: column; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .to-top { right: 14px; bottom: 14px; }
}

@media (max-width: 480px) {
  .container { width: min(100% - 1.8rem, var(--container)); }
  .card, .form-card { padding: 1.5rem; }
  .nav-brand img { width: 44px; }
  .nav-brand-name { font-size: 1.02rem; }
}

/* Accessibilità: chi chiede meno movimento vede tutto, subito e fermo. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
  }
  html.js [data-reveal] { opacity: 1; transform: none; filter: none; clip-path: none; }
  .split-word > i { transform: none; }
  .hero-bg img { animation: none; transform: scale(1.02); }
  .marquee-track { animation: none; }
  .steps::before { transform: scaleX(1); }
  html.js .split-media::after { opacity: .5; transform: none; }
  @view-transition { navigation: none; }
}

@media print {
  .site-header, .nav-toggle, .cta-banner, .site-footer, .to-top, .scroll-progress, .marquee { display: none; }
  body { background: #FFF; color: #000; }
}
