/* ========================================
   VARIABLES
======================================== */
:root {
  --bg-primary: #050505;
  --bg-secondary: rgba(10, 10, 10, 0.88);
  --bg-card: #111111;

  --text-primary: #f5f5f5;
  --text-secondary: #9a9a9a;

  --accent: #c41e3a;
  --accent-dark: #8b1428;

  --border: #242424;

  --shadow: 0 20px 40px rgba(0, 0, 0, 0.5);

  --radius: 18px;

  --transition: 0.3s ease;
}

/* ========================================
   RESET
======================================== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ========================================
   GLOBAL
======================================== */
html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", sans-serif;

  background-color: var(--bg-primary);

  color: var(--text-primary);

  min-height: 100vh;

  line-height: 1.6;

  overflow-x: hidden;

  position: relative;
}

/* ========================================
   BACKGROUND PATTERN
======================================== */
body::before {
  content: "";

  position: fixed;

  inset: -50%;

  z-index: -2;

  background:
    /* Gradient rouge subtil en haut à gauche */
    radial-gradient(ellipse 80% 50% at 10% 10%,
      rgba(196, 30, 58, 0.15),
      transparent 50%),
    /* Gradient rouge foncé en bas à droite */
    radial-gradient(ellipse 60% 40% at 90% 90%,
      rgba(139, 20, 40, 0.12),
      transparent 50%),
    /* Gradient rouge au centre */
    radial-gradient(circle at 50% 50%,
      rgba(196, 30, 58, 0.05),
      transparent 40%),
    /* Lueur rouge subtile en haut */
    radial-gradient(ellipse 100% 30% at 50% 0%,
      rgba(80, 0, 20, 0.2),
      transparent 60%);
}

/* GRID PATTERN + MOTIFS */
body::after {
  content: "";

  position: fixed;

  inset: 0;

  z-index: -1;

  background-color: rgba(10, 10, 10, 0.3);

  background-image:
    /* Diagonales rouge */
    repeating-linear-gradient(45deg,
      transparent,
      transparent 60px,
      rgba(196, 30, 58, 0.2) 60px,
      rgba(196, 30, 58, 0.2) 62px),
    repeating-linear-gradient(-45deg,
      transparent,
      transparent 60px,
      rgba(100, 0, 20, 0.15) 60px,
      rgba(100, 0, 20, 0.15) 62px),
    /* Grille fine */
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);

  background-size:
    88px 88px,
    88px 88px,
    40px 40px;

  background-position:
    0 0,
    0 0,
    0 0;
}

/* ========================================
   HEADER
======================================== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;

  background: var(--bg-secondary);

  backdrop-filter: blur(12px);

  border-bottom: 2px solid var(--accent);

  border-radius: 0 0 16px 16px;

  margin-left: 1rem;
  margin-right: 1rem;

  padding: 1.8rem 0;
}

.header-content {
  max-width: 1200px;

  margin: auto;

  padding: 0 2rem;

  display: flex;

  justify-content: space-between;

  align-items: center;

  gap: 2rem;

  flex-wrap: wrap;
}

/* ========================================
   PROFILE
======================================== */
.profile {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.avatar {
  width: 62px;
  height: 62px;

  border-radius: 50%;

  background: linear-gradient(135deg, var(--accent), var(--accent-dark));

  display: flex;
  justify-content: center;
  align-items: center;

  font-weight: 700;
  font-size: 1.1rem;

  box-shadow: 0 0 25px rgba(196, 30, 58, 0.35);
}

.info h1 {
  font-size: 1.45rem;
  font-weight: 600;
}

.role {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ========================================
   CONTACT
======================================== */
.contact {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;

  color: var(--text-secondary);

  text-decoration: none;

  transition:
    color 0.3s ease,
    transform 0.3s ease;
}

.contact-link:hover {
  color: var(--accent);
  transform: translateY(-2px);
}

/* ========================================
   MAIN
======================================== */
.main {
  max-width: 1200px;

  margin: auto;

  padding: 4rem 2rem;
}

.section-title {
  position: relative;

  padding-left: 1rem;

  margin-bottom: 2.5rem;

  font-size: 1rem;

  text-transform: uppercase;

  letter-spacing: 0.2em;

  color: var(--text-secondary);
}

.section-title::before {
  content: "";

  position: absolute;

  left: 0;
  top: 0;

  width: 4px;
  height: 100%;

  background: var(--accent);

  border-radius: 5px;
}

/* ========================================
   GRID
======================================== */
.projects-grid {
  display: grid;

  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));

  gap: 1.7rem;
}

/* ================ ========================
   PROJECT CARD
======================================== */
.project-card {
  position: relative;

  height: 300px;

  border-radius: var(--radius);

  overflow: hidden;

  text-decoration: none;

  color: white;

  background-color: var(--bg-card);

  background-size: 120px;
  background-repeat: no-repeat;
  background-position: center 20px;

  border: 1px solid red;

  display: flex;

  align-items: flex-end;

  opacity: 0;

  transform: translateY(40px);

  transition:
    opacity 0.6s ease, § transform 0.35s ease,
    box-shadow 0.35s ease;

  transform-style: preserve-3d;

  will-change: transform;

  box-shadow: var(--shadow);
}

.project-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.project-card:hover {
  box-shadow:
    0 25px 50px rgba(0, 0, 0, 0.65),
    0 0 35px rgba(196, 30, 58, 0.18);
}

/* DARK OVERLAY */
.card-overlay {
  position: absolute;

  inset: 0;

  background: linear-gradient(to top,
      rgba(0, 0, 0, 0.97) 0%,
      rgba(0, 0, 0, 0.55) 45%,
      rgba(0, 0, 0, 0.08) 100%);

  transition: 0.3s ease;
}

/* FAVICON PATTERN */
.card-overlay::before {
  content: "";

  position: absolute;
  inset: 0;

  background-image: url("favicon.png");

  /* ↓ PLUS PETIT */
  background-size: 40px;

  /* ↓ PLUS D’AIR ENTRE LES ICÔNES */
  background-repeat: no-repeat;

  background-position: center;

  opacity: 0.04;

  mix-blend-mode: screen;
}

.project-card:hover .card-overlay {
  background: linear-gradient(to top,
      rgba(0, 0, 0, 0.99) 0%,
      rgba(0, 0, 0, 0.4) 45%,
      rgba(0, 0, 0, 0.02) 100%);
}

.card-content {
  position: relative;

  z-index: 2;

  padding: 1.7rem;
}

.card-tag {
  display: inline-block;

  margin-bottom: 0.9rem;

  padding: 0.35rem 0.8rem;

  border-radius: 6px;

  background: linear-gradient(135deg, var(--accent), var(--accent-dark));

  font-size: 0.72rem;

  font-weight: 700;

  letter-spacing: 0.12em;

  text-transform: uppercase;
}

.card-title {
  font-size: 1.35rem;

  font-weight: 600;

  margin-bottom: 0.55rem;
}

.card-description {
  color: #d2d2d2;

  font-size: 0.92rem;
}

/* ========================================
   FOOTER
======================================== */
.footer {
  text-align: center;

  padding: 2rem;

  border-top: 1px solid var(--border);

  color: var(--text-secondary);

  font-size: 0.85rem;

  margin-top: 4rem;
}

/* ========================================
   RESPONSIVE
======================================== */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    text-align: center;
  }

  .profile {
    flex-direction: column;
  }

  .contact {
    justify-content: center;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .project-card {
    height: 250px;
  }
}