/* Hero « showcase » — accueil + page Infra (2 colonnes + effets) */

/* Grille de fond : plein hero, sans voler une colonne (override .hero > * du effects) */
body.page-home .hero-grid,
body[data-page="infra"] .hero-grid {
  grid-column: 1 / -1;
  grid-row: 1;
  position: absolute !important;
  inset: 0;
  z-index: 0;
  align-self: stretch;
  min-height: 100%;
}

/* --- Desktop : texte col. gauche, carte col. droite (comme le HTML / avant inversion) --- */
@media (min-width: 960px) {
  body.page-home .hero,
  body[data-page="infra"] .hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
    gap: clamp(2rem, 5vw, 3.5rem);
    align-items: center;
  }

  body.page-home .hero-inner,
  body[data-page="infra"] .hero-inner {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    text-align: left;
    width: 100%;
    max-width: 32rem;
  }

  body.page-home .hero-card-wrap,
  body[data-page="infra"] .hero-card-wrap {
    grid-column: 2;
    grid-row: 1;
    justify-self: stretch;
    max-width: 440px;
    width: 100%;
  }
}

/* --- Colonne texte : un peu plus d’air --- */
body.page-home .hero-lead,
body[data-page="infra"] .hero-lead {
  max-width: 42ch;
}

/* --- Accueil : GMod + produits + typewriter --- */
body.page-home .hero-gmod-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.65rem;
  margin: 0 0 1.25rem;
  max-width: 36rem;
}

body.page-home .gmod-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.28);
  border-radius: 999px;
  transition: border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

body.page-home .gmod-pill:hover {
  color: var(--text);
  border-color: rgba(34, 211, 238, 0.35);
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.15);
}

body.page-home .gmod-pill-icon {
  color: var(--accent-2);
  font-size: 0.65rem;
}

body.page-home .hero-title-display {
  display: block;
}

body.page-home .typewriter-block {
  display: inline;
  white-space: nowrap;
}

body.page-home .typewriter-target {
  display: inline-block;
  min-width: 11.5ch;
  text-align: left;
  vertical-align: baseline;
}

body.page-home .typewriter-cursor {
  display: inline-block;
  width: 3px;
  height: 0.72em;
  margin-left: 1px;
  vertical-align: -0.05em;
  border-radius: 1px;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  animation: typewriter-cursor-blink 0.85s step-end infinite;
}

@keyframes typewriter-cursor-blink {
  0%,
  45% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

body.page-home .hero-price-hint {
  margin: -0.5rem 0 1.5rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

body.page-home .hero-price-hint a {
  color: var(--accent-2);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(34, 211, 238, 0.35);
}

body.page-home .hero-price-hint a:hover {
  color: var(--text);
  text-decoration-color: var(--accent-2);
}

body.page-home .hero-price-hint-muted {
  opacity: 0.75;
}

body.page-home .hero-stats .stat--accent {
  border-color: rgba(34, 211, 238, 0.22);
}

body.page-home .hero-stats .stat--accent a {
  color: var(--accent-2);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(34, 211, 238, 0.25);
  transition: color 0.2s ease, border-color 0.2s ease;
}

body.page-home .hero-stats .stat--accent a:hover {
  color: var(--text);
  border-bottom-color: var(--accent-2);
}

/* --- Halo autour de la carte terminal --- */
body.page-home .hero-card-wrap,
body[data-page="infra"] .hero-card-wrap {
  position: relative;
}

body.page-home .hero-card-wrap::after,
body[data-page="infra"] .hero-card-wrap::after {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: calc(var(--radius) + 14px);
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.15), rgba(124, 58, 237, 0.12), rgba(232, 121, 249, 0.1));
  opacity: 0.65;
  z-index: -1;
  filter: blur(12px);
  animation: hero-halo-breathe 5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes hero-halo-breathe {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.96);
  }
  50% {
    opacity: 0.85;
    transform: scale(1.03);
  }
}

/* Anneau / glow sur la carte (box-shadow uniquement, compatible tilt JS) */
body.page-home .hero-card,
body[data-page="infra"] .hero-card {
  position: relative;
  box-shadow: 0 0 0 1px rgba(167, 139, 250, 0.15), 0 24px 60px rgba(0, 0, 0, 0.35);
  animation: hero-card-edge 6s ease-in-out infinite;
}

@keyframes hero-card-edge {
  0%,
  100% {
    box-shadow: 0 0 0 1px rgba(167, 139, 250, 0.15), 0 24px 60px rgba(0, 0, 0, 0.35), 0 0 40px rgba(124, 58, 237, 0.08);
  }
  50% {
    box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.35), 0 28px 72px rgba(0, 0, 0, 0.4), 0 0 56px rgba(34, 211, 238, 0.12);
  }
}

/* --- Terminal : scanline --- */
body.page-home .hero .terminal,
body[data-page="infra"] .hero .terminal {
  position: relative;
  overflow: hidden;
}

body.page-home .hero .terminal::after,
body[data-page="infra"] .hero .terminal::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.12) 2px,
    rgba(0, 0, 0, 0.12) 4px
  );
  opacity: 0.25;
  animation: hero-terminal-scan 10s linear infinite;
}

@keyframes hero-terminal-scan {
  to {
    transform: translateY(8px);
  }
}

/* --- Stats accueil uniquement --- */
body.page-home .hero-stats .stat {
  animation: hero-stat-pulse 4.5s ease-in-out infinite;
}

body.page-home .hero-stats .stat:nth-child(1) {
  animation-delay: 0s;
}

body.page-home .hero-stats .stat:nth-child(2) {
  animation-delay: 0.35s;
}

body.page-home .hero-stats .stat:nth-child(3) {
  animation-delay: 0.7s;
}

@keyframes hero-stat-pulse {
  0%,
  100% {
    border-color: rgba(167, 139, 250, 0.22);
    box-shadow: none;
  }
  50% {
    border-color: rgba(34, 211, 238, 0.28);
    box-shadow: 0 0 24px rgba(124, 58, 237, 0.12);
  }
}

/* --- Titre : léger « respire » --- */
body.page-home .hero-title,
body[data-page="infra"] .hero-title {
  animation: hero-title-drift 8s ease-in-out infinite;
}

@keyframes hero-title-drift {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

/* --- Grille hero accueil : un peu plus lisible, masque centré comme la base --- */
body.page-home .hero-grid {
  opacity: 0.95;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 20%, transparent 70%);
}

@media (prefers-reduced-motion: reduce) {
  body.page-home .hero-card-wrap::after,
  body[data-page="infra"] .hero-card-wrap::after,
  body.page-home .hero-card,
  body[data-page="infra"] .hero-card,
  body.page-home .hero .terminal::after,
  body[data-page="infra"] .hero .terminal::after,
  body.page-home .hero-stats .stat,
  body.page-home .hero-title,
  body[data-page="infra"] .hero-title {
    animation: none !important;
  }

  body.page-home .hero-title,
  body[data-page="infra"] .hero-title {
    transform: none;
  }

  body.page-home .typewriter-cursor {
    animation: none;
    opacity: 0.85;
  }
}
