/* =========================================================
   Maxime Canet — Portfolio
   Direction : planche d'architecte. Papier calque, trait
   d'encre, cotations, cartouche, un seul accent signal.
   ========================================================= */

:root {
  --paper: #eeece6;
  --paper-2: #e5e2da;
  --ink: #141414;
  --ink-2: #2a2a28;
  --muted: #6b6862;
  --line: rgba(20, 20, 20, 0.14);
  --line-strong: rgba(20, 20, 20, 0.55);
  --accent: #e8461e;
  --accent-ink: #c2370f;

  --f-sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --gutter: clamp(16px, 4vw, 56px);
  --maxw: 1440px;
  --nav-h: 64px;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 8px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: 17px;
  line-height: 1.55;
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
.mono { font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }
.small { font-size: 11px; }
.muted { color: var(--muted); }
.hl { background: linear-gradient(transparent 62%, rgba(232, 70, 30, 0.28) 62%); padding: 0 .08em; }

::selection { background: var(--accent); color: #fff; }

/* ---------- Trame d'axes en fond ---------- */
.axes {
  position: fixed; inset: 0;
  display: grid; grid-template-columns: repeat(6, 1fr);
  padding: 0 var(--gutter);
  pointer-events: none; z-index: 0;
  max-width: var(--maxw); margin: 0 auto;
}
.axes span { border-left: 1px dashed rgba(20, 20, 20, 0.06); }
.axes span:last-child { border-right: 1px dashed rgba(20, 20, 20, 0.06); }

main, .footer { position: relative; z-index: 1; }

/* =========================================================
   NAVBAR
   ========================================================= */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  height: var(--nav-h);
  display: flex; align-items: center; gap: 24px;
  padding: 0 var(--gutter);
  background: rgba(238, 236, 230, 0.82);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  border-bottom: 1px solid var(--line);
  transition: background .3s, color .3s, border-color .3s;
}
.nav.on-dark { background: rgba(20, 20, 20, 0.82); color: var(--paper); border-color: rgba(238,236,230,.12); }
.scroll-progress {
  position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%;
  background: var(--accent); transform-origin: 0 50%; transform: scaleX(0);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; margin-right: auto; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px;
  border: 1.5px solid currentColor; font-weight: 700; font-size: 13px;
  font-variation-settings: "wdth" 125; letter-spacing: .02em;
}
.brand-name { font-weight: 600; font-variation-settings: "wdth" 85; font-size: 16px; letter-spacing: .01em; }

.nav-links { display: flex; gap: 4px; }
.nav-links a {
  position: relative; text-decoration: none;
  padding: 8px 12px; font-size: 14px; font-weight: 500;
  display: flex; align-items: baseline; gap: 6px;
}
.nav-links a i { font-style: normal; font-family: var(--f-mono); font-size: 10px; color: var(--muted); }
.nav.on-dark .nav-links a i { color: rgba(238,236,230,.5); }
.nav-links a::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 1.5px;
  background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease);
}
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }
.nav-links a.active i { color: var(--accent); }
.nav-sheet { color: var(--muted); padding-left: 20px; border-left: 1px solid var(--line); }
.nav.on-dark .nav-sheet { color: rgba(238,236,230,.55); border-color: rgba(238,236,230,.15); }
.nav-sheet span { color: var(--accent); }

.burger { display: none; background: none; border: 0; width: 40px; height: 40px; cursor: pointer; position: relative; }
.burger span { position: absolute; left: 9px; right: 9px; height: 1.5px; background: currentColor; transition: transform .3s var(--ease), top .3s; }
.burger span:first-child { top: 15px; }
.burger span:last-child { top: 24px; }
.burger[aria-expanded="true"] span:first-child { top: 19px; transform: rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { top: 19px; transform: rotate(-45deg); }

@media (max-width: 900px) {
  .nav-sheet { display: none; }
  .burger { display: block; }
  .nav-links {
    position: fixed; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--ink); color: var(--paper);
    padding: 8px var(--gutter) 24px;
    transform: translateY(-8px); opacity: 0; pointer-events: none;
    transition: opacity .25s, transform .3s var(--ease);
  }
  .nav-links.open { opacity: 1; transform: none; pointer-events: auto; }
  .nav-links a { font-size: 28px; font-weight: 600; font-variation-settings: "wdth" 80; padding: 14px 0; border-bottom: 1px solid rgba(238,236,230,.12); }
  .nav-links a::after { left: 0; right: auto; width: 40px; }
  .nav-links a i { color: rgba(238,236,230,.5); font-size: 12px; }
}

/* =========================================================
   Boutons
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px; border: 1.5px solid var(--ink);
  font-size: 14px; font-weight: 600; letter-spacing: .01em;
  text-decoration: none; cursor: pointer; background: none;
  transition: background .25s, color .25s, border-color .25s, transform .25s var(--ease);
}
.btn span { transition: transform .3s var(--ease); }
.btn:hover span { transform: translateX(4px); }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: var(--accent); border-color: var(--accent); }
.btn-line:hover { background: var(--ink); color: var(--paper); }
.btn-paper { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.btn-paper:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-line-light { border-color: rgba(238,236,230,.4); color: var(--paper); }
.btn-line-light:hover { border-color: var(--paper); }
.btn-line-light:hover span { transform: rotate(180deg); }
.btn:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px;
}

/* =========================================================
   HERO
   ========================================================= */
.hero {
  min-height: 100svh;
  max-width: var(--maxw); margin: 0 auto;
  padding: calc(var(--nav-h) + clamp(32px, 6vh, 72px)) var(--gutter) 40px;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  grid-template-rows: 1fr;
  column-gap: clamp(24px, 5vw, 80px);
  row-gap: 40px;
  position: relative;
}
.kicker { color: var(--muted); line-height: 1.7; margin: 0 0 28px; padding-left: 14px; border-left: 2px solid var(--accent); }
.hero-title {
  margin: 0; font-weight: 800; line-height: .86;
  font-size: clamp(64px, 11.5vw, 184px);
  font-variation-settings: "wdth" 66;
  letter-spacing: -0.02em; text-transform: uppercase;
}
.hero-title .line { display: block; overflow: hidden; padding-bottom: .02em; }
.hero-title .line > span { display: inline-block; transform: translateY(105%); animation: rise 1.1s var(--ease) forwards; }
.hero-title .line:nth-child(2) > span { animation-delay: .12s; }
.hero-title em { font-style: normal; color: var(--accent); }
@keyframes rise { to { transform: none; } }

.hero-lead { font-size: clamp(19px, 1.7vw, 23px); line-height: 1.4; max-width: 30ch; margin: 32px 0 0; font-weight: 500; }
.hero-lead .muted { display: block; margin-top: 10px; font-size: .78em; font-weight: 400; line-height: 1.5; max-width: 44ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

.hero-text { align-self: center; }

.hero-figure { margin: 0; position: relative; align-self: stretch; min-height: 420px; padding: 34px 0 0 34px; }
.hero-img { position: relative; height: 100%; overflow: hidden; background: var(--paper-2); }
.hero-img img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); transition: transform 1.6s var(--ease); }
.hero-figure.in .hero-img img { transform: scale(1); }
.hero-img::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 1px rgba(20,20,20,.12); }

/* cotations */
.dim { position: absolute; color: var(--muted); }
.dim-top { top: 8px; left: 34px; right: 0; height: 14px; border-left: 1px solid var(--line-strong); border-right: 1px solid var(--line-strong); }
.dim-top::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--line-strong); }
.dim-top span { position: absolute; left: 50%; top: -10px; transform: translateX(-50%); background: var(--paper); padding: 0 8px; font-size: 10px; white-space: nowrap; }
.dim-side { left: 8px; top: 34px; bottom: 0; width: 14px; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.dim-side::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; border-left: 1px solid var(--line-strong); }
.dim-side span { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(-90deg); background: var(--paper); padding: 0 6px; font-size: 10px; }
.axis-bubble {
  position: absolute; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; background: var(--paper);
  border: 1px solid var(--ink); font-size: 11px; color: var(--ink);
}
.ab-1 { right: -15px; bottom: 28px; }
.ab-2 { right: 28px; bottom: -15px; background: var(--accent); border-color: var(--accent); color: #fff; }

/* cartouche */
.cartouche {
  grid-column: 1 / -1;
  margin: 0; display: grid; grid-template-columns: repeat(6, 1fr);
  border: 1px solid var(--ink);
}
.cartouche > div { padding: 10px 14px; border-right: 1px solid var(--line-strong); }
.cartouche > div:last-child { border-right: 0; }
.cartouche dt { font-size: 9.5px; color: var(--muted); margin-bottom: 2px; }
.cartouche dd { margin: 0; font-size: 12px; color: var(--ink); }

.scroll-cue {
  position: absolute; right: var(--gutter); bottom: 112px;
  writing-mode: vertical-rl; text-decoration: none; color: var(--muted); font-size: 10px;
  display: none; align-items: center; gap: 10px;
}
.scroll-cue span { display: block; width: 1px; height: 48px; background: var(--line-strong); position: relative; overflow: hidden; }
.scroll-cue span::after { content: ""; position: absolute; left: 0; top: -40%; width: 1px; height: 40%; background: var(--accent); animation: drip 1.8s infinite var(--ease); }
@keyframes drip { to { top: 100%; } }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; grid-template-rows: auto; min-height: auto; }
  .hero-figure { min-height: 0; aspect-ratio: 4/3; padding: 28px 0 0 28px; }
  .dim-top { left: 28px; } .dim-side { top: 28px; }
  .cartouche { grid-template-columns: repeat(3, 1fr); }
  .cartouche > div:nth-child(3) { border-right: 0; }
  .cartouche > div:nth-child(-n+3) { border-bottom: 1px solid var(--line-strong); }
}
@media (max-width: 480px) {
  .cartouche { grid-template-columns: repeat(2, 1fr); }
  .cartouche > div { border-right: 1px solid var(--line-strong) !important; border-bottom: 1px solid var(--line-strong); }
  .cartouche > div:nth-child(2n) { border-right: 0 !important; }
  .cartouche > div:nth-last-child(-n+2) { border-bottom: 0; }
  .ab-1 { right: -8px; }
}

/* =========================================================
   SECTIONS
   ========================================================= */
.section { max-width: var(--maxw); margin: 0 auto; padding: clamp(80px, 12vw, 160px) var(--gutter) 0; }
.section-head { display: flex; align-items: center; gap: 18px; margin-bottom: clamp(40px, 6vw, 72px); }
.section-num {
  font-size: 13px; color: var(--accent);
  border: 1px solid currentColor; padding: 4px 8px; flex: none;
}
.section-head h2 {
  margin: 0; font-size: clamp(36px, 10vw, 120px); line-height: .9; min-width: 0; overflow-wrap: anywhere;
  font-weight: 800; font-variation-settings: "wdth" 66; text-transform: uppercase; letter-spacing: -0.015em;
}
.section-rule { flex: 1; height: 1px; background: var(--ink); align-self: center; transform-origin: left; transform: scaleX(0); transition: transform 1.2s var(--ease) .2s; }
.section-head.in .section-rule { transform: scaleX(1); }

h3 { font-size: 22px; font-weight: 700; font-variation-settings: "wdth" 85; margin: 0 0 22px; letter-spacing: .005em; }
h4 { margin: 0; }

/* ---------- 01 Profil ---------- */
.profil-grid {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: 32px clamp(24px, 3vw, 48px);
}
.statement {
  grid-column: 1 / 9; margin: 0;
  font-size: clamp(26px, 3.1vw, 46px); line-height: 1.16; font-weight: 500;
  font-variation-settings: "wdth" 90; letter-spacing: -0.012em;
}
.profil-body { grid-column: 1 / 8; column-count: 2; column-gap: 36px; color: var(--ink-2); font-size: 16px; }
.profil-body p { margin: 0 0 1em; break-inside: avoid; }
.profil-figure { grid-column: 9 / 13; grid-row: 1 / 3; margin: 0; align-self: start; }
.profil-figure img { width: 100%; aspect-ratio: 3/4; object-fit: cover; filter: grayscale(.15) contrast(1.05); }
.profil-figure figcaption { margin-top: 10px; color: var(--muted); font-size: 10.5px; border-top: 1px solid var(--line-strong); padding-top: 8px; }

.stats {
  list-style: none; padding: 0; margin: clamp(56px, 8vw, 96px) 0 0;
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink);
}
.stats li { padding: 26px 20px 24px; border-right: 1px solid var(--line-strong); display: flex; flex-direction: column; gap: 10px; }
.stats li:last-child { border-right: 0; }
.stats strong { font-size: clamp(44px, 5.5vw, 84px); line-height: .9; font-weight: 800; font-variation-settings: "wdth" 66; }
.stats span { font-size: 14px; color: var(--muted); line-height: 1.35; }

.why { margin-top: clamp(56px, 8vw, 96px); display: grid; grid-template-columns: 1fr 3fr; gap: 32px; }
.why h3 { color: var(--muted); font-size: 12px; font-weight: 400; padding-top: 6px; }
.why ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
.why li { display: flex; gap: 14px; padding: 0 24px; border-left: 1px solid var(--line-strong); }
.why li .mono { color: var(--accent); padding-top: 4px; }
.why b { display: block; font-size: 19px; font-variation-settings: "wdth" 85; margin-bottom: 8px; }
.why p { margin: 0; font-size: 15px; color: var(--ink-2); }

@media (max-width: 1000px) {
  .statement, .profil-body { grid-column: 1 / -1; }
  .profil-figure { grid-column: 1 / -1; grid-row: auto; max-width: 520px; }
  .profil-figure img { aspect-ratio: 4/3; }
  .why { grid-template-columns: 1fr; }
  .why ol { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 640px) {
  .profil-body { column-count: 1; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats li:nth-child(2) { border-right: 0; }
  .stats li:nth-child(-n+2) { border-bottom: 1px solid var(--line-strong); }
  .why li { padding: 0 0 0 16px; }
}

/* ---------- 02 Compétences ---------- */
.skills-layout {
  display: grid; grid-template-columns: 1.25fr 1fr; gap: clamp(40px, 5vw, 72px) clamp(32px, 5vw, 80px);
}
.block-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; border-bottom: 1px solid var(--ink); padding-bottom: 14px; }
.block-head h3 { margin: 0; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 10px; margin: 0; }

.tool-list { list-style: none; margin: 0; padding: 0; }
.tool-list li {
  display: grid; grid-template-columns: 1fr 150px 104px; align-items: center; gap: 20px;
  padding: 18px 0; border-bottom: 1px solid var(--line);
  transition: background .25s;
}
.tool-list li:hover { background: rgba(20,20,20,.03); }
.tool-name b { display: block; font-size: 18px; font-weight: 600; }
.tool-name span { font-size: 13.5px; color: var(--muted); }
.meter { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; height: 12px; }
.meter i { border: 1px solid var(--ink); background: transparent; position: relative; overflow: hidden; }
.meter i::after { content: ""; position: absolute; inset: 0; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease); }
.tools.in .meter i:nth-child(1)::after { transition-delay: .10s; }
.tools.in .meter i:nth-child(2)::after { transition-delay: .18s; }
.tools.in .meter i:nth-child(3)::after { transition-delay: .26s; }
.tools.in .meter i:nth-child(4)::after { transition-delay: .34s; }
.tools.in .meter i:nth-child(5)::after { transition-delay: .42s; }
.tools.in li[style*="--lvl:1"] .meter i:nth-child(-n+1)::after,
.tools.in li[style*="--lvl:2"] .meter i:nth-child(-n+2)::after,
.tools.in li[style*="--lvl:3"] .meter i:nth-child(-n+3)::after,
.tools.in li[style*="--lvl:4"] .meter i:nth-child(-n+4)::after,
.tools.in li[style*="--lvl:5"] .meter i:nth-child(-n+5)::after { transform: scaleX(1); }
.lvl { font-size: 11px; text-align: right; color: var(--ink-2); }
.tool-list li.is-new .meter i::after { background: var(--accent); }
.tool-list li.is-new .meter i { border-color: var(--accent); }
.tool-list li.is-new .tool-name b::after { content: "En progression"; font-family: var(--f-mono); font-size: 9.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--accent); border: 1px solid var(--accent); padding: 2px 6px; margin-left: 10px; vertical-align: 3px; font-weight: 400; }

.knowhow h3, .langs h3, .extras h3 { border-bottom: 1px solid var(--ink); padding-bottom: 14px; }
.kh-cards { display: grid; gap: 0; }
.kh { padding: 20px 0 20px 64px; position: relative; border-bottom: 1px solid var(--line); }
.kh-idx { position: absolute; left: 0; top: 24px; color: var(--accent); font-size: 11px; }
.kh h4 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.kh ul { margin: 0; padding: 0; list-style: none; columns: 1; }
.kh li { font-size: 14.5px; color: var(--ink-2); padding-left: 16px; position: relative; margin: 3px 0; }
.kh li::before { content: ""; position: absolute; left: 0; top: .72em; width: 8px; height: 1px; background: var(--muted); }

.lang { padding: 16px 0 20px; border-bottom: 1px solid var(--line); }
.lang-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; gap: 12px; flex-wrap: wrap; }
.lang-head b { font-size: 18px; font-weight: 600; }
.lang-head span { color: var(--muted); font-size: 11px; }
.cefr { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; counter-reset: c; }
.cefr i {
  font-style: normal; font-family: var(--f-mono); font-size: 10.5px; text-align: center;
  padding: 7px 0; border: 1px solid var(--ink); color: var(--ink);
  transition: background .4s, color .4s;
}
.langs.in .cefr[style*="--c:6"] i,
.langs.in .cefr[style*="--c:4"] i:nth-child(-n+4) { background: var(--ink); color: var(--paper); }
.langs.in .cefr i:nth-child(1) { transition-delay: .05s; } .langs.in .cefr i:nth-child(2) { transition-delay: .12s; }
.langs.in .cefr i:nth-child(3) { transition-delay: .19s; } .langs.in .cefr i:nth-child(4) { transition-delay: .26s; }
.langs.in .cefr i:nth-child(5) { transition-delay: .33s; } .langs.in .cefr i:nth-child(6) { transition-delay: .40s; }

.tags { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { border: 1px solid var(--line-strong); padding: 7px 14px; font-size: 14px; border-radius: 999px; transition: background .2s, color .2s; }
.tags li:hover { background: var(--ink); color: var(--paper); }
.extras .mono { color: var(--muted); }

@media (max-width: 560px) { .section-rule { display: none; } .section-head { gap: 12px; } }
@media (max-width: 1000px) { .skills-layout { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  .tool-list li { grid-template-columns: 1fr auto; gap: 10px 16px; }
  .tool-list .meter { grid-column: 1 / 2; grid-row: 2; }
  .tool-list .lvl { grid-row: 2; }

  .kh { padding-left: 0; padding-top: 44px; }
}

/* ---------- 03 Parcours ---------- */
.parcours-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: clamp(40px, 6vw, 96px); }
.col-title { color: var(--muted); border-bottom: 1px solid var(--ink); padding-bottom: 14px; margin: 0 0 8px; font-weight: 400; font-size: 12px; }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 132px; top: 0; bottom: 0; width: 1px; background: var(--line-strong); }
.tl-item { display: grid; grid-template-columns: 132px 1fr; padding: 28px 0; border-bottom: 1px solid var(--line); position: relative; }
.tl-item::before {
  content: ""; position: absolute; left: 127px; top: 36px; width: 11px; height: 11px;
  background: var(--paper); border: 1.5px solid var(--ink);
}
.tl-date { padding-top: 4px; color: var(--ink-2); font-size: 11.5px; }
.tl-body { padding-left: 32px; }
.tl-body h4 { font-size: clamp(19px, 1.7vw, 24px); font-weight: 650; line-height: 1.2; font-variation-settings: "wdth" 88; }
.tl-org { color: var(--muted); font-size: 11px; margin: 6px 0 12px; text-transform: none; letter-spacing: .02em; }
.tl-body p { margin: 0; font-size: 15px; color: var(--ink-2); }
.tl-body ul { margin: 0; padding: 0; list-style: none; }
.tl-body li { font-size: 15px; color: var(--ink-2); padding-left: 18px; position: relative; margin: 4px 0; }
.tl-body li::before { content: "—"; position: absolute; left: 0; color: var(--muted); }

.tl-next::before { background: var(--accent); border-color: var(--accent); }
.tl-next .tl-date { color: var(--accent); }
.tl-next .tl-body { border: 1.5px dashed var(--accent); padding: 18px 20px; margin-left: 32px; position: relative; }
.tl-next .tl-body::before { content: "À construire"; position: absolute; top: -9px; right: 14px; background: var(--paper); color: var(--accent); font-family: var(--f-mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; padding: 0 6px; }

.diplomas { list-style: none; padding: 0; margin: 0; }
.diplomas li { display: grid; grid-template-columns: 64px 1fr; gap: 16px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.d-level { font-size: 11px; color: var(--accent); padding-top: 4px; }
.diplomas h4 { font-size: 18px; font-weight: 600; line-height: 1.25; }
.diplomas p { margin: 4px 0 0; font-size: 14.5px; color: var(--ink-2); }
.diplomas p.mono { color: var(--muted); text-transform: none; letter-spacing: .02em; }

.levels-viz { display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; gap: 6px; height: 170px; margin-top: 40px; position: relative; padding-bottom: 28px; }
.levels-viz span {
  display: flex; align-items: flex-start; justify-content: center; padding-top: 6px;
  height: calc(var(--h) * 20%); background: var(--ink); color: var(--paper);
  font-family: var(--f-mono); font-size: 11px;
  transform-origin: bottom; transform: scaleY(0); transition: transform .8s var(--ease);
}
.levels-viz span:nth-child(2) { transition-delay: .08s; } .levels-viz span:nth-child(3) { transition-delay: .16s; }
.levels-viz span:nth-child(4) { transition-delay: .24s; } .levels-viz span:nth-child(5) { transition-delay: .32s; }
.levels-viz.in span { transform: none; }
.levels-viz span.next { background: transparent; border: 1.5px dashed var(--accent); color: var(--accent); }
.levels-viz p { position: absolute; left: 0; bottom: 0; margin: 0; color: var(--muted); text-transform: none; }

@media (max-width: 1000px) { .parcours-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .timeline::before { left: 5px; }
  .tl-item { grid-template-columns: 1fr; padding-left: 28px; }
  .tl-item::before { left: 0; top: 33px; }
  .tl-body { padding-left: 0; margin-top: 6px; }
  .tl-next .tl-body { margin-left: 0; margin-top: 14px; }
}

/* ---------- 04 Chantiers (fond encre) ---------- */
.chantiers {
  max-width: none; background: var(--ink); color: var(--paper);
  margin-top: clamp(80px, 12vw, 160px);
  padding-bottom: clamp(64px, 8vw, 112px);
  position: relative; z-index: 2;
}
.chantiers > * { max-width: calc(var(--maxw) - 2 * var(--gutter)); margin-left: auto; margin-right: auto; }
.chantiers .section-rule { background: var(--paper); }
.chantiers-intro { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; margin-bottom: 36px; }
.chantiers-intro p { margin: 0; max-width: 56ch; color: rgba(238,236,230,.75); }
.chantiers-intro .count { color: var(--paper); }
.chantiers-intro .count span:first-child { color: var(--accent); }

.gallery { columns: 4 260px; column-gap: 10px; }
.g-item {
  break-inside: avoid; margin: 0 0 10px; position: relative; display: block; width: 100%;
  padding: 0; border: 0; background: #222; cursor: zoom-in; overflow: hidden;
  opacity: 0; transform: translateY(18px);
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.g-item.shown { opacity: 1; transform: none; }
.g-item img { width: 100%; height: auto; transition: transform .7s var(--ease), filter .5s; filter: saturate(.92); }
.g-item::after {
  content: attr(data-ref); position: absolute; left: 8px; bottom: 8px;
  font-family: var(--f-mono); font-size: 10px; letter-spacing: .06em;
  background: var(--paper); color: var(--ink); padding: 3px 6px;
  opacity: 0; transform: translateY(4px); transition: opacity .3s, transform .3s var(--ease);
}
.g-item::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  border: 1.5px solid var(--accent); opacity: 0; transition: opacity .3s;
}
.g-item:hover img, .g-item:focus-visible img { transform: scale(1.04); filter: saturate(1.05); }
.g-item:hover::after, .g-item:focus-visible::after { opacity: 1; transform: none; }
.g-item:hover::before, .g-item:focus-visible::before { opacity: 1; }
.g-item:focus-visible { outline: none; }

.gallery-actions { display: flex; justify-content: center; gap: 12px; margin-top: 40px; flex-wrap: wrap; }
.gallery-actions [hidden] { display: none; }
.gallery-sentinel { height: 1px; }

@media (max-width: 600px) { .gallery { columns: 2; column-gap: 6px; } .g-item { margin-bottom: 6px; } }

/* ---------- 05 Contact ---------- */
.contact { padding-bottom: clamp(80px, 10vw, 140px); }
.contact-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(40px, 6vw, 96px); align-items: start; }
.contact-big { font-size: clamp(28px, 3.2vw, 46px); line-height: 1.12; font-weight: 500; font-variation-settings: "wdth" 90; margin: 0 0 36px; letter-spacing: -0.01em; }
.contact-info dl { margin: 0; border-top: 1px solid var(--ink); }
.contact-info dl > div { display: grid; grid-template-columns: 120px 1fr; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.contact-info dt { color: var(--muted); font-size: 11px; }
.contact-info dd { margin: 0; font-size: 12.5px; text-transform: none; letter-spacing: .01em; word-break: break-word; }
.contact-info a { text-decoration: none; background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 1.5px no-repeat; transition: background-size .35s var(--ease); }
.contact-info a:hover { background-size: 100% 1.5px; }

.contact-form { border: 1px solid var(--ink); padding: clamp(20px, 3vw, 36px); background: rgba(255,255,255,.35); position: relative; }
.contact-form::before { content: "Formulaire — F.01"; position: absolute; top: -9px; left: 18px; background: var(--paper); padding: 0 8px; font-family: var(--f-mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.field { display: flex; flex-direction: column; margin-bottom: 22px; }
.field label { font-size: 10.5px; color: var(--muted); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  font: inherit; font-size: 16px; color: var(--ink);
  background: transparent; border: 0; border-bottom: 1.5px solid var(--line-strong);
  padding: 10px 0; border-radius: 0; transition: border-color .25s;
  -webkit-appearance: none; appearance: none;
}
.field select { background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 12px) 55%, calc(100% - 7px) 55%; background-size: 5px 5px; background-repeat: no-repeat; cursor: pointer; }
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.field input::placeholder, .field textarea::placeholder { color: #9b978f; }
.field.error input, .field.error textarea { border-color: var(--accent); }
.btn-send { width: 100%; justify-content: center; margin-top: 6px; }
.form-status { min-height: 18px; margin: 14px 0 0; font-size: 11px; color: var(--muted); text-transform: none; letter-spacing: .02em; }
.form-status.ok { color: #2f7a3e; }
.form-status.err { color: var(--accent-ink); }

@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }
@media (max-width: 420px) { .contact-info dl > div { grid-template-columns: 1fr; gap: 2px; } }

/* ---------- Footer ---------- */
.footer {
  max-width: var(--maxw); margin: 0 auto; padding: 22px var(--gutter) 28px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  border-top: 1px solid var(--ink); color: var(--muted);
}
.footer a { text-decoration: none; }
.footer a:hover { color: var(--accent); }

/* =========================================================
   LIGHTBOX
   ========================================================= */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(12, 12, 12, 0.96);
  display: grid; grid-template-columns: 72px 1fr 72px; grid-template-rows: 56px 1fr 24px;
  color: var(--paper);
  opacity: 0; transition: opacity .3s;
}
.lightbox[hidden] { display: none; }
.lightbox.open { opacity: 1; }
.lb-top { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; padding: 0 20px; border-bottom: 1px solid rgba(238,236,230,.1); }
.lb-top #lbCount { color: rgba(238,236,230,.7); }
.lb-close { background: none; border: 1px solid rgba(238,236,230,.3); padding: 8px 14px; cursor: pointer; font-family: var(--f-mono); font-size: 11px; letter-spacing: .06em; transition: border-color .2s, background .2s; }
.lb-close:hover { border-color: var(--accent); background: var(--accent); }
.lb-stage { grid-column: 2; grid-row: 2; margin: 0; display: grid; place-items: center; position: relative; min-height: 0; padding: 20px 0; touch-action: pan-y; }
.lb-stage img { max-width: 100%; max-height: calc(100svh - 120px); width: auto; height: auto; object-fit: contain; transition: opacity .3s, transform .4s var(--ease); box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.lb-stage.loading img { opacity: .25; }
.lb-loader { position: absolute; width: 36px; height: 36px; border: 1.5px solid rgba(238,236,230,.2); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; opacity: 0; transition: opacity .2s; }
.lb-stage.loading .lb-loader { opacity: 1; }
@keyframes spin { to { transform: rotate(360deg); } }
.lb-nav { grid-row: 2; align-self: center; justify-self: center; width: 52px; height: 52px; background: none; border: 1px solid rgba(238,236,230,.3); cursor: pointer; font-size: 20px; transition: background .2s, border-color .2s; }
.lb-nav:hover { background: var(--accent); border-color: var(--accent); }
.lb-prev { grid-column: 1; } .lb-next { grid-column: 3; }

@media (max-width: 640px) {
  .lightbox { grid-template-columns: 0 1fr 0; grid-template-rows: 56px 1fr 80px; }
  .lb-nav { grid-row: 3; position: static; }
  .lb-prev { grid-column: 2; justify-self: start; margin-left: 16px; }
  .lb-next { grid-column: 2; justify-self: end; margin-right: 16px; }
  .lb-stage { padding: 12px 8px; }
  .lb-stage img { max-height: calc(100svh - 160px); }
}

/* =========================================================
   Révélations au scroll
   ========================================================= */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; }
  .reveal, .g-item { opacity: 1; transform: none; }
}


