/* ═══════════════════════════════════════════════════════════
   NAVIGATION — Orbital Menu System
   Hupp & Fuller Detailing
   ═══════════════════════════════════════════════════════════ */

.hf-nav {
  --nav-gold: #D3AF37;
  --nav-cream: #F6D97B;
  --nav-black: #050409;
  --nav-white: #F0EDE6;
  --nav-glass: rgba(10, 10, 18, 0.82);
  --nav-glass-border: rgba(211, 175, 55, 0.1);
  --nav-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --nav-ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --nav-btn-size: 56px;
  --nav-top: 28px;
  --nav-right: 28px;
  --nav-orbit-r: 180px;
  --nav-item-size: 62px;
  --nav-icon-size: 22px;
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: none;
}

/* ═══════════════════════════════════
   BACKDROP
   ═══════════════════════════════════ */

.hf-nav__backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    600px circle at 50% 50%,
    rgba(211, 175, 55, 0.04) 0%,
    rgba(5, 4, 9, 0.94) 65%
  );
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 500ms var(--nav-ease);
}

.hf-nav.is-sliding .hf-nav__backdrop {
  opacity: 1;
  pointer-events: auto;
}

/* ═══════════════════════════════════
   TRIGGER BUTTON (Hamburger)
   ═══════════════════════════════════ */

.hf-nav__trigger {
  position: fixed;
  top: var(--nav-top);
  right: var(--nav-right);
  width: var(--nav-btn-size);
  height: var(--nav-btn-size);
  border-radius: 50%;
  border: 1.5px solid var(--nav-glass-border);
  background: var(--nav-glass);
  cursor: pointer;
  z-index: 10002;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
  scale: 1;
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(211, 175, 55, 0.05);
  transition:
    transform 600ms var(--nav-ease),
    scale 150ms ease,
    background 300ms ease,
    border-color 300ms ease,
    box-shadow 300ms ease;
  outline: none;
}

.hf-nav__trigger:hover {
  border-color: rgba(211, 175, 55, 0.25);
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.4),
    0 0 24px rgba(211, 175, 55, 0.1);
}

.hf-nav:not(.is-sliding) .hf-nav__trigger:active {
  scale: 0.9;
}

.hf-nav__trigger:focus-visible {
  outline: 2px solid var(--nav-gold);
  outline-offset: 3px;
}

/* Slide to viewport center */
.hf-nav.is-sliding .hf-nav__trigger {
  transform: translate(
    calc(-50vw + var(--nav-right) + var(--nav-btn-size) / 2),
    calc(50vh - var(--nav-top) - var(--nav-btn-size) / 2)
  );
}

/* Breathing glow when fully open */
.hf-nav.is-open .hf-nav__trigger {
  background: rgba(211, 175, 55, 0.06);
  border-color: rgba(211, 175, 55, 0.3);
  animation: navHubGlow 3.5s ease-in-out infinite;
}

/* ═══════════════════════════════════
   HAMBURGER BARS → X MORPH
   ═══════════════════════════════════ */

.hf-nav__bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--nav-white);
  border-radius: 2px;
  transition:
    transform 400ms var(--nav-ease),
    opacity 300ms ease,
    width 300ms var(--nav-ease),
    background 300ms ease;
  transform-origin: center;
}

.hf-nav__bar:nth-child(2) {
  width: 16px;
}

.hf-nav__trigger:hover .hf-nav__bar:nth-child(2) {
  width: 22px;
}

.hf-nav.is-open .hf-nav__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
  background: var(--nav-gold);
}

.hf-nav.is-open .hf-nav__bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.hf-nav.is-open .hf-nav__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
  background: var(--nav-gold);
}

/* ═══════════════════════════════════
   ORBIT CONTAINER
   ═══════════════════════════════════ */

.hf-nav__orbit {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  z-index: 10001;
  pointer-events: none;
}

.hf-nav.is-open .hf-nav__orbit {
  pointer-events: auto;
}

/* ═══════════════════════════════════
   DECORATIVE RING
   ═══════════════════════════════════ */

.hf-nav__ring {
  position: fixed;
  top: 50%;
  left: 50%;
  width: calc(var(--nav-orbit-r) * 2 + var(--nav-item-size) + 24px);
  height: calc(var(--nav-orbit-r) * 2 + var(--nav-item-size) + 24px);
  border-radius: 50%;
  border: 1px solid rgba(211, 175, 55, 0.05);
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  pointer-events: none;
  z-index: 10001;
  transition:
    transform 650ms var(--nav-ease),
    opacity 500ms ease;
  transition-delay: 0ms;
}

.hf-nav.is-open .hf-nav__ring {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  transition-delay: 80ms;
}

/* ═══════════════════════════════════
   NAV ITEMS — Default (closed)
   ═══════════════════════════════════ */

.hf-nav__item {
  --tx: calc(cos(var(--angle)) * var(--nav-orbit-r));
  --ty: calc(sin(var(--angle)) * var(--nav-orbit-r));
  position: absolute;
  top: 0;
  left: 0;
  width: var(--nav-item-size);
  height: var(--nav-item-size);
  margin-left: calc(var(--nav-item-size) / -2);
  margin-top: calc(var(--nav-item-size) / -2);
  border-radius: 50%;
  background: var(--nav-glass);
  border: 1px solid var(--nav-glass-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--nav-white);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  transform: translate(0px, 0px);
  scale: 0;
  opacity: 0;
  pointer-events: none;
  transition:
    transform 350ms var(--nav-ease),
    scale 350ms var(--nav-ease),
    opacity 300ms var(--nav-ease),
    background 200ms ease,
    border-color 200ms ease,
    box-shadow 200ms ease;
}

/* Closing reverse stagger */
.hf-nav__item:nth-child(1) { transition-delay: 175ms; }
.hf-nav__item:nth-child(2) { transition-delay: 150ms; }
.hf-nav__item:nth-child(3) { transition-delay: 125ms; }
.hf-nav__item:nth-child(4) { transition-delay: 100ms; }
.hf-nav__item:nth-child(5) { transition-delay: 75ms; }
.hf-nav__item:nth-child(6) { transition-delay: 50ms; }
.hf-nav__item:nth-child(7) { transition-delay: 25ms; }
.hf-nav__item:nth-child(8) { transition-delay: 0ms; }

/* ═══════════════════════════════════
   NAV ITEMS — Open state
   ═══════════════════════════════════ */

.hf-nav.is-open .hf-nav__item {
  transform: translate(var(--tx), var(--ty));
  scale: 1;
  opacity: 1;
  pointer-events: auto;
  transition:
    transform 550ms var(--nav-ease-bounce),
    scale 450ms var(--nav-ease-bounce),
    opacity 400ms var(--nav-ease),
    background 200ms ease,
    border-color 200ms ease,
    box-shadow 200ms ease;
}

/* Opening stagger */
.hf-nav.is-open .hf-nav__item:nth-child(1) { transition-delay: 60ms; }
.hf-nav.is-open .hf-nav__item:nth-child(2) { transition-delay: 110ms; }
.hf-nav.is-open .hf-nav__item:nth-child(3) { transition-delay: 160ms; }
.hf-nav.is-open .hf-nav__item:nth-child(4) { transition-delay: 210ms; }
.hf-nav.is-open .hf-nav__item:nth-child(5) { transition-delay: 260ms; }
.hf-nav.is-open .hf-nav__item:nth-child(6) { transition-delay: 310ms; }
.hf-nav.is-open .hf-nav__item:nth-child(7) { transition-delay: 360ms; }
.hf-nav.is-open .hf-nav__item:nth-child(8) { transition-delay: 410ms; }

/* ═══════════════════════════════════
   NAV ITEMS — Hover
   ═══════════════════════════════════ */

.hf-nav.is-open .hf-nav__item:hover {
  scale: 1.08;
  background: rgba(211, 175, 55, 0.1);
  border-color: rgba(211, 175, 55, 0.35);
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.3),
    0 0 24px rgba(211, 175, 55, 0.12);
  transition:
    transform 550ms var(--nav-ease-bounce),
    scale 200ms var(--nav-ease),
    opacity 400ms var(--nav-ease),
    background 200ms ease,
    border-color 200ms ease,
    box-shadow 200ms ease;
  transition-delay: 0ms;
}

.hf-nav__item:focus-visible {
  outline: 2px solid var(--nav-gold);
  outline-offset: 2px;
}

/* ═══════════════════════════════════
   ACTIVE PAGE INDICATOR
   ═══════════════════════════════════ */

.hf-nav__item.is-current {
  border-color: rgba(211, 175, 55, 0.3);
}

.hf-nav__item.is-current::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--nav-gold);
  box-shadow: 0 0 8px rgba(211, 175, 55, 0.5);
}

/* ═══════════════════════════════════
   BOOK NOW — CTA VARIANT
   ═══════════════════════════════════ */

.hf-nav__item.is-cta {
  background: linear-gradient(135deg, rgba(211, 175, 55, 0.15) 0%, rgba(197, 152, 47, 0.1) 100%);
  border-color: rgba(211, 175, 55, 0.25);
}

.hf-nav.is-open .hf-nav__item.is-cta:hover {
  background: linear-gradient(135deg, rgba(211, 175, 55, 0.25) 0%, rgba(197, 152, 47, 0.18) 100%);
  border-color: rgba(211, 175, 55, 0.5);
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.3),
    0 0 30px rgba(211, 175, 55, 0.2);
}

/* ═══════════════════════════════════
   ICON
   ═══════════════════════════════════ */

.hf-nav__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--nav-icon-size);
  height: var(--nav-icon-size);
  color: var(--nav-white);
  transition: color 200ms ease, filter 200ms ease;
}

.hf-nav__icon svg {
  width: 100%;
  height: 100%;
}

.hf-nav__item:hover .hf-nav__icon,
.hf-nav__item.is-cta .hf-nav__icon {
  color: var(--nav-gold);
  filter: drop-shadow(0 0 4px rgba(211, 175, 55, 0.3));
}

/* ═══════════════════════════════════
   LABEL
   ═══════════════════════════════════ */

.hf-nav__label {
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  color: rgba(240, 237, 230, 0.5);
  pointer-events: none;
  opacity: 0;
  transition: opacity 200ms ease, color 200ms ease;
  transition-delay: 0ms;
}

.hf-nav.is-open .hf-nav__label {
  opacity: 1;
  transition: opacity 300ms ease, color 200ms ease;
  transition-delay: 650ms;
}

.hf-nav__item:hover .hf-nav__label {
  color: var(--nav-gold);
}

.hf-nav__item.is-cta .hf-nav__label {
  color: rgba(211, 175, 55, 0.7);
}

/* ═══════════════════════════════════
   KEYFRAMES
   ═══════════════════════════════════ */

@keyframes navHubGlow {
  0%, 100% {
    box-shadow: 0 0 24px rgba(211, 175, 55, 0.1), 0 0 60px rgba(211, 175, 55, 0.03);
  }
  50% {
    box-shadow: 0 0 36px rgba(211, 175, 55, 0.18), 0 0 80px rgba(211, 175, 55, 0.06);
  }
}

/* ═══════════════════════════════════
   SCROLL LOCK
   ═══════════════════════════════════ */

html.hf-nav-locked {
  overflow: hidden !important;
}

html.hf-nav-locked body {
  overflow: hidden !important;
  touch-action: none;
}

/* ═══════════════════════════════════
   RESPONSIVE — Tablet (≤ 900px)
   ═══════════════════════════════════ */

@media (max-width: 900px) {
  .hf-nav {
    --nav-top: 20px;
    --nav-right: 20px;
    --nav-orbit-r: 150px;
    --nav-item-size: 56px;
    --nav-icon-size: 20px;
  }
}

/* ═══════════════════════════════════
   RESPONSIVE — Mobile (≤ 600px)
   ═══════════════════════════════════ */

@media (max-width: 600px) {
  .hf-nav {
    --nav-top: 16px;
    --nav-right: 16px;
    --nav-btn-size: 50px;
    --nav-orbit-r: 115px;
    --nav-item-size: 48px;
    --nav-icon-size: 18px;
  }

  .hf-nav__bar { width: 20px; }
  .hf-nav__bar:nth-child(2) { width: 14px; }

  .hf-nav__label {
    font-size: 0.52rem;
    bottom: -18px;
  }
}

/* ═══════════════════════════════════
   RESPONSIVE — Small mobile (≤ 420px)
   ═══════════════════════════════════ */

@media (max-width: 420px) {
  .hf-nav {
    --nav-orbit-r: 95px;
    --nav-item-size: 42px;
    --nav-icon-size: 16px;
    --nav-btn-size: 46px;
  }

  .hf-nav__bar { width: 18px; }
  .hf-nav__bar:nth-child(2) { width: 12px; }

  .hf-nav__label {
    font-size: 0.48rem;
    bottom: -16px;
  }
}

/* ═══════════════════════════════════
   REDUCED MOTION
   ═══════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  .hf-nav__trigger,
  .hf-nav__item,
  .hf-nav__bar,
  .hf-nav__backdrop,
  .hf-nav__ring,
  .hf-nav__label {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
}
