/* ==================================================================
   renART Invest — feuille maîtresse (page unique, défilement naturel)
   La page s'adapte à son contenu : aucun débordement horizontal, aucun
   contenu masqué, le défilement vertical suit naturellement la lecture.

   --ivoire harmonisé EXACTEMENT sur la couleur de l'armoirie (#E7E3D7).
   ================================================================== */

/* ---------- 1 · Tokens verrouillés ---------- */

:root {
  --encre: #07090D;
  --nuit: #0B0F16;
  --ivoire: #E7E3D7;   /* harmonisée exactement sur l'armoirie (#E7E3D7) */
  --or: #C6A15B;
  --or-clair: #E7CF9B;
  --brume: rgba(233, 228, 214, .60);
  --brume-lisible: rgba(231, 227, 215, .75); /* serment : discret mais réellement lisible */
  --fil: rgba(198, 161, 91, .28);
}

/* ---------- 2 · Reset sobre — défilement naturel ---------- */

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

html {
  scroll-behavior: smooth;
  color-scheme: dark;
  background: var(--encre);
}

body {
  background: var(--encre);
  color: var(--ivoire);
  font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  font-weight: 400;
  font-size: clamp(17px, 1.35vw, 19px);
  line-height: 1.75;
  overflow-x: clip; /* jamais de débordement horizontal */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Grain — feTurbulence fractalNoise, ~4%, fixe, pointer-events:none */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: .04;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='280'%20height='280'%3E%3Cfilter%20id='grain'%3E%3CfeTurbulence%20type='fractalNoise'%20baseFrequency='0.72'%20numOctaves='2'%20stitchTiles='stitch'/%3E%3C/filter%3E%3Crect%20width='280'%20height='280'%20filter='url(%23grain)'/%3E%3C/svg%3E");
}

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

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* ---------- 3 · Libellés (DM Sans, majuscules, .32em — usage exclusif) ---------- */

.voile-lien,
.devise-trad,
.villes li,
.ligne-adresse,
.ligne-depot {
  font-family: 'DM Sans', 'Helvetica Neue', Arial, sans-serif;
  font-size: 11px;
  font-weight: 300;
  letter-spacing: .32em;
  line-height: 1.6;
}

.voile-lien,
.devise-trad,
.villes li {
  text-transform: uppercase;
}

/* ---------- 4 · Focus & hover (visibles, sobres) ---------- */

:focus-visible {
  outline: 1px solid var(--or);
  outline-offset: 4px;
}

.voile-marque,
.voile-lien {
  transition: color .4s ease;
}

.voile-marque:hover,
.voile-lien:hover {
  color: var(--or-clair);
}

/* ---------- 5 · Skip-link ---------- */

.skip-link {
  position: fixed;
  top: -120px;
  left: 16px;
  z-index: 200;
  padding: 14px 20px;
  background: var(--nuit);
  border: 1px solid var(--fil);
  color: var(--ivoire);
  font-family: 'DM Sans', 'Helvetica Neue', Arial, sans-serif;
  font-size: 11px;
  font-weight: 300;
  letter-spacing: .32em;
  text-transform: uppercase;
}

.skip-link:focus {
  top: 16px;
}

/* ---------- 6 · Voile — header fixe fin (jamais animé) ---------- */

.voile {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: clamp(20px, 5vw, 64px);
  background: var(--encre);
  border-bottom: 1px solid var(--fil);
}

.voile-marque {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: .02em;
  color: var(--ivoire);
  padding: 12px 0; /* cible tactile ≥ 44px */
}

.voile-lien {
  padding-block: 16px; /* cible tactile ≥ 44px */
}

/* ---------- 7 · Ouverture — l'armoirie respire sous l'en-tête ---------- */

.hero {
  padding: clamp(120px, 16vh, 190px) clamp(20px, 5vw, 64px) clamp(40px, 6vh, 72px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-armoiries {
  height: clamp(170px, 24vh, 250px); /* agrandie : elle respire, entière */
  width: auto;
  margin-bottom: clamp(28px, 5vh, 52px);
}

.hero-devise {
  /* Suit directement l'armoirie : son margin-bottom suffit, aucun ajout. */
  margin-top: 0;
}

.devise {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic; /* l'italique appartient à la devise */
  font-size: clamp(19px, 2.4vw, 27px);
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: .04em;
  color: var(--brume);
}

.devise-trad {
  margin-top: 12px;
  color: var(--brume);
}

.hero-ouverture {
  margin-top: clamp(28px, 4.5vh, 46px);
}

.ouverture {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(21px, 2.6vw, 30px);
  font-weight: 400;
  line-height: 1.35;
  color: var(--ivoire);
  text-wrap: balance;
}

/* Discret mais réellement lisible : taille relevée, contraste renforcé,
   interligne confortable. */
.ouverture-suite {
  margin: clamp(14px, 2vh, 22px) auto 0;
  max-width: 36em;
  font-size: clamp(15px, 1.5vw, 17.5px);
  line-height: 1.9;
  letter-spacing: .015em;
  color: var(--brume-lisible);
  text-wrap: pretty;
}

/* ---------- 8 · La carte — élément principal, juste après l'identité ---------- */

.carte-section {
  padding: clamp(16px, 3vh, 40px) clamp(20px, 5vw, 64px) clamp(72px, 10vh, 130px);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.carte {
  width: 100%;
  max-width: 1100px;
}

.carte img {
  width: 100%;
  height: auto;
}

.villes {
  margin-top: clamp(28px, 4vh, 48px);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  row-gap: 12px;
}

.villes li {
  color: var(--ivoire);
}

.villes li + li::before {
  content: "";
  display: inline-block;
  width: 1px;
  height: 14px;
  background: var(--fil);
  margin-inline: clamp(16px, 3vw, 34px);
  vertical-align: middle;
}

/* ---------- 9 · La Correspondance ---------- */

.correspondance {
  padding: clamp(80px, 11vh, 150px) clamp(20px, 5vw, 64px) clamp(56px, 8vh, 110px);
  text-align: center;
}

.entete-section {
  margin-bottom: clamp(40px, 6vh, 64px);
}

.titre-section {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 400;
  line-height: 1.15;
  color: var(--ivoire);
  text-wrap: balance;
}

.filet-titre {
  display: block;
  position: relative;
  width: 64px;
  height: 1px;
  background: var(--fil);
  margin: clamp(20px, 3vw, 32px) auto 0;
}

.filet-titre::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  background: var(--or);
  transform: translate(-50%, -50%) rotate(45deg);
}

.declaration {
  max-width: 720px;
  margin-inline: auto;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(22px, 2.6vw, 32px);
  font-weight: 400;
  line-height: 1.4;
  color: var(--ivoire);
  text-wrap: balance;
}

.invitation {
  max-width: 620px;
  margin: clamp(18px, 3vh, 30px) auto 0;
  font-size: clamp(15px, 1.5vw, 17.5px);
  line-height: 1.85;
  color: var(--brume-lisible);
  text-wrap: pretty;
}

.ligne-adresse {
  display: inline-block;
  margin-top: clamp(26px, 4.5vh, 44px);
  text-transform: uppercase;
  color: var(--ivoire);
  padding-bottom: 7px;
  border-bottom: 1px solid var(--fil);
  transition: color .4s ease, border-color .4s ease;
}

.ligne-adresse:hover,
.ligne-adresse:focus-visible {
  color: var(--or-clair);
  border-color: var(--or-clair);
}

.ligne-depot {
  margin-top: clamp(48px, 8vh, 88px);
  color: var(--brume);
}

/* ---------- 10 · Révélation — signature unique ---------- */

/* Caché UNIQUEMENT quand JS est confirmé présent (html.sans-js retiré).
   Sans JS : tout reste visible, toujours. */
:where(html:not(.sans-js)) [data-revele] {
  opacity: 0;
  transform: translateY(24px);
}

[data-revele].visible {
  opacity: 1;
  transform: none;
  transition:
    opacity 1.1s cubic-bezier(.19, 1, .22, 1) var(--delai, 0ms),
    transform 1.1s cubic-bezier(.19, 1, .22, 1) var(--delai, 0ms),
    color .4s ease;
}

/* Délais génériques par data-index — stagger 120 ms */
[data-revele]              { --delai: 0ms; }
[data-revele][data-index="1"] { --delai: 120ms; }
[data-revele][data-index="2"] { --delai: 240ms; }
[data-revele][data-index="3"] { --delai: 360ms; }
[data-revele][data-index="4"] { --delai: 480ms; }
[data-revele][data-index="5"] { --delai: 600ms; }

/* Timeline d'ouverture du hero (une fois, au chargement) :
   armoiries 0 → devise 150 → ouverture 380 */
.hero [data-revele][data-index="1"] { --delai: 0ms; }
.hero [data-revele][data-index="2"] { --delai: 150ms; }
.hero [data-revele][data-index="3"] { --delai: 380ms; }

.hero [data-revele].visible {
  transition-delay: var(--delai, 0ms) !important;
}

/* ---------- 11 · Halos animés (l'animation vit dans le <style> interne
   de carte-monde.svg — la carte est chargée en <img>. Règle documentaire
   alignée sur la même prescription.) ---------- */

.halo {
  transform-origin: center;
  transform-box: fill-box;
  animation: pulsation-halo 3s ease-in-out infinite;
}

@keyframes pulsation-halo {
  0%, 100% { opacity: .35; transform: scale(1); }
  50%      { opacity: 0;   transform: scale(1.35); }
}

/* ---------- 12 · prefers-reduced-motion — tout statique ET VISIBLE ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  [data-revele],
  :where(html:not(.sans-js)) [data-revele] {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ---------- 13 · La Correspondance ouverte — voile modale ---------- */

html.correspondance-bloque { overflow: hidden; } /* le temps de la modale ouverte seulement */

.voile-modale {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 40px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .4s ease, visibility 0s linear .4s;
}

.voile-modale.est-ouverte {
  opacity: 1;
  visibility: visible;
  transition: opacity .4s ease;
}

.fond-modale {
  position: absolute;
  inset: 0;
  background: rgba(7, 9, 13, .82);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.panneau-modale {
  position: relative;
  width: min(560px, 100%);
  max-height: min(86vh, 720px);
  overflow-y: auto;                      /* petits écrans en paysage */
  background: #0B0F16;
  border: 1px solid var(--fil);
  padding: clamp(36px, 6vh, 56px) clamp(26px, 5vw, 52px);
  text-align: center;
  transform: translateY(18px);
  transition: transform .45s cubic-bezier(.19, 1, .22, 1);
}

.voile-modale.est-ouverte .panneau-modale { transform: none; }

.fermeture-modale {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
  background: none;
  border: 0;
  color: var(--brume);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 26px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  transition: color .4s ease;
}

.fermeture-modale:hover,
.fermeture-modale:focus-visible { color: var(--or-clair); }

.formulaire-correspondance { margin-top: clamp(28px, 5vh, 44px); text-align: left; }

/* Honeypot : hors écran mais présent dans l'arbre (les bots le remplissent). */
.piege {
  position: absolute;
  left: -6000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.etiquette {
  display: block;
  margin: 26px 0 4px;
  font-family: 'DM Sans', 'Helvetica Neue', Arial, sans-serif;
  font-size: 11px;
  font-weight: 300;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--brume);
}

.formulaire-correspondance .etiquette:first-of-type { margin-top: 0; }

.champ {
  display: block;
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--fil);
  border-radius: 0;
  color: var(--ivoire);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 18px;                        /* ≥16px : iOS ne zoome pas au focus */
  font-weight: 400;
  line-height: 1.5;
  padding: 10px 2px 12px;
  transition: border-color .4s ease;
}

.champ:focus { outline: none; border-bottom-color: var(--or-clair); }

.champ-texte { resize: vertical; min-height: 132px; }

.reponse {
  margin: 22px 0 0;
  font-size: 15.5px;
  font-style: italic;
  line-height: 1.7;
  color: var(--brume-lisible);
}

.reponse.est-succes { color: var(--or-clair); }

.envoi {
  margin-top: clamp(26px, 4vh, 36px);
  min-height: 48px;
  padding: 0 38px;
  background: transparent;
  border: 1px solid var(--fil);
  color: var(--ivoire);
  font-family: 'DM Sans', 'Helvetica Neue', Arial, sans-serif;
  font-size: 11px;
  font-weight: 300;
  letter-spacing: .32em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .4s ease, border-color .4s ease;
}

.envoi:hover,
.envoi:focus-visible { color: var(--or-clair); border-color: var(--or-clair); }

.envoi:disabled { opacity: .5; cursor: default; }

/* Écrans courts : le panneau se resserre pour que « Envoyer » reste visible
   sans défilement intérieur (overflow-y ne sert alors qu'aux cas extrêmes). */
@media (max-height: 700px) {
  .panneau-modale { padding: 26px 30px; }
  .entete-section { margin-bottom: 22px; }
  .formulaire-correspondance { margin-top: 18px; }
  .etiquette { margin: 16px 0 3px; }
  .champ-texte { min-height: 84px; }
  .reponse { margin-top: 14px; }
  .envoi { margin-top: 18px; min-height: 44px; }
}

/* Repli sans JS : /contact.php rend le même panneau en pleine page. */
.page-correspondance {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(40px, 8vh, 80px) 20px;
}

.page-correspondance .panneau-modale {
  position: static;
  width: min(560px, 100%);
  max-height: none;
  overflow: visible;
  transform: none;
}
