/* =========================================================================
   PROJET.CSS — Style partagé des pages de détail (stages & projets)
   Chargé par : conventio.html, gsb.html, stage1.html, stage2.html
   ========================================================================= */

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Courier New', monospace;
  background: #05050a;
  color: #e0e0ff;
  line-height: 1.7;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* ===== Fond animé ===== */

/* Grille cyberpunk qui pan lentement */
body::before {
  content: '';
  position: fixed;
  inset: -40px;
  background-image:
    linear-gradient(rgba(0, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 90%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 90%);
  pointer-events: none;
  z-index: 0;
  animation: gridPan 30s linear infinite;
}

@keyframes gridPan {
  from { transform: translate(0, 0); }
  to   { transform: translate(40px, 40px); }
}

/* Scanlines subtiles */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 255, 255, 0.03) 2px,
    rgba(0, 255, 255, 0.03) 4px
  );
  pointer-events: none;
  z-index: 1;
  animation: scanlines 8s linear infinite;
}

@keyframes scanlines {
  from { background-position: 0 0; }
  to   { background-position: 0 100px; }
}

/* Canvas pour les particules (rempli par projet.js) */
#particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* ===== Topbar ===== */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(5, 5, 10, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 255, 255, 0.3);
  padding: 1rem 1.5rem;
}

.back-link {
  color: #00ffff;
  text-decoration: none;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  transition: all 0.2s;
  position: relative;
}

.back-link::before {
  content: '';
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 0;
  height: 1px;
  background: #00ffff;
  box-shadow: 0 0 8px #00ffff;
  transition: width 0.3s ease;
}

.back-link:hover {
  text-shadow: 0 0 10px #00ffff;
}

.back-link:hover::before {
  width: 100%;
}

/* ===== Conteneur ===== */

.page {
  position: relative;
  z-index: 2;
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

/* ===== HERO ===== */

.hero {
  text-align: center;
  padding: 3rem 0 4rem;
  border-bottom: 1px solid rgba(0, 255, 255, 0.2);
  margin-bottom: 3rem;
  position: relative;
}

.hero-label {
  color: #00ffaa;
  font-size: 0.85rem;
  letter-spacing: 0.3em;
  margin-bottom: 1rem;
  opacity: 0;
  animation: fadeInUp 0.6s 0.1s forwards;
}

.hero-title {
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  color: #00ffff;
  text-shadow:
    0 0 10px #00ffff,
    0 0 30px rgba(0, 255, 255, 0.5);
  letter-spacing: 0.05em;
  line-height: 1.1;
  margin-bottom: 1rem;
  position: relative;
  display: inline-block;
  opacity: 0;
  animation:
    fadeInUp 0.7s 0.25s forwards,
    glitch 5s 1.2s infinite;
}

/* Glitch — duplications décalées cyan/magenta */
.hero-title::before,
.hero-title::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
}

.hero-title::before {
  color: #ff00ff;
  animation: glitchA 5s 1.2s infinite;
}

.hero-title::after {
  color: #00ffaa;
  animation: glitchB 5s 1.2s infinite;
}

@keyframes glitch {
  0%, 93%, 100%  { transform: translate(0, 0); }
  94%            { transform: translate(-2px, 1px); }
  95%            { transform: translate(2px, -1px); }
  96%            { transform: translate(-1px, -1px); }
  97%            { transform: translate(1px, 2px); }
}

@keyframes glitchA {
  0%, 92%, 100% { opacity: 0; transform: translate(0, 0); }
  94%           { opacity: 0.8; transform: translate(-3px, 0); }
  96%           { opacity: 0.8; transform: translate(3px, 0); }
}

@keyframes glitchB {
  0%, 92%, 100% { opacity: 0; transform: translate(0, 0); }
  95%           { opacity: 0.6; transform: translate(2px, -1px); }
  97%           { opacity: 0.6; transform: translate(-2px, 1px); }
}

.hero-tagline {
  color: #ff00ff;
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  text-shadow: 0 0 8px rgba(255, 0, 255, 0.5);
  margin-bottom: 2rem;
  min-height: 1.5em;
}

.hero-tagline::after {
  content: '▌';
  color: #00ffff;
  animation: blink 1s steps(2) infinite;
  margin-left: 2px;
}

.hero-tagline.typing-done::after {
  opacity: 0.4;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* ===== Grille de logos tech ===== */

.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.9rem;
  margin-top: 1.5rem;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.tech-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 1rem 0.6rem;
  border: 1px solid rgba(0, 255, 255, 0.3);
  background: rgba(0, 255, 255, 0.03);
  border-radius: 6px;
  color: #00ffff;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  text-align: center;
  text-decoration: none;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.tech-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(0, 255, 255, 0.15) 50%, transparent 60%);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.tech-card:hover::before {
  transform: translateX(100%);
}

.tech-card:hover {
  border-color: #00ffff;
  background: rgba(0, 255, 255, 0.08);
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(0, 255, 255, 0.25);
}

.tech-card.magenta {
  border-color: rgba(255, 0, 255, 0.3);
  background: rgba(255, 0, 255, 0.03);
  color: #ff00ff;
}

.tech-card.magenta:hover {
  border-color: #ff00ff;
  background: rgba(255, 0, 255, 0.08);
  box-shadow: 0 6px 20px rgba(255, 0, 255, 0.25);
}

.tech-icon {
  width: 40px;
  height: 40px;
  filter: drop-shadow(0 0 6px currentColor);
  transition: transform 0.25s ease;
}

.tech-card:hover .tech-icon {
  transform: scale(1.15) rotate(-3deg);
}

.tech-name {
  font-weight: bold;
}

/* ===== Blocks (sections) ===== */

section.block {
  margin-bottom: 2.5rem;
  padding: 2rem;
  background: rgba(10, 10, 30, 0.55);
  border: 1px solid rgba(0, 255, 255, 0.2);
  border-radius: 8px;
  backdrop-filter: blur(4px);
  position: relative;
  overflow: hidden;
}

/* Coin néon en haut à gauche */
section.block::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 30px;
  height: 30px;
  border-top: 2px solid #00ffff;
  border-left: 2px solid #00ffff;
  box-shadow: -2px -2px 8px rgba(0, 255, 255, 0.3);
}

/* Coin néon en bas à droite */
section.block::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 30px;
  height: 30px;
  border-bottom: 2px solid #ff00ff;
  border-right: 2px solid #ff00ff;
  box-shadow: 2px 2px 8px rgba(255, 0, 255, 0.3);
}

section.block h2 {
  color: #00ffff;
  font-size: 1.4rem;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(0, 255, 255, 0.25);
  text-shadow: 0 0 6px rgba(0, 255, 255, 0.4);
  position: relative;
}

/* Préfixe ">" qui clignote sur les h2 */
section.block h2::before {
  content: '> ';
  color: #00ffaa;
  animation: blink 1.5s steps(2) infinite;
}

section.block h3 {
  color: #ff00ff;
  font-size: 1.1rem;
  margin: 1.2rem 0 0.6rem;
  letter-spacing: 0.03em;
}

section.block p {
  margin-bottom: 0.9rem;
  color: #cfcfe6;
}

section.block strong {
  color: #00ffaa;
  font-weight: normal;
}

section.block em {
  color: #ff88ff;
  font-style: normal;
}

section.block code {
  background: rgba(0, 255, 255, 0.08);
  border: 1px solid rgba(0, 255, 255, 0.2);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-size: 0.9em;
  color: #00ffff;
}

section.block ul {
  margin: 0.5rem 0 1rem 1.3rem;
  color: #cfcfe6;
}

section.block ul li {
  margin-bottom: 0.4rem;
}

section.block ul li::marker {
  color: #00ffaa;
}

/* ===== Cards génériques utilisées par les pages ===== */
/* Conventio: .integrations / .integration-card
   Stage1:    .features / .feature-card
   GSB:       .architecture / .arch-card + .status
   Stage2:    .module                                                 */

.integrations,
.features,
.architecture {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.integration-card,
.feature-card,
.arch-card {
  padding: 1.2rem;
  border: 1px solid rgba(255, 0, 255, 0.3);
  background: rgba(255, 0, 255, 0.04);
  border-radius: 6px;
  transition: all 0.25s ease;
}

.integration-card:hover,
.feature-card:hover,
.arch-card:hover {
  border-color: #ff00ff;
  background: rgba(255, 0, 255, 0.08);
  transform: translateY(-3px);
  box-shadow: 0 4px 16px rgba(255, 0, 255, 0.2);
}

.integration-card h3,
.feature-card h3,
.arch-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  color: #ff00ff;
}

.integration-card p,
.feature-card p,
.arch-card p {
  font-size: 0.9rem;
  margin: 0 0 0.5rem;
  color: #cfcfe6;
}

/* Module = variante (stage2) sans grid, blocs verticaux */
.module {
  margin: 1.5rem 0;
  padding: 1.2rem;
  border-left: 3px solid #ff00ff;
  background: rgba(255, 0, 255, 0.03);
  transition: all 0.25s ease;
}

.module:hover {
  background: rgba(255, 0, 255, 0.06);
  border-left-color: #00ffff;
  border-left-width: 5px;
}

/* Status pills (GSB) */
.status {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 3px;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  margin-left: 0.5rem;
}

.status.done {
  background: rgba(0, 255, 170, 0.15);
  border: 1px solid #00ffaa;
  color: #00ffaa;
}

.status.todo {
  background: rgba(255, 0, 255, 0.12);
  border: 1px solid #ff00ff;
  color: #ff00ff;
}

/* ===== Screenshots placeholder ===== */

.screenshots-note {
  text-align: center;
  color: #888;
  font-style: italic;
  padding: 1.5rem;
  border: 1px dashed rgba(0, 255, 255, 0.25);
  border-radius: 6px;
}

/* ===== Screenshots gallery ===== */

.screenshots-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 1.2rem;
}

.screenshot-item {
  cursor: zoom-in;
  border: 1px solid rgba(0, 255, 255, 0.25);
  background: rgba(0, 255, 255, 0.03);
  border-radius: 6px;
  overflow: hidden;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
}

.screenshot-item:hover {
  border-color: #00ffff;
  box-shadow: 0 4px 18px rgba(0, 255, 255, 0.3);
  transform: translateY(-3px);
}

.screenshot-item img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top;
  display: block;
  background: #0a0a14;
}

.screenshot-item figcaption {
  padding: 0.6rem 0.8rem;
  font-size: 0.82rem;
  color: #a0a0c0;
  border-top: 1px solid rgba(0, 255, 255, 0.15);
  font-family: 'Courier New', monospace;
}

/* Lightbox */

.lightbox {
  border: none;
  padding: 0;
  background: rgba(5, 5, 10, 0.92);
  max-width: 95vw;
  max-height: 95vh;
  width: 95vw;
  height: 95vh;
  color: #fff;
  font-family: inherit;
}

.lightbox::backdrop {
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(6px);
}

.lightbox-inner {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  position: relative;
}

.lightbox img {
  flex: 1;
  min-height: 0;
  object-fit: contain;
  background: #05050a;
  width: 100%;
}

.lightbox-caption {
  padding: 0.8rem 1rem;
  text-align: center;
  font-size: 0.9rem;
  color: #00ffff;
  letter-spacing: 0.05em;
  border-top: 1px solid rgba(0, 255, 255, 0.3);
  background: rgba(0, 255, 255, 0.05);
}

.lightbox-close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 40px;
  height: 40px;
  border: 1px solid #ff00ff;
  background: rgba(5, 5, 10, 0.85);
  color: #ff00ff;
  font-size: 1.3rem;
  font-family: inherit;
  cursor: pointer;
  border-radius: 4px;
  z-index: 2;
  transition: all 0.2s;
}

.lightbox-close:hover {
  background: #ff00ff;
  color: #05050a;
  box-shadow: 0 0 16px rgba(255, 0, 255, 0.6);
}

/* ===== Live site CTA ===== */

.live-site-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2rem 1.5rem;
  border: 1px solid rgba(0, 255, 170, 0.35);
  background: linear-gradient(135deg, rgba(0, 255, 170, 0.06), rgba(0, 255, 255, 0.04));
  border-radius: 6px;
  text-align: center;
  margin-top: 1.2rem;
}

.live-site-cta p {
  margin: 0;
  color: #cfcfe6;
  font-size: 0.95rem;
}

.live-site-cta .btn.live {
  border-color: #00ffaa;
  color: #00ffaa;
  font-weight: bold;
}

.live-site-cta .btn.live::before {
  background: linear-gradient(90deg, transparent, rgba(0, 255, 170, 0.4), transparent);
}

.live-site-cta .btn.live:hover {
  background: #00ffaa;
  color: #05050a;
  box-shadow: 0 0 22px rgba(0, 255, 170, 0.6);
}

/* ===== CTA ===== */

.cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(0, 255, 255, 0.2);
}

.btn {
  display: inline-block;
  padding: 0.85rem 1.6rem;
  background: transparent;
  border: 1px solid #00ffff;
  color: #00ffff;
  text-decoration: none;
  font-family: inherit;
  font-size: 1rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.2s;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(0, 255, 255, 0.4), transparent);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}

.btn:hover::before {
  transform: translateX(100%);
}

.btn:hover {
  background: #00ffff;
  color: #05050a;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.6);
}

.btn.magenta {
  border-color: #ff00ff;
  color: #ff00ff;
}

.btn.magenta::before {
  background: linear-gradient(90deg, transparent, rgba(255, 0, 255, 0.4), transparent);
}

.btn.magenta:hover {
  background: #ff00ff;
  color: #05050a;
  box-shadow: 0 0 20px rgba(255, 0, 255, 0.6);
}

/* ===== Scroll reveal ===== */

.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Délais pour les éléments du hero (fade in sans observer) */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== Responsive ===== */

@media (max-width: 600px) {
  .page { padding: 2rem 1rem 3rem; }
  section.block { padding: 1.2rem; }
  .hero { padding: 2rem 0 2.5rem; }
  .tech-grid { grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 0.6rem; }
  .tech-card { padding: 0.8rem 0.4rem; font-size: 0.75rem; }
  .tech-icon { width: 32px; height: 32px; }
}

/* Respect du prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  body::before, body::after,
  .hero-title, .hero-title::before, .hero-title::after,
  .hero-tagline::after,
  section.block h2::before,
  .reveal {
    animation: none !important;
    transition: none !important;
  }
  .reveal { opacity: 1; transform: none; }
  #particles { display: none; }
}
