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

/* Base */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 4rem;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: #1a1a1a;
  background: #fff;
}

a {
  color: #2563EB;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

ul {
  padding-left: 1.25rem;
}

li {
  margin-bottom: 0.3rem;
}

/* Accessibility: focus visible */
a:focus-visible,
button:focus-visible {
  outline: 2px solid #2563EB;
  outline-offset: 2px;
  border-radius: 2px;
}

#navbar a:focus-visible,
#navbar button:focus-visible,
#footer a:focus-visible {
  outline-color: #fff;
}

/* Accessibility: skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 200;
  background: #2563EB;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  padding: 0;
}

.skip-link:focus {
  position: fixed;
  top: 0;
  left: 0;
  width: auto;
  height: auto;
  padding: 0.75rem 1.5rem;
  z-index: 200;
}

/* Accessibility: screen-reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Language: body-class approach (FR/EN/ES) */
body.lang-fr [data-lang="en"],
body.lang-fr [data-lang="es"] {
  display: none !important;
}

body.lang-en [data-lang="fr"],
body.lang-en [data-lang="es"] {
  display: none !important;
}

body.lang-es [data-lang="fr"],
body.lang-es [data-lang="en"] {
  display: none !important;
}

/* Container */
.container {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ==================== Navigation ==================== */
#navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #1a1a1a;
}

.nav-container {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.25rem;
}

.nav-brand {
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  letter-spacing: 0.01em;
}

.nav-brand:hover {
  text-decoration: none;
  color: #fff;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: #fff;
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-links a {
  color: #bbb;
  font-size: 0.8rem;
  text-decoration: none;
  transition: color 0.15s;
  letter-spacing: 0.02em;
}

.nav-links a:hover {
  color: #fff;
  text-decoration: none;
}

.lang-switcher {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.75rem;
  padding-left: 1rem;
  border-left: 1px solid #333;
}

.lang-btn {
  background: none;
  border: none;
  color: #999;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.15rem 0.35rem;
  border-radius: 3px;
  transition: color 0.15s, background 0.15s;
}

.lang-btn:hover {
  color: #fff;
}

.lang-btn.active {
  color: #fff;
  background: #333;
}

.lang-sep {
  color: #666;
  font-size: 0.75rem;
}

/* ==================== Hero ==================== */
#hero {
  padding: 3.5rem 0 3rem;
  background: #FAFAFA;
  border-bottom: 1px solid #E5E7EB;
}

.hero-content {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2.5rem;
}

.hero-text {
  flex: 1;
}

.hero-text h1 {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 0.35rem;
  letter-spacing: -0.02em;
}

.hero-title {
  font-size: 1.4rem;
  color: #2563EB;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.hero-subtitle {
  font-size: 1rem;
  color: #4B5563;
  margin-bottom: 1.25rem;
}

.hero-meta {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: #4B5563;
}

.hero-meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hero-meta-item svg {
  flex-shrink: 0;
  color: #6B7280;
}

.hero-meta-item a {
  color: #2563EB;
}

.hero-photo {
  flex-shrink: 0;
}

.hero-photo img {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

/* ==================== Sections ==================== */
section {
  padding: 3.5rem 0;
}

.section-alt {
  background: #FAFAFA;
}

h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: #1a1a1a;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: #1a1a1a;
}

p {
  margin-bottom: 0.6rem;
}

.section-intro {
  font-size: 1.05rem;
  color: #374151;
  line-height: 1.7;
}

/* ==================== Two-column layout ==================== */
.two-col {
  display: flex;
  gap: 3rem;
  margin-top: 2rem;
}

.two-col > div {
  flex: 1;
}

.two-col h3 {
  margin-bottom: 0.85rem;
  color: #4B5563;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Tag list (skills, tech) */
.tag-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-list li {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 500;
  color: #374151;
  padding: 0.3rem 0.75rem;
  background: #F3F4F6;
  border: 1px solid #E5E7EB;
  border-radius: 6px;
}

/* Detail list (languages, etc.) */
.detail-list {
  list-style: none;
  padding: 0;
}

.detail-list li {
  padding: 0.35rem 0;
  font-size: 0.95rem;
  color: #374151;
}

.detail-list strong {
  color: #1a1a1a;
}

/* ==================== Timeline ==================== */
.timeline {
  position: relative;
  margin-top: 0.5rem;
}

.timeline-item {
  display: flex;
  gap: 1.25rem;
  margin-bottom: 2.25rem;
  position: relative;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-dot {
  position: relative;
  flex-shrink: 0;
  width: 12px;
  margin-top: 6px;
}

.timeline-dot::before {
  content: '';
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #2563EB;
}

.timeline-dot::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 16px;
  bottom: -2.25rem;
  width: 2px;
  background: #E5E7EB;
}

.timeline-item:last-child .timeline-dot::after {
  display: none;
}

.timeline-content {
  flex: 1;
  min-width: 0;
}

.timeline-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.2rem;
  flex-wrap: wrap;
}

.timeline-date {
  font-size: 0.85rem;
  color: #4B5563;
  white-space: nowrap;
  font-weight: 400;
}

.timeline-role {
  font-weight: 500;
  color: #4B5563;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

.timeline-context {
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
  color: #374151;
}

.timeline-institution {
  color: #4B5563;
  font-size: 0.9rem;
  margin-bottom: 0;
}

.timeline-sites {
  color: #4B5563;
  font-size: 0.9rem;
  font-style: italic;
}

.timeline-content ul {
  margin-top: 0.15rem;
  font-size: 0.9rem;
  color: #374151;
}

.timeline-content li {
  margin-bottom: 0.2rem;
}

/* ==================== Project card ==================== */
.project-card {
  background: #FAFAFA;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  padding: 1.75rem;
}

.project-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.project-header h3 {
  font-size: 1.15rem;
}

.project-link {
  font-size: 0.9rem;
  font-weight: 500;
}

.project-desc {
  color: #374151;
  margin-bottom: 0.75rem;
}

/* ==================== E-learning card ==================== */
.elearning-card {
  background: #FAFAFA;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  padding: 1.75rem;
}

.elearning-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.elearning-header h3 {
  font-size: 1.15rem;
}

.elearning-link {
  font-size: 0.9rem;
  font-weight: 500;
}

.elearning-card p {
  color: #374151;
  font-size: 0.95rem;
}

.elearning-topics-title {
  font-weight: 600;
  color: #1a1a1a;
  margin-top: 0.75rem;
}

.elearning-list {
  font-size: 0.9rem;
  color: #374151;
}

.elearning-list li {
  margin-bottom: 0.25rem;
}

/* ==================== Article / Labo ==================== */
.article-card {
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  padding: 2rem;
}

.section-alt .article-card {
  background: #fff;
}

.article-card h3 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  line-height: 1.35;
}

.article-meta {
  font-size: 0.85rem;
  color: #4B5563;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #E5E7EB;
}

.article-prose {
  font-size: 0.95rem;
  line-height: 1.75;
  color: #374151;
}

.article-prose h4 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.article-prose p {
  margin-bottom: 0.75rem;
}

.article-prose ul {
  margin-bottom: 1rem;
}

.article-prose li {
  margin-bottom: 0.35rem;
}

.article-prose strong {
  color: #1a1a1a;
  font-weight: 600;
}

.article-prose code {
  font-family: 'SF Mono', SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.85em;
  background: #F3F4F6;
  padding: 0.15em 0.4em;
  border-radius: 4px;
  color: #1a1a1a;
}

.article-prose pre {
  background: #1a1a1a;
  color: #E5E7EB;
  padding: 1.25rem 1.5rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1rem 0 1.25rem;
  font-size: 0.85rem;
  line-height: 1.6;
}

.article-prose pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  color: inherit;
  font-size: inherit;
}

.article-prose blockquote {
  border-left: 3px solid #2563EB;
  margin: 1rem 0;
  padding: 0.75rem 1.25rem;
  background: #F0F4FF;
  border-radius: 0 8px 8px 0;
}

.article-prose blockquote p {
  margin-bottom: 0;
  font-style: italic;
  color: #1a1a1a;
}

.article-prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.25rem;
  font-size: 0.9rem;
}

.article-prose th,
.article-prose td {
  text-align: left;
  padding: 0.6rem 0.85rem;
  border: 1px solid #E5E7EB;
}

.article-prose th {
  background: #F3F4F6;
  font-weight: 600;
  color: #1a1a1a;
}

.article-prose td {
  color: #374151;
}

/* ==================== Footer ==================== */
#footer {
  padding: 2.5rem 0;
  background: #1a1a1a;
  color: #9CA3AF;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  font-size: 0.875rem;
  flex-wrap: wrap;
}

.footer-sep {
  color: #888;
}

.footer-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: #9CA3AF;
  transition: color 0.15s;
}

.footer-link:hover {
  color: #fff;
  text-decoration: none;
}

.footer-email a {
  color: #9CA3AF;
  transition: color 0.15s;
}

.footer-email a:hover {
  color: #fff;
}

.footer-copy {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.8rem;
  color: #888;
  margin-bottom: 0;
}

/* ==================== Responsive ==================== */
@media screen and (max-width: 768px) {
  body {
    font-size: 16px;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 3.25rem;
    left: 0;
    right: 0;
    background: #1a1a1a;
    flex-direction: column;
    padding: 1rem 1.5rem 1.25rem;
    gap: 0.6rem;
    border-bottom: 1px solid #333;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    font-size: 0.95rem;
    padding: 0.2rem 0;
  }

  .lang-switcher {
    border-left: none;
    padding-left: 0;
    margin-left: 0;
    padding-top: 0.6rem;
    margin-top: 0.25rem;
    border-top: 1px solid #333;
  }

  #hero {
    padding: 2.5rem 0 2rem;
  }

  .hero-content {
    flex-direction: column-reverse;
    text-align: center;
    align-items: center;
    gap: 1.5rem;
  }

  .hero-text h1 {
    font-size: 2rem;
  }

  .hero-title {
    font-size: 1.15rem;
  }

  .hero-meta {
    align-items: center;
  }

  .hero-photo img {
    width: 120px;
    height: 120px;
  }

  .two-col {
    flex-direction: column;
    gap: 2rem;
  }

  section {
    padding: 2.5rem 0;
  }

  .timeline-header {
    flex-direction: column;
    gap: 0;
  }

  .timeline-item {
    gap: 1rem;
  }

  .project-header,
  .elearning-header {
    flex-direction: column;
    gap: 0.25rem;
  }

  .article-card {
    padding: 1.25rem;
  }

  .article-prose pre {
    padding: 1rem;
    font-size: 0.8rem;
  }

  .article-prose table {
    font-size: 0.8rem;
  }

  .article-prose th,
  .article-prose td {
    padding: 0.4rem 0.5rem;
  }

  .article-prose blockquote {
    padding: 0.5rem 1rem;
  }

  .footer-content {
    flex-direction: column;
    gap: 0.5rem;
  }

  .footer-sep {
    display: none;
  }
}
