:root {
  color-scheme: light;
  --ink: #17191b;
  --ink-soft: #52585d;
  --paper: #f4f1ea;
  --paper-raised: #fffdf8;
  --signal: var(--sep-accent);
  --signal-dark: var(--sep-accent-hover);
  --line: #d8d3c9;
  --night: #17191b;
  --night-soft: #222629;
  --white: #fffdf8;
  --max: 1240px;
  --pad: clamp(1.25rem, 4vw, 4.5rem);
  --serif: "Source Serif 4", Georgia, serif;
  --sans: "Manrope", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-width: none; -ms-overflow-style: none; }
html::-webkit-scrollbar { display: none; }
body { margin: 0; overflow-x: hidden; background: var(--paper); color: var(--ink); font-family: var(--sans); line-height: 1.6; }
main { padding-top: var(--sep-header-h); }
section[id] { scroll-margin-top: var(--sep-header-h); }
a { color: inherit; text-decoration: none; }
p, h1, h2, h3 { margin-top: 0; }
button, input, textarea { font: inherit; }
svg { display: block; }
::selection { background: var(--signal); color: #17191b; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; }

.skip-link { position: fixed; z-index: 99; top: .75rem; left: .75rem; padding: .65rem 1rem; background: var(--white); color: #111; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
.site-header { position: fixed; z-index: 50; inset: 0 0 auto; width: 100%; min-width: 0; height: var(--sep-header-h); display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 2rem; padding: 0 10px; background: var(--sep-dark); color: var(--white); border-bottom: 1px solid #ffffff24; }
.brand { display: inline-flex; align-items: center; gap: .75rem; width: max-content; font-weight: 800; letter-spacing: -.04em; font-size: 21px; }
.brand i { color: var(--white); font-style: normal; }
.brand-mark { width: 32px; height: 32px; object-fit: contain; }
.site-header nav { display: flex; align-items: center; gap: 2.25rem; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.site-header nav a { color: #ffffffb8; transition: color .2s; }
.site-header nav a:hover { color: #fff; }
.menu-toggle { display: none; width: 44px; height: 44px; padding: 10px; border: 0; background: transparent; color: var(--white); cursor: pointer; }
.menu-toggle span { display: block; width: 24px; height: 2px; margin: 5px auto; background: var(--sep-accent); transition: transform .2s, opacity .2s; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.hero { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, .8fr); grid-template-rows: auto auto; align-content: center; row-gap: 2rem; min-height: calc(100svh - var(--sep-header-h)); padding: clamp(2.5rem, 5vw, 4.5rem) var(--pad) 2.5rem; background: var(--paper-raised); color: var(--ink); }
.hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 58%, #17191b0b 58%, #17191b0b 58.2%, transparent 58.2%); pointer-events: none; }
.hero-compass { position: absolute; z-index: 1; top: -4vw; left: -4vw; width: clamp(420px, 44vw, 720px); height: auto; object-fit: contain; object-position: left top; pointer-events: none; }
.hero-copy { position: relative; z-index: 1; grid-column: 1; grid-row: 1; max-width: 770px; }
.kicker { display: flex; align-items: center; gap: .7rem; margin-bottom: 1.75rem; color: var(--signal); font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.kicker span { width: 30px; height: 2px; background: currentColor; }
.hero h1, .section-heading h2, .contact h2 { font-family: var(--serif); font-weight: 700; letter-spacing: -.045em; line-height: .96; }
.hero h1 { max-width: 820px; margin-top: 3rem; margin-bottom: 2rem; color: var(--ink); font-size: clamp(3.15rem, 6.25vw, 6.5rem); }
.hero h1 em { display: block; color: var(--signal); font-style: italic; }
.hero-lead { max-width: 650px; margin-bottom: 2.4rem; color: var(--ink-soft); font-size: clamp(1rem, 1.5vw, 1.2rem); }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 1.75rem; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 1rem; min-height: 52px; padding: .85rem 1.25rem; border: 0; cursor: pointer; font-weight: 800; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; transition: background .2s, transform .2s; }
.button:hover { transform: translateY(-2px); }
.button-primary { background: var(--signal); color: #17191b; }
.button-primary:hover { background: var(--signal-dark); color: #fff; }
.text-link { padding: .5rem 0; border-bottom: 1px solid var(--line); color: var(--ink); font-size: .8rem; font-weight: 700; }
.territory-graphic { position: relative; grid-column: 2; grid-row: 1 / 3; align-self: center; justify-self: end; width: min(100%, 520px); display: flex; justify-content: center; }
.anniversary-badge { position: relative; width: min(100%, 440px); padding: 2rem 0 2rem 2.25rem; border-left: 5px solid var(--signal); text-align: left; }
.anniversary-years { display: block; margin-bottom: .8rem; color: var(--signal); font-size: .7rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.anniversary-badge-num { display: block; font-family: var(--serif); font-size: clamp(8rem, 14vw, 13.5rem); font-weight: 700; letter-spacing: -.08em; line-height: .68; color: var(--ink); }
.anniversary-badge-label { display: block; margin-top: 1.2rem; color: var(--ink); font-size: .78rem; font-weight: 800; line-height: 1.4; letter-spacing: .22em; text-transform: uppercase; }
.anniversary-copy { max-width: 32ch; margin: 1.35rem 0 0; padding-top: 1.2rem; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: .95rem; line-height: 1.55; }
.hero-proof { position: relative; z-index: 2; grid-column: 1; grid-row: 2; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: min(720px, 62vw); border-top: 1px solid var(--line); }
.hero-proof p { display: flex; flex-direction: column; align-items: flex-start; gap: .5rem; margin: 0; padding: 1.5rem 1.5rem 1.5rem 0; }
.hero-proof strong { font-family: var(--serif); font-size: clamp(1.6rem, 3vw, 2.35rem); line-height: 1; }
.hero-proof span { color: var(--ink-soft); font-size: .62rem; font-weight: 700; line-height: 1.35; text-transform: uppercase; letter-spacing: .08em; }

.section-shell { max-width: var(--max); margin: 0 auto; padding-left: var(--pad); padding-right: var(--pad); }
.section-heading h2 { max-width: 600px; margin-bottom: 0; font-size: clamp(2.7rem, 5.5vw, 5.6rem); }
.services .section-heading { text-align: right; }
.services .section-heading h2 { max-width: none; display: flex; flex-direction: column; gap: .18em; font-size: clamp(1.8rem, 2.8vw, 2.9rem); line-height: 1.04; }
.title-line { display: block; }
.title-line-nowrap { white-space: nowrap; }
.about-copy { align-self: center; max-width: 650px; padding: .35rem 0 .35rem 2rem; border-left: 4px solid var(--signal); font-size: clamp(1rem, 1.4vw, 1.15rem); }
.about-copy p { margin-bottom: 1.5rem; color: var(--ink-soft); }
.about-copy .about-proof { margin-bottom: 0; color: var(--ink); font-weight: 800; }
.services .about-copy { margin-top: 1.5rem; margin-left: auto; padding-left: 0; border-left: 0; }
.services .service-list { border-left: 4px solid var(--signal); padding-left: clamp(1.5rem, 3vw, 2.5rem); }

.territory { display: grid; grid-template-columns: 1.15fr 1fr; min-height: calc(100svh - var(--sep-header-h)); overflow: hidden; padding: 0; background: #ebe6dc; color: var(--ink); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.territory-map-bg { position: relative; z-index: 0; width: 100%; height: 100%; min-height: 420px; background: #ebe6dc; }
.territory-map-bg .leaflet-tile-pane { filter: grayscale(.4) sepia(.15) brightness(1.05) contrast(.95); opacity: .85; }
.territory-map-bg .leaflet-control-attribution { background: rgba(244, 241, 234, .75); color: var(--ink-soft); font-size: 9px; }
.territory-content { display: flex; flex-direction: column; justify-content: flex-start; gap: 1.25rem; padding: clamp(2rem, 4vw, 3rem) var(--pad) clamp(2.5rem, 5vw, 4.5rem); }
.territory-content h2 { max-width: 480px; margin-bottom: 0; font-family: var(--serif); font-weight: 700; letter-spacing: -.045em; line-height: .96; font-size: clamp(2.2rem, 3.6vw, 3.4rem); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stats > * { min-width: 0; min-height: 88px; display: flex; flex-direction: column; justify-content: center; padding: .9rem 1.2rem; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: transparent; color: inherit; text-align: left; transition: background .5s ease; }
.stats > *:nth-child(3n) { border-right: 0; }
.stats > *:nth-child(n+4) { border-bottom: 0; }
.stats > *.is-active { background: rgba(251, 85, 7, .1); }
.stats button { cursor: pointer; }
.stats button:hover { background: rgba(251, 85, 7, .06); }
.stats [data-stage="regioni"] strong { color: #1c3d5a; }
.stats [data-stage="province"] strong { color: #a63a08; }
.stats strong { color: var(--signal); font-family: var(--serif); font-size: clamp(2rem, 3.5vw, 3.8rem); line-height: 1; }
.stats span { margin-top: .6rem; color: var(--ink-soft); font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.territory-caption { max-width: 42ch; margin: 0; padding-top: 1.5rem; border-top: 1px solid var(--line); color: var(--ink); font-family: var(--sans); font-size: .95rem; line-height: 1.35; white-space: pre-line; }
.territory-sede-card[hidden] { display: none; }
.territory-sede-card { padding-top: 1rem; }
.territory-sede-card h3 { margin-bottom: .5rem; font-family: var(--serif); font-size: clamp(1.2rem, 1.8vw, 1.5rem); }
.territory-sede-card .territory-caption { max-width: 42ch; padding-top: 0; border-top: 0; }
.territory-card-item + .territory-card-item { margin-top: 1rem; }
.territory-pin { opacity: 0; transition: opacity .8s ease; }
.territory-pin span { display: block; width: 10px; height: 10px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 4px rgba(251, 85, 7, .25); }
#territoryMap[data-stage="sedi"] .territory-pin { opacity: 1; }
.leaflet-overlay-pane path { transition: opacity .8s ease, fill-opacity .8s ease; }
.territory-label-marker.leaflet-div-icon { background: transparent; border: none; }
.territory-label-marker { opacity: 0; transition: opacity .8s ease; pointer-events: none; }
.territory-label-inner { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); white-space: nowrap; color: var(--ink); font-family: var(--sans); font-size: .62rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.territory-label-inner--right { top: 50%; left: 100%; transform: translateY(-50%); margin-left: 10px; }
.territory-label--sedi .territory-label-inner { display: flex; flex-direction: column; gap: .15rem; text-transform: none; }
.territory-label-code { color: var(--signal); font-size: .6rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.territory-label-title { color: var(--ink); font-size: .85rem; font-weight: 800; letter-spacing: 0; }
.territory-label--province .territory-label-inner { color: #17191b; font-size: .78rem; }
#territoryMap[data-stage="regioni"] .territory-label--regioni { opacity: 1; }
#territoryMap[data-stage="province"] .territory-label--province { opacity: .95; }
#territoryMap[data-stage="sedi"] .territory-label--sedi { opacity: 1; }

@media (max-width: 900px) {
  .territory { grid-template-columns: 1fr; min-height: auto; }
  .territory-map-bg { height: 60vh; }
}

.services { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: clamp(2.5rem, 5vw, 5rem); max-width: 1440px; min-height: calc(100svh - var(--sep-header-h)); margin: 0 auto; padding: clamp(3rem, 6vw, 5rem) var(--pad); }
.service-list { border-top: 1px solid var(--line); }
.service-list article { display: grid; grid-template-columns: 35px 70px 1fr; gap: 1.4rem; padding: 2.3rem 0; border-bottom: 1px solid var(--line); }
.service-number { color: var(--signal); font-size: .67rem; font-weight: 800; }
.service-icon { width: 56px; height: 56px; display: grid; place-items: center; border: 1px solid var(--line); color: var(--signal); }
.service-icon svg { width: 34px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.service-list h3 { margin-bottom: .65rem; font-family: var(--serif); font-size: 1.6rem; }
.service-list p { margin: 0; color: var(--ink-soft); font-size: .9rem; }

.contact { padding: clamp(5.5rem, 10vw, 9rem) 0; background: #dfd9ce; color: #17191b; }
.contact-grid { display: grid; grid-template-columns: .7fr 1.3fr; gap: clamp(3rem, 8vw, 8rem); }
.contact h2 { margin-bottom: 2rem; font-size: clamp(3.5rem, 7vw, 7rem); }
.contact-intro > p:last-child { max-width: 300px; font-size: .9rem; }
.contact-form { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem 1.25rem; align-content: start; }
.field { display: flex; flex-direction: column; gap: .45rem; }
.field-full { grid-column: 1 / -1; }
.field label { font-size: .67rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.field input, .field textarea { width: 100%; padding: .8rem 0; border: 0; border-bottom: 1px solid #17191b70; border-radius: 0; outline: none; background: transparent; color: #17191b; }
.field textarea { resize: vertical; min-height: 110px; }
.field input:focus, .field textarea:focus { border-color: var(--signal); box-shadow: 0 2px 0 var(--signal); }
.form-submit { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; margin-top: .7rem; }
.form-submit p { margin: 0; color: #17191b99; font-size: .68rem; }

.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-consent { display: flex; align-items: flex-start; gap: .6rem; font-size: .8rem; line-height: 1.5; color: var(--ink-soft); }
.form-consent input { flex: 0 0 auto; width: 18px; height: 18px; margin-top: .1rem; accent-color: var(--signal); }
.form-consent a { border-bottom: 1px solid var(--signal); color: var(--ink); font-weight: 700; }
.contact-form button[aria-busy="true"] { opacity: .65; cursor: progress; }
.form-status { margin: .2rem 0 0; padding: .7rem .9rem; border-left: 3px solid var(--line); font-size: .8rem; line-height: 1.45; }
.form-status[data-kind="pending"] { border-color: var(--ink-soft); color: var(--ink-soft); }
.form-status[data-kind="error"] { border-color: #b3261e; background: #b3261e14; color: #7a1b16; }
.form-done { padding: 1.5rem 0; }
.form-done h3 { margin-bottom: .5rem; font-family: var(--serif); font-size: 1.6rem; }
.form-done p { margin: 0; color: var(--ink-soft); font-size: .95rem; }
.footer-link { border-bottom: 1px solid #ffffff40; }
.footer-link:hover { border-color: var(--signal); }

.legal { max-width: 780px; margin: 0 auto; padding: clamp(2.5rem, 6vw, 4.5rem) var(--pad) clamp(3.5rem, 8vw, 6rem); }
.legal h1 { font-family: var(--serif); font-weight: 700; letter-spacing: -.03em; line-height: 1.05; font-size: clamp(2.2rem, 5vw, 3.4rem); margin-bottom: .6rem; }
.legal .legal-updated { margin-bottom: 2.5rem; color: var(--ink-soft); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }
.legal h2 { font-family: var(--serif); font-weight: 700; font-size: 1.3rem; margin: 2.4rem 0 .8rem; }
.legal p, .legal li { color: var(--ink-soft); font-size: .95rem; line-height: 1.7; }
.legal p { margin-bottom: 1rem; }
.legal ul { margin: 0 0 1rem; padding-left: 1.2rem; }
.legal li { margin-bottom: .5rem; }
.legal a { border-bottom: 1px solid var(--signal); color: var(--ink); font-weight: 600; }
.legal .legal-back { display: inline-block; margin-top: 2.5rem; font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; border-bottom: 0; color: var(--signal); }

.site-footer { display: grid; grid-template-columns: 1fr 1.3fr 1fr auto; align-items: center; gap: 2rem; padding: 3rem var(--pad); background: #101214; color: var(--white); border-top: 4px solid var(--signal); }
.footer-brand { font-size: 1rem; }
.site-footer p { margin: 0; color: #ffffff85; font-size: .7rem; }
.back-top { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }

@media (max-width: 900px) {
  .site-header { display: flex; justify-content: space-between; }
  .site-header nav { min-width: 0; flex: 1; justify-content: flex-end; gap: 1rem; overflow-x: auto; font-size: .62rem; }
  .site-header nav a { flex: 0 0 auto; min-height: 44px; }
  .js .menu-toggle { display: block; flex: 0 0 44px; }
  .js .site-header nav { position: absolute; top: 100%; right: 0; left: 0; display: flex; align-items: stretch; flex-direction: column; gap: 0; padding: .5rem 10px 1rem; overflow: visible; background: var(--sep-dark); border-top: 1px solid #ffffff24; box-shadow: 0 12px 24px #0003; visibility: hidden; opacity: 0; transform: translateY(-.5rem); pointer-events: none; transition: opacity .2s, transform .2s, visibility .2s; }
  .js .site-header nav.is-open { visibility: visible; opacity: 1; transform: translateY(0); pointer-events: auto; }
  .js .site-header nav a { display: flex; align-items: center; min-height: 48px; padding: 0 .75rem; border-bottom: 1px solid #ffffff18; color: #fff; }
  .hero { grid-template-columns: 1fr; }
  .hero-copy { padding-bottom: 1rem; }
  .territory-graphic { display: none; }
  .hero-proof { width: 100%; }
  .services, .contact-grid { grid-template-columns: 1fr; }
  .about-copy { padding-top: 0; }
  .site-footer { grid-template-columns: 1fr 1fr; }
  .back-top { justify-self: end; }
}

@media (max-width: 620px) {
  .site-header { height: var(--sep-header-h); gap: .65rem; }
  .brand-mark { width: 28px; height: 28px; }
  .brand { min-width: 0; font-size: .88rem; white-space: nowrap; }
  .hero { min-height: calc(100svh - var(--sep-header-h)); padding-top: 4.5rem; }
  .hero h1 { font-size: clamp(3.1rem, 15vw, 4.5rem); }
  .hero-lead { font-size: .97rem; }
  .title-line-nowrap { white-space: normal; }
  .hero-actions { align-items: flex-start; flex-direction: column; gap: 1rem; }
  .hero-proof { grid-template-columns: 1fr; margin-top: 3rem; }
  .hero-proof p { padding: 1rem 0; border-bottom: 1px solid var(--line); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats > *:nth-child(3) { border-right: 1px solid var(--line); }
  .stats > *:nth-child(even) { border-right: 0; }
  .stats > *:nth-child(-n+4) { border-bottom: 1px solid var(--line); }
  .service-list article { grid-template-columns: 28px 1fr; }
  .service-icon { display: none; }
  .contact-form { grid-template-columns: 1fr; }
  .field-full { grid-column: auto; }
  .form-submit { align-items: stretch; flex-direction: column; }
  .site-footer { grid-template-columns: 1fr; }
  .back-top { justify-self: start; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
