/* ═══════════════════════════════════════════════════════════════════════════
   Socle visuel des pages NATIVES (profil / entreprise / offre).

   Même parti pris que `watch.html` : fond noir, verre dépoli, typo système.
   Ces pages sont servies en statique puis hydratées depuis Firestore REST —
   aucun framework, aucune dépendance externe (le CSP hosting n'autorise rien).

   ⚠️ Fichier PARTAGÉ par profile.html, company.html et job.html : toute
   nouvelle règle doit rester générique. Le spécifique va dans la page.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --accent: #f4b78a;
  --accent-2: #e79b6d;
  --bg: #050506;
  --ink: #ffffff;
  --ink-2: rgba(255, 255, 255, .62);
  --ink-3: rgba(255, 255, 255, .40);
  --surface: rgba(255, 255, 255, .055);
  --surface-hi: rgba(255, 255, 255, .10);
  --line: rgba(255, 255, 255, .09);
  --radius-tile: 20px;
  --radius-card: 24px;
  --gutter: 20px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0; min-height: 100%;
  background: var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  font-size: 16px; line-height: 1.5;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
svg { display: block; }
img { max-width: 100%; }
.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }

/* ── Fond : la photo du sujet, floutée à l'extrême ────────────────────────── */
#backdrop {
  position: fixed; inset: -10% -10% auto -10%; height: 62vh; z-index: 0;
  background-size: cover; background-position: center;
  filter: blur(70px) saturate(1.5) brightness(.5); transform: scale(1.2);
  opacity: 0; transition: opacity .6s ease;
}
#backdrop.on { opacity: 1; }
#backdrop::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(5, 5, 6, .35), var(--bg) 92%);
}

/* ── Barre haut ───────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 20; padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.ibtn {
  width: 42px; height: 42px; border-radius: 50%; border: none; cursor: pointer; color: #fff;
  background: rgba(30, 30, 32, .5); display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: transform .12s, background .2s; flex: 0 0 auto;
}
.ibtn:hover { background: rgba(60, 60, 64, .62); }
.ibtn:active { transform: scale(.92); }
.brand { display: flex; align-items: center; gap: 8px; }
.brand img { height: 22px; width: auto; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .6)); }
.brand span { font-weight: 800; font-size: 16px; letter-spacing: -.02em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .6); }
.recruiter-btn {
  background: #fff; color: #111; font-weight: 800; font-size: 13.5px; padding: 10px 16px;
  border-radius: 22px; box-shadow: 0 4px 14px rgba(0, 0, 0, .3); white-space: nowrap; cursor: pointer;
}
.recruiter-btn:active { transform: scale(.96); }
@media (max-width: 520px) { .recruiter-btn { display: none; } }

/* ── Trame ────────────────────────────────────────────────────────────────── */
.page { position: relative; z-index: 1; max-width: 1080px; margin: 0 auto;
  padding: 0 var(--gutter) 96px; }
.reveal { opacity: 0; transform: translateY(10px); animation: rise .5s cubic-bezier(.2, .7, .3, 1) forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }
.hidden { display: none !important; }

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero { display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 28px 0 34px; }
.hero.left { align-items: flex-start; text-align: left; }

/* Le « grand rond » : photo de profil, ou initiale en dégradé si absente. */
.orb {
  width: 132px; height: 132px; border-radius: 50%; object-fit: cover; display: block;
  background: #17171a; box-shadow: 0 18px 50px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .12);
}
.orb.fallback { display: flex; align-items: center; justify-content: center;
  font-size: 50px; font-weight: 800; letter-spacing: -.02em; color: #fff;
  background: linear-gradient(140deg, #7a5cff, var(--accent-2)); }
/* Variante entreprise : carré aux coins très arrondis (squircle). */
.orb.square { border-radius: 30px; }
.orb.square.fallback { font-size: 44px; background: linear-gradient(140deg, #2f80ed, var(--accent-2)); }
.orb.contain { object-fit: contain; background: #fff; padding: 14px; }
@media (max-width: 560px) {
  .orb { width: 106px; height: 106px; }
  .orb.fallback { font-size: 40px; }
  .orb.square { border-radius: 24px; }
}

.hero h1 {
  margin: 20px 0 0; font-size: clamp(28px, 6vw, 40px); font-weight: 800;
  letter-spacing: -.03em; line-height: 1.08;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center;
}
.hero.left h1 { justify-content: flex-start; }
.hero .role { margin: 10px 0 0; font-size: clamp(15px, 2.6vw, 17px); color: var(--ink-2); font-weight: 500; }
.hero .handle { margin: 6px 0 0; font-size: 14px; color: var(--ink-3); font-weight: 600; }
.verified { width: 22px; height: 22px; flex: 0 0 auto; }
/* Membre Premium : l'étoile de Dalia, blanche, dans un carré arrondi doré (ProStarBadge de l'app). */
.pro-star { width: 21px; height: 21px; border-radius: 7px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #D08A57, #A9633A); border: .6px solid rgba(255,255,255,.1); }
.pro-star svg { width: 13px; height: 13px; }
.pro-star.hidden { display: none; }

/* ── Pastilles d'infos ────────────────────────────────────────────────────── */
.pills { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 18px 0 0; }
.hero.left .pills { justify-content: flex-start; }
.pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, .86); white-space: nowrap;
}
.pill svg { width: 14px; height: 14px; opacity: .7; }
.pill b { font-weight: 800; }

/* ── Boutons ──────────────────────────────────────────────────────────────── */
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 26px 0 0; }
.hero.left .cta-row { justify-content: flex-start; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px 24px; border-radius: 999px; border: 1px solid transparent; cursor: pointer;
  font: inherit; font-size: 15px; font-weight: 700; letter-spacing: -.01em;
  transition: transform .12s ease, background .2s ease, border-color .2s ease;
}
.btn:active { transform: scale(.97); }
.btn svg { width: 17px; height: 17px; }
.btn.primary { background: #fff; color: #0b0b0d; font-weight: 800;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .38); }
.btn.primary:hover { background: #f0f0f2; }
.btn.ghost { background: var(--surface); color: #fff; border-color: var(--line); }
.btn.ghost:hover { background: var(--surface-hi); }
.btn:disabled { cursor: default; }
.btn:disabled:active { transform: none; }

/* Bouton « Suivre » : l'attente est signalée SUR le bouton (l'icône tourne),
   sans changer sa largeur — un bouton qui rétrécit fait sauter la ligne. */
.btn.is-busy { pointer-events: none; opacity: .72; }
/* Plus d'icône qui tourne : les boutons basculent tout de suite (cf. SL.mountFollow). */
.btn.is-done { color: var(--accent); border-color: rgba(244, 183, 138, .34);
  background: rgba(244, 183, 138, .1); opacity: 1; }
/* « Abonné » touché une fois : la confirmation du désabonnement, sur place. */
.btn.is-armed { color: #ff8a80; border-color: rgba(255, 138, 128, .4); background: rgba(255, 138, 128, .08); }

/* Action secondaire qui se réduit à son icône sur téléphone : à trois boutons,
   la rangée passe sinon à la ligne et l'action principale perd son évidence.
   Le libellé reste dans le DOM (lecteurs d'écran, desktop) — `aria-label`
   couvre l'état replié. */
@media (max-width: 560px) {
  .btn.icon-sm { padding: 13px; border-radius: 50%; }
  .btn.icon-sm > span { display: none; }
  /* `lead-first` : sur téléphone, la première action prend toute la largeur et
     les secondaires se rangent dessous. Trois boutons ne tiennent pas sur une
     ligne de 390 px ; les laisser retomber au hasard faisait passer l'action
     principale pour un reliquat. Là, la hiérarchie est lisible. */
  .cta-row.lead-first > .btn:first-child { flex: 1 1 100%; }
}

/* Message d'échec sous la rangée de boutons (plafond atteint, réseau…). */
.follow-note { margin: 12px 0 0; font-size: 13.5px; color: #ffb4a2; }

/* ── Sections ─────────────────────────────────────────────────────────────── */
.section { margin: 44px 0 0; }
.section > h2 {
  margin: 0 0 16px; font-size: 13px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-3);
}
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card);
  padding: 22px;
}
/* Longueur de ligne : au-delà de ~75 caractères, l'œil perd la ligne suivante.
   La carte garde toute la largeur, c'est le TEXTE qu'on borne. */
.card > .prose, .card > .bullets { max-width: 74ch; }
.prose { font-size: 15.5px; line-height: 1.62; color: rgba(255, 255, 255, .88); }
.prose p { margin: 0 0 .7em; } .prose p:last-child { margin-bottom: 0; }
.prose strong { font-weight: 800; }
.prose ul, .prose ol { margin: .4em 0; padding-left: 1.25em; }
.prose li { margin: .2em 0; }
/* Repli propre des textes longs : on plafonne puis on déplie. */
.clampable { position: relative; max-height: 220px; overflow: hidden; }
.clampable::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 90px; pointer-events: none;
  background: linear-gradient(to top, #0b0b0d, transparent);
}
.clampable.open { max-height: none; }
.clampable.open::after { display: none; }
.more {
  margin-top: 12px; font-size: 14px; font-weight: 700; color: var(--accent);
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px; background: none;
  border: none; padding: 0; font-family: inherit;
}

/* Listes à puces « point discret » (responsabilités, avantages…). */
.bullets { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.bullets li { display: flex; gap: 12px; font-size: 15px; line-height: 1.55;
  color: rgba(255, 255, 255, .88); }
.bullets li::before { content: ""; flex: 0 0 auto; width: 6px; height: 6px; margin-top: 9px;
  border-radius: 50%; background: var(--accent); }

/* Étiquettes de compétences. */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 8px 13px; border-radius: 11px; background: var(--surface);
  border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, .84); }

/* ── Grille de contenus : tuiles aux coins arrondis, SANS pagination ──────── */
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.grid.wide { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
@media (max-width: 560px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .grid.wide { grid-template-columns: 1fr; } }

.tile {
  /* 4/5 et non 9/16 : à trois colonnes, une tuile en 9/16 fait ~2× la hauteur
     d'une vignette et la grille s'étire sans fin. Le reste du site est déjà en
     4/5 (styles.css) — c'était cette grille l'exception. Le cadrage recadre le
     format vertical, ce qui est le propre d'une vignette. */
  position: relative; display: block; aspect-ratio: 4 / 5; border-radius: var(--radius-tile);
  overflow: hidden; background: #131316; border: 1px solid var(--line);
  transition: transform .22s cubic-bezier(.2, .7, .3, 1), border-color .22s;
}
.tile:hover { transform: translateY(-3px) scale(1.012); border-color: rgba(255, 255, 255, .22); }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .veil { position: absolute; inset: auto 0 0 0; height: 62%; pointer-events: none;
  background: linear-gradient(to top, rgba(0, 0, 0, .78), transparent); }
.tile .cap { position: absolute; left: 10px; right: 10px; bottom: 9px; font-size: 12.5px;
  font-weight: 700; line-height: 1.3; letter-spacing: -.01em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile .mark { position: absolute; top: 9px; right: 9px; background: rgba(0, 0, 0, .5);
  border-radius: 7px; padding: 4px; backdrop-filter: blur(6px); }
.tile .mark svg { width: 13px; height: 13px; }

/* Tuile « offre » (page entreprise) : format carte, pas 9/16. */
.otile {
  display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: var(--radius-card);
  background: var(--surface); border: 1px solid var(--line);
  transition: transform .22s cubic-bezier(.2, .7, .3, 1), background .22s, border-color .22s;
}
.otile:hover { transform: translateY(-3px); background: var(--surface-hi);
  border-color: rgba(255, 255, 255, .2); }
.otile .t { font-size: 16px; font-weight: 800; letter-spacing: -.015em; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.otile .m { font-size: 13px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 4px 8px; }
/* Séparateur entre méta-données, sans l'ajouter en fin de ligne. */
.otile .m > span + span::before { content: "·"; margin-right: 8px; opacity: .5; }

/* ── Pied : passerelle vers l'app ─────────────────────────────────────────── */
.gateway { margin: 40px 0 0; padding: 30px 24px; border-radius: var(--radius-card);
  background: var(--surface); border: 1px solid var(--line); text-align: center; }
.gateway h3 { margin: 0 0 8px; font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.gateway p { margin: 0 0 20px; font-size: 14.5px; color: var(--ink-2); }
.foot { margin: 34px 0 0; text-align: center; font-size: 12.5px; color: var(--ink-3); }
.foot a { text-decoration: underline; }

/* ── Chargement / erreur ──────────────────────────────────────────────────── */
.center { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; gap: 18px;
  align-items: center; justify-content: center; text-align: center; padding: 28px; background: var(--bg); }
.center .logo { display: flex; align-items: center; gap: 9px; }
.center .logo img { height: 26px; }
.center .logo span { font-weight: 800; font-size: 19px; }
.spinner { width: 34px; height: 34px; border: 3px solid rgba(255, 255, 255, .22); border-top-color: #fff;
  border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .reveal, #backdrop { animation: none; opacity: 1; transform: none; transition: none; }
  .tile:hover, .otile:hover { transform: none; }
}
