/* ============================================
Portfolio Antoine Passier — GEII / FPGA
Design : corporate bleu/blanc, signature "trace de circuit" + Glassmorphism
============================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --navy: #0A2647;
  --blue: #144272;
  --cyan: #00B4D8;
  --cyan-dim: rgba(0, 180, 216, 0.12);
  --white: #FFFFFF;
  --grey-light: #F7F9FC;
  --grey-line: #E2E8F0;
  --text: #10243E;
  --text-muted: #5A6B85;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --max-width: 1140px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background: transparent;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; border-radius: 6px; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 32px; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--navy);
  letter-spacing: -0.02em;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
  font-weight: 500;
}

.text-muted { color: var(--text-muted); }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
}
.nav { display: flex; align-items: center; justify-content: space-between; padding: 18px 32px; max-width: var(--max-width); margin: 0 auto; }
.nav-logo { font-family: var(--font-mono); font-weight: 500; font-size: 1rem; color: var(--navy); display: flex; align-items: center; gap: 8px; }
.nav-logo .dot { width: 7px; height: 7px; background: var(--cyan); border-radius: 50%; display: inline-block; box-shadow: 0 0 0 3px var(--cyan-dim); }
.nav-links { display: flex; gap: 30px; list-style: none; }
.nav-links a { font-size: 0.9rem; font-weight: 500; color: var(--text-muted); position: relative; padding: 4px 0; transition: color 0.2s ease; white-space: nowrap; }
.nav-links a:hover, .nav-links a.active { color: var(--navy); }
.nav-links a.active::after { content: ''; position: absolute; bottom: -2px; left: 0; width: 100%; height: 2px; background: var(--cyan); }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 4px; }
.nav-toggle span { width: 22px; height: 2px; background: var(--navy); }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 100px 0 90px; overflow: hidden; background: transparent; }
.hero .container { position: relative; z-index: 2; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(2.2rem, 4vw, 3.4rem); line-height: 1.08; margin: 18px 0 20px; }
.hero h1 .highlight { color: var(--cyan); }
.hero p.lede { font-size: 1.1rem; color: var(--text-muted); max-width: 46ch; margin-bottom: 32px; }
.hero-cta { display: flex; gap: 16px; flex-wrap: wrap; }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 13px 26px; border-radius: 4px; font-weight: 600; font-size: 0.95rem; font-family: var(--font-body); border: 1.5px solid transparent; cursor: pointer; transition: all 0.2s ease; }
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--blue); }
.btn-outline { border-color: var(--navy); color: var(--navy); background: transparent; }
.btn-outline:hover { border-color: var(--cyan); color: var(--cyan); }

.circuit-wrap { position: relative; aspect-ratio: 1 / 1; }
.circuit-svg path.trace { fill: none; stroke: var(--blue); stroke-width: 1.4; stroke-linecap: round; stroke-dasharray: 400; stroke-dashoffset: 400; animation: draw 2.2s ease forwards; }
.circuit-svg path.trace.cyan { stroke: var(--cyan); }
.circuit-svg circle.via { fill: var(--navy); opacity: 0; animation: fadein 0.4s ease forwards; }
.circuit-svg circle.via.cyan { fill: var(--cyan); }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fadein { to { opacity: 1; } }

.circuit-divider { width: 100%; height: 40px; display: block; }
.circuit-divider path { fill: none; stroke: rgba(10, 38, 71, 0.1); stroke-width: 1.5; }
.circuit-divider circle { fill: var(--cyan); }

.section { padding: 88px 0; }
.section-alt { background: transparent; }
.section-head { max-width: 640px; margin-bottom: 52px; }
.section-head h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); margin-top: 10px; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }

.card, .project-card {
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 8px 32px rgba(10, 38, 71, 0.05);
  border-radius: 8px; padding: 30px;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover, .project-card:hover { border-color: var(--cyan); transform: translateY(-3px); box-shadow: 0 12px 40px rgba(0, 180, 216, 0.15); }
.card .icon-chip { width: 40px; height: 40px; border-radius: 6px; background: var(--cyan-dim); display: flex; align-items: center; justify-content: center; margin-bottom: 18px; color: var(--cyan); font-size: 1.1rem; }
.card h3 { font-size: 1.1rem; margin-bottom: 10px; }
.card p { color: var(--text-muted); font-size: 0.95rem; }

.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tag { font-family: var(--font-mono); font-size: 0.72rem; padding: 4px 10px; border-radius: 3px; background: rgba(255, 255, 255, 0.8); color: var(--blue); border: 1px solid rgba(10, 38, 71, 0.1); }

.timeline { position: relative; padding-left: 36px; border-left: 2px solid rgba(10, 38, 71, 0.1); }
.timeline-item { position: relative; padding-bottom: 44px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { content: ''; position: absolute; left: -43px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--white); border: 2.5px solid var(--cyan); }
.timeline-item.current::before { background: var(--cyan); box-shadow: 0 0 0 4px var(--cyan-dim); }
.timeline-date { font-family: var(--font-mono); font-size: 0.8rem; color: var(--cyan); margin-bottom: 6px; display: block; }
.timeline-item h3 { font-size: 1.2rem; margin-bottom: 6px; }
.timeline-item .place { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 10px; }
.timeline-item p { margin-bottom: 10px; }

.todo-note { border: 1.5px dashed #C7D2E0; background: rgba(0, 180, 216, 0.08); border-radius: 6px; padding: 14px 18px; font-size: 0.85rem; color: var(--blue); margin-top: 14px; }
.todo-note strong { color: var(--navy); }

.skill-row { margin-bottom: 20px; }
.skill-row .skill-label { display: flex; justify-content: space-between; font-size: 0.9rem; margin-bottom: 7px; }
.skill-row .skill-label .lvl { font-family: var(--font-mono); color: var(--text-muted); font-size: 0.78rem; }
.skill-bar { height: 6px; background: rgba(10, 38, 71, 0.1); border-radius: 3px; overflow: hidden; }
.skill-bar-fill { height: 100%; background: linear-gradient(90deg, var(--blue), var(--cyan)); border-radius: 3px; }

.project-card { padding: 0; margin-bottom: 28px; }
.project-card-head { padding: 30px 34px 0; }
.project-card-head .eyebrow { margin-bottom: 8px; display: block; }
.project-card h3 { font-size: 1.35rem; margin-bottom: 10px; }
.project-card-body { padding: 18px 34px 30px; color: var(--text-muted); }

.project-award { display: inline-flex; align-items: center; gap: 8px; background: var(--navy); color: var(--white); font-family: var(--font-mono); font-size: 0.75rem; padding: 6px 14px; border-radius: 20px; margin-bottom: 16px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-group { margin-bottom: 20px; }
.form-group.full { grid-column: 1 / -1; }
label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--navy); margin-bottom: 8px; }
input, textarea { width: 100%; padding: 12px 14px; border: 1.5px solid rgba(10, 38, 71, 0.2); border-radius: 5px; font-family: var(--font-body); font-size: 0.95rem; color: var(--text); background: rgba(255, 255, 255, 0.8); transition: border-color 0.2s ease, background 0.2s ease; }
input:focus, textarea:focus { outline: none; border-color: var(--cyan); background: var(--white); }
textarea { resize: vertical; min-height: 140px; }

.form-msg { padding: 14px 18px; border-radius: 5px; font-size: 0.9rem; margin-bottom: 22px; display: none; }
.form-msg.success { display: block; background: rgba(230, 247, 238, 0.9); color: #146C43; border: 1px solid #A9E3C4; }
.form-msg.error { display: block; background: rgba(253, 236, 236, 0.9); color: #B42318; border: 1px solid #F5B5AF; }

.contact-info-card { background: rgba(10, 38, 71, 0.85); color: var(--white); border-radius: 8px; padding: 36px; }
.contact-info-card h3 { color: var(--white); margin-bottom: 22px; }
.contact-line { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; font-size: 0.95rem; }
.contact-line .lbl { font-family: var(--font-mono); font-size: 0.72rem; color: var(--cyan); text-transform: uppercase; letter-spacing: 0.08em; width: 72px; flex-shrink: 0; }
.contact-line a { text-decoration: underline; }

.site-footer { border-top: 1px solid rgba(10, 38, 71, 0.1); padding: 40px 0; background: rgba(255, 255, 255, 0.5); backdrop-filter: blur(10px); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.footer-inner p { font-size: 0.85rem; color: var(--text-muted); }
.footer-links { display: flex; gap: 22px; list-style: none; }
.footer-links a { font-size: 0.85rem; color: var(--text-muted); }
.footer-links a:hover { color: var(--cyan); }

@media (max-width: 980px) {
  .nav-links { gap: 20px; }
}
@media (max-width: 860px) {
  .hero .container { grid-template-columns: 1fr; }
  .hero .circuit-wrap { order: -1; max-width: 260px; margin: 0 auto; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0;
    background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(15px);
    flex-direction: column; padding: 20px 32px;
    border-bottom: 1px solid var(--grey-line);
    display: none; gap: 18px;
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: flex; }
}


/* ============================================
   AJOUTS — Fond animé "aurora" + nouvelles pages
   ============================================ */
.bg-aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background: linear-gradient(-45deg, #eef3fa, #e4ecf7, #dbe7f3, #f4f7fb);
  background-size: 400% 400%;
  animation: gradientBG 18s ease infinite;
}
.bg-aurora span {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: floatBlob 24s ease-in-out infinite;
}
.bg-aurora span:nth-child(1) { width: 480px; height: 480px; background: var(--cyan); top: -140px; left: -120px; animation-duration: 26s; }
.bg-aurora span:nth-child(2) { width: 420px; height: 420px; background: var(--blue); top: 25%; right: -160px; animation-duration: 31s; animation-delay: -6s; }
.bg-aurora span:nth-child(3) { width: 380px; height: 380px; background: var(--navy); bottom: -160px; left: 18%; opacity: 0.22; animation-duration: 35s; animation-delay: -12s; }
.bg-aurora span:nth-child(4) { width: 320px; height: 320px; background: var(--cyan); bottom: 8%; right: 8%; opacity: 0.28; animation-duration: 22s; animation-delay: -4s; }

@keyframes floatBlob {
  0%, 100% { transform: translate(0,0) scale(1); }
  33% { transform: translate(50px, -40px) scale(1.1); }
  66% { transform: translate(-40px, 30px) scale(0.92); }
}

body { background: transparent; animation: none; }

.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

.page-hero { padding: 56px 0 20px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 0.85rem; color: var(--blue); margin-bottom: 22px; transition: color 0.2s ease; }
.back-link:hover { color: var(--cyan); }

.meta-row { display: flex; gap: 14px; flex-wrap: wrap; margin: 18px 0 8px; }
.meta-chip {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-muted);
  background: rgba(255, 255, 255, 0.65); border: 1px solid rgba(10, 38, 71, 0.1);
  padding: 6px 14px; border-radius: 20px; backdrop-filter: blur(6px);
}
.meta-chip strong { color: var(--navy); }

.note-callout {
  border: 1.5px solid rgba(0, 180, 216, 0.35);
  background: rgba(0, 180, 216, 0.08);
  border-radius: 8px; padding: 16px 20px; font-size: 0.92rem; color: var(--blue); margin: 24px 0;
}
.note-callout strong { color: var(--navy); }

.clickable-card { display: flex; flex-direction: column; text-decoration: none; }

.mission-list { margin: 14px 0 0 0; padding-left: 20px; }
.mission-list li { margin-bottom: 10px; color: var(--text-muted); }
.mission-list li strong { color: var(--navy); }

.stage-block { margin-bottom: 32px; }
.stage-block h4 { font-family: var(--font-display); color: var(--navy); font-size: 1.05rem; margin-bottom: 8px; }

/* ---------- Pages de stage ---------- */
.stage-intro-grid,
.stage-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
  align-items: center;
}
.stage-intro-grid { margin-bottom: 64px; }
.stage-intro-grid h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); margin: 10px 0 18px; }
.stage-intro-grid p + p { margin-top: 14px; }
.stage-detail-grid { align-items: start; }
.stage-detail-grid h3 { font-size: 1.1rem; margin-bottom: 10px; }
.stage-detail-grid p { color: var(--text-muted); }
.stage-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 28px;
}
.stage-photo-card {
  overflow: hidden;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(10, 38, 71, 0.08);
}
.stage-photo {
  width: 100%;
  height: 320px;
  object-fit: cover;
  border-radius: 0;
}
.stage-photo--top { object-position: center top; }
.stage-photo-card figcaption {
  padding: 14px 18px 16px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ---------- Étude de projet EVSE ---------- */
.evse-intro-grid,
.evse-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
  align-items: center;
}
.evse-intro-grid { margin-bottom: 72px; }
.evse-intro-grid h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); margin: 10px 0 18px; }
.evse-intro-grid p + p { margin-top: 14px; }
.evse-detail-grid { align-items: start; }
.evse-photo-card {
  overflow: hidden;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(10, 38, 71, 0.08);
}
.evse-photo {
  width: 100%;
  height: 260px;
  object-fit: cover;
  object-position: center top;
  border-radius: 0;
  background: rgba(10, 38, 71, 0.06);
}
.evse-photo-card--hero .evse-photo { height: 360px; }
.evse-photo--vehicle-test { object-position: center 60%; }
.evse-photo-card figcaption {
  padding: 14px 18px 16px;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.evse-card-grid { margin-top: 22px; }
.evse-card-grid .card { padding: 24px; }
.evse-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 28px;
}
.evse-gallery--single { grid-template-columns: minmax(0, 560px); }
.evse-safety-card { padding: 28px; }
.evse-safety-card .eyebrow { margin-bottom: 8px; }
.evse-safety-card h3 { margin-bottom: 12px; }

.timeline-item a.stage-link { font-family: var(--font-mono); font-size: 0.85rem; color: var(--cyan); }
.timeline-item a.stage-link:hover { text-decoration: underline; }

/* ---------- Photos page Expérience professionnelle ---------- */
.exp-photo {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 18px;
  background: rgba(10, 38, 71, 0.06);
}

@media (max-width: 860px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .evse-intro-grid,
  .evse-detail-grid,
  .evse-gallery,
  .stage-intro-grid,
  .stage-detail-grid,
  .stage-gallery { grid-template-columns: 1fr; }
  .evse-intro-grid { margin-bottom: 48px; }
}
@media (max-width: 560px) {
  .grid-4 { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .bg-aurora, .bg-aurora span { animation: none; }
}

/* ============================================
   Effet de Fusion d'Images (Collage Serveur)
   ============================================ */
.fusion-gallery {
  position: relative;
  height: 340px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.img-fusion-back, .img-fusion-front {
  position: absolute;
  border-radius: 12px;
  box-shadow: 0 15px 35px rgba(10, 38, 71, 0.15);
  transition: all 0.4s ease;
  object-fit: cover;
}

/* Image en arrière-plan */
.img-fusion-back {
  width: 65%;
  height: auto;
  top: 5%;
  right: 5%;
  z-index: 1;
  opacity: 0.85;
  transform: rotate(4deg);
  border: 3px solid rgba(255, 255, 255, 0.4);
}

/* Image au premier plan */
.img-fusion-front {
  width: 70%;
  height: auto;
  bottom: 5%;
  left: 0;
  z-index: 2;
  border: 6px solid rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(8px);
}

/* Animation au survol : les images s'écartent légèrement */
.fusion-gallery:hover .img-fusion-back {
  opacity: 1;
  transform: rotate(7deg) scale(1.05) translate(15px, -10px);
}

.fusion-gallery:hover .img-fusion-front {
  transform: rotate(-2deg) scale(1.02) translate(-10px, 10px);
}

/* Ajustement pour les téléphones */
@media (max-width: 860px) {
  .fusion-gallery {
    height: 280px;
    margin-top: 24px;
  }
}
