/* ==========================================================================
   PAGES — scène d'accueil, hero des pages, fondu, zones de contenu
   Les couleurs propres à chaque page arrivent par variables CSS
   (--edge, --ground, --focus, --focus-m) définies dans js/config.js.
   ========================================================================== */

/* --------------------------------------------------------------------------
   ACCUEIL — une scène plein écran, rien d'autre
   -------------------------------------------------------------------------- */
.scene {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--indigo-nuit);
}

.scene__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--focus, 50% 30%);
  animation: scene-in 1600ms var(--ease-soie) both;
}

/* Légère ombre en haut pour que le menu reste lisible — aucune retouche de l'image */
.scene::before,
.hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 150px;
  background: linear-gradient(to bottom, rgba(20, 19, 31, 0.5), rgba(20, 19, 31, 0));
  z-index: 1;
  pointer-events: none;
}

/* ---------- Textes de l'accueil ----------
   Placés par rapport à la FENÊTRE (grille plein écran), et non plus à l'image :
   le titre reste sous le menu, l'invitation et le bouton restent au pied de
   l'écran quelle que soit la forme de la fenêtre.

   --u = « un pixel de la maquette » (image 1672 × 941) converti à l'écran.
   Il suit la hauteur de la fenêtre (comme avant sur un écran 16/9), mais ne
   peut pas dépasser ce que la largeur permet : le bloc titre (≈ 820 u de large)
   tient toujours dans l'écran. Toutes les tailles s'écrivent calc(var(--u) * N).
   Une seule voix : Marcellus en capitales espacées, deux teintes de crème. */
.scene {
  --ls-scene: 0.36em;
  --u: min(calc(100vh / 941), calc((100vw - 48px) / 820));
  --u: min(calc(100svh / 941), calc((100vw - 48px) / 820));
  --marge-bas: clamp(30px, 4.2svh, 45px);
}

.scene__contenu {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  padding-inline: 16px;
  /* le titre commence là où il était sur la maquette, jamais sous le menu */
  padding-top: max(calc(var(--header-h) + env(safe-area-inset-top, 0px) + 10px), calc(var(--u) * 118));
  padding-bottom: calc(var(--marge-bas) + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
}
.scene__contenu a { pointer-events: auto; }
.scene__haut, .scene__bas {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 100%;
}
.scene__haut { grid-row: 1; }
.scene__bas { grid-row: 3; gap: calc(var(--u) * 12); }

.scene__overlay {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 100%;
  text-align: center;
  font-family: var(--font-titre);
  text-transform: uppercase;
  letter-spacing: var(--ls-scene);
  color: var(--creme);
  text-shadow: 0 0 calc(var(--u) * 22) rgba(20, 19, 31, 0.6);
}
.scene__overlay p, .scene__overlay h1 { margin: 0; font-weight: 400; }
/* l'interlettrage ajoute un blanc après la dernière lettre : on recentre */
.scene__overlay p, .scene__overlay h1, .scene__overlay span { margin-right: calc(var(--ls-scene) * -1); }
.scene__overlay > * { animation: title-in 1400ms var(--ease-soie) both; }

/* Sur-titre : capitales fines encadrées de deux filets,
   toute la phrase dans la même voix. */
.st-eyebrow {
  display: flex;
  align-items: center;
  gap: calc(var(--u) * 18);
  font-size: max(10.5px, calc(var(--u) * 14.5));
  letter-spacing: 0.42em;
  color: var(--ivoire-doux);
  animation-delay: 450ms !important;
}
.scene__overlay .st-e-txt { margin-right: -0.42em; }
.st-filet {
  display: block;
  flex: none;
  width: calc(var(--u) * 46);
  height: 1px;
  background: linear-gradient(90deg, rgba(216, 200, 174, 0), rgba(216, 200, 174, 0.7));
}
.st-filet:last-child { transform: scaleX(-1); }

/* Titre principal : l'élément fort du bloc */
.st-headline {
  font-size: max(20px, calc(var(--u) * 39));
  line-height: 1.15;
  letter-spacing: 0.13em;
  margin: calc(var(--u) * 16) -0.13em 0 0 !important;
  animation-delay: 650ms !important;
}
.m-br { display: none; }

/* Séparateur : deux filets et un petit losange, comme une ciselure */
.st-rule {
  position: relative;
  display: block;
  width: calc(var(--u) * 128);
  height: max(1px, calc(var(--u) * 1));
  margin: calc(var(--u) * 30) 0 calc(var(--u) * 26) !important;
  background: linear-gradient(90deg,
    rgba(239, 228, 208, 0) 0%,
    rgba(239, 228, 208, 0.75) 38%,
    rgba(239, 228, 208, 0) 44%,
    rgba(239, 228, 208, 0) 56%,
    rgba(239, 228, 208, 0.75) 62%,
    rgba(239, 228, 208, 0) 100%);
  animation: rule-in 1200ms var(--ease-soie) 850ms both !important;
}
.st-rule::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: max(4px, calc(var(--u) * 5));
  height: max(4px, calc(var(--u) * 5));
  border: 1px solid rgba(239, 228, 208, 0.85);
  transform: translate(-50%, -50%) rotate(45deg);
}

/* Nom de la soirée : plus petit, plus espacé, un ton plus doux */
.st-theme {
  font-size: max(12px, calc(var(--u) * 19));
  letter-spacing: 0.5em;
  margin-right: -0.5em !important;
  color: var(--ivoire-doux);
  animation-delay: 1000ms !important;
}

.scene__date { justify-content: center; }
.scene__date > * { animation-delay: 1200ms !important; }
.sd-invite { font-size: max(11px, calc(var(--u) * 16)); line-height: 1.7; }

/* Bouton : vrai lien, toujours entièrement visible au pied de l'écran */
.scene__cta {
  flex-direction: row;
  justify-content: center;
  gap: calc(var(--u) * 18);
  width: min(max(calc(var(--u) * 440), 300px), 100%);
  min-height: max(44px, calc(var(--u) * 51));
  padding-inline: 12px;
  font-size: max(11px, calc(var(--u) * 13));
  text-decoration: none;
  border: 1px solid rgba(239, 228, 208, 0.6);
  background: rgba(26, 18, 22, 0.42);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  animation: title-in 1400ms var(--ease-soie) 1350ms both;
  transition: background var(--dur-ui) var(--ease-soie), border-color var(--dur-ui);
}
.scene__cta > * { animation: none; }
.scene__cta svg {
  width: max(14px, calc(var(--u) * 18));
  height: max(8px, calc(var(--u) * 10));
  flex: none;
  transition: transform var(--dur-ui) var(--ease-soie);
}
.scene__cta:hover { background: rgba(239, 228, 208, 0.1); border-color: var(--creme); }
.scene__cta:hover svg { transform: translateX(4px); }
.scene__cta:focus-visible { outline: 1px solid var(--creme); outline-offset: 4px; }

/* « Même ciel. Autres histoires… » : dans le coin bas droit de l'écran */
.scene__aside {
  position: absolute;
  right: clamp(16px, 3.6vw, 72px);
  bottom: calc(var(--marge-bas) + env(safe-area-inset-bottom, 0px));
  align-items: flex-end;
  text-align: right;
  font-size: max(10px, calc(var(--u) * 11));
  letter-spacing: 0.3em;
  line-height: 1.7;
  color: var(--ivoire-voile);
  animation: title-in 1400ms var(--ease-soie) 1500ms both;
}
.scene__aside p { margin-right: -0.3em; animation: none; }

/* Tablette portrait, téléphone : les longues lignes passent sur deux lignes,
   la mesure --u est alors calculée pour un bloc deux fois plus étroit. */
@media (max-width: 820px) {
  .scene {
    --u: min(calc(100vh / 941), calc((100vw - 32px) / 440));
    --u: min(calc(100svh / 941), calc((100vw - 32px) / 440));
  }
  .m-br { display: inline; }
  .st-eyebrow { display: block; line-height: 1.6; }
  .st-filet { display: none; }
  .st-headline { line-height: 1.25; }
  .st-theme { letter-spacing: 0.4em; margin-right: -0.4em !important; }
  .scene__cta { letter-spacing: 0.24em; }
  .scene__cta span { margin-right: -0.24em; }
  /* le coin n'a plus la place à côté du bouton */
  .scene__aside { display: none; }
}

/* Écrans très bas (téléphone à l'horizontale) : on resserre l'espacement vertical */
@media (max-height: 520px) {
  .scene__contenu { padding-top: calc(var(--header-h) + 6px); }
  .st-headline { margin-top: 6px !important; }
  .st-rule { margin: 12px 0 10px !important; }
  .scene__bas { gap: 6px; }
  .scene__aside { display: none; }
  .scene__cta { width: min(340px, 100%); letter-spacing: 0.24em; }
  .scene__cta span { margin-right: -0.24em; }
}

@keyframes title-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
@keyframes rule-in {
  from { opacity: 0; transform: scaleX(0); }
  to   { opacity: 1; transform: scaleX(1); }
}

@keyframes scene-in {
  from { opacity: 0; transform: scale(1.025); }
  to   { opacity: 1; transform: scale(1); }
}

@media (max-width: 900px) {
  .scene__img { object-position: var(--focus-m, var(--focus, 50% 30%)); }
}

/* --------------------------------------------------------------------------
   HERO des pages 2, 3, 4
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 520px;
  overflow: hidden;
  background: var(--ground);
}

.hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--focus, 50% 50%);
  animation: scene-in 1600ms var(--ease-soie) both;
}

@media (max-width: 900px) {
  .hero__img { object-position: var(--focus-m, var(--focus, 50% 50%)); }
}

/* Tant que l'image 5 n'est pas fournie : ciel nocturne neutre */
.hero__img--attente {
  display: grid;
  place-items: center;
  background:
    radial-gradient(60% 50% at 50% 100%, color-mix(in oklab, var(--edge) 80%, transparent), transparent 70%),
    linear-gradient(to bottom, var(--indigo-nuit) 0%, var(--bleu-nuit) 45%, var(--edge) 100%);
}
.hero__img--attente span {
  font-family: var(--font-titre);
  font-size: var(--t-nav);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--ivoire-voile);
  padding: 10px 18px;
  border: 1px dashed var(--filet-fort);
}

/* Citation du hero : seule exception typographique du site —
   Cormorant Light Italic (300), italique calligraphique très fin,
   comme une phrase de conte écrite dans l'air. Posée dans le ciel. */
.hero__quote {
  position: absolute;
  z-index: 2;
  left: var(--qx, 50%);
  top: var(--qy, 28%);
  transform: translate(-50%, -50%);
  width: min(26em, calc(100% - 48px));
  margin: 0;
  display: grid;
  gap: 0.5em;
  text-align: center;
  font-family: var(--font-conte);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.6rem, 1.05rem + 1.6vw, 2.35rem);
  line-height: 1.42;
  letter-spacing: 0.018em;
  color: rgba(239, 228, 208, 0.9);
  text-shadow: 0 0 28px rgba(20, 19, 31, 0.55), 0 0 2px rgba(20, 19, 31, 0.35);
  text-wrap: balance;
  pointer-events: none;
}
.hero__quote p { margin: 0; }
.hero__quote p + p { color: rgba(216, 200, 174, 0.88); }

/* Apparition « à la plume » : l'encre se pose, s'étale un instant puis sèche.
   Chaque lettre démarre à son propre --d (calculé dans hero.js). */
.ink-w { display: inline-block; white-space: nowrap; }
.ink {
  display: inline-block;
  animation: ink 700ms cubic-bezier(0.33, 0, 0.2, 1) var(--d, 0ms) backwards;
}
/* en attente tant que la page n'est pas visible (voir Router.startQuote) */
.hero__quote:not(.is-writing) .ink { animation-play-state: paused; }
@keyframes ink {
  0% {
    opacity: 0;
    filter: blur(5px);
    color: rgba(196, 150, 104, 0);
    transform: translateY(0.05em) scale(0.985);
  }
  35% {
    opacity: 0.55;
    filter: blur(1.6px);
    color: rgba(206, 164, 116, 0.9);   /* encre fraîche, plus chaude */
  }
  70% { opacity: 0.9; filter: blur(0.3px); }
  /* 100 % : état final = style normal de la citation */
}

/* Tablette en portrait / écrans moyens : citation recentrée pour ne jamais déborder */
@media (max-width: 1100px), (orientation: portrait) {
  .hero__quote { left: 50%; }
}
@media (max-width: 900px) {
  .hero__quote {
    left: 50%;
    top: var(--qym, max(26%, calc(var(--header-h) + 130px)));
    line-height: 1.38;
    gap: 0.6em;
  }
}

/* Le fondu : l'image se dissout dans la couleur de sa propre base.
   Plusieurs paliers pour éviter toute bande visible. */
.hero__fade {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 42%;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(to bottom,
    color-mix(in oklab, var(--edge) 0%,  transparent) 0%,
    color-mix(in oklab, var(--edge) 12%, transparent) 22%,
    color-mix(in oklab, var(--edge) 34%, transparent) 42%,
    color-mix(in oklab, var(--edge) 62%, transparent) 62%,
    color-mix(in oklab, var(--edge) 86%, var(--ground)) 84%,
    var(--ground) 100%);
}

.hero__cue {
  position: absolute;
  left: 50%;
  bottom: clamp(22px, 4vh, 40px);
  transform: translateX(-50%);
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 12px;
  background: none; border: 0; cursor: pointer;
  color: var(--ivoire-voile);
  font-family: var(--font-titre);
  font-size: 0.66rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  padding: 8px 8px 0 calc(8px + 0.4em);
  transition: color var(--dur-ui);
}
.hero__cue:hover { color: var(--creme); }
.hero__cue i {
  display: block;
  width: 1px; height: 38px;
  background: linear-gradient(to bottom, var(--ivoire-voile), transparent);
  animation: cue 2.6s var(--ease-soie) infinite;
  transform-origin: top;
}
@keyframes cue {
  0%   { transform: scaleY(0); opacity: 0; }
  30%  { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1); opacity: 0; }
}

/* --------------------------------------------------------------------------
   ZONE DE CONTENU — sobre, sombre, dans la couleur de l'image
   -------------------------------------------------------------------------- */
.content {
  position: relative;
  background:
    radial-gradient(90% 420px at 50% 0%, color-mix(in oklab, var(--edge) 55%, transparent), transparent 100%),
    var(--ground);
  padding-inline: var(--gutter);
  padding-block: clamp(40px, 7vw, 96px) clamp(72px, 10vw, 140px);
}

.content__inner {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  gap: clamp(56px, 8vw, 104px);
}

.intro {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 26px;
}
.intro .lead { max-width: 34ch; }

.prose {
  max-width: var(--measure);
  margin: 0 auto;
  color: var(--ivoire-doux);
}
.prose p { margin: 0 0 1.1em; }
.prose p:last-child { margin-bottom: 0; }

/* Blocs fictifs : filets fins, pas de cartes */
.blocks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(28px, 4vw, 56px);
}
.block {
  display: grid;
  align-content: start;
  gap: 14px;
  padding-top: 22px;
  border-top: 1px solid var(--filet);
}
.block__label {
  font-family: var(--font-titre);
  font-size: 0.7rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--ocre);
}
.block h3 {
  margin: 0;
  font-family: var(--font-titre);
  font-weight: 400;
  font-size: var(--t-h3);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--creme);
}
.block p { margin: 0; color: var(--ivoire-doux); font-size: 1rem; }

.placeholder-note {
  font-family: var(--font-accent);
  font-style: italic;
  color: var(--vieux-rose);
  font-size: 1rem;
}

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

/* --------------------------------------------------------------------------
   LES POSTES — cartes discrètes : filet fin, voile léger, texte crème
   -------------------------------------------------------------------------- */
/* Prologue : trois temps — l'ouverture, le récit, l'appel */
.prologue {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: var(--gap-niveaux);
  max-width: 820px;
  margin: 0 auto;
}
.prologue__orn {
  position: relative;
  display: block;
  width: 128px;
  height: 1px;
  background: linear-gradient(90deg,
    rgba(239, 228, 208, 0) 0%, rgba(239, 228, 208, 0.6) 38%, rgba(239, 228, 208, 0) 44%,
    rgba(239, 228, 208, 0) 56%, rgba(239, 228, 208, 0.6) 62%, rgba(239, 228, 208, 0) 100%);
}
.prologue__orn::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 5px; height: 5px;
  border: 1px solid rgba(239, 228, 208, 0.75);
  transform: translate(-50%, -50%) rotate(45deg);
}
.prologue__ouverture {
  margin: 0;
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 400;
  font-size: var(--t-ouverture);
  line-height: 1.25;
  color: var(--creme);
  text-wrap: balance;
}
.prologue__recit {
  margin: 0;
  max-width: 52ch;
  font-size: var(--t-body);
  line-height: 1.75;
  color: var(--ivoire-voile);
  text-wrap: pretty;
}
.prologue__appel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: clamp(6px, 1.5vw, 14px) 0 0;
  font-family: var(--font-titre);
  font-size: 0.78rem;
  letter-spacing: 0.3em;
  line-height: 1.8;
  text-transform: uppercase;
  color: var(--ocre);
}
.prologue__appel span { margin-right: -0.3em; text-wrap: balance; }
.prologue__appel i {
  flex: none;
  display: block;
  width: 40px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(184, 146, 95, 0.7));
}
.prologue__appel i:last-child { transform: scaleX(-1); }
@media (max-width: 600px) {
  .prologue__appel i { display: none; }
  .prologue__appel { letter-spacing: 0.22em; }
  .prologue__appel span { margin-right: -0.22em; }
}

.postes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(18px, 2.4vw, 30px);
  list-style: none;
  margin: 0;
  padding: 0;
}
@media (max-width: 680px)  { .postes { grid-template-columns: 1fr; } }
.poste {
  position: relative;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  justify-items: center;
  text-align: center;
  gap: 18px;
  min-width: 0;
  padding: clamp(26px, 3vw, 36px);
  border: 1px solid var(--filet);
  background: linear-gradient(180deg, rgba(239, 228, 208, 0.035), rgba(239, 228, 208, 0.01));
  transition: border-color 500ms var(--ease-soie), background 500ms var(--ease-soie), transform 500ms var(--ease-soie);
}
/* coins ciselés : quatre petits angles, rappel discret des encadrements du palais */
.poste::before {
  content: "";
  position: absolute;
  inset: 6px;
  pointer-events: none;
  --c: rgba(184, 146, 95, 0.55);
  background:
    linear-gradient(var(--c), var(--c)) top left / 12px 1px,
    linear-gradient(var(--c), var(--c)) top left / 1px 12px,
    linear-gradient(var(--c), var(--c)) top right / 12px 1px,
    linear-gradient(var(--c), var(--c)) top right / 1px 12px,
    linear-gradient(var(--c), var(--c)) bottom left / 12px 1px,
    linear-gradient(var(--c), var(--c)) bottom left / 1px 12px,
    linear-gradient(var(--c), var(--c)) bottom right / 12px 1px,
    linear-gradient(var(--c), var(--c)) bottom right / 1px 12px;
  background-repeat: no-repeat;
  opacity: 0.7;
  transition: opacity 500ms var(--ease-soie);
}
.poste:hover {
  border-color: var(--filet-fort);
  background: linear-gradient(180deg, rgba(239, 228, 208, 0.06), rgba(239, 228, 208, 0.02));
  transform: translateY(-2px);
}
.poste:hover::before { opacity: 1; }

.poste__icon { width: 30px; height: 30px; color: var(--ocre); }
.poste__icon svg { width: 100%; height: 100%; display: block; }

.poste h3 {
  margin: 0;
  font-family: var(--font-titre);
  font-weight: 400;
  font-size: var(--t-bloc);
  line-height: 1.5;
  letter-spacing: var(--ls-bloc);
  text-transform: uppercase;
  color: var(--creme);
  text-wrap: balance;
}
.poste p { margin: 0; max-width: 40ch; color: var(--ivoire-doux); font-size: 1rem; text-wrap: pretty; }

/* Petite ciselure entre le nom du rôle et sa description */
.poste__orn {
  display: block;
  width: 56px;
  height: 1px;
  justify-self: center;
  background: linear-gradient(90deg, transparent, var(--filet-fort), transparent);
}

/* --------------------------------------------------------------------------
   SUITE DU PARCOURS + PIED DE PAGE
   -------------------------------------------------------------------------- */
.next {
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
  padding-top: clamp(40px, 6vw, 72px);
  border-top: 1px solid var(--filet);
}
.next__link {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  padding: 16px 30px 16px calc(30px + 0.3em);
  border: 1px solid var(--filet-fort);
  font-family: var(--font-titre);
  font-size: 0.74rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--creme);
  transition: background var(--dur-ui), border-color var(--dur-ui);
}
.next__link:hover { background: rgba(239, 228, 208, 0.05); border-color: var(--creme); }
.next__link svg { width: 18px; height: 10px; transition: transform var(--dur-ui) var(--ease-soie); }
.next__link:hover svg { transform: translateX(4px); }

.footer {
  background: var(--ground);
  border-top: 1px solid var(--filet);
  padding-inline: var(--gutter);
  padding-block: 28px calc(28px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 24px;
  font-family: var(--font-titre);
  font-size: 0.66rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ivoire-voile);
}

/* --------------------------------------------------------------------------
   REJOINDRE LA COUR — deux registres précieux du Palais
   Double encadrement doré très fin, coins ciselés, lueur de lanterne,
   motif d'étoiles à huit branches presque invisible.
   -------------------------------------------------------------------------- */
.registres {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(24px, 3vw, 40px);
  align-items: stretch;
}
@media (max-width: 900px) { .registres { grid-template-columns: 1fr; } }

.registre {
  --or: rgba(184, 146, 95, 0.42);
  --or-doux: rgba(184, 146, 95, 0.2);
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  gap: clamp(28px, 3.4vw, 40px);
  padding: clamp(36px, 4.4vw, 60px) clamp(22px, 4vw, 56px) clamp(34px, 4vw, 52px);
  border: 1px solid var(--or);
  background:
    radial-gradient(70% 38% at 50% 0%, rgba(214, 152, 92, 0.11), transparent 70%),
    linear-gradient(180deg, rgba(239, 228, 208, 0.035), rgba(20, 19, 31, 0.18));
  box-shadow: 0 30px 80px -40px rgba(10, 6, 8, 0.8), inset 0 0 60px rgba(20, 12, 10, 0.35);
}
/* second filet intérieur + coins ciselés */
.registre::before {
  content: "";
  position: absolute;
  inset: 8px;
  z-index: -1;
  pointer-events: none;
  border: 1px solid var(--or-doux);
  --c: rgba(201, 162, 108, 0.75);
  background:
    linear-gradient(var(--c), var(--c)) top left / 16px 1px,
    linear-gradient(var(--c), var(--c)) top left / 1px 16px,
    linear-gradient(var(--c), var(--c)) top right / 16px 1px,
    linear-gradient(var(--c), var(--c)) top right / 1px 16px,
    linear-gradient(var(--c), var(--c)) bottom left / 16px 1px,
    linear-gradient(var(--c), var(--c)) bottom left / 1px 16px,
    linear-gradient(var(--c), var(--c)) bottom right / 16px 1px,
    linear-gradient(var(--c), var(--c)) bottom right / 1px 16px;
  background-repeat: no-repeat;
}
/* motif géométrique en filigrane, qui s'efface vers le bas */
.registre::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: 0.4;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%23b8925f' stroke-opacity='0.1' stroke-width='0.6'%3E%3Crect x='24' y='24' width='24' height='24'/%3E%3Crect x='24' y='24' width='24' height='24' transform='rotate(45 36 36)'/%3E%3Cpath d='M0 36h12M60 36h12M36 0v12M36 60v12'/%3E%3C/g%3E%3C/svg%3E");
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,0.35) 45%, transparent 85%);
  mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,0.35) 45%, transparent 85%);
}

.registre__tete {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 16px;
}
.registre__embleme {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid var(--or);
  border-radius: 50%;
  color: var(--ocre);
  background: radial-gradient(circle, rgba(214, 152, 92, 0.12), transparent 70%);
  box-shadow: 0 0 0 5px rgba(20, 19, 31, 0.25), 0 0 0 6px var(--or-doux);
}
.registre__embleme svg { width: 28px; height: 28px; }
.registre__titre {
  margin: 6px 0 0;
  font-family: var(--font-titre);
  font-weight: 400;
  font-size: clamp(1.05rem, 0.9rem + 0.6vw, 1.4rem);
  letter-spacing: var(--ls-bloc);
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--creme);
  text-wrap: balance;
}
.registre__titre span { margin-right: calc(var(--ls-bloc) * -1); }
.registre__orn {
  position: relative;
  display: block;
  width: 96px;
  height: 1px;
  background: linear-gradient(90deg,
    rgba(201, 162, 108, 0) 0%, rgba(201, 162, 108, 0.7) 38%, rgba(201, 162, 108, 0) 44%,
    rgba(201, 162, 108, 0) 56%, rgba(201, 162, 108, 0.7) 62%, rgba(201, 162, 108, 0) 100%);
}
.registre__orn::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 5px; height: 5px;
  border: 1px solid rgba(201, 162, 108, 0.8);
  transform: translate(-50%, -50%) rotate(45deg);
}
.registre__texte {
  margin: 0;
  max-width: 38ch;
  font-family: var(--font-accent);
  font-style: italic;
  font-size: clamp(1.1rem, 1rem + 0.35vw, 1.28rem);
  line-height: 1.5;
  color: var(--ivoire-doux);
  text-wrap: balance;
}

/* — Champs : une ligne de registre, pas une boîte — */
.registre__form { display: grid; gap: 26px; }
.champs { display: grid; gap: 26px; }
.champs--duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 28px; }
@media (max-width: 1080px) and (min-width: 901px), (max-width: 520px) {
  .champs--duo { grid-template-columns: 1fr; }
}
.champ { display: grid; gap: 8px; min-width: 0; }
.champ__label {
  font-family: var(--font-titre);
  font-size: 0.66rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ocre);
}
.champ__input {
  width: 100%;
  min-width: 0;
  padding: 10px 2px 11px;
  border: 0;
  border-bottom: 1px solid rgba(216, 190, 150, 0.32);
  border-radius: 0;
  background: transparent;
  font-family: var(--font-texte);
  font-size: 1.05rem;
  color: var(--creme);
  outline: none;
  transition: border-color var(--dur-ui) var(--ease-soie), box-shadow var(--dur-ui) var(--ease-soie);
  -webkit-appearance: none;
  appearance: none;
}
.champ__input::placeholder {
  font-family: var(--font-accent);
  font-style: italic;
  font-size: 1.08rem;
  color: rgba(216, 200, 174, 0.45);
}
.champ__input:hover { border-bottom-color: rgba(216, 190, 150, 0.5); }
.champ__input:focus {
  border-bottom-color: var(--ocre);
  box-shadow: 0 10px 18px -14px rgba(214, 152, 92, 0.55);
}
.champ__input:-webkit-autofill {
  -webkit-text-fill-color: var(--creme);
  transition: background-color 9999s;
}

.champ__select { position: relative; }
.champ__select select { padding-right: 28px; cursor: pointer; }
.champ__select select:invalid { font-family: var(--font-accent); font-style: italic; font-size: 1.08rem; color: rgba(216, 200, 174, 0.45); }
.champ__select option { font-family: var(--font-texte); font-style: normal; color: var(--creme); background: #2b1a17; }
.champ__chevron {
  position: absolute;
  right: 4px; top: 50%;
  width: 12px; height: 8px;
  transform: translateY(-50%);
  color: var(--ocre);
  pointer-events: none;
}

/* — Case « me reconnaître » + lien — */
.registre__ligne {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
}
@media (min-width: 521px) { .registre__ligne { flex-wrap: nowrap; } }
.coche {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.coche input { position: absolute; opacity: 0; width: 16px; height: 16px; margin: 0; }
.coche__case {
  position: relative;
  flex: none;
  width: 15px; height: 15px;
  border: 1px solid var(--or);
  transition: border-color var(--dur-ui), background var(--dur-ui);
}
.coche__case::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 6px; height: 6px;
  background: var(--ocre);
  transform: translate(-50%, -50%) rotate(45deg) scale(0);
  transition: transform var(--dur-ui) var(--ease-soie);
}
.coche input:checked + .coche__case::after { transform: translate(-50%, -50%) rotate(45deg) scale(1); }
.coche input:focus-visible + .coche__case { outline: 1px solid var(--ocre); outline-offset: 3px; }
.coche:hover .coche__case { border-color: var(--ocre); }
.coche__texte {
  font-family: var(--font-titre);
  font-size: 0.64rem;
  letter-spacing: 0.22em;
  line-height: 1.7;
  text-transform: uppercase;
  color: var(--ivoire-doux);
}
.registre__oubli { flex: none; }
.registre__oubli {
  padding: 4px 0;
  border: 0;
  background: none;
  cursor: pointer;
  font-family: var(--font-accent);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--ivoire-doux);
  text-decoration: underline;
  text-decoration-color: rgba(184, 146, 95, 0.4);
  text-underline-offset: 4px;
  transition: color var(--dur-ui), text-decoration-color var(--dur-ui);
}
.registre__oubli:hover { color: var(--creme); text-decoration-color: var(--ocre); }

/* — Bouton du registre — */
.registre__bouton {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  width: 100%;
  margin-top: 8px;
  padding: 18px 24px;
  border: 1px solid rgba(201, 162, 108, 0.6);
  background: linear-gradient(180deg, rgba(184, 146, 95, 0.16), rgba(184, 146, 95, 0.06));
  cursor: pointer;
  font-family: var(--font-titre);
  font-size: 0.74rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--creme);
  transition: background var(--dur-ui) var(--ease-soie), border-color var(--dur-ui), box-shadow var(--dur-ui);
}
.registre__bouton span { margin-right: -0.3em; }
.registre__bouton svg { width: 18px; height: 10px; flex: none; transition: transform 500ms var(--ease-soie); }
.registre__bouton:hover {
  border-color: var(--creme);
  background: linear-gradient(180deg, rgba(184, 146, 95, 0.26), rgba(184, 146, 95, 0.1));
  box-shadow: 0 0 34px -10px rgba(214, 152, 92, 0.45);
}
.registre__bouton:hover svg { transform: translateX(5px); }
.registre__bouton:focus-visible { outline: 1px solid var(--creme); outline-offset: 4px; }

@media (max-width: 520px) {
  .registre__bouton { font-size: 0.66rem; letter-spacing: 0.16em; padding-inline: 14px; gap: 12px; }
  .registre__bouton span { margin-right: -0.16em; }
}
.registre__note {
  margin: -6px 0 0;
  text-align: center;
  font-family: var(--font-accent);
  font-style: italic;
  font-size: 1rem;
  line-height: 1.5;
  color: rgba(216, 200, 174, 0.6);
  text-wrap: balance;
  transition: color var(--dur-ui);
}
.registre__note--vide:empty { display: none; }
.registre__note.is-apercu { color: var(--ocre); }

/* Sceau du Palais, en filigrane au pied du second registre */
.registre__sceau {
  margin-top: auto;
  align-self: center;
  width: clamp(84px, 9vw, 116px);
  padding-top: 12px;
  color: rgba(184, 146, 95, 0.32);
}
.registre__sceau svg { display: block; width: 100%; height: auto; }
@media (max-width: 900px) { .registre__sceau { width: 76px; } }


/* --------------------------------------------------------------------------
   REGISTRE CONNECTÉ — états d'envoi, erreurs, identité de courtisan
   -------------------------------------------------------------------------- */
.registres-zone { min-height: 240px; }
.registres-zone[data-mode="attente"] { min-height: 620px; }

.registre__bouton:disabled { opacity: 0.6; cursor: progress; }
/* Tactile : champs assez hauts pour le doigt (≥ 44 px) */
@media (max-width: 900px), (pointer: coarse) {
  .champ__input { min-height: 46px; }
  .registre__oubli { min-height: 44px; }
}
.registre__bouton:disabled svg { transform: none; }
.registre__note.is-erreur { color: #d59a86; }
.champ__input[aria-invalid="true"] { border-bottom-color: rgba(213, 154, 134, 0.85); }

.registre--identite { max-width: 640px; width: 100%; margin: 0 auto; }
.fiche { display: grid; margin: 0; }
.fiche__ligne {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 18px 0 20px;
  border-bottom: 1px solid rgba(216, 190, 150, 0.2);
  text-align: center;
}
.fiche__ligne:first-child { border-top: 1px solid rgba(216, 190, 150, 0.2); }
.fiche dd {
  margin: 0;
  font-family: var(--font-texte);
  font-size: 1.15rem;
  color: var(--creme);
}
.fiche dd.fiche__nom {
  font-family: var(--font-accent);
  font-style: italic;
  font-size: clamp(1.5rem, 1.2rem + 1vw, 1.9rem);
  line-height: 1.3;
}
.registre__quitter { justify-self: center; font-size: 0.98rem; }
