html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #333;
  margin-bottom: 60px;
}

.navbar-brand {
  color: #667eea !important;
  font-size: 1.3rem;
}

.nav-link {
  font-weight: 500;
  transition: color 0.3s ease;
}

.nav-link:hover {
  color: #667eea !important;
}

.language-switch .btn {
  min-width: 92px;
}

.footer {
  background-color: #f8f9fa;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Custom gap utility for older browsers */
.gap-2 {
  gap: 0.5rem;
}

.gap-3 {
  gap: 1rem;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

:root {
  --accent-1: #667eea;
  --accent-2: #764ba2;
  --accent-3: #f093fb;
  --accent-4: #ff6600;
  --ease-smooth: cubic-bezier(.22, 1, .36, 1);
}

body {
  -webkit-font-smoothing: antialiased;
  line-height: 1.65;
}

/* Barre de progression de lecture */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  z-index: 2000;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-3), var(--accent-4));
  transition: width .1s linear;
}

/* Navbar en verre dépoli */
header .navbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  transition: background-color .4s var(--ease-smooth), box-shadow .4s var(--ease-smooth);
}

header {
  position: sticky;
  top: 0;
  z-index: 1030;
}

header .navbar.navbar-scrolled {
  background-color: rgba(255, 255, 255, .75) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 6px 24px rgba(102, 126, 234, .15);
}

/* Hero : dégradé animé */
.hero-section {
  position: relative;
  overflow: hidden;
  background: linear-gradient(-45deg, #667eea, #764ba2, #8e54e9, #4776e6) !important;
  background-size: 400% 400% !important;
  animation: heroGradient 16s ease infinite;
}

.hero-section > .container {
  position: relative;
  z-index: 2;
}

@keyframes heroGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Blobs lumineux */
.hero-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: .45;
  z-index: 1;
  pointer-events: none;
  animation: blobMove 18s ease-in-out infinite alternate;
}

.hero-blob.b1 { width: 380px; height: 380px; background: #f093fb; top: -120px; left: -100px; }
.hero-blob.b2 { width: 320px; height: 320px; background: #4facfe; bottom: -140px; right: 10%; animation-delay: -6s; }
.hero-blob.b3 { width: 220px; height: 220px; background: #ffb347; top: 30%; left: 45%; opacity: .25; animation-delay: -12s; }

@keyframes blobMove {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 40px) scale(1.15); }
  100% { transform: translate(-40px, 20px) scale(.9); }
}

/* Stickers flottants */
.hero-sticker {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  padding: .35rem .7rem;
  border-radius: 999px;
  font-family: Consolas, 'Courier New', monospace;
  font-weight: 700;
  font-size: .9rem;
  color: #fff;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .3);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .12);
  animation: stickerFloat 7s ease-in-out infinite;
  white-space: nowrap;
}

@keyframes stickerFloat {
  0%, 100% { transform: translateY(0) rotate(var(--rot, 0deg)); }
  50% { transform: translateY(-18px) rotate(calc(var(--rot, 0deg) * -1)); }
}

@media (max-width: 991px) {
  .hero-blob { opacity: .3; }

  .hero-section {
    flex-direction: column;
  }

  .hero-section > .container {
    width: 100%;
  }

  .hero-stickers {
    position: relative;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: .4rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, .25);
    pointer-events: auto;
    inset: auto;
    order: 5;
  }

  .hero-stickers .hero-sticker {
    position: static !important;
    top: auto !important;
    left: auto !important;
    animation: none !important;
    white-space: normal;
    font-size: .78rem;
    padding: .3rem .6rem;
  }
}

/* Image SDK dynamique */
.hero-avatar-wrap {
  position: relative;
  display: inline-block;
  perspective: 800px;
}

.hero-avatar-wrap::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 20px;
  background: conic-gradient(from 0deg, var(--accent-3), var(--accent-1), #4facfe, var(--accent-4), var(--accent-3));
  animation: ringSpin 6s linear infinite;
  filter: blur(2px);
  z-index: -1;
}

@keyframes ringSpin {
  to { transform: rotate(360deg); }
}

img.hero-avatar {
  display: block;
  position: relative;
  max-width: 200px !important;
  transition: transform .5s var(--ease-smooth), box-shadow .5s var(--ease-smooth);
  animation: avatarFloat 5s ease-in-out infinite;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .25);
  will-change: transform;
}

@keyframes avatarFloat {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -10px; }
}

/* QR code */
img.hero-qr {
  transition: transform .4s var(--ease-smooth), box-shadow .4s var(--ease-smooth);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .2);
}

img.hero-qr:hover {
  transform: scale(1.05) rotate(-1deg);
  box-shadow: 0 18px 40px rgba(255, 102, 0, .35);
}

/* Icônes tech */
.hero-section .bi,
.hero-section span[title] svg {
  transition: transform .35s var(--ease-smooth), filter .35s ease;
}

.hero-section .bi:hover,
.hero-section span[title]:hover svg {
  transform: translateY(-6px) scale(1.15);
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .3));
}

/* Titre avec reflet */
.hero-section h1 {
  background: linear-gradient(90deg, #fff 0%, #ffe3fb 40%, #fff 60%, #d6e4ff 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shine 6s linear infinite;
  text-shadow: none;
}

@keyframes shine {
  to { background-position: 200% center; }
}

/* Cartes plus claires */
.card {
  border-radius: 16px !important;
  overflow: hidden;
}

.card::before {
  content: '';
  display: block;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2), var(--accent-3));
}

.badge {
  font-weight: 500;
  letter-spacing: .2px;
}

.badge.bg-primary {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2)) !important;
}

.badge.bg-secondary {
  background-color: #eef0fb !important;
  color: #4b4f7a !important;
  border: 1px solid #dde1f7;
}

/* Révélation au scroll */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .8s var(--ease-smooth), transform .8s var(--ease-smooth);
}

.reveal.revealed {
  opacity: 1;
  transform: none;
}

/* Séparateur vague sous le hero */
.hero-wave {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 60px;
  z-index: 2;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .reveal { opacity: 1; transform: none; }
}