:root {
  --navy: #0d2f5f;
  --navy-deep: #08264d;
  --orange: #b5571a;
  --orange-hover: #994814;
  --bg-soft: #f3f6fa;
  --text: #0d1424;
  --muted: #616c7c;
  --line: #d9dee6;
  --white: #ffffff;
  --shadow: 0 12px 34px rgba(10, 31, 68, 0.12);
  --shadow-soft: 0 8px 22px rgba(10, 31, 68, 0.08);
  --radius: 18px;
  --radius-sm: 12px;
  --container: 1440px;
  --transition: 0.2s ease;
  --header-height: 90px;
  --section-anchor-offset: 100px;
  --focus-ring: 3px solid #b5571a;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  color: var(--text);
  background: var(--white);
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
}

button {
  background: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 3px;
}

.container {
  width: min(calc(100% - 48px), var(--container));
  margin-inline: auto;
}

.section {
  padding: 88px 0;
}

section[id] {
  scroll-margin-top: var(--section-anchor-offset);
}

#asseco,
#servizi {
  padding: 100px 0;
}

#asseco {
  scroll-margin-top: 160px;
}

#servizi {
  scroll-margin-top: 140px;
}

.skip-link {
  position: absolute;
  top: -56px;
  left: 16px;
  z-index: 2000;
  background: var(--orange);
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  transition: top var(--transition);
  text-decoration: none;
}

.skip-link:focus {
  top: 16px;
}

/* HEADER */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: linear-gradient(180deg, var(--navy), var(--navy-deep));
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.header-inner {
  min-height: var(--header-height);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  position: relative;
}

.brand {
  color: #fff;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-decoration: none;
}

/* MENU */
.site-nav ul {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 48px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.98rem;
  font-weight: 500;
  text-decoration: none;
  transition:
    color var(--transition),
    opacity var(--transition);
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: #ffffff;
  opacity: 1;
}

.site-nav a.active,
.site-nav a[aria-current="page"] {
  color: #ffffff;
  font-weight: 600;
  opacity: 1;
}

.burger {
  display: none;
  border: 0;
  padding: 0;
  color: #fff;
}

.burger span {
  display: block;
  width: 24px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  padding: 0 32px;
  border: 0;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition:
    background var(--transition),
    transform var(--transition),
    box-shadow var(--transition);
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px);
}

.btn-header,
.btn-primary {
  background: var(--orange);
  color: #fff;
}

.btn-header:hover,
.btn-primary:hover,
.btn-header:focus-visible,
.btn-primary:focus-visible {
  background: var(--orange-hover);
}

.btn-header {
  min-height: 56px;
  padding-inline: 26px;
  white-space: nowrap;
}

.btn-full {
  width: 100%;
}

/* HERO */
.hero {
  display: grid;
  grid-template-columns: 1.04fr 0.96fr;
  min-height: calc(100vh - var(--header-height));
  align-items: stretch;
}

.hero-copy {
  display: flex;
  align-items: center;
  background: linear-gradient(180deg, #f6f8fb 0%, #f3f5f8 100%);
}

.hero-copy-inner {
  max-width: 780px;
  padding: 48px 56px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #0b356d;
}

.section-kicker-light {
  color: rgba(248, 242, 220, 0.96);
}

.hero h1 {
  margin: 0 0 18px;
  max-width: 860px;
  font-size: clamp(2.2rem, 3.15vw, 3.55rem);
  line-height: 1.04;
  letter-spacing: -0.045em;
  font-weight: 800;
  color: #041a49;
}

.hero-text {
  max-width: 560px;
  margin: 0;
  font-size: 1.05rem;
  color: #5b6677;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  margin-top: 24px;
}

.text-link {
  font-size: 1.04rem;
  font-weight: 600;
  color: #13294f;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hero-media {
  min-height: calc(100vh - var(--header-height));
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* SECTIONS */
.section-heading {
  margin-bottom: 28px;
}

.section-title {
  margin: 0;
  font-size: clamp(2.3rem, 3vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: #041a49;
}

.about {
  background: #fff;
}

.about-grid {
  display: grid;
  grid-template-columns: 540px 1fr;
  gap: 56px;
  align-items: center;
}

.about-media img {
  width: 100%;
  aspect-ratio: 1.35 / 1;
  object-fit: cover;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-soft);
}

.about-copy p:last-child {
  margin: 0;
  max-width: 900px;
  font-size: 1.12rem;
  color: #333d4c;
}

/* SERVICES */
.services {
  background: linear-gradient(180deg, #f6f8fb 0%, #eef3f8 100%);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 26px;
}

.service-card {
  min-height: 310px;
  background: #fff;
  border: 1px solid rgba(13, 47, 95, 0.06);
  border-radius: var(--radius);
  padding: 34px 28px 30px;
  box-shadow: var(--shadow);
}

.service-card h3 {
  margin: 0 0 14px;
  font-size: 1.82rem;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: #071331;
}

.service-card p {
  margin: 0;
  font-size: 1.04rem;
  color: #414b5c;
}

/* TESTIMONIAL */
.testimonials {
  padding: 76px 0 64px;
  background: linear-gradient(180deg, var(--navy), var(--navy-deep));
}

.testimonials-simple {
  text-align: center;
}

.testimonial-quote {
  margin: 0;
}

.testimonials h2,
.testimonial-quote p {
  margin: 0 0 18px;
  color: #f8f2dc;
  font-size: clamp(2.3rem, 3.2vw, 4rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
  font-weight: 800;
}

.testimonial-summary {
  max-width: 760px;
  margin: 0 auto;
  font-size: 1.08rem;
  color: rgba(255, 255, 255, 0.88);
}

/* CONTACT */
.contact {
  background: #fff;
  padding-top: 64px;
}

.contact-shell {
  max-width: 820px;
  margin-top: 20px;
}

.contact-copy {
  margin-bottom: 28px;
}

.contact-intro {
  margin: 14px 0 0;
  max-width: 760px;
  color: #495467;
  font-size: 1.06rem;
}

.contact-form {
  display: grid;
  gap: 14px;
  padding: 26px 24px 36px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-field {
  display: grid;
  gap: 8px;
}

.form-field label {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1d2a3f;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 1.5px solid #c8d1dd;
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
  background: #fff;
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: #6f7b8c;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: #5679a8;
  box-shadow: 0 0 0 4px rgba(86, 121, 168, 0.12);
}

.contact-form textarea {
  min-height: 110px;
  resize: vertical;
}

.contact-form .btn-full {
  margin-top: 14px;
}

.form-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 4px;
}

.form-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  flex: 0 0 18px;
  accent-color: var(--navy);
  cursor: pointer;
}

.form-checkbox label {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.4;
  color: #4a5568;
  cursor: pointer;
}

.form-checkbox a {
  color: var(--navy);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* FOOTER */
.site-footer {
  background: linear-gradient(180deg, var(--navy), var(--navy-deep));
  color: #fff;
}

.footer-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer-inner p {
  margin: 0;
  font-size: 0.97rem;
}

.footer-links {
  display: flex;
  gap: 28px;
}

.footer-links a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* RESPONSIVE */
@media (max-width: 1240px) {
  .hero-copy-inner {
    max-width: 720px;
    padding: 44px 40px;
  }

  .hero h1 {
    max-width: 760px;
    font-size: clamp(2.1rem, 3.4vw, 3.3rem);
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  :root {
    --section-anchor-offset: 90px;
  }

  .header-inner {
    grid-template-columns: 1fr auto auto;
  }

  .burger {
    display: inline-flex;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
  }

  .site-nav {
    position: absolute;
    top: var(--header-height);
    left: 50%;
    width: 100vw;
    transform: translateX(-50%);
    background: linear-gradient(180deg, var(--navy), var(--navy-deep));
    padding: 0 24px;
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    transition:
      max-height 0.25s ease,
      visibility 0.25s ease;
  }

  .site-nav ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 8px 0 20px;
  }

  .site-nav a {
    display: block;
    width: 100%;
    padding: 14px 0;
  }

  .site-header.is-open .site-nav {
    max-height: 320px;
    visibility: visible;
  }

  .site-header.is-open .burger span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .site-header.is-open .burger span:nth-child(2) {
    opacity: 0;
  }

  .site-header.is-open .burger span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .site-header {
    overflow: visible;
  }

  .btn-header {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-media {
    order: 1;
    min-height: 420px;
  }

  .hero-copy {
    order: 2;
  }

  .hero-copy-inner {
    max-width: 100%;
    padding: 40px 24px;
  }

  .hero h1 {
    max-width: 100%;
    font-size: clamp(2.2rem, 5vw, 3.4rem);
    line-height: 1.05;
  }

  .section,
  .testimonials {
    padding-top: 56px;
    padding-bottom: 56px;
  }

  #asseco {
    padding: 100px 0;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    flex-direction: column;
    justify-content: center;
    text-align: center;
    padding: 18px 0;
  }
}

@media (max-width: 640px) {
  :root {
    --header-height: 78px;
    --section-anchor-offset: 82px;
  }

  #asseco {
    scroll-margin-top: 70px;
  }

  #servizi {
    scroll-margin-top: 70px;
  }

  .container {
    width: min(calc(100% - 28px), var(--container));
  }

  .header-inner {
    min-height: var(--header-height);
    gap: 14px;
  }

  .brand {
    font-size: 0.96rem;
  }

  .site-nav {
    top: var(--header-height);
  }

  /* 🔥 HERO PIÙ COMPATTA */
  .hero-media {
    height: 220px;
    min-height: unset;
    overflow: hidden;
  }

  .hero-media img {
    height: 100%;
    width: 100%;
    object-fit: cover;
    object-position: center;
  }

  /* 🔥 TESTO HERO PIÙ PULITO */
  .hero-copy-inner {
    padding: 32px 20px;
    max-width: 100%;
  }

  .hero h1 {
    max-width: 18ch;
    font-size: clamp(1.8rem, 7vw, 2.3rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
  }

  .hero-text,
  .about-copy p:last-child,
  .contact-intro,
  .testimonial-summary {
    font-size: 1rem;
  }

  .section-title,
  .testimonials h2,
  .testimonial-quote p {
    font-size: clamp(2rem, 9vw, 2.65rem);
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .service-card {
    min-height: auto;
    padding: 26px 22px;
  }

  .service-card h3 {
    font-size: 1.5rem;
  }

  .contact-shell {
    margin-top: 12px;
  }

  .contact-form {
    padding: 22px 16px 32px;
  }

  .contact-form textarea {
    min-height: 100px;
  }

  .footer-links {
    flex-direction: column;
    gap: 8px;
  }
  .hero-actions {
    gap: 10px;
    margin-top: 18px;
  }

  .hero-actions .btn-primary {
    min-height: 42px;
    padding: 0 16px;
    font-size: 0.88rem;
    border-radius: 10px;
  }
}
