/* ============================================================
   PREMIUM LAYER — Ouzéfi Portfolio
   Palette : indigo profond (#6366f1) + lilas (#a78bfa) sur noir #030712
   Style : Linear / Vercel / Stripe — sobriété + micro-détails
   ============================================================ */

:root {
  --pf-accent: #6366f1;
  --pf-accent-soft: #818cf8;
  --pf-accent-bright: #a5b4fc;
  --pf-lilac: #a78bfa;
  --pf-bg: #030712;
  --pf-card: rgba(17, 24, 39, 0.7);
  --pf-border: rgba(255, 255, 255, 0.08);
}

/* ── 1. Scroll progress bar (top, 2px, indigo) ───────────── */
#pf-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--pf-accent), var(--pf-lilac));
  z-index: 9999;
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.55);
  transition: width 120ms cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

/* ── 2. Reveal on scroll (fade + rise, staggered) ────────── */
[data-pf-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--pf-delay, 0ms);
  will-change: opacity, transform;
}
[data-pf-reveal].pf-in {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  [data-pf-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ── 3. Spotlight cards (glow qui suit la souris — Linear) ─ */
.pf-spot {
  position: relative;
  overflow: hidden;
}
.pf-spot::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    420px circle at var(--pf-mx, 50%) var(--pf-my, 50%),
    rgba(99, 102, 241, 0.13),
    transparent 62%
  );
  opacity: 0;
  transition: opacity 0.45s ease;
  pointer-events: none;
  z-index: 0;
}
.pf-spot:hover::before {
  opacity: 1;
}
.pf-spot > * {
  position: relative;
  z-index: 1;
}

/* ── 4. Gradient text animé (shimmer lent sur les accents) ─ */
.pf-shimmer-text {
  background: linear-gradient(
    110deg,
    var(--pf-accent-bright) 20%,
    #ffffff 42%,
    var(--pf-lilac) 58%,
    var(--pf-accent-bright) 80%
  );
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: pf-shimmer 7s ease-in-out infinite;
}
@keyframes pf-shimmer {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}
@media (prefers-reduced-motion: reduce) {
  .pf-shimmer-text { animation: none; }
}

/* ── 5. Magnetic CTA (le bouton suit légèrement le curseur) ─ */
.pf-magnetic {
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

/* ── 6. Tilt 3D léger (cartes projects) ──────────────────── */
.pf-tilt {
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  transform-style: preserve-3d;
  will-change: transform;
}

/* ── 7. Grain overlay premium (texture film) ─────────────── */
#pf-grain {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: 0.032;
  mix-blend-mode: overlay;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="180" height="180"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="2" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23n)"/></svg>');
}

/* ── 8. Counter stat animé — tabular nums pour éviter le jitter ─ */
.pf-counter {
  font-variant-numeric: tabular-nums;
}

/* ── 9. Focus rings premium (accessibilité = premium) ────── */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--pf-accent-soft);
  outline-offset: 3px;
  border-radius: 8px;
}

/* ── 10. Sélection texte à la couleur du site ────────────── */
::selection {
  background: rgba(99, 102, 241, 0.45);
  color: #ffffff;
}

/* ── 11. Smooth scroll (ancres) ──────────────────────────── */
html {
  scroll-behavior: smooth;
}