:root {
  --color-nuvola-100: #fbfcfc;
  --color-germoglio-vivo-900: #3b551c;
  --wave-height: clamp(340px, 45vh, 470px);
  --font-body: 'Manrope', sans-serif;
  --font-heading: 'General Sans', sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  max-width: 100%;
  overflow-x: clip;
}

body {
  background: var(--color-nuvola-100);
  font-family: var(--font-body);
  min-height: 100vh;
}

.page {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

/* --- Hero: energy scene, logo, tagline, social links --- */

.hero {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  /* Keep the social row inside the clear area above the footer wave. */
  padding: 24px 24px calc(var(--wave-height) + 18px);
  text-align: center;
}

.hero__scene {
  width: min(820px, 62vh, 94vw);
  margin-inline: auto;
  aspect-ratio: 1080 / 422;
  opacity: 0;
  animation: fadeUp 0.7s ease-out 0.05s both;
}

.hero__logo {
  width: min(386px, 60vw);
  height: auto;
  margin-inline: auto;
  opacity: 0;
  animation: logoBuild 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.4s both;
}

.hero__tagline {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: clamp(24px, 4vw, 36px);
  line-height: 1;
  letter-spacing: -1.08px;
  background: linear-gradient(220.48deg, #c7d32a 0%, #277727 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0;
  animation: fadeUp 0.7s ease-out 0.65s both;
}

.hero__socials {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin: 2px 0 0;
  margin-inline: auto;
  padding: 0;
  list-style: none;
  flex-shrink: 0;
}

.hero__socials li {
  opacity: 0;
  animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.hero__socials li:nth-child(1) { animation-delay: 0.9s; }
.hero__socials li:nth-child(2) { animation-delay: 1.0s; }
.hero__socials li:nth-child(3) { animation-delay: 1.1s; }

.hero__socials a {
  display: flex;
  width: 28px;
  height: 28px;
  opacity: 1;
  transition: opacity 0.15s ease;
}

.hero__socials a:hover {
  opacity: 0.75;
}

.hero__socials img {
  width: 100%;
  height: 100%;
  display: block;
}

/* --- Wave footer with contact details --- */

.wave {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  height: var(--wave-height);
  padding: 0 24px 48px;
  overflow: hidden;
  opacity: 0;
  animation: waveRise 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.05s both;
}

.wave__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  object-fit: cover;
  object-position: top center;
}

.wave__contacts {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  width: 100%;
  max-width: 100%;
  padding: 0 16px;
}

.contact-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  color: var(--color-germoglio-vivo-900);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.28px;
  text-decoration: none;
  text-align: center;
  opacity: 0;
  animation: fadeUp 0.6s ease-out both;
}

.contact-row span {
  min-width: 0;
  text-align: center;
}

.wave__contacts .contact-row:nth-child(1) { animation-delay: 1.5s; }
.wave__contacts .contact-row:nth-child(2) { animation-delay: 1.65s; }
.wave__contacts .contact-row:nth-child(3) { animation-delay: 1.8s; }

.contact-row:hover {
  text-decoration: underline;
}

.contact-row img {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

@media (max-width: 560px) {
  :root {
    --wave-height: clamp(260px, 31vh, 360px);
  }

  .hero {
    justify-content: center;
    gap: 12px;
    padding: 16px 16px calc(var(--wave-height) + 20px);
  }

  .hero__scene {
    /* Keep the full illustration inside the viewport on narrow screens. */
    width: min(100%, 62vh);
    max-width: 100%;
  }

  .wave {
    padding: 20px 12px 16px;
  }

  .wave__contacts {
    gap: 8px;
  }

  .contact-row {
    gap: 6px;
    font-size: 13.5px;
  }

  .contact-row span {
    max-width: 220px;
  }
}

/* Short notebooks and landscape phones: scale the composition to the
   available height so the wave never pushes the hero below the viewport. */
@media (max-height: 700px) {
  :root {
    --wave-height: clamp(220px, 40vh, 320px);
  }

  .hero {
    gap: 10px;
    padding-top: 16px;
    padding-bottom: calc(var(--wave-height) + 12px);
  }

  .hero__scene {
    width: min(820px, 52vh, 94vw);
  }

  .hero__tagline {
    font-size: clamp(22px, 4vw, 32px);
  }

  .wave {
    padding-bottom: 32px;
  }

  .wave__contacts {
    gap: 10px;
  }
}

@media (max-width: 560px) and (max-height: 600px) {
  :root {
    --wave-height: clamp(210px, 44vh, 260px);
  }

  .hero {
    padding-bottom: calc(var(--wave-height) + 8px);
  }

  .hero__scene {
    width: min(100%, 52vh);
  }

  .wave {
    padding-bottom: 16px;
  }
}

/* --- Entrance animation keyframes --- */

@keyframes waveRise {
  from { opacity: 0; transform: translateY(48px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes logoBuild {
  from { opacity: 0; transform: scale(0.88); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.4); }
  to { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .hero__scene,
  .hero__logo,
  .hero__tagline,
  .hero__socials li,
  .wave,
  .wave__contacts .contact-row {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
