/* ==========================================================
   Base comune alle pagine demo — ogni pagina definisce i propri colori
   ========================================================== */
:root {
  --bg: #fff; --surface: #f5f7f8; --text: #111; --muted: #5b6470; --line: rgba(0,0,0,.08);
  --primary: #0ea5a4; --primary-ink: #fff; --accent: #0ea5a4;
  --font-head: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --radius: 18px; --btn-radius: 999px; --head-weight: 800; --head-transform: none; --head-spacing: -.02em;
  --ease: cubic-bezier(.22, 1, .36, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 120px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-body); font-size: 1.0625rem; line-height: 1.65; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-head); font-weight: var(--head-weight); text-transform: var(--head-transform); letter-spacing: var(--head-spacing); line-height: 1.1; margin: 0; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[tabindex="-1"]:focus { outline: none; }
.wrap { width: min(1120px, 100% - 40px); margin-inline: auto; }

/* Barra demo */
.demo-bar {
  position: sticky; top: 0; z-index: 60; background: #0a0c10; color: #f2f4f7;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; font-size: .8rem;
}
.demo-bar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.demo-label { display: inline-flex; align-items: center; gap: 8px; text-transform: uppercase; letter-spacing: .12em; font-weight: 600; color: #9aa3b2; }
.demo-label::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #c6ff3d; }
.demo-back {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; font-weight: 700;
  background: #c6ff3d; color: #0a0c10; transition: transform .3s var(--ease), box-shadow .3s;
}
.demo-label, .demo-back { white-space: nowrap; }
.demo-logo { display: inline-grid; place-items: center; width: 26px; height: 20px; margin-right: 2px; border-radius: 5px; background: #0a0c10; color: #c6ff3d; font-size: .62rem; font-weight: 900; letter-spacing: -.02em; }
.demo-back:hover { transform: translateX(-3px); box-shadow: 0 8px 20px -8px rgba(198,255,61,.8); }

/* Header del sito demo */
.d-header { position: sticky; top: 44px; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); transition: box-shadow .3s; }
.d-header.scrolled { box-shadow: 0 10px 30px -20px rgba(0,0,0,.35); }
.d-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.d-brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 700; font-size: 1.12rem; line-height: 1.15; }
.d-brand small { display: block; font-family: var(--font-body); font-weight: 500; font-size: .72rem; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.d-brand .mark { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--primary); color: var(--primary-ink); font-size: 1.2rem; }
.d-nav { display: none; gap: 26px; font-weight: 500; }
.d-nav a { position: relative; color: var(--muted); transition: color .25s; }
.d-nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px; background: var(--accent); transform: scaleX(0); transition: transform .35s var(--ease); }
.d-nav a:hover { color: var(--text); }
.d-nav a:hover::after { transform: scaleX(1); }
.d-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: .85em 1.4em; border-radius: var(--btn-radius);
  background: var(--primary); color: var(--primary-ink); font-weight: 700; font-size: .95rem; border: 1px solid var(--primary);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), background-color .3s, color .3s;
}
.d-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -12px color-mix(in srgb, var(--primary) 70%, transparent); }
.d-btn.outline { background: transparent; color: var(--text); border-color: color-mix(in srgb, var(--text) 25%, transparent); }
.d-btn.outline:hover { border-color: var(--accent); color: var(--accent); }
.d-header .d-btn { padding: .65em 1.1em; font-size: .88rem; }

/* Hero */
.d-hero { position: relative; overflow: hidden; padding: 64px 0 80px; }
.d-hero .wrap { display: grid; gap: 48px; align-items: center; }
.d-kicker { display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin-bottom: 18px; }
.d-hero h1 { font-size: clamp(2.3rem, 7.5vw, 4.2rem); margin-bottom: 20px; }
.d-hero p.lead { font-size: 1.15rem; color: var(--muted); max-width: 46ch; }
.d-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.d-visual { position: relative; min-height: 300px; border-radius: calc(var(--radius) * 1.4); overflow: hidden; display: grid; place-items: center; }
.d-visual .big-emoji { position: relative; font-size: 6rem; filter: drop-shadow(0 20px 30px rgba(0,0,0,.25)); animation: d-float 6s ease-in-out infinite; }
@keyframes d-float { 50% { transform: translateY(-14px) rotate(-3deg); } }

/* Valori */
.d-values { display: grid; gap: 14px; margin-top: 8px; }
.d-values li { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); font-weight: 600; }
.d-values span { font-size: 1.4rem; }

/* Sezioni */
.d-section { padding: clamp(70px, 10vw, 110px) 0; }
.d-section.alt { background: var(--surface); }
.d-head { max-width: 680px; margin-bottom: 44px; }
.d-head h2 { font-size: clamp(1.9rem, 5vw, 3rem); }
.d-head p { color: var(--muted); margin-top: 14px; font-size: 1.08rem; }
.d-services { display: grid; gap: 18px; }
.d-service {
  padding: 30px 26px; border-radius: var(--radius); background: var(--bg); border: 1px solid var(--line);
  transition: transform .45s var(--ease), box-shadow .45s var(--ease), border-color .3s;
}
.d-service:hover { transform: translateY(-6px); box-shadow: 0 26px 50px -28px rgba(0,0,0,.35); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.d-service .ico { width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; font-size: 1.6rem; margin-bottom: 20px; background: color-mix(in srgb, var(--accent) 14%, transparent); transition: transform .5s var(--ease); }
.d-service:hover .ico { transform: scale(1.1) rotate(-6deg); }
.d-service h3 { font-size: 1.25rem; margin-bottom: 8px; }
.d-service p { color: var(--muted); font-size: .98rem; }

/* Banda centrale */
.d-band { padding: clamp(60px, 9vw, 96px) 0; text-align: center; background: var(--primary); color: var(--primary-ink); }
.d-band h2 { font-size: clamp(1.7rem, 4.5vw, 2.7rem); max-width: 22ch; margin: 0 auto 26px; }
.d-band .d-btn { background: var(--primary-ink); color: var(--primary); border-color: var(--primary-ink); }

/* Contatti */
.d-contact { display: grid; gap: 22px; }
.d-info { display: grid; gap: 14px; }
.d-info li { display: flex; gap: 14px; padding: 18px 20px; border-radius: var(--radius); background: var(--bg); border: 1px solid var(--line); }
.d-info .ico { font-size: 1.35rem; line-height: 1.4; }
.d-info strong { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; }
.d-map {
  position: relative; min-height: 280px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line);
  background:
    linear-gradient(90deg, transparent 48%, color-mix(in srgb, var(--text) 10%, transparent) 48% 52%, transparent 52%),
    linear-gradient(0deg, transparent 58%, color-mix(in srgb, var(--text) 10%, transparent) 58% 61%, transparent 61%),
    linear-gradient(30deg, transparent 70%, color-mix(in srgb, var(--text) 7%, transparent) 70% 72%, transparent 72%),
    color-mix(in srgb, var(--accent) 10%, var(--bg));
}
.d-map .pin { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -100%); font-size: 2.6rem; }
.d-map .pin::after { content: ""; position: absolute; left: 50%; bottom: -6px; width: 18px; height: 6px; border-radius: 50%; background: rgba(0,0,0,.25); transform: translateX(-50%); }
.d-map .map-note { position: absolute; left: 14px; bottom: 14px; font-size: .78rem; padding: 6px 10px; border-radius: 8px; background: var(--bg); color: var(--muted); }
.d-cta-box { padding: 30px 26px; border-radius: var(--radius); background: var(--primary); color: var(--primary-ink); display: grid; gap: 14px; }
.d-cta-box h3 { font-size: 1.5rem; }
.d-cta-box p { opacity: .85; }
.d-cta-box .d-btn { justify-self: start; background: var(--primary-ink); color: var(--primary); border-color: var(--primary-ink); }

.d-footer { padding: 34px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; text-align: center; }
.d-footer a { color: var(--accent); font-weight: 600; }

/* Comparsa allo scroll */
.js .reveal { opacity: 0; translate: 0 28px; transition: opacity .9s var(--ease), translate 1s var(--ease), transform .45s var(--ease), box-shadow .45s var(--ease), border-color .3s; transition-delay: var(--d, 0s), var(--d, 0s), 0s, 0s, 0s; }
.js .reveal.visible { opacity: 1; translate: none; }

@media (min-width: 700px) {
  .d-services { grid-template-columns: repeat(2, 1fr); }
  .d-values { grid-template-columns: repeat(3, 1fr); }
  .d-contact { grid-template-columns: 1fr 1fr; }
  .d-contact .d-cta-box { grid-column: 1 / -1; }
}
@media (min-width: 960px) {
  .d-nav { display: flex; }
  .d-hero { padding: 96px 0 110px; }
  .d-hero .wrap { grid-template-columns: 1.1fr .9fr; }
  .d-services { grid-template-columns: repeat(3, 1fr); }
  .d-visual { min-height: 420px; }
}
/* Telefono e tablet: il menu Home / Servizi / Contatti va su una seconda riga */
@media (max-width: 959px) {
  html { scroll-padding-top: 160px; }
  .d-header .wrap { flex-wrap: wrap; row-gap: 0; padding-top: 8px; }
  .d-nav { display: flex; order: 3; width: 100%; justify-content: center; gap: 22px; padding: 4px 0 10px; font-size: .92rem; }
}
@media (max-width: 520px) {
  .wrap { width: calc(100% - 32px); }
  .demo-label { letter-spacing: .06em; font-size: .72rem; }
  .hide-sm { display: none; }
  .d-brand { font-size: 1rem; min-width: 0; }
  .d-brand .mark { width: 34px; height: 34px; font-size: 1rem; }
  .d-brand small { display: none; }
  .d-header .wrap { min-height: 58px; }
  .d-header .d-btn { padding: .55em .9em; font-size: .8rem; }
  .d-nav { gap: 18px; }
  .d-actions .d-btn { width: 100%; }
  .d-hero { padding: 44px 0 60px; }
  .d-hero h1 { overflow-wrap: break-word; }
  .d-visual { min-height: 240px; }
  .d-visual .big-emoji { font-size: 4.5rem; }
  .d-cta-box .d-btn { justify-self: stretch; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; }
  .js .reveal { opacity: 1; translate: none; }
}
@media (max-width: 380px) {
  .demo-bar .wrap { gap: 8px; }
  .demo-label { letter-spacing: 0; }
  .demo-label::before, .demo-logo { display: none; }
  .demo-back { padding: 7px 11px; }
}

/* Telefono: niente sfocature né animazioni continue */
@media (max-width: 768px) {
  .d-header { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg); }
  .d-visual .big-emoji { filter: none; }
  .d-visual .big-emoji, .d-visual::before, .d-visual::after { animation: none !important; }
}
@media (hover: none) {
  .d-service:hover, .d-btn:hover, .demo-back:hover { transform: none; }
}
