/* ============================================================================
   TicTask — Portfolio (page privée, hors index)
   ----------------------------------------------------------------------------
   Prolonge la charte du site vitrine (css/variables.css + css/styles.css) d'un
   cran vers le spectacle, sans jamais inventer de couleur : tout vient des
   tokens. Le bleu reste rare — il ne sert qu'aux moments forts, aux chiffres et
   à l'état actif d'un filtre.

   Toutes les animations ne portent que sur `transform` et `opacity`, et sont
   coupées d'un bloc par `prefers-reduced-motion` en fin de fichier.

   Ordre : en-tête → hero → filtres → grille → carte → citation → résumé
   → carte phare → journée animée → principes → responsive → reduced-motion.
   ========================================================================== */

/* ---------------------------------------------------------------- En-tête -- */
/* Le hero de cette page est en bleu nuit, alors que l'en-tête reste transparent
   tant qu'on n'a pas défilé : la navigation sombre du site s'y effacerait, et
   les trois barres du bouton menu (var(--encre)) deviendraient invisibles.
   On éclaircit donc tout l'en-tête au-dessus du hero, et on rend la main au
   style du site dès que .is-scrolled apparaît (posée par main.js). */
.page-portfolio .pf-logo--sombre { display: none; }

.page-portfolio .site-header.is-scrolled .pf-logo--clair { display: none; }
.page-portfolio .site-header.is-scrolled .pf-logo--sombre { display: block; }

.page-portfolio .site-header:not(.is-scrolled) .nav__links a { color: var(--texte-nuit); }
.page-portfolio .site-header:not(.is-scrolled) .nav__links a:hover { color: #fff; }
.page-portfolio .site-header:not(.is-scrolled) .burger i { background: var(--texte-nuit); }

/* ------------------------------------------------------------------ Hero -- */
.pf-hero {
  position: relative;
  overflow: hidden;
  padding-top: calc(var(--header-h) + clamp(2.5rem, 8vh, 5rem));
  padding-bottom: clamp(3rem, 8vw, 5.5rem);
  background: var(--bleu-nuit);
  color: var(--texte-nuit);
}

/* Halo bleu très diffus, qui respire lentement : le seul « effet » du hero.
   Pas de dégradé criard — une lueur unique, décentrée, qui donne de la
   profondeur au bleu nuit. */
.pf-hero__glow {
  position: absolute;
  top: -30%;
  right: -10%;
  width: min(70vw, 780px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(91, 141, 239, .30) 0%, rgba(91, 141, 239, 0) 68%);
  pointer-events: none;
  animation: pf-respire 14s var(--ease) infinite;
}
@keyframes pf-respire {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); opacity: .9; }
  50%      { transform: translate3d(-3%, 4%, 0) scale(1.12); opacity: 1; }
}

.pf-hero__inner { position: relative; }

.pf-hero__title {
  font-weight: 800;
  font-size: clamp(2.4rem, 1.4rem + 4.6vw, 4.4rem);
  line-height: 1.02;
  color: #fff;
  margin-top: .35rem;
}
.pf-hero__title span,
.pf-hero__title em { display: block; font-style: normal; }
.pf-hero__title em { color: var(--bleu-vif); }

.pf-hero__lead {
  margin-top: 1.4rem;
  color: var(--texte-nuit-doux);
  max-width: 58ch;
}

/* Montée à l'ouverture, ligne après ligne. `--pas` donne le rang. */
.pf-monte { animation: pf-monte .85s var(--ease-out) both; animation-delay: calc(var(--pas, 0) * .11s); }
@keyframes pf-monte {
  from { opacity: 0; transform: translate3d(0, 26px, 0); }
  to   { opacity: 1; transform: none; }
}

.pf-stats {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1.5rem, 5vw, 3.5rem);
  margin-top: clamp(2.25rem, 5vw, 3.25rem);
  padding-top: clamp(1.5rem, 4vw, 2.25rem);
  border-top: 1px solid var(--ligne-nuit);
}
.pf-stat { display: flex; flex-direction: column; gap: .3rem; }
.pf-stat__value {
  font-family: var(--titre);
  font-weight: 800;
  font-size: clamp(2rem, 1.4rem + 2vw, 2.9rem);
  line-height: 1;
  color: var(--bleu-vif);
  font-variant-numeric: tabular-nums;
}
.pf-stat__label { font-size: .93rem; color: var(--texte-nuit-doux); max-width: 22ch; }

/* --------------------------------------------------------------- Filtres -- */
.pf-filtres-section { padding-bottom: clamp(1.5rem, 4vw, 2.5rem); }
.pf-filtres { display: flex; flex-wrap: wrap; gap: .6rem; }

.pf-chip {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-height: 44px;
  padding: .6rem 1.1rem;
  border: 1.5px solid var(--ligne);
  border-radius: var(--r-pill);
  background: var(--blanc);
  color: var(--ardoise);
  font-weight: 500;
  font-size: .95rem;
  text-align: left;
  transition: color .25s, border-color .25s, background-color .25s,
              transform .3s var(--ease), box-shadow .3s var(--ease);
}
.pf-chip:hover { color: var(--encre); border-color: var(--acier); transform: translateY(-2px); }
.pf-chip.is-active {
  background: var(--bleu);
  border-color: var(--bleu);
  color: #fff;
  box-shadow: var(--ombre-bleu);
}

.pf-chip__n {
  font-family: var(--mono);
  font-size: .74rem;
  font-weight: 500;
  padding: .12rem .45rem;
  border-radius: var(--r-pill);
  background: var(--brume);
  color: var(--ardoise);
  font-variant-numeric: tabular-nums;
  transition: background-color .25s, color .25s;
}
.pf-chip.is-active .pf-chip__n { background: rgba(255, 255, 255, .22); color: #fff; }

.pf-compteur { margin-top: 1.4rem; color: var(--acier); }

/* ---------------------------------------------------------------- Grille -- */
.pf-grille {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: clamp(1rem, 2.2vw, 1.6rem);
  /* Pas d'align-items: start — les cartes d'une rangée s'étirent à la même
     hauteur, et `margin-top: auto` sur .pf-wow cale tous les résumés sur la
     même ligne de base. Sans cela, chaque carte s'arrête où elle veut. */
}

.pf-carte[hidden] { display: none; }

/* -------------------------------------------------------------- Invitation - */
/* L'invitation à cliquer, juste au-dessus de l'outil principal. C'est la
   promesse de la page : elle prend toute la largeur et elle est bleue.
   La doctrine dit « le bleu est rare, donc il marque » — c'est précisément ici
   qu'on le dépense. */
.pf-invite {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(1.25rem, 4vw, 3rem);
  margin-bottom: clamp(1.5rem, 4vw, 2.4rem);
  padding: clamp(1.6rem, 4vw, 2.6rem) clamp(1.5rem, 4vw, 2.8rem);
  background: var(--bleu);
  border-radius: var(--r-lg);
  box-shadow: var(--ombre-bleu);
  color: #fff;
}

/* Lueur blanche très diffuse, décentrée, qui respire : elle empêche l'aplat
   bleu de paraître plat sur une grande surface. */
.pf-invite__halo {
  position: absolute;
  top: -60%;
  left: 8%;
  width: min(55%, 460px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .20) 0%, rgba(255, 255, 255, 0) 70%);
  pointer-events: none;
  animation: pf-respire 12s var(--ease) infinite;
}

.pf-invite__contenu { position: relative; }

.pf-invite__sur { color: rgba(255, 255, 255, .72); margin-bottom: .55rem; }

.pf-invite__texte {
  font-family: var(--titre);
  font-weight: 800;
  font-size: clamp(1.35rem, 1.02rem + 1.6vw, 2.15rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  max-width: 30ch;
}
.pf-invite__texte em { font-style: normal; color: var(--bleu-ciel); }

/* -- La petite scène : un curseur vient cliquer une carte ------------------ */
.pf-invite__scene { position: relative; flex: none; width: 150px; height: 112px; }

.pf-invite__carte {
  position: absolute;
  left: 12px; top: 14px;
  width: 108px; height: 68px;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, .55);
  background: rgba(255, 255, 255, .10);
  animation: pf-carte-clic 3.6s var(--ease-out) infinite;
}
@keyframes pf-carte-clic {
  0%, 52%   { background: rgba(255, 255, 255, .10); transform: scale(1); }
  60%       { background: rgba(255, 255, 255, .28); transform: scale(.97); }
  74%, 100% { background: rgba(255, 255, 255, .10); transform: scale(1); }
}

/* L'onde part du point exact où la pointe de la flèche se pose. */
.pf-invite__onde {
  position: absolute;
  left: 52px; top: 40px;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid #fff;
  opacity: 0;
  animation: pf-onde 3.6s var(--ease-out) infinite;
}
@keyframes pf-onde {
  0%, 53%   { transform: scale(.3); opacity: 0; }
  60%       { transform: scale(.7); opacity: .85; }
  85%, 100% { transform: scale(3.4); opacity: 0; }
}

.pf-invite__fleche {
  position: absolute;
  left: 0; top: 0;
  fill: #fff;
  filter: drop-shadow(0 3px 8px rgba(14, 35, 72, .45));
  animation: pf-vise 3.6s var(--ease-out) infinite;
}
@keyframes pf-vise {
  0%        { transform: translate3d(110px, 86px, 0) scale(1); opacity: 0; }
  14%       { opacity: 1; }
  46%, 52%  { transform: translate3d(48px, 36px, 0) scale(1); opacity: 1; }
  58%       { transform: translate3d(48px, 36px, 0) scale(.82); opacity: 1; }
  66%, 88%  { transform: translate3d(48px, 36px, 0) scale(1); opacity: 1; }
  100%      { transform: translate3d(110px, 86px, 0) scale(1); opacity: 0; }
}

/* Cascade : `--i` est posé par portfolio.js selon le rang de la carte VISIBLE.
   Au filtrage, la classe is-visible est retirée puis remise, ce qui rejoue la
   cascade sur la nouvelle sélection. */
html.has-js .pf-carte { transition-delay: calc(var(--i, 0) * 65ms); }

.pf-vide { margin-top: 2rem; color: var(--ardoise); font-size: 1.05rem; }

/* ----------------------------------------------------------------- Carte -- */
.pf-carte { display: flex; }

.pf-carte__inner {
  display: flex;
  flex-direction: column;
  gap: .85rem;
  width: 100%;
  height: 100%;
  padding: clamp(1.4rem, 3vw, 2rem);
  background: var(--blanc);
  border: 1px solid var(--ligne);
  border-radius: var(--r-lg);
  box-shadow: var(--ombre-s);
  transition: transform .4s var(--ease-out), box-shadow .4s var(--ease-out),
              border-color .3s;
}
.pf-carte:hover .pf-carte__inner {
  transform: translateY(-5px);
  box-shadow: var(--ombre-m);
  border-color: var(--bleu-ciel);
}

.pf-carte__secteur { color: var(--acier); }

.pf-carte__titre {
  font-family: var(--titre);
  font-weight: 700;
  font-size: clamp(1.25rem, 1.05rem + .6vw, 1.5rem);
  line-height: 1.15;
}
.pf-carte__titre em { font-style: normal; color: var(--bleu); }

.pf-carte__desc { color: var(--ardoise); font-size: 1rem; }

/* -------------------------------------------------------------- Citation -- */
/* La phrase du client : une voix, pas une description. Guillemet ouvrant en
   gros, très pâle, posé derrière le texte — le filet vertical faisait doublon
   avec le bloc de résumé juste en dessous. */
.pf-gain {
  position: relative;
  margin: .15rem 0 .1rem;
  padding: .1rem 0 .1rem 2.1rem;
  font-style: italic;
  font-size: 1.03rem;
  line-height: 1.5;
  color: var(--encre);
}
.pf-gain::before {
  content: "\201C";                 /* guillemet anglais : la courbe est plus jolie en gros corps */
  position: absolute;
  left: -.1rem;
  top: .34em;
  font-family: var(--titre);
  font-style: normal;
  font-weight: 800;
  font-size: 3.4rem;
  line-height: 0;
  color: var(--bleu-ciel);
  pointer-events: none;
}
.pf-carte:hover .pf-gain::before { color: rgba(44, 102, 224, .22); transition: color .4s var(--ease); }

/* ---------------------------------------------------------------- Résumé -- */
/* Le moment fort. C'est ce que le visiteur doit retenir de la carte : plus gros
   que le corps, semi-gras, et seule tache de bleu du bloc. */
.pf-wow {
  position: relative;
  margin-top: auto;
  padding: 1rem 1.1rem 1rem 2.6rem;
  background: var(--bleu-ciel);
  border-radius: var(--r-sm);
  color: var(--encre);
  font-size: 1.04rem;
  font-weight: 600;
  line-height: 1.45;
}
.pf-wow__marque {
  position: absolute;
  left: 1.05rem;
  top: 1.42rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bleu);
}
/* Battement lent : l'automatisation tourne, même quand personne ne regarde. */
.pf-wow__marque::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--bleu);
  animation: pf-battement 2.8s var(--ease-out) infinite;
}
@keyframes pf-battement {
  0%   { transform: scale(1); opacity: .45; }
  70%  { transform: scale(2.6); opacity: 0; }
  100% { transform: scale(2.6); opacity: 0; }
}

.pf-carte__pied {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  padding-top: 1rem;
  border-top: 1px solid var(--ligne);
}

.pf-tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.pf-tags li {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ardoise);
  background: var(--brume);
  padding: .28rem .6rem;
  border-radius: var(--r-xs);
}

.pf-cta {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-weight: 600;
  font-size: .92rem;
  white-space: nowrap;
}
.pf-cta--attente { color: var(--acier); }
.pf-cta--attente::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--acier);
  opacity: .55;
}
/* État « démo en ligne » — prêt pour la suite : il suffira de remplacer le
   <span class="pf-cta pf-cta--attente"> par un <a class="pf-cta pf-cta--ouvrir">. */
.pf-cta--ouvrir { color: var(--bleu); }
.pf-cta--ouvrir::after { content: "→"; transition: transform .3s var(--ease); }
.pf-cta--ouvrir:hover { color: var(--bleu-fonce); }
.pf-cta--ouvrir:hover::after { transform: translateX(4px); }

.pf-note { margin-top: .2rem; font-size: .84rem; color: var(--acier); }

/* ---------------------------------------------------------- Carte jouable - */
/* Une carte dont la démonstration existe : badge vert, et la carte entière
   devient cliquable. Le lien du pied est étiré sur tout le bloc plutôt que
   d'ajouter un gestionnaire JS — la cible reste un vrai lien, donc utilisable
   au clavier, ouvrable dans un nouvel onglet, et annoncée par un lecteur
   d'écran. */
.pf-carte--jouable .pf-carte__inner { position: relative; }
.pf-carte--jouable .pf-cta--ouvrir::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--r-lg);
}
/* Les tuiles du pied restent au-dessus de la zone étirée : sans cela, elles
   deviendraient inertes au survol et le lien couvrirait leur infobulle. */
.pf-carte--jouable .pf-tags { position: relative; z-index: 1; }

.pf-carte--jouable:hover .pf-carte__inner {
  border-color: var(--bleu);
  box-shadow: var(--ombre-l);
}

/* ------------------------------------------------------------ Carte phare - */
.pf-carte--phare { grid-column: 1 / -1; }

.pf-carte--phare .pf-carte__inner {
  background: var(--bleu-nuit);
  border-color: transparent;
  box-shadow: var(--ombre-l);
  color: var(--texte-nuit);
  gap: 1.1rem;
}
.pf-carte--phare:hover .pf-carte__inner { border-color: transparent; }

.pf-carte__phare-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.pf-carte--phare .pf-carte__secteur { color: var(--texte-nuit-doux); }
.pf-carte--phare .pf-carte__titre { color: #fff; font-size: clamp(1.7rem, 1.2rem + 2.2vw, 2.6rem); font-weight: 800; }
.pf-carte--phare .pf-carte__titre em { color: var(--bleu-vif); }
.pf-carte--phare .pf-carte__desc { color: var(--texte-nuit-doux); max-width: 62ch; }
.pf-carte--phare .pf-carte__pied { border-top-color: var(--ligne-nuit); }
.pf-carte--phare .pf-tags li { background: rgba(255, 255, 255, .07); color: var(--texte-nuit-doux); }

.pf-badge {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .34rem .7rem;
  border-radius: var(--r-pill);
}
.pf-badge--phare { background: var(--bleu); color: #fff; }

.pf-carte--phare .pf-wow {
  background: rgba(91, 141, 239, .14);
  color: #fff;
  font-size: 1.08rem;
}
.pf-carte--phare .pf-wow__marque,
.pf-carte--phare .pf-wow__marque::after { background: var(--bleu-vif); }
.pf-carte--phare .pf-cta--attente { color: var(--texte-nuit-doux); }
.pf-carte--phare .pf-cta--attente::before { background: var(--texte-nuit-doux); }

/* ----------------------------------------------------------- La journée --- */
/* Une chronologie qui se joue seule quand elle entre à l'écran : le trait
   descend, chaque heure s'allume à son tour. Sur UNE colonne, toujours — sur
   deux, l'œil descend la gauche et lit 8 h 13, 9 h 40, 14 h 30 en sautant deux
   heures, et la journée ne se raconte plus. */
.pf-journee { position: relative; display: grid; gap: .7rem; margin: .2rem 0 .3rem; }

.pf-journee::before {
  content: "";
  position: absolute;
  left: 5px;
  top: .6em;
  bottom: .6em;
  width: 2px;
  background: var(--bleu-vif);
  opacity: .3;
  transform-origin: top;
}

.pf-journee__pas {
  position: relative;
  padding-left: 1.8rem;
  color: var(--texte-nuit-doux);
  font-size: .99rem;
  line-height: 1.5;
}

/* L'état masqué n'existe QUE si JS est là — même précaution que les .reveal du
   site : sans script, la chronologie s'affiche entière au lieu de rester
   invisible. C'est le scénario où l'on perd un client, pas une animation. */
html.has-js .pf-journee::before {
  transform: scaleY(0);
  transition: transform 2.4s var(--ease-out);
}
html.has-js .pf-journee.is-on::before { transform: scaleY(1); }

html.has-js .pf-journee__pas {
  opacity: 0;
  transform: translate3d(-10px, 0, 0);
  transition: opacity .55s var(--ease-out), transform .55s var(--ease-out);
  transition-delay: calc(var(--pas, 0) * .38s);
}
html.has-js .pf-journee.is-on .pf-journee__pas { opacity: 1; transform: none; }

/* La pastille est centrée sur le trait : trait à left:5px large de 2px
   (centre 6px) ; pastille de 12px posée à left:0 (centre 6px). */
.pf-journee__pas::before {
  content: "";
  position: absolute;
  left: 0;
  top: .48em;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bleu-nuit);
  border: 2px solid var(--bleu-vif);
}
html.has-js .pf-journee__pas::before {
  transform: scale(0);
  transition: transform .45s var(--ease-out);
  transition-delay: calc(var(--pas, 0) * .38s + .1s);
}
html.has-js .pf-journee.is-on .pf-journee__pas::before { transform: scale(1); }

.pf-journee__h {
  display: inline-block;
  margin-right: .5rem;
  font-family: var(--mono);
  font-size: .82rem;
  font-weight: 500;
  letter-spacing: .04em;
  color: #fff;
}

/* ------------------------------------------------------------- Principes -- */
.pf-principe {
  padding: clamp(1.4rem, 3vw, 1.9rem);
  background: var(--voile);
  border: 1px solid var(--ligne);
  border-radius: var(--r-md);
  transition: transform .4s var(--ease-out), box-shadow .4s var(--ease-out);
}
.pf-principe:hover { transform: translateY(-4px); box-shadow: var(--ombre-m); }
.pf-principe__n { display: block; color: var(--bleu); margin-bottom: .7rem; }
.pf-principe p { margin-top: .5rem; color: var(--ardoise); font-size: .99rem; }

/* Bouton fantôme sur fond nuit : le blanc du .btn--ghost y disparaîtrait. */
.pf-btn-nuit { background: transparent; color: var(--texte-nuit); border-color: var(--ligne-nuit); }
.pf-btn-nuit:hover { background: rgba(255, 255, 255, .07); color: #fff; border-color: var(--texte-nuit-doux); }

/* ------------------------------------------------------------ Responsive -- */
/* Sous 760 px la scène passe sous le texte et se centre : côte à côte, il ne
   resterait ni assez de largeur pour la phrase, ni assez pour le curseur. */
@media (max-width: 760px) {
  .pf-invite { flex-direction: column; align-items: flex-start; text-align: left; }
  .pf-invite__texte { max-width: none; }
  .pf-invite__scene { align-self: center; }
}

@media (max-width: 560px) {
  .pf-chip { font-size: .9rem; padding: .55rem .9rem; }
  .pf-stats { gap: 1.4rem 2rem; }
  .pf-carte__pied { flex-direction: column; align-items: flex-start; }
  .pf-journee__pas { font-size: .95rem; }
}

/* -------------------------------------------------------- Reduced motion -- */
/* Tout est coupé d'un bloc : les chronologies et les cascades s'affichent
   d'emblée dans leur état final, jamais masquées. */
@media (prefers-reduced-motion: reduce) {
  .pf-hero__glow,
  .pf-invite__halo,
  .pf-invite__carte,
  .pf-invite__onde,
  .pf-invite__fleche,
  .pf-wow__marque::after { animation: none; }
  /* La flèche s'immobilise sur la carte plutôt que de disparaître (son état à
     0 % est opacity: 0), sinon la scène paraîtrait vide et cassée. */
  .pf-invite__fleche { transform: translate3d(48px, 36px, 0); opacity: 1; }
  .pf-invite__onde { opacity: 0; }

  .pf-monte { animation: none; opacity: 1; transform: none; }

  .pf-journee::before { transform: scaleY(1); transition: none; }
  .pf-journee__pas { opacity: 1; transform: none; transition: none; }
  .pf-journee__pas::before { transform: scale(1); transition: none; }

  html.has-js .pf-carte { transition-delay: 0s; }

  .pf-chip,
  .pf-carte__inner,
  .pf-principe,
  .pf-cta--ouvrir::after { transition: none; }
  .pf-chip:hover,
  .pf-carte:hover .pf-carte__inner,
  .pf-principe:hover { transform: none; }
}
