@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@600;700&display=swap');

:root {
  --page-bg: #f0f0f0;
  --text: #000;
  --brand-max: 220px;
  --brand-min: 120px;
  --gap: clamp(16px, 3vw, 32px);
  --pulse-scale: 1.04;
  --breathe-scale: 1.06;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100svh; /* use small viewport height for mobile address bar */
  background: var(--page-bg);
  font-family: 'Montserrat', system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
}

.page {
  width: min(1100px, 92vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(30px, 4vw, 60px);
  text-align: center;
}

.hero {
  display: flex;
  justify-content: center;
  align-items: center;
}

.central-logo {
  width: min(340px, 70vw);
  height: auto;
  animation: pulse 2400ms ease-in-out infinite;
  will-change: transform;
}

.brands {
  display: grid;
  grid-template-columns: repeat(3, minmax(var(--brand-min), 1fr));
  gap: var(--gap);
  align-items: center;
  justify-items: center;
}

.brand {
  text-decoration: none;
  color: inherit;
  display: grid;
  justify-items: center;
  gap: 6px;
}

.brand img {
  width: min(var(--brand-max), 22vw);
  height: auto;
  transition: transform 220ms ease, filter 220ms ease, opacity 220ms ease;
  animation: breathe 2600ms ease-in-out infinite;
  will-change: transform;
}

.brand:nth-child(2) img { animation-delay: 200ms; }
.brand:nth-child(3) img { animation-delay: 400ms; }

.visit-site {
  display: none;
  font-size: 13px;
}

.brand:focus .visit-site,
.brand:hover .visit-site {
  display: block;
}

.brands:has(.brand:hover) .brand:not(:hover) img,
.brands:has(.brand:focus-visible) .brand:not(:focus-visible) img {
  opacity: .7;
  animation-play-state: paused;
}

/* Footer */
.site-footer {
  font-size: 12px;
  line-height: 1.4;
}

/* Animazioni */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(var(--pulse-scale)); }
  100% { transform: scale(1); }
}

@keyframes breathe {
  0% { transform: scale(1); }
  50% { transform: scale(var(--breathe-scale)); }
  100% { transform: scale(1); }
}

/* Responsività */
@media (max-width: 900px) {
  .brands {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .brands {
    grid-template-columns: 1fr;
  }
  .central-logo { width: min(220px, 70vw); }
  .brand img { width: min(200px, 70vw); }
}
