/* Piste B – Mosaïque – Thomas Fonteneau */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../fonts/bricolage-grotesque-latin-wdth-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  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: "Bricolage-secours"; src: local("Arial"); ascent-override: 93%; descent-override: 27%; line-gap-override: 0%; }

:root {
  color-scheme: dark;
  --bg: #111216;
  --tile: #1C1E25;
  --tile-2: #262934;
  --text: #F3F1EA;
  --muted: #A7ACB8;
  --lilac: #B8A4FF;
  --lilac-hover: #D4C8FF;
  --tangerine: #FF8A4C;
  --line: #6E7385;
  --link: var(--lilac);
  --focus: var(--lilac);

  --font: "Bricolage Grotesque", "Bricolage-secours", Arial, sans-serif;
  --stretch-display: 75%;
  --stretch-title: 85%;
  --stretch-text: 100%;

  --fs-h1: clamp(3.25rem, 1rem + 9vw, 9rem);
  --fs-h2: clamp(2.25rem, 1.2rem + 4vw, 4.5rem);
  --fs-h3: 1.375rem;
  --fs-big-number: clamp(4.5rem, 2rem + 9vw, 10rem);
  --fs-lead: clamp(1.375rem, 1.1rem + 1.1vw, 2.125rem);
  --fs-subtitle: clamp(1.125rem, 1rem + 0.6vw, 1.5rem);
  --fs-body: 1.0625rem;
  --fs-small: 0.875rem;
  --fs-label: 0.8125rem;
  --lh-tight: 0.88;
  --lh-body: 1.6;
  --measure: 66ch;

  --container: 1280px;
  --page-margin: clamp(1rem, 4vw, 3rem);
  --gap: clamp(0.75rem, 1.2vw, 1.25rem);
  --row: minmax(9rem, auto);
  --radius-tile: 20px;
  --radius-pill: 999px;
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: clamp(4rem, 8vw, 7rem);

  --dur-fast: 180ms;
  --dur-reveal: 300ms;
  --dur-count: 350ms;
  --dur-spin: 320ms;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --stagger: 50ms;

  --focus-width: 3px;
  --focus-offset: 3px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { font-synthesis: none; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-body);
  font-weight: 400;
  font-stretch: var(--stretch-text);
  line-height: var(--lh-body);
  overflow-wrap: break-word;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { margin: 0; overflow-wrap: break-word; hyphens: manual; }
p, ul, ol, blockquote, figure { margin: 0; }
section[id], [id] { scroll-margin-top: var(--space-3); }

a { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover, a:focus-visible { text-decoration-thickness: 2px; }
:focus { outline: none; }
:focus-visible { outline: var(--focus-width) solid var(--focus); outline-offset: var(--focus-offset); border-radius: 4px; }

.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(--page-margin); top: var(--space-1);
  transform: translateY(-300%);
  z-index: 100;
  padding: 0.6em 1.2em;
  background: var(--lilac); color: var(--bg);
  border-radius: var(--radius-pill);
  font-weight: 650; text-decoration: none;
  --focus: var(--text);
}
.skip-link:focus { transform: none; outline-color: var(--text); }

.wrap { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--page-margin); }

/* ---------- En-tête ---------- */
.site-header { border-bottom: 1px solid var(--line); }
.site-header__inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--space-1) var(--space-3);
  padding-block: 0.75rem;
}
.site-name {
  color: var(--text); text-decoration: none;
  font-weight: 700; font-stretch: var(--stretch-title); font-size: 1.25rem; line-height: 1.2;
}
.site-nav ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.site-nav a { color: var(--muted); text-decoration: none; font-weight: 600; display: inline-block; padding-block: 0.25rem; }
.site-nav a:hover { color: var(--lilac); text-decoration: underline; text-decoration-thickness: 2px; }
.site-nav a:focus-visible { color: var(--lilac); }
@media (min-width: 1000px) {
  .site-nav { margin-left: auto; }
}
@media (max-width: 767px) {
  .site-nav { width: 100%; }
}

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; text-align: center;
  border-radius: var(--radius-pill);
  padding: 0.8em 1.4em;
  font-weight: 650; line-height: 1.25; text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.btn--primary { background: var(--lilac); color: var(--bg); }
.btn--primary:hover { background: var(--lilac-hover); }
.btn--primary:focus-visible, .btn--secondary:focus-visible { border-radius: var(--radius-pill); }
.btn--compact { padding: 0.55em 1.1em; font-size: 0.9375rem; }
.btn--secondary { border: 1.5px solid var(--line); color: var(--text); }
.btn--secondary:hover { border-color: var(--lilac); }
.btn--on-accent { background: var(--bg); color: var(--lilac); }
.btn--on-accent:hover { background: var(--tile); color: var(--text); }
.btn--on-accent:focus-visible { border-radius: var(--radius-pill); }

/* ---------- Sections et grille ---------- */
.section { padding-block: var(--space-5) 0; }
.section--hero { padding-top: var(--space-4); }
.section__head { display: grid; gap: var(--space-2); margin-bottom: var(--space-4); }
.section__head h2, #titre-contact {
  font-weight: 800; font-stretch: var(--stretch-display); font-size: var(--fs-h2); line-height: 0.95; letter-spacing: -0.01em;
}
.lead { font-size: var(--fs-subtitle); font-weight: 600; color: var(--muted); max-width: var(--measure); line-height: 1.4; }
.subhead { font-weight: 700; font-stretch: var(--stretch-title); font-size: var(--fs-h3); margin-bottom: var(--space-2); }
.section__cta { margin-top: var(--space-3); }

.mosaic {
  display: grid;
  grid-template-columns: 1fr;
  grid-auto-rows: auto;
  gap: var(--gap);
  list-style: none;
  padding-left: 0;
}
ol.mosaic, ul.mosaic { padding-inline-start: 0; }
.wrap.mosaic { padding-inline: var(--page-margin); }
.mosaic + .mosaic { margin-top: var(--gap); }

/* ---------- Tuiles ---------- */
.tile {
  position: relative;
  display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-2);
  min-width: 0;
  background: var(--tile);
  border: 1px solid var(--line);
  border-radius: var(--radius-tile);
  padding: clamp(1.25rem, 2.2vw, 2rem);
  transition: opacity var(--dur-reveal) var(--ease) var(--delay, 0ms), transform var(--dur-reveal) var(--ease) var(--delay, 0ms), border-color var(--dur-fast) var(--ease);
}
.js .tile:not(.is-in) { opacity: 0; transform: scale(.97); }
.tile:has(a):hover { transform: translateY(-3px); border-color: var(--lilac); }
.tile--accent:has(a):hover { border-color: var(--bg); }
.tile h3 { font-weight: 700; font-stretch: var(--stretch-title); font-size: var(--fs-h3); line-height: 1.2; }
.tile h3 + p { margin-top: var(--space-1); }
.tile p { max-width: var(--measure); }
.tile__index {
  font-weight: 600; font-size: var(--fs-label); letter-spacing: 0.08em; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.tile--alt { background: var(--tile-2); }
.tile--accent, .tile--data { --focus: var(--bg); --link: var(--bg); color: var(--bg); }
.tile--accent { background: var(--lilac); border-color: var(--lilac); }
.tile--data { background: var(--tangerine); border-color: var(--tangerine); }
.tile--accent a:not(.btn) { text-decoration-thickness: 2px; }

/* Accueil */
.tile--name { justify-content: flex-end; }
.tile--name h1 {
  font-weight: 800; font-stretch: var(--stretch-display); font-size: var(--fs-h1);
  line-height: var(--lh-tight); letter-spacing: -0.015em;
}
.tile--name h1 span { display: block; }
.intro__subtitle { font-weight: 600; font-size: var(--fs-subtitle); line-height: 1.3; }
.intro__place { font-weight: 600; font-size: var(--fs-subtitle); line-height: 1.3; color: var(--muted); }
.tile--subtitle, .tile--place { justify-content: flex-end; }
.tile--photo { justify-content: flex-start; gap: var(--space-1); padding: var(--gap); }
.tile--photo img {
  width: min(100%, 600px); aspect-ratio: 1; object-fit: cover;
  border-radius: calc(var(--radius-tile) - 6px);
}
.photo-caption { font-size: var(--fs-small); color: var(--muted); line-height: 1.4; padding-inline: 0.25rem; }
.tile--hook { gap: var(--space-3); }
.intro__hook p { font-weight: 600; font-stretch: 90%; font-size: var(--fs-lead); line-height: 1.2; }
.tile--hook .btn { align-self: flex-start; }
.tile--sig { padding: var(--gap); justify-content: center; background: var(--tile); }
.frieze { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); }

/* Tesselles */
.tesselles { display: block; width: 100%; height: auto; border-radius: calc(var(--radius-tile) - 6px); }
.tesselles .t-fond { fill: var(--tile-2); }
.tesselles .t-lilas { fill: var(--lilac); }
.tesselles .t-creme { fill: var(--text); }
.tesselles .t-anneau { fill: none; stroke: var(--tangerine); stroke-width: 10; }
.tesselles .t-vide { fill: none; stroke: var(--line); stroke-width: 4; stroke-dasharray: 12 10; }
.tesselles > :not(.t-fond) { transform-box: fill-box; transform-origin: center; transition: transform var(--dur-spin) var(--ease); }
.tile:hover .tesselles > :nth-child(2) { transform: rotate(90deg); }
.tile:hover .tesselles > :nth-child(4) { transform: rotate(-90deg); transition-delay: 40ms; }
.tile:hover .tesselles > :nth-child(5) { transform: rotate(180deg); transition-delay: 80ms; }

/* Parcours */
.tile--job-now h3 { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.25rem); font-weight: 800; font-stretch: var(--stretch-display); line-height: 1.05; }
.tile--job-prev h3 { font-size: clamp(1.375rem, 1.1rem + 0.9vw, 1.75rem); }
.tile--full p { margin-top: var(--space-1); }

/* Compétences */
.mosaic--scope .tile { justify-content: space-between; }
.mosaic--scope strong {
  font-weight: 700; font-stretch: var(--stretch-title); font-size: var(--fs-h3); line-height: 1.2; color: var(--text);
}
.mosaic--scope .tile--wide strong { font-weight: 800; font-stretch: var(--stretch-display); font-size: clamp(1.75rem, 1.2rem + 2vw, 3rem); line-height: 1; }
.mosaic--tools .tile { justify-content: flex-start; gap: var(--space-3); }
.tags { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tags li {
  border: 1px solid var(--line); border-radius: var(--radius-pill);
  padding: 0.35em 0.8em; font-size: 0.9375rem; line-height: 1.35;
}
.tile--alt p { color: var(--text); }

/* Réalisations */
.tile--data { justify-content: space-between; }
.tile--data h3 { display: flex; flex-direction: column; gap: var(--space-1); font-stretch: var(--stretch-display); }
.kpi-label {
  font-weight: 600; font-stretch: 100%; font-size: var(--fs-label); letter-spacing: 0.08em; text-transform: uppercase;
}
.kpi-value {
  font-weight: 800; font-stretch: var(--stretch-display); font-size: var(--fs-big-number); line-height: 0.85; letter-spacing: -0.02em;
}
.count { display: inline-block; min-width: 2ch; text-align: end; font-variant-numeric: tabular-nums; }
.tile--data p { font-weight: 600; font-size: var(--fs-subtitle); line-height: 1.3; }

/* Contact */
.tile--contact { display: grid; gap: var(--space-4); align-items: end; padding: clamp(1.5rem, 4vw, 3.5rem); }
.contact__text { display: grid; gap: var(--space-3); }
.contact__text p { font-size: var(--fs-subtitle); font-weight: 600; line-height: 1.35; }
.contact__link { color: var(--bg); text-decoration-thickness: 2px; text-underline-offset: 0.2em; font-weight: 700; font-size: var(--fs-lead); font-stretch: 90%; }
.contact__link:hover { text-decoration-thickness: 3px; }
.contact__sig { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-1); max-width: 28rem; }

/* Pied de page */
.site-footer { margin-top: var(--space-5); border-top: 1px solid var(--line); }
.site-footer__inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--space-2) var(--space-4); padding-block: var(--space-4);
  color: var(--muted); font-size: 0.9375rem;
}
.site-footer a { color: var(--muted); }
.site-footer a:hover, .site-footer a:focus-visible { color: var(--lilac); }
.site-footer ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.site-footer a[aria-current="page"] { color: var(--text); }

/* ---------- Pages annexes ---------- */
.page { padding-top: var(--space-4); }
.mosaic--page { grid-template-columns: 1fr; }
.tile--page { justify-content: flex-start; gap: 0; }
.tile--page h1 {
  font-weight: 800; font-stretch: var(--stretch-display); font-size: clamp(2.5rem, 1.5rem + 4vw, 5rem); line-height: 0.95; letter-spacing: -0.01em;
  margin-bottom: var(--space-3);
}
.tile--page h2 { font-weight: 700; font-stretch: var(--stretch-title); font-size: 1.5rem; line-height: 1.2; margin: var(--space-4) 0 var(--space-1); }
.prose { max-width: none; }
.prose p, .prose ul { max-width: 68ch; }
.prose p + p, .prose p + ul, .prose ul + p { margin-top: var(--space-2); }
.prose ul { padding-left: 1.25rem; }
.prose li + li { margin-top: 0.25rem; }
.muted { color: var(--muted); }
.back-links { margin-top: var(--space-4); display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); }
.sitemap-tiles { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); gap: var(--gap); }
.sitemap-tiles a {
  display: flex; align-items: flex-end; min-height: 5.5rem; height: 100%;
  padding: 1rem 1.25rem; background: var(--tile-2); border: 1px solid var(--line); border-radius: var(--radius-tile);
  color: var(--text); text-decoration: none; font-weight: 700; font-stretch: var(--stretch-title); font-size: 1.125rem; line-height: 1.25;
  transition: border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.sitemap-tiles a:hover { border-color: var(--lilac); transform: translateY(-3px); text-decoration: underline; text-decoration-color: var(--lilac); }
.sitemap-tiles a:focus-visible { border-radius: var(--radius-tile); }
.sitemap-tiles a[aria-current="page"] { border-color: var(--lilac); }
.tile--page h2 a { color: var(--lilac); }

/* 404 */
.tile--404 { justify-content: flex-end; }
.tile--404 h1 { font-weight: 800; font-stretch: var(--stretch-display); font-size: clamp(3rem, 1.5rem + 6vw, 7rem); line-height: 0.9; letter-spacing: -0.015em; }
.tile--404sig { justify-content: center; padding: var(--gap); }
.grid-2x2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); max-width: 22rem; width: 100%; margin-inline: auto; }
.tile--404links { justify-content: space-between; font-size: var(--fs-subtitle); font-weight: 600; }
.tile--404links .back-links { margin-top: 0; }
.tile--404links a { font-weight: 700; }

/* ---------- Points de rupture ---------- */
@media (max-width: 767px) {
  .mosaic > .tile { min-height: 6rem; }
}
@media (max-width: 479px) {
  .tile--sig { display: none; }
}
@media (min-width: 768px) {
  .mosaic { grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-rows: var(--row); }
  .mosaic--hero .tile--name { grid-column: 1 / -1; }
  .mosaic--hero .tile--subtitle { grid-column: 1 / 4; }
  .mosaic--hero .tile--place { grid-column: 4 / -1; }
  .mosaic--hero .tile--photo { grid-column: 1 / 4; grid-row: span 3; }
  .mosaic--hero .tile--hook { grid-column: 4 / -1; grid-row: span 2; }
  .mosaic--hero .tile--sig { grid-column: 4 / -1; }
  .mosaic--career .tile--job-now { grid-column: 1 / 5; }
  .mosaic--career .tile--job-prev { grid-column: 5 / -1; }
  .tile--full { grid-column: 1 / -1; }
  .mosaic--scope > .tile { grid-column: span 3; }
  .mosaic--scope > .tile--wide { grid-column: 1 / -1; }
  .mosaic--tools > .tile { grid-column: span 3; }
  .mosaic--results > .tile { grid-column: span 3; }
  .mosaic--results > .tile--data { grid-column: 1 / -1; grid-row: span 2; }
  .mosaic--results > .tile--r1 { grid-column: 1 / -1; }
  .tile--contact { grid-template-columns: 1.4fr 1fr; }
  .mosaic--page .tile--page { grid-column: 1 / -1; }
  .mosaic--404 .tile--404 { grid-column: 1 / 4; grid-row: span 2; }
  .mosaic--404 .tile--404sig { grid-column: 4 / -1; grid-row: span 2; }
  .mosaic--404 .tile--404links { grid-column: 1 / -1; }
}
@media (min-width: 1100px) {
  .mosaic { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .mosaic--hero .tile--name { grid-column: 1 / 8; grid-row: 1 / 3; }
  .mosaic--hero .tile--photo { grid-column: 8 / 13; grid-row: 1 / 4; }
  .mosaic--hero .tile--subtitle { grid-column: 1 / 5; grid-row: 3; }
  .mosaic--hero .tile--place { grid-column: 5 / 8; grid-row: 3; }
  .mosaic--hero .tile--hook { grid-column: 1 / 8; grid-row: 4; }
  .mosaic--hero .tile--sig { grid-column: 8 / 13; grid-row: 4; }
  .mosaic--career .tile--job-now { grid-column: 1 / 8; }
  .mosaic--career .tile--job-prev { grid-column: 8 / 13; }
  .mosaic--scope > .tile { grid-column: span 3; }
  .mosaic--scope > .tile--wide { grid-column: span 6; }
  .mosaic--tools > .tile { grid-column: span 6; }
  .mosaic--results > .tile--data { grid-column: 1 / 7; grid-row: 1 / 3; }
  .mosaic--results > .tile--r1 { grid-column: 7 / 13; grid-row: 1; }
  .mosaic--results > .tile--r2a { grid-column: 7 / 10; grid-row: 2; }
  .mosaic--results > .tile--r2b { grid-column: 10 / 13; grid-row: 2; }
  .mosaic--page .tile--page { grid-column: 2 / 12; }
  .mosaic--404 .tile--404 { grid-column: 1 / 7; grid-row: span 2; }
  .mosaic--404 .tile--404sig { grid-column: 7 / 13; grid-row: span 2; }
  .mosaic--404 .tile--404links { grid-column: 1 / 13; }
}

/* ---------- Mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .tile, .tile:hover, .tesselles *, .sitemap-tiles a:hover { transform: none !important; opacity: 1 !important; }
}

/* Recette v3 : une tuile qui reçoit le focus est visible immédiatement */
.js .tile:focus-within { opacity: 1; transform: none; }
