/* ==========================================================
   Book — Etienne Achard
   Charte : DM Serif Display + Inter, fond blanc, accent bleu nuit
   ========================================================== */

:root {
  --bg-page: #f6f6f6;
  --bg-surface: #ffffff;
  --bg-inverse: #06005d;
  --text-primary: #0f1115;
  --text-muted: #5f6670;
  --text-inverse: #ffffff;
  --border-default: #e2e4e8;
  --accent: #06005d;
  --highlight: #ff4c15;
  --accent-hover: #0a0090;

  --font-serif: "DM Serif Display", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --margin: 40px;
  --radius: 12px;
  --max: 1440px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }

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

/* ---------- Navigation ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-default);
}
.nav .wrap { display: flex; justify-content: space-between; align-items: center; padding-top: 22px; padding-bottom: 22px; }
.nav__logo { font-size: 14px; font-weight: 500; text-decoration: none; }
.nav__links { display: flex; gap: 40px; }
.nav__link { font-size: 14px; font-weight: 500; text-decoration: none; color: var(--text-primary); }
.nav__link:hover { color: var(--accent); }
.nav__link[aria-current="page"] { color: var(--highlight); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 16px 24px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--text-inverse);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s ease;
}
.btn:hover { background: var(--accent-hover); }

/* ---------- Hero accueil ---------- */
.hero { padding-top: 64px; padding-bottom: 96px; }
.eyebrow { font-size: 14px; font-weight: 500; color: var(--text-muted); }
.hero__title {
  margin-top: 64px;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(64px, 14vw, 200px);
  line-height: 0.95;
  letter-spacing: -0.02em;
}
.hero__row { margin-top: 64px; display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; }
.hero__intro { max-width: 560px; font-size: 22px; line-height: 1.45; }

/* ---------- Sections ---------- */
.section { border-top: 1px solid var(--border-default); padding-top: 96px; padding-bottom: 96px; }
.section__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 64px; }
.section__title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(48px, 7vw, 96px);
  line-height: 0.95;
  letter-spacing: -0.01em;
}
.section__count { font-size: 14px; font-weight: 500; color: var(--text-muted); }

/* ---------- Cartes projets ---------- */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 56px 40px; }
.card { display: flex; flex-direction: column; gap: 16px; text-decoration: none; }
.card__visual {
  aspect-ratio: 11 / 7;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
}
.card__visual img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform 0.5s ease; }
.card:hover .card__visual img { transform: scale(1.03); }
.card__visual--cover { background: transparent; border: 0; }
.card__visual--cover img { object-position: center; }
.card__visual--contain { display: flex; align-items: center; justify-content: center; padding: 24px; }
.card__visual--contain img { width: 100%; height: auto; object-fit: contain; border-radius: 8px; }
.card__visual--empty { display: flex; align-items: center; justify-content: center; font-size: 14px; color: var(--text-muted); }
.card__meta { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.card__name { font-family: var(--font-serif); font-weight: 400; font-size: 32px; line-height: 1.1; }
.card__desc { max-width: 260px; font-size: 15px; color: var(--text-muted); }
.card__year { font-size: 14px; color: var(--text-muted); }

/* ---------- Pied de page ---------- */
.footer { background: var(--bg-inverse); color: var(--text-inverse); padding-top: 96px; padding-bottom: 40px; }
.footer__title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(44px, 7vw, 96px);
  line-height: 0.98;
  letter-spacing: -0.01em;
}
.footer__row { margin-top: 40px; display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.footer__link { font-size: 22px; text-decoration: none; }
.footer__link:hover { text-decoration: underline; }
.footer__legal { margin-top: 64px; font-size: 13px; color: #b9b6e6; }

/* ---------- Page « Qui je suis » ---------- */
.about-hero { padding-top: 64px; padding-bottom: 96px; }
.about-hero__title { margin-top: 48px; font-family: var(--font-serif); font-weight: 400; font-size: clamp(52px, 8.5vw, 120px); line-height: 0.98; letter-spacing: -0.01em; }
.about-hero__sub { font-family: var(--font-serif); font-style: italic; font-weight: 400; color: var(--text-muted); font-size: clamp(26px, 3.6vw, 48px); line-height: 1.1; margin-top: 12px; }
.about-hero__grid { margin-top: 64px; display: grid; grid-template-columns: 1fr 520px; gap: 64px; align-items: start; }
.about-hero__lead { font-size: 22px; line-height: 1.45; }
.about-hero__bio { margin-top: 24px; color: var(--text-muted); }
.about-hero__photo { border-radius: var(--radius); overflow: hidden; aspect-ratio: 520 / 640; background: var(--bg-surface); }
.about-hero__photo img { width: 100%; height: 100%; object-fit: cover; }

.xp { border-top: 1px solid var(--border-default); }
.xp__row { display: grid; grid-template-columns: 200px 440px 1fr; gap: 40px; padding: 24px 8px; border-bottom: 1px solid var(--border-default); }
.xp__date { font-size: 14px; font-weight: 500; }
.xp__date span { display: block; color: var(--text-muted); }
.xp__company { font-family: var(--font-serif); font-size: 32px; line-height: 1.1; }
.xp__sector { margin-top: 6px; color: var(--text-muted); font-size: 15px; }
.xp__lead { font-size: 15px; }
.xp__list { margin-top: 10px; display: grid; gap: 6px; font-size: 15px; }
.xp__list li { position: relative; padding-left: 16px; }
.xp__list li::before { content: ""; position: absolute; left: 0; top: 0.65em; width: 5px; height: 5px; border-radius: 50%; background: var(--text-primary); }

.skills { background: var(--bg-surface); }
.skills__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.skills__grid + .skills__grid { margin-top: 64px; padding-top: 64px; border-top: 1px solid var(--border-default); }
.label { font-size: 12px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.skills__block ul { margin-top: 16px; display: grid; gap: 4px; }
.skills__block li strong { font-weight: 500; }

/* ---------- Études de cas ---------- */
.case-hero { padding-top: 64px; padding-bottom: 64px; }
.case-hero__back { font-size: 14px; font-weight: 500; text-decoration: none; color: var(--text-muted); }
.case-hero__back:hover { color: var(--accent); }
.case-hero__title { margin-top: 48px; font-family: var(--font-serif); font-weight: 400; font-size: clamp(64px, 11vw, 160px); line-height: 0.95; letter-spacing: -0.02em; }
.case-hero__summary { margin-top: 32px; max-width: 760px; font-size: 22px; line-height: 1.45; }
.meta { margin-top: 64px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; padding-top: 24px; border-top: 1px solid var(--border-default); }
.meta dt { font-size: 12px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.meta dd { margin: 6px 0 0; font-size: 16px; }

.case-cover { background: var(--bg-surface); border-top: 1px solid var(--border-default); border-bottom: 1px solid var(--border-default); padding: 64px 0; }
.case-cover img { border-radius: var(--radius); border: 1px solid var(--border-default); margin: 0 auto; }

.block { display: grid; grid-template-columns: 260px 1fr; gap: 40px; padding-top: 80px; padding-bottom: 80px; border-top: 1px solid var(--border-default); }
.block__title { font-family: var(--font-serif); font-weight: 400; font-size: 36px; line-height: 1.1; }
.block__body { display: grid; gap: 24px; max-width: 820px; font-size: 18px; line-height: 1.55; }
.block__body p { color: var(--text-primary); }
.block__body .muted { color: var(--text-muted); }
.block__body ul { display: grid; gap: 10px; }
.block__body li { position: relative; padding-left: 18px; }
.block__body li::before { content: ""; position: absolute; left: 0; top: 0.7em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.facts--4 { grid-template-columns: repeat(4, 1fr); max-width: none; }
.fact { padding: 24px; border-radius: var(--radius); background: var(--bg-surface); }
.fact strong { display: block; font-family: var(--font-serif); font-weight: 400; font-size: 44px; line-height: 1; }
.fact span { display: block; margin-top: 8px; font-size: 14px; color: var(--text-muted); }

.figure { margin: 0; }
.figure img { width: 100%; border-radius: var(--radius); border: 1px solid var(--border-default); background: var(--bg-surface); }
.figure figcaption { margin-top: 12px; font-size: 14px; color: var(--text-muted); }
.figures { padding-bottom: 80px; display: grid; gap: 40px; }
.figures--2 { grid-template-columns: 1fr 1fr; }
.figures--3 { grid-template-columns: repeat(3, 1fr); }
.figures--4 { grid-template-columns: repeat(4, 1fr); }
.figure--tall img { max-height: 760px; object-fit: cover; object-position: top; }
.figure--center { max-width: 560px; margin-left: auto; margin-right: auto; }
.scroll-preview { max-height: 720px; overflow-y: auto; border-radius: var(--radius); border: 1px solid var(--border-default); background: var(--bg-surface); }
.scroll-preview img { border: 0; border-radius: 0; }

.placeholder {
  display: grid; place-items: center; min-height: 420px; padding: 32px; text-align: center;
  border-radius: var(--radius); border: 1px dashed #b8bcc4; background: var(--bg-surface);
  color: var(--text-muted); font-size: 15px;
}

.next { border-top: 1px solid var(--border-default); }
.next__link { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; padding-top: 64px; padding-bottom: 64px; text-decoration: none; }
.next__label { font-size: 14px; font-weight: 500; color: var(--text-muted); }
.next__name { margin-top: 8px; font-family: var(--font-serif); font-size: clamp(48px, 7vw, 96px); line-height: 0.98; }
.next__link:hover .next__name { color: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
  .cards { gap: 40px 24px; }
  .about-hero__grid { grid-template-columns: 1fr; }
  .about-hero__photo { max-width: 520px; }
  .xp__row { grid-template-columns: 140px 1fr; }
  .xp__row > :nth-child(3) { grid-column: 2; }
  .skills__grid { grid-template-columns: 1fr 1fr; }
  .meta { grid-template-columns: 1fr 1fr; }
  .block { grid-template-columns: 1fr; gap: 24px; }
  .figures--3, .figures--4 { grid-template-columns: 1fr 1fr; }
  .facts--4 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 767px) {
  :root { --margin: 20px; }
  .nav__links { gap: 20px; }
  .hero { padding-top: 40px; padding-bottom: 64px; }
  .hero__title { margin-top: 40px; }
  .hero__row { margin-top: 40px; flex-direction: column; align-items: flex-start; gap: 32px; }
  .hero__intro { font-size: 18px; }
  .section { padding-top: 64px; padding-bottom: 64px; }
  .section__head { margin-bottom: 40px; }
  .cards { grid-template-columns: 1fr; }
  .card__meta { flex-direction: column; gap: 8px; }
  .footer { padding-top: 64px; }
  .footer__link { font-size: 18px; }
  .xp__row { grid-template-columns: 1fr; gap: 12px; }
  .xp__row > :nth-child(3) { grid-column: auto; }
  .skills__grid { grid-template-columns: 1fr; }
  .facts, .facts--4 { grid-template-columns: 1fr; }
  .meta { grid-template-columns: 1fr 1fr; gap: 24px; }
  .case-cover { padding: 32px 0; }
  .block { padding-top: 56px; padding-bottom: 56px; }
  .block__body { font-size: 16px; }
  .figures--2, .figures--3, .figures--4 { grid-template-columns: 1fr; }
}

/* ---------- Nav : lien externe ---------- */
.nav__link[target="_blank"] { color: var(--text-muted); }
.nav__link[target="_blank"]:hover { color: var(--accent); }

/* ---------- Hero : phrases qui défilent ---------- */
.hero__title--ticker {
  font-size: clamp(38px, 7vw, 104px);
  line-height: 1.05;
  letter-spacing: -0.015em;
}
.ticker { display: block; height: 2.1em; overflow: hidden; }
.ticker__track { display: block; animation: ticker 10s cubic-bezier(.7, 0, .2, 1) infinite; }
.ticker__item { display: block; height: 2.1em; }
.ticker__item em { font-style: italic; color: var(--accent); }
@keyframes ticker {
  0%, 26%   { transform: translateY(0); }
  33%, 59%  { transform: translateY(-25%); }
  66%, 92%  { transform: translateY(-50%); }
  100%      { transform: translateY(-75%); }
}
@media (prefers-reduced-motion: reduce) {
  .ticker { height: auto; }
  .ticker__track { animation: none; }
  .ticker__item { height: auto; margin-bottom: 0.3em; }
  .ticker__item--clone { display: none; }
}

/* ---------- Bouton secondaire ---------- */
.btn--ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn--ghost:hover { background: var(--accent); color: var(--text-inverse); }
.about-hero__cta { margin-top: 32px; }

/* ---------- Process (apparition au scroll) ---------- */
.process { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.process__item { position: relative; padding-top: 28px; }
.process__item::before {
  content: ""; position: absolute; top: 0; left: 0; height: 2px; width: 100%;
  background: var(--border-default);
}
.process__item::after {
  content: ""; position: absolute; top: 0; left: 0; height: 2px; width: 100%;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform 0.9s cubic-bezier(.2, .7, .2, 1);
}
.process__num { font-size: 14px; font-weight: 500; color: var(--accent); }
.process__title { margin-top: 24px; font-family: var(--font-serif); font-weight: 400; font-size: clamp(28px, 3vw, 40px); line-height: 1.05; }
.process__text { margin-top: 16px; color: var(--text-muted); }
.js .process__item { opacity: 0; transform: translateY(32px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(.2, .7, .2, 1); transition-delay: calc(var(--i) * 0.18s); }
.js .process__item::after { transition-delay: calc(var(--i) * 0.18s + 0.2s); }
.js .process.is-visible .process__item { opacity: 1; transform: none; }
.js .process.is-visible .process__item::after { transform: scaleX(1); }
@media (prefers-reduced-motion: reduce) {
  .js .process__item { opacity: 1; transform: none; transition: none; }
  .js .process__item::after { transform: scaleX(1); transition: none; }
}
@media (max-width: 991px) { .process { grid-template-columns: 1fr 1fr; gap: 48px 32px; } }
@media (max-width: 767px) { .process { grid-template-columns: 1fr; } .nav__links { flex-wrap: wrap; } }

/* ---------- UI v2 (maquette Figma) ---------- */
.hero__title--ticker {
  color: var(--accent);
  font-size: clamp(56px, 13.5vw, 196px);
  line-height: 0.98;
  letter-spacing: -0.03em;
}
.hero__title--ticker { line-height: 0.94; }
.ticker { height: 2.22em; }
.ticker__item { height: 2.22em; }
.ticker__item .hl { color: var(--highlight); }
.btn--orange { background: var(--highlight); }
.btn--orange:hover { background: #e63e08; }
.footer { text-align: center; }
.footer__title { margin-left: auto; margin-right: auto; max-width: none; white-space: nowrap; font-size: clamp(30px, 8vw, 96px); }
.footer .btn { margin-top: 40px; }
.footer__row { justify-content: center; gap: 48px; }
.footer__legal { margin-top: 56px; }

/* Process : bloc bleu nuit */
.process-block { background: var(--accent); color: var(--text-inverse); border-radius: var(--radius); padding: 88px 40px; }
.process-block__title { font-family: var(--font-serif); font-weight: 400; text-align: center; font-size: clamp(44px, 6vw, 88px); line-height: 1; letter-spacing: -0.02em; }
@media (max-width: 767px) { .process-block { padding: 72px 24px; } }

/* ---------- Cartes en cours (WIP) ---------- */
.card--wip { cursor: default; pointer-events: none; }
.card--wip .card__visual { position: relative; }
.card--wip:hover .card__visual img { transform: none; }
.card--wip .card__visual--empty { background: var(--bg-surface); }
.card__badge { position: absolute; top: 16px; left: 16px; z-index: 1; padding: 8px 14px; border-radius: 999px; background: var(--accent); color: var(--text-inverse); font-size: 13px; font-weight: 500; }
.card--wip .card__visual--empty .card__badge { position: static; }
.card--wip .card__name, .card--wip .card__desc, .card--wip .card__year { color: var(--text-muted); }

/* ---------- Process : chemin dessiné au scroll ---------- */
.pmap { position: relative; max-width: 1200px; margin: 48px auto 0; aspect-ratio: 1200 / 920; }
.pmap__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.pmap__route, .pmap__trail { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.pmap__route { stroke: rgba(255, 255, 255, 0.28); stroke-width: 2; stroke-dasharray: 2 9; }
.pmap__trail { stroke: #fff; stroke-width: 4; filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.6)); }
.pmap__rider { fill: var(--highlight); filter: drop-shadow(0 0 10px var(--highlight)); }
.pmap__halo { fill: rgba(255, 76, 21, 0.25); animation: halo 1.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes halo { 50% { transform: scale(1.5); opacity: 0.4; } }
.pmap__steps { list-style: none; margin: 0; padding: 0; }
.pstep { position: absolute; width: min(300px, 30%); padding-left: 28px; transform: translateY(-9px); }
.pstep--left { transform: translate(calc(-100% - 0px), -9px); padding-left: 0; padding-right: 28px; text-align: right; }
.pstep__dot { position: absolute; top: 0; left: -9px; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.6); background: var(--accent); transition: background .4s, border-color .4s; }
.pstep--left .pstep__dot { left: auto; right: -9px; }
.pstep > :not(.pstep__dot) { opacity: 0.25; transform: translateY(20px); transition: opacity .5s ease, transform .8s cubic-bezier(.2,.7,.2,1); display: block; }
.pstep.is-reached > :not(.pstep__dot) { opacity: 1; transform: none; }
.pstep.is-reached .pstep__title { transition-delay: .06s; }
.pstep.is-reached .pstep__text { transition-delay: .12s; }
.pstep.is-reached .pstep__dot { background: var(--highlight); border-color: var(--highlight); }
.pstep__num { font-size: 14px; font-weight: 500; color: var(--highlight); }
.pstep__title { margin-top: 6px; font-family: var(--font-serif); font-weight: 400; font-size: clamp(26px, 2.8vw, 38px); line-height: 1.05; }
.pstep__text { margin-top: 8px; color: #c9c6f0; font-size: 15px; }
@media (prefers-reduced-motion: reduce) { .pstep > :not(.pstep__dot) { opacity: 1; transform: none; transition: none; } .pmap__halo { animation: none; } }
@media (max-width: 899px) {
  .pmap { aspect-ratio: auto; margin-top: 48px; }
  .pmap__svg { display: none; }
  .pstep, .pstep--left, .pstep[data-side="right"] { position: static; width: 100% !important; max-width: 340px; margin: 0 auto; left: auto !important; top: auto !important; transform: none !important; padding: 36px 0 !important; border-top: 1px solid rgba(255, 255, 255, 0.25); text-align: center !important; }
  .pstep:first-child { border-top: 0; }
  .pstep__dot { display: none; }
}
.pstep--left { width: min(260px, 22%); }
.pstep--bl { transform: translate(-100%, 26px); padding-left: 0; padding-right: 28px; text-align: right; }
.pstep--bl .pstep__dot { left: auto; right: -9px; top: -35px; }
.pstep[data-side="right"] { padding-left: 44px; width: min(260px, 22%); }
.pstep[data-side="right"] .pstep__dot { left: -9px; }
@media (max-width: 899px) { .pstep--bl { transform: none !important; } }

/* ---------- Disponibilité (header) ---------- */
.nav__left { display: flex; align-items: center; gap: 48px; }
.avail { display: inline-flex; align-items: center; gap: 10px; padding: 6px 12px; border-radius: 6px; background: #fff; font-size: 13px; font-weight: 500; white-space: nowrap; }
.avail__dot { width: 9px; height: 9px; border-radius: 50%; background: #4a9a96; box-shadow: 0 0 0 0 rgba(74, 154, 150, 0.5); animation: avail 2s ease-out infinite; }
@keyframes avail { 0% { box-shadow: 0 0 0 0 rgba(74, 154, 150, 0.5); } 70%, 100% { box-shadow: 0 0 0 8px rgba(74, 154, 150, 0); } }
@media (prefers-reduced-motion: reduce) { .avail__dot { animation: none; } }
@media (max-width: 991px) { .nav__left { gap: 20px; } }
@media (max-width: 767px) { .nav .wrap { flex-wrap: wrap; row-gap: 10px; } .avail { font-size: 12px; } }

/* Experience : aperçu du projet au survol du titre */
.xp__company { display: inline-block; transition: color .25s; }
.xp__row[data-thumb] { cursor: default; }
.xp__row.is-hover .xp__company { color: var(--highlight); }
.xp__thumb { position: fixed; top: 0; left: 0; z-index: 50; width: 280px; aspect-ratio: 990 / 630; border-radius: 12px; overflow: hidden; pointer-events: none; box-shadow: 0 18px 40px rgba(15, 17, 21, 0.22); opacity: 0; scale: .85; transition: opacity .25s ease, scale .35s cubic-bezier(.2,.7,.2,1); }
.xp__thumb.is-on { opacity: 1; scale: 1; }
.xp__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (hover: none), (pointer: coarse) { .xp__thumb { display: none; } }
