/* =========================================================================
   Appaji Foundation — Seamless & Satisfying Multi-Page Transition System
   Designed for silky-smooth dissolves, zero jarring shift, and anchored header.
   ========================================================================= */

/* Native CSS View Transitions (Chrome 111+, Edge 111+, Safari 18+) */
@view-transition {
  navigation: auto;
}

/* Anchored Persistent Header — Stays rock-solid while page content transitions */
.header-section-1 {
  view-transition-name: main-site-header;
}

/* Seamless Ambient Dissolve */
::view-transition-old(root) {
  animation: 180ms cubic-bezier(0.22, 1, 0.36, 1) both apSeamlessFadeOut;
}

::view-transition-new(root) {
  animation: 240ms cubic-bezier(0.22, 1, 0.36, 1) both apSeamlessFadeIn;
}

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

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

/* Graceful Content Entrance on Page Load */
body {
  opacity: 1;
}

body.page-is-entering {
  animation: apContentReveal 0.24s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes apContentReveal {
  from {
    opacity: 0.25;
  }
  to {
    opacity: 1;
  }
}

/* Micro-interaction: Tactile click feedback on navigation links */
.main-menu ul li a:active,
.off-canvas-menu ul li a:active,
nav a:active {
  transform: scale(0.97);
  transition: transform 0.08s ease;
}

/* Satin Gold Top Loading Accent Bar */
#page-transition-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 2.5px;
  background: linear-gradient(90deg, #FFE175 0%, #FFC003 60%, #FFE175 100%);
  box-shadow: 0 1px 8px rgba(255, 225, 117, 0.45);
  z-index: 99999999;
  transition: width 0.25s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease;
  pointer-events: none;
  opacity: 0;
}

#page-transition-bar.running {
  opacity: 1;
  width: 75%;
  transition: width 0.4s cubic-bezier(0.1, 0.8, 0.2, 1), opacity 0.15s ease;
}

#page-transition-bar.finished {
  opacity: 1;
  width: 100%;
  transition: width 0.12s ease-out, opacity 0.3s ease 0.1s;
}

/* Active navigation link styling with clean golden underline */
.main-menu ul li a.active,
.off-canvas-menu ul li a.active,
nav a.active {
  color: #FFE175 !important;
  font-weight: 700 !important;
  position: relative;
}

.main-menu ul li a.active::after {
  content: '';
  position: absolute;
  bottom: 0px;
  left: 14px;
  right: 14px;
  height: 2px;
  background: #FFE175;
  border-radius: 2px;
}

/* Reduce motion preference */
@media (prefers-reduced-motion: reduce) {
  *,
  ::view-transition-old(root),
  ::view-transition-new(root),
  body.page-is-entering {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
  #page-transition-bar {
    display: none !important;
  }
}
