:root {
  --brand-blue: #326f9b;
  --brand-blue-dark: #265578;
  --hero-bg: #141d26;
  --hero-bg-mid: #1a2734;
  --text: #231f20;
  --text-muted: #5a5657;
  --line: #e2e6ea;
  --line-strong: #cdd3d9;
  --surface: #f4f6f8;
  --bg: #ffffff;
  --radius: 10px;
  --header-h: 4.5rem;
  --max: 72rem;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --section-pad-x: clamp(1.25rem, 4vw, 2.5rem);
  --section-pad-y: clamp(3.5rem, 7vw, 5.5rem);
  --scroll-pad: calc(var(--header-h) + 0.75rem);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  font-size: 1.0625rem;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--brand-blue-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--brand-blue);
}

[id] {
  scroll-margin-top: var(--scroll-pad);
}

.visually-hidden {
  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: -9999px;
  top: 0;
  background: var(--brand-blue);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 1000;
}

.skip-link:focus {
  left: 0.75rem;
  top: 0.75rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

@supports not (backdrop-filter: blur(8px)) {
  .site-header {
    background: #fff;
  }
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--section-pad-x);
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.brand {
  line-height: 0;
  flex-shrink: 0;
}

.brand img {
  display: block;
  height: 3.25rem;
  width: auto;
}

.nav-desktop {
  display: none;
  align-items: center;
  gap: 1.75rem;
  margin-left: auto;
}

.nav-desktop a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.nav-desktop a:hover,
.nav-desktop a:focus-visible {
  color: var(--brand-blue);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border-radius: 8px;
  padding: 0.7rem 1.25rem;
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1.2;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.btn:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--brand-blue);
  color: #fff;
  box-shadow: 0 1px 2px rgba(20, 29, 38, 0.08);
}

.btn-primary:hover {
  background: var(--brand-blue-dark);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  border-color: rgba(255, 255, 255, 0.28);
}

.btn-ghost:hover {
  border-color: rgba(255, 255, 255, 0.55);
  color: #fff;
}

.btn-secondary {
  background: #fff;
  color: var(--brand-blue-dark);
  border-color: var(--line-strong);
}

.btn-secondary:hover {
  border-color: var(--brand-blue);
  color: var(--brand-blue);
}

.header-accedi {
  display: none;
  flex-shrink: 0;
  padding: 0.55rem 0.95rem;
  font-size: 0.875rem;
}

.header-cta {
  display: none;
  flex-shrink: 0;
}

.header-accedi-mobile {
  width: 100%;
  margin-top: 0.35rem;
}

.menu-toggle {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.menu-toggle:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
}

.menu-toggle svg {
  width: 1.25rem;
  height: 1.25rem;
}

.nav-mobile {
  display: none;
  border-top: 1px solid var(--line);
  background: #fff;
}

.nav-mobile.is-open {
  display: block;
}

.nav-mobile ul {
  list-style: none;
  margin: 0;
  padding: 0.85rem var(--section-pad-x) 1.5rem;
  display: grid;
  gap: 0.15rem;
}

.nav-mobile a {
  display: block;
  padding: 0.65rem 0;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}

.nav-mobile .btn {
  width: 100%;
  margin-top: 0.65rem;
}

@media (min-width: 900px) {
  .nav-desktop,
  .header-accedi,
  .header-cta {
    display: inline-flex;
  }

  .menu-toggle,
  .nav-mobile {
    display: none !important;
  }
}

main {
  overflow-x: hidden;
}

/* Hero */
.hero-band {
  background: linear-gradient(168deg, var(--hero-bg) 0%, var(--hero-bg-mid) 52%, #1f2f3f 100%);
  color: #e6edf3;
  padding: clamp(3.25rem, 8vw, 5.75rem) 0 clamp(3.5rem, 8vw, 6rem);
}

.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--section-pad-x);
  display: grid;
  gap: clamp(2.5rem, 6vw, 3.75rem);
  align-items: center;
}

@media (min-width: 960px) {
  .hero {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: clamp(2.5rem, 5vw, 4rem);
  }
}

.hero-eyebrow {
  margin: 0 0 1.1rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(230, 237, 243, 0.65);
}

.hero h1 {
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height: 1.12;
  margin: 0 0 1.2rem;
  letter-spacing: -0.025em;
  font-weight: 700;
  color: #fff;
  max-width: 16ch;
}

@media (min-width: 960px) {
  .hero h1 {
    max-width: 13ch;
  }
}

.hero-lead {
  color: rgba(230, 237, 243, 0.78);
  font-size: clamp(1.02rem, 1.8vw, 1.12rem);
  line-height: 1.7;
  max-width: 44ch;
  margin: 0 0 1.85rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Hero integration panel */
.hero-visual {
  margin: 0;
}

.integration-panel {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  box-shadow:
    0 1px 2px rgba(12, 18, 24, 0.06),
    0 24px 60px rgba(12, 18, 24, 0.28);
  overflow: hidden;
  color: var(--text);
}

.integration-panel__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.integration-panel__title {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.integration-panel__status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #2d6b47;
}

.status-dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: #3d8b5f;
}

.integration-diagram {
  display: grid;
  gap: 1rem;
  padding: 1.25rem 1.15rem 1.35rem;
}

@media (min-width: 640px) {
  .integration-diagram {
    grid-template-columns: 1fr auto 1fr auto 1fr;
    align-items: stretch;
    gap: 0.65rem;
    padding: 1.35rem 1.25rem 1.5rem;
  }

  .integration-arrows {
    width: 2.5rem;
    align-self: center;
    color: var(--brand-blue);
    opacity: 0.75;
  }
}

@media (max-width: 639px) {
  .integration-arrows {
    display: none;
  }

  .integration-col + .integration-col {
    position: relative;
    padding-top: 0.75rem;
  }

  .integration-col + .integration-col::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 0;
    width: 1px;
    height: 0.5rem;
    background: var(--line-strong);
    transform: translateX(-50%);
  }
}

.integration-col__label {
  margin: 0 0 0.45rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.integration-col--accent .integration-col__label {
  color: var(--brand-blue);
}

.integration-card {
  height: 100%;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.integration-card--accent {
  border-color: rgba(50, 111, 155, 0.35);
  background: linear-gradient(180deg, #f6f9fc 0%, #fff 100%);
}

.integration-card__name {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 0.25rem;
}

.integration-card__detail {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.integration-metrics {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0.65rem 0 0;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0.35rem;
}

.integration-metrics li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.75rem;
}

.metric-key {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.metric-val {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--text);
}

.metric-val--ok {
  color: #2d6b47;
}

.hero-visual__caption {
  margin: 0.85rem 0 0;
  font-size: 0.8125rem;
  color: rgba(230, 237, 243, 0.58);
  text-align: center;
  line-height: 1.5;
}

/* Sections */
section {
  padding: var(--section-pad-y) var(--section-pad-x);
}

.section-inner {
  max-width: var(--max);
  margin: 0 auto;
}

.section-head {
  max-width: 40rem;
  margin-bottom: clamp(2rem, 4vw, 2.75rem);
}

.section-head h2 {
  font-size: clamp(1.75rem, 3.2vw, 2.25rem);
  margin: 0 0 0.65rem;
  letter-spacing: -0.025em;
  font-weight: 700;
  line-height: 1.15;
}

.section-head p {
  margin: 0;
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.65;
  max-width: 48ch;
}

.section-label {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand-blue);
}

/* Servizi */
.section-servizi {
  background: var(--bg);
}

.service-list {
  border-top: 1px solid var(--line);
}

.service-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem 1.75rem;
  padding: clamp(1.5rem, 3vw, 2.25rem) 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}

@media (min-width: 640px) {
  .service-row {
    grid-template-columns: 3.75rem 1fr;
    gap: 1.25rem 2.5rem;
  }
}

.service-num {
  font-size: 0.875rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--brand-blue);
  letter-spacing: 0.02em;
  padding-top: 0.2rem;
}

.service-row h3 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.15rem, 2vw, 1.35rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.service-row p {
  margin: 0;
  color: var(--text-muted);
  max-width: 56ch;
  line-height: 1.65;
}

/* Soluzioni */
.section-soluzioni {
  background: var(--surface);
  border-block: 1px solid var(--line);
}

.solution-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}

@media (min-width: 768px) {
  .solution-steps {
    grid-template-columns: repeat(3, 1fr);
  }

  .solution-step:not(:last-child) {
    border-right: 1px solid var(--line);
  }
}

.solution-step {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  padding: 1.5rem 1.35rem;
  border-bottom: 1px solid var(--line);
}

@media (min-width: 768px) {
  .solution-step {
    grid-template-columns: 1fr;
    gap: 0.85rem;
    padding: 1.75rem 1.5rem;
    border-bottom: none;
  }
}

.solution-step:last-child {
  border-bottom: none;
}

.solution-step__num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 0.8125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--brand-blue);
}

@media (min-width: 768px) {
  .solution-step__num {
    width: 2.25rem;
    height: 2.25rem;
  }
}

.solution-step__title {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.solution-step__text {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Chi siamo + Contatti */
.section-about-contact {
  background: var(--bg);
}

.about-contact-grid {
  display: grid;
  gap: clamp(2.5rem, 5vw, 4rem);
}

@media (min-width: 768px) {
  .about-contact-grid {
    grid-template-columns: 1.1fr 0.9fr;
    gap: clamp(3rem, 6vw, 5rem);
    align-items: start;
  }
}

.about-block h2,
.contact-block h2 {
  font-size: clamp(1.75rem, 3.2vw, 2.25rem);
  margin: 0 0 1rem;
  letter-spacing: -0.025em;
  font-weight: 700;
  line-height: 1.15;
}

.about-block p {
  margin: 0;
  color: var(--text-muted);
  max-width: 46ch;
  line-height: 1.7;
}

.contact-block {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.35rem, 3vw, 1.85rem);
  background: var(--surface);
}

.contact-lead {
  margin: 0 0 0.85rem;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
}

.contact-invite {
  margin: 0 0 0.85rem;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 48ch;
}

.contact-email-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin: 0 0 0.75rem;
}

.contact-email {
  font-size: clamp(1.1rem, 3vw, 1.35rem);
  font-weight: 600;
  text-decoration: none;
  color: var(--brand-blue-dark);
  word-break: break-word;
  letter-spacing: -0.01em;
}

.contact-email:hover {
  color: var(--brand-blue);
}

.btn-copy {
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 6px;
  padding: 0.45rem 0.8rem;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
}

.btn-copy:hover {
  border-color: var(--brand-blue);
  color: var(--brand-blue);
}

.btn-copy:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
}

.contact-hint {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Reveal */
.reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Legal / 404 */
.legal-main {
  padding-top: clamp(2rem, 4vw, 3rem);
  padding-bottom: clamp(3rem, 6vw, 5rem);
  padding-left: var(--section-pad-x);
  padding-right: var(--section-pad-x);
}

.legal-main h1 {
  font-size: clamp(1.85rem, 3vw, 2.35rem);
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}

.legal-main h2 {
  font-size: 1.2rem;
  margin: 2rem 0 0.5rem;
}

.legal-main p,
.legal-main li {
  color: var(--text-muted);
}

.legal-main ul {
  padding-left: 1.2rem;
}

.page-404 {
  text-align: center;
  padding: 5rem var(--section-pad-x);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem var(--section-pad-x) 2.5rem;
  background: #fff;
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .footer-inner {
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 2rem;
  }
}

.footer-meta {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.45;
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: 0.9rem;
}

.footer-legal a {
  text-decoration: none;
}

.footer-legal a:hover {
  text-decoration: underline;
}

@media (max-width: 320px) {
  .hero-actions .btn {
    width: 100%;
  }

  .integration-panel__top {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Cookie consent bar */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #fff;
  border-top: 1px solid var(--line-strong);
  box-shadow: 0 -4px 20px rgba(20, 29, 38, 0.07);
  padding: 0.85rem var(--section-pad-x);
}

.cookie-banner[hidden],
.cookie-banner--dismissed {
  display: none;
}

.cookie-banner__inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1.25rem;
}

.cookie-banner__text {
  flex: 1 1 14rem;
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text);
}

.cookie-banner__text a {
  white-space: nowrap;
}

.cookie-banner__text code {
  font-size: 0.85em;
}

.cookie-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  flex: 0 0 auto;
}

.cookie-banner__btn {
  min-width: 6.75rem;
}

@media (max-width: 520px) {
  .cookie-banner__actions {
    width: 100%;
  }

  .cookie-banner__actions .cookie-banner__btn {
    flex: 1 1 calc(50% - 0.3rem);
  }
}