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%;
}

html {
  scroll-behavior: smooth;
}

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

/* Navbar (vert sur mobile + desktop) */
.navbar-brand {
  color: #6ca16e !important;
  font-size: 1.3rem;
}

.navbar-nav .nav-link {
  color: #6ca16e !important;
  font-weight: 500;
  transition: color 0.3s ease;
}

.navbar-nav .nav-link:active,
.navbar-nav .nav-link:focus,
.navbar-nav .nav-link:hover {
  color: #4e7c5a !important;
  text-decoration: underline;
}

.footer {
  background-color: #f8f9fa;
}

/* 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;
}

@media (max-width: 991.98px) {
  .navbar-brand {
    padding-left: 0.75rem;
    font-size: 1.2rem;
  }

  .navbar-toggler {
    margin-right: 0.75rem;
  }

  .navbar-nav .nav-link {
    font-size: 1.1rem;
  }
}

/* ===================== ANIMATIONS & DYNAMISME ===================== */
:root {
  --green-1: #6ca16e;
  --green-2: #4e7c5a;
  --accent: #ff6600;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
}

.scroll-progress { position: fixed; top: 0; left: 0; width: 100%; height: 4px; z-index: 2000; pointer-events: none; }
.scroll-progress span {
  display: block; height: 100%; width: 100%;
  transform: scaleX(0); transform-origin: left;
  background: linear-gradient(90deg, var(--accent), #ffd166, var(--green-1));
  box-shadow: 0 0 10px rgba(255, 102, 0, .6);
}

.navbar { transition: padding .4s var(--ease-out), box-shadow .4s ease, background-color .4s ease; }
.navbar.navbar-scrolled {
  background-color: rgba(255, 255, 255, .85) !important;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, .08);
}

/* Bandeau défilant */
.orthoptie-icons-banner { overflow: hidden; background: #fff; padding: .6rem 0; border-bottom: 1px solid rgba(108, 161, 110, .2); }
.icons-track { display: flex; gap: 3rem; width: max-content; animation: marquee 30s linear infinite; }
.icons-track i { font-size: 1.5rem; color: var(--green-1); transition: transform .3s var(--ease-out), color .3s ease; }
.icons-track i:hover { transform: scale(1.4) rotate(-10deg); color: var(--accent); }
.orthoptie-icons-banner:hover .icons-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* Hero */
.hero-section, .contact-section {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #6ca16e, #4e7c5a, #3d6b4a, #7fb582);
  background-size: 300% 300%;
  animation: gradientShift 15s ease infinite;
}
.hero-section { min-height: 85vh; display: flex; align-items: center; }
@keyframes gradientShift { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero-glow {
  position: absolute; width: 500px; height: 500px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .18), transparent 70%);
  left: var(--mx, 50%); top: var(--my, 50%);
  transform: translate(-50%, -50%); pointer-events: none;
  transition: left .3s ease-out, top .3s ease-out;
}

.hero-img {
  width: 220px; max-width: 220px; aspect-ratio: 1 / 1; border: 2px solid var(--accent); background: #fff; border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .2); object-fit: cover; margin-bottom: 24px;
  transition: box-shadow .4s ease;
}
.hero-img:hover { box-shadow: 0 20px 45px rgba(0, 0, 0, .3), 0 0 25px rgba(255, 102, 0, .45); }

.profile-wrapper { position: relative; animation: floatY 6s ease-in-out infinite; }
.profile-wrapper::before {
  content: ""; position: absolute; inset: -10px -10px 14px -10px; border-radius: 18px;
  border: 2px solid rgba(255, 255, 255, .6); animation: pulseRing 2.8s ease-out infinite; pointer-events: none;
}
@keyframes floatY { 0%, 100% { translate: 0 0; } 50% { translate: 0 -12px; } }
@keyframes pulseRing { 0% { opacity: .8; transform: scale(.95); } 100% { opacity: 0; transform: scale(1.12); } }

.tilt {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .25s ease-out; will-change: transform;
}

/* Titre lettre par lettre */
.hero-title .char {
  display: inline-block; opacity: 0; transform: translateY(40px) rotateX(-90deg);
  animation: charIn .8s var(--ease-out) forwards;
  animation-delay: calc(var(--i) * 45ms + .2s);
}
@keyframes charIn { to { opacity: 1; transform: translateY(0) rotateX(0); } }

.caret { display: inline-block; margin-left: 2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; }}

/* Liens */
.animated-link {
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 2px; background-position: 0 100%; background-repeat: no-repeat;
  transition: background-size .4s var(--ease-out), color .3s ease;
}
.animated-link:hover { background-size: 100% 2px; color: #ffd166 !important; }
.instagram-link i { display: inline-block; transition: transform .5s var(--ease-out); }
.instagram-link:hover i { transform: rotate(360deg) scale(1.2); }

/* Indicateur de scroll */
.scroll-indicator {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
  width: 28px; height: 46px; border: 2px solid rgba(255, 255, 255, .8); border-radius: 20px;
}
.scroll-indicator span {
  position: absolute; top: 8px; left: 50%; width: 4px; height: 8px; margin-left: -2px;
  border-radius: 2px; background: #fff; animation: scrollDot 1.8s ease-in-out infinite;
}
@keyframes scrollDot { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(18px); } }

/* Titres de section */
.section-title { position: relative; display: inline-block; color: var(--green-2); font-weight: 700; }
.section-title::after {
  content: ""; position: absolute; left: 50%; bottom: -8px; width: 60px; height: 3px; border-radius: 2px;
  background: var(--accent); transform: translateX(-50%) scaleX(0);
  transition: transform .8s var(--ease-out) .3s;
}
.section-title.is-visible::after { transform: translateX(-50%) scaleX(1); }

/* Vidéo */
.video-frame {
  display: inline-block; border-radius: 16px; padding: 4px;
  background: linear-gradient(135deg, var(--green-1), var(--accent), var(--green-2));
  background-size: 200% 200%; animation: gradientShift 6s ease infinite;
  box-shadow: 0 15px 40px rgba(0, 0, 0, .15);
}
.video-frame video { display: block; max-width: 380px; width: 100%; border-radius: 12px; }

/* Boutons */
.btn-animated { position: relative; overflow: hidden; transition: translate .3s var(--ease-out), box-shadow .3s ease, background-color .3s ease, color .3s ease; }
.btn-animated:hover { box-shadow: 0 12px 25px rgba(0, 0, 0, .25); }
.btn-animated i { transition: transform .4s var(--ease-out); }
.btn-animated:hover i { transform: scale(1.25) rotate(-8deg); }
.magnetic { transition: translate .3s var(--ease-out); }
.ripple {
  position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .5);
  transform: scale(0); animation: ripple .6s linear; pointer-events: none;
}
@keyframes ripple { to { transform: scale(4); opacity: 0; } }

/* Révélation au scroll */
.reveal {
  opacity: 0; transform: translateY(40px);
  transition: opacity .9s var(--ease-out), transform .9s var(--ease-out), translate .3s var(--ease-out), box-shadow .3s ease, background-color .3s ease, color .3s ease;
  transition-delay: var(--delay, 0s), var(--delay, 0s), 0s, 0s, 0s, 0s;
}
.reveal-left { transform: translateX(-60px); }
.reveal-right { transform: translateX(60px); }
.reveal-zoom { transform: scale(.85); }
.reveal.is-visible { opacity: 1; transform: none; }

/* Icônes de fond en parallaxe */
.orthoptie-icons-bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.orthoptie-icons-bg i { position: absolute; font-size: 5rem; color: rgba(108, 161, 110, .07); will-change: transform; }
.orthoptie-icons-bg i:nth-child(1) { top: 10%; left: 5%; }
.orthoptie-icons-bg i:nth-child(2) { top: 30%; right: 8%; }
.orthoptie-icons-bg i:nth-child(3) { top: 55%; left: 12%; }
.orthoptie-icons-bg i:nth-child(4) { top: 75%; right: 15%; }
.orthoptie-icons-bg i:nth-child(5) { top: 90%; left: 40%; }
.orthoptie-icons-bg i:nth-child(6) { top: 45%; left: 50%; }

@media (max-width: 991.98px) {
  .hero-section { min-height: auto; padding-bottom: 5rem !important; }
  .hero-glow { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal, .hero-title .char { opacity: 1 !important; transform: none !important; }
}