:root {
  --bg: #080a12;
  --bg-soft: #101421;
  --card: rgba(255, 255, 255, 0.06);
  --card-hover: rgba(255, 255, 255, 0.095);
  --card-border: rgba(255, 255, 255, 0.12);
  --text: #f5f7fb;
  --muted: #a8b0c3;
  --accent: #7c5cff;
  --accent-2: #20d3ff;
  --radius: 24px;
  --max-width: 1120px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background:
    radial-gradient(circle at top left, rgba(124, 92, 255, 0.28), transparent 34rem),
    radial-gradient(circle at top right, rgba(32, 211, 255, 0.18), transparent 30rem),
    var(--bg);
  color: var(--text);
  line-height: 1.6;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(18px);
  background: rgba(8, 10, 18, 0.72);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.navbar {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.1rem 1.4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-weight: 900;
  font-size: 1.35rem;
  letter-spacing: -0.04em;
}

.logo span {
  color: var(--accent-2);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.4rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.nav-links a {
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--text);
}

.menu-toggle {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
}

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

.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 6rem 1.4rem;
}

.hero {
  min-height: calc(100vh - 74px);
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  align-items: center;
  gap: 3rem;
}

.eyebrow {
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

h1 {
  font-size: clamp(3.2rem, 8vw, 6.5rem);
  line-height: 0.92;
  letter-spacing: -0.08em;
  max-width: 850px;
}

h2 {
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1;
  letter-spacing: -0.06em;
  margin-bottom: 1.4rem;
}

h3 {
  font-size: 1.18rem;
  line-height: 1.2;
  margin-bottom: 0.7rem;
}

.hero-text {
  max-width: 720px;
  color: var(--text);
  font-size: clamp(1.35rem, 2.6vw, 2rem);
  line-height: 1.18;
  letter-spacing: -0.04em;
  margin-top: 1.6rem;
}

.hero-subtext {
  max-width: 620px;
  color: var(--muted);
  font-size: 1.05rem;
  margin-top: 1rem;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.6rem;
  max-width: 720px;
}

.hero-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 0.85rem;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  font-size: 0.88rem;
}

.hero-actions,
.contact-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 1.25rem;
  border-radius: 999px;
  font-weight: 800;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
}

.btn.secondary {
  border: 1px solid var(--card-border);
  color: var(--text);
}

.hero-card,
.info-card,
.project-card,
.contact-section {
  background: linear-gradient(
    180deg,
    rgba(255,255,255,0.08),
    rgba(255,255,255,0.035)
  );
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.25);
}

.hero-card {
  position: relative;
  overflow: hidden;
  padding: 2rem;
}

.card-glow {
  position: absolute;
  inset: auto -60px -80px auto;
  width: 180px;
  height: 180px;
  background: var(--accent);
  filter: blur(70px);
  opacity: 0.6;
}

.card-label {
  color: var(--muted);
  margin-bottom: 1rem;
}

.hero-card h2 {
  position: relative;
  font-size: 2rem;
  margin-bottom: 1rem;
}

.hero-card p:last-child {
  position: relative;
  color: var(--muted);
}

.split-section {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 3rem;
  align-items: start;
}

.text-block {
  color: var(--muted);
  font-size: 1.08rem;
}

.text-block p + p {
  margin-top: 1rem;
}

.grid {
  display: grid;
  gap: 1.2rem;
}

.cards-grid {
  grid-template-columns: repeat(4, 1fr);
  margin-top: 2rem;
}

.info-card {
  padding: 1.4rem;
  min-height: 250px;
  transition:
    transform 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease;
}

.info-card:hover {
  transform: translateY(-5px);
  background: var(--card-hover);
  border-color: rgba(255, 255, 255, 0.2);
}

.card-number {
  color: var(--accent-2);
  font-weight: 900;
  margin-bottom: 2.2rem;
}

.info-card p,
.project-card p,
.section-heading p,
.contact-section p {
  color: var(--muted);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  align-items: end;
  margin-bottom: 2rem;
}

.section-heading p {
  max-width: 430px;
}

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

.project-card {
  min-height: 280px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition:
    transform 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease;
}

.project-card:hover {
  transform: translateY(-5px);
  background: var(--card-hover);
  border-color: rgba(255, 255, 255, 0.2);
}

.project-card span {
  color: var(--accent-2);
  font-weight: 900;
  margin-bottom: auto;
}

.contact-section {
  text-align: center;
  padding: 4rem 1.5rem;
}

.contact-section p {
  max-width: 640px;
  margin: 0 auto;
}

.contact-actions {
  justify-content: center;
}

.site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.4rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-footer a:hover {
  color: var(--text);
}

@media (max-width: 1050px) {
  .cards-grid,
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero {
    grid-template-columns: 1fr;
    padding-top: 4rem;
  }

  .hero-card {
    max-width: 620px;
  }
}

@media (max-width: 900px) {
  .split-section {
    grid-template-columns: 1fr;
  }

  .section-heading {
    display: block;
  }

  .section-heading p {
    margin-top: 1rem;
  }
}

@media (max-width: 680px) {
  .navbar {
    padding-inline: 1.1rem;
  }

  .nav-links {
    position: absolute;
    top: 68px;
    left: 1rem;
    right: 1rem;
    display: none;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    background: rgba(16, 20, 33, 0.96);
    border: 1px solid var(--card-border);
    border-radius: 18px;
  }

  .nav-links.open {
    display: flex;
  }

  .menu-toggle {
    display: block;
  }

  .section {
    padding: 4.5rem 1.1rem;
  }

  .hero {
    min-height: auto;
  }

  h1 {
    font-size: clamp(3rem, 16vw, 4.6rem);
  }

  .hero-text {
    font-size: 1.45rem;
  }

  .cards-grid,
  .project-grid {
    grid-template-columns: 1fr;
  }

  .info-card,
  .project-card {
    min-height: 220px;
  }

  .hero-actions,
  .contact-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .site-footer {
    flex-direction: column;
  }
}

/* --- Placeholder foto e immagini sostituibili --- */
.hero-card-photo {
  min-height: 620px;
  padding: 0;
  isolation: isolate;
}

.hero-card-photo > img,
.about-image img,
.photo-card img,
.gallery-item img,
.contact-bg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-card-photo > img {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.hero-card-photo::after,
.photo-card::after,
.photo-contact-section::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-card-photo::after {
  z-index: -1;
  background: linear-gradient(
    to top,
    rgba(8, 10, 18, 0.96),
    rgba(8, 10, 18, 0.22)
  );
}

.hero-card-overlay {
  min-height: 620px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.about-content {
  display: grid;
  gap: 1.5rem;
}

.about-image {
  overflow: hidden;
  min-height: 340px;
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
  background: var(--card);
}

.service-icon {
  width: 58px;
  height: 58px;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid var(--card-border);
  margin-bottom: 1rem;
  background: rgba(255, 255, 255, 0.06);
}

.info-card .card-number {
  margin-bottom: 1.2rem;
}

.photo-project-grid {
  align-items: stretch;
}

.photo-card {
  position: relative;
  min-height: 390px;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
  background: var(--card);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.25);
  transition:
    transform 0.2s ease,
    border-color 0.2s ease;
}

.photo-card img {
  position: absolute;
  inset: 0;
  transition:
    transform 0.35s ease,
    opacity 0.35s ease;
}

.photo-card::after {
  background: linear-gradient(
    to top,
    rgba(8, 10, 18, 0.96),
    rgba(8, 10, 18, 0.48) 46%,
    rgba(8, 10, 18, 0.14)
  );
}

.photo-card div {
  position: relative;
  z-index: 1;
  min-height: 390px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.photo-card span {
  color: var(--accent-2);
  font-weight: 900;
  margin-bottom: auto;
}

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

.photo-card:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 255, 255, 0.2);
}

.photo-card:hover img {
  transform: scale(1.06);
  opacity: 0.92;
}

.gallery-section {
  padding-top: 3rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.2rem;
}

.gallery-item {
  min-height: 360px;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
  background: var(--card);
}

.gallery-item.wide {
  grid-column: span 2;
}

.photo-contact-section {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: 0;
  min-height: 460px;
  display: grid;
  place-items: center;
}

.photo-contact-section::after {
  z-index: -1;
  background: linear-gradient(
    135deg,
    rgba(8, 10, 18, 0.98),
    rgba(8, 10, 18, 0.78),
    rgba(8, 10, 18, 0.95)
  );
}

.contact-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.contact-content {
  padding: 4rem 1.5rem;
}

@media (max-width: 1050px) {
  .hero-card-photo,
  .hero-card-overlay {
    min-height: 520px;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 680px) {
  .hero-card-photo,
  .hero-card-overlay {
    min-height: 420px;
  }

  .about-image,
  .gallery-item {
    min-height: 280px;
  }

  .photo-card,
  .photo-card div {
    min-height: 340px;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .gallery-item.wide {
    grid-column: span 1;
  }

  .photo-contact-section {
    min-height: 520px;
  }
}

/* --- Link social header e contatti --- */
.social-links {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.social-links a {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.social-links a:hover,
.social-links a:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.09);
}

.social-links svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.social-links svg path:last-child:nth-child(2) {
  fill: currentColor;
}

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

.photo-card:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 4px;
}

@media (max-width: 680px) {
  .nav-social {
    position: absolute;
    top: 14px;
    right: 4.3rem;
    gap: 0.45rem;
  }

  .nav-social a {
    width: 36px;
    height: 36px;
  }

  .nav-social svg {
    width: 18px;
    height: 18px;
  }

  .contact-social {
    width: 100%;
  }
}
