/* =========================================================
   Thème
   ========================================================= */
:root {
  --bg: #f7f8fb;
  --bg-alt: #ffffff;
  --surface: #ffffff;
  --border: #e4e7ef;
  --text: #141a2b;
  --muted: #5a6378;
  --accent: #3d5afe;
  --accent-soft: rgba(61, 90, 254, 0.1);
  --accent-2: #00b894;
  --shadow: 0 1px 2px rgba(20, 26, 43, 0.04), 0 8px 24px rgba(20, 26, 43, 0.06);
  --shadow-hover: 0 2px 4px rgba(20, 26, 43, 0.06), 0 16px 40px rgba(20, 26, 43, 0.12);
  --radius: 16px;
  --nav-h: 68px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1117;
    --bg-alt: #121823;
    --surface: #161d2b;
    --border: #253047;
    --text: #e8ecf5;
    --muted: #9aa5bd;
    --accent: #7c8cff;
    --accent-soft: rgba(124, 140, 255, 0.14);
    --accent-2: #3ee0b5;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
    --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.4), 0 16px 40px rgba(0, 0, 0, 0.4);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0d1117;
  --bg-alt: #121823;
  --surface: #161d2b;
  --border: #253047;
  --text: #e8ecf5;
  --muted: #9aa5bd;
  --accent: #7c8cff;
  --accent-soft: rgba(124, 140, 255, 0.14);
  --accent-2: #3ee0b5;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
  --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.4), 0 16px 40px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}

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

html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }
html, body { overflow-x: clip; }

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.4rem); font-weight: 800; margin-bottom: 40px; }
h3 { font-size: 1.15rem; font-weight: 700; }

.accent { color: var(--accent); }
.lead { font-size: 1.125rem; color: var(--muted); }

/* =========================================================
   Boutons
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.975rem;
  border: 1.5px solid transparent;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 20px var(--accent-soft); }
.btn-primary:hover { box-shadow: 0 10px 28px var(--accent-soft); filter: brightness(1.08); }
.btn-ghost { border-color: var(--border); color: var(--text); background: var(--surface); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-lg { padding: 16px 30px; font-size: 1.05rem; }

.icon-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 1rem;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }

/* =========================================================
   Navigation
   ========================================================= */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.navbar.scrolled { border-bottom-color: var(--border); box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04); }

.nav-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.brand { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.03em; }
.brand span { color: var(--accent); }

.nav-links { display: flex; gap: 6px; }
.nav-links a {
  display: block;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.93rem;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.2s ease, background 0.2s ease;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); background: var(--accent-soft); }

.nav-actions { display: flex; gap: 8px; }
.menu-icon { display: none; }

/* =========================================================
   Hero
   ========================================================= */
.hero {
  position: relative;
  padding: 80px 0 100px;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: -20% -10% auto auto;
  width: 640px; height: 640px;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 65%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 56px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 24px;
}
.eyebrow .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-2) 25%, transparent);
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  margin-bottom: 24px;
}
.hero .lead { max-width: 560px; margin-bottom: 32px; }

.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 36px; }

.hero-social { display: flex; gap: 10px; }
.hero-social a {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.hero-social a:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }

.hero-photo { display: flex; justify-content: center; }
.photo-frame {
  position: relative;
  width: min(100%, 360px);
  aspect-ratio: 4 / 5;
}
.photo-frame::before {
  content: '';
  position: absolute;
  inset: 18px -18px -18px 18px;
  border-radius: 28px;
  border: 2px solid var(--accent);
  opacity: 0.5;
}
.photo-frame img {
  position: relative;
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 28px;
  box-shadow: var(--shadow-hover);
}

/* =========================================================
   Sections
   ========================================================= */
.section { padding: 96px 0; }
.section:nth-of-type(odd) { background: var(--bg-alt); }

.section-tag {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* À propos */
.about-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: start; }
.about-text p { color: var(--muted); font-size: 1.075rem; margin-bottom: 18px; }
.about-text strong { color: var(--text); }
.about-stats { display: grid; gap: 12px; }
.about-stats li {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 600;
}
.about-stats i {
  width: 38px; height: 38px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
}

/* Compétences */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.skill-card {
  padding: 28px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.skill-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.skill-icon {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1.2rem;
  margin-bottom: 18px;
}
.skill-card h3 { margin-bottom: 16px; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
}
.tags.small li { font-size: 0.78rem; padding: 3px 10px; }

/* Parcours */
.timeline { position: relative; max-width: 760px; padding-left: 32px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 7px; top: 8px; bottom: 8px;
  width: 2px;
  background: var(--border);
}
.timeline-item { position: relative; padding-bottom: 40px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: -32px; top: 6px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--border);
}
.timeline-item.current::before {
  border-color: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-soft);
}
.timeline-date {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 6px;
}
.timeline-item h3 { margin-bottom: 6px; }
.timeline-item .org { color: var(--muted); font-weight: 500; }
.timeline-item p { color: var(--muted); }

/* Projets */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.project-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.project-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-hover); }
.project-img { aspect-ratio: 16 / 10; overflow: hidden; background: #fff; border-bottom: 1px solid var(--border); }
.project-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.project-card:hover .project-img img { transform: scale(1.05); }
.project-body { flex: 1; display: flex; flex-direction: column; gap: 14px; padding: 24px; }
.project-body p { color: var(--muted); font-size: 0.95rem; }
.project-link {
  margin-top: auto;
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600;
  color: var(--accent);
}
.project-link i { transition: transform 0.2s ease; }
.project-link:hover i { transform: translateX(4px); }

/* Contact */
.contact-card {
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
  padding: 64px 40px;
  border-radius: 28px;
  border: 1px solid var(--border);
  background:
    radial-gradient(circle at 20% 0%, var(--accent-soft), transparent 60%),
    var(--surface);
  box-shadow: var(--shadow);
}
.contact-card h2 { margin-bottom: 16px; }
.contact-card .lead { margin-bottom: 32px; }
.contact-links { display: flex; justify-content: center; gap: 24px; margin-top: 28px; }
.contact-links a {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--muted);
  font-weight: 600;
  transition: color 0.2s ease;
}
.contact-links a:hover { color: var(--accent); }

/* Footer */
.footer { padding: 28px 0; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.9rem; }
.footer .container { display: flex; align-items: center; justify-content: space-between; }
.back-top {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.back-top:hover { color: var(--accent); border-color: var(--accent); }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 48px; }
  .hero-photo { order: -1; }
  .photo-frame { width: min(70%, 280px); }
  .about-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .container { padding: 0 16px; }
  .menu-icon { display: grid; }
  .nav-links {
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    flex-direction: column;
    gap: 4px;
    padding: 12px 16px 20px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  }
  .nav-links.active { opacity: 1; visibility: visible; transform: none; }
  .nav-links a { padding: 12px 16px; font-size: 1rem; }

  .hero { padding: 48px 0 72px; }
  .section { padding: 72px 0; }
  h2 { margin-bottom: 28px; }
  .projects-grid { grid-template-columns: 1fr; }
  .contact-card { padding: 48px 20px; }
  .btn-lg { font-size: 0.95rem; padding: 14px 20px; word-break: break-all; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* Publications */
.posts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; margin-bottom: 32px; }
.post-card {
  padding: 28px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 14px;
  max-width: 640px;
}
.post-head { display: flex; align-items: center; gap: 12px; }
.post-icon {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
}
.post-topic { font-size: 0.82rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.post-card p { color: var(--muted); }
.post-list { display: grid; gap: 6px; }
.post-list li { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 500; }
.post-list li::before {
  content: '\f00d';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 0.8rem;
  color: #e5484d;
}
.post-card blockquote {
  margin-top: 4px;
  padding: 14px 18px;
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: var(--accent-soft);
  font-weight: 600;
}
.posts-more { margin-top: 0; }

/* Certifications */
.sub-title { font-size: 1.4rem; font-weight: 800; margin: 64px 0 24px; }
.certs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.cert-card {
  display: flex; flex-direction: column; gap: 12px;
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.cert-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.cert-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.cert-issuer {
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--accent);
}
.cert-date { font-size: 0.82rem; color: var(--muted); white-space: nowrap; }
.cert-card h4 { font-size: 1.08rem; font-weight: 700; line-height: 1.35; }
.cert-card p { color: var(--muted); font-size: 0.93rem; }
.cert-card .cert-meta { font-size: 0.85rem; }
.badge {
  display: inline-block;
  margin-left: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-2) 16%, transparent);
  color: var(--accent-2);
  font-size: 0.72rem;
  font-weight: 700;
  vertical-align: middle;
}

@media (max-width: 600px) {
  .eyebrow { border-radius: 14px; align-items: flex-start; }
  .eyebrow .dot { margin-top: 7px; flex-shrink: 0; }
}
