/* =========================================================
   SACI COSTRUZIONI — Hero Grid (Premium 3-Panel)
   60fps: only transform + opacity on compositor thread
   ========================================================= */

.hero-grid {
  position: relative;
  height: 100vh;
  min-height: 640px;
  display: grid;
  grid-template-columns: 1fr 36%;
  gap: 3px;
  background: var(--color-primary);
  overflow: hidden;
}

/* ── Shared panel base ── */
.hg-panel,
.hg-cell {
  position: relative;
  overflow: hidden;
}

/* ── Right column ── */
.hg-aside {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.hg-cell { flex: 1; }

/* ── Slides ── */
.hg-slides {
  position: absolute;
  inset: 0;
}

.hg-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 1.4s ease, transform 8s ease;
  will-change: transform, opacity;
}

.hg-slide.active {
  opacity: 1;
  transform: scale(1);
}

/* ── Overlays ── */
.hg-panel::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    160deg,
    rgba(10, 24, 54, .12) 0%,
    rgba(10, 24, 54, .45) 50%,
    rgba(10, 24, 54, .75) 100%
  );
  z-index: 1;
  pointer-events: none;
}

.hg-cell::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(10, 24, 54, .08) 40%,
    rgba(10, 24, 54, .68) 100%
  );
  z-index: 1;
  pointer-events: none;
}

/* ── Main content ── */
.hg-content {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 56px 60px;
}

.hg-title {
  font-family: var(--font-heading);
  font-size: clamp(2.4rem, 4.2vw, 4.4rem);
  font-weight: 900;
  color: #fff;
  line-height: 1.0;
  letter-spacing: -.03em;
  margin-bottom: 16px;
  animation: hgFadeUp .9s ease .3s both;
}

.hg-sub {
  font-family: var(--font-heading);
  font-size: clamp(.85rem, 1.1vw, 1rem);
  font-weight: 400;
  color: rgba(255, 255, 255, .68);
  line-height: 1.75;
  max-width: 440px;
  margin-bottom: 36px;
  animation: hgFadeUp .9s ease .45s both;
}

.hg-ctas {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  animation: hgFadeUp .9s ease .6s both;
}

/* ── Progress bar ── */
.hg-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: rgba(255, 255, 255, .85);
  width: 0%;
  z-index: 3;
  transform-origin: left;
}

.hg-progress.running {
  width: 100%;
  transition: width 5s linear;
}

/* ── Scroll indicator ── */
.hg-scroll {
  position: absolute;
  bottom: 44px;
  left: 60px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: hgFadeUp .9s ease .85s both;
}

.hg-scroll-line {
  width: 36px;
  height: 1px;
  background: rgba(255, 255, 255, .25);
  position: relative;
  overflow: hidden;
}

.hg-scroll-line::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, .8);
  animation: hgScrollPulse 2s ease-in-out infinite 1.5s;
}

.hg-scroll-label {
  font-family: var(--font-heading);
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .35);
}

/* ── Cell labels (right panels) ── */
.hg-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  padding: 18px 20px 20px;
}

.hg-label-tag {
  display: block;
  font-family: var(--font-heading);
  font-size: .54rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .45);
  margin-bottom: 4px;
}

.hg-label-title {
  display: block;
  font-family: var(--font-heading);
  font-size: .88rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .92);
}

/* ── Animations ── */
@keyframes hgFadeUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes hgScrollPulse {
  0%   { left: -100%; }
  100% { left: 100%; }
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr 34%; }
  .hg-content { padding: 48px 40px; }
  .hg-scroll { left: 40px; }
}

@media (max-width: 768px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hg-aside { display: none; }
  .hg-content {
    padding: 80px 28px 40px;
    align-items: center;
    text-align: center;
    justify-content: center;
  }
  .hg-ctas { justify-content: center; }
  .hg-scroll { left: 50%; transform: translateX(-50%); bottom: 24px; }
  .hg-title { font-size: clamp(2.2rem, 9vw, 3rem); }
  .hg-sub { font-size: .9rem; }
}
