/* ==========================================================================
   Geom. Davide Cremoni — foglio di stile principale
   Concetto: mappa catastale. Inchiostro di Prussia su carta da lucido,
   carminio dei fabbricati come unico accento. Tema scuro: cianografia.
   Tutti i colori sono token: per cambiare palette modifica solo :root.
   ========================================================================== */

/* Caratteri ospitati sul sito (licenza SIL OFL, file in assets/fonts) */
@font-face { font-family: "Archivo"; src: url("../fonts/archivo-var.woff") format("woff"); font-weight: 400 800; font-stretch: 62% 100%; font-style: normal; font-display: swap; }

:root {
  --paper: #F4F6F3;        /* fondo pagina: carta da lucido */
  --sheet: #FFFFFF;        /* fogli, schede, riquadri */
  --ink: #1F2B3D;          /* testo: inchiostro di Prussia */
  --ink-2: #4E596A;        /* testo secondario */
  --rule: #C8CFD8;         /* linee */
  --rule-soft: #E2E6EB;    /* linee leggere */
  --accent: #B3283E;       /* carminio dei fabbricati */
  --cta: #B3283E;          /* pulsanti principali */
  --cta-ink: #FFFFFF;
  --cta-hover: #952034;
  --wash: #F6DCE1;         /* campitura carminio chiara */
  --water: #D5E3F1;        /* acque, fossi */
  --band: #1F2B3D;         /* fascia di chiusura */
  --band-ink: #F4F6F3;
  --band-ink-2: #B9C4D3;
  --band-edge: #1F2B3D;
  --ok: #2C6A4D;  --ok-bg: #E0EFE7;
  --warn: #8F5300; --warn-bg: #FBECD3;
  --info: #2A4F7F; --info-bg: #E1E9F4;
  --k-stone: #DAD3C6;      /* richiamo alle cucine (pietra) */
  --k-ink: #33271F;
  --k-red: #8C2F26;
  --shadow: 0 1px 0 rgba(31, 43, 61, .05), 0 18px 40px -24px rgba(31, 43, 61, .45);
  --map-img: url("../img/mappa-chiara.svg");
  --font: "Archivo", "Arial Narrow", Arial, system-ui, sans-serif;
  --display: var(--font);
  --serif: "Marcellus", Georgia, "Times New Roman", serif;
  --gutter: clamp(16px, 4vw, 40px);
  --maxw: 1180px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0F1F35;
    --sheet: #152A46;
    --ink: #E8EEF6;
    --ink-2: #A9BAD0;
    --rule: #31507A;
    --rule-soft: #1F3A5E;
    --accent: #F0899A;
    --cta: #C93B52;
    --cta-ink: #FFFFFF;
    --cta-hover: #D9506A;
    --wash: #3B2946;
    --water: #18385E;
    --band: #152A46;
    --band-ink: #E8EEF6;
    --band-ink-2: #A9BAD0;
    --band-edge: #F0899A;
    --ok: #86D3AC;  --ok-bg: #163B31;
    --warn: #F3B76B; --warn-bg: #40311A;
    --info: #9CC2F0; --info-bg: #1B3556;
    --k-stone: #2A2420;
    --k-ink: #ECE5DA;
    --k-red: #D98273;
    --shadow: 0 1px 0 rgba(0, 0, 0, .25), 0 18px 40px -24px rgba(0, 0, 0, .8);
    --map-img: url("../img/mappa-scura.svg");
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0F1F35;
  --sheet: #152A46;
  --ink: #E8EEF6;
  --ink-2: #A9BAD0;
  --rule: #31507A;
  --rule-soft: #1F3A5E;
  --accent: #F0899A;
  --cta: #C93B52;
  --cta-ink: #FFFFFF;
  --cta-hover: #D9506A;
  --wash: #3B2946;
  --water: #18385E;
  --band: #152A46;
  --band-ink: #E8EEF6;
  --band-ink-2: #A9BAD0;
  --band-edge: #F0899A;
  --ok: #86D3AC;  --ok-bg: #163B31;
  --warn: #F3B76B; --warn-bg: #40311A;
  --info: #9CC2F0; --info-bg: #1B3556;
  --k-stone: #2A2420;
  --k-ink: #ECE5DA;
  --k-red: #D98273;
  --shadow: 0 1px 0 rgba(0, 0, 0, .25), 0 18px 40px -24px rgba(0, 0, 0, .8);
  --map-img: url("../img/mappa-scura.svg");
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-stretch: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--accent); }
p { margin: 0 0 1em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
q { quotes: "\201C" "\201D"; }
:lang(de) q { quotes: "\201E" "\201C"; }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: absolute; inset-inline-start: -9999px; top: 0; }
.skip:focus { inset-inline-start: 16px; top: 12px; z-index: 100; background: var(--sheet); color: var(--ink); padding: 10px 14px; border: 1px solid var(--ink); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

h1, h2, h3 { font-family: var(--display); text-wrap: balance; margin: 0; }
h1 {
  font-size: clamp(2.35rem, 1.25rem + 4.3vw, 4.3rem);
  line-height: .98;
  font-stretch: 72%;
  font-weight: 780;
  letter-spacing: -.012em;
}
h2 {
  font-size: clamp(1.85rem, 1.2rem + 2.4vw, 2.9rem);
  line-height: 1.03;
  font-stretch: 78%;
  font-weight: 740;
  letter-spacing: -.008em;
}
h3 {
  font-size: 1.2rem;
  line-height: 1.25;
  font-stretch: 92%;
  font-weight: 660;
}

/* ---------- Icone ---------- */
.i { width: 1.2em; height: 1.2em; flex: none; display: inline-block; vertical-align: -.2em;
     fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.i-fill { fill: currentColor; stroke: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 50;
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule-soft);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 66px; }
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; min-width: 0; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 22px; height: 32px; flex: none; }
.brand-mark .dc-c { fill: var(--ink); }   /* la C di Cremoni */
.brand-mark .dc-d { fill: var(--accent); } /* la D di Davide, che è anche una freccia */
.brand-text { display: grid; line-height: 1.1; min-width: 0; }
.brand-name { font-weight: 720; font-stretch: 85%; font-size: 1.08rem; letter-spacing: -.005em; white-space: nowrap; }
.brand-role { font-size: .82rem; color: var(--ink-2); white-space: nowrap; }
.header-nav { display: flex; align-items: center; gap: clamp(14px, 1.6vw, 22px); }
.header-nav a { text-decoration: none; font-weight: 560; font-size: .97rem; color: var(--ink); white-space: nowrap; }
.header-nav a:hover { color: var(--accent); }
.header-actions { display: flex; align-items: center; gap: 16px; }
.header-phone { text-decoration: none; font-weight: 620; font-variant-numeric: tabular-nums; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; }
.lang-switch { display: flex; gap: 5px; }
.lang-switch a { font-size: .82rem; font-weight: 650; text-decoration: none; border: 1px solid var(--rule); padding: 3px 6px; border-radius: 3px; }
.lang-switch a:hover { border-color: var(--ink); color: var(--ink); }
/* Home: con menu e pulsanti delle lingue il telefono in alto lascia spazio (resta nei contatti e nel footer) */
@media (max-width: 1180px) { .site-header.has-lang .header-nav ~ .header-actions .header-phone { display: none; } }
@media (max-width: 420px) {
  .site-header.has-lang .wrap { gap: 10px; }
  .site-header.has-lang .brand { gap: 8px; }
  .site-header.has-lang .brand-name { font-size: .98rem; }
  .lang-switch { gap: 3px; }
  .lang-switch a { padding: 3px 5px; font-size: .74rem; }
}

/* ---------- Pulsanti ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  padding: .82em 1.2em;
  border-radius: 4px;
  border: 1.5px solid transparent;
  font: inherit; font-weight: 650; font-size: 1rem; line-height: 1.1;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn .i { width: 1.2em; height: 1.2em; }
.btn-primary { background: var(--cta); color: var(--cta-ink); }
.btn-primary:hover { background: var(--cta-hover); color: var(--cta-ink); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn-sm { padding: .62em .95em; font-size: .94rem; }

/* ---------- Hero landing ---------- */
.hero { padding-block: clamp(36px, 6vw, 84px) clamp(48px, 7vw, 100px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero-text { min-width: 0; }
.eyebrow { margin: 0 0 18px; color: var(--ink-2); font-weight: 540; font-size: 1rem; }
.lead { font-size: clamp(1.1rem, 1rem + .4vw, 1.3rem); line-height: 1.5; color: var(--ink-2); max-width: 46ch; margin: 22px 0 0; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.facts { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 10px 24px; font-size: .96rem; }
.facts li { display: flex; align-items: center; gap: 8px; }
.facts .i { color: var(--ok); }
.facts .fact-badge { display: block; width: auto; height: 40px; flex: none; border-radius: 2px; } /* logo ufficiale Esperto CQ: non ricolorare */

.hero-visual {
  position: relative;
  min-width: 0;
  padding: clamp(22px, 3.5vw, 44px) clamp(16px, 3vw, 36px);
  background: var(--map-img) center / cover no-repeat, var(--paper);
  border: 1px solid var(--rule-soft);
  border-radius: 4px;
}

/* ---------- Scheda (documento d'esempio) ---------- */
.sheet {
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: 3px;
  box-shadow: var(--shadow);
  max-width: 470px;
  margin-inline: auto;
  font-size: .95rem;
}
.sheet-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 14px 18px 12px; border-bottom: 1.5px solid var(--ink); }
.sheet-title { margin: 0; font-weight: 680; font-stretch: 88%; font-size: 1.06rem; line-height: 1.25; }
.sheet-tag { font-size: .76rem; color: var(--ink-2); border: 1px solid var(--rule); padding: 1px 7px; border-radius: 2px; white-space: nowrap; }
.sheet-rows { list-style: none; margin: 0; padding: 2px 18px; }
.sheet-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 14px; align-items: center; padding: 11px 0; border-bottom: 1px dashed var(--rule); }
.sheet-row:last-child { border-bottom: 0; }
.sheet-row.has-value { grid-template-columns: minmax(0, 1fr) auto 5.8em; }
.sheet-row.has-value .status { justify-self: end; }
.sheet-row.has-value .sheet-value { text-align: end; }
.sheet-label { min-width: 0; line-height: 1.35; }
.sheet-value { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sheet-row.term { display: block; }
.sheet-row.term .sheet-label { display: block; font-weight: 680; }
.sheet-row.term .sheet-meaning { display: block; color: var(--ink-2); font-size: .92rem; margin-top: 2px; }
.sheet-foot { padding: 10px 18px 13px; font-size: .82rem; color: var(--ink-2); border-top: 1px solid var(--rule-soft); }

.status { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 620; padding: 3px 9px 3px 8px; border-radius: 999px; white-space: nowrap; line-height: 1.3; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.status-ok { color: var(--ok); background: var(--ok-bg); }
.status-warn { color: var(--warn); background: var(--warn-bg); }
.status-info, .status-wip { color: var(--info); background: var(--info-bg); }
.status-wip::before { background: transparent; border: 1.5px solid currentColor; }

/* ---------- Sezioni ---------- */
.section { padding-block: clamp(56px, 8vw, 110px); }
.section-rule { border-top: 1px solid var(--rule-soft); }
.section-head { display: grid; gap: 14px; margin-bottom: clamp(28px, 4vw, 48px); max-width: 62ch; }
.section-intro { margin: 0; color: var(--ink-2); font-size: 1.08rem; }
.split { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.split > * { min-width: 0; }

/* Problemi */
.pains { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(24px, 4vw, 56px); }
.pains li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 12px; padding: 20px 0; border-top: 1px solid var(--rule); font-size: 1.12rem; line-height: 1.45; }
.pains .i { width: 20px; height: 20px; color: var(--accent); margin-top: 3px; }

/* Servizi */
.services { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(30px, 4vw, 48px) clamp(28px, 5vw, 64px); }
.service { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 6px 18px; align-content: start; padding-top: 22px; border-top: 1.5px solid var(--ink); }
.service-icon { grid-row: span 3; width: 38px; height: 38px; color: var(--ink); stroke-width: 1.5; }
.service p { margin: 0; color: var(--ink-2); }
.gets { display: flex; gap: 8px; align-items: flex-start; font-size: .95rem; font-weight: 620; margin-top: 6px; }
.gets .i { color: var(--ok); width: 18px; height: 18px; margin-top: 2px; }

/* Poligonale (come funziona) */
.traverse {
  --gap: clamp(18px, 2.6vw, 34px);
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr));
  column-gap: var(--gap);
}
.traverse li { position: relative; min-width: 0; }
.station { position: relative; height: 44px; margin-bottom: 18px; display: flex; align-items: center; }
.station-mark {
  position: relative; z-index: 1;
  width: 42px; height: 42px; border-radius: 50%;
  border: 1.5px solid var(--ink); background: var(--paper);
  display: grid; place-items: center;
  font-weight: 700; font-stretch: 85%; font-size: .95rem; font-variant-numeric: tabular-nums;
}
.station::after { content: ""; position: absolute; inset-inline-start: 42px; inset-inline-end: calc(-1 * var(--gap)); top: 50%; border-top: 1.5px dashed var(--ink-2); }
.traverse li:last-child .station::after { display: none; }
.seg { position: absolute; top: -3px; inset-inline-start: 50px; inset-inline-end: calc(8px - var(--gap)); text-align: center; font-size: .8rem; font-weight: 620; color: var(--accent); line-height: 1.2; }
.traverse h3 { margin-bottom: 8px; }
.traverse p { margin: 0; color: var(--ink-2); font-size: .98rem; }

/* Offerta / pacchetti */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 20px; }
.plan { display: grid; gap: 14px; align-content: start; padding: clamp(22px, 3vw, 32px); background: var(--sheet); border: 1px solid var(--rule); border-radius: 4px; }
.plan h3 { font-size: 1.35rem; font-stretch: 85%; }
.plan-for { margin: 0; color: var(--ink-2); }
.plan ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.plan li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; }
.plan li .i { color: var(--ok); width: 18px; height: 18px; margin-top: 3px; }
.plan-note { margin: 0; padding-top: 12px; border-top: 1px dashed var(--rule); font-size: .92rem; color: var(--ink-2); }
.plan-featured { background: var(--band); color: var(--band-ink); border-color: var(--band-edge); }
.plan-featured .plan-for, .plan-featured .plan-note { color: var(--band-ink-2); }
.plan-featured li .i { color: var(--band-ink); }
.plan-featured .plan-note { border-top-color: color-mix(in srgb, var(--band-ink) 30%, transparent); }

/* Nota / riquadro informativo */
.note { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; align-items: start; padding: clamp(20px, 3vw, 30px); background: var(--sheet); border: 1px solid var(--rule); border-radius: 4px; }
.note-icon { width: 34px; height: 34px; color: var(--accent); stroke-width: 1.5; }
.note h3 { margin-bottom: 6px; }
.note p { margin: 0; color: var(--ink-2); }
.note p + p { margin-top: .6em; }
.note-list { margin: 10px 0 0; padding-inline-start: 1.1em; color: var(--ink-2); display: grid; gap: 4px; }

/* Calcolatore gare */
.calc { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(22px, 4vw, 48px); padding: clamp(22px, 3vw, 36px); background: var(--sheet); border: 1px solid var(--rule); border-radius: 4px; }
.calc-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-content: start; }
.field { min-width: 0; }
.field label { display: block; font-size: .92rem; font-weight: 620; margin-bottom: 6px; line-height: 1.3; }
.field input {
  width: 100%; font: inherit; font-size: 1.05rem; font-variant-numeric: tabular-nums;
  padding: .6em .7em; border: 1px solid var(--rule); border-radius: 3px;
  background: var(--paper); color: var(--ink);
}
.field input:focus { border-color: var(--ink); }
.calc-out { display: grid; align-content: center; gap: 8px; padding-inline-start: clamp(22px, 3vw, 36px); border-inline-start: 1px dashed var(--rule); }
.calc-out .calc-label { margin: 0; font-weight: 620; }
.calc-big { margin: 0; font-size: clamp(2.3rem, 1.4rem + 3vw, 3.5rem); font-weight: 780; font-stretch: 72%; line-height: 1; font-variant-numeric: tabular-nums; }
.calc-out small { color: var(--ink-2); font-size: .88rem; line-height: 1.45; }

/* Recensione */
.review { max-width: 780px; margin: 0; }
.review blockquote { margin: 0; font-size: clamp(1.25rem, 1.05rem + .8vw, 1.62rem); line-height: 1.42; font-stretch: 92%; font-weight: 500; }
.review figcaption { margin-top: 18px; color: var(--ink-2); font-size: .96rem; }
.review figcaption strong { color: var(--ink); font-weight: 650; }

/* Chi sono */
.about { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.portrait { margin: 0; max-width: 260px; }
.portrait img { display: block; width: 100%; height: auto; aspect-ratio: 5 / 6; object-fit: cover; border-radius: 3px; border: 1px solid var(--rule); background: var(--rule-soft); }
.portrait figcaption { font-size: .86rem; color: var(--ink-2); margin-top: 10px; line-height: 1.45; }
.about-text { min-width: 0; max-width: 62ch; }
.about-text p { color: var(--ink-2); }
.about-text p.about-lead { color: var(--ink); font-size: 1.15rem; }
.creds { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 10px; }
.creds li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; }
.creds .i { color: var(--accent); width: 20px; height: 20px; margin-top: 2px; }
.cred-badge { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: center; margin: 20px 0 0; padding: 12px 18px 12px 12px; background: var(--sheet); border: 1px solid var(--rule); border-radius: 4px; }
.cred-badge img { display: block; width: 72px; height: auto; border-radius: 2px; }
.about-text .cred-badge p { margin: 0; color: var(--ink-2); font-size: .95rem; line-height: 1.45; }
.cred-badge strong { display: block; color: var(--ink); font-size: 1.02rem; font-weight: 660; margin-bottom: 2px; }
.cred-badge a { display: inline-block; margin-top: 4px; color: var(--ink); font-weight: 600; white-space: nowrap; }
.cred-badge a:hover { color: var(--accent); }
.skills { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.skills li { border: 1px solid var(--rule); border-radius: 3px; padding: 4px 10px; font-size: .9rem; font-weight: 560; }

/* Domande frequenti */
.faq { max-width: 820px; border-top: 1px solid var(--rule); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary { list-style: none; cursor: pointer; position: relative; padding-block: 20px; padding-inline: 0 44px; font-weight: 640; font-size: 1.1rem; line-height: 1.35; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; inset-inline-end: 8px; top: 50%; width: 15px; height: 15px; transform: translateY(-50%);
  background:
    linear-gradient(var(--ink), var(--ink)) center / 15px 1.75px no-repeat,
    linear-gradient(var(--ink), var(--ink)) center / 1.75px 15px no-repeat;
}
.faq details[open] summary::after { background: linear-gradient(var(--ink), var(--ink)) center / 15px 1.75px no-repeat; }
.faq summary:hover { color: var(--accent); }
.faq .answer { padding: 0 0 22px; color: var(--ink-2); max-width: 68ch; }
.faq .answer p:last-child { margin-bottom: 0; }

/* Rimando ad altra pagina */
.crosslink { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 28px; padding: clamp(20px, 3vw, 28px); border: 1.5px solid var(--ink); border-radius: 4px; }
.crosslink p { margin: 0; max-width: 56ch; }
.crosslink strong { display: block; font-size: 1.15rem; font-stretch: 90%; }

/* Fascia finale */
.final { background: var(--band); color: var(--band-ink); padding-block: clamp(56px, 8vw, 104px); }
.final h2 { font-size: clamp(2rem, 1.15rem + 3.5vw, 3.7rem); font-stretch: 72%; font-weight: 780; max-width: 18ch; }
.final p { color: var(--band-ink-2); font-size: 1.15rem; max-width: 54ch; margin: 18px 0 0; }
.final .btn-ghost { color: var(--band-ink); border-color: color-mix(in srgb, var(--band-ink) 40%, transparent); }
.final .btn-ghost:hover { border-color: var(--band-ink); }
.final .cta-row { margin-top: 32px; }
.contact-line { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 26px; font-size: .98rem; color: var(--band-ink-2); }
.contact-line a { color: var(--band-ink); }
.contact-line span { white-space: nowrap; }

/* Footer */
.site-footer { padding-block: 44px 48px; font-size: .92rem; color: var(--ink-2); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }
.footer-grid > * { min-width: 0; }
.footer-grid h2 { font-size: .95rem; font-stretch: 100%; font-weight: 650; color: var(--ink); margin-bottom: 10px; letter-spacing: 0; }
.footer-grid p { margin: 0 0 .5em; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.site-footer a { color: var(--ink); }
.footer-base { margin-top: 32px; padding-top: 18px; border-top: 1px solid var(--rule-soft); display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }

/* Barra contatti su telefono */
.mobile-bar { display: none; }

/* ---------- Home ---------- */
.home-hero .hero-grid { grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); }
.home-hero h1 { font-size: clamp(2.4rem, 1.2rem + 3.9vw, 4.1rem); }
.map-frame { position: relative; margin: 0; background: var(--sheet); border: 1px solid var(--rule); border-radius: 3px; box-shadow: var(--shadow); padding: 10px; min-width: 0; }
.map-frame > svg { display: block; width: 100%; height: auto; }
.map-cartiglio { position: absolute; right: 20px; bottom: 20px; max-width: 220px; background: var(--sheet); border: 1.5px solid var(--ink); font-size: .78rem; line-height: 1.3; }
.map-cartiglio strong { display: block; padding: 6px 9px; border-bottom: 1px solid var(--ink); font-size: .84rem; font-stretch: 88%; }
.map-cartiglio span { display: block; padding: 6px 9px; color: var(--ink-2); }
.map-cartiglio .on-narrow { display: none; }
.map-cartiglio .on-hover { display: none; }
@media (hover: hover) and (pointer: fine) {
  .map-cartiglio .on-touch { display: none; }
  .map-cartiglio .on-hover { display: block; }
}
.map-tip {
  position: absolute; z-index: 3; pointer-events: none;
  padding: 6px 11px; white-space: nowrap;
  background: var(--sheet); color: var(--ink);
  border: 1.5px solid var(--ink); border-radius: 2px;
  font-size: .9rem; font-weight: 650; line-height: 1.25;
  box-shadow: var(--shadow);
}
.map-tip::after {
  content: ""; position: absolute; left: var(--ax, 50%); top: 100%;
  border: 6px solid transparent; border-top-color: var(--ink);
  transform: translateX(-50%);
}
.map-tip.is-below::after { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: var(--ink); }

.m-parcel { fill: var(--sheet); stroke: var(--ink); stroke-width: .6; }
.m-build { fill: var(--wash); stroke: var(--accent); stroke-width: .8; }
.m-num { fill: var(--ink-2); font-family: var(--font); font-size: 8.5px; font-style: italic; text-anchor: middle; dominant-baseline: middle; }
.m-road-edge { fill: none; stroke: var(--ink); stroke-width: 15; stroke-linejoin: round; stroke-linecap: butt; }
.m-road { fill: none; stroke: var(--sheet); stroke-width: 13; stroke-linejoin: round; stroke-linecap: butt; }
.m-water-edge { fill: none; stroke: var(--info); stroke-width: 6; opacity: .55; }
.m-water { fill: none; stroke: var(--water); stroke-width: 4.5; }
.m-label { fill: var(--ink-2); font-family: var(--font); font-size: 9px; letter-spacing: .08em; font-style: italic; }
.m-north { fill: none; stroke: var(--ink); stroke-width: 1.2; }
.m-north-fill { fill: var(--ink); }
.m-trig .m-tri { fill: var(--sheet); stroke: var(--ink); stroke-width: 1.3; stroke-linejoin: round; }
.m-trig .m-dot { fill: var(--accent); }
.m-key { cursor: pointer; }
.m-key .m-parcel { transition: fill .15s ease; }
.m-key:hover .m-parcel, .m-key:focus-visible .m-parcel, .m-key.is-on .m-parcel { fill: var(--wash); }
.m-key:focus-visible { outline: none; }
.m-key:focus-visible .m-parcel { stroke: var(--accent); stroke-width: 2; }
.m-key-dot { fill: var(--accent); stroke: var(--sheet); stroke-width: 2; }
.m-key-num { fill: var(--cta-ink); font-family: var(--font); font-size: 11px; font-weight: 700; text-anchor: middle; dominant-baseline: central; }
.m-key-mark { --s: 1; transform-box: fill-box; transform-origin: center; transform: scale(var(--s)); }
@media (prefers-reduced-motion: no-preference) {
  .m-key-mark { animation: keyIn .5s cubic-bezier(.2, .8, .2, 1.2) both; animation-delay: calc(var(--k, 0) * 70ms + 200ms); }
  @keyframes keyIn { from { transform: scale(calc(var(--s) * .55)); opacity: .35; } to { transform: scale(var(--s)); opacity: 1; } }
}

.cases { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(30px, 4vw, 48px) clamp(28px, 5vw, 64px); align-items: start; }
.case-group { min-width: 0; }
.case-group h3 { font-size: 1rem; font-stretch: 100%; font-weight: 620; color: var(--ink-2); margin-bottom: 10px; }
.case-list { list-style: none; margin: 0; padding: 0; border-top: 1.5px solid var(--ink); }
.case { border-bottom: 1px solid var(--rule); }
.case a { display: grid; grid-template-columns: 30px minmax(0, 1fr) 20px; gap: 3px 14px; align-items: center; padding: 15px 6px; text-decoration: none; color: var(--ink); transition: background-color .15s ease; }
.case a:hover, .case.is-on a { background: var(--wash); color: var(--ink); }
.case-key { grid-row: span 2; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--cta-ink); display: grid; place-items: center; font-weight: 700; font-size: .84rem; font-variant-numeric: tabular-nums; }
.case-name { font-weight: 660; font-size: 1.08rem; font-stretch: 92%; line-height: 1.25; }
.case-teaser { grid-column: 2; color: var(--ink-2); font-size: .95rem; line-height: 1.4; }
.case-go { grid-column: 3; grid-row: 1 / span 2; color: var(--ink-2); width: 18px; height: 18px; }

.legend { background: var(--sheet); border: 1.5px solid var(--ink); border-radius: 2px; overflow: hidden; }
.legend-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 16px; padding: 14px 20px; border-bottom: 1.5px solid var(--ink); }
.legend-head span { color: var(--ink-2); font-size: .92rem; }
.legend-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 -1px -1px 0; }
.legend-item { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 4px 16px; align-content: start; padding: 22px 20px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.legend-sym { grid-row: span 2; width: 48px; height: 36px; }
.legend-item p { margin: 0; color: var(--ink-2); font-size: .96rem; }
.ls-line { fill: none; stroke: var(--ink); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.ls-thin { fill: none; stroke: var(--ink-2); stroke-width: .9; }
.ls-wash { fill: var(--wash); stroke: var(--accent); stroke-width: 1.1; }
.ls-accent { fill: var(--accent); }
.ls-text { fill: var(--ink); font-family: var(--font); font-size: 8px; font-weight: 600; text-anchor: middle; }

.method { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 4vw, 48px); }
.method > div { padding-top: 20px; border-top: 1.5px solid var(--ink); min-width: 0; }
.method h3 { margin-bottom: 8px; }
.method p { margin: 0; color: var(--ink-2); }

.cucine-band { background: var(--k-stone); color: var(--k-ink); padding-block: clamp(48px, 7vw, 88px); }
.cucine-band .wrap { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 28px; align-items: center; }
.cucine-band h2 { font-family: var(--serif); font-weight: 400; font-stretch: 100%; letter-spacing: 0; font-size: clamp(1.9rem, 1.3rem + 2.3vw, 3rem); line-height: 1.1; }
.cucine-band p { margin: 14px 0 0; max-width: 54ch; font-size: 1.08rem; }
.cucine-band a.btn { justify-self: start; background: var(--k-red); color: #FFFFFF; }
.cucine-band a.btn:hover { filter: brightness(1.08); }

.contact-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1.5px solid var(--ink); }
.contact-item { padding: 20px 20px 22px 0; border-bottom: 1px solid var(--rule); min-width: 0; }
.contact-item h3 { font-size: .95rem; font-stretch: 100%; color: var(--ink-2); font-weight: 600; margin-bottom: 6px; }
.contact-item p { margin: 0; font-size: 1.1rem; font-weight: 600; overflow-wrap: anywhere; }
.contact-item p small { display: block; font-size: .9rem; color: var(--ink-2); font-weight: 450; }

/* Pagina testo (privacy) */
.area-line { margin: 24px 0 0; max-width: 72ch; color: var(--ink-2); font-size: .98rem; }
.prose { max-width: 70ch; }
.prose h2 { font-size: 1.5rem; font-stretch: 85%; margin: 2em 0 .5em; }
.prose p, .prose li { color: var(--ink-2); }
.prose ul { padding-inline-start: 1.2em; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero-grid, .home-hero .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-visual { max-width: 620px; }
  .legend-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .header-nav { display: none; }
  .cucine-band .wrap { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .split, .about, .calc { grid-template-columns: minmax(0, 1fr); }
  .portrait { max-width: 190px; }
  .calc-out { padding-inline-start: 0; border-inline-start: 0; padding-top: 22px; border-top: 1px dashed var(--rule); }
  .traverse { grid-template-columns: minmax(0, 1fr); row-gap: 0; }
  .traverse li { padding: 0 0 30px; padding-inline-start: 62px; }
  .traverse li::before { content: ""; position: absolute; inset-inline-start: 21px; top: 46px; bottom: 4px; border-inline-start: 1.5px dashed var(--ink-2); }
  .traverse li:last-child::before { display: none; }
  .traverse li:last-child { padding-bottom: 0; }
  .station { position: absolute; inset-inline-start: 0; top: 0; margin: 0; }
  .station::after { display: none; }
  .seg { position: static; display: inline-block; margin-top: 10px; text-align: start; }
  .footer-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .footer-grid > :first-child { grid-column: 1 / -1; }
  .method { grid-template-columns: minmax(0, 1fr); }
  .contact-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .header-phone { display: none; }
  .mobile-bar {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    background: var(--paper); border-top: 1px solid var(--rule);
  }
  .mobile-bar .btn { width: 100%; }
  body { padding-bottom: 76px; }
  .pains, .services, .cases { grid-template-columns: minmax(0, 1fr); }
  .legend-grid { grid-template-columns: minmax(0, 1fr); }
  .map-cartiglio { position: static; max-width: none; margin-top: 10px; }
  .map-cartiglio .on-wide { display: none; }
  .map-cartiglio .on-narrow { display: block; }
  .m-key-mark { --s: 1.6; }
}
@media (max-width: 520px) {
  .site-header.has-lang .header-actions > .btn { display: none; }
  .site-header .btn-label-long { display: none; }
  .brand-role { display: none; }
  .calc-fields { grid-template-columns: minmax(0, 1fr); }
  .sheet-row.has-value { grid-template-columns: minmax(0, 1fr) auto; }
  .sheet-row.has-value .sheet-value { grid-column: 2; grid-row: 1; }
  .sheet-row.has-value .status { grid-column: 1 / -1; grid-row: 2; justify-self: start; }
  .cta-row .btn { flex: 1 1 100%; }
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Arabo (pagina bayt-fi-italia.html, da destra a sinistra) ----------
   Archivo non ha i caratteri arabi: il testo arabo usa i font di sistema, Archivo resta per le parti in alfabeto latino.
   Niente spaziatura tra le lettere: in arabo spezzerebbe le legature. */
:root[lang="ar"] { --font: "Archivo", "Noto Sans Arabic", "Segoe UI", Tahoma, "Geeza Pro", "Arabic UI Text", Arial, sans-serif; }
[lang="ar"] h1, [lang="ar"] h2, [lang="ar"] h3 { letter-spacing: 0; line-height: 1.3; }
[lang="ar"] body { line-height: 1.75; }
[lang="ar"] .contact-line span { white-space: normal; }
[lang="ar"] .contact-line a { white-space: nowrap; }
