:root {
  --bg: #f6f3ee;
  --surface: #ffffff;
  --ink: #16151a;
  --ink-soft: #55525c;
  --line: #e2ddd4;
  --red: #da291c;
  --red-ink: #b81f14;
  --accent: #ffd23f;
  --dark: #16151a;
  --on-dark: #f6f3ee;
  --radius: 18px;
  --max: 1160px;
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111014;
    --surface: #1b1a20;
    --ink: #f3f0ea;
    --ink-soft: #a9a5b0;
    --line: #2d2b33;
    --red: #ff4a3d;
    --red-ink: #ff6a5f;
    --dark: #1b1a20;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
.project { scroll-margin-top: 84px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.08; margin: 0; letter-spacing: -0.02em; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; background: var(--red); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 99; }

/* NAV */
.nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px max(16px, calc((100% - var(--max)) / 2));
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-display); font-size: 17px; }
.brand b { margin-left: 4px; }
.brand-mark {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 7px;
  background: var(--red); color: #fff; font-weight: 700; font-size: 22px; line-height: 1;
}
.nav nav { display: flex; gap: 22px; align-items: center; font-size: 15px; font-weight: 500; }
.nav nav a { text-decoration: none; color: var(--ink-soft); transition: color .2s; }
.nav nav a:hover { color: var(--ink); }
.nav .nav-cta { color: #fff; background: var(--ink); padding: 8px 16px; border-radius: 999px; }
@media (prefers-color-scheme: dark) { .nav .nav-cta { color: var(--bg); } }
.nav .nav-cta:hover { color: #fff; background: var(--red); }

/* LAYOUT */
.hero, .section, .stats, .contact { width: min(var(--max), calc(100% - 32px)); margin-inline: auto; }

/* HERO */
.hero {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 56px; align-items: center;
  padding: 88px 0 64px;
}
.eyebrow, .kicker {
  font-family: var(--font-display); font-weight: 500; text-transform: uppercase; letter-spacing: .12em;
  font-size: 13px; color: var(--red-ink); margin: 0 0 18px;
}
.hero h1 { font-size: clamp(42px, 6.4vw, 82px); font-weight: 700; }
.hero-name { display: block; line-height: 1.5; text-wrap: pretty; }
.hero-name strong { font-weight: 700; }
.swiss { color: var(--red); position: relative; white-space: nowrap; }
.swiss::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: .06em; height: .14em;
  background: var(--accent); z-index: -1; transform-origin: left; animation: underline 1s .4s both cubic-bezier(.7,0,.2,1);
}
@keyframes underline { from { transform: scaleX(0); } }
.rotator { display: block; min-height: 2.16em; color: var(--ink); }
.rotator span { text-decoration: underline 3px var(--red); text-underline-offset: .12em; transition: opacity .3s; }
.rotator span.out { opacity: 0; }
.lede { font-size: 19px; color: var(--ink-soft); max-width: 58ch; margin: 28px 0 32px; }
.hero-actions, .contact-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 13px 22px; border-radius: 999px;
  text-decoration: none; font-weight: 600; font-size: 15px; transition: transform .2s, background .2s, color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-ink); }
.btn-ghost { border: 1.5px solid var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--bg); }

.hero-photo { margin: 0; position: relative; justify-self: center; width: min(360px, 100%); }
.hero-photo::before {
  content: "+"; position: absolute; inset: -18px -18px auto auto; width: 84px; height: 84px; border-radius: 20px;
  background: var(--red); color: #fff; font: 700 64px/84px var(--font-display); text-align: center; z-index: 2;
  transform: rotate(8deg); box-shadow: 0 10px 30px rgba(218,41,28,.35);
  animation: spin-in .9s .2s both cubic-bezier(.2,.9,.3,1.3);
}
@keyframes spin-in { from { transform: rotate(-120deg) scale(.3); opacity: 0; } }
.hero-photo img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 28px; border: 6px solid var(--surface); box-shadow: 0 30px 60px -20px rgba(0,0,0,.35); }
.hero-photo figcaption { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; justify-content: center; }
.hero-photo figcaption span { font-size: 13px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }

/* STATS */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 40px;
}
.stat { background: var(--surface); padding: 28px 24px; }
.stat strong { display: block; font: 700 clamp(34px, 4vw, 48px)/1 var(--font-display); color: var(--red); margin-bottom: 10px; }
.stat span { font-size: 14px; color: var(--ink-soft); }

/* SECTIONS */
.section { padding: 88px 0 24px; }
.section-head { max-width: 680px; margin-bottom: 44px; }
.section-head h2, .contact h2 { font-size: clamp(32px, 4.4vw, 54px); margin-bottom: 16px; }
.section-head p:not(.kicker) { color: var(--ink-soft); margin: 0; font-size: 18px; }
.sub { font-size: 20px; margin: 48px 0 18px; }

/* BLADES */
.blades { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.blade {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; overflow: hidden; transition: transform .35s cubic-bezier(.2,.9,.3,1.2), border-color .3s;
  transform-origin: 0 100%;
}
.blade::after {
  content: ""; position: absolute; left: 0; top: 0; height: 4px; width: 100%; background: var(--red);
  transform: scaleX(0); transform-origin: left; transition: transform .4s;
}
.blade:hover { transform: rotate(-1.5deg) translateY(-4px); border-color: var(--red); }
.blade:hover::after { transform: scaleX(1); }
.blade h3 { font-size: 21px; margin: 14px 0 8px; }
.blade p { margin: 0; color: var(--ink-soft); font-size: 15px; }
.blade-icon {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  background: var(--bg); font-size: 22px; color: var(--red);
}
.blade-hot { background: var(--dark); color: var(--on-dark); border-color: var(--dark); }
.blade-hot p { color: #cfcad6; }
.blade-hot .blade-icon { background: var(--red); color: #fff; }

/* PROJECTS */
.project {
  background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 36px;
  position: relative; overflow: hidden;
}
.project h3 { font-size: clamp(30px, 3.6vw, 44px); margin: 16px 0 12px; }
.project-lede { font-size: 18px; color: var(--ink-soft); margin: 0 0 20px; max-width: 60ch; }
.project-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); }
.tag-hot { background: var(--red); border-color: var(--red); color: #fff; }
.project-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.project-list li { padding-left: 26px; position: relative; font-size: 15.5px; }
.project-list li::before { content: "+"; position: absolute; left: 0; top: -1px; font: 700 18px var(--font-display); color: var(--red); }
.project-link { display: inline-block; margin-top: 24px; font-weight: 600; text-decoration: none; border-bottom: 2px solid var(--red); padding-bottom: 2px; }
.project-link:hover { color: var(--red); }
.note { font-size: 13px; color: var(--ink-soft); font-style: italic; margin: 20px 0 0; }

.project-nucleus {
  background: var(--dark); color: var(--on-dark); border-color: var(--dark); margin-bottom: 16px;
  background-image:
    radial-gradient(circle at 85% 30%, rgba(218,41,28,.45), transparent 40%),
    radial-gradient(circle at 95% 90%, rgba(255,210,63,.18), transparent 35%);
}
.project-nucleus .project-lede, .project-nucleus .note { color: #cfcad6; }
.project-nucleus .tag { border-color: #3a3842; }
.project-nucleus .tag-hot { border-color: var(--red); }
.project-nucleus .project-list { grid-template-columns: 1fr 1fr; column-gap: 32px; }
.project-nucleus::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%;
  border: 2px dashed rgba(255,255,255,.12); animation: orbit 40s linear infinite;
}
@keyframes orbit { to { transform: rotate(360deg); } }

.project-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.project-cmj { border-top: 6px solid #f28c28; }
.project-cdc { border-top: 6px solid var(--accent); }

/* TIMELINE */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.timeline li { position: relative; padding: 0 0 36px 44px; }
.timeline li::before {
  content: ""; position: absolute; left: 0; top: 6px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--red);
}
.timeline li:first-child::before { background: var(--red); }
.when { font: 500 13px var(--font-display); text-transform: uppercase; letter-spacing: .1em; color: var(--red-ink); }
.timeline h3 { font-size: 22px; margin: 4px 0 8px; }
.timeline small { display: block; font: 500 15px var(--font-body); color: var(--ink-soft); margin-top: 4px; letter-spacing: 0; }
.timeline p { margin: 0; color: var(--ink-soft); max-width: 72ch; font-size: 15.5px; }

.edu { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.edu li { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; font-size: 15px; }
.edu span { display: block; font: 500 12px var(--font-display); text-transform: uppercase; letter-spacing: .1em; color: var(--ink-soft); margin-bottom: 4px; }
.edu em { font-style: normal; font-weight: 600; color: var(--red-ink); margin-left: 6px; }
.edu-ai { border-left: 4px solid var(--red) !important; }

/* CHIPS */
.chips-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.chips-wrap .sub { margin-top: 0; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; transition: transform .2s; }
.chips li:hover { transform: translateY(-2px); }
.chips li.hot { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }
.aside { margin-top: 36px; color: var(--ink-soft); font-size: 15px; }

/* CONTACT */
.contact {
  margin-top: 88px; margin-bottom: 40px; padding: 64px 48px; border-radius: 28px; background: var(--red); color: #fff;
  position: relative; overflow: hidden;
}
.contact::after {
  content: "+"; position: absolute; right: -20px; bottom: -120px; font: 700 420px/1 var(--font-display); color: rgba(255,255,255,.12);
}
.contact .kicker { color: #ffe9e6; }
.contact p { font-size: 18px; max-width: 52ch; margin: 0 0 28px; }
.contact .btn-primary { background: #fff; color: var(--red-ink); }
.contact .btn-ghost { border-color: #fff; color: #fff; }
.contact .btn-ghost:hover { background: #fff; color: var(--red-ink); }
.contact-actions { position: relative; z-index: 1; }

.foot { text-align: center; padding: 24px 16px 48px; color: var(--ink-soft); font-size: 14px; }

/* REVEAL */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s, transform .7s cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1; transform: none; }

/* RESPONSIVE */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; padding-top: 48px; gap: 40px; }
  .hero-photo { width: min(280px, 80%); }
  .stats { grid-template-columns: 1fr 1fr; }
  .blades { grid-template-columns: 1fr 1fr; }
  .project-grid, .chips-wrap { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .nav nav a:not(.nav-cta) { display: none; }
  .blades, .edu, .project-nucleus .project-list { grid-template-columns: 1fr; }
  .project { padding: 26px 22px; }
  .contact { padding: 44px 24px; }
  .swiss { white-space: normal; }
  .contact .btn { width: 100%; justify-content: center; word-break: break-all; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* NUCLEUS MAP */
.wf { margin: 32px 0 0; }
.wf img { width: 100%; max-height: 760px; object-fit: contain; border-radius: 16px; border: 1px solid #3a3842; background: #16151a; }
.wf figcaption { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; font-size: 13px; color: #cfcad6; }
.wf i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 7px; vertical-align: -1px; }
.k-trig { background: #da291c; } .k-tg { background: #5aa9e6; } .k-ai { background: #ffd23f; }
.k-api { background: #9b8cff; } .k-logic { background: #f6f3ee; } .k-code { background: #55525c; }
.hero-photo figcaption .avail { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }

/* PROJECT LAYOUT & GALLERIES */
.project + .project { margin-top: 16px; }
.project-nucleus { margin-bottom: 0; }
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 36px; align-items: start; }
.phones { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.phones figure { margin: 0; }
.phones img { width: 100%; border-radius: 22px; border: 5px solid #2b2a31; box-shadow: 0 20px 40px -18px rgba(0,0,0,.7); transition: transform .35s; }
.phones figure:nth-child(2) img { transform: translateY(18px); }
.phones figure:hover img { transform: translateY(-6px) rotate(-1deg); }
.phones figcaption { text-align: center; font-size: 13px; color: #cfcad6; margin-top: 10px; }
.phones figure:nth-child(2) figcaption { margin-top: 28px; }
.wf figcaption strong { width: 100%; font: 600 14px var(--font-display); color: var(--on-dark); }

.shots { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.shot { margin: 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); box-shadow: 0 16px 34px -20px rgba(0,0,0,.4); transition: transform .3s; }
.shot::before { content: ""; display: block; height: 14px; background: radial-gradient(circle at 10px 7px, #ff5f57 3px, transparent 3.5px), radial-gradient(circle at 22px 7px, #febc2e 3px, transparent 3.5px), radial-gradient(circle at 34px 7px, #28c840 3px, transparent 3.5px), var(--bg); border-bottom: 1px solid var(--line); }
.shot:hover { transform: translateY(-4px); }
.shot img { width: 100%; }
.shot-main { grid-column: 1 / -1; }

.project-rnj { border-top: 6px solid #5865f2; }
.pipeline { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; counter-reset: s; }
.pipe-step { position: relative; background: var(--bg); border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; }
.pipe-step:not(:last-child)::after {
  content: "→"; position: absolute; right: -14px; top: 50%; transform: translateY(-50%); z-index: 1;
  width: 26px; height: 26px; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; font-size: 14px;
}
.pipe-num { font: 600 13px var(--font-display); text-transform: uppercase; letter-spacing: .1em; color: var(--red-ink); }
.pipe-step ul { margin: 10px 0 0; padding-left: 18px; font-size: 15px; }
.pipe-step li { margin: 4px 0; }
.sectors { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.sectors li { font-size: 13px; padding: 6px 12px; border-radius: 999px; background: #5865f2; color: #fff; font-weight: 600; }

@media (max-width: 960px) {
  .split, .pipeline { grid-template-columns: 1fr; }
  .pipe-step:not(:last-child)::after { content: "↓"; right: 50%; top: auto; bottom: -14px; transform: translateX(50%); }
}
@media (max-width: 520px) {
  .shots { grid-template-columns: 1fr; }
  .phones { gap: 8px; }
  .phones img { border-width: 3px; border-radius: 14px; }
}
.project-nucleus .split .project-list { grid-template-columns: 1fr; }
.split-rnj { margin-bottom: 36px; }
.pipe-title { font: 700 20px var(--font-display); margin: 0 0 16px; }
@media (max-width: 380px) { .hero h1 { font-size: 37px; } }

/* Évite les mots seuls en fin de paragraphe */
h1, h2, h3 { text-wrap: balance; }
p, li { text-wrap: pretty; }
.section-head { max-width: 760px; }
