:root {
  --bg:      #F7F6F5;
  --ink:     rgb(67, 66, 66);
  --muted:   rgba(67, 66, 66, 0.58);
  --meta:    rgba(67, 66, 66, 0.70);
  --line:    rgba(67, 66, 66, 0.12);
  --pill:    rgba(67, 66, 66, 0.055);
  --pill-h:  rgba(67, 66, 66, 0.10);
  --tile-bg: rgba(67, 66, 66, 0.05);
  --shadow:  0 14px 40px -22px rgba(40, 38, 36, 0.45);
  --shadow-h:0 22px 56px -24px rgba(40, 38, 36, 0.55);
  --focus:   rgba(67, 66, 66, 0.55);
  --sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --ease-press: cubic-bezier(0.16, 1, 0.3, 1);
  --btn-press:  0.97;
  --btn-radius: 12px;
  --ripple:     rgba(67, 66, 66, 0.20);

  --accent:      #1b1a18;
  --accent-tint: rgba(27, 26, 24, 0.08);
  --seg-thumb:   #ffffff;
  --feed-bg:     #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg:      #1b1a18;
    --ink:     rgba(237, 235, 231, 0.92);
    --muted:   rgba(237, 235, 231, 0.52);
    --meta:    rgba(237, 235, 231, 0.64);
    --line:    rgba(237, 235, 231, 0.13);
    --pill:    rgba(237, 235, 231, 0.07);
    --pill-h:  rgba(237, 235, 231, 0.13);
    --tile-bg: rgba(237, 235, 231, 0.06);
    --shadow:  0 14px 40px -22px rgba(0, 0, 0, 0.7);
    --shadow-h:0 22px 56px -24px rgba(0, 0, 0, 0.8);
    --focus:   rgba(237, 235, 231, 0.6);
    --ripple:  rgba(237, 235, 231, 0.22);
    --accent:      rgba(237, 235, 231, 0.95);
    --accent-tint: rgba(237, 235, 231, 0.12);
    --seg-thumb:   #322f2c;
    --feed-bg:     #232120;
  }
}
:root[data-theme="dark"] {
  --bg:      #1b1a18;
  --ink:     rgba(237, 235, 231, 0.92);
  --muted:   rgba(237, 235, 231, 0.52);
  --meta:    rgba(237, 235, 231, 0.64);
  --line:    rgba(237, 235, 231, 0.13);
  --pill:    rgba(237, 235, 231, 0.07);
  --pill-h:  rgba(237, 235, 231, 0.13);
  --tile-bg: rgba(237, 235, 231, 0.06);
  --shadow:  0 14px 40px -22px rgba(0, 0, 0, 0.7);
  --shadow-h:0 22px 56px -24px rgba(0, 0, 0, 0.8);
  --focus:   rgba(237, 235, 231, 0.6);
  --ripple:  rgba(237, 235, 231, 0.22);
  --accent:      rgba(237, 235, 231, 0.95);
  --accent-tint: rgba(237, 235, 231, 0.12);
  --seg-thumb:   #322f2c;
  --feed-bg:     #232120;
}
:root[data-theme="black"] {
  --bg:      #000000;
  --ink:     rgba(237, 235, 231, 0.94);
  --muted:   rgba(237, 235, 231, 0.54);
  --meta:    rgba(237, 235, 231, 0.66);
  --line:    rgba(237, 235, 231, 0.16);
  --pill:    rgba(237, 235, 231, 0.085);
  --pill-h:  rgba(237, 235, 231, 0.15);
  --tile-bg: rgba(237, 235, 231, 0.07);
  --shadow:  0 14px 40px -22px rgba(0, 0, 0, 0.9);
  --shadow-h:0 22px 56px -24px rgba(0, 0, 0, 1);
  --focus:   rgba(237, 235, 231, 0.65);
  --ripple:  rgba(237, 235, 231, 0.24);
  --accent:      rgba(237, 235, 231, 0.97);
  --accent-tint: rgba(237, 235, 231, 0.14);
  --seg-thumb:   #1d1d1d;
  --feed-bg:     #121212;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0.2px;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
}

body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; }
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  position: relative; z-index: 1;
  width: 100%;
  padding: clamp(3.5rem, 11vw, 120px) 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(40px, 7vw, 64px);
  --col-w: 520px;
  --feed-w: var(--col-w);
}
.col {
  width: 100%; max-width: var(--col-w);
  padding-inline: 24px;
}
.feed { display: block; width: 100%; }
.feed-inner {
  width: 100%;
  max-width: var(--feed-w);
  margin-inline: auto;
  padding-inline: 24px;
  display: flex; flex-direction: column; gap: 18px;
  transition: max-width 0.15s linear;
}
@media (prefers-reduced-motion: reduce) { .feed-inner { transition: none; } }


.hero { display: flex; flex-direction: column; align-items: flex-start; gap: 22px; width: 100%;}
.photo {
  width: 128px; height: 128px;
  border-radius: 128px;
  overflow: hidden;
  background: var(--tile-bg);
  flex: none;
}
.photo img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  filter: grayscale(1) contrast(1.02);
  transition: filter 0.6s var(--ease), transform 0.6s var(--ease);
}
.photo:hover img, .photo:focus-within img { filter: grayscale(0); transform: scale(1.04); }

.identity { display: flex; flex-direction: column; gap: 4px; }
.name { font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.1px; }
.tagline { color: var(--meta); font-size: 14px; }

.intro {
  width: 100%;
  font-size: 17px;
  line-height: 1.55;
  max-width: 46ch;
}
.intro strong { font-weight: 600; color: var(--ink); }
.intro a {
  font-weight: 500;
  color: var(--accent);
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px; background-position: 0 100%; background-repeat: no-repeat;
  transition: background-size 0.35s var(--ease);
}
.intro a:hover { background-size: 100% 1px; }

section { width: 100%; display: flex; flex-direction: column; gap: 18px; }
.label {
  color: var(--meta);
  font-size: 12px; font-weight: 500;
  letter-spacing: 0.6px; text-transform: uppercase;
}

.xp { display: flex; flex-direction: column; }
.xp-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 24px;
  padding: 15px 0; border-bottom: 1px solid var(--line);
}
.xp-row:first-child { padding-top: 0; }
.xp-row:last-child { border-bottom: 0; padding-bottom: 0; }
.company { font-weight: 500; }
.role { color: var(--meta); font-size: 14px; margin-top: 3px; }
.dates { color: var(--meta); font-size: 14px; text-align: right; white-space: nowrap; }
@media (max-width: 460px) {
  .xp-row { flex-direction: column; gap: 4px; }
  .dates { text-align: left; white-space: normal; }
}

.btn {
  --btn-bg:    var(--pill);
  --btn-fg:    var(--ink);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; min-width: 80px; padding: 0 16px;
  border: 0; border-radius: var(--btn-radius);
  font-family: var(--sans); font-size: 14px; font-weight: 500; line-height: 1;
  letter-spacing: 0.1px; white-space: nowrap;
  color: var(--btn-fg); background: var(--btn-bg);
  cursor: pointer; user-select: none;
  transition:
    transform 180ms var(--ease-press),
    background-color 0.25s var(--ease),
    border-color 0.25s var(--ease),
    color 0.25s var(--ease),
    box-shadow 0.25s var(--ease),
    opacity 0.25s var(--ease);
}
.btn:active { transform: scale(var(--btn-press)); }
.btn svg { width: 16px; height: 16px; flex: none; }

.btn-sm { height: 32px; min-width: 64px; padding: 0 12px; font-size: 13px; border-radius: 8px; gap: 6px; }
.btn-lg { height: 48px; min-width: 96px; padding: 0 24px; font-size: 16px; border-radius: 14px; }
.btn-icon { min-width: 0; width: 40px; padding: 0; }
.btn-icon.btn-sm { width: 32px; } .btn-icon.btn-lg { width: 48px; }

.btn-solid    { --btn-bg: var(--accent); --btn-fg: var(--bg); }
.btn-flat     { --btn-bg: var(--pill); --btn-fg: var(--ink); }
.btn-bordered { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-light    { background: transparent; color: var(--ink); }
.btn-ghost    { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-shadow   { --btn-bg: var(--accent); --btn-fg: var(--bg); box-shadow: var(--shadow); }

@media (hover: hover) and (pointer: fine) {
  .btn-solid:hover, .btn-shadow:hover { opacity: 0.88; }
  .btn-flat:hover     { background: var(--pill-h); }
  .btn-bordered:hover { box-shadow: inset 0 0 0 1.5px var(--meta); }
  .btn-light:hover    { background: var(--pill); }
  .btn-ghost:hover    { background: var(--ink); color: var(--bg); box-shadow: inset 0 0 0 1.5px var(--ink); }
  .btn-shadow:hover   { box-shadow: var(--shadow-h); }
}

.pills { display: flex; flex-direction: row; flex-wrap: wrap; gap: 10px; }
.pill {
  position: relative; isolation: isolate; overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 44px;
  background: var(--pill);
  padding: 10px 17px; border-radius: 999px;
  font-size: 15px; font-weight: 500;
  transition: transform 180ms var(--ease-press), background-color 0.25s var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .pill:hover { background: var(--pill-h); }
}
.pill:active { transform: scale(var(--btn-press)); }
.pill svg { width: 13px; height: 13px; opacity: 0.55; flex: none; }

.feed-list { display: flex; flex-direction: column; gap: 30px; width: 100%; }
.item { display: flex; flex-direction: column; gap: 12px; }
.tile {
  width: 100%; border-radius: 8px; overflow: hidden;
  background: var(--tile-bg);
}
.tile img, .tile video {
  width: 100%; height: 100%; object-fit: contain; display: block;
}
.r-169 { aspect-ratio: 16 / 9; }
.r-43  { aspect-ratio: 4 / 3; }
.r-portrait { aspect-ratio: 3 / 4; }

.caption { display: flex; flex-direction: column; gap: 1px; padding-inline: 4px; }
.caption .title { font-weight: 500; font-size: 15px; }
.caption .context { color: var(--meta); font-size: 14px; }

footer {
  margin-top: 8px;
  padding-block: 28px 56px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  color: var(--meta); font-size: 13px;
}
.footer-links { display: flex; gap: 16px; }
.footer-links a { transition: color 0.25s var(--ease); }
.footer-links a:hover { color: var(--ink); }

.reveal { opacity: 0; transform: translateY(10px); }
.reveal.in { opacity: 1; transform: none; transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }

.text-reveal { opacity: 0; }
.text-reveal.in { opacity: 1; }

.te-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.42em);
  filter: blur(5px);
  transition: opacity 0.6s var(--ease),
              transform 0.6s var(--ease),
              filter 0.6s var(--ease);
  transition-delay: var(--d, 0ms);
}
.text-reveal:not(.te-done) .te-word { will-change: opacity, transform, filter; }
.text-reveal.in .te-word { opacity: 1; transform: none; filter: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .reveal.in { opacity: 1 !important; transform: none !important; transition: none; }
  .text-reveal { opacity: 1 !important; }
  .te-word { opacity: 1 !important; transform: none !important; filter: none !important; transition: none; }
  .photo img, .tile img, .tile video, .pill, .tile, .btn { transition: none; }
  .btn:active, .pill:active { transform: none; }   /* pas de scale en reduced-motion */
}

.cl-head { display: flex; flex-direction: column; gap: 12px; }
.cl-back {
  display: inline-flex; align-items: center; gap: 7px; align-self: flex-start;
  color: var(--meta); font-size: 14px; font-weight: 500;
  transition: color 0.25s var(--ease), transform 0.25s var(--ease);
}
.cl-back svg { width: 15px; height: 15px; flex: none; }
.cl-back:hover { color: var(--ink); transform: translateX(-2px); }
.cl-title-page { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.3px; }
.cl-sub { color: var(--meta); font-size: 15px; line-height: 1.55; max-width: 46ch; }

.cl-list {
  position: relative;
  display: flex; flex-direction: column; gap: 34px;
  margin-top: 6px; padding-left: 26px;
}
.cl-list::before {
  content: ""; position: absolute; left: 5px; top: 7px; bottom: 7px;
  width: 1px; background: var(--line);
}
.cl-entry { position: relative; display: flex; flex-direction: column; gap: 6px; }
.cl-entry::before {
  content: ""; position: absolute; left: -26px; top: 6px;
  width: 11px; height: 11px; border-radius: 999px;
  background: var(--bg); box-shadow: inset 0 0 0 2px var(--meta);
}
.cl-date {
  display: flex; align-items: center; gap: 8px;
  color: var(--meta); font-size: 12px; font-weight: 500;
  letter-spacing: 0.6px; text-transform: uppercase;
}
.cl-tag {
  padding: 2px 9px; border-radius: 999px;
  background: var(--pill); color: var(--meta);
  font-size: 11px; letter-spacing: 0.4px;
}
.cl-h { font-weight: 500; font-size: 16px; letter-spacing: -0.1px; }
.cl-text { color: var(--muted); font-size: 15px; line-height: 1.55; max-width: 60ch; }
.cl-text a {
  font-weight: 500;
  color: var(--accent);
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px; background-position: 0 100%; background-repeat: no-repeat;
  transition: background-size 0.35s var(--ease);
}
.cl-text a:hover { background-size: 100% 1px; }


.settings {
  position: fixed;
  top: clamp(14px, 2.4vw, 22px);
  right: clamp(24px, 2.4vw, 22px);
  z-index: 90;
}
.nav-settings { position: relative; flex: none; }

.nav-gear {
  width: 40px; height: 40px;
  border: 0; border-radius: 999px;
  background: var(--pill);
  display: grid; place-items: center;
  cursor: pointer; color: var(--meta);
  -webkit-tap-highlight-color: transparent;
  transition: color 0.25s var(--ease), background 0.25s var(--ease),
              transform 160ms var(--ease-press);
}
.nav-gear svg { width: 19px; height: 19px; }
@media (hover: hover) { .nav-gear:hover { color: var(--ink); background: var(--pill-h); } }
.nav-gear:active { transform: scale(0.94); }
.nav-gear[aria-expanded="true"] { color: var(--ink); background: var(--pill-h); }

.theme-pop {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 1;
  min-width: 188px; padding: 7px;
  background: var(--feed-bg);
  border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow-h);
  display: flex; flex-direction: column; gap: 1px;
  transform-origin: top right;
}
.theme-pop[hidden] { display: none; }
.theme-pop-label {
  font-size: 11px; font-weight: 500; letter-spacing: 0.6px; text-transform: uppercase;
  color: var(--meta); padding: 7px 10px 6px;
}
.theme-opt {
  display: flex; align-items: center; width: 100%;
  border: 0; background: transparent; cursor: pointer; text-align: left;
  padding: 10px 11px; border-radius: 10px;
  font-family: inherit; font-size: 14px; font-weight: 500; color: var(--ink);
  -webkit-tap-highlight-color: transparent;
  transition: background 0.18s var(--ease), color 0.18s var(--ease),
              transform 140ms var(--ease-press);
}
.theme-opt .opt-name { flex: 1 1 auto; }
.theme-opt .check {
  width: 16px; height: 16px; flex: none; margin-left: 12px;
  opacity: 0; transform: scale(0.6);
  transition: opacity 0.18s var(--ease), transform 0.24s var(--ease-spring);
}
@media (hover: hover) { .theme-opt:hover { background: var(--pill); } }
.theme-opt:active { transform: scale(0.985); }
.theme-opt[aria-checked="true"] { color: var(--accent); }
.theme-opt[aria-checked="true"] .check { opacity: 1; transform: none; }


.page-title { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.3px; }
.page-sub { color: var(--meta); font-size: 15px; line-height: 1.55; max-width: 50ch; }
.about { font-size: 17px; line-height: 1.55; max-width: 52ch; }
.about strong { font-weight: 600; color: var(--ink); }
.about a, .xp-link {
  color: var(--accent); font-weight: 500;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px; background-position: 0 100%; background-repeat: no-repeat;
  transition: background-size 0.35s var(--ease);
}
.about a:hover, .xp-link:hover { background-size: 100% 1px; }


.xp-desc { color: var(--muted); font-size: 14px; line-height: 1.5; margin-top: 8px; max-width: 52ch; }
.edu-school { font-weight: 500; }
.edu-detail { color: var(--meta); font-size: 14px; margin-top: 3px; }


.feed-zone {
  width: 100%;
  background: var(--feed-bg);
  display: flex; flex-direction: column; align-items: center;
  gap: clamp(40px, 7vw, 64px);
  padding-block: clamp(44px, 7vw, 84px);
  transition: background 0.4s var(--ease);
}

.connect-list { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; }
.connect-link {
  font-size: 16px; color: var(--muted);
  transition: color 0.25s var(--ease);
}
.connect-link .handle {
  color: var(--ink); font-weight: 500;
  transition: color 0.25s var(--ease);
}
@media (hover: hover) {
  .connect-link:hover { color: var(--meta); }
  .connect-link:hover .handle { color: var(--accent); }
}


.toaster {
  position: fixed;
  left: 50%;
  top: clamp(18px, 4vw, 30px);
  transform: translateX(-50%);
  z-index: 80;
  display: grid;
  justify-items: center;
  pointer-events: none;
}
.toast {
  grid-area: 1 / 1;
  pointer-events: auto;
  transform-origin: bottom center;
  transform: translateY(calc(var(--i, 0) * -11px)) scale(calc(1 - var(--i, 0) * 0.05));
  opacity: calc(1 - var(--i, 0) * 0.32);
  z-index: calc(10 - var(--i, 0));
  transition: transform 0.38s var(--ease), opacity 0.38s var(--ease);
}
.toast-inner {
  display: inline-flex; align-items: center; gap: 9px;
  height: 44px; padding: 0 18px 0 15px;
  max-width: min(90vw, 360px);
  border-radius: 999px;
  background: var(--feed-bg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-h);
  color: var(--ink); font-size: 14px; font-weight: 500;
  letter-spacing: 0.1px; white-space: nowrap;
  transition: opacity 0.38s var(--ease), transform 0.38s var(--ease);
}
.toast-inner .check { width: 17px; height: 17px; flex: none; color: var(--accent); }
.toast-inner .toast-msg { overflow: hidden; text-overflow: ellipsis; }

.toast.enter .toast-inner { opacity: 0; transform: translateY(14px) scale(0.96); }
.toast.leave .toast-inner {
  opacity: 0; transform: translateY(10px) scale(0.97);
  transition: opacity 0.24s var(--ease), transform 0.24s var(--ease);
}

@media (hover: hover) {
  .toaster:hover .toast,
  .toaster:focus-within .toast {
    transform: translateY(calc(var(--i, 0) * -54px));
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .toast { transform: none !important; opacity: 1; transition: opacity 0.2s var(--ease); }
  .toast:not(.is-front) { display: none; }   /* on ne montre que le toast de devant */
  .toast-inner { transition: opacity 0.2s var(--ease); }
  .toast.enter .toast-inner,
  .toast.leave .toast-inner { transform: none; }
}