/* ==========================================
   PORTFOLIO NAV (TOP CENTER)
========================================== */

.portfolio-nav {
  position: fixed;

  top: 1rem;
  left: 50%;

  transform: translateX(-50%);

  display: flex;
  align-items: center;

  padding: 10px 14px;

  background: rgba(20, 20, 20, 0.88);
  backdrop-filter: blur(14px);

  border-radius: 18px;

  border: 1px solid rgba(244, 187, 0, 0.12);

  z-index: 9998;

  transition:
    top 0.35s ease,
    bottom 0.35s ease,
    opacity 0.35s ease;

  box-shadow:
    0 0 30px rgba(173, 20, 20, 0.15),
    0 0 60px rgba(244, 187, 0, 0.05);
}

/* ==========================================
   COLLAPSED (DESKTOP)
========================================== */

.portfolio-nav.collapsed {
  top: -120px;
  opacity: 0;
}

/* ==========================================
   MENU
========================================== */

.portfolio-nav-menu {
  display: flex;
  align-items: center;
  gap: 10px;

  list-style: none;
  margin: 0;
  padding: 0;
}

/* ==========================================
   LINKS
========================================== */

.portfolio-nav-link {
  position: relative;

  display: flex;
  align-items: center;
  justify-content: center;

  width: 58px;
  height: 58px;

  border-radius: 14px;

  color: rgba(255, 255, 255, 0.65);

  transition: all 0.25s ease;

  text-decoration: none;
}

.portfolio-nav-link svg {
  width: 22px;
  height: 22px;
}

.portfolio-nav-link:hover {
  transform: translateY(-3px);

  color: var(--color-gold);

  background: rgba(244, 187, 0, 0.08);

  box-shadow: 0 0 18px rgba(244, 187, 0, 0.15);
}

/* ==========================================
   TOOLTIP
========================================== */

.portfolio-nav-link span {
  position: absolute;

  top: calc(100% + 10px);
  left: 50%;

  transform: translateX(-50%) translateY(-6px);

  opacity: 0;

  pointer-events: none;

  white-space: nowrap;

  padding: 8px 12px;

  border-radius: 10px;

  background: rgba(15, 17, 21, 0.95);

  border: 1px solid rgba(244, 187, 0, 0.15);

  color: var(--color-gold);

  font-size: 0.85rem;

  transition: 0.25s ease;
}

.portfolio-nav-link:hover span {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==========================================
   ACTIVE STATE
========================================== */

.portfolio-nav-link.active {
  color: white;

  background: linear-gradient(
    135deg,
    var(--color-accent),
    var(--color-accent-dark)
  );

  box-shadow:
    0 0 18px rgba(173, 20, 20, 0.55),
    0 0 40px rgba(173, 20, 20, 0.2);

  transform: scale(1.08);
}

.portfolio-nav-link.active::before {
  content: "";

  position: absolute;
  inset: -3px;

  border-radius: 16px;

  border: 1px solid rgba(244, 187, 0, 0.35);

  animation: activePulse 2s infinite;
}

@keyframes activePulse {
  0% {
    opacity: 0;
    transform: scale(0.95);
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: scale(1.1);
  }
}

/* ==========================================
   SCROLL PROGRESS
========================================== */

.nav-progress {
  position: absolute;

  bottom: 0;
  left: 0;

  height: 3px;
  width: 0;

  border-radius: 10px;

  background: linear-gradient(
    90deg,
    var(--color-gold),
    var(--color-gold-soft)
  );

  transition: width 0.15s linear;
}

/* ==========================================
   GOLD GLOW LINE
========================================== */

.portfolio-nav::before {
  content: "";

  position: absolute;

  left: 0;
  bottom: 0;

  width: 100%;
  height: 2px;

  background: linear-gradient(
    90deg,
    transparent,
    var(--color-gold),
    transparent
  );

  animation: navGlow 4s linear infinite;
}

@keyframes navGlow {
  0%,
  100% {
    opacity: 0.3;
  }

  50% {
    opacity: 1;
  }
}

/* ==========================================
   TOGGLE BUTTON
========================================== */

.nav-toggle {
  position: fixed;

  top: 1.3rem;
  right: 1.3rem;

  width: 46px;
  height: 46px;

  border-radius: 50%;

  border: none;

  background: linear-gradient(
    135deg,
    var(--color-accent),
    var(--color-accent-dark)
  );

  color: white;

  display: flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;

  z-index: 9999;

  box-shadow: 0 0 20px rgba(173, 20, 20, 0.45);

  transition: transform 0.2s ease;
}

.nav-toggle:hover {
  transform: scale(1.05);
}

/* ==========================================
   MOBILE / TABLET
========================================== */

@media (max-width: 991px) {

  .portfolio-nav {
    top: auto;

    bottom: 0.35rem;

    left: 50%;
    transform: translateX(-50%);

    padding: 10px 12px;
  }

  .portfolio-nav.collapsed {
    top: auto;

    bottom: max(0.15rem, env(safe-area-inset-bottom));

    opacity: 0;
  }

  .portfolio-nav-menu {
    gap: 8px;
  }

  .portfolio-nav-link {
    width: 52px;
    height: 52px;
  }

  .portfolio-nav-link span {
    display: none;
  }

  .nav-toggle {
    top: auto;

    bottom: max(0.15rem, env(safe-area-inset-bottom));

    right: 0.75rem;
  }
}