/* ==========================================================================
   KOCHUMAGIQUE — Floating Glass Navigation Stylesheet (Phase 5 Refined)
   Compact Apple-Inspired Glass Rail (Desktop) / Floating Glass Dock (Mobile)
   ========================================================================== */

:root {
  --nav-rail-w: 48px;
  --nav-item-sz: 38px;
  --nav-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --color-gold: #C5A059;
  --color-gold-glow: rgba(197, 160, 89, 0.35);
  --color-cream: #F6F3E9;
  --color-green: #405751;
  /* Ultra-Clear Transparent White Glass Design Tokens */
  --color-dark-glass: rgba(255, 255, 255, 0.12);
  --color-light-glass: rgba(255, 255, 255, 0.38);
}

/* ==========================================================================
   Desktop Slim Vertical Navigation Rail (Fixed, Stable & Compact)
   ========================================================================== */
.magique-nav {
  position: fixed;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1000;
  pointer-events: auto;
  user-select: none;
}

.nav-capsule {
  position: relative;
  width: var(--nav-rail-w);
  border-radius: 28px;
  padding: 8px 5px;
  background-color: var(--color-light-glass);
  background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.58) 0%, rgba(255, 255, 255, 0.20) 100%);
  backdrop-filter: blur(24px) saturate(190%) contrast(102%) brightness(105%);
  -webkit-backdrop-filter: blur(24px) saturate(190%) contrast(102%) brightness(105%);
  border: 1px solid rgba(255, 255, 255, 0.78);
  box-shadow: 
    0 18px 42px -8px rgba(40, 60, 55, 0.12),
    0 4px 14px -2px rgba(40, 60, 55, 0.05),
    inset 0 1.5px 2px 0 rgba(255, 255, 255, 0.98),
    inset 0 -1px 1px 0 rgba(255, 255, 255, 0.35);
  transition: 
    background-color 0.35s ease,
    background-image 0.35s ease,
    border-color 0.35s ease,
    box-shadow 0.35s ease;
  overflow: visible; /* Allows floating label pills to extend seamlessly */
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Navigation List */
.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  align-items: center;
  padding: 0;
  margin: 0;
}

.nav-item {
  position: relative;
  width: var(--nav-item-sz);
  height: var(--nav-item-sz);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Navigation Interactive Link */
.nav-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--nav-item-sz);
  height: var(--nav-item-sz);
  border-radius: 50%;
  text-decoration: none;
  color: #405751;
  outline: none;
  position: relative;
  background-color: transparent;
  transition: 
    background-color 0.22s var(--nav-ease),
    color 0.22s ease,
    transform 0.2s var(--nav-ease);
}

/* Stationary Centered Icon Container */
.nav-icon-box {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: inherit;
  transition: transform 0.22s var(--nav-ease), color 0.22s ease;
}

.nav-icon {
  width: 19px;
  height: 19px;
  stroke-width: 1.6;
  transition: transform 0.22s var(--nav-ease), stroke 0.22s ease;
}

/* Compact Floating Glass Label Badge (Beside Icon) */
.nav-label {
  position: absolute;
  left: calc(var(--nav-item-sz) + 10px);
  top: 50%;
  transform: translateY(-50%) translateX(-8px);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.55);
  background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.80) 0%, rgba(255, 255, 255, 0.35) 100%);
  backdrop-filter: blur(20px) saturate(190%) contrast(102%) brightness(105%);
  -webkit-backdrop-filter: blur(20px) saturate(190%) contrast(102%) brightness(105%);
  border: 1px solid rgba(255, 255, 255, 0.88);
  color: #405751;
  box-shadow: 
    0 10px 24px -4px rgba(40, 60, 55, 0.12),
    inset 0 1.5px 1.5px 0 rgba(255, 255, 255, 1),
    inset 0 -1px 1px 0 rgba(255, 255, 255, 0.35);
  transition: 
    opacity 0.22s var(--nav-ease),
    transform 0.24s var(--nav-ease);
  will-change: opacity, transform;
}

/* Hover & Focus Smooth Label Reveal */
.nav-link:hover .nav-label,
.nav-link:focus-visible .nav-label {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
  pointer-events: auto;
}

/* Link Hover State: Subtle Circular Background Highlight */
.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.35);
  color: var(--color-gold);
}

.nav-link:hover .nav-icon {
  transform: scale(1.1);
  stroke: var(--color-gold);
}

/* Active State: Restrained Gold Highlight */
.nav-link.active {
  background-color: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.65);
  color: var(--color-gold);
}

.nav-link.active .nav-icon {
  stroke: var(--color-gold);
}

/* Active Dot Indicator */
.nav-indicator-dot {
  position: absolute;
  right: -2px;
  top: 50%;
  transform: translateY(-50%) scale(0);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: var(--color-gold);
  box-shadow: 0 0 6px var(--color-gold-glow);
  opacity: 0;
  transition: transform 0.25s var(--nav-ease), opacity 0.25s ease;
}

.nav-link.active .nav-indicator-dot {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

/* Accessible Keyboard Focus Ring */
.nav-link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--color-gold);
}

/* ==========================================================================
   Cinematic Dark Adaptive Theme (.theme-dark)
   ========================================================================== */
.magique-nav.theme-dark .nav-capsule {
  background-color: var(--color-dark-glass);
  background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.05) 100%);
  border-color: rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(24px) saturate(190%) brightness(110%);
  -webkit-backdrop-filter: blur(24px) saturate(190%) brightness(110%);
  box-shadow: 
    0 18px 40px -8px rgba(0, 0, 0, 0.45),
    0 4px 12px -2px rgba(0, 0, 0, 0.25),
    inset 0 1.5px 2px 0 rgba(255, 255, 255, 0.78),
    inset 0 -1px 1px 0 rgba(255, 255, 255, 0.15);
}

.magique-nav.theme-dark .nav-link {
  color: rgba(255, 255, 255, 0.90);
}

.magique-nav.theme-dark .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.22);
  color: var(--color-gold);
}

.magique-nav.theme-dark .nav-link.active {
  background-color: rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 255, 255, 0.50);
  color: var(--color-gold);
}

.magique-nav.theme-dark .nav-label {
  background: rgba(255, 255, 255, 0.18);
  background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.30) 0%, rgba(255, 255, 255, 0.08) 100%);
  backdrop-filter: blur(20px) saturate(190%) brightness(110%);
  -webkit-backdrop-filter: blur(20px) saturate(190%) brightness(110%);
  border-color: rgba(255, 255, 255, 0.50);
  color: #FFFFFF;
  box-shadow: 
    0 10px 24px -4px rgba(0, 0, 0, 0.45),
    inset 0 1.5px 1.5px 0 rgba(255, 255, 255, 0.85),
    inset 0 -1px 1px 0 rgba(255, 255, 255, 0.15);
}

/* ==========================================================================
   Mobile Responsive Navigation (< 768px): Compact Floating Bottom Dock
   ========================================================================== */
@media (max-width: 767px) {
  .magique-nav {
    left: 50%;
    top: auto;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    width: auto;
    max-width: calc(100vw - 32px);
  }

  .nav-capsule {
    width: auto !important;
    height: 50px;
    padding: 0 10px;
    border-radius: 9999px;
    flex-direction: row;
    box-shadow: 
      0 12px 30px -6px rgba(40, 60, 55, 0.14),
      inset 0 1.5px 1.5px 0 rgba(255, 255, 255, 0.95);
  }

  .nav-list {
    flex-direction: row;
    gap: 6px;
    align-items: center;
    justify-content: center;
  }

  .nav-item {
    width: auto;
    height: auto;
  }

  .nav-link {
    height: 44px;
    width: 44px;
    min-width: 44px;
  }

  .nav-icon {
    width: 20px;
    height: 20px;
  }

  /* Labels hidden on compact mobile dock */
  .nav-label {
    display: none !important;
  }

  .nav-indicator-dot {
    right: auto;
    left: 50%;
    top: auto;
    bottom: 4px;
    transform: translateX(-50%) scale(0);
  }

  .nav-link.active .nav-indicator-dot {
    opacity: 1;
    transform: translateX(-50%) scale(1);
  }

  .magique-nav.theme-dark .nav-capsule {
    box-shadow: 
      0 12px 30px -6px rgba(0, 0, 0, 0.5),
      inset 0 1.5px 1.5px 0 rgba(255, 255, 255, 0.75);
  }
}

/* ==========================================================================
   Reduced Motion Accessibility Override
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .nav-capsule,
  .nav-label,
  .nav-link,
  .nav-icon-box,
  .nav-icon,
  .nav-indicator-dot,
  .goto-portal-pill {
    transition: none !important;
    animation: none !important;
  }
}

/* ==========================================================================
   Fixed "Go to AKJ Company" Portal Navigation Pill
   Ultra-Clear Transparent White Glass Design
   ========================================================================== */
.goto-portal-pill {
  position: fixed;
  top: 28px;
  right: 28px;
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 9999px;
  font-family: var(--font-sans, 'Inter', sans-serif);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  backdrop-filter: blur(24px) saturate(190%) brightness(108%);
  -webkit-backdrop-filter: blur(24px) saturate(190%) brightness(108%);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Dark Theme (Default for #home) */
.goto-portal-pill.theme-dark,
.goto-portal-pill:not(.theme-light) {
  background: rgba(255, 255, 255, 0.14);
  background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.24) 0%, rgba(255, 255, 255, 0.06) 100%);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.42);
  box-shadow: 
    0 10px 25px -5px rgba(0, 0, 0, 0.35),
    inset 0 1.5px 1.5px 0 rgba(255, 255, 255, 0.80);
}

.goto-portal-pill.theme-dark:hover,
.goto-portal-pill:not(.theme-light):hover {
  background: rgba(255, 255, 255, 0.25);
  background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.38) 0%, rgba(255, 255, 255, 0.12) 100%);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.85);
  transform: translateY(-2px);
  box-shadow: 
    0 14px 28px -4px rgba(0, 0, 0, 0.45),
    inset 0 1.5px 1.5px 0 rgba(255, 255, 255, 0.95);
}

/* Light Theme (For #baking, #celebrations, #stitching, #our-story) */
.goto-portal-pill.theme-light {
  background: rgba(255, 255, 255, 0.42);
  background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.68) 0%, rgba(255, 255, 255, 0.24) 100%);
  color: #405751;
  backdrop-filter: blur(24px) saturate(190%) contrast(102%) brightness(105%);
  -webkit-backdrop-filter: blur(24px) saturate(190%) contrast(102%) brightness(105%);
  border: 1px solid rgba(255, 255, 255, 0.80);
  box-shadow: 
    0 12px 28px -5px rgba(40, 60, 55, 0.12),
    inset 0 1.5px 1.5px 0 rgba(255, 255, 255, 1);
}

.goto-portal-pill.theme-light:hover {
  background: rgba(255, 255, 255, 0.65);
  background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.88) 0%, rgba(255, 255, 255, 0.45) 100%);
  color: #162420;
  border-color: rgba(255, 255, 255, 0.98);
  transform: translateY(-2px);
  box-shadow: 
    0 14px 28px -4px rgba(40, 60, 55, 0.18),
    inset 0 1.5px 1.5px 0 rgba(255, 255, 255, 1);
}

.goto-portal-pill svg {
  transition: transform 0.3s ease;
}

.goto-portal-pill:hover svg {
  transform: translateX(-3px);
}

@media (max-width: 767px) {
  .goto-portal-pill {
    top: calc(14px + env(safe-area-inset-top, 0px));
    right: 14px;
    padding: 6px 12px;
    font-size: 8.5px;
    letter-spacing: 0.18em;
  }
}

