/* ==========================================================================
   ghibon — design system
   Papier, encre, terre cuite. Formes organiques, mouvement discret.
   Aucune dépendance, aucun framework, aucune ressource tierce.
   ========================================================================== */

/* --------------------------------------------------------------- 1. Jetons */

:root {
  /* Surfaces — le papier */
  --paper:        #f7f3ec;
  --paper-raise:  #fffdf8;
  --paper-sunk:   #ece5d9;

  /* Encre */
  --ink:          #191712;
  --ink-2:        #4a443b;
  --ink-3:        #7c7367;

  /* Accents — terre, mousse, ocre */
  --terre:        #b8552f;
  --terre-deep:   #8d3f1e;
  --terre-wash:   rgba(184, 85, 47, 0.10);
  --mousse:       #5b7050;
  --ocre:         #d29c3c;

  --line:         rgba(25, 23, 18, 0.13);
  --line-strong:  rgba(25, 23, 18, 0.28);
  --shadow:       0 1px 2px rgba(25, 23, 18, .04),
                  0 8px 24px -12px rgba(25, 23, 18, .16);
  --shadow-lift:  0 2px 4px rgba(25, 23, 18, .05),
                  0 24px 48px -20px rgba(25, 23, 18, .28);

  /* Typographie */
  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-text:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --step--1: clamp(0.83rem, 0.80rem + 0.15vw, 0.92rem);
  --step-0:  clamp(1.00rem, 0.96rem + 0.20vw, 1.12rem);
  --step-1:  clamp(1.20rem, 1.12rem + 0.40vw, 1.45rem);
  --step-2:  clamp(1.50rem, 1.34rem + 0.80vw, 2.05rem);
  --step-3:  clamp(1.90rem, 1.58rem + 1.60vw, 3.05rem);
  --step-4:  clamp(2.40rem, 1.75rem + 3.25vw, 4.60rem);
  --step-5:  clamp(2.90rem, 1.80rem + 5.50vw, 6.60rem);

  /* Rythme */
  --gutter:  clamp(1.25rem, 4vw, 3rem);
  --measure: 62ch;
  --wide:    76rem;
  --narrow:  46rem;
  --section: clamp(3.5rem, 7vw, 6.5rem);

  --radius:    18px;
  --radius-lg: 28px;
  --ease:      cubic-bezier(.22, .61, .36, 1);

  color-scheme: light;
}

:root[data-theme='dark'] {
  --paper:        #141210;
  --paper-raise:  #1e1b17;
  --paper-sunk:   #0e0c0a;

  --ink:          #f2ece1;
  --ink-2:        #bfb6a7;
  --ink-3:        #8c8376;

  --terre:        #e07c4e;
  --terre-deep:   #f0a077;
  --terre-wash:   rgba(224, 124, 78, 0.13);
  --mousse:       #8fa77f;
  --ocre:         #e5bb64;

  --line:         rgba(242, 236, 225, 0.14);
  --line-strong:  rgba(242, 236, 225, 0.30);
  --shadow:       0 1px 2px rgba(0, 0, 0, .30), 0 8px 24px -12px rgba(0, 0, 0, .60);
  --shadow-lift:  0 2px 4px rgba(0, 0, 0, .34), 0 24px 48px -20px rgba(0, 0, 0, .74);

  color-scheme: dark;
}

/* ------------------------------------------------------- 2. Remise à plat */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--step-0);
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 .5em;
  font-variation-settings: 'SOFT' 40, 'WONK' 1, 'opsz' 90;
  text-wrap: balance;
}

p { margin: 0 0 1.1em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

img, svg, video { max-width: 100%; height: auto; display: block; }

a { color: inherit; }

button, input, textarea, select { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--terre);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: var(--terre); color: var(--paper-raise); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* --------------------------------------------------------- 3. Mise en page */

.shell {
  width: min(100% - var(--gutter) * 2, var(--wide));
  margin-inline: auto;
}
.shell--narrow { width: min(100% - var(--gutter) * 2, var(--narrow)); }

.section { padding-block: var(--section); position: relative; }
.section--sunk { background: var(--paper-sunk); }

/* Titre de section : un numéro en capitale, un filet, un titre serif */
.section-eyebrow {
  display: flex;
  align-items: center;
  gap: .9rem;
  font-family: var(--font-text);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--terre);
  margin-bottom: 1.4rem;
}
.section-eyebrow::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

.section-title { font-size: var(--step-3); max-width: 18ch; }

.lede {
  font-size: var(--step-1);
  color: var(--ink-2);
  max-width: var(--measure);
  line-height: 1.5;
}

/* ------------------------------------------------------------ 4. En-tête */

.masthead {
  position: fixed;
  inset: 0 0 auto;
  z-index: 60;
  padding-block: .85rem;
  transition: background .35s var(--ease), box-shadow .35s var(--ease),
              padding .35s var(--ease);
}
.masthead[data-stuck='true'] {
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 1px 0 var(--line);
  padding-block: .5rem;
}

.masthead__inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.wordmark {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -.03em;
  text-decoration: none;
  font-variation-settings: 'SOFT' 60, 'WONK' 1, 'opsz' 40;
  display: inline-flex;
  align-items: baseline;
  gap: .12em;
}
.wordmark__dot { color: var(--terre); }

.nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: clamp(.5rem, 2vw, 1.75rem);
}
.nav__link {
  text-decoration: none;
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: .02em;
  color: var(--ink-2);
  padding: .4rem 0;
  position: relative;
  transition: color .25s var(--ease);
}
.nav__link::after {
  content: '';
  position: absolute;
  left: 0; right: 100%; bottom: .1rem;
  height: 1.5px;
  background: var(--terre);
  transition: right .3s var(--ease);
}
.nav__link:hover { color: var(--ink); }
.nav__link:hover::after { right: 0; }

/* Bascule de thème */
.theme-toggle {
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  width: 2.35rem; height: 2.35rem;
  display: grid; place-items: center;
  cursor: pointer;
  color: var(--ink-2);
  transition: border-color .25s var(--ease), color .25s var(--ease),
              transform .25s var(--ease);
}
.theme-toggle:hover { color: var(--terre); border-color: var(--terre); transform: rotate(-18deg); }
.theme-toggle svg { width: 1.05rem; height: 1.05rem; }
:root:not([data-theme='dark']) .theme-toggle .icon-sun { display: none; }
:root[data-theme='dark'] .theme-toggle .icon-moon { display: none; }

.nav-toggle { display: none; }

/* --------------------------------------------------------------- 5. Boutons */

.btn {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .85rem 1.6rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: var(--step--1);
  font-weight: 550;
  letter-spacing: .01em;
  text-decoration: none;
  cursor: pointer;
  position: relative;
  transition: transform .25s var(--ease), background .25s var(--ease),
              color .25s var(--ease), border-color .25s var(--ease),
              box-shadow .25s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--solid {
  background: var(--terre);
  color: #fffdf8;
  box-shadow: 0 6px 20px -8px var(--terre);
}
.btn--solid:hover { background: var(--terre-deep); box-shadow: 0 12px 28px -10px var(--terre); }
:root[data-theme='dark'] .btn--solid { color: #17140f; }

.btn--ghost { border-color: var(--line-strong); color: var(--ink); }
.btn--ghost:hover { border-color: var(--terre); color: var(--terre); }

.btn__arrow { transition: transform .3s var(--ease); }
.btn:hover .btn__arrow { transform: translateX(4px); }

/* ------------------------------------------------------------- 6. Héros */

.hero {
  position: relative;
  min-height: min(92svh, 50rem);
  display: flex;
  align-items: center;
  padding-block: 8rem 4rem;
  overflow: hidden;
}

.hero__inner { position: relative; z-index: 2; }

.hero__hail {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-size: var(--step--1);
  letter-spacing: .04em;
  color: var(--ink-2);
  background: var(--paper-raise);
  border: 1px solid var(--line);
  padding: .4rem 1rem .4rem .55rem;
  border-radius: 999px;
  margin-bottom: 1.8rem;
  box-shadow: var(--shadow);
}
.hero__pulse {
  width: .5rem; height: .5rem; border-radius: 50%;
  background: var(--mousse);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--mousse) 60%, transparent);
  animation: pulse 2.6s var(--ease) infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--mousse) 55%, transparent); }
  70%  { box-shadow: 0 0 0 .55rem transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.hero__title {
  font-size: var(--step-5);
  font-weight: 500;
  letter-spacing: -.035em;
  max-width: 15ch;
  margin-bottom: .35em;
  font-variation-settings: 'SOFT' 60, 'WONK' 1, 'opsz' 144;
}
.hero__title em {
  font-style: normal;
  font-weight: 700;
  color: var(--terre);
  position: relative;
  white-space: nowrap;
}
/* Le trait d'encre sous le mot clé, tracé au chargement */
.hero__stroke {
  position: absolute;
  left: -2%; bottom: -.22em;
  width: 104%; height: .42em;
  overflow: visible;
  pointer-events: none;
}
.hero__stroke path {
  fill: none;
  stroke: var(--ocre);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 640;
  stroke-dashoffset: 640;
  animation: draw 1.5s var(--ease) .55s forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

.hero__lede { max-width: 48ch; margin-bottom: 2.4rem; }

.hero__actions { display: flex; flex-wrap: wrap; gap: .9rem; align-items: center; }

/* Formes organiques du fond */
.blobs {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.blob {
  position: absolute;
  filter: blur(28px);
  opacity: .5;
  will-change: border-radius, transform;
}
.blob--1 {
  width: 46vw; height: 46vw; max-width: 640px; max-height: 640px;
  right: -8vw; top: -6vw;
  background: radial-gradient(circle at 35% 35%,
              color-mix(in srgb, var(--terre) 32%, transparent), transparent 68%);
  border-radius: 58% 42% 39% 61% / 47% 55% 45% 53%;
  animation: morph 22s ease-in-out infinite alternate;
}
.blob--2 {
  width: 34vw; height: 34vw; max-width: 460px; max-height: 460px;
  left: -10vw; bottom: -8vw;
  background: radial-gradient(circle at 60% 40%,
              color-mix(in srgb, var(--mousse) 30%, transparent), transparent 70%);
  border-radius: 42% 58% 63% 37% / 55% 40% 60% 45%;
  animation: morph 28s ease-in-out infinite alternate-reverse;
}
.blob--3 {
  width: 24vw; height: 24vw; max-width: 320px; max-height: 320px;
  right: 22vw; bottom: 4vw;
  background: radial-gradient(circle at 50% 50%,
              color-mix(in srgb, var(--ocre) 26%, transparent), transparent 72%);
  border-radius: 50% 50% 36% 64% / 60% 44% 56% 40%;
  animation: morph 18s ease-in-out infinite alternate;
}
@keyframes morph {
  0%   { border-radius: 58% 42% 39% 61% / 47% 55% 45% 53%; transform: translate3d(0,0,0) scale(1); }
  50%  { border-radius: 38% 62% 58% 42% / 62% 38% 62% 38%; transform: translate3d(2%, -3%, 0) scale(1.06); }
  100% { border-radius: 47% 53% 44% 56% / 39% 60% 40% 61%; transform: translate3d(-2%, 2%, 0) scale(.97); }
}

/* Grain papier, très léger */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: .35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.28'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}
:root[data-theme='dark'] body::before { mix-blend-mode: screen; opacity: .16; }

/* Séparation de sections : un bord de papier déchiré, pas une ligne droite */
.torn {
  display: block;
  width: 100%;
  height: clamp(28px, 4vw, 56px);
  fill: var(--paper-sunk);
}
.torn--up { fill: var(--paper); }

/* ------------------------------------------------------------ 7. Services */

.services {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: clamp(1rem, 2.2vw, 1.6rem);
  margin-top: 3.5rem;
}

.service {
  position: relative;
  background: var(--paper-raise);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg) var(--radius) var(--radius-lg) var(--radius);
  padding: 2rem 1.75rem 1.9rem;
  overflow: hidden;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease),
              border-color .4s var(--ease);
}
.service:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lift);
  border-color: color-mix(in srgb, var(--terre) 40%, var(--line));
}
.service__num {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 700;
  color: var(--terre);
  opacity: .32;
  position: absolute;
  top: 1.1rem; right: 1.4rem;
  font-variation-settings: 'SOFT' 80, 'WONK' 1;
}
.service__glyph {
  width: 3rem; height: 3rem;
  display: grid; place-items: center;
  border-radius: 46% 54% 52% 48% / 50% 46% 54% 50%;
  background: var(--terre-wash);
  color: var(--terre);
  margin-bottom: 1.3rem;
  transition: border-radius .6s var(--ease), transform .6s var(--ease);
}
.service:hover .service__glyph {
  border-radius: 58% 42% 38% 62% / 42% 58% 42% 58%;
  transform: rotate(-8deg);
}
.service__glyph svg { width: 1.4rem; height: 1.4rem; }
.service__name { font-size: var(--step-1); margin-bottom: .5rem; }
.service__body { color: var(--ink-2); font-size: var(--step--1); line-height: 1.6; }
.service__body p { margin-bottom: .5em; }

/* -------------------------------------------------------------- 8. Styles */

.styles-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
}

.styles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.25rem, 2.5vw, 2rem);
  margin-top: 3rem;
}
@media (max-width: 760px) {
  .styles { grid-template-columns: 1fr; }
}

.style-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--paper-raise);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  transition: transform .45s var(--ease), box-shadow .45s var(--ease),
              border-color .45s var(--ease);
}
.style-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lift);
  border-color: color-mix(in srgb, var(--terre) 45%, var(--line));
}

.style-card__frame {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--paper-sunk);
}
.style-card__frame img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 1.1s var(--ease);
}
.style-card:hover .style-card__frame img { transform: scale(1.05); }

/* Un style protégé par un code : l'image reste visible en aperçu, une
   pastille rappelle qu'il faut la clé pour entrer. */
.style-card--prive .style-card__frame img { filter: saturate(.75) brightness(.86); }

.style-card__lock {
  position: absolute;
  top: .85rem; left: .85rem;
  z-index: 1;
  display: inline-flex; align-items: center; gap: .4rem;
  background: color-mix(in srgb, var(--ink) 68%, transparent);
  color: #fffdf8;
  font-size: .72rem;
  font-weight: 550;
  letter-spacing: .02em;
  padding: .35rem .7rem;
  border-radius: 999px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.style-card__veil {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--ink) 55%, transparent);
  opacity: 0;
  transition: opacity .4s var(--ease);
}
.style-card:hover .style-card__veil { opacity: 1; }
.style-card__cue {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--paper-raise);
  color: var(--ink);
  padding: .6rem 1.15rem;
  border-radius: 999px;
  font-size: var(--step--1);
  font-weight: 550;
  transform: translateY(10px);
  transition: transform .4s var(--ease);
}
.style-card:hover .style-card__cue { transform: translateY(0); }

.style-card__body { padding: 1.4rem 1.5rem 1.6rem; }
.style-card__title { font-size: var(--step-1); margin-bottom: .25rem; }
.style-card__sub {
  font-size: var(--step--1);
  color: var(--ink-3);
  letter-spacing: .02em;
}
.style-card__tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .9rem; }
.tag {
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-weight: 550;
  color: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .2rem .6rem;
}
.tag--live { color: var(--mousse); border-color: color-mix(in srgb, var(--mousse) 45%, transparent); }

/* -------------------------------------------------------------- 9. Chemin */

.path-wrap { position: relative; margin-top: 4rem; }

/* Le fil d'encre qui relie les étapes, tracé au scroll */
.path-line {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  height: 100%;
  width: 120px;
  overflow: visible;
  pointer-events: none;
  z-index: 0;
}
.path-line path {
  fill: none;
  stroke: var(--line-strong);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  pathLength: 1;
}

.steps { list-style: none; margin: 0; padding: 0; position: relative; z-index: 1; }

.step {
  display: grid;
  grid-template-columns: 1fr 7rem 1fr;
  align-items: center;
  gap: 1rem;
  margin-bottom: clamp(2rem, 5vw, 4rem);
}
.step:last-child { margin-bottom: 0; }

.step__card {
  background: var(--paper-raise);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg) var(--radius) var(--radius-lg) var(--radius);
  padding: 1.6rem 1.7rem;
  box-shadow: var(--shadow);
  grid-column: 1;
  text-align: right;
}
.step:nth-child(even) .step__card {
  grid-column: 3;
  text-align: left;
  border-radius: var(--radius) var(--radius-lg) var(--radius) var(--radius-lg);
}

.step__bead {
  grid-column: 2;
  justify-self: center;
  width: 5rem; height: 5rem;
  border-radius: 52% 48% 45% 55% / 48% 52% 48% 52%;
  overflow: hidden;
  border: 3px solid var(--paper);
  box-shadow: 0 0 0 1px var(--line), var(--shadow);
  background: var(--paper-sunk);
  display: grid; place-items: center;
  position: relative;
  transition: border-radius .8s var(--ease), transform .5s var(--ease);
}
.step:hover .step__bead {
  border-radius: 44% 56% 58% 42% / 56% 44% 56% 44%;
  transform: scale(1.06);
}
.step__bead img { width: 100%; height: 100%; object-fit: cover; }
.step__bead span {
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 700;
  color: var(--terre);
}

.step__kicker {
  font-size: .72rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--terre);
  font-weight: 600;
  display: block;
  margin-bottom: .4rem;
}
.step__title { font-size: var(--step-1); margin-bottom: .4rem; }
.step__body { color: var(--ink-2); font-size: var(--step--1); line-height: 1.6; white-space: pre-line; }

/* ------------------------------------------------------------ 10. Contact */

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
  margin-top: 3rem;
}

.contact-side p { color: var(--ink-2); }
.contact-side__list { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; gap: 1rem; }
.contact-side__list a {
  display: inline-flex; align-items: center; gap: .7rem;
  text-decoration: none; color: var(--ink); font-weight: 500;
  transition: color .25s var(--ease);
}
.contact-side__list a:hover { color: var(--terre); }
.contact-side__list svg { width: 1.05rem; height: 1.05rem; color: var(--terre); flex: none; }

.form { display: grid; gap: 1rem; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.field { position: relative; }
.field input, .field textarea {
  width: 100%;
  background: var(--paper-raise);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.4rem 1.1rem .6rem;
  font-size: var(--step-0);
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.field textarea { min-height: 11rem; resize: vertical; line-height: 1.6; }
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--terre);
  box-shadow: 0 0 0 3px var(--terre-wash);
}
.field label {
  position: absolute;
  left: 1.15rem; top: 1.05rem;
  font-size: var(--step-0);
  color: var(--ink-3);
  pointer-events: none;
  transform-origin: left top;
  transition: transform .22s var(--ease), color .22s var(--ease);
}
.field input:focus + label,
.field input:not(:placeholder-shown) + label,
.field textarea:focus + label,
.field textarea:not(:placeholder-shown) + label {
  transform: translateY(-.72rem) scale(.76);
  color: var(--terre);
}
.field--textarea label { top: 1.05rem; }

.form__note { font-size: var(--step--1); color: var(--ink-3); }
.form__error { color: var(--terre-deep); font-size: var(--step--1); margin-top: .3rem; }

.flash {
  display: flex; align-items: center; gap: .8rem;
  border-radius: 14px;
  padding: .9rem 1.2rem;
  font-size: var(--step--1);
  border: 1px solid;
  margin-bottom: 1.5rem;
}
.flash--ok { border-color: color-mix(in srgb, var(--mousse) 50%, transparent); background: color-mix(in srgb, var(--mousse) 12%, transparent); }
.flash--ko { border-color: color-mix(in srgb, var(--terre) 50%, transparent); background: var(--terre-wash); }

/* ------------------------------------------------------------- 11. Signature */

.colophon {
  background: var(--paper-sunk);
  border-top: 1px solid var(--line);
  padding-block: 3.5rem 2rem;
}
.colophon__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
  gap: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--line);
}
.colophon__blurb { color: var(--ink-2); font-size: var(--step--1); max-width: 34ch; margin-top: .8rem; }
.colophon h4 {
  font-family: var(--font-text);
  font-size: .72rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
  margin-bottom: 1rem;
}
.colophon ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.colophon a { text-decoration: none; color: var(--ink-2); font-size: var(--step--1); transition: color .25s var(--ease); }
.colophon a:hover { color: var(--terre); }
.colophon__base {
  display: flex; flex-wrap: wrap; gap: 1rem;
  justify-content: space-between;
  padding-top: 1.5rem;
  font-size: var(--step--1);
  color: var(--ink-3);
}

/* ------------------------------------------------- 12. Entrées au scroll */

[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
[data-reveal].is-in { opacity: 1; transform: none; }
[data-reveal-delay='1'] { transition-delay: .08s; }
[data-reveal-delay='2'] { transition-delay: .16s; }
[data-reveal-delay='3'] { transition-delay: .24s; }
[data-reveal-delay='4'] { transition-delay: .32s; }

/* -------------------------------------------------------- 13. Adaptations */

@media (max-width: 860px) {
  .contact-grid { grid-template-columns: 1fr; }
  .step { grid-template-columns: 3.6rem 1fr; gap: .9rem; }
  .step__card,
  .step:nth-child(even) .step__card {
    grid-column: 2;
    text-align: left;
    border-radius: var(--radius) var(--radius-lg) var(--radius) var(--radius-lg);
  }
  .step__bead { grid-column: 1; grid-row: 1; align-self: start; width: 3.4rem; height: 3.4rem; }
  .step__bead span { font-size: var(--step-0); }
  .path-line { display: none; }
  .colophon__grid { grid-template-columns: 1fr 1fr; }
  .colophon__grid > :first-child { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .form__row { grid-template-columns: 1fr; }
  .nav__link { display: none; }
  .nav-toggle {
    display: grid; place-items: center;
    width: 2.35rem; height: 2.35rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: none; cursor: pointer;
  }
  .nav[data-open='true'] {
    position: absolute;
    inset: 100% var(--gutter) auto;
    flex-direction: column;
    align-items: stretch;
    background: var(--paper-raise);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: .75rem;
    box-shadow: var(--shadow-lift);
  }
  .nav[data-open='true'] .nav__link { display: block; padding: .7rem .9rem; }
  .colophon__grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  .hero__stroke path { stroke-dashoffset: 0; }
}

/* ------------------------------------------------ 14. Visite d'un style
   La barre qui reste au-dessus du site visité, et qui permet d'aller au
   suivant sans repasser par la page d'accueil.                          */

.visite {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: var(--paper-sunk);
}

.visite__bar {
  display: flex;
  align-items: center;
  gap: clamp(.5rem, 2vw, 1.25rem);
  padding: .6rem clamp(.75rem, 2vw, 1.25rem);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow);
  z-index: 2;
}

.visite__back {
  display: inline-flex; align-items: center; gap: .5rem;
  text-decoration: none;
  font-size: var(--step--1);
  font-weight: 550;
  color: var(--ink-2);
  padding: .45rem .8rem .45rem .6rem;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: color .25s var(--ease), border-color .25s var(--ease), background .25s var(--ease);
}
.visite__back:hover { color: var(--terre); border-color: var(--line-strong); background: var(--paper-raise); }

.visite__id { min-width: 0; }
.visite__name {
  font-family: var(--font-display);
  font-size: var(--step-0);
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.visite__sub {
  font-size: .74rem;
  color: var(--ink-3);
  letter-spacing: .04em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.visite__nav { margin-left: auto; display: flex; align-items: center; gap: .4rem; }

.visite__step {
  width: 2.2rem; height: 2.2rem;
  display: grid; place-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-2);
  text-decoration: none;
  transition: color .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease);
}
.visite__step:hover { color: var(--terre); border-color: var(--terre); }
.visite__step--prev:hover { transform: translateX(-2px); }
.visite__step--next:hover { transform: translateX(2px); }

.visite__count {
  font-size: var(--step--1);
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  padding-inline: .35rem;
}

/* Les pastilles de saut direct, une par style */
.visite__dots { display: flex; gap: .3rem; padding-inline: .5rem; }
.visite__dot {
  width: .5rem; height: .5rem;
  border-radius: 50%;
  background: var(--line-strong);
  transition: background .25s var(--ease), transform .25s var(--ease);
}
.visite__dot:hover { transform: scale(1.5); background: var(--ink-3); }
.visite__dot[aria-current='true'] { background: var(--terre); transform: scale(1.3); }

.visite__stage { position: relative; background: var(--paper-sunk); }
.visite__frame { width: 100%; height: 100%; border: 0; display: block; background: #fff; }

/* Repli si le site refuse d'être affiché dans un cadre */
.visite__fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: var(--gutter);
  text-align: center;
  background: var(--paper);
}
.visite__fallback > div { max-width: 40ch; }
.visite__fallback h2 { font-size: var(--step-2); }
.visite__fallback p { color: var(--ink-2); margin-bottom: 1.6rem; }

@media (max-width: 640px) {
  .visite__dots, .visite__sub { display: none; }
}

/* ------------------------------------------------- 15. Présentation privée
   La page qui garde une maquette adressée à un seul destinataire.        */

.porte {
  min-height: 100svh;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}
.porte__inner { position: relative; z-index: 2; display: grid; place-items: center; }

.porte__carte {
  background: var(--paper-raise);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg) var(--radius) var(--radius-lg) var(--radius);
  box-shadow: var(--shadow-lift);
  padding: clamp(2rem, 5vw, 3.25rem);
  max-width: 34rem;
}

.porte__sceau {
  width: 3.4rem; height: 3.4rem;
  display: grid; place-items: center;
  border-radius: 48% 52% 55% 45% / 52% 46% 54% 48%;
  background: var(--terre-wash);
  color: var(--terre);
  margin-bottom: 1.6rem;
}
.porte__sceau svg { width: 1.5rem; height: 1.5rem; }

.porte__titre { font-size: var(--step-2); margin-bottom: 1rem; }
.porte__texte { color: var(--ink-2); font-size: var(--step--1); line-height: 1.7; }

.porte__form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .75rem;
  align-items: start;
  margin-top: 1.75rem;
}
.porte__form .btn { padding-block: 1.05rem; }

.porte__pied { margin-top: 1.5rem; font-size: var(--step--1); color: var(--ink-3); }
.porte__pied a { color: var(--terre); text-decoration: none; }
.porte__pied a:hover { text-decoration: underline; }

@media (max-width: 520px) {
  .porte__form { grid-template-columns: 1fr; }
}

/* ------------------------------------------------- 16. Édition visuelle
   Le bandeau « Modifier mon site » et les blocs de texte cliquables.
   Invisible pour un visiteur ordinaire : le bandeau n'est même pas rendu
   côté serveur si la personne n'est pas membre du personnel.            */

.edit-bar {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: .75rem clamp(1rem, 3vw, 2rem);
  background: var(--ink);
  color: var(--paper);
  font-size: var(--step--1);
  box-shadow: 0 -8px 24px -8px rgba(0,0,0,.35);
}
:root[data-theme='dark'] .edit-bar { background: var(--paper-raise); color: var(--ink); border-top: 1px solid var(--line); }

.edit-bar__label {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-weight: 550;
}
.edit-bar__label svg { width: 1rem; height: 1rem; }

.edit-bar__toggle {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  background: none;
  border: 1px solid color-mix(in srgb, var(--paper) 35%, transparent);
  color: inherit;
  padding: .5rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-weight: 550;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.edit-bar__toggle:hover { border-color: var(--paper); }
:root[data-theme='dark'] .edit-bar__toggle { border-color: var(--line-strong); }
:root[data-theme='dark'] .edit-bar__toggle:hover { border-color: var(--ink); }

.edit-bar[data-edit-active='true'] .edit-bar__toggle {
  background: var(--terre);
  border-color: var(--terre);
  color: #fffdf8;
}

.edit-bar__status {
  font-size: .78rem;
  opacity: .75;
  min-width: 8ch;
}

/* Un bloc éditable, hors mode édition : rien à voir, texte normal. */
.editable { border-radius: 4px; }

/* En mode édition : on montre que c'est cliquable, sans dénaturer la mise
   en page (le texte garde exactement sa taille et sa position). */
body[data-edit-active='true'] .editable {
  cursor: text;
  outline: 1.5px dashed color-mix(in srgb, var(--terre) 55%, transparent);
  outline-offset: 3px;
  transition: outline-color .15s var(--ease), background .15s var(--ease);
}
body[data-edit-active='true'] .editable:hover {
  outline-color: var(--terre);
  background: var(--terre-wash);
}
body[data-edit-active='true'] .editable:focus {
  outline: 2px solid var(--terre);
  background: var(--terre-wash);
}
.editable--enregistrement { opacity: .55; }
