/* VOICE   sobre, factuel, lisible en trente secondes par un recruteur
   IDEA    un registre : la date à gauche, les faits à droite, comme le CV
   PICTURE la seule image est la topologie réelle de la SAÉ 201
   COLOUR  blanc, encre presque noire, un bleu pour les liens et l'état actif
   TYPE    Public Sans seule, de 400 à 700 ; LAYOUT une colonne de 50 rem

   Sommaire : 1 police · 2 variables · 3 base · 4 en-tête · 5 présentation
              6 sections et lignes · 7 pied · 8 adaptations · 9 impression */

/* ── 1. Police ── */
@font-face {
  font-family: "Public Sans";
  src: url("../assets/fonts/public-sans-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

/* ── 2. Variables ── */
:root {
  color-scheme: light dark;
  --bg:    light-dark(#FFFFFF, #121417);
  --tint:  light-dark(#F5F7F9, #1A1D21);
  --rule:  light-dark(#E3E6EA, #2A2F35);
  --ink:   light-dark(#14171A, #ECEEF0);
  --body:  light-dark(#30363C, #C9CDD2);
  --muted: light-dark(#5B6470, #98A1AC);
  --blue:  light-dark(#1F4FD1, #7FA3FF);
  --blue-bg: light-dark(#EAF0FF, #1C2740);
  --todo:  light-dark(#FFF1A8, #4A4214);

  --font: "Public Sans", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --fs-h1: clamp(2.5rem, 6vw, 3.5rem);
  --fs-h2: 1.5rem;
  --fs-h3: 1.0625rem;
  --fs-body: 1rem;
  --fs-small: .875rem;

  --s-1: .25rem; --s-2: .5rem; --s-3: .75rem; --s-4: 1rem;
  --s-5: 1.5rem; --s-6: 2rem;  --s-7: 3rem;   --s-8: 4.5rem;

  --page: 50rem;          /* largeur du contenu */
  --date: 8.5rem;         /* colonne des dates */
  --gutter: clamp(1.25rem, 5vw, 2rem);
  --top-h: 3.75rem;
  --radius: 4px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
:root[data-theme=light] { color-scheme: light; }
:root[data-theme=dark]  { color-scheme: dark; }

/* ── 3. Base ── */
*, *::before, *::after { box-sizing: border-box; min-width: 0; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--top-h) + var(--s-4)); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--body);
  font: 400 var(--fs-body)/1.6 var(--font);
  -webkit-font-smoothing: antialiased; overflow-x: clip;
}
h1, h2, h3, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
sup { font-size: .7em; line-height: 0; }

a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--rule); text-decoration-thickness: 1px; text-underline-offset: .22em; transition: text-decoration-color .2s, color .2s; }
a:hover { text-decoration-color: var(--blue); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 2px; }
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .86em; background: var(--tint); padding: .1em .35em; border-radius: 3px; overflow-wrap: anywhere; }

.wrap { max-width: calc(var(--page) + var(--gutter) * 2); margin: 0 auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: var(--gutter); top: -4rem; z-index: 30; padding: var(--s-2) var(--s-4); background: var(--ink); color: var(--bg); border-radius: var(--radius); text-decoration: none; }
.skip:focus { top: var(--s-2); }

/* À remplacer avant mise en ligne : grep "À COMPLÉTER" */
.todo { background: var(--todo); color: var(--ink); padding: 0 .3em; border-radius: 2px; font-weight: 500; box-decoration-break: clone; -webkit-box-decoration-break: clone; }

/* Boutons */
.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  min-height: 2.75rem; padding: 0 1.1rem;
  font: 600 .9375rem/1 var(--font); text-decoration: none;
  color: var(--bg); background: var(--ink); border: 1px solid var(--ink); border-radius: var(--radius);
  transition: background .2s, border-color .2s, color .2s;
}
.btn:hover { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn svg { transition: transform .2s var(--ease); }
.btn:hover svg { transform: translateY(2px); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn--ghost:hover { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn--small { min-height: 2.25rem; padding: 0 .85rem; font-size: .875rem; }

/* ── 4. En-tête ── */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule); }
.top__in { max-width: calc(var(--page) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); min-height: var(--top-h); display: flex; align-items: center; gap: var(--s-5); }
.top__name { font-weight: 700; color: var(--ink); text-decoration: none; margin-right: auto; white-space: nowrap; }
.top__nav { display: flex; gap: var(--s-5); }
.top__nav a { display: block; padding: var(--s-2) 0; font-size: var(--fs-small); color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; transition: color .2s, border-color .2s; }
.top__nav a:hover { color: var(--ink); }
.top__nav a[aria-current="true"] { color: var(--ink); border-bottom-color: var(--blue); }
.top__lang { font: 600 .8125rem/1 var(--font); color: var(--muted); background: none; border: 1px solid var(--rule); border-radius: var(--radius); min-height: 2.25rem; padding: 0 .6rem; cursor: pointer; }
.top__lang:hover { color: var(--ink); border-color: var(--ink); }

/* ── 5. Présentation ── */
.intro { padding: clamp(3rem, 9vh, 5.5rem) 0 var(--s-7); }
.status { display: inline-flex; align-items: center; gap: .5rem; font-size: .8125rem; font-weight: 500; padding: .3rem .7rem; border-radius: 99px; background: var(--blue-bg); color: var(--blue); }
.status i { width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; }
.intro h1 { margin-top: var(--s-5); font-size: var(--fs-h1); font-weight: 700; line-height: 1.05; letter-spacing: -.025em; color: var(--ink); }
.intro__role { margin-top: var(--s-3); font-size: clamp(1.125rem, 2.2vw, 1.3125rem); font-weight: 500; color: var(--ink); }
.intro__lead { margin-top: var(--s-4); max-width: 38rem; font-size: 1.0625rem; }
.intro__actions { margin-top: var(--s-6); display: flex; flex-wrap: wrap; gap: var(--s-3); }
.intro__links { margin-top: var(--s-5); display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); font-size: var(--fs-small); }

/* ── 6. Sections et lignes du registre ── */
.sec { padding-top: var(--s-8); }
.sec h2 { font-size: var(--fs-h2); font-weight: 700; letter-spacing: -.015em; line-height: 1.2; color: var(--ink); padding-bottom: var(--s-3); border-bottom: 1px solid var(--ink); }
.sec__intro { margin-top: var(--s-3); font-size: var(--fs-small); color: var(--muted); }

.row {
  position: relative;
  display: grid; grid-template-columns: var(--date) minmax(0, 1fr); gap: var(--s-5);
  padding: var(--s-5) 0;
  border-bottom: 1px solid var(--rule);
}
.row__when { font-size: var(--fs-small); color: var(--muted); font-variant-numeric: tabular-nums; padding-top: .1rem; }
h3.row__when { font-weight: 600; color: var(--ink); }
.row__body > * + * { margin-top: var(--s-2); }
.row h3:not(.row__when) { font-size: var(--fs-h3); font-weight: 650; line-height: 1.35; color: var(--ink); }
.row__org { font-size: var(--fs-small); color: var(--muted); }
.row__meta, .row__note { font-size: var(--fs-small); color: var(--muted); }
.row__body > .row__meta, .row__body > .row__note { margin-top: var(--s-3); }
.row--small h3:not(.row__when) { font-size: 1rem; }
.row--small p { font-size: .9375rem; }

.list li { position: relative; padding-left: 1rem; }
.list li + li { margin-top: .3rem; }
.list li::before { content: ""; position: absolute; left: 0; top: .72em; width: .35rem; height: .35rem; border-radius: 50%; background: var(--rule); }

/* Survol d'un projet : le titre se souligne, un filet bleu marque la ligne */
.row--link::before {
  content: ""; position: absolute; left: calc(var(--s-4) * -1); top: var(--s-5); bottom: var(--s-5); width: 2px;
  background: var(--blue); transform: scaleY(0); transform-origin: top; transition: transform .25s var(--ease);
}
.row--link:hover::before, .row--link:focus-within::before { transform: none; }
.row--link h3 { text-decoration: underline; text-decoration-color: transparent; text-underline-offset: .25em; transition: text-decoration-color .2s; }
.row--link:hover h3, .row--link:focus-within h3 { text-decoration-color: var(--blue); }

.fig { margin-top: var(--s-4) !important; max-width: 36rem; }
.fig a { display: block; border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; background: #fff; }
.fig figcaption { margin-top: var(--s-2); font-size: .8125rem; color: var(--muted); }

.row--contact .row__body p { font-size: 1.0625rem; }
.row--contact .row__body a { font-weight: 500; overflow-wrap: anywhere; }

/* ── 7. Pied ── */
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-2) var(--s-5); padding-top: var(--s-7); padding-bottom: var(--s-7); font-size: .8125rem; color: var(--muted); }

/* ── 8. Adaptations ── */
@media (max-width: 47.5rem) {
  .top__nav { display: none; }                 /* la page est courte : le CV reste accessible */
}
@media (max-width: 37.5rem) {
  :root { --s-8: 3.5rem; }
  .row { grid-template-columns: minmax(0, 1fr); gap: var(--s-1); padding: var(--s-4) 0; }
  .row--link::before { display: none; }
  .intro__actions .btn { flex: 1 1 auto; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

/* ── 9. Impression : la page sort comme un CV propre ── */
@media print {
  :root { color-scheme: light; --bg: #fff; --ink: #000; --body: #111; --muted: #444; --rule: #ccc; }
  .top, .skip, .intro__actions, .fig, .foot { display: none; }
  body { font-size: 10pt; }
  .intro { padding: 0 0 1rem; }
  .sec { padding-top: 1.25rem; }
  .row { break-inside: avoid; padding: .6rem 0; }
  a { text-decoration: none; }
}
