/* =========================================
   FRACTUS DEMO — VERSION MATRIX 4.4 (Compacte + Responsive)
   Auteur : Marc Cedrych (Fractys)
   ========================================= */

/* ====== STRUCTURE DE BASE ====== */
.demo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 28px;
  padding: 40px;
  justify-items: center;
}

.demo-card {
  position: relative;
  background: rgba(10, 12, 14, 0.9);
  border: 1px solid rgba(127, 255, 212, 0.2);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 0 25px rgba(127, 255, 212, 0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.demo-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 30px rgba(127, 255, 212, 0.25);
}

/* ====== IMAGES ====== */
.demo-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  opacity: 0.9;
  display: block;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.demo-card:hover img {
  opacity: 0.5;
  transform: scale(1.04);
}

/* ====== OVERLAY TEXTE ====== */
.demo-overlay {
  position: absolute;
  inset: 0;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 20%, rgba(0, 0, 0, 0.1) 100%);
  color: #c8fff2;
  text-align: left;
  z-index: 2;
}

.demo-overlay h3 {
  margin: 0 0 4px;
  font-size: 1.1rem;
  color: #7fffd4;
}

.demo-overlay p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
  color: #bdfaea;
}

/* ====== BOUTONS ====== */
.btn.glow {
  margin-top: 30px;
  display: inline-block;
  padding: 12px 22px;
  border: 1px solid #7fffd4;
  border-radius: 8px;
  color: #7fffd4;
  text-decoration: none;
  background: rgba(0, 255, 200, 0.05);
  box-shadow: 0 0 15px rgba(127, 255, 212, 0.15);
  transition: all 0.3s ease;
}

.btn.glow:hover {
  background: #7fffd4;
  color: #000;
  box-shadow: 0 0 25px rgba(127, 255, 212, 0.55);
}

/* ====== RESPONSIVE DE BASE ====== */
@media (max-width: 700px) {
  .demo-grid { padding: 20px; gap: 18px; }
  .demo-card img { height: 180px; }
}

/* =========================================
   LAB STYLES — BENCHMARKS & ENGINE VISUALS
   ========================================= */

.lab-section { padding: 40px 0 0; }

.lab-title {
  color: #7fffd4;
  font-size: 1.25rem;
  margin: 4px 0 18px;
  text-align: center;
  letter-spacing: 0.3px;
}

.lab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.lab-card {
  background: rgba(10, 15, 15, 0.9);
  border: 1px solid rgba(127,255,212,0.14);
  border-radius: 12px;
  padding: 14px 14px 12px;
  box-shadow: 0 0 14px rgba(127,255,212,0.08);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.lab-card:hover {
  border-color: rgba(127,255,212,0.25);
  box-shadow: 0 0 25px rgba(127,255,212,0.12);
}

.lab-card h4 {
  margin: 0 0 8px;
  color: #bfffea;
  font-weight: 600;
}

.lab-meta {
  font-size: 0.86rem;
  color: #9adfce;
  opacity: 0.95;
  margin-bottom: 10px;
}

.lab-canvas {
  width: 100%;
  min-height: 160px;
  height: 160px !important;
  display: block;
  border-radius: 8px;
  background: #0b0f10;
  border: 1px solid rgba(127,255,212,0.12);
}

/* =========================================
   FRACTUS ENGINE — MATRIX COMPACTE + RESPONSIVE
   ========================================= */

.fractus-lab-center {
  padding: 20px 0 40px;
  text-align: center;
}

/* --- Grille adaptée à ton DOM actuel --- */
.fractus-grid-core {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: auto auto auto;
  grid-template-areas:
    "error entropy"
    "stability eff"
    "center center";
  gap: 24px 32px;
  align-items: start;
  justify-items: center;
  max-width: 1000px;
  margin: 0 auto;
  padding: 10px 0 40px;
  position: relative;
}

/* Zones */
#card-error     { grid-area: error; }
#card-entropy   { grid-area: entropy; }
#card-stability { grid-area: stability; }
#card-eff       { grid-area: eff; }
.engine-core    { grid-area: center; }

/* --- Centre fractal (roue réduite) --- */
.engine-core {
  background: radial-gradient(circle at center, rgba(0,255,200,0.06), rgba(0,0,0,1) 85%);
  border-radius: 20px;
  box-shadow: 0 0 25px rgba(127,255,212,0.12);
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 400px;
  margin-top: -6px;
  transition: all 0.3s ease;
}

.engine-core canvas {
  width: 100%;
  max-width: 360px;
  height: 220px;
  border-radius: 12px;
  border: 1px solid rgba(127,255,212,0.18);
}

/* --- Halo respirant doux --- */
.engine-core::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 22px;
  background: radial-gradient(circle at 50% 50%, rgba(127,255,212,0.05), transparent 80%);
  animation: pulse-halo 6s ease-in-out infinite;
  z-index: 0;
}

@keyframes pulse-halo {
  0%,100% { opacity: .4; transform: scale(1); }
  50% { opacity: 0.9; transform: scale(1.03); }
}

/* =========================================
   RESPONSIVE SPÉCIAL — TABLETTES & GRAND ÉCRAN
   ========================================= */

/* -- TABLETTES (≥ 768px) : ajustement des espacements -- */
@media (min-width: 768px) and (max-width: 1200px) {
  .fractus-grid-core {
    gap: 20px 28px;
    max-width: 850px;
  }

  .engine-core {
    max-width: 360px;
  }

  .engine-core canvas {
    max-width: 320px;
    height: 200px;
  }
}

/* -- GRAND ÉCRAN (≥ 1400px) : on redonne de l’espace à la roue -- */
@media (min-width: 1400px) {
  .fractus-grid-core {
    gap: 30px 40px;
    max-width: 1200px;
  }

  .engine-core {
    max-width: 480px;
    margin-top: 0;
  }

  .engine-core canvas {
    max-width: 440px;
    height: 260px;
  }
}

/* -- PETIT ÉCRAN / MOBILE -- */
@media (max-width: 700px) {
  .fractus-grid-core {
    grid-template-columns: 1fr;
    grid-template-areas:
      "error"
      "entropy"
      "stability"
      "eff"
      "center";
    gap: 22px;
    padding: 20px;
  }

  .engine-core {
    max-width: 100%;
    margin-top: 0;
  }

  .engine-core canvas {
    max-width: 100%;
    height: 200px;
  }
}

/* =========================================
   FOOTER / GÉNÉRAL
   ========================================= */
footer {
  margin-top: 28px;
  color: #9fffe0;
  text-align: center;
  padding-bottom: 20px;
}
/* ============================
   RESPONSIVE FIX — sample-viewer
   ============================ */

@media (max-width: 800px) {
  .sample-viewer {
    grid-template-columns: 1fr; /* photo au-dessus, texte en dessous */
    gap: 16px;
    padding: 14px;
  }

  .sample-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .badge span {
    max-width: 100%; /* nom de fichier complet visible sur mobile */
  }

  .sample-thumb, .thumb-fallback {
    aspect-ratio: 16/9;
    max-height: 220px;
  }

  .sample-meta div {
    width: 100%;
  }
}

