/* -------------------- DESIGN VARIABLES -------------------- */
:root {
  --accent: #c9181f;
  --accent-dark: #981117;
  --text: #181818;
  --muted: #666666;
  --surface: #ffffff;
  --surface-soft: #f5f5f5;
  --surface-dark: #202020;
  --border: #dddddd;
  --container: 1180px;
  --radius: 14px;
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.10);
}

/* -------------------- BASE STYLES -------------------- */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--surface);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.6;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  line-height: 1.15;
}

h1 {
  font-size: clamp(2.4rem, 6vw, 5rem);
}

h2 {
  font-size: clamp(2rem, 4vw, 3.25rem);
}

h3 {
  font-size: 1.35rem;
}

.container {
  width: min(calc(100% - 40px), var(--container));
  margin-inline: auto;
}

.narrow-container {
  max-width: 760px;
  text-align: center;
}

.section {
  padding: 96px 0;
}

.section-light {
  background: var(--surface-soft);
}

.eyebrow {
  margin-bottom: 12px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 42px;
}

.section-heading h1,
.section-heading h2 {
  margin-bottom: 14px;
}

.section-heading p:last-child {
  color: var(--muted);
}

.centered-heading {
  margin-inline: auto;
  text-align: center;
}

.heading-with-controls {
  display: flex;
  max-width: none;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.section-action {
  margin-top: 42px;
  text-align: center;
}

.hidden-field {
  position: absolute;
  left: -9999px;
}

/* -------------------- HEADER AND NAVIGATION -------------------- */
.site-header {
  position: sticky;
  z-index: 1000;
  top: 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.header-content {
  display: flex;
  min-height: 84px;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.brand img {
  width: 165px;
  height: 66px;
  object-fit: contain;
}

.site-navigation {
  display: flex;
  align-items: center;
  gap: 26px;
}

.site-navigation a {
  position: relative;
  padding: 8px 0;
  font-size: 0.96rem;
  font-weight: 700;
  text-decoration: none;
}

.site-navigation a::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--accent);
  content: "";
  transform: scaleX(0);
  transition: transform 180ms ease;
}

.site-navigation a:hover::after,
.site-navigation a[aria-current="page"]::after {
  transform: scaleX(1);
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: var(--text);
}

/* -------------------- BUTTONS AND LINKS -------------------- */
.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border: 2px solid transparent;
  border-radius: 999px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: 180ms ease;
}

.button-primary {
  color: #ffffff;
  background: var(--accent);
}

.button-primary:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
}

.button-outline-light {
  color: #ffffff;
  border-color: #ffffff;
  background: transparent;
}

.button-outline-light:hover {
  color: var(--text);
  background: #ffffff;
}

.button-dark {
  color: #ffffff;
  background: var(--surface-dark);
}

.button-dark:hover {
  background: #000000;
  transform: translateY(-2px);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.text-link {
  display: inline-block;
  color: var(--accent);
  font-weight: 700;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

/* -------------------- HERO SECTIONS -------------------- */
.hero {
  display: grid;
  min-height: 620px;
  place-items: center;
  color: #ffffff;
  background-position: center;
  background-size: cover;
}

.hero-home {
  background-image: linear-gradient(rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0.62)), url("images/hero-home.jpg");
}

.hero-inner {
  min-height: 480px;
  background-image: linear-gradient(rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.72)), url("images/hero-dark.jpg");
}

.hero-content {
  max-width: 900px;
  padding-block: 84px;
  text-align: center;
}

.hero-content h1 {
  margin-bottom: 22px;
}

.hero-content .eyebrow {
  color: #ff777c;
}

.hero-text {
  max-width: 760px;
  margin: 0 auto 30px;
  font-size: clamp(1.05rem, 2vw, 1.3rem);
}

.hero-content .button-row {
  justify-content: center;
}

.hero-feature-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 34px;
}

.hero-feature-list span {
  padding: 7px 14px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
}

.page-intro {
  padding: 110px 0 80px;
  background: var(--surface-soft);
}

.page-intro h1 {
  margin-bottom: 18px;
}

.page-intro p:last-child {
  color: var(--muted);
  font-size: 1.08rem;
}

.confirmation-section {
  min-height: 62vh;
  display: grid;
  align-items: center;
}

/* -------------------- CARDS AND GRIDS -------------------- */
.three-column-grid,
.project-grid,
.icon-grid {
  display: grid;
  gap: 24px;
}

.three-column-grid,
.project-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.icon-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.image-card,
.project-card,
.icon-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.image-card,
.project-card {
  display: flex;
  min-height: 100%;
  flex-direction: column;
}

.image-card > img,
.project-card > img {
  width: 100%;
  height: 230px;
  object-fit: cover;
}

.card-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  padding: 24px;
}

.card-content h3 {
  margin-bottom: 12px;
}

.card-content p {
  color: var(--muted);
}

.card-content .text-link {
  margin-top: auto;
}

.icon-card {
  padding: 30px 24px;
  text-align: center;
}

.icon-card img {
  width: 62px;
  height: 62px;
  margin: 0 auto 20px;
  object-fit: contain;
}

.icon-card p {
  color: var(--muted);
}

/* -------------------- HORIZONTAL CAROUSEL -------------------- */
.card-carousel {
  display: grid;
  grid-auto-columns: minmax(290px, 31%);
  grid-auto-flow: column;
  gap: 22px;
  overflow-x: auto;
  padding: 4px 4px 22px;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.card-carousel .image-card {
  scroll-snap-align: start;
}

.carousel-controls {
  display: flex;
  gap: 8px;
}

.carousel-button {
  width: 46px;
  height: 46px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  font-size: 1.4rem;
  cursor: pointer;
}

.carousel-button:hover {
  color: #ffffff;
  border-color: var(--accent);
  background: var(--accent);
}

/* -------------------- CALL TO ACTION -------------------- */
.cta-banner {
  padding: 66px 0;
  color: #ffffff;
  background: var(--accent);
}

.cta-banner .eyebrow {
  color: #ffd6d8;
}

.cta-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.cta-content h2 {
  margin-bottom: 0;
}

/* -------------------- CONTACT FORMS -------------------- */
.contact-section {
  padding: 100px 0;
  color: #ffffff;
  background-image: linear-gradient(rgba(0, 0, 0, 0.76), rgba(0, 0, 0, 0.76)), url("images/hero-dark.jpg");
  background-position: center;
  background-size: cover;
}

.contact-panel,
.contact-page-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 70px;
  align-items: start;
}

.contact-intro h2 {
  margin-bottom: 20px;
}

.contact-intro .eyebrow {
  color: #ff777c;
}

.contact-form {
  display: grid;
  gap: 10px;
}

.contact-form label {
  margin-top: 6px;
  font-weight: 700;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.10);
}

.contact-form textarea {
  resize: vertical;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: rgba(255, 255, 255, 0.72);
}

.contact-form .button {
  justify-self: start;
  margin-top: 12px;
}

.contact-page-section {
  min-height: 70vh;
}

.contact-details {
  padding: 36px;
  border-radius: var(--radius);
  color: #ffffff;
  background: var(--surface-dark);
}

.contact-details a {
  color: #ffffff;
  font-weight: 700;
}

.contact-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 36px;
}

.form-on-light {
  padding: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.form-on-light input,
.form-on-light textarea {
  color: var(--text);
  border-color: var(--border);
  background: #ffffff;
}

.form-on-light input::placeholder,
.form-on-light textarea::placeholder {
  color: #888888;
}

/* -------------------- SERVICES SPLIT FEATURE -------------------- */
.split-feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 460px;
  background: var(--surface-dark);
}

.split-feature > img {
  width: 100%;
  height: 100%;
  min-height: 460px;
  object-fit: cover;
}

.split-feature-content {
  display: grid;
  align-content: center;
  max-width: 630px;
  padding: 70px;
  color: #ffffff;
}

.split-feature-content .eyebrow {
  color: #ff777c;
}

/* -------------------- PROJECT DETAILS -------------------- */
.project-detail {
  padding: 88px 0;
}

.project-detail-alt {
  background: var(--surface-soft);
}

.project-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 60px;
  align-items: center;
}

.project-detail-grid > img {
  width: 100%;
  height: 430px;
  border-radius: var(--radius);
  object-fit: cover;
  box-shadow: var(--shadow);
}

.project-detail-alt .project-detail-grid > img {
  order: 2;
}

.project-detail-grid p {
  color: var(--muted);
}

/* -------------------- DOWNLOAD SECTIONS -------------------- */
.download-section {
  border-top: 1px solid var(--border);
  background: var(--surface-soft);
}

.download-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 50px;
  padding-block: 58px;
}

.download-title h2 {
  margin-bottom: 0;
  padding-left: 18px;
  border-left: 8px solid var(--accent);
  font-size: 2rem;
}

.download-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.download-list li {
  padding: 0;
  border: 0;
  background: transparent;
}

.download-list a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  padding: 15px 54px 15px 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: #ffffff;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.download-list a::after {
  position: absolute;
  top: 50%;
  right: 18px;
  color: var(--accent);
  font-size: 1.25rem;
  line-height: 1;
  content: "↓";
  transform: translateY(-52%);
  transition: color 160ms ease, transform 160ms ease;
}

.download-list a:hover {
  color: #ffffff;
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 10px 24px rgba(201, 24, 31, 0.2);
  transform: translateY(-2px);
}

.download-list a:hover::after {
  color: #ffffff;
  transform: translateY(-42%);
}

.download-list a:focus-visible {
  outline: 3px solid rgba(201, 24, 31, 0.28);
  outline-offset: 3px;
}

/* -------------------- ABOUT PAGE -------------------- */
.story-list {
  display: grid;
  gap: 70px;
}

.story-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 58px;
  align-items: center;
}

.story-row-reverse img {
  order: 2;
}

.story-row img {
  width: 100%;
  height: 420px;
  border-radius: var(--radius);
  object-fit: cover;
  box-shadow: var(--shadow);
}

.story-row p {
  color: var(--muted);
}

.stats-section {
  padding: 90px 0;
  color: #ffffff;
  background-image: linear-gradient(rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0.78)), url("images/chi-siamo-mission.jpg");
  background-position: center;
  background-size: cover;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
  text-align: center;
}

.stat strong,
.stat span {
  display: block;
}

.stat strong {
  margin-bottom: 8px;
  color: #ff777c;
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 1;
}

/* -------------------- EMPTY STATE -------------------- */
.empty-state {
  max-width: 700px;
  margin-inline: auto;
  padding: 64px 28px;
  border: 1px dashed #b8b8b8;
  border-radius: var(--radius);
  text-align: center;
  background: #ffffff;
}

.empty-state p {
  color: var(--muted);
}

/* -------------------- FOOTER -------------------- */
.site-footer {
  padding: 48px 0 22px;
  color: #ffffff;
  background: #292929;
}

.footer-content {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 30px;
}

.footer-brand img {
  width: 175px;
  height: 80px;
  object-fit: contain;
}

.footer-email {
  font-weight: 700;
}

.social-links {
  display: flex;
  justify-content: flex-end;
  gap: 18px;
}

.social-links a,
.footer-email {
  color: #ffffff;
  text-decoration: none;
}

.social-links a:hover,
.footer-email:hover {
  color: #ff777c;
}

.copyright {
  margin: 28px 0 0;
  color: #aaaaaa;
  font-size: 0.86rem;
  text-align: center;
}

/* -------------------- TABLET LAYOUT -------------------- */
@media (max-width: 960px) {
  .section {
    padding: 76px 0;
  }

  .menu-toggle {
    display: block;
  }

  .site-navigation {
    position: absolute;
    top: 84px;
    right: 0;
    left: 0;
    display: none;
    max-height: calc(100vh - 84px);
    gap: 4px;
    overflow-y: auto;
    padding: 16px 20px 22px;
    border-top: 1px solid var(--border);
    background: #ffffff;
    box-shadow: 0 18px 30px rgba(0, 0, 0, 0.12);
  }

  .site-navigation.is-open {
    display: grid;
  }

  .site-navigation a {
    padding: 10px 0;
  }

  .three-column-grid,
  .project-grid,
  .icon-grid,
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card-carousel {
    grid-auto-columns: minmax(290px, 48%);
  }

  .contact-panel,
  .contact-page-grid,
  .project-detail-grid,
  .story-row,
  .split-feature {
    grid-template-columns: 1fr;
  }

  .project-detail-alt .project-detail-grid > img,
  .story-row-reverse img {
    order: 0;
  }

  .split-feature-content {
    max-width: none;
    padding: 58px 40px;
  }

  .footer-content {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .social-links {
    justify-content: center;
  }
}

/* -------------------- MOBILE LAYOUT -------------------- */
@media (max-width: 640px) {
  .container {
    width: min(calc(100% - 28px), var(--container));
  }

  .section {
    padding: 64px 0;
  }

  .hero {
    min-height: 560px;
  }

  .hero-inner {
    min-height: 430px;
  }

  .button-row,
  .cta-content,
  .heading-with-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .button-row .button,
  .cta-content .button {
    width: 100%;
  }

  .three-column-grid,
  .project-grid,
  .icon-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .card-carousel {
    grid-auto-columns: 88%;
  }

  .carousel-controls {
    align-self: flex-end;
  }

  .cta-content {
    display: flex;
  }

  .download-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .project-detail,
  .project-detail-alt {
    padding: 64px 0;
  }

  .project-detail-grid > img,
  .story-row img {
    height: 300px;
  }

  .contact-panel,
  .contact-page-grid {
    gap: 42px;
  }

  .form-on-light,
  .contact-details {
    padding: 24px;
  }

  .split-feature > img {
    min-height: 320px;
  }

  .split-feature-content {
    padding: 48px 24px;
  }

  .social-links {
    flex-wrap: wrap;
  }
}
