/* Ideal Marbre — page d'attente.
   Aucun style ni script en ligne : la CSP (nginx/default.conf) les refuse.
   Modifier ce fichier => incrementer ?v=N dans index.html et 404.html
   (cache navigateur de 7 jours sur /assets/). Meme regle pour les images
   de marbre ci-dessous, appelees avec ?v=N : ce sont des rendus fixes des
   SVG de outils/ (un filtre SVG en direct couterait du calcul a chaque
   redimensionnement, notamment quand la barre d'adresse mobile se replie). */

@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-display: swap;
  font-weight: 300 700;
  src: url("/assets/fonts/cormorant-garamond-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Contrastes verifies (WCAG AA) sur le pire fond de plaque de chaque theme :
   clair  #e9e4db -> texte 13,6:1, doux 6,8:1, or 5,0:1
   sombre #2a2825 -> texte 12,8:1, doux 8,8:1, or 7,5:1 */
:root {
  color-scheme: light dark;
  --fond: #f2efe9;
  --marbre: url("/assets/marbre-clair.webp?v=1");
  --plaque: rgb(250 248 244 / 0.82);
  --bord: rgb(122 90 40 / 0.45);
  --texte: #1d1b18;
  --doux: #514b43;
  --or: #7a5a28;
  --ombre: 0 30px 80px -30px rgb(40 32 20 / 0.35);
}

@media (prefers-color-scheme: dark) {
  :root {
    --fond: #151413;
    --marbre: url("/assets/marbre-sombre.webp?v=1");
    --plaque: rgb(22 21 19 / 0.8);
    --bord: rgb(214 180 122 / 0.4);
    --texte: #f3efe8;
    --doux: #cfc7ba;
    --or: #d6b47a;
    --ombre: 0 30px 80px -30px rgb(0 0 0 / 0.7);
  }
}

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

html {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: 1fr auto;
  justify-items: center;
  align-items: center;
  padding: clamp(1rem, 4vw, 3rem) clamp(1rem, 4vw, 2rem) 1.25rem;
  background: var(--fond);
  color: var(--texte);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Le marbre sur un calque fixe plutot qu'en background-attachment: fixed,
   ignore par Safari iOS. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--fond) var(--marbre) center / cover no-repeat;
}

.plaque {
  position: relative;
  width: min(100%, 34rem);
  padding: clamp(2.25rem, 6vw, 3.5rem) clamp(1.25rem, 5vw, 3.5rem);
  text-align: center;
  background: var(--plaque);
  -webkit-backdrop-filter: blur(6px) saturate(1.1);
  backdrop-filter: blur(6px) saturate(1.1);
  border: 1px solid var(--bord);
  box-shadow: var(--ombre);
  animation: apparition 900ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

/* Second filet interieur : l'aspect d'une plaque gravee. */
.plaque::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid var(--bord);
  opacity: 0.6;
  pointer-events: none;
}

.embleme {
  display: block;
  width: 3.25rem;
  height: 3.25rem;
  margin: 0 auto 1.25rem;
  color: var(--or);
}

.surtitre {
  margin: 0 0 0.75rem;
  /* compense l'espacement apres la derniere lettre : centrage optique */
  padding-left: 0.28em;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--or);
}

h1 {
  margin: 0;
  font-family: "Cormorant Garamond", Garamond, "Times New Roman", serif;
  font-weight: 500;
  font-size: clamp(2.75rem, 11vw, 4.5rem);
  line-height: 1.02;
  letter-spacing: 0.01em;
  text-wrap: balance;
}

.filet {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: min(12rem, 60%);
  margin: 1.5rem auto;
  color: var(--or);
}

.filet::before,
.filet::after {
  content: "";
  flex: 1;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
}

.filet span {
  width: 0.45rem;
  height: 0.45rem;
  border: 1px solid currentColor;
  transform: rotate(45deg);
}

.message {
  margin: 0;
  color: var(--doux);
  font-size: clamp(1rem, 2.6vw, 1.08rem);
  /* pas de mot seul en fin de paragraphe sur petit ecran */
  text-wrap: balance;
}

/* une phrase par ligne, chacune equilibree (text-wrap ne traverse pas un <br>) */
.ligne {
  display: block;
  text-wrap: balance;
}

.message + .message {
  margin-top: 1rem;
}

.message-ar {
  margin: 1rem 0 0;
  color: var(--doux);
  font-family: "Noto Naskh Arabic", "Geeza Pro", "Segoe UI", Tahoma, sans-serif;
  font-size: 1.08rem;
  line-height: 1.8;
  text-wrap: balance;
}

.lien {
  color: var(--or);
  font-weight: 600;
  text-underline-offset: 0.2em;
}

.lien:hover,
.lien:focus-visible {
  text-decoration-thickness: 2px;
}

.pied {
  margin-top: 1.5rem;
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  background: var(--plaque);
  color: var(--doux);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

@keyframes apparition {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .plaque {
    animation: none;
  }
}
