@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;700;900&display=swap');

:root {
  --green: #588157;
  --green-dark: #4a6d49;
  --bg: #f3f2ed;
  --nav-inactive: #d9d9d9;
  --nav-inactive-hover: #c4c4c4;
  --card-bg: #dddcdc;
  --white: #ffffff;
  --black: #000000;
  --text-dark: #1e1e1e;
  --gray-mid: #5d5d5d;
  --placeholder: #d9d9d9;
  --max-width: 1280px;
  --nav-height: 64px;
  --radius-pill: 15px;
  --radius-btn: 12px;
  --radius-card: 50px;
  --radius-media: 20px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --header-transition: 0.38s var(--ease-in-out);
  --page-transition: 0.5s var(--ease-out);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text-dark);
  line-height: 1.5;
  overflow-x: hidden;
  padding-top: var(--nav-height);
}

/* Header sempre visibile durante la navigazione */
.site-header {
  opacity: 1 !important;
  visibility: visible !important;
}

main.main-enter {
  opacity: 0;
  transform: translateY(14px);
}

main.main-enter.main-enter--done {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity var(--page-transition),
    transform var(--page-transition);
}

main.main-exit {
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.28s var(--ease-in-out),
    transform 0.28s var(--ease-in-out);
  pointer-events: none;
}

body.is-loaded .section-reveal,
main.main-enter--done .section-reveal {
  animation: sectionReveal 0.55s var(--ease-out) backwards;
}

@keyframes sectionReveal {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: disc;
  padding-left: 1.5rem;
}

/* ── Header / Nav ── */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--white);
  height: var(--nav-height);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
  transform: translateY(0);
  transition:
    transform var(--header-transition),
    box-shadow var(--header-transition);
  will-change: transform;
}

.site-header.is-hidden {
  transform: translateY(-100%);
  box-shadow: none;
}

.header-inner {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 12px 0 16px;
  gap: 0.75rem;
}

.logo {
  font-weight: 900;
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--black);
  letter-spacing: -0.02em;
  flex-shrink: 0;
  margin-right: auto;
  transition: opacity 0.25s ease, transform 0.25s var(--ease-out);
}

.logo:hover {
  opacity: 0.85;
  transform: scale(1.02);
}

.nav-toggle {
  display: none;
  background: var(--nav-inactive);
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  font: 700 0.875rem Inter, sans-serif;
  cursor: pointer;
}

.site-nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  justify-content: flex-end;
  align-items: center;
  margin-left: auto;
  flex-shrink: 0;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  background: var(--nav-inactive);
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--black);
  white-space: nowrap;
  transition:
    background 0.28s var(--ease-out),
    color 0.28s var(--ease-out),
    transform 0.28s var(--ease-out),
    box-shadow 0.28s var(--ease-out);
}

.nav-link:hover {
  background: var(--nav-inactive-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.nav-link:active {
  transform: translateY(0);
  box-shadow: none;
  transition-duration: 0.1s;
}

.nav-link.active {
  background: var(--green);
  color: var(--white);
}

.nav-link.active:hover {
  background: var(--green-dark);
  box-shadow: 0 4px 14px rgba(88, 129, 87, 0.35);
}

.nav-link--switching {
  transform: scale(0.92);
  background: var(--nav-inactive-hover);
  transition-duration: 0.15s;
}

.nav-link--arrived {
  animation: navActivePulse 0.45s var(--ease-out);
}

@keyframes navActivePulse {
  0% {
    transform: scale(0.94);
    box-shadow: 0 0 0 0 rgba(88, 129, 87, 0.45);
  }
  60% {
    transform: scale(1.04);
    box-shadow: 0 0 0 8px rgba(88, 129, 87, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: none;
  }
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 24px;
  border-radius: var(--radius-btn);
  background: var(--nav-inactive);
  color: var(--black);
  font-weight: 700;
  font-size: 1.125rem;
  border: none;
  cursor: pointer;
  transition:
    background 0.28s var(--ease-out),
    color 0.28s var(--ease-out),
    transform 0.28s var(--ease-out),
    box-shadow 0.28s var(--ease-out);
}

.btn:hover {
  background: var(--nav-inactive-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}

.btn--light {
  background: var(--white);
  color: var(--green);
}

.btn--light:hover {
  background: #eee;
  color: var(--green-dark);
}

.btn--sm {
  min-height: 42px;
  font-size: 1rem;
  padding: 0 20px;
  border-radius: var(--radius-pill);
}

/* ── Sections ── */
.section {
  padding: clamp(3rem, 8vw, 5rem) clamp(1.25rem, 4vw, 5rem);
}

.section--green {
  background: var(--green);
  color: var(--white);
}

.section--cream {
  background: var(--bg);
}

.section--white {
  background: var(--white);
}

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-title {
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.15;
  margin-bottom: 1.5rem;
}

.section-title--green {
  color: var(--green);
}

.section-title--white {
  color: var(--white);
}

.section-title--center {
  text-align: center;
}

.section-subtitle {
  font-weight: 400;
  font-size: clamp(1.25rem, 3vw, 2rem);
  letter-spacing: 0.03em;
}

/* Two-column layout */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.split--reverse .split__media {
  order: -1;
}

.split__content p,
.split__content li {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.split__content li {
  margin-bottom: 0.75rem;
}

.split__content li span,
.split__content .text-regular {
  font-weight: 400;
}

.split__content li strong,
.split__content .text-bold {
  font-weight: 700;
}

/* ── Hero (homepage) ── */
.hero {
  background: var(--bg);
  padding: clamp(2rem, 6vw, 4rem) clamp(1.25rem, 4vw, 5rem);
  min-height: calc(100vh - var(--nav-height));
  max-height: 900px;
  display: flex;
  align-items: center;
}

.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
  width: 100%;
}

.hero-title {
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--green);
  line-height: 1.15;
  margin-bottom: 2rem;
}

.hero-image {
  max-width: 367px;
  margin: 0 auto;
}

/* ── Video embed ── */
.video-wrap {
  position: relative;
  width: 100%;
  max-width: 569px;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-media);
  overflow: hidden;
  background: var(--placeholder);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ── Page hero (inner pages) ── */
.page-hero {
  background: var(--bg);
  padding: clamp(2.5rem, 6vw, 4rem) 1.25rem;
  text-align: center;
}

.page-hero .section-title {
  margin-bottom: 0;
}

/* ── Agenda intro (green block) ── */
.agenda-intro {
  background: var(--green);
  color: var(--white);
  padding: clamp(3rem, 8vw, 5rem) clamp(1.25rem, 4vw, 3rem);
}

.agenda-intro-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.agenda-intro h1 {
  font-weight: 900;
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 1.5rem;
}

.agenda-intro .intro-text {
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1.6;
}

.agenda-intro .intro-text p + p {
  margin-top: 1rem;
}

.agenda-intro .intro-text strong {
  font-weight: 700;
}

.agenda-intro-image {
  border-radius: var(--radius-media);
  overflow: hidden;
}

.agenda-intro-image img {
  width: 100%;
  max-height: 620px;
  object-fit: contain;
}

/* ── Goal blocks ── */
.goal-block {
  padding: clamp(3rem, 6vw, 4.5rem) clamp(1.25rem, 4vw, 3rem);
}

.goal-block-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(2rem, 4vw, 4rem);
  align-items: center;
}

.goal-block--alt .goal-block-inner {
  grid-template-columns: 1fr auto;
}

.goal-block--alt .goal-icon {
  order: 2;
}

.goal-block--alt .goal-content {
  order: 1;
}

.goal-icon {
  position: relative;
  width: min(297px, 40vw);
  aspect-ratio: 1;
  flex-shrink: 0;
  border-radius: var(--radius-media);
  overflow: hidden;
  display: block;
  line-height: 0;
}

.goal-icon img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Goal 7: asset Figma con margini interni — zoom come nel design originale */
.goal-icon--7 img {
  width: 200%;
  height: 125%;
  left: 50%;
  top: 50%;
  right: auto;
  bottom: auto;
  transform: translate(-50%, -50%);
  max-width: none;
  object-fit: cover;
}

.goal-title {
  font-weight: 900;
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 1rem;
}

.goal-block.section--green .goal-title,
.goal-block.section--green .goal-content {
  color: var(--white);
}

.goal-block.section--cream .goal-title,
.goal-block.section--cream .goal-content {
  color: var(--green);
}

.goal-content {
  font-size: 1.25rem;
}

.goal-content ul {
  margin-top: 0.5rem;
}

.goal-content li {
  margin-bottom: 0.5rem;
}

/* ── Team cards ── */
.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 3vw, 2.5rem);
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem 3rem;
}

.team-card {
  background: var(--card-bg);
  border-radius: var(--radius-card);
  padding: 2rem 1.5rem 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.team-card__photo {
  width: 231px;
  height: 226px;
  border-radius: 24px;
  background: #ecebeb;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.team-card__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.team-card__name {
  font-weight: 900;
  font-size: 2rem;
  color: var(--green);
  margin-bottom: 1rem;
}

/* ── Content blocks (normative / consigli) ── */
.content-block {
  padding: clamp(3rem, 7vw, 5rem) clamp(1.25rem, 4vw, 3rem);
}

.content-block-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 4vw, 3rem);
  align-items: center;
}

.content-block--reverse .content-block-inner {
  direction: rtl;
}

.content-block--reverse .content-block-inner > * {
  direction: ltr;
}

.content-block h2 {
  font-weight: 700;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.content-block.section--green h2,
.content-block.section--green .block-text,
.content-block.section--green .block-text li,
.content-block.section--green .block-text p {
  color: var(--white);
}

.content-block.section--cream h2,
.content-block.section--cream .block-text {
  color: var(--green);
}

.block-text {
  font-size: 1.5rem;
}

.block-text li {
  margin-bottom: 1rem;
}

.block-media img {
  border-radius: var(--radius-card);
  max-height: 400px;
  width: auto;
  margin: 0 auto;
  object-fit: contain;
}

.block-media--round img {
  border-radius: var(--radius-card);
}

/* ── Game page ── */
.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;
}

.page-hero--compact {
  padding-bottom: clamp(1rem, 3vw, 1.5rem);
}

.game-section {
  padding-top: 0;
  padding-bottom: clamp(2rem, 5vw, 3rem);
}

.game-section-inner {
  width: 100%;
}

.game-screen {
  position: relative;
  width: 100%;
  height: min(72vh, 720px);
  min-height: 520px;
  background: var(--placeholder);
  border-radius: var(--radius-media);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.game-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.game-unavailable {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  min-height: 280px;
  padding: 2.5rem 2rem;
  text-align: center;
  background: var(--card-bg);
  border-radius: var(--radius-media);
  color: var(--text-dark);
  font-size: 1.125rem;
  line-height: 1.6;
  max-width: 640px;
  margin: 0 auto;
}

.game-unavailable__title {
  font-weight: 900;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  color: var(--green);
}

@media (max-width: 1023px), (pointer: coarse) {
  .game-page .game-screen {
    display: none;
  }

  .game-page .game-unavailable {
    display: flex;
  }
}

@media (min-width: 1024px) and (pointer: fine) and (hover: hover) {
  .game-page:not(.game-page--mobile) .game-screen {
    display: block;
  }

  .game-page:not(.game-page--mobile) .game-unavailable {
    display: none;
  }
}

body.game-page--mobile .game-screen {
  display: none !important;
}

body.game-page--mobile .game-unavailable {
  display: flex !important;
}

body.game-page--desktop .game-screen {
  display: block !important;
}

body.game-page--desktop .game-unavailable {
  display: none !important;
}

.game-instructions {
  background: var(--green);
  color: var(--white);
  padding: clamp(3rem, 6vw, 4rem) 1.25rem;
}

.game-instructions h2 {
  font-weight: 700;
  font-size: clamp(2rem, 4vw, 4rem);
  text-align: center;
  margin-bottom: 2rem;
}

.game-instructions .instructions-text {
  max-width: 735px;
  margin: 0 auto;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.6;
}

.game-instructions .instructions-text p + p {
  margin-top: 1rem;
}

/* ── Footer links (homepage) ── */
.footer-links {
  background: var(--green);
  color: var(--white);
  padding: clamp(2.5rem, 5vw, 3.5rem) 1.25rem 4rem;
  text-align: center;
}

.footer-links h2 {
  font-weight: 900;
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 0.25rem;
}

.footer-links .section-subtitle {
  margin-bottom: 2.5rem;
  opacity: 0.95;
}

.link-icons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  max-width: 700px;
  margin: 0 auto;
}

.link-icon {
  width: 93px;
  height: 100px;
  background: var(--white);
  border-radius: var(--radius-media);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  transition: transform 0.2s;
}

.link-icon:hover {
  transform: scale(1.05);
}

.link-icon img {
  max-height: 80px;
  width: auto;
  object-fit: contain;
}

/* ── Recycling symbol section ── */
.recycling-section .split__media img {
  max-width: 283px;
}

.split__content--right {
  text-align: right;
}

.split__content--right .btn {
  margin-left: auto;
}

.split__content--right .section-title {
  text-align: right;
}

/* ── Responsive ── */
@media (max-width: 1200px) {
  .nav-link {
    padding: 0 11px;
    font-size: 0.8125rem;
  }

  .logo {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
  }
}

@media (max-width: 1024px) {
  .hero-inner,
  .split,
  .agenda-intro-inner,
  .content-block-inner,
  .goal-block-inner,
  .goal-block--alt .goal-block-inner {
    grid-template-columns: 1fr;
  }

  .goal-block--alt .goal-icon,
  .goal-block--alt .goal-content {
    order: unset;
  }

  .content-block--reverse .content-block-inner {
    direction: ltr;
  }

  .team-grid {
    grid-template-columns: 1fr;
    max-width: 360px;
  }

  .split--reverse .split__media {
    order: unset;
  }

  .split__content--right,
  .split__content--right .section-title {
    text-align: left;
  }

  .split__content--right .btn {
    margin-left: 0;
  }

  .hero {
    min-height: auto;
    max-height: none;
  }

  .video-wrap {
    max-width: 100%;
    margin: 0 auto;
  }

  .goal-block-inner {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .goal-icon {
    width: min(260px, 70vw);
  }

  .block-text {
    font-size: clamp(1rem, 2.5vw, 1.35rem);
  }

  .content-block h2 {
    font-size: clamp(1.75rem, 5vw, 2.75rem);
  }
}

@media (max-width: 992px) {
  .nav-toggle {
    display: block;
    margin-left: 0;
    flex-shrink: 0;
    transition: transform 0.25s var(--ease-out), background 0.25s ease;
  }

  .nav-toggle:hover {
    transform: scale(1.04);
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    padding: 0.75rem 10px;
    flex-direction: column;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    gap: 6px;
    margin-left: 0;
  }

  .site-nav.open {
    display: flex;
  }

  .site-header:has(.site-nav.open) {
    transform: translateY(0) !important;
  }

  .nav-link {
    width: 100%;
    justify-content: center;
    min-height: 44px;
    font-size: 0.9375rem;
  }

  .header-inner {
    padding: 0 10px 0 12px;
    flex-wrap: nowrap;
  }
}

@media (max-width: 768px) {
  :root {
    --nav-height: 56px;
  }

  .section {
    padding: clamp(2rem, 6vw, 3rem) 1rem;
  }

  .hero {
    padding: 2rem 1rem 2.5rem;
  }

  .hero-title {
    margin-bottom: 1.25rem;
  }

  .hero-image {
    max-width: min(280px, 85vw);
  }

  .btn {
    width: 100%;
    max-width: 280px;
  }

  .hero-inner .btn,
  .split__content .btn {
    display: flex;
  }

  .page-hero {
    padding: 2rem 1rem;
  }

  .agenda-intro {
    padding: 2.5rem 1rem;
  }

  .agenda-intro .btn {
    width: 100%;
    max-width: 280px;
  }

  .team-card__photo {
    width: min(231px, 75vw);
    height: auto;
    aspect-ratio: 1;
  }

  .team-card__name {
    font-size: clamp(1.5rem, 5vw, 2rem);
  }

  .game-screen {
    min-height: 0;
    height: auto;
    margin: 0;
  }

  .game-section {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .game-instructions .instructions-text {
    font-size: clamp(1rem, 3.5vw, 1.25rem);
    padding: 0 0.5rem;
  }

  .footer-links {
    padding: 2rem 1rem 2.5rem;
  }

  .link-icons {
    gap: 0.75rem;
  }

  .link-icon {
    width: 80px;
    height: 86px;
  }

  .link-icon img {
    max-height: 64px;
  }
}

@media (max-width: 480px) {
  .logo {
    font-size: 1.65rem;
  }

  .section-title {
    font-size: clamp(1.5rem, 7vw, 2rem);
  }

  .section-subtitle {
    font-size: clamp(1rem, 4.5vw, 1.35rem);
  }

  .split__content p,
  .split__content li,
  .goal-content {
    font-size: 1rem;
  }

  .content-block {
    padding: 2rem 0.875rem;
  }

  .goal-block {
    padding: 2rem 0.875rem;
  }

  .link-icons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    max-width: 280px;
  }

  .link-icon {
    width: 100%;
    height: 72px;
  }

  .nav-toggle {
    padding: 10px 14px;
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .site-header,
  .nav-link,
  .logo,
  .btn {
    transition: none;
  }

  main.main-enter,
  main.main-exit,
  main.main-enter--done,
  main.main-enter--done .section-reveal,
  .nav-link--arrived {
    animation: none !important;
    transition: none !important;
    opacity: 1;
    transform: none;
  }
}
