:root {
  color-scheme: light;
}

html.dark {
  color-scheme: dark;
}

body {
  transition: background-color 300ms ease, color 300ms ease;
}

body.page-enter {
  opacity: 0;
  animation: pageIn 700ms ease forwards;
}

@keyframes pageIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

#siteHeader.scrolled {
  margin-top: 0;
  border-radius: 0;
  width: 100%;
  max-width: 100%;
  border-color: rgba(62, 59, 47, 0.08);
  background: rgba(245, 237, 224, 0.98);
  box-shadow: 0 15px 35px rgba(62, 59, 47, 0.12);
}

.nav-link {
  position: relative;
  color: rgba(62, 59, 47, 0.88);
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: #bf440b;
  transition: width 250ms ease;
}

.nav-link:hover::after,
.nav-link:focus-visible::after {
  width: 100%;
}

.acacia {
  animation: sway 7s ease-in-out infinite;
  transform-origin: center bottom;
}

@keyframes sway {
  0%, 100% { transform: rotate(-1deg); }
  50% { transform: rotate(2deg); }
}

.reveal {
  opacity: 0;
  transform: translateY(25px);
  transition: 700ms ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.tilt-card {
  transition: transform 260ms ease, box-shadow 260ms ease;
  transform-style: preserve-3d;
}

.tilt-card:hover {
  transform: perspective(1200px) rotateX(6deg) rotateY(-6deg) translateY(-6px);
  box-shadow: 0 30px 50px rgba(166, 139, 91, 0.3);
}

.animal-icon svg {
  width: 52px;
  height: 52px;
  stroke: #6b6f3a;
  stroke-width: 1.8;
  fill: none;
  animation: breathe 4s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.07); opacity: 1; }
}

.destination-carousel::-webkit-scrollbar {
  height: 8px;
}

.destination-carousel::-webkit-scrollbar-thumb {
  background: rgba(166, 139, 91, 0.6);
  border-radius: 999px;
}

.destination-carousel article {
  min-width: min(300px, 85vw);
}

.filter-btn {
  border: 1px solid rgba(62, 59, 47, 0.2);
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.86rem;
  transition: all 220ms ease;
}

.filter-btn.active,
.filter-btn:hover {
  background: linear-gradient(120deg, #6b6f3a, #bf440b);
  border-color: transparent;
  color: white;
}

.safari-card {
  border-radius: 1.5rem;
  overflow: hidden;
  border: 1px solid rgba(62, 59, 47, 0.12);
  background: white;
  box-shadow: 0 10px 24px rgba(62, 59, 47, 0.08);
  transition: transform 250ms ease, box-shadow 250ms ease;
}

.safari-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 18px 40px rgba(166, 139, 91, 0.25);
}

.safari-card img {
  width: 100%;
  height: 230px;
  object-fit: cover;
}

.safari-card .content {
  padding: 1.15rem;
}

.safari-card .content h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
}

.safari-card .content p {
  margin-top: 0.4rem;
  color: rgba(62, 59, 47, 0.8);
  font-size: 0.94rem;
}

.gallery-image {
  transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1), filter 300ms ease;
}

.gallery-item:hover .gallery-image {
  transform: scale(1.06);
  filter: saturate(1.08) contrast(1.04);
}

.gallery-modern-item {
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  transition: opacity 600ms ease, transform 600ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 300ms ease;
  transition-delay: calc(var(--delay) * 40ms);
}

.gallery-modern-item.gallery-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.gallery-modern-item:hover {
  box-shadow: 0 18px 35px rgba(46, 42, 31, 0.18);
}

img.lazy-media {
  filter: blur(10px);
  transform: scale(1.02);
  transition: filter 420ms ease, transform 420ms ease, opacity 420ms ease;
  opacity: 0.92;
}

img.lazy-media.media-ready {
  filter: blur(0);
  transform: scale(1);
  opacity: 1;
}

.floating-cta {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 40;
}

.social-float-rail {
  position: fixed;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 45;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(62, 59, 47, 0.2);
  background: rgba(245, 237, 224, 0.76);
  backdrop-filter: blur(10px);
  box-shadow: 0 14px 35px rgba(46, 42, 31, 0.2);
  animation: socialRailIn 700ms ease both, socialPulse 4.2s ease-in-out 900ms infinite;
}

@keyframes socialRailIn {
  from {
    opacity: 0;
    transform: translateY(-50%) translateX(-14px);
  }
  to {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
}

@keyframes socialPulse {
  0%, 100% {
    box-shadow: 0 14px 35px rgba(46, 42, 31, 0.2);
    border-color: rgba(62, 59, 47, 0.2);
  }
  50% {
    box-shadow: 0 20px 38px rgba(166, 139, 91, 0.32);
    border-color: rgba(166, 139, 91, 0.45);
  }
}

.social-float-link {
  width: 2.45rem;
  height: 2.45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #f5ede0;
  box-shadow: 0 8px 20px rgba(46, 42, 31, 0.25);
  transition: transform 220ms ease, box-shadow 220ms ease, filter 220ms ease;
}

.social-float-link svg {
  width: 1.15rem;
  height: 1.15rem;
}

.social-call-menu {
  position: relative;
  list-style: none;
}

.social-call-menu > summary {
  list-style: none;
}

.social-call-menu > summary::-webkit-details-marker {
  display: none;
}

.social-call-options {
  position: absolute;
  left: calc(100% + 0.6rem);
  top: 50%;
  transform: translateY(-50%);
  min-width: 9.5rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(62, 59, 47, 0.2);
  background: rgba(245, 237, 224, 0.96);
  box-shadow: 0 12px 26px rgba(46, 42, 31, 0.22);
  overflow: hidden;
}

.social-call-options a {
  display: block;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #3e3b2f;
  transition: background-color 200ms ease, color 200ms ease;
}

.social-call-options a + a {
  border-top: 1px solid rgba(62, 59, 47, 0.12);
}

.social-call-options a:hover,
.social-call-options a:focus-visible {
  background: linear-gradient(135deg, rgba(166, 139, 91, 0.18), rgba(191, 68, 11, 0.15));
  color: #2e2a1f;
}

.social-float-link:hover,
.social-float-link:focus-visible {
  transform: translateX(-3px) scale(1.08);
  box-shadow: 0 10px 25px rgba(46, 42, 31, 0.35);
  filter: saturate(1.15);
}

.social-whatsapp {
  background: linear-gradient(135deg, #6b6f3a, #a68b5b);
}

.social-instagram {
  background: linear-gradient(135deg, #bf440b, #a68b5b);
}

.social-call {
  background: linear-gradient(135deg, #3e3b2f, #6b6f3a);
}

.cursor-trail-dot {
  position: fixed;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(194, 178, 128, 0.5);
  pointer-events: none;
  z-index: 20;
}

#themeToggle {
  transition: transform 220ms ease, background-color 220ms ease, color 220ms ease, box-shadow 220ms ease;
}

#themeToggle:hover {
  transform: translateY(-2px) scale(1.03);
}

#themeToggle.active-theme {
  background: linear-gradient(135deg, #3e3b2f, #2e2a1f);
  color: #f5ede0;
  border-color: rgba(245, 237, 224, 0.3);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
}

#themeToggleIcon {
  font-size: 1.05rem;
  line-height: 1;
}

html.dark body {
  background: #2e2a1f;
  color: #f5ede0;
}

html.dark #siteHeader.scrolled {
  background: rgba(46, 42, 31, 0.96);
  border-color: rgba(245, 237, 224, 0.1);
}

html.dark .nav-link,
html.dark .text-bark,
html.dark p,
html.dark h1,
html.dark h2,
html.dark h3,
html.dark h4 {
  color: #f5ede0 !important;
}

html.dark .bg-white,
html.dark .bg-white\/70,
html.dark .bg-white\/80,
html.dark .bg-white\/75,
html.dark .bg-white\/90 {
  background-color: rgba(62, 59, 47, 0.95) !important;
}

html.dark .border-bark\/10,
html.dark .border-bark\/20 {
  border-color: rgba(245, 237, 224, 0.16) !important;
}

html.dark .social-float-rail {
  background: rgba(46, 42, 31, 0.85);
  border-color: rgba(245, 237, 224, 0.2);
}

html.dark .social-call-options {
  background: rgba(46, 42, 31, 0.98);
  border-color: rgba(245, 237, 224, 0.2);
}

html.dark .social-call-options a {
  color: #f5ede0;
}

html.dark .social-call-options a + a {
  border-top-color: rgba(245, 237, 224, 0.14);
}

#ugandaMap {
  z-index: 1;
}

.leaflet-container {
  border-radius: 1.5rem;
}

@media (max-width: 768px) {
  .hero h1 {
    font-size: clamp(2rem, 8vw, 2.8rem);
  }

  .floating-cta {
    right: 1rem;
    bottom: 4.2rem;
  }

  #themeToggle {
    width: 2.75rem;
    height: 2.75rem;
    left: 1rem;
    bottom: 1rem;
  }

  #siteHeader.scrolled {
    width: 100%;
  }

  .social-float-rail {
    top: 50%;
    bottom: auto;
    left: auto;
    right: 1rem;
    transform: translateY(-50%);
    flex-direction: column;
    border-radius: 999px;
    animation: socialPulse 4.2s ease-in-out infinite;
    padding: 0.32rem;
    gap: 0.3rem;
    opacity: 0.8;
  }

  .social-float-link {
    width: 2rem;
    height: 2rem;
  }

  .social-float-link svg {
    width: 0.9rem;
    height: 0.9rem;
  }

  .social-call-options {
    right: calc(100% + 0.6rem);
    left: auto;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
  }

  .social-float-link:hover,
  .social-float-link:focus-visible {
    transform: scale(1.05);
  }
}

@media (max-width: 480px) {
  .tilt-card:hover,
  .safari-card:hover {
    transform: none;
  }
}

@media (min-width: 1800px) {
  html {
    font-size: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
