/* ═══════════════════════════════════════════════
   CHIP-BG.CSS — sfondo della home "Il chip che si apre" (solo index.html)
   ═══════════════════════════════════════════════ */
/* il chip è la firma del finale: prima schermata e sezioni sono opache (niente scritta dietro
   ai testi), il chip si vede solo dietro la chiamata finale (.core-cta) e il footer.
   Le pagine interne non caricano più lo sfondo 3D (dal 22/10/2026). */
:root { --page-bg: var(--navy); }

.chip-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: #0e1126;
  overflow: hidden;
}
.chip-bg canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 1;
}

/* bagliore agganciato al nucleo (posizione da track.json), respira anche da fermo */
.chip-core-glow {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  opacity: 0;
  will-change: transform, opacity;
}
.chip-core-glow::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(140, 225, 255, .55) 0%, rgba(var(--accent-rgb), .22) 30%, rgba(123, 47, 255, .12) 52%, transparent 70%);
  mix-blend-mode: screen;
  animation: core-breath 4.2s ease-in-out 3;   /* tre respiri, poi fermo */
}
@keyframes core-breath {
  0%, 100% { transform: scale(.88); opacity: .55; }
  50%      { transform: scale(1.08); opacity: 1; }
}

/* velo per la leggibilità: più scuro a sinistra (testi), il chip a destra respira */
.chip-bg-veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, rgba(var(--navy-rgb), .72) 0%, rgba(var(--navy-rgb), .38) 45%, rgba(var(--navy-rgb), .12) 75%),
    linear-gradient(to bottom, rgba(var(--navy-rgb), .35), rgba(var(--navy-rgb), .1) 40%, rgba(var(--navy-rgb), .4));
}
@media (max-aspect-ratio: 1/1) {
  .chip-bg-veil {
    background:
      radial-gradient(ellipse at 50% 45%, rgba(var(--navy-rgb), .2) 0%, rgba(var(--navy-rgb), .6) 75%),
      linear-gradient(to bottom, rgba(var(--navy-rgb), .45), rgba(var(--navy-rgb), .2) 40%, rgba(var(--navy-rgb), .55));
  }
}

/* la chiamata finale sta sopra il nucleo luminoso: ombra scura (con scostamento) che stacca il testo */
.core-cta { text-shadow: 0 2px 10px rgba(var(--navy-rgb), .9); }

.hero { background: var(--navy); }

/* footer sopra il chip aperto: semitrasparente solo in home */
.site-footer { background: linear-gradient(to bottom, rgba(var(--navy-rgb), .55), rgba(var(--navy-rgb), .92)); }

/* ── CTA finale sul nucleo aperto ── */
.core-cta {
  position: relative;
  z-index: 10;
  min-height: 92vh;
  display: flex;
  align-items: center;
  padding: 6rem clamp(1.25rem, 5vw, 4rem);
}
.core-cta-inner {
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
}
.core-cta-title {
  font-family: var(--fd);
  font-size: clamp(2.2rem, 4.6vw, 3.8rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.02em;
  max-width: 14ch;
  margin: 1rem 0 1.4rem;
  text-shadow: 0 2px 28px rgba(2, 3, 10, .85);
}
.core-cta-title em { font-style: normal; color: var(--accent); }
.core-cta-desc {
  font-size: 1.02rem;
  color: var(--t2);
  line-height: 1.7;
  max-width: 420px;
  margin: 0 0 2.2rem;
}
@media (max-aspect-ratio: 1/1) {
  .core-cta { align-items: flex-end; min-height: 100vh; }
  .core-cta-title, .core-cta-desc { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  .chip-core-glow::before { animation: none; opacity: .8; }
}
