/* Thomas Fonteneau – piste C « Signal » – feuille de style unique */

/* ---------- Polices locales (IBM Plex, SIL OFL 1.1, voir assets/fonts/) ---------- */
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/IBMPlexMono-Regular-Latin1.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/IBMPlexMono-SemiBold-Latin1.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("../fonts/IBMPlexSans-Regular-Latin1.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("../fonts/IBMPlexSans-Medium-Latin1.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("../fonts/IBMPlexSans-SemiBold-Latin1.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}

@font-face { font-family: "PlexMono-secours"; src: local("Courier New"); ascent-override: 102.5%; descent-override: 27.5%; line-gap-override: 0%; }
@font-face { font-family: "PlexSans-secours"; src: local("Arial"); ascent-override: 102.5%; descent-override: 27.5%; line-gap-override: 0%; }

/* ---------- Jetons (charte § 11) ---------- */
:root {
  --light: #F2F2EF;
  --dark: #121212;
  --dark-hover: #2A2A2A;
  --grey-l: #5C5C5C;
  --grey-d: #A3A3A3;
  --rule-l: #767676;
  --rule-d: #6B6B6B;
  --signal: #FF5B14;

  --bg: var(--light);
  --text: var(--dark);
  --text-muted: var(--grey-l);
  --border: var(--rule-l);
  --focus: var(--dark);

  --font-mono: "IBM Plex Mono", "PlexMono-secours", "Courier New", monospace;
  --font-text: "IBM Plex Sans", "PlexSans-secours", Arial, sans-serif;

  --fs-h1: clamp(2.5rem, 1rem + 7vw, 7.5rem);
  --fs-h1-page: clamp(2rem, 1.2rem + 3vw, 3.5rem);
  --fs-h2: clamp(1.75rem, 1rem + 3vw, 3.25rem);
  --fs-big-number: clamp(4rem, 2rem + 8vw, 9rem);
  --fs-lead: clamp(1.375rem, 1.1rem + 1vw, 2rem);
  --fs-subtitle: clamp(1rem, 0.9rem + 0.5vw, 1.375rem);
  --fs-body: 1.0625rem;
  --fs-small: 0.875rem;
  --fs-label: 0.8125rem;
  --lh-tight: 0.95;
  --lh-body: 1.6;
  --measure: 68ch;

  --container: 1360px;
  --gutter: 24px;
  --page-margin: clamp(1.25rem, 5vw, 4rem);
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 40px;
  --space-5: 64px;
  --space-6: clamp(80px, 10vw, 144px);
  --section-min-h: 100svh;
  --marker: 8px;
  --header-h: 0px;

  --dur-fast: 150ms;
  --dur-index: 200ms;
  --dur-wipe: 340ms;
  --dur-draw: 380ms;
  --ease: cubic-bezier(.2, .7, .2, 1);

  --focus-width: 3px;
  --focus-offset: 3px;
}
.on-dark { --bg: var(--dark); --text: var(--light); --text-muted: var(--grey-d); --border: var(--rule-d); --focus: var(--signal); background: var(--bg); color: var(--text); }
.on-light { --bg: var(--light); --text: var(--dark); --text-muted: var(--grey-l); --border: var(--rule-l); --focus: var(--dark); background: var(--bg); color: var(--text); }
.on-signal { --text: var(--dark); --focus: var(--dark); background: var(--signal); color: var(--dark); }
@media (max-width: 1023px), (max-height: 699px) { :root { --section-min-h: auto; } }
@media (min-width: 1024px) { :root { --header-h: 64px; } }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { font-synthesis: none; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--light);
  color: var(--dark);
  font-family: var(--font-text);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  overflow-wrap: break-word;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { margin: 0; font-family: var(--font-mono); font-weight: 600; line-height: 1.15; }
p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
strong { font-weight: 600; }

:focus-visible { outline: var(--focus-width) solid var(--focus); outline-offset: var(--focus-offset); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: var(--space-2); top: var(--space-2); z-index: 100;
  padding: .75em 1.25em; background: var(--signal); color: var(--dark);
  font-family: var(--font-mono); font-weight: 600; text-decoration: none;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; outline: var(--focus-width) solid var(--dark); outline-offset: var(--focus-offset); }

.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--page-margin));
  margin-inline: auto;
  padding-inline: var(--page-margin);
}

/* ---------- Liens ---------- */
a { color: inherit; }
.on-dark a:not(.btn) { color: var(--light); text-decoration-color: var(--signal); }
.on-light a:not(.btn) { color: var(--dark); text-decoration-color: var(--dark); }
main a:not(.btn), .site-footer a {
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
  transition: text-decoration-thickness var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}
main a:not(.btn):hover, .site-footer a:hover { text-decoration-thickness: 3px; }
.on-light a:not(.btn):hover { background-color: var(--signal); color: var(--dark); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-block;
  padding: .9em 1.4em;
  border: 0;
  border-radius: 0;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: var(--fs-small);
  line-height: 1.3;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.on-light .btn { background: var(--dark); color: var(--light); }
.on-light .btn:hover { background: var(--dark-hover); color: var(--light); }
.on-dark .btn { background: var(--signal); color: var(--dark); }
.on-dark .btn:hover { background: var(--light); color: var(--dark); }
.btn--compact { padding: .6em 1em; font-size: var(--fs-label); }

/* ---------- Étiquettes et index ---------- */
.label, .index {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: var(--fs-label);
  letter-spacing: .06em;
  text-transform: uppercase;
  line-height: 1.4;
}
.index { display: flex; align-items: center; gap: var(--space-1); color: var(--text-muted); margin-bottom: var(--space-3); }
.index::before { content: ""; flex: none; width: var(--marker); height: var(--marker); background: var(--signal); }
.index span { display: inline-block; }

/* ---------- Barre de progression (CSS seul) ---------- */
.progress { display: none; }
@supports (animation-timeline: scroll()) {
  .progress {
    display: block;
    position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 60;
    background: var(--signal);
    transform-origin: 0 50%; transform: scaleX(0);
    animation: progress linear both; animation-timeline: scroll(root);
    pointer-events: none;
  }
  @keyframes progress { to { transform: scaleX(1); } }
}

/* ---------- En-tête ---------- */
.site-header { border-bottom: 1px solid var(--rule-d); }
.site-header__inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--space-2) var(--space-3);
  padding-block: var(--space-2);
}
.site-name {
  font-family: var(--font-mono); font-weight: 600; font-size: var(--fs-small);
  letter-spacing: .06em; text-transform: uppercase; text-decoration: none; color: var(--light);
}
.site-nav ul { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); }
.site-nav a {
  display: inline-flex; align-items: center; gap: var(--space-1);
  padding-block: 4px;
  font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: .06em; text-transform: uppercase;
  color: var(--light); text-decoration: none;
  text-decoration-line: underline; text-decoration-color: transparent; text-decoration-thickness: 1px; text-underline-offset: .3em;
  transition: text-decoration-color var(--dur-fast) var(--ease);
}
.site-nav a::before { content: ""; width: var(--marker); height: var(--marker); background: transparent; transition: background-color var(--dur-fast) var(--ease); }
.site-nav a:hover { text-decoration-color: var(--signal); }
.site-nav a.is-current::before { background: var(--signal); }
@media (max-width: 639px) {
  .site-header__inner { flex-direction: column; align-items: flex-start; }
}
@media (min-width: 1024px) {
  .site-header { position: sticky; top: 0; z-index: 50; }
  .site-header__inner { flex-wrap: nowrap; min-height: var(--header-h); padding-block: 0; }
  .site-nav { margin-left: auto; }
}

/* ---------- Sections de la page d'accueil ---------- */
main section[id] { scroll-margin-top: var(--header-h); }
.section { display: flex; flex-direction: column; min-height: var(--section-min-h); }
.section > .container { flex: 1 0 auto; display: flex; flex-direction: column; justify-content: center; padding-block: var(--space-6); }
.section > .container.section__grid { display: grid; grid-template-columns: minmax(0, 1fr); align-content: center; }
@media (min-width: 1024px) {
  .section > .container.section__grid { grid-template-columns: 12ch minmax(0, 1fr); column-gap: var(--gutter); }
  .section__grid > .index { position: sticky; top: calc(var(--header-h) + var(--space-3)); align-self: start; margin: 0; padding-top: .9em; }
}
.section h2 { font-size: var(--fs-h2); line-height: 1.05; letter-spacing: -.02em; margin-bottom: var(--space-3); max-width: 22ch; }
.lead { font-size: var(--fs-subtitle); font-family: var(--font-text); font-weight: 500; line-height: 1.4; max-width: 48ch; color: var(--text); margin-bottom: var(--space-5); }

/* Trame de signal */
.trame { display: block; width: 100%; height: 80px; flex: none; }
.trame .s { fill: none; stroke-width: 3; stroke: var(--signal); }
.on-light .trame .s { stroke: var(--dark); }
.t-d { fill: var(--grey-d); }
.t-l { fill: var(--grey-l); }

/* #accueil */
.intro { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
.intro__photo { order: 2; width: min(100%, 360px); }
.intro h1 {
  font-size: var(--fs-h1); line-height: var(--lh-tight); letter-spacing: -.03em; text-transform: uppercase;
}
.intro h1 span { display: block; }
.intro__subtitle { font-family: var(--font-mono); font-size: var(--fs-subtitle); line-height: 1.4; margin-top: var(--space-2); }
.intro__place { font-family: var(--font-mono); font-size: var(--fs-small); letter-spacing: .04em; color: var(--text-muted); }
.intro__hook { font-family: var(--font-text); font-weight: 500; font-size: var(--fs-lead); line-height: 1.3; max-width: 34ch; margin-block: var(--space-3); }
.intro__cta { justify-self: start; }
.intro__frame { position: relative; border: 1.5px solid var(--rule-d); margin: 16px 0 0 16px; }
.intro__frame::before { content: ""; position: absolute; width: 16px; height: 16px; background: var(--signal); left: -17.5px; top: -17.5px; }
.intro__photo img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.intro__caption { margin-top: var(--space-1); font-family: var(--font-mono); font-size: var(--fs-label); line-height: 1.4; color: var(--grey-d); }
@media (max-width: 1023px) {
  .intro h1 { order: 0; }
  .intro__subtitle, .intro__place, .intro__hook, .intro__cta { order: 1; }
}
@media (min-width: 1024px) {
  .intro { grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: auto auto auto auto auto 1fr; column-gap: var(--gutter); row-gap: 0; }
  .intro h1 { grid-column: 1 / -1; grid-row: 1; margin-bottom: var(--space-4); }
  .intro__subtitle { grid-column: 1 / 8; grid-row: 2; margin-top: 0; }
  .intro__place { grid-column: 1 / 8; grid-row: 3; margin-top: var(--space-1); }
  .intro__hook { grid-column: 1 / 8; grid-row: 4; margin-block: var(--space-4); }
  .intro__cta { grid-column: 1 / 8; grid-row: 5; }
  .intro__photo { grid-column: 8 / 13; grid-row: 2 / 7; width: min(100%, 600px); justify-self: end; }
}

/* #parcours */
.timeline { border-top: 1.5px solid var(--border); margin-bottom: var(--space-5); }
.timeline li { position: relative; padding-block: var(--space-4); border-bottom: 1.5px solid var(--border); }
.timeline h3 { font-size: clamp(1.125rem, 1rem + .6vw, 1.5rem); line-height: 1.3; max-width: 40ch; }
.timeline .dates {
  display: block; margin-top: var(--space-1);
  font-size: clamp(1.75rem, 1rem + 3vw, 3.25rem); line-height: 1.05; letter-spacing: -.02em;
}
.timeline p { margin-top: var(--space-2); max-width: var(--measure); }
.context { border: 1.5px solid var(--border); padding: var(--space-3); max-width: 80ch; }
.context h3 { font-weight: 400; font-size: var(--fs-label); letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); padding-bottom: var(--space-1); margin-bottom: var(--space-2); border-bottom: 1px solid var(--border); }

/* #competences */
.skills { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-5); }
@media (min-width: 1024px) { .skills { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: var(--space-5); } }
.skills h3, .tools-groups h3 { font-weight: 400; font-size: var(--fs-label); letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: var(--space-2); }
.scope-list { counter-reset: scope; border-top: 1px solid var(--border); }
.scope-list li {
  counter-increment: scope;
  display: grid; grid-template-columns: 4ch minmax(0, 1fr); gap: var(--space-2);
  padding-block: var(--space-2); border-bottom: 1px solid var(--border);
}
.scope-list li::before {
  content: counter(scope, decimal-leading-zero);
  content: counter(scope, decimal-leading-zero) / "";
  font-family: var(--font-mono); font-weight: 600; color: var(--signal);
}
.scope-list strong { font-family: var(--font-mono); font-weight: 600; }
.tools-groups { display: grid; gap: var(--space-5); align-content: start; }
.tools-groups p { color: var(--text-muted); margin-bottom: var(--space-2); }
.tags li { font-family: var(--font-mono); font-size: 1rem; line-height: 1.5; padding-block: 6px; padding-left: 3ch; text-indent: -3ch; }
.tags li::before { content: "—  "; content: "—  " / ""; color: var(--text-muted); white-space: pre; }

/* #realisations */
.cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gutter); margin-bottom: var(--space-5); }
.card {
  border: 1.5px solid var(--border); padding: var(--space-3); background: var(--light); color: var(--dark);
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.card h3 { font-size: 1.125rem; line-height: 1.3; padding-bottom: var(--space-2); margin-bottom: var(--space-2); border-bottom: 1px solid var(--rule-l); }
.card:not(.card--result):hover { background: var(--dark); color: var(--light); }
.card:not(.card--result):hover h3 { border-bottom-color: var(--rule-d); }
.card--result { background: var(--signal); color: var(--dark); border: 0; display: flex; flex-direction: column; justify-content: space-between; }
.card--result h3 { border-bottom-color: var(--dark); font-weight: 400; font-size: var(--fs-small); letter-spacing: .06em; text-transform: uppercase; }
.card--result .kpi-label { display: block; }
.card--result .kpi-value { display: block; margin-top: var(--space-2); font-weight: 600; font-size: var(--fs-big-number); line-height: .95; letter-spacing: -.03em; word-spacing: -.35em; text-transform: none; white-space: nowrap; }
.card--result p { font-family: var(--font-mono); font-size: 1rem; }
@media (min-width: 640px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } .card--result { grid-column: 1 / -1; } }
@media (min-width: 1024px) {
  .cards { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .card--result { grid-column: 1 / 6; grid-row: 1 / 4; padding: var(--space-4); }
  .card:not(.card--result) { grid-column: 6 / 13; }
}

/* #contact */
.contact__text { font-size: var(--fs-subtitle); max-width: 48ch; color: var(--text); margin-bottom: var(--space-4); }
.contact .btn.contact__link {
  background: none; padding: 0; color: var(--light);
  font-size: clamp(1.5rem, .9rem + 3.4vw, 4rem); line-height: 1.15; letter-spacing: -.02em; text-transform: none;
  text-decoration-line: underline; text-decoration-color: var(--signal); text-decoration-thickness: 3px; text-underline-offset: .18em;
  transition: color var(--dur-fast) var(--ease);
}
.contact .btn.contact__link:hover { background: none; color: var(--signal); }

/* ---------- Pied de page ---------- */
.site-footer { border-top: 1px solid var(--rule-d); }
.site-footer .container { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-4); padding-block: var(--space-4); }
.site-footer, .site-footer a { font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: .04em; }
.site-footer ul { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); }
.site-footer a { color: var(--light); text-decoration-color: var(--signal); }
.site-footer a[aria-current="page"] { text-decoration-thickness: 3px; }
.copyright { color: var(--grey-d); }

/* ---------- Pages annexes ---------- */
.page-content > .container { padding-block: var(--space-6); }
.page-content .prose { max-width: var(--measure); margin-inline: auto; counter-reset: intertitre; }
.page-content h1 { font-size: var(--fs-h1-page); line-height: 1.05; letter-spacing: -.02em; margin-bottom: var(--space-4); }
.page-content .prose > h2 {
  counter-increment: intertitre;
  display: flex; gap: 1ch; align-items: baseline;
  font-size: clamp(1.125rem, 1rem + .6vw, 1.5rem); line-height: 1.3;
  margin-top: var(--space-5); margin-bottom: var(--space-2); padding-top: var(--space-2); border-top: 1px solid var(--border);
}
.page-content .prose > h2::before { content: counter(intertitre) "."; content: counter(intertitre) "." / ""; color: var(--text-muted); font-weight: 400; }
.page-content p + p { margin-top: var(--space-2); }
.page-content p + ul, .page-content ul + p { margin-top: var(--space-2); }
.page-content .prose ul { list-style: square; padding-left: 1.25em; }
.page-content .prose ul li + li { margin-top: 4px; }
.muted { color: var(--text-muted); font-family: var(--font-mono); font-size: var(--fs-small); }
.back-links { margin-top: var(--space-5) !important; display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); font-family: var(--font-mono); }

/* Plan du site : arborescence en mono */
.prose ul.tree { list-style: none; padding-left: 0; font-family: var(--font-mono); }
.tree li { position: relative; padding-left: 4ch; }
.tree li::before { content: "├─ "; content: "├─ " / ""; position: absolute; left: 0; color: var(--text-muted); white-space: pre; }
.tree li:last-child::before { content: "└─ "; content: "└─ " / ""; }

/* 404 */
.page-404 { display: flex; flex-direction: column; min-height: calc(100svh - 140px); }
.page-404 > .container { flex: 1 0 auto; display: flex; flex-direction: column; justify-content: center; }
.page-404 h1 { font-size: var(--fs-h1); line-height: var(--lh-tight); letter-spacing: -.03em; text-transform: uppercase; color: var(--signal); max-width: 12ch; }
.page-404 p { font-size: var(--fs-subtitle); }

/* ---------- Mouvement (amélioration progressive, classe .js posée par main.js) ---------- */
section h2 { transition: clip-path var(--dur-wipe) var(--ease); }
.js section h2:not(.is-in) { clip-path: inset(0 100% 0 0); }
.js .index span { transition: transform var(--dur-index) var(--ease); }
.js .index:not(.is-in) span { transform: translateY(8px); }
.js .trame .s { stroke-dasharray: 1; stroke-dashoffset: 1; }
.js .trame.is-in .s { stroke-dashoffset: 0; transition: stroke-dashoffset var(--dur-draw) var(--ease); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  html { scroll-behavior: auto; }
  .progress { display: none !important; }
  section h2 { clip-path: none !important; }
  .index span { transform: none !important; }
  .trame .s { stroke-dasharray: none !important; stroke-dashoffset: 0 !important; }
}
