/* ========== Base & atmosphère ========== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
  background-color: #0a0f0d;
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(52, 211, 153, 0.16), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 30%, rgba(16, 185, 129, 0.08), transparent 50%),
    radial-gradient(ellipse 50% 35% at 0% 70%, rgba(5, 150, 105, 0.07), transparent 45%),
    linear-gradient(180deg, #0a0f0d 0%, #070b09 100%);
}

.page-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
  background-size: 180px;
  mix-blend-mode: overlay;
}

/* ========== Avatar ========== */
.avatar-ring {
  position: relative;
  padding: 3px;
  border-radius: 9999px;
  background: linear-gradient(145deg, #34d399, #059669 45%, #1e2a25 100%);
  box-shadow: 0 0 32px rgba(52, 211, 153, 0.28);
}

.avatar-ring::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 9999px;
  border: 1px solid rgba(52, 211, 153, 0.2);
  animation: pulse-ring 2.8s ease-in-out infinite;
}

@keyframes pulse-ring {
  0%, 100% { opacity: 0.45; transform: scale(1); }
  50% { opacity: 0.15; transform: scale(1.04); }
}

/* ========== Boutons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 3.25rem;
  padding: 0.85rem 1.35rem;
  border-radius: 9999px;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    color 0.2s ease;
  -webkit-user-select: none;
  user-select: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  color: #062016;
  background: linear-gradient(135deg, #6ee7b7 0%, #34d399 45%, #10b981 100%);
  box-shadow: 0 8px 28px rgba(52, 211, 153, 0.28);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(52, 211, 153, 0.4);
}

.btn-secondary {
  color: #ecfdf5;
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  background: rgba(52, 211, 153, 0.1);
  border-color: rgba(52, 211, 153, 0.35);
  box-shadow: 0 0 20px rgba(52, 211, 153, 0.12);
}

.btn-ghost {
  min-height: 2.6rem;
  padding: 0.55rem 1rem;
  font-size: 0.875rem;
  color: #6ee7b7;
  background: rgba(52, 211, 153, 0.08);
  border-color: rgba(52, 211, 153, 0.22);
  width: 100%;
}

.btn-ghost:hover {
  transform: translateY(-1px);
  background: rgba(52, 211, 153, 0.16);
  border-color: rgba(52, 211, 153, 0.45);
  box-shadow: 0 0 18px rgba(52, 211, 153, 0.15);
}

.btn-icon {
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
}

.btn-icon-sm {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

/* ========== Cartes projets ========== */
.project-card {
  overflow: hidden;
  border-radius: 1.25rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.02) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition:
    transform 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.project-card:hover {
  transform: translateY(-3px);
  border-color: rgba(52, 211, 153, 0.28);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35), 0 0 28px rgba(52, 211, 153, 0.1);
}

.project-media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #16201c;
}

.project-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.project-card:hover .project-media img {
  transform: scale(1.04);
}

.project-body {
  padding: 1.15rem 1.2rem 1.25rem;
}

/* ========== Section QR Code ========== */
.qr-section {
  animation: fade-up 0.55s ease both;
}

.qr-card {
  padding: 1.35rem 1.25rem 1.4rem;
  border-radius: 1.35rem;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, rgba(255, 255, 255, 0.02) 100%);
  border: 1px solid rgba(52, 211, 153, 0.18);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.qr-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem;
  border-radius: 1rem;
  background: #ffffff;
  box-shadow: 0 0 24px rgba(52, 211, 153, 0.18);
}

.qrcode {
  width: 150px;
  height: 150px;
  opacity: 0;
  transform: scale(0.92) translateY(6px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.qrcode.qr-ready {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.qrcode img,
.qrcode canvas,
.qrcode table {
  display: block;
  width: 150px !important;
  height: 150px !important;
  margin: 0 auto;
}

/* ========== Entrée profil ========== */
.profile-enter {
  animation: fade-up 0.7s ease both;
  animation-delay: 0.08s;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Réduction de mouvement */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
