/* =============================================================
   « Fait main » : dessins au trait, soulignés à la main, ardoise,
   signature — ce qui rend le site unique.
   ============================================================= */

/* ---------- Dessins au trait ---------- */
.doodle { display: block; overflow: visible; color: var(--ink); }
.doodle path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}
.doodle .a { stroke: var(--ember); }
.doodle--sm { width: 56px; height: 56px; }
.doodle--sm path { stroke-width: 2.6; }
.doodle--md { width: 112px; height: 112px; }
.doodle--lg { width: clamp(170px, 22vw, 300px); height: auto; aspect-ratio: 1; }
.doodle--lg path { stroke-width: 1.15; }

/* Animation : chaque trait se dessine l'un après l'autre (activée par JS) */
.doodle.is-armed path { stroke-dasharray: 1 1; stroke-dashoffset: 1; }
.doodle.is-drawn path {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1.1s var(--ease) var(--d, 0s);
}
.doodle.is-drawn .a { transition-duration: .8s; transition-delay: calc(var(--d, 0s) + .25s); }
/* Une fois dessiné, il « respire » doucement */
.doodle--lg.is-drawn { animation: doodleFloat 7s var(--ease-io) 2.5s infinite; }
@keyframes doodleFloat { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-6px) rotate(-1.5deg); } }

/* Hero des pages intérieures : grand dessin à droite */
.page-hero { position: relative; }
.page-hero__doodle { position: absolute; right: var(--pad); top: clamp(7.5rem, 14vw, 10rem); }
@media (max-width: 760px) {
  .page-hero__doodle { position: static; width: fit-content; margin: 0 0 1rem auto; }
  .page-hero__doodle .doodle--lg { width: 104px; }
  .page-hero__doodle .doodle--lg path { stroke-width: 2.2; }
}

/* La carte : un dessin par partie du menu */
.menu__course-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.menu__course-head .doodle { margin-bottom: .6rem; flex: none; }

/* Étapes de la méthode (fond sombre) */
.step .doodle { color: var(--paper); margin-bottom: 1.25rem; }
.step__head { display: flex; align-items: flex-end; justify-content: space-between; }

/* Formules, parcours, étapes de contact */
.timeline__item .doodle { margin-top: .4rem; }
.mini-steps .doodle { margin-bottom: .75rem; }
.story__drawing { margin-top: 2.5rem; }
.next-project__card .doodle { margin-bottom: -1rem; }

/* ---------- Soulignés tracés à la main sous les mots en italique ---------- */
.section h2 em, .cta__link em { position: relative; display: inline-block; }
.section h2 em::after, .cta__link em::after {
  content: "";
  position: absolute;
  left: -3%; right: -3%; bottom: -.02em;
  height: .2em;
  background: currentColor;
  opacity: .5;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 14' preserveAspectRatio='none'%3E%3Cpath d='M3 9 C 40 3, 72 12, 106 7 S 168 3, 197 8' fill='none' stroke='black' stroke-width='3.4' stroke-linecap='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 14' preserveAspectRatio='none'%3E%3Cpath d='M3 9 C 40 3, 72 12, 106 7 S 168 3, 197 8' fill='none' stroke='black' stroke-width='3.4' stroke-linecap='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  transition: clip-path .9s var(--ease) .7s;
  pointer-events: none;
}
/* Avec JS : le souligné se trace quand le titre apparaît (sans JS, il est simplement visible) */
.js .section h2 em::after, .js .cta__link em::after { clip-path: inset(0 100% 0 0); }
.js .section h2.is-in em::after, .js .cta__link.is-in em::after { clip-path: inset(0 0 0 0); }

/* ---------- L'ardoise : le conseil du jour ---------- */
.ardoise {
  position: relative;
  margin-top: clamp(3rem, 7vw, 5rem);
  display: grid; grid-template-columns: auto 1fr; gap: clamp(1.25rem, 4vw, 3rem); align-items: center;
  padding: clamp(1.75rem, 4vw, 3rem);
  border-radius: 22px;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,.06), transparent 60%),
    #1d1b19;
  color: #EDE8DD;
  box-shadow: inset 0 0 0 10px #2a2622, inset 0 0 0 11px rgba(255,255,255,.06), 0 30px 60px -35px rgba(0,0,0,.6);
  overflow: hidden;
}
.ardoise::before { /* poussière de craie */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .12;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: screen;
}
.ardoise .doodle { color: #EDE8DD; }
.ardoise__label { color: rgba(237, 232, 221, .55); display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; }
.ardoise__label span { color: var(--ember); }
.ardoise__tip {
  margin-top: .8rem;
  font-family: var(--serif); font-style: italic;
  font-size: clamp(1.5rem, 3vw, 2.4rem); line-height: 1.15;
  text-shadow: 0 0 1px rgba(237, 232, 221, .4);
  max-width: 30ch;
}
.ardoise__tip.is-writing { animation: chalk 1.1s var(--ease) both; }
@keyframes chalk { from { clip-path: inset(0 100% 0 0); opacity: .3; } to { clip-path: inset(0 0 0 0); opacity: 1; } }
.ardoise__nav { display: flex; gap: .5rem; margin-top: 1.4rem; }
.ardoise__nav button {
  all: unset; cursor: pointer;
  font: 500 .7rem/1 var(--mono); letter-spacing: .06em; text-transform: uppercase;
  padding: .55rem .85rem; border-radius: 999px; border: 1px solid rgba(237,232,221,.25);
  transition: background .3s, color .3s;
}
.ardoise__nav button:hover, .ardoise__nav button:focus-visible { background: #EDE8DD; color: #1d1b19; }
@media (max-width: 640px) { .ardoise { grid-template-columns: 1fr; } .ardoise .doodle { width: 64px; height: 64px; } }

/* ---------- Signature ---------- */
.signature { margin-top: 1rem; display: inline-grid; gap: .1rem; }
.signature__name { font-family: var(--serif); font-style: italic; font-size: 2.2rem; line-height: 1; color: var(--ink); }
.signature svg { width: 150px; height: 18px; overflow: visible; }
.signature svg path { fill: none; stroke: var(--ember); stroke-width: 2; stroke-linecap: round; }
.signature.is-armed svg path { stroke-dasharray: 1 1; stroke-dashoffset: 1; }
.signature.is-drawn svg path { stroke-dashoffset: 0; transition: stroke-dashoffset 1.2s var(--ease) .3s; }

@media (prefers-reduced-motion: reduce) {
  .doodle--lg.is-drawn { animation: none; }
  .section h2 em::after, .cta__link em::after { clip-path: none; transition: none; }
}
