/* Polices auto-hébergées (SIL Open Font License) : Syne, IBM Plex Sans, IBM Plex Mono. */

@font-face {
  font-family: "Syne";
  src: url("fonts/syne-var.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("fonts/plex-sans-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("fonts/plex-sans-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

/* Thème sombre par défaut, thème clair sur demande (bouton, mémorisé). */

:root {
  color-scheme: dark;

  --bg: #0a1216;
  --surface: #101c21;
  --text: #e9efed;
  --muted: #93a5a8;
  --rule: #223238;
  --accent: #ff5a3c;
  --on-accent: #0a1216;
  --edge: #3a6470;
  --node: #5fb0b0;

  --display: "Syne", "Helvetica Neue", Arial, sans-serif;
  --text-font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --gutter: 20px;
  --top-h: 56px;
}

:root[data-theme="light"] {
  color-scheme: light;

  --bg: #e7efee;
  --surface: #d8e5e3;
  --text: #0d1f26;
  --muted: #40545b;
  --rule: #bccbca;
  --accent: #b02d1b;
  --on-accent: #ffffff;
  --edge: #8fb1b0;
  --node: #35646d;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--text-font);
  font-size: 1.02rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

[id], .row { scroll-margin-top: calc(var(--top-h) + 20px); }

.wrap {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}
a:hover { text-decoration-thickness: 2px; }

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -5rem;
  background: var(--text);
  color: var(--bg);
  padding: 0.5rem 0.9rem;
  z-index: 30;
}
.skip:focus { top: 8px; }

/* Barre du haut */

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
}

.top-in {
  display: flex;
  position: relative;
  align-items: center;
  gap: 8px 14px;
  min-height: var(--top-h);
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.brand {
  margin-right: auto;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  view-transition-name: brand;
}
.brand::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 10px;
  background: var(--accent);
}

.brand-full { display: none; }

@media (min-width: 480px) {
  .brand-full { display: inline; }
  .brand-short { display: none; }
}

.top-nav { display: none; gap: 22px; }
.top-nav a { color: var(--muted); text-decoration: none; padding: 6px 0; }
.top-nav a:hover { color: var(--text); }

@media (min-width: 860px) {
  .top-in { gap: 8px 22px; }
  .top-nav { display: flex; }
}

/* Sélecteur de langue */

.lang {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-weight: 500;
}
.lang a { padding: 6px 2px; }
.lang span { color: var(--muted); }
.lang [aria-current] { color: var(--text); }

.theme {
  font: inherit;
  font-weight: 500;
  color: var(--text);
  background: none;
  border: 1px solid var(--rule);
  padding: 6px 10px;
  cursor: pointer;
  white-space: nowrap;
}
.theme:hover { border-color: var(--text); }

/* Tracé du scroll : un paquet parcourt le bas de la barre au fil de la page. */

.route { display: none; }

@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .route {
      display: block;
      position: absolute;
      left: 0;
      bottom: -2px;
      width: 28px;
      height: 3px;
      background: var(--accent);
      animation: route linear both;
      animation-timeline: scroll(root block);
    }
  }
}

@keyframes route {
  from { left: 0; }
  to   { left: calc(100% - 28px); }
}

/* Hero */

.hero {
  padding: clamp(28px, 5vw, 64px) 0 clamp(36px, 6vw, 72px);
  border-bottom: 1px solid var(--rule);
}

.hero-grid {
  display: grid;
  gap: 28px;
  align-items: center;
}

.name {
  margin: 0 0 20px;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.9rem, 10.5vw, 6rem);
  line-height: 0.94;
  letter-spacing: -0.035em;
}

.role {
  margin: 0 0 14px;
  max-width: 32rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.15rem, 2.2vw, 1.4rem);
  line-height: 1.3;
}

.pitch {
  margin: 0 0 22px;
  max-width: 33rem;
  color: var(--muted);
}

.availability {
  position: relative;
  margin: 0 0 26px;
  padding: 14px 16px 14px 40px;
  max-width: 33rem;
  background: var(--surface);
  border-left: 3px solid var(--accent);
  line-height: 1.5;
}

.dot {
  position: absolute;
  left: 16px;
  top: 1.25em;
  width: 9px;
  height: 9px;
  background: var(--accent);
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 22px;
  margin: 0;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.92rem;
}

.hero-links a:nth-child(-n+2) {
  padding: 10px 16px;
  border: 1px solid var(--accent);
  text-decoration: none;
}
.hero-links a:first-child {
  background: var(--accent);
  color: var(--on-accent);
}
.hero-links a:nth-child(2):hover {
  background: var(--accent);
  color: var(--on-accent);
}
.hero-links a:first-child:hover { filter: brightness(1.1); }

/* Carte du réseau */

.net-wrap { min-width: 0; }

.net {
  display: block;
  width: 100%;
  height: clamp(340px, 100vw, 460px);
  touch-action: pan-y;
}

.net-caption {
  margin: 8px 0 0;
  min-height: 3em;
  font-family: var(--mono);
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--muted);
}

/* Sans JavaScript, la carte n'existe pas : on masque son emplacement. */
.net-wrap:not(.on) { display: none; }

@media (min-width: 980px) {
  .hero-grid { grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); gap: 40px; }
  .net { height: min(74vh, 660px); }
}

/* Sections */

main { counter-reset: section; }

.section {
  padding: clamp(44px, 6vw, 84px) 0;
  border-bottom: 1px solid var(--rule);
}

.section h2 {
  counter-increment: section;
  margin: 0 0 clamp(22px, 4vw, 38px);
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.45rem, 7.2vw, 2.9rem);
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.section h2::before {
  content: counter(section, decimal-leading-zero);
  display: block;
  margin-bottom: 8px;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--accent);
}

h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.22rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

/* Lignes datées (projets, expérience, formation) */

.rows {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--text);
  container-type: inline-size;
}

.row {
  display: grid;
  gap: 6px 36px;
  padding: 26px 0;
  border-bottom: 1px solid var(--rule);
}

@container (min-width: 700px) {
  .row { grid-template-columns: 9.5rem minmax(0, 1fr); }
}

.when {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  color: var(--muted);
  padding-top: 0.3em;
}

.stack {
  margin: 6px 0 12px;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--node);
}

.what ul {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 44rem;
}

.what li {
  position: relative;
  margin: 0 0 8px;
  padding-left: 20px;
}

.what li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.78em;
  width: 9px;
  height: 1px;
  background: var(--muted);
}

.more {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
  margin: 14px 0 0;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.9rem;
}

/* Projets secondaires : une ligne chacun */
.mini-stack {
  margin-left: 6px;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--node);
}
.what .mini { margin-top: 10px; }
@media (max-width: 599px) {
  .mini-stack { display: block; margin-left: 0; }
}
.what .mini strong { font-weight: 600; }
.row + .aside, .rows + .aside { margin-top: 20px; }

/* Ligne visée depuis la carte du réseau */
.row.ping { animation: ping 1.4s ease-out; }

@keyframes ping {
  from { box-shadow: inset 3px 0 0 var(--accent); background: var(--surface); }
  to   { box-shadow: inset 3px 0 0 transparent; background: transparent; }
}

.aside {
  margin: 28px 0 0;
  max-width: 44rem;
  color: var(--muted);
}

/* Parcours : carte schématique (villes placées selon leurs coordonnées réelles) */

.path {
  display: grid;
  gap: 20px 40px;
  align-items: center;
  margin: 0 0 clamp(28px, 4vw, 44px);
  container-type: inline-size;
}

.path-map {
  display: block;
  width: 100%;
  height: auto;
  max-width: 560px;
  border: 1px solid var(--rule);
  background: var(--bg);
}

.path-sea { fill: var(--surface); }
.path-coast { fill: none; stroke: var(--edge); stroke-width: 1.5; }
.path-water { fill: var(--muted); font-family: var(--mono); font-size: 14px; letter-spacing: 0.06em; text-anchor: middle; }
.path-route { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.path-goal { fill: none; stroke: var(--text); stroke-width: 1.5; stroke-dasharray: 5 6; }
.path-stop { fill: var(--accent); stroke: var(--accent); stroke-width: 2; }
.path-stop-goal { fill: var(--bg); stroke: var(--text); }
.path-num { fill: var(--on-accent); font-family: var(--mono); font-weight: 500; font-size: 14px; text-anchor: middle; }
.path-city { fill: var(--text); font-family: var(--display); font-weight: 700; font-size: 19px; text-anchor: middle; }
.path-packet { fill: var(--text); opacity: 0; }

.path figcaption { min-width: 0; }

.path-lead {
  margin: 0 0 14px;
  max-width: 34rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.12rem;
  line-height: 1.4;
}

.path-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  max-width: 34rem;
}

.path-steps li {
  counter-increment: step;
  position: relative;
  margin: 0 0 12px;
  padding-left: 34px;
}

.path-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.2em;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.8rem;
  line-height: 1;
}

.path-steps strong { font-weight: 600; }

@media (min-width: 900px) {
  .path { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

@media (prefers-reduced-motion: no-preference) {
  @supports (offset-path: path("M0 0 L1 1")) {
    .path-packet {
      opacity: 1;
      offset-path: path("M118.1 61.1 Q 243 14 368.1 58.5 Q 243 124 118.1 61.1");
      offset-rotate: 0deg;
      animation: path-travel 6s linear infinite;
    }
  }
}

@keyframes path-travel {
  0%   { offset-distance: 0%; opacity: 0; }
  12%  { opacity: 1; }
  88%  { opacity: 1; }
  100% { offset-distance: 100%; opacity: 0; }
}

/* Ce sur quoi je travaille en ce moment (Rampe) : section à part, sur fond distinct */

.now {
  background: var(--surface);
  border-top: 3px solid var(--accent);
}

.now h4 {
  margin: 32px 0 10px;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.now-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 18px;
  padding-top: 18px;
  border-top: 1px solid var(--text);
}

.now-name {
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* « En cours » est dit en toutes lettres : la pastille n'est qu'un ornement. */
.now-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 4px 10px;
  border: 1px solid var(--text);
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.82rem;
}

.now-dot {
  width: 8px;
  height: 8px;
  flex: none;
  background: var(--accent);
}

.now-lead {
  margin: 14px 0 0;
  max-width: 44rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.08rem, 2vw, 1.3rem);
  line-height: 1.4;
}

.now-grid {
  display: grid;
  gap: 8px 44px;
  align-items: start;
}

.now-text p { margin: 0 0 12px; max-width: 44rem; }

.now-caveat {
  padding: 10px 14px;
  border-left: 3px solid var(--text);
  background: var(--bg);
}

.now-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 44rem;
}

.now-list li {
  position: relative;
  margin: 0 0 8px;
  padding-left: 20px;
}

.now-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.78em;
  width: 9px;
  height: 1px;
  background: var(--muted);
}

.now-points { max-width: none; container-type: inline-size; }

@container (min-width: 760px) {
  .now-points { display: grid; grid-template-columns: 1fr 1fr; column-gap: 40px; }
}

.now-points strong,
.now-list strong { font-weight: 600; }

.now-p { margin: 0 0 12px; max-width: 46rem; }

.now-shot { margin: 24px 0 0; min-width: 0; }

.now-shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
}

.now-shot figcaption {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
}

.now-foot {
  display: grid;
  gap: 0 44px;
}

.now-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.92rem;
}

.now-tags {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.now-tags li {
  padding: 3px 9px;
  border: 1px solid var(--muted);
  font-family: var(--mono);
  font-size: 0.8rem;
}

@media (min-width: 980px) {
  .now-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .now-shot { margin-top: 32px; }
  .now-foot { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

/* Compétences */

.skills {
  margin: 0;
  border-top: 1px solid var(--text);
}

.skills dt {
  padding-top: 18px;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.skills dd {
  margin: 2px 0 0;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rule);
  max-width: 44rem;
}

@media (min-width: 760px) {
  .skills { display: grid; grid-template-columns: 9.5rem 1fr; column-gap: 36px; }
  .skills dt { padding: 20px 0 18px; border-bottom: 1px solid var(--rule); }
  .skills dd { margin: 0; padding: 18px 0; max-width: none; }
}

/* Contact */

.contact-lead {
  margin: 0 0 22px;
  max-width: 32rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.3rem;
  line-height: 1.4;
}

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 1.02rem;
  overflow-wrap: anywhere;
}

/* Page des rapports */

.reports-hero {
  padding: clamp(28px, 5vw, 60px) 0 clamp(28px, 5vw, 52px);
}

.reports-name {
  margin: 14px 0 18px;
  font-size: clamp(1.9rem, 5.6vw, 3.6rem);
  overflow-wrap: anywhere;
  line-height: 1;
}

.reports-hero .pitch { max-width: 46rem; margin-bottom: 0; }

.back {
  margin: 0;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.9rem;
}

.reports-group { margin-top: 40px; }
.reports-group:first-child { margin-top: 0; }

.section .reports-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
  margin: 0;
  padding-bottom: 12px;
  font-size: clamp(1.4rem, 4vw, 1.8rem);
  border-bottom: 1px solid var(--text);
}
.section .reports-title::before { flex-basis: 100%; margin-bottom: 0; }

.reports-count {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.reports {
  list-style: none;
  margin: 0;
  padding: 0;
}

.reports > li {
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
}

.report-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 18px;
}

.report-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.1rem;
}

.report-actions {
  flex: none;
  display: flex;
  gap: 18px;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.86rem;
  white-space: nowrap;
}

.report-desc {
  margin: 6px 0 0;
  max-width: 46rem;
  color: var(--muted);
}

.reports-group + .more { margin-top: 32px; }

/* Pied de page */

.footer {
  padding: 28px 0 44px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.8rem;
}
.footer p { margin: 0; }

/* Mouvement : tout ce qui suit est désactivé avec prefers-reduced-motion. */

@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }

  .dot { animation: beat 2.4s ease-in-out infinite; }

  /* Révélation au scroll, en CSS natif quand le navigateur le permet…
     Seul transform est animé : un texte semi-transparent ferait tomber le contraste sous le seuil AA. */
  @supports (animation-timeline: view()) {
    main .row,
    main .section h2,
    .skills dt,
    .skills dd,
    .contact-list li,
    .reports > li {
      animation: reveal linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 55%;
    }
  }

  /* … sinon par IntersectionObserver (classes posées par script.js). */
  .io .rv {
    transform: translateY(18px);
    transition: transform 520ms cubic-bezier(0.2, 0.8, 0.25, 1);
  }
  .io .rv.in {
    transform: none;
  }
}

@keyframes beat {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}

@keyframes reveal {
  from { transform: translateY(18px); }
  to   { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .row.ping { animation: none; }
}
