@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/BricolageGrotesque-variable.ttf") format("truetype-variations");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("/fonts/HankenGrotesk-variable.ttf") format("truetype-variations");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --paper: #f6f4ef;
  --surface: #ffffff;
  --ink: #17171b;
  --ink-2: #55565e;
  --line: #e2ded5;
  --accent: #d9481f;

  /* Une teinte par application, reprise de sa propre identité. */
  --conteur: #244cb2;
  --conteur-bg: #e7ecf9;
  --trousseau: #1e6fa8;
  --trousseau-bg: #e4eff6;
  --releve: #6a4cf5;
  --releve-bg: #eeebfe;
  --retour: #2f4263;
  --retour-bg: #e8ecf2;

  --radius: 24px;
  --wrap: 1160px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121215;
    --surface: #1b1b20;
    --ink: #f1f0ec;
    --ink-2: #a6a6ae;
    --line: #2d2d34;
    --accent: #ff7a52;
    --conteur: #93aef0;
    --conteur-bg: #161d33;
    --trousseau: #5eb3e4;
    --trousseau-bg: #13232e;
    --releve: #a795ff;
    --releve-bg: #1e1a35;
    --retour: #aebcd8;
    --retour-bg: #181e2a;
    color-scheme: dark;
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 "Hanken Grotesk", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

h1, h2, h3 {
  font-family: "Bricolage Grotesque", "Hanken Grotesk", sans-serif;
  line-height: 1.04;
  letter-spacing: -0.025em;
  margin: 0;
  text-wrap: balance;
}
p { margin: 0; text-wrap: pretty; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: 20px; padding-right: 20px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 8px; z-index: 20; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.eyebrow {
  font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2);
}

/* ——— Barre de progression ——— */
.progress {
  position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 15;
  background: linear-gradient(90deg, var(--conteur), var(--trousseau), var(--releve), var(--accent));
  transform-origin: 0 50%; transform: scaleX(0);
}

/* ——— En-tête ——— */
.top {
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  background: color-mix(in srgb, var(--paper) 78%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease;
}
.top.scrolled { border-bottom-color: var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 700 1.35rem/1 "Bricolage Grotesque", sans-serif; letter-spacing: -0.02em; }
.brand svg { width: 30px; height: 30px; transition: transform .6s var(--ease); }
.brand:hover svg { transform: rotate(90deg); }
.top nav { display: flex; gap: 24px; font-weight: 500; }
.top nav a { text-decoration: none; color: var(--ink-2); transition: color .2s; }
.top nav a:hover { color: var(--ink); }

/* ——— Ouverture ——— */
.hero {
  position: relative;
  min-height: min(92svh, 900px);
  display: grid; align-content: center;
  padding-top: 40px; padding-bottom: 100px;
}
.hero-text { position: relative; z-index: 2; max-width: 50rem; }
.hero h1 {
  font-size: clamp(2.8rem, 8vw, 6.2rem);
  font-weight: 700;
  margin: 20px 0 28px;
}
.hero h1 .line { display: block; overflow: hidden; padding-bottom: .06em; }
.hero h1 .line > span { display: inline-block; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lede { font-size: clamp(1.1rem, 2vw, 1.3rem); color: var(--ink-2); max-width: 40rem; }
.hero .cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 38px; }

.floaters { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.floater {
  position: absolute;
  width: clamp(64px, 9vw, 118px); aspect-ratio: 1;
  border-radius: 24%;
  box-shadow: 0 24px 50px -20px rgb(0 0 0 / .35), 0 2px 6px rgb(0 0 0 / .1);
  overflow: hidden;
  will-change: transform;
}
.floater img { width: 100%; height: 100%; }
.floater.f1 { right: 6%; top: 10%; }
.floater.f2 { right: 22%; top: 38%; width: clamp(52px, 7vw, 92px); }
.floater.f3 { right: 3%; top: 58%; width: clamp(56px, 8vw, 104px); }
.floater.f4 { right: 18%; top: 76%; width: clamp(46px, 6vw, 80px); }

.scroll-hint {
  position: absolute; left: 20px; bottom: 28px; z-index: 2;
  display: flex; align-items: center; gap: 10px;
  font-size: .85rem; color: var(--ink-2); text-decoration: none;
}
.scroll-hint i {
  width: 22px; height: 34px; border: 1.5px solid currentColor; border-radius: 12px; position: relative;
}
.scroll-hint i::after {
  content: ""; position: absolute; left: 50%; top: 7px; width: 3px; height: 7px; margin-left: -1.5px;
  border-radius: 2px; background: currentColor; animation: wheel 1.8s var(--ease) infinite;
}
@keyframes wheel { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(10px); opacity: 0; } 100% { opacity: 0; } }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 24px; border-radius: 999px;
  font-weight: 600; text-decoration: none;
  border: 1.5px solid var(--ink);
  transition: transform .2s var(--ease), background .2s ease, color .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-solid { background: var(--ink); color: var(--paper); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }

/* ——— Bandeau défilant ——— */
.band {
  border-block: 1px solid var(--line);
  padding: 22px 0;
  overflow: hidden;
  white-space: nowrap;
  font: 700 clamp(1.8rem, 5vw, 3.4rem)/1 "Bricolage Grotesque", sans-serif;
  letter-spacing: -0.02em;
}
.band-track { display: inline-flex; gap: .6em; will-change: transform; }
.band-track span { display: inline-flex; align-items: center; gap: .6em; }
.band-track span::after { content: ""; width: .32em; height: .32em; border-radius: 30%; background: var(--accent); }
.band-track span:nth-child(4n+1) { color: var(--conteur); }
.band-track span:nth-child(4n+2) { color: var(--trousseau); }
.band-track span:nth-child(4n+3) { color: var(--releve); }
.band-track span:nth-child(4n+4) { color: var(--retour); }

/* ——— Sections ——— */
section { padding: 110px 0; }
.section-head { display: grid; gap: 14px; margin-bottom: 56px; max-width: 46rem; }
.section-head h2 { font-size: clamp(2.1rem, 5vw, 3.6rem); font-weight: 700; }
.section-head p { color: var(--ink-2); font-size: 1.15rem; }

/* ——— Les applications ——— */
.apps { display: grid; gap: 28px; }

.app {
  --c: var(--ink); --c-bg: var(--surface);
  background: var(--c-bg);
  border-radius: calc(var(--radius) + 6px);
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 40px;
  padding: clamp(28px, 5vw, 64px);
  padding-bottom: 0;
  overflow: hidden;
  position: relative;
  min-height: 560px;
}
.app:nth-child(even) { grid-template-columns: 1fr 1.15fr; }
.app:nth-child(even) .app-text { order: 2; }
.app.conteur { --c: var(--conteur); --c-bg: var(--conteur-bg); }
.app.trousseau { --c: var(--trousseau); --c-bg: var(--trousseau-bg); }
.app.releve { --c: var(--releve); --c-bg: var(--releve-bg); }
.app.retour { --c: var(--retour); --c-bg: var(--retour-bg); }

/* Grand numéro en filigrane. */
.app::before {
  content: attr(data-num);
  position: absolute; right: -.05em; top: -.18em;
  font: 800 clamp(10rem, 24vw, 20rem)/1 "Bricolage Grotesque", sans-serif;
  color: var(--c); opacity: .07; letter-spacing: -0.05em;
  pointer-events: none;
}
.app:nth-child(even)::before { right: auto; left: -.02em; }

.app-text { display: grid; gap: 18px; align-content: center; padding-bottom: clamp(28px, 5vw, 64px); position: relative; }
.app-head { display: flex; align-items: center; gap: 16px; }
.app-icon { width: 68px; height: 68px; border-radius: 16px; box-shadow: 0 1px 2px rgb(0 0 0 / .12), 0 8px 18px -8px rgb(0 0 0 / .3); flex: none; }
.app h3 { font-size: clamp(2rem, 4vw, 2.7rem); font-weight: 700; color: var(--c); }
.app .for { font-size: .92rem; color: var(--ink-2); font-weight: 500; margin-top: 4px; }
.app .pitch { font-size: 1.22rem; font-weight: 500; line-height: 1.5; }
.app ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; color: var(--ink-2); }
.app li { padding-left: 22px; position: relative; }
.app li::before { content: ""; position: absolute; left: 2px; top: .6em; width: 8px; height: 8px; border-radius: 2.5px; background: var(--c); }

.app-links { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 4px; }
.app-links .site { font-weight: 600; color: var(--c); text-underline-offset: 4px; }
.app-links .badge { transition: transform .2s var(--ease); }
.app-links .badge:hover { transform: translateY(-2px); }
.app-links .badge img { height: 42px; width: auto; }
.status {
  display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .03em;
  padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--c); color: var(--c);
}

.app-visual { position: relative; display: flex; justify-content: center; align-items: flex-end; }
.phone {
  width: min(100%, 300px);
  aspect-ratio: 560 / 1080;
  overflow: hidden;
  border-radius: 38px 38px 0 0;
  border: 9px solid #0d0d10;
  border-bottom: 0;
  background: #fff;
  box-shadow: 0 40px 80px -30px rgb(0 0 0 / .5);
  will-change: transform;
}
.phone img { width: 100%; height: auto; }

/* ——— Principes ——— */
.principles { display: grid; gap: 28px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.principle { border-top: 2px solid var(--ink); padding-top: 22px; display: grid; gap: 12px; align-content: start; }
.principle .num { font: 700 .85rem/1 "Bricolage Grotesque", sans-serif; color: var(--accent); letter-spacing: .08em; }
.principle h3 { font-size: 1.5rem; font-weight: 650; }
.principle p { color: var(--ink-2); }

/* ——— La maison ——— */
.house {
  background: var(--ink); color: var(--paper);
  border-radius: calc(var(--radius) + 10px);
  padding: clamp(32px, 6vw, 80px);
  display: grid; gap: 56px;
  grid-template-columns: 1fr 1fr;
  align-items: center;
}
.house .eyebrow { color: var(--accent); }
.house h2 { font-size: clamp(2.2rem, 5vw, 3.8rem); font-weight: 700; margin: 16px 0 24px; }
.house p { color: color-mix(in srgb, var(--paper) 74%, transparent); font-size: 1.12rem; }
.house p + p { margin-top: 16px; }
.house strong { color: var(--paper); font-weight: 600; }

.names { list-style: none; margin: 0; padding: 0; display: grid; }
.names li {
  display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 6px 20px;
  padding: 20px 0; border-top: 1px solid color-mix(in srgb, var(--paper) 16%, transparent);
}
.names li:first-child { border-top: 0; }
.names b { font: 700 clamp(1.5rem, 3vw, 2.1rem)/1.1 "Bricolage Grotesque", sans-serif; letter-spacing: -0.02em; }
.names span { color: color-mix(in srgb, var(--paper) 62%, transparent); text-align: right; }
.names li:nth-child(1) b { color: #93aef0; }
.names li:nth-child(2) b { color: #5eb3e4; }
.names li:nth-child(3) b { color: #a795ff; }
.names li:nth-child(4) b { color: #ff9a78; }

@media (prefers-color-scheme: dark) {
  .names li:nth-child(1) b { color: #244cb2; }
  .names li:nth-child(2) b { color: #1e6fa8; }
  .names li:nth-child(3) b { color: #6a4cf5; }
  .names li:nth-child(4) b { color: #d9481f; }
}

/* ——— Contact ——— */
.contact { text-align: center; padding: 130px 0 140px; }
.contact h2 { font-size: clamp(2.4rem, 7vw, 4.8rem); font-weight: 700; margin: 16px auto 20px; max-width: 14ch; }
.contact p { color: var(--ink-2); max-width: 36rem; margin: 0 auto; font-size: 1.15rem; }
.contact .mail {
  display: inline-block; margin-top: 34px;
  font: 650 clamp(1.15rem, 3.4vw, 1.8rem)/1.2 "Bricolage Grotesque", sans-serif;
  color: var(--accent); text-underline-offset: 6px; text-decoration-thickness: 2px;
  overflow-wrap: anywhere;
}

/* ——— Pied ——— */
footer { border-top: 1px solid var(--line); padding: 28px 0 40px; font-size: .9rem; color: var(--ink-2); }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
footer a { color: var(--ink-2); text-underline-offset: 3px; }
footer a:hover { color: var(--ink); }

/* ——— Page de texte (mentions) ——— */
.doc { max-width: 46rem; padding: 48px 0 100px; }
.doc h1 { font-size: clamp(2.3rem, 5vw, 3.5rem); font-weight: 700; margin-bottom: 12px; }
.doc .updated { color: var(--ink-2); margin-bottom: 44px; }
.doc h2 { font-size: 1.45rem; font-weight: 650; margin: 44px 0 12px; }
.doc p, .doc ul { margin: 0 0 12px; }
.doc ul { padding-left: 1.2em; }
.doc dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 22px; margin: 0; }
.doc dt { color: var(--ink-2); }
.doc dd { margin: 0; font-weight: 500; }

/* ——— Apparitions au défilement ———
   Seulement quand le script tourne (classe .js) : sans lui, tout est visible. */
.js .reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
  transition-delay: var(--d, 0s);
}
.js .reveal.in { opacity: 1; transform: none; }

.js .hero h1 .line > span { transform: translateY(105%); transition: transform 1s var(--ease); }
.js .hero h1 .line:nth-child(2) > span { transition-delay: .09s; }
.js .hero h1 .line:nth-child(3) > span { transition-delay: .18s; }
.js.ready .hero h1 .line > span { transform: none; }
.js .hero .eyebrow, .js .hero .lede, .js .hero .cta {
  opacity: 0; transform: translateY(16px);
  transition: opacity .8s var(--ease) .35s, transform .8s var(--ease) .35s;
}
.js .hero .lede { transition-delay: .45s; }
.js .hero .cta { transition-delay: .55s; }
.js.ready .hero .eyebrow, .js.ready .hero .lede, .js.ready .hero .cta { opacity: 1; transform: none; }

.js .floater { opacity: 0; transition: opacity 1.2s ease .5s; }
.js.ready .floater { opacity: 1; }

@media (max-width: 900px) {
  .app, .app:nth-child(even) { grid-template-columns: 1fr; gap: 8px; min-height: 0; }
  .app:nth-child(even) .app-text { order: 0; }
  .app-text { padding-bottom: 12px; }
  .phone { width: min(76%, 280px); }
  .principles, .house { grid-template-columns: 1fr; }
  .top nav a:not(.keep) { display: none; }
  .hero { min-height: 0; padding-top: 48px; padding-bottom: 72px; }
  .floaters { position: relative; inset: auto; height: 110px; margin-top: 44px; display: flex; align-items: flex-start; gap: 16px; }
  .floater, .floater.f1, .floater.f2, .floater.f3, .floater.f4 { position: relative; inset: auto; width: 68px; }
  .floater.f2 { margin-top: 26px; } .floater.f4 { margin-top: 18px; }
  .scroll-hint { display: none; }
  section { padding: 76px 0; }
  .contact { padding: 90px 0 100px; }
  .doc dl { grid-template-columns: 1fr; gap: 2px; }
  .doc dd { margin-bottom: 12px; }
  .names li { grid-template-columns: 1fr; }
  .names span { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js .reveal, .js .hero h1 .line > span, .js .hero .eyebrow, .js .hero .lede, .js .hero .cta, .js .floater { opacity: 1; transform: none; }
}
