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

html,
body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Mobile-first: Single column layout */
.grid-container {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: repeat(4, 1fr);
  height: 100vh;
  height: 100dvh; /* Dynamic viewport height for mobile browsers */
  width: 100vw;
  position: relative;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.quadrant {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
}

/* Dark overlay for better text readability */
.quadrant::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 1;
}

.content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.6rem;
  position: relative;
  z-index: 2;
  color: #ffffff;
}

/* Logo container base styles */
.logo-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1rem;
  border-radius: 4px;
  gap: 0.4rem;
  max-width: 200px;
}

/* Dark background box for white/light logos */
.logo-box-dark {
  background-color: rgba(30, 30, 30, 0.9);
}

.logo-box-dark .description {
  color: rgba(255, 255, 255, 0.85);
}

/* Light background box for dark logos */
.logo-box-light {
  background-color: rgba(255, 255, 255, 0.95);
  padding: 0.4rem 0.6rem;
}

.logo-box-light .company-logo {
  max-width: 140px;
  max-height: 55px;
}

.logo-box-light .description {
  color: rgba(40, 40, 40, 0.9);
}

.company-logo {
  max-width: 100px;
  max-height: 40px;
  height: auto;
  object-fit: contain;
}

.description {
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.2px;
  line-height: 1.4;
  text-align: center;
  text-shadow: none;
}

.description p {
  margin: 0;
}

.cta-button {
  display: inline-block;
  padding: 0.5rem 1.2rem;
  font-size: 0.7rem;
  font-weight: 500;
  text-decoration: none;
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 2px;
  transition: all 0.3s ease;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  backdrop-filter: blur(4px);
}

.cta-button:hover {
  background-color: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.9);
  transform: translateY(-1px);
}

/* Background images for each quadrant */
.repston {
  background-image: url("backgrounds/repston_bg.jpg");
}

.marmi-futerno {
  background-image: url("backgrounds/marmi_bg.jpg");
}

.hektor-light {
  background-image: url("backgrounds/hector_bg.jpg");
}

.baltic-design {
  background-image: url("backgrounds/baltic_bg.jpg");
}

/* Center CSI Logo */
/* Mobile: CSI logo in top-left corner */
.center-logo {
  position: absolute;
  top: 0.8rem;
  left: 0.8rem;
  transform: none;
  z-index: 10;
  background-color: rgba(255, 255, 255, 0.95);
  padding: 0.5rem 0.7rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.csi-logo {
  max-width: 50px;
  max-height: 35px;
  object-fit: contain;
  display: block;
}

/* Tablet: 2x2 grid, CSI logo moves to center */
@media (min-width: 600px) {
  .grid-container {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
  }

  .quadrant {
    padding: 1.5rem;
  }

  .content {
    gap: 0.8rem;
  }

  .logo-container {
    padding: 1rem 1.2rem;
    gap: 0.5rem;
    max-width: 220px;
  }

  .logo-box-light {
    padding: 0.5rem 0.8rem;
  }

  .company-logo {
    max-width: 120px;
    max-height: 50px;
  }

  .logo-box-light .company-logo {
    max-width: 160px;
    max-height: 65px;
  }

  .description {
    font-size: 0.65rem;
  }

  .cta-button {
    padding: 0.5rem 1.2rem;
    font-size: 0.7rem;
  }

  .center-logo {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 1rem 1.5rem;
  }

  .csi-logo {
    max-width: 80px;
    max-height: 50px;
  }
}

/* Desktop: Larger elements */
@media (min-width: 1024px) {
  .quadrant {
    padding: 2rem;
  }

  .content {
    gap: 1rem;
  }

  .logo-container {
    padding: 1.2rem 1.5rem;
    gap: 0.6rem;
    max-width: 260px;
  }

  .logo-box-light {
    padding: 0.6rem 1rem;
  }

  .company-logo {
    max-width: 150px;
    max-height: 60px;
  }

  .logo-box-light .company-logo {
    max-width: 190px;
    max-height: 75px;
  }

  .description {
    font-size: 0.75rem;
    letter-spacing: 0.3px;
  }

  .cta-button {
    padding: 0.6rem 1.5rem;
    font-size: 0.75rem;
  }

  .center-logo {
    padding: 1.5rem 2rem;
  }

  .csi-logo {
    max-width: 100px;
    max-height: 60px;
  }
}

/* Large screens */
@media (min-width: 1400px) {
  .logo-container {
    padding: 1.5rem 2rem;
    gap: 0.8rem;
    max-width: 300px;
  }

  .logo-box-light {
    padding: 0.8rem 1.2rem;
  }

  .company-logo {
    max-width: 180px;
    max-height: 70px;
  }

  .logo-box-light .company-logo {
    max-width: 220px;
    max-height: 85px;
  }

  .description {
    font-size: 0.85rem;
  }

  .cta-button {
    padding: 0.7rem 1.8rem;
    font-size: 0.8rem;
  }

  .center-logo {
    padding: 1.8rem 2.5rem;
  }

  .csi-logo {
    max-width: 120px;
    max-height: 70px;
  }
}
