:root {
  --fond: #0b0b0d;
  --carte: #141416;
  --bouton: #242428;
  --bouton-survol: #2e2e33;
  --rond: #2a2a2f;
  --texte: #ffffff;
  --texte-doux: rgba(255, 255, 255, 0.72);
  --texte-gris: #8e8e93;
  --ligne: rgba(255, 255, 255, 0.1);
  --vert: #34c759;
  --bleu: #0095f6;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--fond);
  color: var(--texte);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* ---- Fond : la photo floutée et assombrie ---- */
.fond {
  position: fixed;
  inset: -60px;
  z-index: 0;
  background: var(--fond) center / cover no-repeat;
  filter: blur(40px) brightness(0.42) saturate(1.15);
  transform: translateZ(0);
}

/* ---- Mise en page ---- */
.page {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  min-height: 100dvh;
  padding: max(20px, env(safe-area-inset-top)) 16px max(32px, env(safe-area-inset-bottom));
}

.carte {
  width: 100%;
  max-width: 420px;
  background: var(--carte);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* ---- Photo de couverture ---- */
.couverture {
  position: relative;
  aspect-ratio: 4 / 5;
  background: #1c1c1f;
}

.couverture img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.couverture::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom,
    rgba(20, 20, 22, 0) 45%,
    rgba(20, 20, 22, 0.55) 68%,
    rgba(20, 20, 22, 0.92) 88%,
    var(--carte) 100%);
  pointer-events: none;
}

.identite {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  z-index: 1;
  padding: 0 20px;
  text-align: center;
}

.nom {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 34px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
}

.badge { display: inline-flex; width: 26px; height: 26px; flex: none; }
.badge svg { width: 100%; height: 100%; }

.sous-titre {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--texte-doux);
}

.statut { display: inline-flex; align-items: center; gap: 6px; }
.sep { color: rgba(255, 255, 255, 0.35); margin-right: 2px; }

.point {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--vert);
  box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.2);
}

/* ---- Contenu sous la photo ---- */
.contenu {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 6px 20px 26px;
}

.bascule {
  appearance: none;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.chevron {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 260ms var(--ease);
}

.bascule[aria-expanded="true"] .chevron { transform: rotate(180deg); }

/* Zone repliable : hauteur animée sans valeur fixe */
.repli {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 300ms var(--ease), opacity 200ms ease;
}
.repli > div { overflow: hidden; min-height: 0; }
.repli.ouvert { grid-template-rows: 1fr; opacity: 1; }

/* ---- Bio ---- */
.bloc-bio { display: flex; flex-direction: column; align-items: center; }

.bascule-bio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 15px;
  font-weight: 600;
  color: #c7c7cc;
  border-radius: 10px;
}

.bio-texte {
  margin: 0;
  padding-top: 8px;
  max-width: 34ch;
  font-size: 15px;
  line-height: 1.5;
  color: #d1d1d6;
  text-align: center;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

/* ---- Icônes rondes ---- */
.reseaux { display: flex; justify-content: center; gap: 14px; }
.reseaux:empty { display: none; }

.rond {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--rond);
  color: #fff;
  transition: transform 160ms var(--ease), background-color 160ms ease;
}
.rond svg { width: 22px; height: 22px; }

/* ---- Boutons ---- */
.boutons { display: flex; flex-direction: column; gap: 12px; }

.bouton {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 58px;
  padding: 14px 56px;
  border: 0;
  border-radius: 14px;
  background: var(--bouton);
  color: var(--texte);
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  overflow-wrap: anywhere;
  transition: transform 160ms var(--ease), background-color 160ms ease;
}

.bouton .icone {
  position: absolute;
  left: 16px;
  top: 50%;
  display: flex;
  width: 28px;
  height: 28px;
  transform: translateY(-50%);
}
.bouton .icone svg { width: 100%; height: 100%; }

.bouton:active, .rond:active { transform: scale(0.97); }

@media (hover: hover) and (pointer: fine) {
  .bouton:hover { background: var(--bouton-survol); }
  .rond:hover { background: #36363c; }
  .bascule-bio:hover { color: #fff; }
  .bascule-assos:hover .assos-titre,
  .bascule-assos:hover .chevron { color: #c7c7cc; }
}

/* ---- Charities ---- */
.assos { margin-top: 6px; }

.bascule-assos {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px 0;
  color: var(--texte-gris);
}

.assos-titre {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: color 160ms ease;
}

.assos-ligne { width: 100%; height: 1px; background: var(--ligne); }

.bascule-assos .chevron { transition: transform 260ms var(--ease), color 160ms ease; }

.assos-liens { display: flex; flex-direction: column; gap: 10px; padding-top: 12px; }
.assos-liens .bouton { min-height: 50px; font-size: 15px; font-weight: 600; }

/* ---- Accessibilité ---- */
:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.85); outline-offset: 3px; }
.bouton:focus-visible, .rond:focus-visible { outline-offset: 2px; }

.sans-js {
  position: relative;
  z-index: 2;
  margin: 40px 16px;
  text-align: center;
  color: var(--texte-doux);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
