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

:root {
  --insa-red:      #E30613;
  --insa-red-dark: #A8000D;
  --insa-red-light:#FF6B6B;
  --insa-white:    #FFFFFF;
  --insa-off-white:#F7F7F7;
  --insa-black:    #1A1A1A;
  --insa-gray:     #4A4A4A;
  --insa-gray-light:#E8E8E8;
  --cell-height:   100vh;
  --header-h:      70px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--insa-white);
  color: var(--insa-black);
  overflow-x: hidden;
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-h);
  background: var(--insa-white);
  border-bottom: 3px solid var(--insa-red);
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-insa {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--insa-red);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.logo-sep {
  display: block;
  width: 2px;
  height: 28px;
  background: var(--insa-red);
  opacity: 0.35;
}

.logo-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--insa-gray);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.header-nav {
  display: flex;
  gap: 1.8rem;
}

.header-nav a {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--insa-gray);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: color 0.2s;
  position: relative;
}

.header-nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--insa-red);
  transition: width 0.25s ease;
}

.header-nav a:hover {
  color: var(--insa-red);
}

.header-nav a:hover::after {
  width: 100%;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  padding-top: var(--header-h);
  height: 100vh;
  background: var(--insa-red);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -120px;
  right: -120px;
  width: 500px;
  height: 500px;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -80px;
  left: -80px;
  width: 300px;
  height: 300px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
}

.hero-content {
  text-align: center;
  color: var(--insa-white);
  z-index: 2;
}

.hero-eyebrow {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.75;
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 300;
  line-height: 1.1;
  margin-bottom: 1.2rem;
}

.hero h1 strong {
  font-weight: 900;
  display: block;
}

.hero-sub {
  font-size: 1.1rem;
  opacity: 0.85;
  margin-bottom: 2.5rem;
  font-weight: 400;
}

.btn-hero {
  display: inline-block;
  padding: 0.9rem 2.5rem;
  border: 2px solid var(--insa-white);
  color: var(--insa-white);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: background 0.25s, color 0.25s;
}

.btn-hero:hover {
  background: var(--insa-white);
  color: var(--insa-red);
}

.hero-badge {
  position: absolute;
  bottom: 3rem;
  right: 4rem;
  width: 90px;
  height: 90px;
  border: 3px solid rgba(255,255,255,0.5);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--insa-white);
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============================================================
   DAMIER — STRUCTURE GÉNÉRALE
   ============================================================ */
.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: var(--cell-height);
  position: relative;
}

/* cellule texte */
.cell-text {
  position: relative;
  z-index: 10;
  background: var(--insa-white);
  display: flex;
  align-items: center;
  overflow: hidden;
}

/* cellule image — POSITION STICKY pour l'effet parallaxe/fixe */
.cell-image {
  position: sticky;
  top: 0;
  height: var(--cell-height);
  overflow: hidden;
}

/* fond image (position fixed simulé via sticky + background-attachment) */
.img-bg-r {
  position: absolute;
  inset: 0;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: right;
  background-attachment: fixed;
}

.img-bg-l {
  position: absolute;
  inset: 0;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: left;
  background-attachment: fixed;
}

/* Couleurs de substitution tant que les vraies images ne sont pas définies */
.img-bg-1 { background-image: url('fermat.png'); }
.img-bg-2 {background-image: url('insa.png'); }
.img-bg-3 { background-color: #16213e; background-image: linear-gradient(135deg, #16213e 0%, #0f3460 100%); }
.img-bg-4 { background-color: #E30613; background-image: linear-gradient(135deg, #A8000D 0%, #E30613 60%, #ff6b6b 100%); }
.img-bg-5 { background-color: #1a1a2e; background-image: linear-gradient(135deg, #0d0d0d 0%, #1a1a2e 100%); }
.img-bg-6 { background-color: #533483; background-image: linear-gradient(135deg, #533483 0%, #E30613 100%); }
.img-bg-7 { background-color: #A8000D; background-image: linear-gradient(135deg, #A8000D 0%, #1a1a2e 100%); }

/* Pour utiliser de vraies images, remplacez par :
   .img-bg-1 { background-image: url('images/photo1.jpg'); background-attachment: fixed; }
*/


.img-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 2rem;
  background: linear-gradient(to top, rgba(0,0,0,0.45) 0%, transparent 50%);
}

.img-overlay span {
  color: var(--insa-white);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  opacity: 0.8;
}

/* ============================================================
   CONTENU TEXTE DES CELLULES
   ============================================================ */
.cell-inner {
  padding: 4rem 5rem;
  max-width: 580px;
}

.cell-tag {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--insa-red);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-bottom: 1rem;
  position: relative;
  padding-left: 2rem;
}

.cell-tag::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1.4rem;
  height: 2px;
  background: var(--insa-red);
}

.cell-text h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800;
  color: var(--insa-black);
  line-height: 1.15;
  margin-bottom: 1.5rem;
}

.cell-text p {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--insa-gray);
  margin-bottom: 1rem;
}

.cell-text ul {
  list-style: none;
  padding: 0;
}

.cell-text ul li {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--insa-gray);
  padding: 0.35rem 0;
  padding-left: 1.2rem;
  position: relative;
}

.cell-text ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.75rem;
  width: 6px;
  height: 6px;
  background: var(--insa-red);
  border-radius: 50%;
}

/* ============================================================
   ACCENT LIGNE ROUGE sur cellules texte alternées
   ============================================================ */
.row-1 .cell-text,
.row-3 .cell-text,
.row-5 .cell-text,
.row-7 .cell-text {
  border-top: 4px solid var(--insa-red);
}

.row-2 .cell-text,
.row-4 .cell-text,
.row-6 .cell-text {
  border-top: 4px solid var(--insa-black);
}

/* ============================================================
   GRILLE COMPÉTENCES
   ============================================================ */
.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
}

.skill-item {
  background: var(--insa-off-white);
  padding: 1rem 1.2rem;
  border-left: 3px solid var(--insa-red);
}

.skill-item strong {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--insa-black);
  margin-bottom: 0.3rem;
}

.skill-item span {
  font-size: 0.88rem;
  color: var(--insa-gray);
}

/* ============================================================
   LISTE PROJETS
   ============================================================ */
.project-list {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.project-item {
  display: flex;
  gap: 1.2rem;
  align-items: flex-start;
}

.project-num {
  font-size: 2rem;
  font-weight: 900;
  color: var(--insa-red);
  opacity: 0.25;
  line-height: 1;
  flex-shrink: 0;
  min-width: 2.5rem;
}

.project-item strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--insa-black);
  margin-bottom: 0.3rem;
}

.project-item p {
  font-size: 0.88rem;
  color: var(--insa-gray);
  margin: 0;
}

/* ============================================================
   TIMELINE EXPÉRIENCES
   ============================================================ */
.timeline {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  border-left: 2px solid var(--insa-red);
  padding-left: 1.5rem;
}

.tl-item {
  position: relative;
}

.tl-item::before {
  content: '';
  position: absolute;
  left: -1.6rem;
  top: 0.5rem;
  width: 10px;
  height: 10px;
  background: var(--insa-red);
  border-radius: 50%;
}

.tl-date {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--insa-red);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.3rem;
}

.tl-item strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--insa-black);
  margin-bottom: 0.25rem;
}

.tl-item p {
  font-size: 0.88rem;
  color: var(--insa-gray);
  margin: 0;
}

/* ============================================================
   ENGAGEMENTS
   ============================================================ */
.engage-list {
  list-style: none;
  padding: 0;
  margin-top: 1rem;
}

.engage-list li {
  font-size: 0.95rem;
  color: var(--insa-gray);
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--insa-gray-light);
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.engage-list li::before {
  display: none;
}

.engage-icon {
  color: var(--insa-red);
  font-size: 0.5rem;
  flex-shrink: 0;
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact-block {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--insa-gray-light);
}

.contact-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--insa-red);
  min-width: 80px;
}

.contact-item a,
.contact-item span {
  font-size: 0.95rem;
  color: var(--insa-gray);
  text-decoration: none;
  transition: color 0.2s;
}

.contact-item a:hover {
  color: var(--insa-red);
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--insa-black);
  padding: 3rem 2rem;
  text-align: center;
}

.footer-inner {
  max-width: 800px;
  margin: 0 auto;
}

.footer-logo {
  display: block;
  font-size: 2rem;
  font-weight: 900;
  color: var(--insa-red);
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

.site-footer p {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.65);
  line-height: 1.7;
}

.footer-copy {
  font-size: 0.78rem !important;
  margin-top: 0.5rem;
  opacity: 0.4;
}

/* ============================================================
   RESPONSIVE (base)
   ============================================================ */
@media (max-width: 900px) {
  .header-nav {
    display: none;
  }

  .row {
    grid-template-columns: 1fr;
    height: auto;
  }

  .cell-image {
    position: relative;
    height: 55vw;
    min-height: 260px;
    top: auto;
  }

  .img-bg {
    background-attachment: scroll;
  }

  .cell-inner {
    padding: 3rem 2rem;
    max-width: 100%;
  }

  /* Rétablir l'ordre pour mobile : toujours texte en premier */
  .row-2 .cell-image,
  .row-4 .cell-image,
  .row-6 .cell-image {
    order: 2;
  }

  .row-2 .cell-text,
  .row-4 .cell-text,
  .row-6 .cell-text {
    order: 1;
  }
}
