/* =========================
   Design system (8pt grid)
   ========================= */
:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --surface-soft: #f8f8f5;
  --tint: #f4f7ff;
  --text: #0f172a;
  --muted: #566174;
  --border: rgba(15, 23, 42, 0.09);

  --brand: #1f4b99;
  --brand-ink: #163a78;
  --ring: rgba(31, 75, 153, 0.22);

  --shadow-sm: 0 1px 0 rgba(15, 23, 42, 0.03), 0 8px 26px rgba(15, 23, 42, 0.045);
  --shadow-md: 0 1px 0 rgba(15, 23, 42, 0.04), 0 14px 42px rgba(15, 23, 42, 0.08);

  --radius: 8px;
  --radius-sm: 8px;

  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 40px;
  --space-6: 48px;
  --space-7: 56px;
  --space-8: 64px;

  --max: 1120px;

  --font-sans: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji",
    "Segoe UI Emoji";
  --font-serif: Newsreader, ui-serif, Georgia, serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

[data-i18n]:not(:has([data-i18n])) {
  transition: opacity 260ms ease, transform 260ms ease;
}

html.is-language-switching [data-i18n]:not(:has([data-i18n])) {
  opacity: 0.68;
  transform: translateY(2px);
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible,
button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--ring);
  border-radius: var(--radius-sm);
}

.wrap {
  width: min(var(--max), calc(100% - 2 * var(--space-3)));
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: var(--space-2);
  padding: var(--space-1) var(--space-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  z-index: 9999;
}

.skip-link:focus {
  left: var(--space-2);
}

/* =========================
   Topbar / Nav
   ========================= */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(251, 250, 247, 0.9);
  border-bottom: 1px solid var(--border);
}

.topbar__inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: var(--space-4);
  padding: 14px 0;
}

.topbar__brandSlot {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.brand {
  display: grid;
  gap: 2px;
  min-width: 200px;
}

.brand__name {
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand__tag {
  font-size: 12px;
  color: var(--muted);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.nav__menu {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-4);
  width: 100%;
}

.nav__sections,
.nav__utilities {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav__sections {
  justify-content: center;
  min-width: 0;
}

.nav__utilities {
  justify-content: flex-end;
  white-space: nowrap;
}

.nav__link {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.nav__langToggle {
  appearance: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
  line-height: inherit;
}

.nav__link:hover {
  background: rgba(31, 75, 153, 0.07);
  color: var(--brand-ink);
}

.nav__link.is-active {
  background: rgba(31, 75, 153, 0.08);
  color: var(--brand-ink);
}

.nav__link--cta {
  border: 1px solid rgba(31, 75, 153, 0.2);
}

.nav__link--cta:hover {
  background: rgba(31, 75, 153, 0.1);
}

.nav__link--cv {
  background: var(--brand);
  color: white;
  border: 1px solid rgba(31, 75, 153, 0.35);
}

.nav__link--cv:hover {
  background: var(--brand-ink);
  color: white;
}

.nav__toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  box-shadow: var(--shadow-sm);
}

.nav__toggleLine {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  margin: 4px 0;
  border-radius: 99px;
}

.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;
}

/* =========================
   Hero
   ========================= */
.hero {
  padding: calc(var(--space-8) + var(--space-2)) 0 var(--space-6);
}

.hero__grid {
  display: grid;
  grid-template-columns: 1.35fr 0.95fr;
  gap: var(--space-6);
  align-items: start;
}

.eyebrow {
  margin: 0 0 var(--space-2);
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero__title {
  margin: 0 0 var(--space-3);
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.06;
  font-size: clamp(38px, 4.4vw, 58px);
}

.accent {
  color: var(--brand);
}

.hero__subtitle {
  margin: 0 0 var(--space-4);
  color: var(--muted);
  max-width: 56ch;
  font-size: 17px;
}

.hero__actions {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

.btn {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 600;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn--primary {
  background: var(--brand);
  color: white;
  border-color: rgba(31, 75, 153, 0.28);
}

.btn--primary:hover {
  background: var(--brand-ink);
}

.btn--ghost {
  background: transparent;
  box-shadow: none;
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.72);
}

.hero__meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}

@media (min-width: 981px) {
  html[lang="fr"] .hero__meta {
    grid-template-columns: minmax(0, 1.35fr) minmax(190px, 0.65fr);
  }
}

.metaCard {
  padding: var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow-sm);
}

.metaCard__label {
  font-size: 12px;
  color: var(--muted);
}

.metaCard__value {
  margin-top: 2px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.profileCard {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.profileCard__avatar {
  padding: var(--space-4) var(--space-4) var(--space-2);
  display: flex;
  justify-content: center;
}

.avatarImg {
  width: 215px;
  height: 215px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(31, 75, 153, 0.18);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04), 0 18px 40px rgba(15, 23, 42, 0.12);
}

.profileCard__body {
  padding: 0 var(--space-4) var(--space-4);
}

.profileCard__name {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.profileCard__role {
  margin: 6px 0 var(--space-3);
  color: var(--muted);
  font-size: 13px;
}

.profileCard__links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Info list */
.infoList {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-3);
  display: grid;
  gap: 12px;
}

.infoItem {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
}

.infoIcon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: rgba(15, 23, 42, 0.8);
}

.infoIcon svg {
  display: block;
}

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

.infoLink {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
}

.infoLink:hover {
  color: var(--brand-ink);
  text-decoration: underline;
  text-decoration-color: rgba(31, 75, 153, 0.55);
  text-underline-offset: 3px;
}

.infoLink:focus-visible {
  color: var(--brand-ink);
  text-decoration: underline;
  text-decoration-color: rgba(31, 75, 153, 0.45);
  text-underline-offset: 3px;
}

/* Hero scroll CTA */
.hero__scroll {
  display: flex;
  justify-content: center;
  margin-top: var(--space-5);
}

.scrollBtn {
  font-size: 14px;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--brand-ink);
  border: 1px solid rgba(31, 75, 153, 0.14);
  text-decoration: none;
  transition: background 180ms ease, transform 180ms ease;
}

.scrollBtn:hover {
  background: rgba(31, 75, 153, 0.08);
  transform: translateY(-1px);
}

/* =========================
   Sections
   ========================= */
.section {
  padding: var(--space-8) 0;
}

.section--tint {
  background: linear-gradient(180deg, rgba(244, 247, 255, 0.62), rgba(244, 247, 255, 0.28));
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.sectionHeader {
  margin-bottom: var(--space-5);
}

.sectionHeader h2 {
  margin: 0 0 10px;
  font-family: var(--font-serif);
  letter-spacing: -0.03em;
  line-height: 1.08;
  font-size: clamp(30px, 3vw, 38px);
}

.sectionHeader p {
  margin: 0;
  color: var(--muted);
  max-width: 66ch;
  font-size: 15px;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

.grid3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-sm);
  padding: var(--space-4);
}

.card__top {
  margin-bottom: var(--space-2);
}

.card h3,
.card__top h3,
.tItem__content h3,
.subSection h3 {
  margin: 0 0 6px;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

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

.body {
  margin: 0;
  color: var(--text);
}

.tiny {
  font-size: 12px;
}

.card--hover {
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.card--hover:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.list {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
}

.list li {
  margin: 8px 0;
}

.list--tight li {
  margin: 6px 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--brand-ink);
  border: 1px solid rgba(31, 75, 153, 0.18);
  background: rgba(31, 75, 153, 0.06);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-2);
}

.callout {
  margin-top: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(31, 75, 153, 0.16);
  background: rgba(31, 75, 153, 0.045);
}

.callout__title {
  font-weight: 600;
  margin-bottom: 6px;
}

.callout__text {
  margin: 0;
  color: var(--muted);
}

.textLink {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin-top: var(--space-2);
  color: var(--brand-ink);
  text-decoration: underline;
  text-decoration-color: rgba(31, 75, 153, 0.25);
  text-underline-offset: 3px;
}

.textLink:hover {
  text-decoration-color: rgba(31, 75, 153, 0.55);
}

/* Timeline */
.timeline {
  display: grid;
  gap: var(--space-3);
}

.tItem {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-sm);
}

.tItem__time {
  font-weight: 600;
  color: var(--brand-ink);
  letter-spacing: -0.01em;
}

.tItem__content p {
  margin: 0;
}

/* Stats */
.statCard {
  padding: var(--space-4);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-sm);
}

.statCard__value {
  font-family: var(--font-serif);
  font-size: 28px;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
  color: var(--brand-ink);
}

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

/* Chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  color: var(--text);
}

.chip--solid {
  background: rgba(31, 75, 153, 0.06);
  border-color: rgba(31, 75, 153, 0.18);
  color: var(--brand-ink);
}

.subSection {
  margin-top: var(--space-5);
}

.subSection h3 {
  margin-bottom: var(--space-2);
}

/* Contact */
.contactSection {
  position: relative;
  overflow: hidden;
  padding-bottom: 0;
}

.contactGrid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: var(--space-3);
  align-items: stretch;
}

.contactCard {
  height: 100%;
  padding: clamp(28px, 3vw, 40px);
}

.contactCard--primary {
  background: linear-gradient(180deg, rgba(244, 247, 255, 0.78), rgba(255, 255, 255, 0.9));
  border-color: rgba(31, 75, 153, 0.16);
  box-shadow: var(--shadow-md);
}

.contactCard h3 {
  margin: 0 0 10px;
  font-size: clamp(24px, 3vw, 30px);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.contactLead {
  max-width: 58ch;
  color: var(--muted);
  font-size: 15px;
}

.contactActions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-3);
}

.contactEmailRow {
  margin-top: var(--space-3);
  padding: 14px 16px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.72);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.contactEmailLabel {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.contactEmailValue {
  font-weight: 600;
  color: var(--brand-ink);
  word-break: break-word;
}

.contactNote {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.contactToast {
  min-height: 24px;
  margin: 12px 0 0;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  background: rgba(31, 75, 153, 0.08);
  color: var(--brand-ink);
  font-size: 12px;
  font-weight: 600;
}

.contactToast:empty {
  padding: 0;
  min-height: 0;
  background: transparent;
}

.contactFacts {
  display: grid;
  gap: 14px;
  margin-top: var(--space-2);
}

.contactFact {
  padding: 14px 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  display: grid;
  gap: 6px;
}

.contactFact:first-child {
  padding-top: 4px;
}

.contactFact:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.contactFact__label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.contactFact__value {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
}

.contactFact--channels {
  gap: 12px;
}

.contactChannels {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}

.contactChannel {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  text-decoration: none;
  transition: color 160ms ease, opacity 160ms ease;
}

.contactChannel:hover {
  color: var(--brand-ink);
  opacity: 0.9;
}

.contactChannel__icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  flex: 0 0 24px;
}

.contactChannel__icon svg {
  width: 24px;
  height: 24px;
  display: block;
}

.contactChannel__icon--github {
  color: #4b5563;
}

.contactChannel__text {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Contact footer zone */
#contact {
  position: relative;
  overflow: hidden;
  padding-bottom: 0;
}

#contact .footer {
  margin-top: var(--space-6);
  padding: var(--space-4) 0 var(--space-4);
  position: relative;
  text-align: center;
}

#contact .footer p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

#contact .footer::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 100%;
  background: var(--tint);
  z-index: -1;
}

#contact .footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 1px;
  background: rgba(31, 75, 153, 0.42);
  z-index: 1;
}

#contact .wrap:last-child {
  margin-bottom: 0;
}

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 380ms ease, transform 380ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Global scroll offset */
section {
  scroll-margin-top: 74px;
}

#education {
  margin-top: var(--space-6);
}

/* Responsive */
@media (max-width: 980px) {
  .hero__grid {
    grid-template-columns: 1fr;
  }

  .hero__meta {
    grid-template-columns: 1fr;
  }

  .grid3 {
    grid-template-columns: 1fr;
  }

  .grid2 {
    grid-template-columns: 1fr;
  }

  .contactGrid {
    grid-template-columns: 1fr;
  }

  .contactCard {
    padding: 28px;
  }

  .tItem {
    grid-template-columns: 1fr;
  }

  .tItem__time {
    font-size: 13px;
  }
}

@media (max-width: 940px) {
  .nav__toggle {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .nav__menu {
    position: absolute;
    right: calc((100% - min(var(--max), calc(100% - 2 * var(--space-2)))) / 2);
    top: 62px;
    width: min(360px, calc(100vw - 24px));
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow-md);
  }

  .nav__menu.is-open {
    display: flex;
  }

  .nav__sections,
  .nav__utilities {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
  }

  .nav__utilities {
    border-top: 1px solid var(--border);
    margin-top: 4px;
    padding-top: 8px;
  }

  .nav__link {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .wrap {
    width: min(var(--max), calc(100% - 2 * var(--space-2)));
  }

  .hero {
    padding-top: var(--space-7);
  }

  .hero__title {
    font-size: clamp(34px, 12vw, 44px);
  }
}
