/* PORTFOLIO — charte minimale.
   Angles vifs partout sur les boîtes : cartes, panneaux et tuiles d'icône.
   Seuls les éléments cliquables de filtrage gardent leur forme de pilule,
   qui les distingue au premier coup d'œil du contenu. */

.pf-hero { text-align: center; padding: 3.5rem 0 1rem; }
.pf-hero .section-label { display: block; }
.pf-title {
  font-size: clamp(28px, 4.5vw, 46px); font-weight: 600;
  letter-spacing: -0.03em; line-height: 1.08;
  margin: 0.5rem 0 1rem;
}
.pf-sub {
  max-width: 620px; margin: 0 auto;
  color: var(--text2); font-size: 16px; line-height: 1.7; font-weight: 300;
}

/* Barre de filtres */
.pf-filter {
  border: 1px solid var(--border); border-radius: 0;
  padding: 1.5rem 1.75rem; margin: 2.5rem 0 2.5rem; background: var(--bg2);
}
.pf-filter-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--text3); font-family: 'DM Mono', monospace;
  text-transform: uppercase; letter-spacing: 0.09em; margin-bottom: 1.1rem;
}
.pf-filter-head svg { width: 15px; height: 15px; }
.pf-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pf-chip {
  font: inherit; font-size: 12.5px; line-height: 1;
  padding: 7px 13px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text2);
  cursor: pointer; transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.pf-chip:hover { border-color: var(--border2); color: var(--text); }
.pf-chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }

/* Grille de cartes */
.pf-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding-bottom: 4rem; }
.pf-card {
  display: flex; flex-direction: column;
  scroll-margin-top: 76px;
  border: 1px solid var(--border); border-radius: 0;
  padding: 1.5rem; background: var(--bg2);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease, border-color 0.2s ease;
}
.pf-card:hover {
  transform: translateY(-8px) scale(1.02); border-color: var(--border2);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.14);
}
@media (prefers-reduced-motion: reduce) {
  .pf-card { transition: box-shadow 0.2s ease, border-color 0.2s ease; }
  .pf-card:hover { transform: none; }
}
.pf-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.1rem; }
.pf-ic {
  width: 40px; height: 40px; border-radius: 0; flex: none;
  display: grid; place-items: center; background: var(--bg3); color: var(--text);
  transition: background 0.2s ease, color 0.2s ease;
}
.pf-card:hover .pf-ic { background: var(--text); color: var(--bg); }
.pf-ic svg { width: 20px; height: 20px; }
.pf-co { font-size: 12px; color: var(--text3); font-family: 'DM Mono', monospace; margin-bottom: 0.4rem; }
.pf-card-title { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; margin-bottom: 0.6rem; }
.pf-desc { font-size: 14px; color: var(--text2); line-height: 1.75; font-weight: 400; margin-bottom: 1.2rem; flex: 1; }
.pf-points { list-style: none; display: flex; flex-direction: column; gap: 0.65rem; margin-bottom: 1.2rem; flex: 1; }
.pf-points li { position: relative; padding-left: 1.05rem; font-size: 14px; color: var(--text2); line-height: 1.6; font-weight: 400; }
.pf-points li::before { content: ''; position: absolute; left: 2px; top: 0.62em; width: 5px; height: 5px; border-radius: 50%; background: var(--text3); }

/* Stack de la carte : un sous-titre et une énumération en texte.
   Les pilules faisaient concurrence aux boutons de filtre, qui eux se cliquent. */
.pf-stack { margin-top: 0.2rem; padding-top: 0.9rem; border-top: 1px solid var(--border); }
.pf-stack-lbl {
  display: block; margin-bottom: 4px;
  font-family: 'DM Mono', monospace; font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.09em; color: var(--text3);
}
.pf-stack-list { font-size: 12.5px; color: var(--text2); line-height: 1.65; }

.pf-empty { grid-column: 1 / -1; text-align: center; color: var(--text3); font-size: 14px; padding: 2rem 0; }

/* Nav rapide entre les deux sections (visibilité) */
.pf-quicknav { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 1.75rem; }
.pf-qn {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 500; text-decoration: none; color: var(--text2);
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--bg2); transition: color 0.15s, border-color 0.15s;
}
.pf-qn:hover { border-color: var(--border2); color: var(--text); }
.pf-qn b { color: var(--text3); font-weight: 500; }
.pf-qn-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }

/* Bloc Open source distinct (panneau grisé + cartes blanches) */
.pf-os {
  background: var(--bg3); border: 1px solid var(--border); border-radius: 0;
  padding: 2.75rem 2rem 3rem; margin: 1rem 0 4rem;
}
.pf-os .pf-grid--gh { padding: 2rem 0 0; }
.pf-os-mark { display: inline-grid; place-items: center; color: var(--text); margin-bottom: 0.6rem; }
.pf-os-mark svg { width: 26px; height: 26px; }

/* Section Open source / GitHub */
.pf-section-head { text-align: center; padding: 0; }
.pf-title--sm { font-size: clamp(22px, 3vw, 32px); margin: 0.75rem 0 0.75rem; }
.pf-grid--gh { padding-top: 2rem; }
.pf-link {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 1.1rem;
  font-family: 'DM Mono', monospace; font-size: 12.5px; font-weight: 500;
  color: var(--text); text-decoration: none; transition: gap 0.2s;
}
.pf-link svg { width: 14px; height: 14px; }
.pf-link:hover { gap: 10px; }
.pf-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-top: 1.1rem; }
.pf-links .pf-link { margin-top: 0; }

/* Le schéma est l'action la plus intéressante de la carte — et la seule qui reste
   sur le site. Il porte donc un bouton noir plein, quand « Voir le code » (sortant)
   reste un lien de texte : deux poids, deux intentions. */
.pf-link--schema {
  position: relative;                       /* ancre l'infobulle */
  padding: 8px 14px; border-radius: 0;      /* angles vifs : un bouton, pas une pilule */
  background: var(--text); border: 1px solid var(--text);
  color: var(--bg2);
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease,
              transform 0.18s ease, box-shadow 0.18s ease;
}
.pf-link--schema:hover { gap: 7px; }                    /* la flèche mène le mouvement, pas l'espacement */
.pf-link--schema::after {
  content: "→"; font-size: 13px; line-height: 1;
  animation: pfSchemaNudge 2.2s ease-in-out infinite;   /* invite au clic, discrète */
}
.pf-link--schema:hover, .pf-link--schema:focus-visible {
  background: var(--bg2); color: var(--text);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16);
}

/* Infobulle au survol — même procédé que .hero-cred et .lang-flag.
   ::before et non ::after : la flèche occupe déjà ::after. Le bouton ne porte
   qu'un mot, l'infobulle dit la phrase entière. */
.pf-link--schema::before {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 9px); left: 50%;
  transform: translateX(-50%);
  width: max-content; max-width: 240px;
  padding: 7px 11px; border-radius: var(--r);
  background: var(--text); color: var(--bg2);
  font-family: 'DM Sans', sans-serif; font-size: 11.5px; font-weight: 400;
  letter-spacing: 0; line-height: 1.45; text-align: center;
  opacity: 0; pointer-events: none; z-index: 20;
  transition: opacity 0.15s ease;
}
.pf-link--schema:hover::before, .pf-link--schema:focus-visible::before { opacity: 1; }
/* la carte survolée passe devant ses voisines, sinon l'infobulle se fait couper */
.pf-card:hover { z-index: 3; }
@media (max-width: 760px) { .pf-link--schema::before { display: none; } }
.pf-link--schema:hover::after,
.pf-link--schema:focus-visible::after { animation: none; transform: translateX(3px); }
@keyframes pfSchemaNudge {
  0%, 100% { transform: translateX(0); }
  55%      { transform: translateX(3px); }
}
@media (prefers-reduced-motion: reduce) {
  .pf-link--schema { transition: background 0.15s, color 0.15s; }
  .pf-link--schema::after { animation: none; }
  .pf-link--schema:hover { transform: none; box-shadow: none; }
}

.pf-more { margin: -2rem 0 3rem; font-size: 13.5px; }
/* Dans le panneau open source la grille n'a pas de marge basse : la remontée
   de -2rem faisait chevaucher ce lien avec la dernière carte. */
.pf-os .pf-more { margin: 1.75rem 0 0; }
.pf-more a {
  color: var(--text2); text-decoration: none;
  border-bottom: 1px solid var(--border2); padding-bottom: 1px;
  transition: color 0.15s, border-color 0.15s;
}
.pf-more a::after { content: " →"; }
.pf-more a:hover { color: var(--text); border-color: var(--text3); }

@media (max-width: 900px) { .pf-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) {
  .pf-grid { grid-template-columns: 1fr; }
  .pf-filter { padding: 1.25rem; }
}


/* ── Hiérarchie & couleur ─────────────────────────────────────────────── */

/* Chiffre mis en avant. Seules les cartes dont le chiffre est réellement
   sourcé en portent un : elles deviennent de fait les têtes de grille. */
.pf-metric {
  font-family: 'DM Mono', monospace; font-size: 26px; font-weight: 500;
  letter-spacing: -0.02em; color: var(--text); line-height: 1;
  margin: 0.25rem 0 0.75rem;
}
.pf-metric span {
  display: block; margin-top: 6px;
  font-size: 10px; font-weight: 500; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text3);
}

/* Carte de tête : double largeur, titre plus grand */
.pf-card--lead { grid-column: span 2; }
.pf-card--lead .pf-card-title { font-size: 19px; }
@media (max-width: 900px) { .pf-card--lead { grid-column: span 2; } }
@media (max-width: 620px) { .pf-card--lead { grid-column: span 1; } }
