:root {
  --ground: #0E0F11;
  --raised: #17191C;
  --sunk:   #0A0B0C;
  --line:   #24272B;
  --line-2: #33373C;
  --ink:    #F3F2F0;
  --ink-2:  #9C9B98;
  --ink-3:  #6A6967;
  --ok:     #4FBF9A;
  --wait:   #6E9BD1;
  --brand:  #E0A458;
  --sans: "Schibsted Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
}

* { box-sizing: border-box; }

/* La règle navigateur [hidden]{display:none} perd contre n'importe quelle
   classe qui pose un display — .stack{display:flex} par exemple. Sans ce
   !important, un bloc marqué hidden reste visible. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
  line-height: 1.5;
}

a { color: var(--brand); text-decoration: none; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 2px; }

button { font-family: var(--sans); cursor: pointer; }
button:disabled { cursor: not-allowed; }

.wrap {
  max-width: 520px;
  margin: 0 auto;
  padding: 0 20px;
}

.pad-top { padding-top: max(28px, env(safe-area-inset-top)); }
.pad-bot { padding-bottom: max(28px, env(safe-area-inset-bottom)); }

.studio {
  display: flex; align-items: center; gap: 9px;
  font-size: 10.5px; letter-spacing: .19em; text-transform: uppercase;
  color: var(--brand); font-weight: 600;
}

.display {
  font-family: var(--serif);
  font-size: clamp(38px, 13vw, 54px);
  line-height: .99;
  letter-spacing: -.015em;
  margin: 0;
  text-wrap: balance;
}

.eyebrow {
  font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-2);
}

.muted  { color: var(--ink-2); font-size: 14px; }
.tiny   { color: var(--ink-3); font-size: 12px; }
.stack  { display: flex; flex-direction: column; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  cursor: pointer;
  width: 100%; min-height: 56px; padding: 0 18px;
  border: 0; border-radius: 3px;
  background: var(--brand); color: #14100C;
  font-size: 16px; font-weight: 700;
}
.btn-ghost {
  background: transparent; color: var(--ink);
  border: 1px solid var(--line-2); font-weight: 500; font-size: 15px; min-height: 52px;
}
.btn:disabled { background: #2A2C30; color: #5C6167; }

.card {
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 15px 17px;
}

/* --- écran d'arrivée --- */
.hero { position: relative; min-height: 100svh; display: flex; flex-direction: column; overflow: hidden; }
.hero__glow {
  position: absolute; inset: 0 0 auto 0; height: 52vh; pointer-events: none;
  background:
    radial-gradient(38% 30% at 72% 26%, color-mix(in srgb, var(--brand) 26%, transparent) 0%, transparent 70%),
    radial-gradient(120% 90% at 25% 18%, #7A5636 0%, #3A2A1D 42%, #14100C 78%);
  opacity: .85;
}
.hero__fade {
  position: absolute; left: 0; right: 0; top: 24vh; height: 30vh; pointer-events: none;
  background: linear-gradient(180deg, transparent 0%, var(--ground) 88%);
}
.hero__inner { position: relative; flex: 1; display: flex; flex-direction: column; gap: 0; }
.spacer { flex: 1 1 auto; min-height: 24px; }

.avatars { display: flex; flex: none; }
.avatars img {
  width: 30px; height: 30px; border-radius: 50%; display: block;
  border: 2px solid var(--raised); background: #1A1D20;
  /* Recadrage centré : une photo panoramique doit rester lisible en rond. */
  object-fit: cover;
}
.avatars img + img { margin-left: -11px; }

/* --- galerie --- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--ground) 92%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 34px; padding: 0 15px; border-radius: 17px;
  border: 1px solid var(--line-2); background: transparent; color: #C8C6C3;
  font-size: 13px; font-weight: 500;
}
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #14100C; }

.masonry { display: flex; gap: 5px; align-items: flex-start; }
.masonry__col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.tile {
  display: block; width: 100%; border: 0; padding: 0; border-radius: 2px;
  background: #1A1D20 center/cover no-repeat; overflow: hidden; position: relative;
}
.tile > a { display: block; }
.tile img { display: block; width: 100%; height: auto; }

/* Retirer sa propre photo. Discret — c'est une correction, pas une action
   courante — mais assez large pour un pouce, et jamais sur les photos des
   autres : le bouton n'est posé que sur ce qu'on a déposé soi-même. */
.tile__del {
  position: absolute; top: 6px; right: 6px; z-index: 2;
  width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10, 11, 13, .62); color: #F3F2F0;
  -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px);
}
.tile__del:hover  { background: rgba(10, 11, 13, .85); }
.tile__del:disabled { opacity: .45; }
.tile__play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(10,11,13,.28);
}

.live { display: flex; align-items: center; gap: 7px; }
.live i { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); display: block; }

/* --- file d'attente --- */
.queue { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; }
.queue__inner {
  max-width: 520px; margin: 0 auto;
  padding: 14px 20px max(18px, env(safe-area-inset-bottom));
  background: var(--raised); border-top: 1px solid var(--line);
}
.bar { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--brand); width: 0; transition: width .25s ease; }

.notice {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 15px; border-radius: 3px;
  background: #131A22; border: 1px solid #24303C; color: #7F94AB; font-size: 13px; line-height: 1.45;
}
.notice b { color: #A9C6E6; display: block; font-size: 14px; margin-bottom: 3px; }

.fab {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 0 20px max(18px, env(safe-area-inset-bottom));
  pointer-events: none;
}
/* Colonne plutôt que ligne : sans ça, un seul bouton ne change rien, mais
   la pastille d'adresse (ajoutée conditionnellement) se place au-dessus du
   bouton principal plutôt qu'à côté. */
.fab__inner { max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; pointer-events: auto; }
.fab__scrim {
  position: fixed; left: 0; right: 0; bottom: 0; height: 130px; z-index: 29; pointer-events: none;
  background: linear-gradient(180deg, transparent 0%, var(--ground) 62%);
}

/* --- pastille « laisser mon adresse » ---
   N'apparaît que lorsque le vrai bloc, en bas de page, est hors écran : sur
   une galerie de quelques photos il ne sert à rien, sur une galerie de
   plusieurs centaines il évite d'avoir à tout faire défiler. */
.cap-pill {
  display: flex; align-items: stretch; gap: 2px;
  min-height: 48px; border-radius: 16px; border: 1px solid var(--line-2);
  background: color-mix(in srgb, var(--raised) 96%, transparent);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .35);
}
/* Icône calée sur la première ligne plutôt que centrée sur le bloc entier,
   comme .notice : le message tient maintenant sur deux lignes. */
.cap-pill__open {
  flex: 1 1 auto; display: flex; align-items: flex-start; gap: 10px;
  background: none; border: 0; padding: 13px 4px 13px 16px;
  color: var(--ink); font-family: var(--sans); font-size: 13.5px; font-weight: 600;
  line-height: 1.35; text-align: left;
}
.cap-pill__open svg { flex: none; margin-top: 1px; color: var(--brand); }
.cap-pill__x {
  flex: none; width: 44px; display: flex; align-items: center; justify-content: center;
  background: none; border: 0; color: var(--ink-3);
}
.cap-pill__x:hover { color: var(--ink-2); }

/* --- fiche superposée : même formulaire, accessible sans défiler --- */
.sheet { position: fixed; inset: 0; z-index: 70; display: flex; align-items: flex-end; justify-content: center; }
.sheet__scrim { position: absolute; inset: 0; background: rgba(6, 7, 8, .72); }
.sheet__card {
  position: relative; width: 100%; max-width: 520px;
  background: var(--raised); border: 1px solid var(--line);
  border-top-left-radius: 16px; border-top-right-radius: 16px;
  padding: 26px 20px max(24px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 14px;
  animation: sheet-in .22s ease;
}
.sheet__close {
  position: absolute; top: 14px; right: 14px; z-index: 1;
  width: 34px; height: 34px; border-radius: 50%; border: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--ground); color: var(--ink-2);
}
@keyframes sheet-in {
  from { transform: translateY(20px); opacity: .3; }
  to   { transform: translateY(0); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .sheet__card { animation: none; }
}

.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* --- QR code à montrer --- */
.qrmodal {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(6, 7, 8, .82);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.qrmodal[hidden] { display: none; }
.qrmodal__card {
  background: #fff; border-radius: 6px; padding: 26px 22px 22px;
  width: min(100%, 360px); text-align: center;
  display: flex; flex-direction: column; gap: 14px;
}
.qrmodal__lead {
  margin: 0; font-size: 15px; font-weight: 600; color: #141210;
}
.qrmodal__code { line-height: 0; }
.qrmodal__code svg { width: 100%; height: auto; display: block; }
.qrmodal__url {
  margin: 0; font-size: 13px; color: #55504B; word-break: break-all;
}
.qrmodal__close {
  min-height: 48px; border: 0; border-radius: 3px;
  background: #141210; color: #fff; font-size: 15px; font-weight: 600;
}
.qr-open {
  display: inline-flex; align-items: center; gap: 7px;
  background: none; border: 0; padding: 8px 0; min-height: 44px;
  color: var(--ink-2); font-size: 13px;
}
.qr-open:hover { color: var(--ink); }

/* --- QR affiché en clair sur l'écran d'arrivée --- */
/* Carte blanche à la taille du code : le SVG porte déjà sa zone de silence,
   une marge de 10 px suffit à le détacher du fond sombre. */
.qrblock {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  background: none; border: 0; padding: 0; width: 100%;
}
.qrinline {
  /* Éléments en ligne dans un <button> : sans display:block, la largeur
     est ignorée et le code s'étale sur toute la carte. */
  display: block; width: fit-content; margin: 0;
  background: #fff; border-radius: 4px; padding: 10px; line-height: 0;
}
.qrinline__code { display: block; width: 108px; }
.qrinline__code svg { width: 100%; height: auto; display: block; }
.qrblock__hint { font-size: 11px; color: var(--ink-3); margin: 0; }
.qrblock:hover .qrblock__hint { color: var(--ink-2); }

/* --- QR agrandi --- */
.qrmodal {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(6, 7, 8, .9);
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
}
.qrmodal[hidden] { display: none; }
.qrmodal__card {
  background: #fff; border-radius: 6px; padding: 20px 18px 18px;
  width: min(100%, 420px); text-align: center;
  display: flex; flex-direction: column; gap: 14px;
}
.qrmodal__lead { margin: 0; font-size: 15px; font-weight: 600; color: #141210; }
.qrmodal__code { line-height: 0; }
.qrmodal__code svg { width: 100%; height: auto; display: block; }
.qrmodal__url { margin: 0; font-size: 13px; color: #55504B; overflow-wrap: anywhere; }
.qrmodal__close {
  min-height: 48px; border: 0; border-radius: 3px;
  background: #141210; color: #fff; font-size: 15px; font-weight: 600;
}
.qr-open {
  display: inline-flex; align-items: center; gap: 7px;
  background: none; border: 0; padding: 8px 0; min-height: 44px;
  color: var(--ink-2); font-size: 13px;
}
.qr-open:hover { color: var(--ink); }

/* --- recherche par selfie --- */
.consent {
  display: flex; gap: 12px; align-items: flex-start; cursor: pointer;
  padding: 14px 15px; border-radius: 3px;
  background: var(--raised); border: 1px solid var(--line);
}
.consent input { width: 21px; height: 21px; flex: none; margin: 1px 0 0; accent-color: var(--brand); }
.consent span { font-size: 13.5px; line-height: 1.45; color: var(--ink-2); }

/* Bouton en attente de consentement : le champ est désactivé, l'apparence
   doit le dire avant que le doigt ne parte. */
.btn.is-off { background: #2A2C30; color: #5C6167; cursor: not-allowed; }

.fine { color: var(--ink-3); font-size: 12.5px; line-height: 1.55; }
.fine p { margin: 0 0 7px; color: var(--ink-2); }
.fine ul { margin: 0; padding-left: 17px; }
.fine li { margin-bottom: 5px; }
.fine b { color: var(--ink-2); }

.ring {
  width: 34px; height: 34px; border-radius: 50%; display: block;
  border: 2px solid var(--line-2); border-top-color: var(--brand);
  animation: spin 900ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ring { animation-duration: 3s; } }

/* Entrée depuis la galerie */
.selfie-cta {
  display: flex; align-items: center; gap: 13px;
  text-decoration: none; color: inherit; margin-bottom: 14px;
}
.selfie-cta svg { flex: none; color: var(--brand); }
.selfie-cta b { display: block; font-size: 14.5px; color: var(--ink); }
.selfie-cta b + span { font-size: 12px; color: var(--ink-3); line-height: 1.4; }
.selfie-cta .chev { margin-left: auto; color: var(--ink-3); }

/* --- pages légales --- */
.legal { padding: clamp(34px, 6vw, 64px) 20px clamp(60px, 8vw, 96px); }
.legal__wrap { max-width: 740px; margin: 0 auto; }
.legal h1 {
  font-family: var(--serif); font-size: clamp(32px, 6vw, 46px);
  line-height: 1.05; letter-spacing: -.015em; margin: 0;
}
.legal__intro { color: var(--ink-2); font-size: 15px; line-height: 1.6; margin: 14px 0 0; max-width: 60ch; }
.legal section { margin-top: 38px; padding-top: 26px; border-top: 1px solid var(--line); }
.legal h2 {
  font-family: var(--sans); font-size: 12px; font-weight: 600;
  letter-spacing: .13em; text-transform: uppercase; color: var(--brand); margin: 0 0 14px;
}
.legal p { margin: 0 0 12px; font-size: 14.5px; line-height: 1.65; color: var(--ink-2); }
.legal p:last-child { margin-bottom: 0; }
.legal b { color: var(--ink); font-weight: 600; }
.legal a { text-decoration: underline; text-underline-offset: 2px; }
.legal code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px;
  background: var(--raised); border: 1px solid var(--line); border-radius: 3px; padding: 1px 5px;
}

/* Deux colonnes tant qu'il y a la place, empilé sur téléphone. */
.legal .fiche { display: grid; grid-template-columns: 200px 1fr; gap: 10px 22px; margin: 0 0 12px; }
.legal .fiche dt { font-size: 12.5px; color: var(--ink-3); line-height: 1.5; }
.legal .fiche dd { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }
@media (max-width: 600px) {
  .legal .fiche { grid-template-columns: 1fr; gap: 3px 0; }
  .legal .fiche dd { margin-bottom: 12px; }
}

/* Un trou visible vaut mieux qu'une mention inventée. */
.acompleter {
  color: #D98B7A; background: #251A17; border: 1px dashed #4A2F28;
  border-radius: 3px; padding: 1px 7px; font-size: 13px;
}

.legal__maj { margin-top: 38px; font-size: 12px; color: var(--ink-3); }
.legal__nav {
  margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 13px;
}
.legal__nav a { color: var(--ink-3); text-decoration: none; }
.legal__nav a:hover { color: var(--ink-2); }

/* --- liens légaux de bas de page --- */
.legales {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 3px 15px;
  margin: 8px 0 0; font-size: 11px; line-height: 1.5;
}
.legales a { color: var(--ink-3); text-decoration: none; }
.legales a:hover { color: var(--ink-2); }
