/* Carte de visite de David. Couleurs et polices reprises de kairozenlabs.com (brun, crème, Halant, Geist) ; l'or vient du logo. */

@font-face { font-family: "Halant"; src: url("/fonts/halant-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Geist"; src: url("/fonts/geist.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --brun: #2b180a;
  --creme: #f6f0e9;
  --or: #d9ab52;

  /* Style « nuit » : brun du site en fond, or du logo pour le circuit. */
  color-scheme: dark;
  --fond: var(--brun);
  --texte: var(--creme);
  --discret: #cbbcaa;
  --trait: var(--or);
  --accent: var(--or);
  --plein-fond: var(--or);
  --plein-texte: var(--brun);
  --doux-fond: rgb(246 240 233 / 0.09);
}

[data-theme="creme"] {
  /* Style « crème » : les couleurs du site, telles quelles. */
  color-scheme: light;
  --fond: var(--creme);
  --texte: var(--brun);
  --discret: #6f6257;
  --trait: #a97c2a;
  --accent: #7a5614;
  --plein-fond: var(--brun);
  --plein-texte: var(--creme);
  --doux-fond: rgb(43 24 10 / 0.07);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--fond); }
body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font: 400 17px/1.5 "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }

/* ---------- La carte ---------- */

.carte {
  display: flex;
  flex-direction: column;
  max-width: 440px;
  min-height: 100svh;
  margin: 0 auto;
  padding: max(10px, env(safe-area-inset-top)) 24px max(20px, env(safe-area-inset-bottom));
}

.tete { display: flex; align-items: center; justify-content: space-between; min-height: 44px; font-size: 14px; }
.maison { color: var(--discret); text-decoration: none; }
.langues { display: flex; margin-right: -10px; }
.langues button {
  min-width: 44px; min-height: 44px; padding: 0;
  font: inherit; color: var(--discret); background: none; border: 0; cursor: pointer;
}
.langues button[aria-pressed="true"] {
  color: var(--texte);
  text-decoration: underline; text-decoration-color: var(--trait); text-decoration-thickness: 1.5px; text-underline-offset: 6px;
}

.rencontre { margin: 6px 0 0; font-size: 14px; color: var(--accent); }

.identite { display: flex; align-items: flex-end; gap: 18px; margin-top: 18px; }
.portrait { position: relative; flex: none; width: 96px; height: 111px; }
.portrait img, .initiales {
  position: absolute; inset: 3px; width: 90px; height: 105px;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
.portrait img { object-fit: cover; }
.initiales {
  display: grid; place-items: center; padding-top: 4px;
  background: var(--doux-fond); color: var(--accent);
  font: 500 34px/1 "Halant", Georgia, serif;
}
.portrait svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }

h1 { margin: 0; font: 500 clamp(40px, 11.6vw, 48px)/0.96 "Halant", Georgia, serif; letter-spacing: -0.01em; }
h1 span { display: block; }
.titre { margin: 6px 0 0; font-size: 16px; font-weight: 500; color: var(--accent); }

/* Le circuit : un trait part du portrait, longe la phrase et se branche sur chaque bouton. */
.circuit { display: grid; grid-template-columns: 40px 1fr; }
.coude { grid-column: 1 / -1; display: block; width: 60px; height: 44px; overflow: visible; }
.rail { grid-area: 2 / 1; display: block; width: 40px; height: 100%; overflow: visible; }
.phrase { grid-area: 2 / 2; margin: 0; padding: 0 0 22px; text-wrap: pretty; }
.actions { grid-area: 3 / 1 / auto / -1; }

.action {
  display: grid; grid-template-columns: 40px 1fr; height: 62px;
  color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent;
}
.action:last-child { height: 52px; }
.action svg { display: block; width: 40px; height: 62px; overflow: visible; }
.bouton {
  display: flex; align-items: center; height: 52px; padding: 0 18px;
  font-size: 16px; font-weight: 500;
  background: var(--doux-fond);
  /* Deux coins coupés, comme les angles de l'hexagone. */
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}
.principale .bouton { background: var(--plein-fond); color: var(--plein-texte); }
.action:active .bouton { transform: translateY(1px); filter: brightness(0.93); }
.action:focus-visible { outline: 2px solid var(--trait); outline-offset: 3px; }
.maison:focus-visible, .pied a:focus-visible, .langues button:focus-visible { outline: 2px solid var(--trait); outline-offset: 2px; }

.trace { fill: none; stroke: var(--trait); stroke-width: 1.5; stroke-linejoin: round; }
.pastille { fill: var(--trait); }

.pied {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px;
  margin-top: auto; padding-top: 26px;
  font-size: 13px; color: var(--discret);
}
.pied a { color: inherit; text-underline-offset: 3px; }

/* Un seul mouvement, à l'ouverture : le circuit se trace du portrait jusqu'aux boutons. */
@media (prefers-reduced-motion: no-preference) {
  .trace { stroke-dasharray: 1; stroke-dashoffset: 1; animation: tracer var(--t, 0.3s) cubic-bezier(0.4, 0, 0.2, 1) var(--d, 0s) forwards; }
  .pastille { transform-box: fill-box; transform-origin: center; transform: scale(0); animation: poser 0.28s cubic-bezier(0.3, 1.6, 0.5, 1) var(--d, 0s) forwards; }
}
@keyframes tracer { to { stroke-dashoffset: 0; } }
@keyframes poser { to { transform: scale(1); } }

/* ---------- L'écran du QR code (sur le téléphone de David) ---------- */

.ecran-qr {
  /* Toujours blanc : c'est ce qui se scanne le mieux. */
  color-scheme: light;
  --fond: #fff; --texte: var(--brun); --discret: #6f6257; --trait: #a97c2a; --accent: #7a5614;
  --plein-fond: var(--brun); --plein-texte: var(--creme); --doux-fond: rgb(43 24 10 / 0.07);
  background: #fff;
}
.presentoir {
  display: flex; flex-direction: column; align-items: center;
  max-width: 440px; min-height: 100svh; margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 24px max(18px, env(safe-area-inset-bottom));
  text-align: center;
}
.presentoir h1 { font-size: 34px; line-height: 1; }
.presentoir .titre { margin-top: 4px; font-size: 15px; }
.code { width: min(100%, 52svh); margin: auto auto 0; }
.code svg { display: block; width: 100%; height: auto; }
.code path { fill: var(--brun); }
.invite { margin: 2px 0 0; font-size: 16px; font-weight: 500; }
.invite span { display: block; font-weight: 400; font-size: 14px; color: var(--discret); }

.reglages { width: 100%; margin-top: auto; padding-top: 18px; text-align: left; }
.reglages label { display: block; font-size: 13px; color: var(--discret); }
.reglages input {
  width: 100%; height: 48px; margin-top: 4px; padding: 0 14px;
  font: inherit; font-size: 16px; color: var(--texte);
  background: var(--doux-fond); border: 0; border-radius: 0;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}
.reglages input:focus-visible { outline: none; box-shadow: inset 0 -2px 0 var(--trait); }
.deux { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.deux .bouton { justify-content: center; width: 100%; padding: 0 10px; font: 500 15px/1 "Geist", system-ui, sans-serif; color: var(--texte); border: 0; cursor: pointer; text-decoration: none; }
.deux .bouton:focus-visible { box-shadow: inset 0 -2px 0 var(--trait); outline: none; }
.astuce { margin: 12px 0 0; font-size: 13px; color: var(--discret); }
