/* =========================================================
   Florian Bridier — Portfolio · v5 « fiche technique »
   Charte : Psycle Research (encre #202020, jaune #F1C749,
   Stack Sans Headline / Fustat) × UTC (jaune #FFD600, pétrole #003E4C).
   Polices auto-hébergées (SIL OFL, voir assets/fonts).
   Aucune règle inline : compatible avec la CSP stricte du site.
   ========================================================= */

@font-face {
  font-family: "Stack Sans Headline";
  src: url("../assets/fonts/stack-sans-headline-var.woff") format("woff");
  font-weight: 200 700;
  font-display: swap;
}
@font-face {
  font-family: "Fustat";
  src: url("../assets/fonts/fustat-var.woff") format("woff");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --ink: #202020;
  --ink-deep: #141414;
  --paper: #f5f4f0;
  --paper-2: #ecebe5;
  --white: #ffffff;
  --rule: #d8d6ce;
  --rule-strong: #202020;
  --muted: #55554f;
  --muted-2: #77766f;

  --yellow: #f1c749;
  --yellow-utc: #ffd600;
  --yellow-wash: #f8e7a8;
  --petrol: #003e4c;
  --petrol-2: #00596d;
  --petrol-wash: #d9e7ea;

  --font-head: "Stack Sans Headline", "Segoe UI", Roboto, Arial, sans-serif;
  --font-body: "Fustat", "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --max: 1240px;
  --gutter: 24px;
  --r: 2px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, h4, p { margin-top: 0; }
ul, ol { margin-top: 0; }
::selection { background: var(--yellow); color: var(--ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; box-shadow: 0 0 0 5px var(--yellow); }

h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; letter-spacing: -.03em; color: var(--ink); }
h1 { font-size: clamp(2.6rem, 6.4vw, 6rem); line-height: .95; margin-bottom: 28px; }
h2 { font-size: clamp(1.9rem, 3.6vw, 3.2rem); line-height: 1.02; margin-bottom: 18px; }
h3 { font-size: 1.25rem; line-height: 1.2; margin-bottom: 8px; letter-spacing: -.02em; }
h4 { font-size: 1rem; }

.container { width: min(var(--max), calc(100% - 2 * var(--gutter))); margin: 0 auto; }
.section { padding: 112px 0; border-top: 1px solid var(--rule); }
.section.tight-top { padding-top: 0; border-top: 0; }

/* Surligneur */
mark, .hl { background: linear-gradient(transparent 58%, var(--yellow) 58%, var(--yellow) 92%, transparent 92%); color: inherit; padding: 0 .08em; }

/* ---------- Libellés techniques (mono) ---------- */
.eyebrow, .section-kicker, .project-tag, .now-label, .tl-date, .tag, .mono {
  font-family: var(--font-mono);
  font-size: .76rem;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.eyebrow, .section-kicker {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 0 0 18px;
  color: var(--muted);
}
.eyebrow::before, .section-kicker::before { content: "["; color: var(--ink); }
.eyebrow::after, .section-kicker::after { content: "]"; color: var(--ink); }
.project-tag { color: var(--muted); margin: 0 0 10px; }

.hero-text { font-size: 1.15rem; color: var(--muted); max-width: 640px; margin-bottom: 34px; }

/* ---------- Boutons ---------- */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid var(--ink);
  border-radius: var(--r);
  font-family: var(--font-body);
  font-size: .98rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .18s var(--ease), color .18s var(--ease), box-shadow .18s var(--ease), transform .18s var(--ease);
}
.btn-primary { background: var(--ink); color: var(--white); box-shadow: 4px 4px 0 var(--yellow); }
.btn-primary:hover { transform: translate(-1px, -1px); box-shadow: 6px 6px 0 var(--yellow); }
.btn-primary::after { content: "→"; transition: transform .18s var(--ease); }
.btn-primary:hover::after { transform: translateX(3px); }
.btn-secondary { background: transparent; color: var(--ink); }
.btn-secondary:hover { background: var(--yellow); }
.btn-dark { background: var(--ink); color: var(--white); }
.btn-dark:hover { background: var(--yellow); color: var(--ink); }
.full { width: 100%; margin-top: 12px; }

/* ---------- Barre d'état + en-tête ---------- */
.topbar {
  background: var(--ink);
  color: rgba(255, 255, 255, .78);
  font-family: var(--font-mono);
  font-size: .74rem;
  letter-spacing: .03em;
}
.topbar .container { display: flex; justify-content: space-between; gap: 16px; min-height: 34px; align-items: center; }
.topbar strong { color: var(--white); font-weight: 600; }
.topbar .live { display: inline-flex; align-items: center; gap: 8px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .live::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--yellow);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .35; } }

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(245, 244, 240, .94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule-strong);
}
.scroll-progress {
  position: absolute; left: 0; bottom: -1px;
  height: 3px; width: 100%;
  background: var(--yellow);
  transform-origin: 0 50%;
  transform: scaleX(var(--progress, 0));
}
.navbar {
  width: min(var(--max), calc(100% - 2 * var(--gutter)));
  min-height: 68px;
  margin: 0 auto;
  display: flex; align-items: center; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: var(--ink); color: var(--yellow);
  font-family: var(--font-mono); font-weight: 700; font-size: .82rem;
  border-radius: var(--r);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.12; }
.brand-name { font-family: var(--font-head); font-weight: 600; font-size: 1.02rem; letter-spacing: -.02em; }
.brand-sub { font-family: var(--font-mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted-2); }

.nav-menu { display: flex; align-items: center; list-style: none; margin: 0 0 0 auto; padding: 0; gap: 0; }
.nav-menu a {
  position: relative;
  display: block;
  padding: 22px 14px;
  font-weight: 600; font-size: .95rem;
  color: var(--muted);
  transition: color .18s var(--ease);
}
.nav-menu a::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 3px;
  background: var(--ink); transform: scaleX(0); transform-origin: 0 50%;
  transition: transform .22s var(--ease);
}
.nav-menu a:hover { color: var(--ink); }
.nav-menu a:hover::after { transform: scaleX(1); }
.nav-menu a.active { color: var(--ink); }
.nav-menu a.active::after { transform: scaleX(1); background: var(--ink); }
.nav-menu a.nav-login {
  display: inline-flex; align-items: center; gap: 8px;
  margin-left: 12px;
  padding: 9px 14px;
  border: 1px solid var(--ink);
  border-radius: var(--r);
  color: var(--ink);
}
.nav-menu a.nav-login::after { display: none; }
.nav-menu a.nav-login svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.nav-menu a.nav-login:hover { background: var(--ink); color: var(--white); }

.nav-socials { display: flex; gap: 2px; }
.nav-socials a {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  color: var(--muted);
  border-radius: var(--r);
  transition: background .18s, color .18s;
}
.nav-socials a:hover { background: var(--yellow); color: var(--ink); }
.nav-socials svg { width: 17px; height: 17px; fill: currentColor; }

.nav-toggle {
  display: none; margin-left: auto;
  width: 44px; height: 44px;
  border: 1px solid var(--ink); border-radius: var(--r);
  background: transparent; cursor: pointer;
}
.nav-toggle i { display: block; width: 20px; height: 2px; margin: 4px auto; background: var(--ink); transition: transform .2s, opacity .2s; }
.nav-toggle[aria-expanded="true"] i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] i:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Trame de fond (grille visible) ---------- */
.home-hero, .page-hero, .project-detail-hero {
  position: relative;
  background-image:
    linear-gradient(var(--rule) 1px, transparent 1px),
    linear-gradient(90deg, var(--rule) 1px, transparent 1px);
  background-size: 80px 80px;
  background-position: -1px -1px;
}
.home-hero::before, .page-hero::before, .project-detail-hero::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--paper) 0%, rgba(245, 244, 240, .86) 55%, rgba(245, 244, 240, .55) 100%);
  pointer-events: none;
}
.home-hero > *, .page-hero > *, .project-detail-hero > * { position: relative; }

/* ---------- Héro d'accueil ---------- */
.home-hero { padding: 88px 0 0; }
.home-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 56px;
  align-items: end;
}
.home-hero-content { padding-bottom: 72px; }
.home-hero h1 { font-size: clamp(3rem, 8.4vw, 7.4rem); letter-spacing: -.055em; margin-bottom: 26px; }
.hero-lead {
  font-family: var(--font-head);
  font-size: clamp(1.3rem, 2.2vw, 1.75rem);
  line-height: 1.25;
  letter-spacing: -.02em;
  font-weight: 500;
  max-width: 620px;
  margin-bottom: 20px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* Cadre « détection » (clin d'œil vision industrielle) */
.vision-frame {
  position: relative;
  margin: 0;
  padding: 14px;
  align-self: end;
}
.vision-frame .home-photo { position: relative; aspect-ratio: 1 / 1; overflow: hidden; background: var(--yellow); }
.vision-frame img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.vision-frame .corner { position: absolute; width: 34px; height: 34px; border: 0 solid var(--ink); }
.vision-frame .c-tl { top: 0; left: 0; border-top-width: 3px; border-left-width: 3px; }
.vision-frame .c-tr { top: 0; right: 0; border-top-width: 3px; border-right-width: 3px; }
.vision-frame .c-bl { bottom: 0; left: 0; border-bottom-width: 3px; border-left-width: 3px; }
.vision-frame .c-br { bottom: 0; right: 0; border-bottom-width: 3px; border-right-width: 3px; }
.detect-box {
  position: absolute;
  left: 29%; top: 6%; width: 40%; height: 46%;
  border: 2px solid var(--ink);
}
.detect-box::before, .detect-box::after {
  content: ""; position: absolute; width: 10px; height: 10px; background: var(--ink);
}
.detect-box::before { right: -6px; bottom: -6px; }
.detect-box::after { left: -6px; bottom: -6px; }
.detect-label {
  position: absolute; left: -2px; top: -26px;
  padding: 3px 8px;
  background: var(--ink); color: var(--yellow);
  font-family: var(--font-mono); font-size: .7rem; font-weight: 600;
  white-space: nowrap;
}
.vision-caption {
  display: flex; justify-content: space-between; gap: 12px;
  margin-top: 10px;
  font-family: var(--font-mono); font-size: .7rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em;
}

/* Bande de caractéristiques */
.hero-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  background: var(--paper);
}
.hero-facts div { padding: 20px 22px; }
.hero-facts div + div { border-left: 1px solid var(--rule); }
.hero-facts dt { font-family: var(--font-mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted-2); margin-bottom: 6px; }
.hero-facts dd { margin: 0; font-family: var(--font-head); font-weight: 600; font-size: 1.08rem; letter-spacing: -.01em; }

/* ---------- En-têtes de chapitres ---------- */
.chapter-head {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 24px;
  margin-bottom: 56px;
}
.chapter-num {
  font-family: var(--font-mono);
  font-size: .82rem;
  font-weight: 600;
  padding-top: 8px;
  border-top: 3px solid var(--ink);
  align-self: start;
}
.chapter-head .section-kicker { margin-bottom: 14px; }
.chapter-head h2 { max-width: 820px; }
.chapter-head p:last-child { color: var(--muted); max-width: 640px; margin-bottom: 0; }
.chapter-body { margin-left: 144px; }
.section-heading { max-width: 720px; margin-bottom: 40px; }
.section-heading > p:last-child { color: var(--muted); }

/* ---------- Aujourd'hui (fiches) ---------- */
.now-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--ink); background: var(--white); }
.now-card { display: flex; flex-direction: column; padding: 0; }
.now-card + .now-card { border-left: 1px solid var(--ink); }
.now-top {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 28px;
  border-bottom: 1px solid var(--ink);
  font-family: var(--font-mono); font-size: .74rem; text-transform: uppercase; letter-spacing: .04em;
}
.is-company .now-top { background: var(--yellow); }
.is-school .now-top { background: var(--petrol); color: var(--white); }
.now-inner { display: flex; flex-direction: column; flex: 1; padding: 30px 28px 28px; }
.now-card h3 { font-size: clamp(1.5rem, 2.4vw, 2rem); letter-spacing: -.035em; margin-bottom: 6px; }
.now-role { color: var(--muted); font-weight: 600; margin-bottom: 22px; }
.now-card > .now-inner > p { color: var(--muted); }
.spec { margin: 0 0 22px; border-top: 1px solid var(--rule); }
.spec div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--rule); }
.spec dt { font-family: var(--font-mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted-2); padding-top: 3px; }
.spec dd { margin: 0; font-weight: 600; }
.now-meta { margin-top: auto; padding-top: 18px; display: flex; justify-content: flex-end; }
.now-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; border-bottom: 2px solid var(--ink); }
.now-link::after { content: "↗"; }
.now-link:hover { background: var(--yellow); }

/* ---------- Listes ---------- */
.clean-list { list-style: none; margin: 0 0 22px; padding: 0; }
.clean-list li { position: relative; padding: 7px 0 7px 26px; color: var(--muted); }
.clean-list li::before { content: "→"; position: absolute; left: 0; top: 7px; color: var(--ink); font-family: var(--font-mono); font-size: .9rem; }
.clean-list strong { color: var(--ink); }

/* ---------- Domaines ---------- */
.home-skills-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.skill-card { position: relative; padding: 30px 26px 34px; transition: background .2s var(--ease); }
.home-skills-grid .skill-card + .skill-card { border-left: 1px solid var(--rule); }
.skill-card::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 4px;
  background: var(--yellow); transform: scaleX(0); transform-origin: 0 50%;
  transition: transform .3s var(--ease);
}
.skill-card:hover { background: var(--white); }
.skill-card:hover::after { transform: scaleX(1); }
.skill-card > span {
  display: block;
  font-family: var(--font-head); font-weight: 600;
  font-size: 3rem; line-height: 1; letter-spacing: -.05em;
  color: var(--rule);
  margin-bottom: 28px;
  transition: color .2s;
}
.skill-card:hover > span { color: var(--ink); }
.skill-card p { color: var(--muted); margin-bottom: 0; font-size: .98rem; }

/* ---------- Parcours (frise verticale) ---------- */
.home-path { background: var(--white); }
.path-layout { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 80px; align-items: start; }
.path-intro { position: sticky; top: 120px; }
.path-intro .chapter-num { display: inline-block; width: 120px; margin-bottom: 28px; }
.path-intro > p:not(.section-kicker) { color: var(--muted); max-width: 460px; margin-bottom: 32px; }

.timeline-list { --node: 18px; list-style: none; margin: 0; padding: 0; position: relative; }
.timeline-list::before {
  content: ""; position: absolute;
  left: calc(var(--node) / 2 - 1px); top: 10px; bottom: 10px;
  width: 2px;
  background: repeating-linear-gradient(var(--ink) 0 6px, transparent 6px 10px);
}
.timeline-list li { position: relative; padding: 0 0 40px 48px; }
.timeline-list li:last-child { padding-bottom: 0; }
.timeline-list li::before {
  content: ""; position: absolute; left: 0; top: 4px;
  width: var(--node); height: var(--node);
  background: var(--white);
  border: 2px solid var(--ink);
  transition: transform .25s var(--ease), background .25s var(--ease);
}
.timeline-list li.is-school::before { background: var(--petrol); border-color: var(--petrol); }
.timeline-list li.is-now::before { background: var(--yellow); box-shadow: 0 0 0 5px var(--yellow-wash); }
.timeline-list li:hover::before { transform: rotate(45deg); }
.tl-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 6px; }
.tl-date { color: var(--ink); font-weight: 600; }
.timeline-list h3 { font-size: 1.18rem; margin-bottom: 4px; }
.timeline-list p { color: var(--muted); margin: 0; font-size: .98rem; max-width: 620px; }
.tag {
  padding: 2px 7px;
  border: 1px solid var(--ink);
  font-size: .62rem;
  white-space: nowrap;
}
.tag-company { background: var(--yellow); }
.tag-now { background: var(--ink); color: var(--yellow); }
.tag-school { background: var(--petrol); color: var(--white); border-color: var(--petrol); }

/* ---------- Projets (accueil) ---------- */
.home-projects-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 24px;
}
.home-project-card { position: relative; display: flex; flex-direction: column; grid-column: span 4; background: var(--white); border: 1px solid var(--ink); transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.home-project-card:first-child { grid-column: span 6; grid-row: span 2; }
.home-project-card:nth-child(2), .home-project-card:nth-child(3) { grid-column: span 6; flex-direction: row; }
.home-project-card:hover { transform: translate(-3px, -3px); box-shadow: 6px 6px 0 var(--ink); }
.home-project-card .proj-media { position: relative; overflow: hidden; background: var(--paper-2); border-bottom: 1px solid var(--ink); }
.home-project-card:first-child .proj-media { aspect-ratio: 4 / 3; }
.home-project-card:nth-child(n+2) .proj-media { flex: 0 0 42%; border-bottom: 0; border-right: 1px solid var(--ink); }
.home-project-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.home-project-card:hover img { transform: scale(1.04); }
.proj-index { position: absolute; left: 0; top: 0; padding: 4px 9px; background: var(--ink); color: var(--yellow); font-family: var(--font-mono); font-size: .72rem; }
.home-project-card > div:last-child { display: flex; flex-direction: column; flex: 1; padding: 24px; }
.home-project-card:first-child h3 { font-size: 1.8rem; }
.home-project-card p { color: var(--muted); font-size: .98rem; }
.project-link { display: inline-flex; align-items: center; gap: 8px; margin-top: auto; font-weight: 700; }
.project-link::after { content: "→"; transition: transform .2s var(--ease); }
.project-link:hover::after, .home-project-card:hover .project-link::after { transform: translateX(4px); }
.project-link::before { content: ""; position: absolute; inset: 0; }
.center-action { display: flex; justify-content: flex-end; margin-top: 36px; }

/* ---------- Contact (accueil) ---------- */
.contact-band { background: var(--ink); color: var(--white); padding: 112px 0; border-top: 0; }
.contact-band h2, .contact-band h3 { color: var(--white); }
.contact-band .section-kicker { color: rgba(255, 255, 255, .6); }
.contact-band .section-kicker::before, .contact-band .section-kicker::after { color: var(--yellow); }
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; align-items: end; }
.contact-grid h2 { font-size: clamp(2.6rem, 6vw, 5.4rem); letter-spacing: -.05em; line-height: .95; }
.contact-grid h2 .y { color: var(--yellow); }
.contact-grid > div > p { color: rgba(255, 255, 255, .7); max-width: 520px; margin-bottom: 0; }
.contact-card { border-top: 1px solid rgba(255, 255, 255, .3); }
.contact-card .contact-item { margin: 0; border-bottom: 1px solid rgba(255, 255, 255, .3); }
.contact-card .contact-item a {
  display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 16px; align-items: center;
  padding: 20px 4px;
  color: var(--white);
  font-family: var(--font-head); font-weight: 500; font-size: 1.15rem;
  transition: background .2s var(--ease), color .2s var(--ease), padding .2s var(--ease);
  word-break: break-word;
}
.contact-card .contact-item a::after { content: "↗"; font-family: var(--font-mono); }
.contact-card .contact-item a:hover { background: var(--yellow); color: var(--ink); padding-left: 14px; padding-right: 14px; }
.contact-card .contact-item small { font-family: var(--font-mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; opacity: .65; }

/* ---------- Pages intérieures : héros ---------- */
.page-hero { padding: 96px 0 80px; border-bottom: 1px solid var(--ink); }
.page-hero h1, .project-detail-hero h1 { max-width: 920px; letter-spacing: -.05em; }
.page-hero .eyebrow, .page-hero .hero-text { max-width: 720px; }
.page-hero .hero-text { margin-bottom: 0; }

.project-detail-hero { padding: 64px 0 80px; border-bottom: 1px solid var(--ink); }
.project-detail-hero h1 { font-size: clamp(2.4rem, 5vw, 4.4rem); }
.project-detail-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 56px; align-items: center; }
.project-detail-cover {
  position: relative;
  padding: 12px;
  background:
    linear-gradient(var(--ink), var(--ink)) top left / 34px 3px no-repeat,
    linear-gradient(var(--ink), var(--ink)) top left / 3px 34px no-repeat,
    linear-gradient(var(--ink), var(--ink)) top right / 34px 3px no-repeat,
    linear-gradient(var(--ink), var(--ink)) top right / 3px 34px no-repeat,
    linear-gradient(var(--ink), var(--ink)) bottom left / 34px 3px no-repeat,
    linear-gradient(var(--ink), var(--ink)) bottom left / 3px 34px no-repeat,
    linear-gradient(var(--ink), var(--ink)) bottom right / 34px 3px no-repeat,
    linear-gradient(var(--ink), var(--ink)) bottom right / 3px 34px no-repeat;
}
.project-detail-cover img { width: 100%; height: 420px; object-fit: cover; border: 1px solid var(--rule); background: var(--white); }
.back-link { display: flex; width: fit-content; align-items: center; gap: 8px; margin-bottom: 28px; font-family: var(--font-mono); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--ink); }
.back-link:hover { background: var(--yellow); }

/* ---------- Pages intérieures : contenu ---------- */
.detail-section { padding-top: 72px; border-top: 0; }
.detail-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 32px; align-items: start; }
.detail-content { display: grid; gap: 0; border-top: 1px solid var(--ink); }
.detail-block { padding: 36px 0; border-bottom: 1px solid var(--rule); background: transparent; }
.detail-block > h2 { font-size: clamp(1.45rem, 2.4vw, 2rem); }
.detail-block p { color: var(--muted); }
.detail-block p strong { color: var(--ink); }
.detail-block p:last-child { margin-bottom: 0; }

.project-summary-card {
  position: sticky; top: 96px;
  padding: 0;
  border: 1px solid var(--ink);
  background: var(--white);
}
.project-summary-card h2 {
  margin: 0;
  padding: 12px 20px;
  background: var(--ink); color: var(--white);
  font-family: var(--font-mono); font-size: .76rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: .05em;
}
.project-summary-card ul { list-style: none; margin: 0; padding: 4px 20px 10px; }
.project-summary-card li { padding: 11px 0; border-bottom: 1px dashed var(--rule); color: var(--muted); font-size: .96rem; }
.project-summary-card li:last-child { border-bottom: 0; }
.project-summary-card strong { display: block; font-family: var(--font-mono); font-size: .7rem; font-weight: 500; text-transform: uppercase; letter-spacing: .05em; color: var(--muted-2); }
.project-summary-card .section-kicker { margin: 16px 20px 0; }

.tech-pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 20px 0; }
.tech-pills span {
  padding: 4px 9px;
  border: 1px solid var(--ink);
  border-radius: var(--r);
  background: var(--white);
  font-family: var(--font-mono); font-size: .76rem;
}
.tech-pills.big span { font-size: .8rem; padding: 5px 10px; }

.feature-grid, .skills-matrix { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border: 1px solid var(--rule); margin-top: 8px; }
.feature-grid > div, .skills-matrix > div { padding: 20px 22px; background: var(--white); }
.feature-grid > div:nth-child(even), .skills-matrix > div:nth-child(even) { border-left: 1px solid var(--rule); }
.feature-grid > div:nth-child(n+3), .skills-matrix > div:nth-child(n+3) { border-top: 1px solid var(--rule); }
.feature-grid p, .skills-matrix p { margin-bottom: 0; color: var(--muted); font-size: .96rem; }
.feature-grid h3, .skills-matrix h3 { font-size: 1.05rem; }

.architecture-flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-top: 24px; border: 1px solid var(--ink); }
.architecture-flow span {
  position: relative;
  display: grid; place-items: center;
  min-height: 72px; padding: 14px;
  text-align: center;
  background: var(--white);
  font-family: var(--font-mono); font-size: .82rem; font-weight: 600;
}
.architecture-flow span + span { border-left: 1px solid var(--ink); }
.architecture-flow span:first-child { background: var(--yellow); }

/* Liste des projets */
.projects-list-section { padding-top: 72px; border-top: 0; }
.projects-list { display: grid; gap: 0; border-top: 1px solid var(--ink); counter-reset: proj; }
.project-list-card {
  position: relative;
  display: grid;
  grid-template-columns: 80px 380px minmax(0, 1fr);
  gap: 32px;
  padding: 36px 0;
  border-bottom: 1px solid var(--ink);
  counter-increment: proj;
  transition: background .2s var(--ease);
}
.project-list-card::before {
  content: counter(proj, decimal-leading-zero);
  font-family: var(--font-head); font-weight: 600; font-size: 2.6rem; letter-spacing: -.05em; line-height: 1;
  color: var(--rule);
  transition: color .2s;
}
.project-list-card:hover { background: var(--white); }
.project-list-card:hover::before { color: var(--ink); }
.project-list-image { aspect-ratio: 4 / 3; overflow: hidden; border: 1px solid var(--ink); background: var(--paper-2); }
.project-list-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.project-list-card:hover .project-list-image img { transform: scale(1.04); }
.project-list-content { padding: 0 24px 0 0; }
.project-list-content > p { color: var(--muted); }
.project-list-content h2 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); }
.project-topline { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 12px; }
.project-topline .project-tag { margin: 0; }
.project-type { padding: 3px 8px; border: 1px solid var(--ink); font-family: var(--font-mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.project-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

/* Captures */
.screenshots-section { padding: 48px 0 112px; border-top: 0; }
.screenshots-container { max-width: 940px; margin: 0 auto; padding: 0 var(--gutter); }
.screenshot-block { margin-bottom: 48px; }
.screenshot-block h3 { display: flex; align-items: center; gap: 10px; font-size: 1.1rem; margin-bottom: 14px; }
.screenshot-block h3::before { content: ""; width: 12px; height: 12px; background: var(--yellow); border: 1px solid var(--ink); }
.screenshot-block img { width: 100%; max-width: 1000px; border: 1px solid var(--ink); background: var(--white); }
.screenshot-block.mobile img { max-width: 320px; margin: 0 auto; }
.screenshot-grid { display: grid; gap: 24px; }
.screenshot-grid figure { margin: 0; border: 1px solid var(--ink); background: var(--white); }
.screenshot-grid figcaption { padding: 12px 16px; border-top: 1px solid var(--ink); font-family: var(--font-mono); font-size: .76rem; text-transform: uppercase; }

/* Frise des mondes (Pac-Man) */
.world-timeline { display: grid; gap: 0; margin-top: 24px; border-top: 1px solid var(--ink); }
.world-step { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--rule); }
.world-number { width: 48px; height: 48px; display: grid; place-items: center; background: var(--ink); color: var(--yellow); font-family: var(--font-mono); font-weight: 700; }
.world-step h3 { margin-bottom: 4px; }
.world-step p { margin-bottom: 0; color: var(--muted); }

/* Parcours */
.parcours-section { padding-top: 96px; }
.section-header { max-width: 820px; margin: 0 0 56px; }
.section-header p:not(.eyebrow) { color: var(--muted); margin-bottom: 0; }
.section-formation { background: var(--paper); border-top: 0; }
.section-experience { background: var(--white); border-top: 1px solid var(--ink); }
.section-formation .project-summary-card h2 { background: var(--petrol); }
.section-experience .project-summary-card h2 { background: var(--yellow); color: var(--ink); }

/* Contact */
.contact-page { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; align-items: center; }
.contact-info { padding: 36px; border: 1px solid var(--ink); background: var(--white); box-shadow: 8px 8px 0 var(--yellow); }
.contact-info > p { color: var(--muted); }
.contact-item { margin-bottom: 18px; }
.contact-item strong { display: block; margin-bottom: 2px; font-family: var(--font-mono); font-size: .7rem; font-weight: 500; text-transform: uppercase; letter-spacing: .05em; color: var(--muted-2); }
.contact-item a { font-weight: 700; border-bottom: 1px solid var(--ink); word-break: break-word; }
.contact-item a:hover { background: var(--yellow); }
.contact-photo { display: flex; justify-content: center; }
.contact-photo img { width: 100%; max-width: 440px; border: 1px solid var(--ink); box-shadow: 10px 10px 0 var(--ink); }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 700; margin-bottom: 6px; }
.form-group input, .form-group textarea { width: 100%; padding: 12px; border: 1px solid var(--ink); border-radius: var(--r); font: inherit; background: var(--white); }

/* ---------- Pied de page ---------- */
.footer { background: var(--ink-deep); color: var(--white); padding-top: 72px; overflow: hidden; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; }
.footer-about p { color: rgba(255, 255, 255, .6); max-width: 300px; font-size: .96rem; }
.footer-about .brand { margin-bottom: 18px; color: var(--white); }
.footer-about .brand-mark { background: var(--yellow); color: var(--ink); }
.footer-about .brand-sub { color: rgba(255, 255, 255, .5); }
.footer-col h4 { margin: 0 0 18px; font-family: var(--font-mono); font-size: .72rem; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; color: var(--yellow); }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { color: rgba(255, 255, 255, .82); font-size: .96rem; transition: color .18s; }
.footer-col a:hover { color: var(--yellow); }
.footer-wordmark {
  width: min(var(--max), calc(100% - 2 * var(--gutter)));
  margin: 64px auto 0;
  font-family: var(--font-head); font-weight: 700;
  font-size: clamp(3.2rem, 12.5vw, 11.5rem);
  line-height: .8; letter-spacing: -.06em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, .22);
  white-space: nowrap;
  user-select: none;
}
.footer-bottom {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  width: min(var(--max), calc(100% - 2 * var(--gutter)));
  margin: 0 auto;
  padding: 22px 0;
  border-top: 1px solid rgba(255, 255, 255, .16);
  font-family: var(--font-mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em;
  color: rgba(255, 255, 255, .55);
}
.footer-bottom p { margin: 0; }

/* ---------- Apparition au défilement ---------- */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .55s var(--ease), transform .55s var(--ease); }
.js .reveal.visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .nav-socials { display: none; }
  .home-skills-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-skills-grid .skill-card:nth-child(3) { border-left: 0; }
  .home-skills-grid .skill-card:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .project-list-card { grid-template-columns: 64px 300px minmax(0, 1fr); gap: 24px; }
}

@media (max-width: 960px) {
  .home-hero-grid, .now-grid, .contact-grid, .project-detail-grid, .detail-layout, .contact-page { grid-template-columns: minmax(0, 1fr); }
  .home-hero-content { padding-bottom: 24px; }
  .vision-frame { max-width: 440px; margin-bottom: 40px; }
  .now-card + .now-card { border-left: 0; border-top: 1px solid var(--ink); }
  .hero-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-facts div:nth-child(3) { border-left: 0; }
  .hero-facts div:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .chapter-head { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .path-layout { grid-template-columns: minmax(0, 1fr); gap: 48px; }
  .path-intro { position: static; }
  .chapter-num { width: 80px; }
  .chapter-body { margin-left: 0; }
  .home-project-card, .home-project-card:first-child, .home-project-card:nth-child(2), .home-project-card:nth-child(3) { grid-column: span 12; grid-row: auto; }
  .project-summary-card { position: static; }
  .project-list-card { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .project-list-content { padding: 0; }
  .project-detail-cover img { height: auto; }
  .architecture-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .architecture-flow span:nth-child(3) { border-left: 0; }
  .architecture-flow span:nth-child(n+3) { border-top: 1px solid var(--ink); }
}

@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .nav-menu {
    position: absolute; top: calc(100% + 8px); left: 16px; right: 16px;
    flex-direction: column; align-items: stretch;
    padding: 8px;
    background: var(--paper);
    border: 1px solid var(--ink);
    box-shadow: 8px 8px 0 var(--yellow);
    opacity: 0; transform: translateY(-8px); pointer-events: none; visibility: hidden;
    transition: opacity .18s, transform .18s, visibility .18s;
  }
  .nav-menu.open { opacity: 1; transform: none; pointer-events: auto; visibility: visible; }
  .nav-menu a { padding: 14px 12px; border-bottom: 1px solid var(--rule); }
  .nav-menu li:last-child a { border-bottom: 0; }
  .nav-menu a::after { display: none; }
  .nav-menu a.active { background: var(--yellow); }
  .nav-menu a.nav-login { display: flex; margin: 8px 0 0; justify-content: center; }
  .topbar .hide-sm { display: none; }
}

@media (max-width: 680px) {
  :root { --gutter: 16px; }
  body { font-size: 1rem; }
  .section { padding: 76px 0; }
  .home-hero { padding-top: 48px; }
  .hero-facts { grid-template-columns: minmax(0, 1fr); }
  .hero-facts div + div { border-left: 0; border-top: 1px solid var(--rule); }
  .home-project-card:nth-child(2), .home-project-card:nth-child(3) { flex-direction: column; }
  .home-project-card:nth-child(n+2) .proj-media { flex: none; aspect-ratio: 16 / 10; border-right: 0; border-bottom: 1px solid var(--ink); }
  .home-skills-grid { grid-template-columns: minmax(0, 1fr); }
  .home-skills-grid .skill-card + .skill-card { border-left: 0; border-top: 1px solid var(--rule); }
  .timeline-list li { padding-left: 38px; padding-bottom: 32px; }
  .spec div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .now-top, .now-inner { padding-left: 20px; padding-right: 20px; }
  .contact-card .contact-item a { grid-template-columns: minmax(0, 1fr) auto; }
  .contact-card .contact-item small { grid-column: 1 / -1; }
  .page-hero { padding: 64px 0 56px; }
  .project-detail-hero { padding: 48px 0 56px; }
  .feature-grid, .skills-matrix, .architecture-flow { grid-template-columns: minmax(0, 1fr); }
  .feature-grid > div:nth-child(even), .skills-matrix > div:nth-child(even) { border-left: 0; }
  .feature-grid > div + div, .skills-matrix > div + div { border-top: 1px solid var(--rule); }
  .architecture-flow span + span { border-left: 0; border-top: 1px solid var(--ink); }
  .world-step { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .contact-info { padding: 24px; box-shadow: 5px 5px 0 var(--yellow); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- Logos UTC × Psycle (en-tête) ---------- */
.brand-logos {
  display: flex; align-items: center; gap: 8px;
  padding-right: 14px; margin-right: 2px;
  border-right: 1px solid var(--rule);
}
.brand-logos img { height: 28px; width: auto; max-width: 130px; object-fit: contain; }
.brand-x { font-family: var(--font-mono); font-size: .85rem; color: var(--muted-2); }
@media (max-width: 680px) {
  .brand { gap: 10px; }
  .brand-logos { gap: 6px; padding-right: 10px; }
  .brand-logos img { height: 22px; max-width: 64px; }
  .brand-sub { display: none; }
}
@media (max-width: 380px) {
  .brand-logos { display: none; }
}

/* Logos cliquables (UTC / Psycle) séparés du lien d'accueil */
.brand-wrap { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-logos a { display: flex; align-items: center; padding: 4px; margin: -4px; border-radius: var(--r); transition: background .18s var(--ease), opacity .18s; }
.brand-logos a:hover { background: var(--paper-2); }
@media (max-width: 680px) { .brand-wrap { gap: 10px; } }
@media (max-width: 380px) { .brand-logos { display: none; } }

/* Logos UTC × Psycle (pied de page, sur pastille claire) */
.footer-logos {
  display: inline-flex; align-items: center; gap: 10px;
  margin-bottom: 20px;
  padding: 8px 12px;
  background: var(--paper);
  border-radius: var(--r);
}
.footer-logos a { display: flex; align-items: center; border-radius: var(--r); transition: opacity .18s; }
.footer-logos a:hover { opacity: .7; }
.footer-logos img { height: 26px; width: auto; max-width: 120px; object-fit: contain; }
.footer-logos .brand-x { color: var(--muted-2); }
.footer-about .brand { margin-bottom: 14px; }
