/* Police Inter auto-hébergée (sous-set latin) — plus aucun appel à Google Fonts. */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('../fonts/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('../fonts/inter-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('../fonts/inter-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('../fonts/inter-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 800; font-display: swap;
  src: url('../fonts/inter-latin-800-normal.woff2') format('woff2'); }

:root {
  --bg: #0a0c14;
  --bg-tint: #10131f;
  --accent: #818cf8;
  --accent-strong: #6366f1;
  --accent-light: rgba(99, 102, 241, 0.14);
  --text: #f1f2f6;
  --text-dim: #9498ad;
  --border: rgba(255, 255, 255, 0.09);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { margin: 0 0 0.6em; font-weight: 700; letter-spacing: -0.01em; }

/* === Navbar === */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(10, 12, 20, 0.75);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.2s;
}
#navbar.scrolled { box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3); }
.nav-inner {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.5rem;
}
.nav-logo { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 700; color: var(--text); font-size: 1.05rem; }
.nav-logo:hover { text-decoration: none; }
.nav-logo-icon { width: 20px; height: 20px; border-radius: 5px; object-fit: cover; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
  margin: 0; padding: 0;
}
.nav-link {
  color: var(--text-dim);
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-link:hover { color: var(--text); text-decoration: none; }
.nav-link.active { color: var(--accent); }
.nav-cta {
  background: var(--accent-strong);
  color: #fff !important;
  padding: 0.55rem 1.2rem;
  border-radius: 8px;
}
.nav-cta:hover { background: #5457e0; }

.nav-login {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  color: var(--text) !important;
  padding: 0.5rem 1.1rem;
  border-radius: 8px;
}
.nav-login:hover { border-color: var(--accent); color: var(--accent) !important; text-decoration: none; }
.nav-login .icon { width: 14px; height: 14px; margin-right: 0.4rem; }
#nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.2rem;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
}

@media (max-width: 760px) {
  .nav-links {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: flex-start;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 1.2rem 1.5rem;
    display: none;
    gap: 1.1rem;
  }
  .nav-links.open { display: flex; }
  #nav-toggle { display: block; }
}

/* === Hero === */
.hero {
  padding: 9rem 1.5rem 5rem;
  max-width: 1140px;
  margin: 0 auto;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: center;
}
.hero-kicker {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.8rem;
}
.hero-title { font-size: clamp(2.2rem, 5vw, 3.2rem); line-height: 1.15; }
.accent-text { color: var(--accent); }
.hero-meta { display: flex; gap: 0.7rem; flex-wrap: wrap; margin: 1.1rem 0 1.3rem; }
.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
}
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55);
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); }
  70%  { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.hero-text { color: var(--text-dim); font-size: 1.08rem; max-width: 560px; margin: 1.2rem 0 2rem; }
.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.6rem; }

.btn {
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.8rem 1.6rem;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
  display: inline-flex;
  align-items: center;
  text-decoration: none !important;
}
.btn-primary { background: var(--accent-strong); color: #fff; }
.btn-primary:hover { background: #5457e0; transform: translateY(-1px); box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35); }
.btn-ghost { border-color: var(--border); color: var(--text); background: rgba(255,255,255,0.03); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.btn[hidden] { display: none; }

.hero-socials { font-size: 0.92rem; color: var(--text-dim); display: flex; align-items: center; flex-wrap: wrap; }
.hero-socials a { color: var(--text-dim); font-weight: 500; display: inline-flex; align-items: center; }
.hero-socials a:hover { color: var(--accent); }
.dot-sep { margin: 0 0.6rem; color: var(--border); }

.icon { width: 16px; height: 16px; margin-right: 0.4rem; flex-shrink: 0; }
.btn .icon { width: 17px; height: 17px; }

/* === Email smart dropdown === */
.email-dropdown { position: relative; display: inline-block; }
.email-trigger {
  font-family: var(--font);
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
}
.email-trigger:hover { color: var(--accent); }
.email-trigger.btn { padding: 0.8rem 1.6rem; }
.email-trigger.btn:hover { color: #fff; }
.caret { font-size: 0.7em; display: inline-block; transition: transform 0.2s; }
.email-dropdown.open .caret { transform: rotate(180deg); }

.email-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  background: var(--bg-tint);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.4rem;
  min-width: 220px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s, transform 0.18s;
  z-index: 50;
  text-align: left;
}
.email-dropdown.open .email-menu { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.email-menu a {
  display: block;
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 500;
}
.email-menu a:hover { background: var(--accent-light); color: var(--accent); text-decoration: none; }

.hero-avatar { display: flex; justify-content: center; min-width: 0; }
.avatar-ring {
  width: 200px; height: 200px;
  max-width: 100%;
  flex-shrink: 0;
  border-radius: 50%;
  padding: 4px;
  background: linear-gradient(135deg, var(--accent-strong), #c084fc);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 16px 40px rgba(99, 102, 241, 0.3);
}
.avatar-photo {
  width: 100%;
  height: 100%;
  max-width: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 3px solid var(--bg);
}

@media (max-width: 760px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-text { margin-left: auto; margin-right: auto; }
  .hero-cta, .hero-socials { justify-content: center; }
  .avatar-ring { width: 140px; height: 140px; margin: 0 auto; }
}

/* === Sections === */
.section { max-width: 1140px; margin: 0 auto; padding: 5.5rem 1.5rem; }
.section-tint { background: var(--bg-tint); max-width: none; }
.section-tint > * { max-width: 1140px; margin-left: auto; margin-right: auto; }
.section-kicker {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}
.section-title { font-size: clamp(1.7rem, 3.5vw, 2.2rem); margin-bottom: 2.6rem; }

.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* === Skills === */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.2rem;
}
.skill-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.skill-card:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35); border-color: rgba(129, 140, 248, 0.4); }
.skill-card h3 { font-size: 1rem; }
.tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tags li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 500;
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
}
.tag-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  object-fit: contain;
}
.tags li a.tag-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: inherit;
  text-decoration: none;
}
.tags li a.tag-link:hover { text-decoration: underline; }

/* === Timeline === */
.timeline { position: relative; padding-left: 2rem; border-left: 2px solid var(--border); }
.timeline-item { position: relative; margin-bottom: 2.6rem; padding-left: 1.6rem; }
.timeline-item:last-child { margin-bottom: 0; }
.timeline-dot {
  position: absolute;
  left: -2.45rem;
  top: 0.35rem;
  width: 12px; height: 12px;
  background: var(--accent);
  border: 3px solid var(--bg);
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--accent), 0 0 14px rgba(129, 140, 248, 0.5);
}
.section-tint .timeline-dot { border-color: var(--bg-tint); }
.timeline-date {
  display: inline-block;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--accent-light);
  padding: 0.2rem 0.7rem;
  border-radius: 6px;
  margin-bottom: 0.6rem;
}
.timeline-content h3 { font-size: 1.1rem; margin-top: 0.2rem; }
.timeline-company { display: flex; align-items: center; gap: 0.6rem; }
.company-logo { width: 32px; height: 32px; object-fit: contain; border-radius: 6px; flex-shrink: 0; }
.timeline-content ul { margin: 0.7rem 0 0; padding-left: 1.2rem; color: var(--text-dim); }
.timeline-content li { margin-bottom: 0.4rem; font-size: 0.95rem; }
.timeline-content p { color: var(--text-dim); margin: 0.3rem 0 0; }
.timeline-compact .timeline-item { margin-bottom: 1.7rem; }

/* === Balayage à l'entrée de chaque bloc (Parcours & Formations) ===
   Déclenché une seule fois par l'observer (.in-view). Le contenu se dévoile
   de gauche à droite (clip-path), une bande de lumière le balaie, et le point
   apparaît en pop. Pas de translation verticale ici pour rester net. */
.timeline-item.reveal { transform: none; transition: opacity 0.6s ease; }

.timeline-content {
  position: relative;
  overflow: hidden;
  clip-path: inset(0 100% 0 0);
  transition: clip-path 0.75s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.timeline-item.in-view .timeline-content { clip-path: inset(0 0 0 0); }

.timeline-content::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 32%, rgba(129, 140, 248, 0.16) 50%, transparent 68%);
  transform: translateX(-120%);
  pointer-events: none;
}
.timeline-item.in-view .timeline-content::after { animation: tl-sweep 1.15s ease 0.15s 1 both; }
@keyframes tl-sweep { from { transform: translateX(-120%); } to { transform: translateX(120%); } }

.timeline-dot { transform: scale(0); transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s; }
.timeline-item.in-view .timeline-dot { transform: scale(1); }

/* === Quote block === */
.quote-block {
  border-left: 3px solid var(--accent);
  padding-left: 1.5rem;
  margin: 0 auto;
  max-width: 760px;
  font-size: 1.1rem;
  color: var(--text-dim);
  font-style: normal;
}

/* === Footer / contact === */
footer.section { text-align: center; border-top: 1px solid var(--border); }
.contact-links { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-top: 1.4rem; }
.footer-note { margin-top: 3.5rem; color: var(--text-dim); font-size: 0.85rem; }

/* === Stats band === */
.stats-band {
  background: var(--bg-tint);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 3rem 1.5rem;
}
.stats-band-inner {
  max-width: 600px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  text-align: center;
}
.stat-number {
  display: block;
  font-size: clamp(1.6rem, 3.5vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, #fff, var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat-label {
  display: block;
  color: var(--text-dim);
  font-size: 0.88rem;
  margin-top: 0.4rem;
}
@media (max-width: 700px) {
  .stats-band-inner { grid-template-columns: 1fr; gap: 1.4rem; }
}

/* === Scroll-driven feature (style Apple) === */
/* Section pilotée au scroll : l'illustration reste fixée, profondeur + fondu doux.
   --p (0→1) est posé par le JS sur .scroll-feature et hérité en dessous. */
.scroll-feature { position: relative; height: 300vh; --p: 0; }
.scroll-feature-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 38%,
    rgba(99, 102, 241, calc(0.05 + 0.12 * var(--p))), transparent 62%);
}
.scroll-illustration {
  width: min(780px, 90vw);
  transform:
    perspective(1400px)
    rotateX(calc(11deg - 11deg * var(--p)))
    scale(calc(0.84 + 0.20 * var(--p)))
    translateY(calc(26px - 52px * var(--p)));
  transform-origin: center 42%;
  will-change: transform;
}
.scroll-illustration svg { width: 100%; height: auto; display: block; }

.data-line {
  stroke: var(--accent);
  stroke-width: 2;
  stroke-dasharray: 6 10;
  opacity: 0.35;
  animation: dash-flow 3s linear infinite;
}
@keyframes dash-flow { to { stroke-dashoffset: -160; } }

.rack-body {
  fill: rgba(255, 255, 255, 0.03);
  stroke: rgba(255, 255, 255, 0.14);
  stroke-width: 1.5;
  transition: stroke 0.4s, fill 0.4s;
}
.unit {
  fill: rgba(255, 255, 255, 0.06);
  transition: fill 0.4s, opacity 0.4s;
}
.led {
  fill: rgba(255, 255, 255, 0.15);
  transition: fill 0.4s, filter 0.4s;
}
.rack.lit .rack-body { stroke: rgba(129, 140, 248, 0.55); fill: rgba(99, 102, 241, 0.05); }
.rack.lit .unit { fill: rgba(129, 140, 248, 0.32); }
.rack.lit .unit:nth-child(odd) { fill: rgba(192, 132, 252, 0.28); }
.rack.lit .led { fill: #818cf8; filter: drop-shadow(0 0 5px #818cf8);
  animation: led-pulse 2.6s ease-in-out infinite; }
#rack-2 .led { animation-delay: 0.65s; }
#rack-3 .led { animation-delay: 1.3s; }
#rack-4 .led { animation-delay: 1.95s; }
@keyframes led-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

/* Légendes empilées : le JS gère leur opacité/translation en fondu enchaîné. */
.scroll-captions {
  position: relative;
  width: 100%;
  max-width: 580px;
  min-height: 8rem;
  margin-top: 2.2rem;
  padding: 0 1.5rem;
  flex-shrink: 0;
}
.scroll-caption {
  position: absolute;
  inset: 0 0 auto 0;
  text-align: center;
  opacity: 0;
  will-change: opacity, transform;
}
.scroll-caption .section-kicker { margin-bottom: 0.4rem; }
.scroll-caption h2 { font-size: clamp(1.4rem, 3vw, 1.95rem); margin-bottom: 0.5rem; }
.scroll-caption h2 + p { color: var(--text-dim); margin: 0 auto; max-width: 520px; font-size: 1.02rem; }

.scroll-dots { display: flex; justify-content: center; gap: 0.7rem; margin-top: 1.6rem; flex-shrink: 0; }
.scroll-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--border);
  border: none; padding: 0;
  cursor: pointer;
  transition: background 0.3s, transform 0.3s;
}
.scroll-dot:hover { background: var(--text-dim); transform: scale(1.2); }
.scroll-dot.active { background: var(--accent); transform: scale(1.35); }
.scroll-dot:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

@media (max-width: 760px) {
  .scroll-feature { height: 280vh; }
  .scroll-illustration { width: 92vw; }
  .scroll-captions { min-height: 10rem; margin-top: 1.6rem; }
}

/* ── Pages légales (mentions légales, confidentialité) ── */
.legal { max-width: 780px; }
.legal .section-title { margin-bottom: 0.6rem; }
.legal .legal-intro { color: var(--text-dim); margin-bottom: 2rem; }
.legal h3 { font-size: 1.15rem; margin: 2.4rem 0 0.6rem; color: var(--text); }
.legal p, .legal li { color: var(--text-dim); line-height: 1.75; }
.legal p { margin: 0.6rem 0; }
.legal ul { margin: 0.6rem 0 0.6rem 1.2rem; }
.legal li { margin: 0.35rem 0; }
.legal a { color: var(--accent); }
.legal dl { margin: 0.4rem 0; }
.legal dt { color: var(--text); font-weight: 600; margin-top: 1.1rem; }
.legal dd { margin: 0.2rem 0 0 0; color: var(--text-dim); }
.legal .updated { margin-top: 2.6rem; padding-top: 1.2rem; border-top: 1px solid var(--border);
  font-size: 0.85rem; color: var(--text-dim); font-style: italic; }
.footer-legal-links { margin-top: 1rem; display: flex; gap: 1.2rem; justify-content: center;
  flex-wrap: wrap; font-size: 0.85rem; }
.footer-legal-links a { color: var(--text-dim); }
.footer-legal-links a:hover { color: var(--accent); }

/* Respect de la préférence système « animations réduites » :
   on désactive les animations infinies ET on aplatit la section scroll
   (tout devient statique et lisible d'un bloc, sans pilotage au scroll). */
@media (prefers-reduced-motion: reduce) {
  .data-line, .rack.lit .led { animation: none !important; }
  .reveal { transition: none !important; }
  .scroll-feature { height: auto; }
  .scroll-feature-sticky { position: static; height: auto; padding: 2.5rem 1rem; }
  .scroll-illustration { transform: none !important; }
  .rack .rack-body { stroke: rgba(129, 140, 248, 0.55); fill: rgba(99, 102, 241, 0.05); }
  .rack .unit { fill: rgba(129, 140, 248, 0.32); }
  .rack .unit:nth-child(odd) { fill: rgba(192, 132, 252, 0.28); }
  .rack .led { fill: #818cf8; }
  .scroll-captions { position: static; min-height: 0; display: flex; flex-direction: column; gap: 1.6rem; }
  .scroll-caption { position: static; opacity: 1 !important; transform: none !important; }
  .scroll-dots { display: none; }
  .timeline-content { clip-path: none !important; }
  .timeline-content::after { display: none !important; }
  .timeline-dot { transform: none !important; }
}

/* ===== Section lab : CTA vers le portail ===== */
.lab-cta { text-align: center; }
.lab-cta .section-title { margin-bottom: 1.2rem; }
.lab-cta-text { max-width: 620px; margin: 0 auto 2rem; color: var(--text-soft, inherit); }
.lab-cta-buttons { justify-content: center; }
