*, *::before, *::after {
  box-sizing: border-box;
}

.mobile-nav {
  display: none;
}

@media (max-width: 720px) and (hover: none) and (pointer: coarse) {
  .mobile-nav {
    position: fixed;
    bottom: calc(16px + env(safe-area-inset-bottom));
    
    left: 50%;
    transform: translateX(-50%) translateZ(0);
    
    width: calc(100% - 40px);
    max-width: 400px;
    
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    z-index: 100;
    pointer-events: none; 
    
    background-color: color-mix(in srgb, var(--color-mobile-nav) 85%, transparent);
    border-radius: 999px; 
    border: 4px solid var(--color-button-border);
    box-shadow: var(--shadow-md) var(--color-button-base-shadow);
    overflow: hidden;

    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  .mobile-nav-container {
    position: relative;
    display: flex;
    align-items: stretch;
    justify-content: space-evenly;
    width: 100%;
    min-height: 56px;
    pointer-events: auto;
    padding: 0;
    gap: 4px;
  }

  .mobile-nav-button {
    flex: 1; 
    height: auto;
    background-color: transparent;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 2px 0;
    transition: all 0.3s ease;
    border-radius: 999px;
  }

  .mobile-nav-button.active-tab {
    background: linear-gradient(135deg, color-mix(in srgb, aliceblue 40%, transparent) 0%, color-mix(in srgb, aliceblue 10%, transparent) 100%);
    box-shadow: inset 0 -2px 4px color-mix(in srgb, white 70%, transparent), inset 0 2px 6px var(--color-shadow), 0 -4px 12px rgba(0, 0, 0, 0.1);
  }

  .mobile-nav-icon-container {
    position: relative;
    height: 24px;
    width: 24px;
  }

  .mobile-nav-icon {
    position: absolute;
    object-fit: cover;
    height: 100%;
    width: 100%;
    left: 0;
    top: 0;
    opacity: 1;
    transition: opacity 0.2s linear;
  }

  .mobile-nav-icon.inactive {
    opacity: 0;
  }

  .mobile-nav-text {
    color: var(--color-text-dark);
    font-size: var(--font-size-body);
    font-family: var(--font-family-accent);
    transition: color 0.2s ease;
  }

  .mobile-nav-text.inactive {
    color: var(--color-text-inactive);
  }

  .desktop-nav {
    display: none;
  }

  .header-menu-container {
    gap: 0;
  }

  .return-to-top-container {
    bottom: calc(100px + env(safe-area-inset-bottom));
    right: 20px;
    z-index: 99;
  }

  footer {
    padding-bottom: calc(100px + env(safe-area-inset-bottom));
  }
}