/* ============================================================
   BASE.CSS — Fondations partagées par toutes les pages
   (portfolio + pages projets)
   Contient : variables de thème, reset, typographie, composants
   communs (boutons, tags, sections, barre de contact, halo/grille
   de fond des hero, révélation au scroll).
   ============================================================ */

:root{
  --bg: #090c11;
  --bg-soft: #0c1019;
  --surface: #11161f;
  --surface-2: #151b26;
  --border: #1f2733;
  --border-soft: #171e29;
  --text: #e8ecf3;
  --text-muted: #8b93a7;
  --text-faint: #545e72;

  /* ------------------------------------------------------------
     ACCENT PAR DÉFAUT (portfolio / bleu).
     Sur une page projet, ré-écris simplement ces 4 variables
     dans project.css (ou un fichier dédié) — voir le bloc en
     tête de project.css pour l'exemple.
     ------------------------------------------------------------ */
  --accent: #5b8cff;
  --accent-2: #7dd3fc;
  --accent-dim: #2a3f6e;
  --accent-glow: rgba(91,140,255,0.16);

  --radius: 6px;
  --maxw-text: 680px;
  --maxw-wide: 1040px;
}

*{ box-sizing: border-box; }

html{ scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *{ animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body{
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 76px; /* espace pour la barre de contact sticky */
}

h1, h2, h3{
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--text);
}

a{ color: inherit; }

::selection{ background: var(--accent-dim); color: var(--text); }

/* ---------- Eyebrow (petit label mono au-dessus des titres) ---------- */
.eyebrow{
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-2);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.eyebrow::before{
  content: "";
  width: 22px;
  height: 1px;
  background: var(--accent-2);
  opacity: 0.6;
}

/* ---------- Layout de base ---------- */
section{
  padding: 96px 24px;
  position: relative;
}
.wrap-text{ max-width: var(--maxw-text); margin: 0 auto; }
.wrap-wide{ max-width: var(--maxw-wide); margin: 0 auto; }

/* ---------- Révélation au scroll (voir script.js) ---------- */
.reveal{
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.in{
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Boutons ---------- */
.btn{
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.03em;
  text-decoration: none;
  padding: 11px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: inline-block;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.btn:hover{ border-color: var(--accent); color: var(--text); background: var(--surface); }
.btn.primary{
  border-color: var(--accent-dim);
  color: var(--text);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
}
.btn.primary:hover{ border-color: var(--accent); }

/* ---------- Tags (compétences, technos, filtres) ---------- */
.tag{
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 6px 11px;
  border-radius: 4px;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.tag:hover{ border-color: var(--accent-dim); color: var(--text); }

/* ---------- Fond animé des sections "hero" (grille + halo) ----------
   Utilisé par le hero du portfolio ET le hero des pages projets.
   Chaque page positionne .hero-bg / .hero-glow dans un conteneur
   avec position:relative + overflow:hidden. ---------------------- */
.hero-bg{
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(var(--border-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-soft) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.5;
}
.hero-glow{
  position: absolute;
  top: -18%;
  left: -10%;
  width: 65vw;
  height: 65vw;
  max-width: 780px;
  max-height: 780px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 68%);
  z-index: 0;
  animation: drift 22s ease-in-out infinite alternate;
}
@keyframes drift{
  from{ transform: translate(0, 0); }
  to{ transform: translate(4%, 6%); }
}

/* ---------- Footer ---------- */
footer{
  text-align: center;
  padding: 48px 24px 56px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-faint);
}

/* ---------- Barre de contact sticky ---------- */
.contact-bar{
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(9, 12, 17, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
}
.contact-bar-inner{
  max-width: var(--maxw-wide);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 16px;
  flex-wrap: wrap;
}
.contact-link{
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  color: var(--text-muted);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 5px;
  transition: color 0.2s ease, background 0.2s ease;
}
.contact-link svg{ width: 15px; height: 15px; flex-shrink: 0; opacity: 0.85; }
.contact-link:hover{ color: var(--text); background: var(--surface); }
.contact-link:hover svg{ opacity: 1; }
.contact-sep{
  width: 1px;
  height: 16px;
  background: var(--border);
  margin: 0 2px;
}

/* ---------- Responsive commun ---------- */
@media (max-width: 640px){
  section{ padding: 72px 20px; }
  .contact-link span.label{ display: none; }
  .contact-link{ padding: 9px 11px; }
  .contact-bar-inner{ gap: 2px; }
}
